@korsolutions/ui 0.0.51 → 0.0.53
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/AGENTS.md +32 -19
- package/dist/module/components/alert/components/alert-description.js.map +1 -1
- package/dist/module/components/button/components/button-label.js.map +1 -1
- package/dist/module/components/index.js +1 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/input/numeric-input.js +1 -1
- package/dist/module/components/input/numeric-input.js.map +1 -1
- package/dist/module/components/input/variants/default.js +9 -2
- package/dist/module/components/input/variants/default.js.map +1 -1
- package/dist/module/components/input/variants/secondary.js +9 -2
- package/dist/module/components/input/variants/secondary.js.map +1 -1
- package/dist/module/components/link/variants/default.js.map +1 -1
- package/dist/module/components/menu/components/menu-trigger.js +1 -1
- package/dist/module/components/menu/components/menu-trigger.js.map +1 -1
- package/dist/module/components/phone-input/index.js +4 -0
- package/dist/module/components/phone-input/index.js.map +1 -0
- package/dist/module/components/phone-input/phone-input.js +165 -0
- package/dist/module/components/phone-input/phone-input.js.map +1 -0
- package/dist/module/components/phone-input/types.js +4 -0
- package/dist/module/components/phone-input/types.js.map +1 -0
- package/dist/module/components/phone-input/variants/default.js +128 -0
- package/dist/module/components/phone-input/variants/default.js.map +1 -0
- package/dist/module/components/phone-input/variants/index.js +7 -0
- package/dist/module/components/phone-input/variants/index.js.map +1 -0
- package/dist/module/components/select/components/select-trigger.js +2 -2
- package/dist/module/components/select/components/select-trigger.js.map +1 -1
- package/dist/module/components/tabs/variants/default.js.map +1 -1
- package/dist/module/components/toast/components/toast-icon.js.map +1 -1
- package/dist/module/components/toast/manager.js +2 -2
- package/dist/module/components/toast/manager.js.map +1 -1
- package/dist/module/components/typography/variants/body-lg.js.map +1 -1
- package/dist/module/components/typography/variants/body-md.js.map +1 -1
- package/dist/module/components/typography/variants/body-sm.js.map +1 -1
- package/dist/module/components/typography/variants/heading-lg.js.map +1 -1
- package/dist/module/components/typography/variants/heading-md.js.map +1 -1
- package/dist/module/components/typography/variants/heading-sm.js.map +1 -1
- package/dist/module/data/countries.js +476 -0
- package/dist/module/data/countries.js.map +1 -0
- package/dist/module/hooks/index.js +1 -0
- package/dist/module/hooks/index.js.map +1 -1
- package/dist/module/hooks/use-phone-mask.js +121 -0
- package/dist/module/hooks/use-phone-mask.js.map +1 -0
- package/dist/module/hooks/use-relative-position.js.map +1 -1
- package/dist/module/index.js +2 -2
- package/dist/module/index.js.map +1 -1
- package/dist/module/themes/default/colors.js +28 -28
- package/dist/module/themes/default/colors.js.map +1 -1
- package/dist/module/themes/provider.js.map +1 -1
- package/dist/module/themes/utils.js.map +1 -1
- package/dist/module/utils/input-utils.js.map +1 -1
- package/dist/module/utils/normalize-layout.js.map +1 -1
- package/dist/module/utils/use-themed-styles.js.map +1 -1
- package/dist/typescript/src/components/alert/components/alert-body.d.ts.map +1 -1
- package/dist/typescript/src/components/alert/components/alert-description.d.ts +2 -2
- package/dist/typescript/src/components/alert/components/alert-description.d.ts.map +1 -1
- package/dist/typescript/src/components/alert/components/alert-icon.d.ts.map +1 -1
- package/dist/typescript/src/components/alert/components/alert-root.d.ts.map +1 -1
- package/dist/typescript/src/components/alert/components/alert-title.d.ts.map +1 -1
- package/dist/typescript/src/components/alert/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/alert/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/alert/variants/destructive.d.ts +1 -1
- package/dist/typescript/src/components/alert/variants/destructive.d.ts.map +1 -1
- package/dist/typescript/src/components/alert-dialog/components/alert-dialog-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/alert-dialog/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/alert-dialog/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/avatar/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/avatar/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/badge/components/badge-root.d.ts.map +1 -1
- package/dist/typescript/src/components/badge/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/badge/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/badge/variants/secondary.d.ts +1 -1
- package/dist/typescript/src/components/badge/variants/secondary.d.ts.map +1 -1
- package/dist/typescript/src/components/button/components/button-label.d.ts +2 -1
- package/dist/typescript/src/components/button/components/button-label.d.ts.map +1 -1
- package/dist/typescript/src/components/button/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/button/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/button/variants/secondary.d.ts +1 -1
- package/dist/typescript/src/components/button/variants/secondary.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/calendar/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/card/card-body.d.ts.map +1 -1
- package/dist/typescript/src/components/card/card-footer.d.ts.map +1 -1
- package/dist/typescript/src/components/card/card-header.d.ts.map +1 -1
- package/dist/typescript/src/components/card/card-root.d.ts.map +1 -1
- package/dist/typescript/src/components/card/card-title.d.ts.map +1 -1
- package/dist/typescript/src/components/card/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/card/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/checkbox/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/checkbox/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/checkbox/variants/outlined.d.ts +1 -1
- package/dist/typescript/src/components/checkbox/variants/outlined.d.ts.map +1 -1
- package/dist/typescript/src/components/empty/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/empty/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/field/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/field/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/icon/icon.d.ts.map +1 -1
- package/dist/typescript/src/components/index.d.ts +1 -0
- package/dist/typescript/src/components/index.d.ts.map +1 -1
- package/dist/typescript/src/components/input/input.d.ts.map +1 -1
- package/dist/typescript/src/components/input/numeric-input.d.ts +1 -1
- package/dist/typescript/src/components/input/numeric-input.d.ts.map +1 -1
- package/dist/typescript/src/components/input/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/input/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/input/variants/secondary.d.ts +1 -1
- package/dist/typescript/src/components/input/variants/secondary.d.ts.map +1 -1
- package/dist/typescript/src/components/link/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-trigger.d.ts +1 -1
- package/dist/typescript/src/components/menu/components/menu-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/context.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/menu/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/phone-input/index.d.ts +3 -0
- package/dist/typescript/src/components/phone-input/index.d.ts.map +1 -0
- package/dist/typescript/src/components/phone-input/phone-input.d.ts +16 -0
- package/dist/typescript/src/components/phone-input/phone-input.d.ts.map +1 -0
- package/dist/typescript/src/components/phone-input/types.d.ts +15 -0
- package/dist/typescript/src/components/phone-input/types.d.ts.map +1 -0
- package/dist/typescript/src/components/phone-input/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/phone-input/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/phone-input/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/phone-input/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/popover/components/popover-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/popover/context.d.ts.map +1 -1
- package/dist/typescript/src/components/popover/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/popover/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/popover/variants/unstyled.d.ts +1 -1
- package/dist/typescript/src/components/popover/variants/unstyled.d.ts.map +1 -1
- package/dist/typescript/src/components/progress/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/progress/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/select/context.d.ts.map +1 -1
- package/dist/typescript/src/components/select/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/select/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/tabs/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/tabs/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/tabs/variants/line.d.ts +1 -1
- package/dist/typescript/src/components/tabs/variants/line.d.ts.map +1 -1
- package/dist/typescript/src/components/textarea/variants/default.d.ts +1 -1
- package/dist/typescript/src/components/textarea/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/toast/components/toast-icon.d.ts +1 -1
- package/dist/typescript/src/components/toast/components/toast-icon.d.ts.map +1 -1
- package/dist/typescript/src/components/toast/manager.d.ts.map +1 -1
- package/dist/typescript/src/components/typography/variants/body-lg.d.ts.map +1 -1
- package/dist/typescript/src/components/typography/variants/body-md.d.ts.map +1 -1
- package/dist/typescript/src/components/typography/variants/body-sm.d.ts.map +1 -1
- package/dist/typescript/src/components/typography/variants/heading-lg.d.ts.map +1 -1
- package/dist/typescript/src/components/typography/variants/heading-md.d.ts.map +1 -1
- package/dist/typescript/src/components/typography/variants/heading-sm.d.ts.map +1 -1
- package/dist/typescript/src/data/countries.d.ts +17 -0
- package/dist/typescript/src/data/countries.d.ts.map +1 -0
- package/dist/typescript/src/hooks/index.d.ts +1 -0
- package/dist/typescript/src/hooks/index.d.ts.map +1 -1
- package/dist/typescript/src/hooks/use-phone-mask.d.ts +20 -0
- package/dist/typescript/src/hooks/use-phone-mask.d.ts.map +1 -0
- package/dist/typescript/src/hooks/use-relative-position.d.ts +1 -1
- package/dist/typescript/src/hooks/use-relative-position.d.ts.map +1 -1
- package/dist/typescript/src/index.d.ts +2 -2
- package/dist/typescript/src/index.d.ts.map +1 -1
- package/dist/typescript/src/themes/provider.d.ts +1 -1
- package/dist/typescript/src/themes/provider.d.ts.map +1 -1
- package/dist/typescript/src/themes/types.d.ts +1 -1
- package/dist/typescript/src/themes/types.d.ts.map +1 -1
- package/dist/typescript/src/themes/utils.d.ts.map +1 -1
- package/dist/typescript/src/utils/input-utils.d.ts.map +1 -1
- package/dist/typescript/src/utils/normalize-layout.d.ts +1 -1
- package/dist/typescript/src/utils/normalize-layout.d.ts.map +1 -1
- package/dist/typescript/src/utils/use-themed-styles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/alert/components/alert-body.tsx +1 -1
- package/src/components/alert/components/alert-description.tsx +5 -3
- package/src/components/alert/components/alert-icon.tsx +1 -1
- package/src/components/alert/components/alert-root.tsx +1 -1
- package/src/components/alert/components/alert-title.tsx +2 -2
- package/src/components/alert/variants/default.tsx +2 -2
- package/src/components/alert/variants/destructive.tsx +2 -2
- package/src/components/alert-dialog/components/alert-dialog-trigger.tsx +1 -1
- package/src/components/alert-dialog/variants/default.tsx +2 -2
- package/src/components/avatar/variants/default.tsx +2 -2
- package/src/components/badge/components/badge-label.tsx +1 -1
- package/src/components/badge/components/badge-root.tsx +2 -2
- package/src/components/badge/variants/default.tsx +2 -2
- package/src/components/badge/variants/secondary.tsx +2 -2
- package/src/components/button/components/button-label.tsx +3 -2
- package/src/components/button/variants/default.tsx +3 -3
- package/src/components/button/variants/secondary.tsx +3 -3
- package/src/components/calendar/components/calendar-day.tsx +1 -1
- package/src/components/calendar/components/calendar-nav-button.tsx +1 -1
- package/src/components/calendar/components/calendar-title.tsx +1 -1
- package/src/components/calendar/components/calendar-weeks.tsx +1 -1
- package/src/components/calendar/variants/default.tsx +2 -2
- package/src/components/card/card-body.tsx +2 -2
- package/src/components/card/card-footer.tsx +2 -2
- package/src/components/card/card-header.tsx +2 -2
- package/src/components/card/card-root.tsx +2 -2
- package/src/components/card/card-title.tsx +3 -3
- package/src/components/card/variants/default.tsx +2 -2
- package/src/components/checkbox/variants/default.tsx +2 -2
- package/src/components/checkbox/variants/outlined.tsx +2 -2
- package/src/components/empty/variants/default.tsx +2 -2
- package/src/components/field/variants/default.tsx +2 -2
- package/src/components/icon/icon.tsx +1 -1
- package/src/components/icon/variants/default.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/input/input.tsx +1 -1
- package/src/components/input/numeric-input.tsx +8 -2
- package/src/components/input/variants/default.tsx +10 -3
- package/src/components/input/variants/secondary.tsx +10 -3
- package/src/components/link/variants/default.tsx +2 -2
- package/src/components/menu/components/menu-content.tsx +1 -1
- package/src/components/menu/components/menu-root.tsx +1 -1
- package/src/components/menu/components/menu-trigger.tsx +40 -38
- package/src/components/menu/context.ts +1 -1
- package/src/components/menu/variants/default.tsx +2 -2
- package/src/components/phone-input/index.ts +2 -0
- package/src/components/phone-input/phone-input.tsx +220 -0
- package/src/components/phone-input/types.ts +20 -0
- package/src/components/phone-input/variants/default.tsx +124 -0
- package/src/components/phone-input/variants/index.ts +5 -0
- package/src/components/popover/components/popover-content.tsx +2 -2
- package/src/components/popover/components/popover-root.tsx +1 -1
- package/src/components/popover/components/popover-trigger.tsx +2 -2
- package/src/components/popover/context.ts +1 -1
- package/src/components/popover/variants/default.tsx +2 -2
- package/src/components/popover/variants/unstyled.tsx +2 -2
- package/src/components/progress/components/progress-indicator.tsx +1 -1
- package/src/components/progress/components/progress-root.tsx +1 -1
- package/src/components/progress/variants/default.tsx +2 -2
- package/src/components/scroll-bar/scroll-bar.tsx +1 -1
- package/src/components/select/components/select-content.tsx +2 -2
- package/src/components/select/components/select-option.tsx +1 -1
- package/src/components/select/components/select-overlay.tsx +1 -1
- package/src/components/select/components/select-root.tsx +2 -2
- package/src/components/select/components/select-trigger.tsx +35 -9
- package/src/components/select/context.ts +1 -1
- package/src/components/select/variants/default.tsx +2 -2
- package/src/components/tabs/variants/default.tsx +2 -2
- package/src/components/tabs/variants/line.tsx +2 -2
- package/src/components/textarea/variants/default.tsx +2 -2
- package/src/components/toast/components/toast-icon.tsx +8 -2
- package/src/components/toast/manager.tsx +11 -4
- package/src/components/toast/variants/danger.tsx +1 -1
- package/src/components/toast/variants/default.tsx +1 -1
- package/src/components/toast/variants/success.tsx +1 -1
- package/src/components/typography/variants/body-lg.tsx +1 -1
- package/src/components/typography/variants/body-md.tsx +1 -1
- package/src/components/typography/variants/body-sm.tsx +1 -1
- package/src/components/typography/variants/heading-lg.tsx +1 -1
- package/src/components/typography/variants/heading-md.tsx +1 -1
- package/src/components/typography/variants/heading-sm.tsx +1 -1
- package/src/data/countries.ts +88 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-phone-mask.ts +183 -0
- package/src/hooks/use-relative-position.ts +94 -18
- package/src/index.tsx +8 -3
- package/src/themes/default/colors.ts +28 -28
- package/src/themes/provider.tsx +23 -5
- package/src/themes/types.ts +1 -1
- package/src/themes/utils.ts +5 -2
- package/src/utils/input-utils.ts +5 -2
- package/src/utils/normalize-layout.ts +5 -2
- package/src/utils/use-themed-styles.ts +11 -3
- package/tsconfig.json +14 -7
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
3
|
+
import type { PhoneInputStyles } from "../types";
|
|
4
|
+
|
|
5
|
+
export function usePhoneInputVariantDefault(): PhoneInputStyles {
|
|
6
|
+
return useThemedStyles(
|
|
7
|
+
({ colors, radius, fontFamily, fontSize }): PhoneInputStyles => ({
|
|
8
|
+
root: {
|
|
9
|
+
default: {
|
|
10
|
+
flexDirection: "row",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
borderWidth: 1,
|
|
13
|
+
borderColor: colors.border,
|
|
14
|
+
borderRadius: radius,
|
|
15
|
+
backgroundColor: colors.surface,
|
|
16
|
+
height: 48,
|
|
17
|
+
overflow: "hidden",
|
|
18
|
+
outlineWidth: 0,
|
|
19
|
+
},
|
|
20
|
+
focused: {
|
|
21
|
+
borderColor: colors.primary,
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
backgroundColor: colors.muted,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
countryButton: {
|
|
28
|
+
default: {
|
|
29
|
+
paddingHorizontal: 12,
|
|
30
|
+
height: "100%",
|
|
31
|
+
justifyContent: "center",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
flexDirection: "row",
|
|
34
|
+
gap: 4,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
countryButtonText: {
|
|
38
|
+
default: {
|
|
39
|
+
fontFamily,
|
|
40
|
+
fontSize,
|
|
41
|
+
color: colors.foreground,
|
|
42
|
+
},
|
|
43
|
+
disabled: {
|
|
44
|
+
color: colors.mutedForeground,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
separator: {
|
|
48
|
+
default: {
|
|
49
|
+
width: 1,
|
|
50
|
+
alignSelf: "center",
|
|
51
|
+
height: "60%",
|
|
52
|
+
backgroundColor: colors.border,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
input: {
|
|
56
|
+
default: {
|
|
57
|
+
flex: 1,
|
|
58
|
+
paddingHorizontal: 12,
|
|
59
|
+
fontFamily,
|
|
60
|
+
fontSize,
|
|
61
|
+
color: colors.foreground,
|
|
62
|
+
height: "100%",
|
|
63
|
+
outlineWidth: 0,
|
|
64
|
+
...Platform.select({
|
|
65
|
+
default: {},
|
|
66
|
+
web: {
|
|
67
|
+
outline: "none",
|
|
68
|
+
},
|
|
69
|
+
}),
|
|
70
|
+
},
|
|
71
|
+
disabled: {
|
|
72
|
+
color: colors.mutedForeground,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
pickerOverlay: {
|
|
76
|
+
default: {},
|
|
77
|
+
},
|
|
78
|
+
pickerContent: {
|
|
79
|
+
default: {
|
|
80
|
+
backgroundColor: colors.surface,
|
|
81
|
+
borderRadius: radius,
|
|
82
|
+
borderWidth: 1,
|
|
83
|
+
borderColor: colors.border,
|
|
84
|
+
padding: 4,
|
|
85
|
+
maxHeight: 300,
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
pickerOption: {
|
|
89
|
+
default: {
|
|
90
|
+
paddingVertical: 10,
|
|
91
|
+
paddingHorizontal: 12,
|
|
92
|
+
borderRadius: radius / 2,
|
|
93
|
+
flexDirection: "row",
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
gap: 8,
|
|
96
|
+
},
|
|
97
|
+
selected: {
|
|
98
|
+
backgroundColor: colors.muted,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
pickerOptionText: {
|
|
102
|
+
default: {
|
|
103
|
+
fontFamily,
|
|
104
|
+
fontSize,
|
|
105
|
+
color: colors.foreground,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
pickerSearch: {
|
|
109
|
+
default: {
|
|
110
|
+
borderWidth: 1,
|
|
111
|
+
borderColor: colors.border,
|
|
112
|
+
borderRadius: radius,
|
|
113
|
+
paddingVertical: 8,
|
|
114
|
+
paddingHorizontal: 12,
|
|
115
|
+
fontFamily,
|
|
116
|
+
fontSize: fontSize * 0.875,
|
|
117
|
+
color: colors.foreground,
|
|
118
|
+
marginBottom: 4,
|
|
119
|
+
outlineWidth: 0,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
}),
|
|
123
|
+
);
|
|
124
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useRelativePosition } from "
|
|
2
|
-
import { useSafeAreaInsets } from "
|
|
1
|
+
import { useRelativePosition } from "../../../hooks/use-relative-position";
|
|
2
|
+
import { useSafeAreaInsets } from "../../../safe-area";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
5
5
|
import { usePopover } from "../context";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_LAYOUT, DEFAULT_POSITION, type LayoutPosition } from "
|
|
1
|
+
import { DEFAULT_LAYOUT, DEFAULT_POSITION, type LayoutPosition } from "../../../hooks/use-relative-position";
|
|
2
2
|
import React, { useState } from "react";
|
|
3
3
|
import { type LayoutRectangle } from "react-native";
|
|
4
4
|
import { PopoverContext } from "../context";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ViewRef } from "
|
|
2
|
-
import { measureLayoutPosition } from "
|
|
1
|
+
import type { ViewRef } from "../../../types/element.types";
|
|
2
|
+
import { measureLayoutPosition } from "../../../utils/normalize-layout";
|
|
3
3
|
import React, { forwardRef, useImperativeHandle, useRef } from "react";
|
|
4
4
|
import { type PressableProps } from "react-native";
|
|
5
5
|
import { usePopover } from "../context";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LayoutPosition } from "
|
|
1
|
+
import type { LayoutPosition } from "../../hooks/use-relative-position";
|
|
2
2
|
import { createContext, type Dispatch, useContext } from "react";
|
|
3
3
|
import type { LayoutRectangle } from "react-native";
|
|
4
4
|
import type { PopoverStyles } from "./types";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type PopoverStyles } from "
|
|
2
|
-
import { useThemedStyles } from "
|
|
1
|
+
import { type PopoverStyles } from "../types";
|
|
2
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
3
3
|
|
|
4
4
|
export const usePopoverVariantDefault = (): PopoverStyles => {
|
|
5
5
|
return useThemedStyles(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type PopoverStyles } from "
|
|
2
|
-
import { useThemedStyles } from "
|
|
1
|
+
import { type PopoverStyles } from "../types";
|
|
2
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
3
3
|
|
|
4
4
|
export const usePopoverVariantUnstyled = (): PopoverStyles => {
|
|
5
5
|
return useThemedStyles(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { calculateComposedStyles } from "
|
|
1
|
+
import { calculateComposedStyles } from "../../../utils/calculate-styles";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
4
4
|
import { useProgress } from "../context";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { calculateComposedStyles } from "
|
|
1
|
+
import { calculateComposedStyles } from "../../../utils/calculate-styles";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
4
4
|
import { ProgressContext } from "../context";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ProgressStyles } from "
|
|
2
|
-
import { useThemedStyles } from "
|
|
1
|
+
import { type ProgressStyles } from "../..";
|
|
2
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
3
3
|
|
|
4
4
|
export const useProgressVariantDefault = (): ProgressStyles => {
|
|
5
5
|
return useThemedStyles(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useRelativePosition } from "
|
|
2
|
-
import { calculateComposedStyles } from "
|
|
1
|
+
import { useRelativePosition } from "../../../hooks/use-relative-position";
|
|
2
|
+
import { calculateComposedStyles } from "../../../utils/calculate-styles";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
5
5
|
import { useSelect } from "../context";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { calculateComposedStyles } from "
|
|
1
|
+
import { calculateComposedStyles } from "../../../utils/calculate-styles";
|
|
2
2
|
import React, { useEffect, useState } from "react";
|
|
3
3
|
import { Pressable, Text } from "react-native";
|
|
4
4
|
import { useSelect } from "../context";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { calculateComposedStyles } from "
|
|
1
|
+
import { calculateComposedStyles } from "../../../utils/calculate-styles";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Pressable, type StyleProp, StyleSheet, type ViewStyle } from "react-native";
|
|
4
4
|
import { useSelect } from "../context";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_LAYOUT, DEFAULT_POSITION, type LayoutPosition } from "
|
|
2
|
-
import { calculateComposedStyles } from "
|
|
1
|
+
import { DEFAULT_LAYOUT, DEFAULT_POSITION, type LayoutPosition } from "../../../hooks";
|
|
2
|
+
import { calculateComposedStyles } from "../../../utils/calculate-styles";
|
|
3
3
|
import React, { useState } from "react";
|
|
4
4
|
import { type LayoutRectangle, type StyleProp, View, type ViewStyle } from "react-native";
|
|
5
5
|
import { SelectContext } from "../context";
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import type { ViewRef } from "@/types/element.types";
|
|
2
|
-
import { calculateComposedStyles } from "@/utils/calculate-styles";
|
|
3
|
-
import { measureLayoutPosition } from "@/utils/normalize-layout";
|
|
4
1
|
import React, { useRef } from "react";
|
|
5
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
Text,
|
|
5
|
+
type StyleProp,
|
|
6
|
+
type TextStyle,
|
|
7
|
+
type ViewStyle,
|
|
8
|
+
} from "react-native";
|
|
9
|
+
import type { ViewRef } from "../../../types/element.types";
|
|
10
|
+
import { calculateComposedStyles } from "../../../utils/calculate-styles";
|
|
11
|
+
import { measureLayoutPosition } from "../../../utils/normalize-layout";
|
|
6
12
|
import { useSelect } from "../context";
|
|
7
13
|
|
|
8
14
|
export interface SelectTriggerProps {
|
|
@@ -14,7 +20,12 @@ export function SelectTrigger(props: SelectTriggerProps) {
|
|
|
14
20
|
const select = useSelect();
|
|
15
21
|
const triggerRef = useRef<ViewRef>(null);
|
|
16
22
|
|
|
17
|
-
const composedStyles = calculateComposedStyles(
|
|
23
|
+
const composedStyles = calculateComposedStyles(
|
|
24
|
+
select.styles,
|
|
25
|
+
select.state,
|
|
26
|
+
"trigger",
|
|
27
|
+
props.style,
|
|
28
|
+
);
|
|
18
29
|
|
|
19
30
|
const onTriggerPress = () => {
|
|
20
31
|
if (!select.isOpen) {
|
|
@@ -28,7 +39,12 @@ export function SelectTrigger(props: SelectTriggerProps) {
|
|
|
28
39
|
};
|
|
29
40
|
|
|
30
41
|
return (
|
|
31
|
-
<Pressable
|
|
42
|
+
<Pressable
|
|
43
|
+
ref={triggerRef}
|
|
44
|
+
onPress={onTriggerPress}
|
|
45
|
+
disabled={select.isDisabled}
|
|
46
|
+
style={composedStyles}
|
|
47
|
+
>
|
|
32
48
|
<SelectValue placeholder={props.placeholder} />
|
|
33
49
|
</Pressable>
|
|
34
50
|
);
|
|
@@ -42,12 +58,22 @@ export interface SelectValueProps {
|
|
|
42
58
|
export function SelectValue(props: SelectValueProps) {
|
|
43
59
|
const select = useSelect();
|
|
44
60
|
|
|
45
|
-
const selectedOption = select.options.find(
|
|
61
|
+
const selectedOption = select.options.find(
|
|
62
|
+
(option) => option.value === select.value,
|
|
63
|
+
);
|
|
46
64
|
const selectedOptionLabel = selectedOption?.label;
|
|
47
65
|
|
|
48
|
-
const composedStyles = calculateComposedStyles(
|
|
66
|
+
const composedStyles = calculateComposedStyles(
|
|
67
|
+
select.styles,
|
|
68
|
+
select.state,
|
|
69
|
+
selectedOptionLabel ? "value" : "placeholder",
|
|
70
|
+
);
|
|
49
71
|
if (typeof selectedOptionLabel !== "string") {
|
|
50
72
|
return <>{selectedOptionLabel}</>;
|
|
51
73
|
}
|
|
52
|
-
return
|
|
74
|
+
return (
|
|
75
|
+
<Text style={composedStyles}>
|
|
76
|
+
{selectedOptionLabel ?? props.placeholder}
|
|
77
|
+
</Text>
|
|
78
|
+
);
|
|
53
79
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LayoutPosition } from "
|
|
1
|
+
import type { LayoutPosition } from "../../hooks";
|
|
2
2
|
import { createContext, type Dispatch, useContext } from "react";
|
|
3
3
|
import type { LayoutRectangle } from "react-native";
|
|
4
4
|
import type { SelectOption, SelectState, SelectStyles } from "./types";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type SelectStyles } from "
|
|
2
|
-
import { useThemedStyles } from "
|
|
1
|
+
import { type SelectStyles } from "../..";
|
|
2
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
3
3
|
|
|
4
4
|
export function useSelectVariantDefault(): SelectStyles {
|
|
5
5
|
return useThemedStyles(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
2
|
+
import { type TabsStyles } from "../types";
|
|
3
3
|
|
|
4
4
|
export const useTabsVariantDefault = (): TabsStyles => {
|
|
5
5
|
return useThemedStyles(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type TabsStyles } from "
|
|
2
|
-
import { useThemedStyles } from "
|
|
1
|
+
import { type TabsStyles } from "../..";
|
|
2
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
3
3
|
|
|
4
4
|
export const useTabsVariantLine = (): TabsStyles => {
|
|
5
5
|
return useThemedStyles(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type TextareaStyles } from "
|
|
2
|
-
import { useThemedStyles } from "
|
|
1
|
+
import { type TextareaStyles } from "../..";
|
|
2
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
3
3
|
|
|
4
4
|
export function useTextareaVariantDefault(): TextareaStyles {
|
|
5
5
|
return useThemedStyles(
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type { PropsWithRequiredRender, SvgProps } from "@/types/props.types";
|
|
2
1
|
import React from "react";
|
|
2
|
+
import type {
|
|
3
|
+
PropsWithRequiredRender,
|
|
4
|
+
SvgProps,
|
|
5
|
+
} from "../../../types/props.types";
|
|
3
6
|
import { useToast } from "../context";
|
|
4
7
|
|
|
5
8
|
export type ToastIconProps = SvgProps;
|
|
6
9
|
|
|
7
|
-
export function ToastIcon({
|
|
10
|
+
export function ToastIcon({
|
|
11
|
+
render: Component,
|
|
12
|
+
...props
|
|
13
|
+
}: PropsWithRequiredRender<ToastIconProps>) {
|
|
8
14
|
const toast = useToast();
|
|
9
15
|
|
|
10
16
|
const composedProps = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Portal } from "@/components/portal";
|
|
2
|
-
import { useSafeAreaInsets } from "@/safe-area";
|
|
3
1
|
import React, { useSyncExternalStore } from "react";
|
|
4
2
|
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import { useSafeAreaInsets } from "../../safe-area";
|
|
4
|
+
import { Portal } from "../portal";
|
|
5
5
|
import { ToastDescription } from "./components/toast-description";
|
|
6
6
|
import { ToastRoot } from "./components/toast-root";
|
|
7
7
|
import { ToastTitle } from "./components/toast-title";
|
|
@@ -87,7 +87,12 @@ export function ToastContainer() {
|
|
|
87
87
|
<Portal name={TOAST_PORTAL_NAME}>
|
|
88
88
|
<View style={[s.wrapper, { top: insets.top + 24 }]}>
|
|
89
89
|
{toasts.map((toast) => (
|
|
90
|
-
<ToastComponent
|
|
90
|
+
<ToastComponent
|
|
91
|
+
key={toast.id}
|
|
92
|
+
title={toast.title}
|
|
93
|
+
description={toast.description}
|
|
94
|
+
variant={toast.variant}
|
|
95
|
+
/>
|
|
91
96
|
))}
|
|
92
97
|
</View>
|
|
93
98
|
</Portal>
|
|
@@ -105,7 +110,9 @@ export function ToastComponent(props: ToastProps) {
|
|
|
105
110
|
return (
|
|
106
111
|
<ToastRoot variant={props.variant}>
|
|
107
112
|
<ToastTitle>{props.title}</ToastTitle>
|
|
108
|
-
{!!props.description &&
|
|
113
|
+
{!!props.description && (
|
|
114
|
+
<ToastDescription>{props.description}</ToastDescription>
|
|
115
|
+
)}
|
|
109
116
|
</ToastRoot>
|
|
110
117
|
);
|
|
111
118
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export interface CountryData {
|
|
2
|
+
/** ISO 3166-1 alpha-2 code */
|
|
3
|
+
code: string;
|
|
4
|
+
/** Display name */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Dial code without plus sign */
|
|
7
|
+
dialCode: string;
|
|
8
|
+
/** Flag emoji */
|
|
9
|
+
flag: string;
|
|
10
|
+
/** Format pattern using # for digits */
|
|
11
|
+
format: string;
|
|
12
|
+
/** Priority for sorting countries with same dial code (lower = higher) */
|
|
13
|
+
priority: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const COUNTRIES: CountryData[] = [
|
|
17
|
+
{ code: "AF", name: "Afghanistan", dialCode: "93", flag: "🇦🇫", format: "## ### ####", priority: 0 },
|
|
18
|
+
{ code: "AL", name: "Albania", dialCode: "355", flag: "🇦🇱", format: "## ### ####", priority: 0 },
|
|
19
|
+
{ code: "DZ", name: "Algeria", dialCode: "213", flag: "🇩🇿", format: "### ## ## ##", priority: 0 },
|
|
20
|
+
{ code: "AR", name: "Argentina", dialCode: "54", flag: "🇦🇷", format: "## ####-####", priority: 0 },
|
|
21
|
+
{ code: "AU", name: "Australia", dialCode: "61", flag: "🇦🇺", format: "#### ### ###", priority: 0 },
|
|
22
|
+
{ code: "AT", name: "Austria", dialCode: "43", flag: "🇦🇹", format: "### #######", priority: 0 },
|
|
23
|
+
{ code: "BD", name: "Bangladesh", dialCode: "880", flag: "🇧🇩", format: "#### ######", priority: 0 },
|
|
24
|
+
{ code: "BE", name: "Belgium", dialCode: "32", flag: "🇧🇪", format: "### ## ## ##", priority: 0 },
|
|
25
|
+
{ code: "BR", name: "Brazil", dialCode: "55", flag: "🇧🇷", format: "(##) #####-####", priority: 0 },
|
|
26
|
+
{ code: "CA", name: "Canada", dialCode: "1", flag: "🇨🇦", format: "(###) ###-####", priority: 1 },
|
|
27
|
+
{ code: "CL", name: "Chile", dialCode: "56", flag: "🇨🇱", format: "# #### ####", priority: 0 },
|
|
28
|
+
{ code: "CN", name: "China", dialCode: "86", flag: "🇨🇳", format: "### #### ####", priority: 0 },
|
|
29
|
+
{ code: "CO", name: "Colombia", dialCode: "57", flag: "🇨🇴", format: "### ### ####", priority: 0 },
|
|
30
|
+
{ code: "CR", name: "Costa Rica", dialCode: "506", flag: "🇨🇷", format: "#### ####", priority: 0 },
|
|
31
|
+
{ code: "CZ", name: "Czech Republic", dialCode: "420", flag: "🇨🇿", format: "### ### ###", priority: 0 },
|
|
32
|
+
{ code: "DK", name: "Denmark", dialCode: "45", flag: "🇩🇰", format: "## ## ## ##", priority: 0 },
|
|
33
|
+
{ code: "DO", name: "Dominican Republic", dialCode: "1", flag: "🇩🇴", format: "(###) ###-####", priority: 2 },
|
|
34
|
+
{ code: "EC", name: "Ecuador", dialCode: "593", flag: "🇪🇨", format: "## ### ####", priority: 0 },
|
|
35
|
+
{ code: "EG", name: "Egypt", dialCode: "20", flag: "🇪🇬", format: "### ### ####", priority: 0 },
|
|
36
|
+
{ code: "FI", name: "Finland", dialCode: "358", flag: "🇫🇮", format: "## ### ## ##", priority: 0 },
|
|
37
|
+
{ code: "FR", name: "France", dialCode: "33", flag: "🇫🇷", format: "# ## ## ## ##", priority: 0 },
|
|
38
|
+
{ code: "DE", name: "Germany", dialCode: "49", flag: "🇩🇪", format: "#### #######", priority: 0 },
|
|
39
|
+
{ code: "GH", name: "Ghana", dialCode: "233", flag: "🇬🇭", format: "## ### ####", priority: 0 },
|
|
40
|
+
{ code: "GR", name: "Greece", dialCode: "30", flag: "🇬🇷", format: "### ### ####", priority: 0 },
|
|
41
|
+
{ code: "GT", name: "Guatemala", dialCode: "502", flag: "🇬🇹", format: "#### ####", priority: 0 },
|
|
42
|
+
{ code: "HK", name: "Hong Kong", dialCode: "852", flag: "🇭🇰", format: "#### ####", priority: 0 },
|
|
43
|
+
{ code: "HU", name: "Hungary", dialCode: "36", flag: "🇭🇺", format: "## ### ####", priority: 0 },
|
|
44
|
+
{ code: "IN", name: "India", dialCode: "91", flag: "🇮🇳", format: "#####-#####", priority: 0 },
|
|
45
|
+
{ code: "ID", name: "Indonesia", dialCode: "62", flag: "🇮🇩", format: "### #### ####", priority: 0 },
|
|
46
|
+
{ code: "IE", name: "Ireland", dialCode: "353", flag: "🇮🇪", format: "## ### ####", priority: 0 },
|
|
47
|
+
{ code: "IL", name: "Israel", dialCode: "972", flag: "🇮🇱", format: "##-###-####", priority: 0 },
|
|
48
|
+
{ code: "IT", name: "Italy", dialCode: "39", flag: "🇮🇹", format: "### ### ####", priority: 0 },
|
|
49
|
+
{ code: "JM", name: "Jamaica", dialCode: "1", flag: "🇯🇲", format: "(###) ###-####", priority: 3 },
|
|
50
|
+
{ code: "JP", name: "Japan", dialCode: "81", flag: "🇯🇵", format: "##-####-####", priority: 0 },
|
|
51
|
+
{ code: "KE", name: "Kenya", dialCode: "254", flag: "🇰🇪", format: "### ######", priority: 0 },
|
|
52
|
+
{ code: "KR", name: "South Korea", dialCode: "82", flag: "🇰🇷", format: "##-####-####", priority: 0 },
|
|
53
|
+
{ code: "MY", name: "Malaysia", dialCode: "60", flag: "🇲🇾", format: "##-### ####", priority: 0 },
|
|
54
|
+
{ code: "MX", name: "Mexico", dialCode: "52", flag: "🇲🇽", format: "## #### ####", priority: 0 },
|
|
55
|
+
{ code: "MA", name: "Morocco", dialCode: "212", flag: "🇲🇦", format: "##-### ####", priority: 0 },
|
|
56
|
+
{ code: "NL", name: "Netherlands", dialCode: "31", flag: "🇳🇱", format: "# ## ## ## ##", priority: 0 },
|
|
57
|
+
{ code: "NZ", name: "New Zealand", dialCode: "64", flag: "🇳🇿", format: "## ### ####", priority: 0 },
|
|
58
|
+
{ code: "NG", name: "Nigeria", dialCode: "234", flag: "🇳🇬", format: "### ### ####", priority: 0 },
|
|
59
|
+
{ code: "NO", name: "Norway", dialCode: "47", flag: "🇳🇴", format: "### ## ###", priority: 0 },
|
|
60
|
+
{ code: "PK", name: "Pakistan", dialCode: "92", flag: "🇵🇰", format: "### #######", priority: 0 },
|
|
61
|
+
{ code: "PA", name: "Panama", dialCode: "507", flag: "🇵🇦", format: "####-####", priority: 0 },
|
|
62
|
+
{ code: "PE", name: "Peru", dialCode: "51", flag: "🇵🇪", format: "### ### ###", priority: 0 },
|
|
63
|
+
{ code: "PH", name: "Philippines", dialCode: "63", flag: "🇵🇭", format: "### ### ####", priority: 0 },
|
|
64
|
+
{ code: "PL", name: "Poland", dialCode: "48", flag: "🇵🇱", format: "### ### ###", priority: 0 },
|
|
65
|
+
{ code: "PT", name: "Portugal", dialCode: "351", flag: "🇵🇹", format: "### ### ###", priority: 0 },
|
|
66
|
+
{ code: "PR", name: "Puerto Rico", dialCode: "1", flag: "🇵🇷", format: "(###) ###-####", priority: 4 },
|
|
67
|
+
{ code: "RO", name: "Romania", dialCode: "40", flag: "🇷🇴", format: "### ### ###", priority: 0 },
|
|
68
|
+
{ code: "RU", name: "Russia", dialCode: "7", flag: "🇷🇺", format: "### ###-##-##", priority: 0 },
|
|
69
|
+
{ code: "SA", name: "Saudi Arabia", dialCode: "966", flag: "🇸🇦", format: "## ### ####", priority: 0 },
|
|
70
|
+
{ code: "SG", name: "Singapore", dialCode: "65", flag: "🇸🇬", format: "#### ####", priority: 0 },
|
|
71
|
+
{ code: "ZA", name: "South Africa", dialCode: "27", flag: "🇿🇦", format: "## ### ####", priority: 0 },
|
|
72
|
+
{ code: "ES", name: "Spain", dialCode: "34", flag: "🇪🇸", format: "### ## ## ##", priority: 0 },
|
|
73
|
+
{ code: "SE", name: "Sweden", dialCode: "46", flag: "🇸🇪", format: "##-### ## ##", priority: 0 },
|
|
74
|
+
{ code: "CH", name: "Switzerland", dialCode: "41", flag: "🇨🇭", format: "## ### ## ##", priority: 0 },
|
|
75
|
+
{ code: "TW", name: "Taiwan", dialCode: "886", flag: "🇹🇼", format: "### ### ###", priority: 0 },
|
|
76
|
+
{ code: "TH", name: "Thailand", dialCode: "66", flag: "🇹🇭", format: "## ### ####", priority: 0 },
|
|
77
|
+
{ code: "TR", name: "Turkey", dialCode: "90", flag: "🇹🇷", format: "### ### ## ##", priority: 0 },
|
|
78
|
+
{ code: "UA", name: "Ukraine", dialCode: "380", flag: "🇺🇦", format: "## ### ## ##", priority: 0 },
|
|
79
|
+
{ code: "AE", name: "United Arab Emirates", dialCode: "971", flag: "🇦🇪", format: "## ### ####", priority: 0 },
|
|
80
|
+
{ code: "GB", name: "United Kingdom", dialCode: "44", flag: "🇬🇧", format: "#### ######", priority: 0 },
|
|
81
|
+
{ code: "US", name: "United States", dialCode: "1", flag: "🇺🇸", format: "(###) ###-####", priority: 0 },
|
|
82
|
+
{ code: "VE", name: "Venezuela", dialCode: "58", flag: "🇻🇪", format: "###-###-####", priority: 0 },
|
|
83
|
+
{ code: "VN", name: "Vietnam", dialCode: "84", flag: "🇻🇳", format: "## ### ## ##", priority: 0 },
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
export function getCountryByCode(code: string): CountryData | undefined {
|
|
87
|
+
return COUNTRIES.find((c) => c.code === code);
|
|
88
|
+
}
|