@scripso-homepad/ui 0.4.21 → 0.4.23
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/index.cjs +71 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -3
- package/dist/index.d.ts +23 -3
- package/dist/index.js +70 -41
- package/dist/index.js.map +1 -1
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +1 -1
- package/dist/web/index.d.ts +1 -1
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CountryCodeSelector.tsx +3 -7
- package/src/components/CountryFlag.tsx +37 -0
- package/src/components/Select.stories.tsx +1 -0
- package/src/components/Select.tsx +9 -2
- package/src/index.ts +8 -0
- 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/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";
|
|
@@ -74,6 +74,11 @@ interface SelectBaseProps {
|
|
|
74
74
|
hintClassName?: string;
|
|
75
75
|
/** Shorter option rows for compact filter-style dropdowns. */
|
|
76
76
|
compact?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* When true (default), clicking the already-selected option clears the selection
|
|
79
|
+
* in single-select mode. Set to false for required fields that must keep a value.
|
|
80
|
+
*/
|
|
81
|
+
allowDeselect?: boolean;
|
|
77
82
|
}
|
|
78
83
|
interface SingleSelectProps extends SelectBaseProps {
|
|
79
84
|
multiple?: false;
|
|
@@ -86,7 +91,7 @@ interface MultipleSelectProps extends SelectBaseProps {
|
|
|
86
91
|
onValueChange?: (value: string[]) => void;
|
|
87
92
|
}
|
|
88
93
|
type SelectProps = SingleSelectProps | MultipleSelectProps;
|
|
89
|
-
declare function Select({ label, placeholder, value, onValueChange, options, leftIcon, multiple, disabled, error, invalid, hint, containerStyle, fieldStyle, className, fieldClassName, menuClassName, labelClassName, errorClassName, hintClassName, compact, }: SelectProps): react.JSX.Element;
|
|
94
|
+
declare function Select({ label, placeholder, value, onValueChange, options, leftIcon, multiple, disabled, error, invalid, hint, containerStyle, fieldStyle, className, fieldClassName, menuClassName, labelClassName, errorClassName, hintClassName, compact, allowDeselect, }: SelectProps): react.JSX.Element;
|
|
90
95
|
|
|
91
96
|
interface PhoneInputProps extends Omit<TextInputProps, "style"> {
|
|
92
97
|
label?: string;
|
|
@@ -126,6 +131,21 @@ interface CountryCodeSelectorProps {
|
|
|
126
131
|
}
|
|
127
132
|
declare function CountryCodeSelector({ value, onValueChange, options, disabled, style, className, }: CountryCodeSelectorProps): react.JSX.Element;
|
|
128
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
|
+
|
|
129
149
|
type DateRange = {
|
|
130
150
|
start: Date;
|
|
131
151
|
end?: Date;
|
|
@@ -520,4 +540,4 @@ declare const shadows: {
|
|
|
520
540
|
};
|
|
521
541
|
};
|
|
522
542
|
|
|
523
|
-
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";
|
|
@@ -74,6 +74,11 @@ interface SelectBaseProps {
|
|
|
74
74
|
hintClassName?: string;
|
|
75
75
|
/** Shorter option rows for compact filter-style dropdowns. */
|
|
76
76
|
compact?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* When true (default), clicking the already-selected option clears the selection
|
|
79
|
+
* in single-select mode. Set to false for required fields that must keep a value.
|
|
80
|
+
*/
|
|
81
|
+
allowDeselect?: boolean;
|
|
77
82
|
}
|
|
78
83
|
interface SingleSelectProps extends SelectBaseProps {
|
|
79
84
|
multiple?: false;
|
|
@@ -86,7 +91,7 @@ interface MultipleSelectProps extends SelectBaseProps {
|
|
|
86
91
|
onValueChange?: (value: string[]) => void;
|
|
87
92
|
}
|
|
88
93
|
type SelectProps = SingleSelectProps | MultipleSelectProps;
|
|
89
|
-
declare function Select({ label, placeholder, value, onValueChange, options, leftIcon, multiple, disabled, error, invalid, hint, containerStyle, fieldStyle, className, fieldClassName, menuClassName, labelClassName, errorClassName, hintClassName, compact, }: SelectProps): react.JSX.Element;
|
|
94
|
+
declare function Select({ label, placeholder, value, onValueChange, options, leftIcon, multiple, disabled, error, invalid, hint, containerStyle, fieldStyle, className, fieldClassName, menuClassName, labelClassName, errorClassName, hintClassName, compact, allowDeselect, }: SelectProps): react.JSX.Element;
|
|
90
95
|
|
|
91
96
|
interface PhoneInputProps extends Omit<TextInputProps, "style"> {
|
|
92
97
|
label?: string;
|
|
@@ -126,6 +131,21 @@ interface CountryCodeSelectorProps {
|
|
|
126
131
|
}
|
|
127
132
|
declare function CountryCodeSelector({ value, onValueChange, options, disabled, style, className, }: CountryCodeSelectorProps): react.JSX.Element;
|
|
128
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
|
+
|
|
129
149
|
type DateRange = {
|
|
130
150
|
start: Date;
|
|
131
151
|
end?: Date;
|
|
@@ -520,4 +540,4 @@ declare const shadows: {
|
|
|
520
540
|
};
|
|
521
541
|
};
|
|
522
542
|
|
|
523
|
-
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
1
|
import { spacing, colors, fontWeight, fontSize, fonts, radii, INPUT_ICON_GAP, useApplyWebClassName, resolveInputVisualState, Label, getInputFieldStyles, inputFieldMetrics } from './chunk-KJYQA5OY.js';
|
|
2
2
|
export { Button, Input, Label, brand, buttonTypography, colors, emeraldGreen, fontSize, fontWeight, fonts, labelTypography, navy, radii, rubyRed, shadows, spacing, stormGray, typographyScale } from './chunk-KJYQA5OY.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
|
|
|
@@ -483,7 +483,8 @@ function Select({
|
|
|
483
483
|
labelClassName,
|
|
484
484
|
errorClassName,
|
|
485
485
|
hintClassName,
|
|
486
|
-
compact = false
|
|
486
|
+
compact = false,
|
|
487
|
+
allowDeselect = true
|
|
487
488
|
}) {
|
|
488
489
|
const wrapperRef = useRef(null);
|
|
489
490
|
const triggerRef = useRef(null);
|
|
@@ -587,6 +588,9 @@ function Select({
|
|
|
587
588
|
return;
|
|
588
589
|
}
|
|
589
590
|
if (selectedValues.includes(nextValue)) {
|
|
591
|
+
if (allowDeselect) {
|
|
592
|
+
onValueChange?.("");
|
|
593
|
+
}
|
|
590
594
|
closeMenu();
|
|
591
595
|
return;
|
|
592
596
|
}
|
|
@@ -882,6 +886,35 @@ function countryCodeToFlagEmoji(code) {
|
|
|
882
886
|
...upper.split("").map((char) => 127462 - 65 + char.charCodeAt(0))
|
|
883
887
|
);
|
|
884
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
|
+
});
|
|
885
918
|
var DROPDOWN_GAP = 10;
|
|
886
919
|
var DROPDOWN_HEIGHT = 186;
|
|
887
920
|
var DROPDOWN_PADDING = 8;
|
|
@@ -947,13 +980,13 @@ function CountryCodeSelector({
|
|
|
947
980
|
accessibilityRole: "button",
|
|
948
981
|
onPress: () => handleSelect(item.code),
|
|
949
982
|
style: [
|
|
950
|
-
|
|
951
|
-
isSelected &&
|
|
952
|
-
!isLast &&
|
|
983
|
+
styles3.option,
|
|
984
|
+
isSelected && styles3.optionSelected,
|
|
985
|
+
!isLast && styles3.optionSpacing
|
|
953
986
|
],
|
|
954
987
|
children: [
|
|
955
|
-
/* @__PURE__ */ jsx(
|
|
956
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
988
|
+
/* @__PURE__ */ jsx(CountryFlag, { code: item.code }),
|
|
989
|
+
/* @__PURE__ */ jsx(Text, { style: styles3.optionDialCode, children: item.dialCode })
|
|
957
990
|
]
|
|
958
991
|
},
|
|
959
992
|
item.code
|
|
@@ -963,8 +996,8 @@ function CountryCodeSelector({
|
|
|
963
996
|
ScrollView,
|
|
964
997
|
{
|
|
965
998
|
ref: scrollRef,
|
|
966
|
-
style:
|
|
967
|
-
contentContainerStyle:
|
|
999
|
+
style: styles3.dropdownScroll,
|
|
1000
|
+
contentContainerStyle: styles3.dropdownContent,
|
|
968
1001
|
keyboardShouldPersistTaps: "handled",
|
|
969
1002
|
showsVerticalScrollIndicator: true,
|
|
970
1003
|
bounces: false,
|
|
@@ -972,7 +1005,7 @@ function CountryCodeSelector({
|
|
|
972
1005
|
children: optionList
|
|
973
1006
|
}
|
|
974
1007
|
);
|
|
975
|
-
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [
|
|
1008
|
+
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [styles3.root, style], children: [
|
|
976
1009
|
/* @__PURE__ */ jsxs(
|
|
977
1010
|
Pressable,
|
|
978
1011
|
{
|
|
@@ -981,13 +1014,13 @@ function CountryCodeSelector({
|
|
|
981
1014
|
disabled,
|
|
982
1015
|
onPress: handleOpen,
|
|
983
1016
|
style: [
|
|
984
|
-
|
|
985
|
-
disabled ?
|
|
986
|
-
Platform.OS === "web" ?
|
|
1017
|
+
styles3.trigger,
|
|
1018
|
+
disabled ? styles3.triggerDisabled : styles3.triggerEnabled,
|
|
1019
|
+
Platform.OS === "web" ? styles3.triggerWeb : null
|
|
987
1020
|
],
|
|
988
1021
|
children: [
|
|
989
|
-
/* @__PURE__ */ jsx(
|
|
990
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1022
|
+
/* @__PURE__ */ jsx(CountryFlag, { code: selected.code }),
|
|
1023
|
+
/* @__PURE__ */ jsx(Text, { style: [styles3.dialCode, { color: textColor }], children: selected.dialCode }),
|
|
991
1024
|
/* @__PURE__ */ jsx(ChevronDownIcon, { size: CHEVRON_SIZE, color: colors.stormGray100 })
|
|
992
1025
|
]
|
|
993
1026
|
}
|
|
@@ -999,11 +1032,11 @@ function CountryCodeSelector({
|
|
|
999
1032
|
transparent: true,
|
|
1000
1033
|
animationType: "fade",
|
|
1001
1034
|
onRequestClose: closeDropdown,
|
|
1002
|
-
children: /* @__PURE__ */ jsx(Pressable, { style:
|
|
1035
|
+
children: /* @__PURE__ */ jsx(Pressable, { style: styles3.overlay, onPress: closeDropdown, children: anchor ? /* @__PURE__ */ jsx(
|
|
1003
1036
|
View,
|
|
1004
1037
|
{
|
|
1005
1038
|
style: [
|
|
1006
|
-
|
|
1039
|
+
styles3.dropdown,
|
|
1007
1040
|
{
|
|
1008
1041
|
top: dropdownTop,
|
|
1009
1042
|
left: anchor.x,
|
|
@@ -1017,7 +1050,7 @@ function CountryCodeSelector({
|
|
|
1017
1050
|
)
|
|
1018
1051
|
] });
|
|
1019
1052
|
}
|
|
1020
|
-
var
|
|
1053
|
+
var styles3 = StyleSheet.create({
|
|
1021
1054
|
root: {
|
|
1022
1055
|
alignSelf: "flex-start",
|
|
1023
1056
|
flexShrink: 0
|
|
@@ -1045,10 +1078,6 @@ var styles2 = StyleSheet.create({
|
|
|
1045
1078
|
triggerWeb: {
|
|
1046
1079
|
width: "max-content"
|
|
1047
1080
|
},
|
|
1048
|
-
flag: {
|
|
1049
|
-
fontSize: 18,
|
|
1050
|
-
lineHeight: 24
|
|
1051
|
-
},
|
|
1052
1081
|
dialCode: {
|
|
1053
1082
|
fontSize: fontSize.md,
|
|
1054
1083
|
fontWeight: fontWeight.medium,
|
|
@@ -1147,7 +1176,7 @@ function PhoneInput({
|
|
|
1147
1176
|
onChangeText?.(sanitizePhoneDigits(value));
|
|
1148
1177
|
}
|
|
1149
1178
|
const helperMessage = error ?? hint;
|
|
1150
|
-
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [
|
|
1179
|
+
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [styles4.wrapper, containerStyle], children: [
|
|
1151
1180
|
label ? /* @__PURE__ */ jsx(
|
|
1152
1181
|
Label,
|
|
1153
1182
|
{
|
|
@@ -1157,24 +1186,24 @@ function PhoneInput({
|
|
|
1157
1186
|
children: label
|
|
1158
1187
|
}
|
|
1159
1188
|
) : null,
|
|
1160
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1189
|
+
/* @__PURE__ */ jsxs(View, { style: styles4.row, children: [
|
|
1161
1190
|
/* @__PURE__ */ jsx(
|
|
1162
1191
|
CountryCodeSelector,
|
|
1163
1192
|
{
|
|
1164
1193
|
value: countryCode,
|
|
1165
1194
|
onValueChange: onCountryCodeChange,
|
|
1166
1195
|
disabled: isDisabled,
|
|
1167
|
-
style:
|
|
1196
|
+
style: styles4.countrySelector
|
|
1168
1197
|
}
|
|
1169
1198
|
),
|
|
1170
|
-
/* @__PURE__ */ jsx(View, { style: [phoneFieldStyles.outline,
|
|
1199
|
+
/* @__PURE__ */ jsx(View, { style: [phoneFieldStyles.outline, styles4.phoneOutline], children: /* @__PURE__ */ jsx(
|
|
1171
1200
|
View,
|
|
1172
1201
|
{
|
|
1173
1202
|
style: [
|
|
1174
1203
|
inputFieldMetrics.containerBase,
|
|
1175
1204
|
inputFieldMetrics.container,
|
|
1176
1205
|
phoneFieldStyles.container,
|
|
1177
|
-
|
|
1206
|
+
styles4.phoneField
|
|
1178
1207
|
],
|
|
1179
1208
|
children: /* @__PURE__ */ jsx(
|
|
1180
1209
|
TextInput,
|
|
@@ -1198,10 +1227,10 @@ function PhoneInput({
|
|
|
1198
1227
|
}
|
|
1199
1228
|
) })
|
|
1200
1229
|
] }),
|
|
1201
|
-
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ?
|
|
1230
|
+
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles4.error : styles4.hint, children: helperMessage }) : null
|
|
1202
1231
|
] });
|
|
1203
1232
|
}
|
|
1204
|
-
var
|
|
1233
|
+
var styles4 = StyleSheet.create({
|
|
1205
1234
|
wrapper: {
|
|
1206
1235
|
width: "100%",
|
|
1207
1236
|
gap: spacing.sm
|
|
@@ -2379,16 +2408,16 @@ function DatePicker(props) {
|
|
|
2379
2408
|
View,
|
|
2380
2409
|
{
|
|
2381
2410
|
ref: wrapperRef,
|
|
2382
|
-
style: [
|
|
2411
|
+
style: [styles5.wrapper, isFluidField && styles5.wrapperFluid, containerStyle],
|
|
2383
2412
|
children: [
|
|
2384
|
-
label ? /* @__PURE__ */ jsx(Label, { disabled, style:
|
|
2413
|
+
label ? /* @__PURE__ */ jsx(Label, { disabled, style: styles5.label, className: labelClassName, children: label }) : null,
|
|
2385
2414
|
/* @__PURE__ */ jsx(
|
|
2386
2415
|
View,
|
|
2387
2416
|
{
|
|
2388
2417
|
style: [
|
|
2389
2418
|
fieldStyles.outline,
|
|
2390
|
-
|
|
2391
|
-
isFluidField &&
|
|
2419
|
+
styles5.fieldOutline,
|
|
2420
|
+
isFluidField && styles5.fieldOutlineFluid,
|
|
2392
2421
|
fieldOutlineStyle
|
|
2393
2422
|
],
|
|
2394
2423
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -2401,7 +2430,7 @@ function DatePicker(props) {
|
|
|
2401
2430
|
onPress: openPicker,
|
|
2402
2431
|
style: [
|
|
2403
2432
|
calendarFieldMetrics.container,
|
|
2404
|
-
isFluidField &&
|
|
2433
|
+
isFluidField && styles5.fieldContainerFluid,
|
|
2405
2434
|
fieldStyles.container,
|
|
2406
2435
|
fieldStyle
|
|
2407
2436
|
],
|
|
@@ -2414,7 +2443,7 @@ function DatePicker(props) {
|
|
|
2414
2443
|
children: displayValue
|
|
2415
2444
|
}
|
|
2416
2445
|
),
|
|
2417
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
2446
|
+
/* @__PURE__ */ jsx(View, { style: styles5.iconSlot, children: /* @__PURE__ */ jsx(
|
|
2418
2447
|
CalendarIcon,
|
|
2419
2448
|
{
|
|
2420
2449
|
size: CALENDAR_FIELD_ICON_SIZE,
|
|
@@ -2426,12 +2455,12 @@ function DatePicker(props) {
|
|
|
2426
2455
|
)
|
|
2427
2456
|
}
|
|
2428
2457
|
),
|
|
2429
|
-
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ?
|
|
2430
|
-
/* @__PURE__ */ jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: closePicker, children: /* @__PURE__ */ jsxs(View, { style:
|
|
2458
|
+
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles5.error : styles5.hint, children: helperMessage }) : null,
|
|
2459
|
+
/* @__PURE__ */ jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: closePicker, children: /* @__PURE__ */ jsxs(View, { style: styles5.modalRoot, children: [
|
|
2431
2460
|
/* @__PURE__ */ jsx(
|
|
2432
2461
|
Pressable,
|
|
2433
2462
|
{
|
|
2434
|
-
style:
|
|
2463
|
+
style: styles5.backdrop,
|
|
2435
2464
|
onPress: closePicker,
|
|
2436
2465
|
accessibilityRole: "button",
|
|
2437
2466
|
accessibilityLabel: labels?.closeCalendar ?? translations.closeCalendar
|
|
@@ -2441,7 +2470,7 @@ function DatePicker(props) {
|
|
|
2441
2470
|
View,
|
|
2442
2471
|
{
|
|
2443
2472
|
style: [
|
|
2444
|
-
|
|
2473
|
+
styles5.panelPosition,
|
|
2445
2474
|
{
|
|
2446
2475
|
top: dropdownTop,
|
|
2447
2476
|
left: panelLeft,
|
|
@@ -2489,7 +2518,7 @@ function DatePicker(props) {
|
|
|
2489
2518
|
}
|
|
2490
2519
|
);
|
|
2491
2520
|
}
|
|
2492
|
-
var
|
|
2521
|
+
var styles5 = StyleSheet.create({
|
|
2493
2522
|
wrapper: {
|
|
2494
2523
|
width: CALENDAR_FIELD_WIDTH,
|
|
2495
2524
|
maxWidth: "100%",
|
|
@@ -2565,6 +2594,6 @@ function LockIcon({
|
|
|
2565
2594
|
) });
|
|
2566
2595
|
}
|
|
2567
2596
|
|
|
2568
|
-
export { Calendar, CalendarIcon, CalendarLocaleProvider, CountryCodeSelector, DatePicker, LockIcon, PhoneInput, Select, calendarTranslations, countries, defaultCountry, findCountry, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, resolveCalendarLocale, resolveWeekdayLabels, useCalendarLocale };
|
|
2597
|
+
export { Calendar, CalendarIcon, CalendarLocaleProvider, CountryCodeSelector, CountryFlag, DatePicker, LockIcon, PhoneInput, Select, calendarTranslations, countries, countryCodeToFlagEmoji, defaultCountry, findCountry, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, getCountryFlagImageUri, resolveCalendarLocale, resolveWeekdayLabels, useCalendarLocale };
|
|
2569
2598
|
//# sourceMappingURL=index.js.map
|
|
2570
2599
|
//# sourceMappingURL=index.js.map
|