@scripso-homepad/ui 0.4.22 → 0.4.24
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/dist/{chunk-KJYQA5OY.js → chunk-JNVYKEYT.js} +11 -11
- package/dist/chunk-JNVYKEYT.js.map +1 -0
- package/dist/index.cjs +89 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -10
- package/dist/index.d.ts +25 -10
- package/dist/index.js +87 -53
- package/dist/index.js.map +1 -1
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.css +1 -1
- package/dist/web/index.css.map +1 -1
- package/dist/web/index.d.cts +1 -1
- package/dist/web/index.d.ts +1 -1
- package/dist/web/index.js +1 -1
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CountryCodeSelector.tsx +6 -8
- package/src/components/CountryFlag.tsx +37 -0
- package/src/components/PhoneInput.tsx +23 -9
- package/src/index.ts +8 -0
- package/src/theme/tokens.ts +8 -8
- package/src/utils/countryFlag.ts +12 -1
- package/src/web/components/Drawer.stories.tsx +3 -3
- package/src/web/components/Drawer.tsx +1 -1
- package/src/web/components/sonner-toast.css +1 -1
- package/dist/chunk-KJYQA5OY.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { GestureResponderEvent, StyleProp, ViewStyle, TextStyle, TextInputProps, TextProps } from 'react-native';
|
|
3
|
+
import { GestureResponderEvent, StyleProp, ViewStyle, TextStyle, TextInputProps, ImageStyle, TextProps } from 'react-native';
|
|
4
4
|
|
|
5
5
|
type ButtonVariant = "white" | "primary" | "green" | "gray";
|
|
6
6
|
type ButtonSize = "lg" | "sm";
|
|
@@ -131,6 +131,21 @@ interface CountryCodeSelectorProps {
|
|
|
131
131
|
}
|
|
132
132
|
declare function CountryCodeSelector({ value, onValueChange, options, disabled, style, className, }: CountryCodeSelectorProps): react.JSX.Element;
|
|
133
133
|
|
|
134
|
+
type CountryFlagProps = {
|
|
135
|
+
code: string;
|
|
136
|
+
style?: StyleProp<ImageStyle>;
|
|
137
|
+
};
|
|
138
|
+
/** Renders a country flag image (works on Windows; emoji flags do not). */
|
|
139
|
+
declare function CountryFlag({ code, style }: CountryFlagProps): react.JSX.Element | null;
|
|
140
|
+
|
|
141
|
+
/** ISO 3166-1 alpha-2 country code → flag emoji. Prefer CountryFlag images on Windows. */
|
|
142
|
+
declare function countryCodeToFlagEmoji(code: string): string;
|
|
143
|
+
/**
|
|
144
|
+
* PNG flag URL (flagcdn). Windows does not render regional-indicator flag emoji,
|
|
145
|
+
* so UI should use images instead of countryCodeToFlagEmoji.
|
|
146
|
+
*/
|
|
147
|
+
declare function getCountryFlagImageUri(code: string): string | null;
|
|
148
|
+
|
|
134
149
|
type DateRange = {
|
|
135
150
|
start: Date;
|
|
136
151
|
end?: Date;
|
|
@@ -507,22 +522,22 @@ declare const shadows: {
|
|
|
507
522
|
readonly shadowColor: "#082640";
|
|
508
523
|
readonly shadowOffset: {
|
|
509
524
|
readonly width: 0;
|
|
510
|
-
readonly height:
|
|
525
|
+
readonly height: 1;
|
|
511
526
|
};
|
|
512
|
-
readonly shadowOpacity: 0.
|
|
513
|
-
readonly shadowRadius:
|
|
514
|
-
readonly elevation:
|
|
527
|
+
readonly shadowOpacity: 0.06;
|
|
528
|
+
readonly shadowRadius: 4;
|
|
529
|
+
readonly elevation: 1;
|
|
515
530
|
};
|
|
516
531
|
readonly cardLg: {
|
|
517
532
|
readonly shadowColor: "#082640";
|
|
518
533
|
readonly shadowOffset: {
|
|
519
534
|
readonly width: 0;
|
|
520
|
-
readonly height:
|
|
535
|
+
readonly height: 2;
|
|
521
536
|
};
|
|
522
|
-
readonly shadowOpacity: 0.
|
|
523
|
-
readonly shadowRadius:
|
|
524
|
-
readonly elevation:
|
|
537
|
+
readonly shadowOpacity: 0.08;
|
|
538
|
+
readonly shadowRadius: 6;
|
|
539
|
+
readonly elevation: 2;
|
|
525
540
|
};
|
|
526
541
|
};
|
|
527
542
|
|
|
528
|
-
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, CalendarIcon, type CalendarLabels, type CalendarLocale, CalendarLocaleProvider, type CalendarLocaleProviderProps, type CalendarProps, type CalendarRangeProps, type CalendarSingleProps, type CalendarTranslationKey$1 as CalendarTranslationKey, type CalendarTranslations, type Country, CountryCodeSelector, type CountryCodeSelectorProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DateRange, type EmeraldGreenStep, Input, type InputProps, Label, type LabelProps, LockIcon, type MultipleSelectProps, type NavyStep, PhoneInput, type PhoneInputProps, type RubyRedStep, Select, type SelectOption, type SelectProps, type SingleSelectProps, type StormGrayStep, brand, buttonTypography, calendarTranslations, colors, countries, defaultCountry, emeraldGreen, findCountry, fontSize, fontWeight, fonts, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, labelTypography, navy, radii, resolveCalendarLocale, resolveWeekdayLabels, rubyRed, shadows, spacing, stormGray, typographyScale, useCalendarLocale };
|
|
543
|
+
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, CalendarIcon, type CalendarLabels, type CalendarLocale, CalendarLocaleProvider, type CalendarLocaleProviderProps, type CalendarProps, type CalendarRangeProps, type CalendarSingleProps, type CalendarTranslationKey$1 as CalendarTranslationKey, type CalendarTranslations, type Country, CountryCodeSelector, type CountryCodeSelectorProps, CountryFlag, type CountryFlagProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DateRange, type EmeraldGreenStep, Input, type InputProps, Label, type LabelProps, LockIcon, type MultipleSelectProps, type NavyStep, PhoneInput, type PhoneInputProps, type RubyRedStep, Select, type SelectOption, type SelectProps, type SingleSelectProps, type StormGrayStep, brand, buttonTypography, calendarTranslations, colors, countries, countryCodeToFlagEmoji, defaultCountry, emeraldGreen, findCountry, fontSize, fontWeight, fonts, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, getCountryFlagImageUri, labelTypography, navy, radii, resolveCalendarLocale, resolveWeekdayLabels, rubyRed, shadows, spacing, stormGray, typographyScale, useCalendarLocale };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { GestureResponderEvent, StyleProp, ViewStyle, TextStyle, TextInputProps, TextProps } from 'react-native';
|
|
3
|
+
import { GestureResponderEvent, StyleProp, ViewStyle, TextStyle, TextInputProps, ImageStyle, TextProps } from 'react-native';
|
|
4
4
|
|
|
5
5
|
type ButtonVariant = "white" | "primary" | "green" | "gray";
|
|
6
6
|
type ButtonSize = "lg" | "sm";
|
|
@@ -131,6 +131,21 @@ interface CountryCodeSelectorProps {
|
|
|
131
131
|
}
|
|
132
132
|
declare function CountryCodeSelector({ value, onValueChange, options, disabled, style, className, }: CountryCodeSelectorProps): react.JSX.Element;
|
|
133
133
|
|
|
134
|
+
type CountryFlagProps = {
|
|
135
|
+
code: string;
|
|
136
|
+
style?: StyleProp<ImageStyle>;
|
|
137
|
+
};
|
|
138
|
+
/** Renders a country flag image (works on Windows; emoji flags do not). */
|
|
139
|
+
declare function CountryFlag({ code, style }: CountryFlagProps): react.JSX.Element | null;
|
|
140
|
+
|
|
141
|
+
/** ISO 3166-1 alpha-2 country code → flag emoji. Prefer CountryFlag images on Windows. */
|
|
142
|
+
declare function countryCodeToFlagEmoji(code: string): string;
|
|
143
|
+
/**
|
|
144
|
+
* PNG flag URL (flagcdn). Windows does not render regional-indicator flag emoji,
|
|
145
|
+
* so UI should use images instead of countryCodeToFlagEmoji.
|
|
146
|
+
*/
|
|
147
|
+
declare function getCountryFlagImageUri(code: string): string | null;
|
|
148
|
+
|
|
134
149
|
type DateRange = {
|
|
135
150
|
start: Date;
|
|
136
151
|
end?: Date;
|
|
@@ -507,22 +522,22 @@ declare const shadows: {
|
|
|
507
522
|
readonly shadowColor: "#082640";
|
|
508
523
|
readonly shadowOffset: {
|
|
509
524
|
readonly width: 0;
|
|
510
|
-
readonly height:
|
|
525
|
+
readonly height: 1;
|
|
511
526
|
};
|
|
512
|
-
readonly shadowOpacity: 0.
|
|
513
|
-
readonly shadowRadius:
|
|
514
|
-
readonly elevation:
|
|
527
|
+
readonly shadowOpacity: 0.06;
|
|
528
|
+
readonly shadowRadius: 4;
|
|
529
|
+
readonly elevation: 1;
|
|
515
530
|
};
|
|
516
531
|
readonly cardLg: {
|
|
517
532
|
readonly shadowColor: "#082640";
|
|
518
533
|
readonly shadowOffset: {
|
|
519
534
|
readonly width: 0;
|
|
520
|
-
readonly height:
|
|
535
|
+
readonly height: 2;
|
|
521
536
|
};
|
|
522
|
-
readonly shadowOpacity: 0.
|
|
523
|
-
readonly shadowRadius:
|
|
524
|
-
readonly elevation:
|
|
537
|
+
readonly shadowOpacity: 0.08;
|
|
538
|
+
readonly shadowRadius: 6;
|
|
539
|
+
readonly elevation: 2;
|
|
525
540
|
};
|
|
526
541
|
};
|
|
527
542
|
|
|
528
|
-
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, CalendarIcon, type CalendarLabels, type CalendarLocale, CalendarLocaleProvider, type CalendarLocaleProviderProps, type CalendarProps, type CalendarRangeProps, type CalendarSingleProps, type CalendarTranslationKey$1 as CalendarTranslationKey, type CalendarTranslations, type Country, CountryCodeSelector, type CountryCodeSelectorProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DateRange, type EmeraldGreenStep, Input, type InputProps, Label, type LabelProps, LockIcon, type MultipleSelectProps, type NavyStep, PhoneInput, type PhoneInputProps, type RubyRedStep, Select, type SelectOption, type SelectProps, type SingleSelectProps, type StormGrayStep, brand, buttonTypography, calendarTranslations, colors, countries, defaultCountry, emeraldGreen, findCountry, fontSize, fontWeight, fonts, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, labelTypography, navy, radii, resolveCalendarLocale, resolveWeekdayLabels, rubyRed, shadows, spacing, stormGray, typographyScale, useCalendarLocale };
|
|
543
|
+
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, CalendarIcon, type CalendarLabels, type CalendarLocale, CalendarLocaleProvider, type CalendarLocaleProviderProps, type CalendarProps, type CalendarRangeProps, type CalendarSingleProps, type CalendarTranslationKey$1 as CalendarTranslationKey, type CalendarTranslations, type Country, CountryCodeSelector, type CountryCodeSelectorProps, CountryFlag, type CountryFlagProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DateRange, type EmeraldGreenStep, Input, type InputProps, Label, type LabelProps, LockIcon, type MultipleSelectProps, type NavyStep, PhoneInput, type PhoneInputProps, type RubyRedStep, Select, type SelectOption, type SelectProps, type SingleSelectProps, type StormGrayStep, brand, buttonTypography, calendarTranslations, colors, countries, countryCodeToFlagEmoji, defaultCountry, emeraldGreen, findCountry, fontSize, fontWeight, fonts, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, getCountryFlagImageUri, labelTypography, navy, radii, resolveCalendarLocale, resolveWeekdayLabels, rubyRed, shadows, spacing, stormGray, typographyScale, useCalendarLocale };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { spacing, colors, fontWeight, fontSize, fonts, radii, INPUT_ICON_GAP, useApplyWebClassName, resolveInputVisualState, Label, getInputFieldStyles, inputFieldMetrics } from './chunk-
|
|
2
|
-
export { Button, Input, Label, brand, buttonTypography, colors, emeraldGreen, fontSize, fontWeight, fonts, labelTypography, navy, radii, rubyRed, shadows, spacing, stormGray, typographyScale } from './chunk-
|
|
1
|
+
import { spacing, colors, fontWeight, fontSize, fonts, radii, INPUT_HEIGHT, INPUT_OUTLINE_WIDTH, INPUT_ICON_GAP, useApplyWebClassName, resolveInputVisualState, Label, getInputFieldStyles, inputFieldMetrics } from './chunk-JNVYKEYT.js';
|
|
2
|
+
export { Button, Input, Label, brand, buttonTypography, colors, emeraldGreen, fontSize, fontWeight, fonts, labelTypography, navy, radii, rubyRed, shadows, spacing, stormGray, typographyScale } from './chunk-JNVYKEYT.js';
|
|
3
3
|
import { createContext, useRef, useState, useMemo, useEffect, useLayoutEffect, useContext, isValidElement, cloneElement } from 'react';
|
|
4
|
-
import { Platform, StyleSheet, Animated, Easing, View, Pressable, Text, Modal, ScrollView, TextInput, Dimensions } from 'react-native';
|
|
4
|
+
import { Platform, StyleSheet, Animated, Easing, View, Pressable, Text, Modal, ScrollView, Image, TextInput, Dimensions } from 'react-native';
|
|
5
5
|
import Svg2, { Path } from 'react-native-svg';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
|
|
@@ -65,11 +65,11 @@ var selectValueTypography = {
|
|
|
65
65
|
letterSpacing: 0,
|
|
66
66
|
textAlign: "left"
|
|
67
67
|
};
|
|
68
|
-
var
|
|
68
|
+
var INPUT_OUTLINE_WIDTH2 = 2;
|
|
69
69
|
function createOutlineStyle(ringColor) {
|
|
70
70
|
return {
|
|
71
|
-
borderRadius: radii.lg +
|
|
72
|
-
borderWidth:
|
|
71
|
+
borderRadius: radii.lg + INPUT_OUTLINE_WIDTH2,
|
|
72
|
+
borderWidth: INPUT_OUTLINE_WIDTH2,
|
|
73
73
|
borderColor: ringColor,
|
|
74
74
|
padding: 0,
|
|
75
75
|
backgroundColor: colors.transparent,
|
|
@@ -79,8 +79,8 @@ function createOutlineStyle(ringColor) {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
var defaultOutline = {
|
|
82
|
-
borderRadius: radii.lg +
|
|
83
|
-
borderWidth:
|
|
82
|
+
borderRadius: radii.lg + INPUT_OUTLINE_WIDTH2,
|
|
83
|
+
borderWidth: INPUT_OUTLINE_WIDTH2,
|
|
84
84
|
borderColor: colors.transparent,
|
|
85
85
|
padding: 0,
|
|
86
86
|
backgroundColor: colors.transparent,
|
|
@@ -886,12 +886,41 @@ function countryCodeToFlagEmoji(code) {
|
|
|
886
886
|
...upper.split("").map((char) => 127462 - 65 + char.charCodeAt(0))
|
|
887
887
|
);
|
|
888
888
|
}
|
|
889
|
+
function getCountryFlagImageUri(code) {
|
|
890
|
+
const lower = code.trim().toLowerCase();
|
|
891
|
+
if (!/^[a-z]{2}$/.test(lower)) return null;
|
|
892
|
+
return `https://flagcdn.com/w40/${lower}.png`;
|
|
893
|
+
}
|
|
894
|
+
var FLAG_HEIGHT = 18;
|
|
895
|
+
var FLAG_WIDTH = 24;
|
|
896
|
+
function CountryFlag({ code, style }) {
|
|
897
|
+
const uri = getCountryFlagImageUri(code);
|
|
898
|
+
if (uri === null) {
|
|
899
|
+
return null;
|
|
900
|
+
}
|
|
901
|
+
return /* @__PURE__ */ jsx(
|
|
902
|
+
Image,
|
|
903
|
+
{
|
|
904
|
+
source: { uri },
|
|
905
|
+
style: [styles2.flag, style],
|
|
906
|
+
accessibilityIgnoresInvertColors: true,
|
|
907
|
+
accessibilityLabel: `${code.trim().toUpperCase()} flag`
|
|
908
|
+
}
|
|
909
|
+
);
|
|
910
|
+
}
|
|
911
|
+
var styles2 = StyleSheet.create({
|
|
912
|
+
flag: {
|
|
913
|
+
width: FLAG_WIDTH,
|
|
914
|
+
height: FLAG_HEIGHT,
|
|
915
|
+
borderRadius: 2
|
|
916
|
+
}
|
|
917
|
+
});
|
|
889
918
|
var DROPDOWN_GAP = 10;
|
|
890
919
|
var DROPDOWN_HEIGHT = 186;
|
|
891
920
|
var DROPDOWN_PADDING = 8;
|
|
892
921
|
var OPTION_GAP = 10;
|
|
893
922
|
var OPTION_HEIGHT = 35;
|
|
894
|
-
var TRIGGER_HEIGHT =
|
|
923
|
+
var TRIGGER_HEIGHT = INPUT_HEIGHT;
|
|
895
924
|
var CHEVRON_SIZE = 16;
|
|
896
925
|
function resolveDropdownTop(anchor) {
|
|
897
926
|
const windowHeight = Dimensions.get("window").height;
|
|
@@ -951,13 +980,13 @@ function CountryCodeSelector({
|
|
|
951
980
|
accessibilityRole: "button",
|
|
952
981
|
onPress: () => handleSelect(item.code),
|
|
953
982
|
style: [
|
|
954
|
-
|
|
955
|
-
isSelected &&
|
|
956
|
-
!isLast &&
|
|
983
|
+
styles3.option,
|
|
984
|
+
isSelected && styles3.optionSelected,
|
|
985
|
+
!isLast && styles3.optionSpacing
|
|
957
986
|
],
|
|
958
987
|
children: [
|
|
959
|
-
/* @__PURE__ */ jsx(
|
|
960
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
988
|
+
/* @__PURE__ */ jsx(CountryFlag, { code: item.code }),
|
|
989
|
+
/* @__PURE__ */ jsx(Text, { style: styles3.optionDialCode, children: item.dialCode })
|
|
961
990
|
]
|
|
962
991
|
},
|
|
963
992
|
item.code
|
|
@@ -967,8 +996,8 @@ function CountryCodeSelector({
|
|
|
967
996
|
ScrollView,
|
|
968
997
|
{
|
|
969
998
|
ref: scrollRef,
|
|
970
|
-
style:
|
|
971
|
-
contentContainerStyle:
|
|
999
|
+
style: styles3.dropdownScroll,
|
|
1000
|
+
contentContainerStyle: styles3.dropdownContent,
|
|
972
1001
|
keyboardShouldPersistTaps: "handled",
|
|
973
1002
|
showsVerticalScrollIndicator: true,
|
|
974
1003
|
bounces: false,
|
|
@@ -976,7 +1005,7 @@ function CountryCodeSelector({
|
|
|
976
1005
|
children: optionList
|
|
977
1006
|
}
|
|
978
1007
|
);
|
|
979
|
-
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [
|
|
1008
|
+
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [styles3.root, style], children: [
|
|
980
1009
|
/* @__PURE__ */ jsxs(
|
|
981
1010
|
Pressable,
|
|
982
1011
|
{
|
|
@@ -985,13 +1014,13 @@ function CountryCodeSelector({
|
|
|
985
1014
|
disabled,
|
|
986
1015
|
onPress: handleOpen,
|
|
987
1016
|
style: [
|
|
988
|
-
|
|
989
|
-
disabled ?
|
|
990
|
-
Platform.OS === "web" ?
|
|
1017
|
+
styles3.trigger,
|
|
1018
|
+
disabled ? styles3.triggerDisabled : styles3.triggerEnabled,
|
|
1019
|
+
Platform.OS === "web" ? styles3.triggerWeb : null
|
|
991
1020
|
],
|
|
992
1021
|
children: [
|
|
993
|
-
/* @__PURE__ */ jsx(
|
|
994
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1022
|
+
/* @__PURE__ */ jsx(CountryFlag, { code: selected.code }),
|
|
1023
|
+
/* @__PURE__ */ jsx(Text, { style: [styles3.dialCode, { color: textColor }], children: selected.dialCode }),
|
|
995
1024
|
/* @__PURE__ */ jsx(ChevronDownIcon, { size: CHEVRON_SIZE, color: colors.stormGray100 })
|
|
996
1025
|
]
|
|
997
1026
|
}
|
|
@@ -1003,11 +1032,11 @@ function CountryCodeSelector({
|
|
|
1003
1032
|
transparent: true,
|
|
1004
1033
|
animationType: "fade",
|
|
1005
1034
|
onRequestClose: closeDropdown,
|
|
1006
|
-
children: /* @__PURE__ */ jsx(Pressable, { style:
|
|
1035
|
+
children: /* @__PURE__ */ jsx(Pressable, { style: styles3.overlay, onPress: closeDropdown, children: anchor ? /* @__PURE__ */ jsx(
|
|
1007
1036
|
View,
|
|
1008
1037
|
{
|
|
1009
1038
|
style: [
|
|
1010
|
-
|
|
1039
|
+
styles3.dropdown,
|
|
1011
1040
|
{
|
|
1012
1041
|
top: dropdownTop,
|
|
1013
1042
|
left: anchor.x,
|
|
@@ -1021,7 +1050,7 @@ function CountryCodeSelector({
|
|
|
1021
1050
|
)
|
|
1022
1051
|
] });
|
|
1023
1052
|
}
|
|
1024
|
-
var
|
|
1053
|
+
var styles3 = StyleSheet.create({
|
|
1025
1054
|
root: {
|
|
1026
1055
|
alignSelf: "flex-start",
|
|
1027
1056
|
flexShrink: 0
|
|
@@ -1049,10 +1078,6 @@ var styles2 = StyleSheet.create({
|
|
|
1049
1078
|
triggerWeb: {
|
|
1050
1079
|
width: "max-content"
|
|
1051
1080
|
},
|
|
1052
|
-
flag: {
|
|
1053
|
-
fontSize: 18,
|
|
1054
|
-
lineHeight: 24
|
|
1055
|
-
},
|
|
1056
1081
|
dialCode: {
|
|
1057
1082
|
fontSize: fontSize.md,
|
|
1058
1083
|
fontWeight: fontWeight.medium,
|
|
@@ -1102,6 +1127,13 @@ var styles2 = StyleSheet.create({
|
|
|
1102
1127
|
color: colors.slateBlue
|
|
1103
1128
|
}
|
|
1104
1129
|
});
|
|
1130
|
+
var countryOutlineSlot = {
|
|
1131
|
+
borderRadius: radii.lg + INPUT_OUTLINE_WIDTH,
|
|
1132
|
+
borderWidth: INPUT_OUTLINE_WIDTH,
|
|
1133
|
+
borderColor: colors.transparent,
|
|
1134
|
+
padding: 0,
|
|
1135
|
+
backgroundColor: colors.transparent
|
|
1136
|
+
};
|
|
1105
1137
|
function sanitizePhoneDigits(value) {
|
|
1106
1138
|
return value.replace(/\D/g, "");
|
|
1107
1139
|
}
|
|
@@ -1151,7 +1183,7 @@ function PhoneInput({
|
|
|
1151
1183
|
onChangeText?.(sanitizePhoneDigits(value));
|
|
1152
1184
|
}
|
|
1153
1185
|
const helperMessage = error ?? hint;
|
|
1154
|
-
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [
|
|
1186
|
+
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [styles4.wrapper, containerStyle], children: [
|
|
1155
1187
|
label ? /* @__PURE__ */ jsx(
|
|
1156
1188
|
Label,
|
|
1157
1189
|
{
|
|
@@ -1161,24 +1193,24 @@ function PhoneInput({
|
|
|
1161
1193
|
children: label
|
|
1162
1194
|
}
|
|
1163
1195
|
) : null,
|
|
1164
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1165
|
-
/* @__PURE__ */ jsx(
|
|
1196
|
+
/* @__PURE__ */ jsxs(View, { style: styles4.row, children: [
|
|
1197
|
+
/* @__PURE__ */ jsx(View, { style: [countryOutlineSlot, styles4.countryOutline], children: /* @__PURE__ */ jsx(
|
|
1166
1198
|
CountryCodeSelector,
|
|
1167
1199
|
{
|
|
1168
1200
|
value: countryCode,
|
|
1169
1201
|
onValueChange: onCountryCodeChange,
|
|
1170
1202
|
disabled: isDisabled,
|
|
1171
|
-
style:
|
|
1203
|
+
style: styles4.countrySelector
|
|
1172
1204
|
}
|
|
1173
|
-
),
|
|
1174
|
-
/* @__PURE__ */ jsx(View, { style: [phoneFieldStyles.outline,
|
|
1205
|
+
) }),
|
|
1206
|
+
/* @__PURE__ */ jsx(View, { style: [phoneFieldStyles.outline, styles4.phoneOutline], children: /* @__PURE__ */ jsx(
|
|
1175
1207
|
View,
|
|
1176
1208
|
{
|
|
1177
1209
|
style: [
|
|
1178
1210
|
inputFieldMetrics.containerBase,
|
|
1179
1211
|
inputFieldMetrics.container,
|
|
1180
1212
|
phoneFieldStyles.container,
|
|
1181
|
-
|
|
1213
|
+
styles4.phoneField
|
|
1182
1214
|
],
|
|
1183
1215
|
children: /* @__PURE__ */ jsx(
|
|
1184
1216
|
TextInput,
|
|
@@ -1202,22 +1234,24 @@ function PhoneInput({
|
|
|
1202
1234
|
}
|
|
1203
1235
|
) })
|
|
1204
1236
|
] }),
|
|
1205
|
-
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ?
|
|
1237
|
+
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles4.error : styles4.hint, children: helperMessage }) : null
|
|
1206
1238
|
] });
|
|
1207
1239
|
}
|
|
1208
|
-
var
|
|
1240
|
+
var styles4 = StyleSheet.create({
|
|
1209
1241
|
wrapper: {
|
|
1210
1242
|
width: "100%",
|
|
1211
1243
|
gap: spacing.sm
|
|
1212
1244
|
},
|
|
1213
1245
|
row: {
|
|
1214
1246
|
flexDirection: "row",
|
|
1215
|
-
alignItems: "
|
|
1247
|
+
alignItems: "center",
|
|
1216
1248
|
gap: INPUT_ICON_GAP
|
|
1217
1249
|
},
|
|
1250
|
+
countryOutline: {
|
|
1251
|
+
flexShrink: 0
|
|
1252
|
+
},
|
|
1218
1253
|
countrySelector: {
|
|
1219
|
-
flexShrink: 0
|
|
1220
|
-
alignSelf: "flex-start"
|
|
1254
|
+
flexShrink: 0
|
|
1221
1255
|
},
|
|
1222
1256
|
phoneOutline: {
|
|
1223
1257
|
flex: 1
|
|
@@ -2383,16 +2417,16 @@ function DatePicker(props) {
|
|
|
2383
2417
|
View,
|
|
2384
2418
|
{
|
|
2385
2419
|
ref: wrapperRef,
|
|
2386
|
-
style: [
|
|
2420
|
+
style: [styles5.wrapper, isFluidField && styles5.wrapperFluid, containerStyle],
|
|
2387
2421
|
children: [
|
|
2388
|
-
label ? /* @__PURE__ */ jsx(Label, { disabled, style:
|
|
2422
|
+
label ? /* @__PURE__ */ jsx(Label, { disabled, style: styles5.label, className: labelClassName, children: label }) : null,
|
|
2389
2423
|
/* @__PURE__ */ jsx(
|
|
2390
2424
|
View,
|
|
2391
2425
|
{
|
|
2392
2426
|
style: [
|
|
2393
2427
|
fieldStyles.outline,
|
|
2394
|
-
|
|
2395
|
-
isFluidField &&
|
|
2428
|
+
styles5.fieldOutline,
|
|
2429
|
+
isFluidField && styles5.fieldOutlineFluid,
|
|
2396
2430
|
fieldOutlineStyle
|
|
2397
2431
|
],
|
|
2398
2432
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -2405,7 +2439,7 @@ function DatePicker(props) {
|
|
|
2405
2439
|
onPress: openPicker,
|
|
2406
2440
|
style: [
|
|
2407
2441
|
calendarFieldMetrics.container,
|
|
2408
|
-
isFluidField &&
|
|
2442
|
+
isFluidField && styles5.fieldContainerFluid,
|
|
2409
2443
|
fieldStyles.container,
|
|
2410
2444
|
fieldStyle
|
|
2411
2445
|
],
|
|
@@ -2418,7 +2452,7 @@ function DatePicker(props) {
|
|
|
2418
2452
|
children: displayValue
|
|
2419
2453
|
}
|
|
2420
2454
|
),
|
|
2421
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
2455
|
+
/* @__PURE__ */ jsx(View, { style: styles5.iconSlot, children: /* @__PURE__ */ jsx(
|
|
2422
2456
|
CalendarIcon,
|
|
2423
2457
|
{
|
|
2424
2458
|
size: CALENDAR_FIELD_ICON_SIZE,
|
|
@@ -2430,12 +2464,12 @@ function DatePicker(props) {
|
|
|
2430
2464
|
)
|
|
2431
2465
|
}
|
|
2432
2466
|
),
|
|
2433
|
-
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ?
|
|
2434
|
-
/* @__PURE__ */ jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: closePicker, children: /* @__PURE__ */ jsxs(View, { style:
|
|
2467
|
+
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles5.error : styles5.hint, children: helperMessage }) : null,
|
|
2468
|
+
/* @__PURE__ */ jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: closePicker, children: /* @__PURE__ */ jsxs(View, { style: styles5.modalRoot, children: [
|
|
2435
2469
|
/* @__PURE__ */ jsx(
|
|
2436
2470
|
Pressable,
|
|
2437
2471
|
{
|
|
2438
|
-
style:
|
|
2472
|
+
style: styles5.backdrop,
|
|
2439
2473
|
onPress: closePicker,
|
|
2440
2474
|
accessibilityRole: "button",
|
|
2441
2475
|
accessibilityLabel: labels?.closeCalendar ?? translations.closeCalendar
|
|
@@ -2445,7 +2479,7 @@ function DatePicker(props) {
|
|
|
2445
2479
|
View,
|
|
2446
2480
|
{
|
|
2447
2481
|
style: [
|
|
2448
|
-
|
|
2482
|
+
styles5.panelPosition,
|
|
2449
2483
|
{
|
|
2450
2484
|
top: dropdownTop,
|
|
2451
2485
|
left: panelLeft,
|
|
@@ -2493,7 +2527,7 @@ function DatePicker(props) {
|
|
|
2493
2527
|
}
|
|
2494
2528
|
);
|
|
2495
2529
|
}
|
|
2496
|
-
var
|
|
2530
|
+
var styles5 = StyleSheet.create({
|
|
2497
2531
|
wrapper: {
|
|
2498
2532
|
width: CALENDAR_FIELD_WIDTH,
|
|
2499
2533
|
maxWidth: "100%",
|
|
@@ -2569,6 +2603,6 @@ function LockIcon({
|
|
|
2569
2603
|
) });
|
|
2570
2604
|
}
|
|
2571
2605
|
|
|
2572
|
-
export { Calendar, CalendarIcon, CalendarLocaleProvider, CountryCodeSelector, DatePicker, LockIcon, PhoneInput, Select, calendarTranslations, countries, defaultCountry, findCountry, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, resolveCalendarLocale, resolveWeekdayLabels, useCalendarLocale };
|
|
2606
|
+
export { Calendar, CalendarIcon, CalendarLocaleProvider, CountryCodeSelector, CountryFlag, DatePicker, LockIcon, PhoneInput, Select, calendarTranslations, countries, countryCodeToFlagEmoji, defaultCountry, findCountry, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, getCountryFlagImageUri, resolveCalendarLocale, resolveWeekdayLabels, useCalendarLocale };
|
|
2573
2607
|
//# sourceMappingURL=index.js.map
|
|
2574
2608
|
//# sourceMappingURL=index.js.map
|