@scripso-homepad/ui 0.4.8 → 0.4.10
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-DAOLVE64.js → chunk-YSDLHEJ7.js} +204 -14
- package/dist/chunk-YSDLHEJ7.js.map +1 -0
- package/dist/index.cjs +130 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +176 -323
- package/dist/index.js.map +1 -1
- package/dist/web/index.cjs +882 -30
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.css +161 -0
- package/dist/web/index.css.map +1 -1
- package/dist/web/index.d.cts +90 -3
- package/dist/web/index.d.ts +90 -3
- package/dist/web/index.js +645 -19
- package/dist/web/index.js.map +1 -1
- package/package.json +9 -3
- package/src/components/Button.tsx +10 -3
- package/src/components/DatePicker.tsx +37 -3
- package/src/components/Select.tsx +1 -1
- package/src/web/components/ConfirmModal.stories.tsx +55 -0
- package/src/web/components/ConfirmModal.tsx +116 -0
- package/src/web/components/Drawer.stories.tsx +234 -0
- package/src/web/components/Drawer.tsx +169 -0
- package/src/web/components/HistoryTimeline.tsx +46 -0
- package/src/web/components/Modal.stories.tsx +130 -0
- package/src/web/components/Modal.tsx +162 -0
- package/src/web/components/TableActionButton.tsx +9 -4
- package/src/web/components/Toaster.stories.tsx +106 -0
- package/src/web/components/Toaster.tsx +92 -0
- package/src/web/components/ToasterProvider.tsx +6 -0
- package/src/web/components/drawer-scroll.css +41 -0
- package/src/web/components/sonner-toast.css +141 -0
- package/src/web/icons/TimelineCheckIcon.tsx +24 -0
- package/src/web/icons/ToastIcons.tsx +119 -0
- package/src/web/index.ts +26 -0
- package/src/web/mutation-toast.ts +33 -0
- package/src/web/toast.ts +1 -0
- package/dist/chunk-DAOLVE64.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,196 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { Input, Label, brand, buttonTypography, colors, emeraldGreen, fontSize, fontWeight, fonts, labelTypography, navy, radii, rubyRed, shadows, spacing, stormGray } from './chunk-
|
|
1
|
+
import { spacing, colors, fontSize, fontWeight, fonts, radii, INPUT_ICON_GAP, useApplyWebClassName, resolveInputVisualState, Label, getInputFieldStyles, inputFieldMetrics } from './chunk-YSDLHEJ7.js';
|
|
2
|
+
export { Button, Input, Label, brand, buttonTypography, colors, emeraldGreen, fontSize, fontWeight, fonts, labelTypography, navy, radii, rubyRed, shadows, spacing, stormGray } from './chunk-YSDLHEJ7.js';
|
|
3
3
|
import { createContext, useRef, useState, useMemo, useEffect, useLayoutEffect, useContext, isValidElement, cloneElement } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
4
|
+
import { Platform, StyleSheet, Animated, Easing, Pressable, Text, View, Modal, ScrollView, TextInput, Dimensions } from 'react-native';
|
|
5
|
+
import Svg2, { Path } from 'react-native-svg';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
// src/icons/arrowUpRightPath.ts
|
|
9
|
-
var ARROW_UP_RIGHT_PATH = "M14.1667 14.1668V5.8335H5.83333M14.1667 5.8335L5.83333 14.1668";
|
|
10
|
-
function ArrowUpRightIcon({
|
|
11
|
-
size = 20,
|
|
12
|
-
color = "#082640",
|
|
13
|
-
strokeWidth = 2
|
|
14
|
-
}) {
|
|
15
|
-
return /* @__PURE__ */ jsx(Svg3, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx(
|
|
16
|
-
Path,
|
|
17
|
-
{
|
|
18
|
-
d: ARROW_UP_RIGHT_PATH,
|
|
19
|
-
stroke: color,
|
|
20
|
-
strokeWidth,
|
|
21
|
-
strokeLinecap: "round",
|
|
22
|
-
strokeLinejoin: "round"
|
|
23
|
-
}
|
|
24
|
-
) });
|
|
25
|
-
}
|
|
26
|
-
var variantConfig = {
|
|
27
|
-
white: {
|
|
28
|
-
backgroundColor: colors.white,
|
|
29
|
-
textColor: colors.slateBlue,
|
|
30
|
-
iconBadgeBackgroundColor: colors.stormGray150,
|
|
31
|
-
iconColor: colors.navy
|
|
32
|
-
},
|
|
33
|
-
primary: {
|
|
34
|
-
backgroundColor: colors.navy,
|
|
35
|
-
textColor: colors.stormGray0,
|
|
36
|
-
iconBadgeBackgroundColor: colors.white,
|
|
37
|
-
iconColor: colors.navy
|
|
38
|
-
},
|
|
39
|
-
green: {
|
|
40
|
-
backgroundColor: colors.green,
|
|
41
|
-
textColor: colors.stormGray0,
|
|
42
|
-
iconBadgeBackgroundColor: colors.white,
|
|
43
|
-
iconColor: colors.green
|
|
44
|
-
},
|
|
45
|
-
gray: {
|
|
46
|
-
backgroundColor: colors.stormGray50,
|
|
47
|
-
textColor: colors.slateBlue,
|
|
48
|
-
iconBadgeBackgroundColor: colors.stormGray150,
|
|
49
|
-
iconColor: colors.navy
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
var sizeConfig = {
|
|
53
|
-
lg: {
|
|
54
|
-
borderRadius: 16,
|
|
55
|
-
paddingTop: 8,
|
|
56
|
-
paddingRight: 8,
|
|
57
|
-
paddingBottom: 8,
|
|
58
|
-
paddingLeft: 24,
|
|
59
|
-
paddingHorizontalCentered: 24,
|
|
60
|
-
text: buttonTypography.lg,
|
|
61
|
-
iconContainerSize: 36,
|
|
62
|
-
iconContainerRadius: 12,
|
|
63
|
-
iconContainerPadding: 8,
|
|
64
|
-
iconSize: 20
|
|
65
|
-
},
|
|
66
|
-
sm: {
|
|
67
|
-
borderRadius: 12,
|
|
68
|
-
paddingTop: 8,
|
|
69
|
-
paddingRight: 8,
|
|
70
|
-
paddingBottom: 8,
|
|
71
|
-
paddingLeft: 16,
|
|
72
|
-
paddingHorizontalCentered: 16,
|
|
73
|
-
text: buttonTypography.sm,
|
|
74
|
-
iconContainerSize: 32,
|
|
75
|
-
iconContainerRadius: 8,
|
|
76
|
-
iconContainerPadding: 8,
|
|
77
|
-
iconSize: 16
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
function Button({
|
|
81
|
-
title,
|
|
82
|
-
children,
|
|
83
|
-
onPress,
|
|
84
|
-
disabled = false,
|
|
85
|
-
variant = "primary",
|
|
86
|
-
size = "lg",
|
|
87
|
-
showIcon = false,
|
|
88
|
-
icon,
|
|
89
|
-
style,
|
|
90
|
-
textStyle,
|
|
91
|
-
className,
|
|
92
|
-
textClassName
|
|
93
|
-
}) {
|
|
94
|
-
const containerRef = useRef(null);
|
|
95
|
-
const textRef = useRef(null);
|
|
96
|
-
const preset = variantConfig[variant];
|
|
97
|
-
const metrics = sizeConfig[size];
|
|
98
|
-
useApplyWebClassName(containerRef, className);
|
|
99
|
-
useApplyWebClassName(textRef, textClassName);
|
|
100
|
-
const label = typeof children !== "undefined" ? children : title;
|
|
101
|
-
const hasCustomChildren = typeof children !== "undefined";
|
|
102
|
-
const customIcon = icon != null && typeof icon !== "boolean" ? icon : void 0;
|
|
103
|
-
const hasIcon = showIcon || icon === true || customIcon != null;
|
|
104
|
-
const iconNode = customIcon ?? /* @__PURE__ */ jsx(ArrowUpRightIcon, { size: metrics.iconSize, color: preset.iconColor });
|
|
105
|
-
const containerStyle = [
|
|
106
|
-
styles.base,
|
|
107
|
-
{
|
|
108
|
-
borderRadius: metrics.borderRadius,
|
|
109
|
-
backgroundColor: preset.backgroundColor,
|
|
110
|
-
paddingTop: metrics.paddingTop,
|
|
111
|
-
paddingBottom: metrics.paddingBottom,
|
|
112
|
-
paddingLeft: hasIcon ? metrics.paddingLeft : metrics.paddingHorizontalCentered,
|
|
113
|
-
paddingRight: hasIcon ? metrics.paddingRight : metrics.paddingHorizontalCentered
|
|
114
|
-
},
|
|
115
|
-
hasIcon ? styles.withIcon : styles.centered,
|
|
116
|
-
disabled && styles.disabled,
|
|
117
|
-
style
|
|
118
|
-
];
|
|
119
|
-
const labelStyle = [
|
|
120
|
-
styles.label,
|
|
121
|
-
metrics.text,
|
|
122
|
-
{ color: preset.textColor },
|
|
123
|
-
Platform.OS === "android" ? styles.labelAndroid : null,
|
|
124
|
-
!hasIcon && styles.labelCentered,
|
|
125
|
-
hasIcon && styles.labelWithIcon,
|
|
126
|
-
textStyle
|
|
127
|
-
];
|
|
128
|
-
return /* @__PURE__ */ jsxs(
|
|
129
|
-
TouchableOpacity,
|
|
130
|
-
{
|
|
131
|
-
ref: containerRef,
|
|
132
|
-
style: containerStyle,
|
|
133
|
-
onPress,
|
|
134
|
-
disabled,
|
|
135
|
-
activeOpacity: 0.7,
|
|
136
|
-
accessibilityRole: "button",
|
|
137
|
-
accessibilityState: { disabled },
|
|
138
|
-
children: [
|
|
139
|
-
hasCustomChildren ? children : /* @__PURE__ */ jsx(Text, { ref: textRef, style: labelStyle, children: label }),
|
|
140
|
-
hasIcon ? /* @__PURE__ */ jsx(
|
|
141
|
-
View,
|
|
142
|
-
{
|
|
143
|
-
style: [
|
|
144
|
-
styles.iconContainer,
|
|
145
|
-
{
|
|
146
|
-
width: metrics.iconContainerSize,
|
|
147
|
-
height: metrics.iconContainerSize,
|
|
148
|
-
borderRadius: metrics.iconContainerRadius,
|
|
149
|
-
padding: metrics.iconContainerPadding,
|
|
150
|
-
backgroundColor: preset.iconBadgeBackgroundColor
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
children: iconNode
|
|
154
|
-
}
|
|
155
|
-
) : null
|
|
156
|
-
]
|
|
157
|
-
}
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
var styles = StyleSheet.create({
|
|
161
|
-
base: {
|
|
162
|
-
flexDirection: "row",
|
|
163
|
-
alignItems: "center",
|
|
164
|
-
borderWidth: 0
|
|
165
|
-
},
|
|
166
|
-
centered: {
|
|
167
|
-
justifyContent: "center"
|
|
168
|
-
},
|
|
169
|
-
withIcon: {
|
|
170
|
-
justifyContent: "space-between"
|
|
171
|
-
},
|
|
172
|
-
disabled: {
|
|
173
|
-
opacity: 0.6
|
|
174
|
-
},
|
|
175
|
-
label: {},
|
|
176
|
-
labelAndroid: {
|
|
177
|
-
includeFontPadding: false
|
|
178
|
-
},
|
|
179
|
-
labelCentered: {
|
|
180
|
-
textAlign: "center"
|
|
181
|
-
},
|
|
182
|
-
labelWithIcon: {
|
|
183
|
-
flex: 1,
|
|
184
|
-
flexShrink: 1,
|
|
185
|
-
marginRight: 8
|
|
186
|
-
},
|
|
187
|
-
iconContainer: {
|
|
188
|
-
alignItems: "center",
|
|
189
|
-
justifyContent: "center",
|
|
190
|
-
flexShrink: 0
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
|
|
194
8
|
// src/icons/chevronDownPath.ts
|
|
195
9
|
var CHEVRON_DOWN_PATH = "M4 6L8 10L12 6";
|
|
196
10
|
var CHEVRON_DOWN_PATH_20 = "M5 7.5L10 12.5L15 7.5";
|
|
@@ -201,7 +15,7 @@ function ChevronDownIcon({
|
|
|
201
15
|
}) {
|
|
202
16
|
const useLarge = size >= 20;
|
|
203
17
|
return /* @__PURE__ */ jsx(
|
|
204
|
-
|
|
18
|
+
Svg2,
|
|
205
19
|
{
|
|
206
20
|
width: size,
|
|
207
21
|
height: size,
|
|
@@ -604,7 +418,7 @@ function Select({
|
|
|
604
418
|
const optionHeight = compact ? SELECT_OPTION_HEIGHT_COMPACT : SELECT_OPTION_HEIGHT;
|
|
605
419
|
const needsScroll = useMemo(
|
|
606
420
|
() => resolveSelectDropdownContentHeight(options.length, optionHeight) > SELECT_DROPDOWN_MAX_HEIGHT - SELECT_DROPDOWN_PADDING * 2,
|
|
607
|
-
[
|
|
421
|
+
[optionHeight, options.length]
|
|
608
422
|
);
|
|
609
423
|
useApplyWebClassName(wrapperRef, className);
|
|
610
424
|
useApplyWebClassName(triggerRef, fieldClassName);
|
|
@@ -717,13 +531,13 @@ function Select({
|
|
|
717
531
|
},
|
|
718
532
|
style: [
|
|
719
533
|
selectDropdownMetrics.option,
|
|
720
|
-
compact &&
|
|
534
|
+
compact && styles.optionCompact,
|
|
721
535
|
{ height: optionHeight, minHeight: optionHeight, maxHeight: optionHeight },
|
|
722
536
|
isSelected && selectDropdownMetrics.optionSelected,
|
|
723
|
-
compact && isSelected &&
|
|
537
|
+
compact && isSelected && styles.optionSelectedCompact,
|
|
724
538
|
isHighlighted && !isSelected && !option.disabled ? selectDropdownMetrics.optionHighlighted : null,
|
|
725
|
-
!isLast &&
|
|
726
|
-
option.disabled &&
|
|
539
|
+
!isLast && styles.optionSpacing,
|
|
540
|
+
option.disabled && styles.optionDisabled
|
|
727
541
|
],
|
|
728
542
|
children: /* @__PURE__ */ jsx(
|
|
729
543
|
Text,
|
|
@@ -731,7 +545,7 @@ function Select({
|
|
|
731
545
|
style: [
|
|
732
546
|
selectDropdownMetrics.optionLabel,
|
|
733
547
|
isSelected && selectDropdownMetrics.optionLabelSelected,
|
|
734
|
-
option.disabled &&
|
|
548
|
+
option.disabled && styles.optionLabelDisabled
|
|
735
549
|
],
|
|
736
550
|
numberOfLines: 1,
|
|
737
551
|
children: option.label
|
|
@@ -742,8 +556,8 @@ function Select({
|
|
|
742
556
|
);
|
|
743
557
|
});
|
|
744
558
|
const dropdownTop = anchor ? resolveSelectDropdownTop(anchor, dropdownHeight) : 0;
|
|
745
|
-
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [
|
|
746
|
-
label ? /* @__PURE__ */ jsx(Label, { disabled, style:
|
|
559
|
+
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [styles.wrapper, containerStyle], children: [
|
|
560
|
+
label ? /* @__PURE__ */ jsx(Label, { disabled, style: styles.label, className: labelClassName, children: label }) : null,
|
|
747
561
|
/* @__PURE__ */ jsx(View, { style: fieldStyles.outline, children: /* @__PURE__ */ jsxs(
|
|
748
562
|
Pressable,
|
|
749
563
|
{
|
|
@@ -754,11 +568,11 @@ function Select({
|
|
|
754
568
|
onPress: open ? closeMenu : openMenu,
|
|
755
569
|
style: [selectFieldMetrics.container, fieldStyles.container, fieldStyle],
|
|
756
570
|
children: [
|
|
757
|
-
leftIcon ? /* @__PURE__ */ jsx(View, { style:
|
|
571
|
+
leftIcon ? /* @__PURE__ */ jsx(View, { style: styles.iconSlot, children: renderSelectIcon(leftIcon, fieldStyles.icon) }) : null,
|
|
758
572
|
/* @__PURE__ */ jsx(
|
|
759
573
|
View,
|
|
760
574
|
{
|
|
761
|
-
style:
|
|
575
|
+
style: styles.valueContainer,
|
|
762
576
|
onLayout: (event) => {
|
|
763
577
|
setValueContainerWidth(event.nativeEvent.layout.width);
|
|
764
578
|
},
|
|
@@ -779,7 +593,7 @@ function Select({
|
|
|
779
593
|
/* @__PURE__ */ jsx(
|
|
780
594
|
Animated.View,
|
|
781
595
|
{
|
|
782
|
-
style: [
|
|
596
|
+
style: [styles.iconSlot, { transform: [{ rotate: chevronRotate }] }],
|
|
783
597
|
children: /* @__PURE__ */ jsx(
|
|
784
598
|
ChevronDownIcon,
|
|
785
599
|
{
|
|
@@ -792,14 +606,14 @@ function Select({
|
|
|
792
606
|
]
|
|
793
607
|
}
|
|
794
608
|
) }),
|
|
795
|
-
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ?
|
|
796
|
-
/* @__PURE__ */ jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: closeMenu, children: /* @__PURE__ */ jsx(Pressable, { style:
|
|
609
|
+
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles.error : styles.hint, children: helperMessage }) : null,
|
|
610
|
+
/* @__PURE__ */ jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: closeMenu, children: /* @__PURE__ */ jsx(Pressable, { style: styles.overlay, onPress: closeMenu, children: anchor ? /* @__PURE__ */ jsx(
|
|
797
611
|
View,
|
|
798
612
|
{
|
|
799
613
|
ref: menuRef,
|
|
800
614
|
style: [
|
|
801
615
|
selectDropdownMetrics.menu,
|
|
802
|
-
|
|
616
|
+
styles.dropdown,
|
|
803
617
|
{
|
|
804
618
|
top: dropdownTop,
|
|
805
619
|
left: anchor.x,
|
|
@@ -811,20 +625,20 @@ function Select({
|
|
|
811
625
|
ScrollView,
|
|
812
626
|
{
|
|
813
627
|
ref: scrollRef,
|
|
814
|
-
style:
|
|
815
|
-
contentContainerStyle:
|
|
628
|
+
style: styles.dropdownScroll,
|
|
629
|
+
contentContainerStyle: styles.dropdownContent,
|
|
816
630
|
keyboardShouldPersistTaps: "handled",
|
|
817
631
|
showsVerticalScrollIndicator: true,
|
|
818
632
|
bounces: false,
|
|
819
633
|
nestedScrollEnabled: true,
|
|
820
634
|
children: optionList
|
|
821
635
|
}
|
|
822
|
-
) : /* @__PURE__ */ jsx(View, { style:
|
|
636
|
+
) : /* @__PURE__ */ jsx(View, { style: styles.dropdownContent, children: optionList })
|
|
823
637
|
}
|
|
824
638
|
) : null }) })
|
|
825
639
|
] });
|
|
826
640
|
}
|
|
827
|
-
var
|
|
641
|
+
var styles = StyleSheet.create({
|
|
828
642
|
wrapper: {
|
|
829
643
|
width: "100%",
|
|
830
644
|
gap: SELECT_LABEL_GAP
|
|
@@ -1051,13 +865,13 @@ function CountryCodeSelector({
|
|
|
1051
865
|
accessibilityRole: "button",
|
|
1052
866
|
onPress: () => handleSelect(item.code),
|
|
1053
867
|
style: [
|
|
1054
|
-
|
|
1055
|
-
isSelected &&
|
|
1056
|
-
!isLast &&
|
|
868
|
+
styles2.option,
|
|
869
|
+
isSelected && styles2.optionSelected,
|
|
870
|
+
!isLast && styles2.optionSpacing
|
|
1057
871
|
],
|
|
1058
872
|
children: [
|
|
1059
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
1060
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
873
|
+
/* @__PURE__ */ jsx(Text, { style: styles2.flag, children: countryCodeToFlagEmoji(item.code) }),
|
|
874
|
+
/* @__PURE__ */ jsx(Text, { style: styles2.optionDialCode, children: item.dialCode })
|
|
1061
875
|
]
|
|
1062
876
|
},
|
|
1063
877
|
item.code
|
|
@@ -1067,8 +881,8 @@ function CountryCodeSelector({
|
|
|
1067
881
|
ScrollView,
|
|
1068
882
|
{
|
|
1069
883
|
ref: scrollRef,
|
|
1070
|
-
style:
|
|
1071
|
-
contentContainerStyle:
|
|
884
|
+
style: styles2.dropdownScroll,
|
|
885
|
+
contentContainerStyle: styles2.dropdownContent,
|
|
1072
886
|
keyboardShouldPersistTaps: "handled",
|
|
1073
887
|
showsVerticalScrollIndicator: true,
|
|
1074
888
|
bounces: false,
|
|
@@ -1076,7 +890,7 @@ function CountryCodeSelector({
|
|
|
1076
890
|
children: optionList
|
|
1077
891
|
}
|
|
1078
892
|
);
|
|
1079
|
-
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [
|
|
893
|
+
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [styles2.root, style], children: [
|
|
1080
894
|
/* @__PURE__ */ jsxs(
|
|
1081
895
|
Pressable,
|
|
1082
896
|
{
|
|
@@ -1085,13 +899,13 @@ function CountryCodeSelector({
|
|
|
1085
899
|
disabled,
|
|
1086
900
|
onPress: handleOpen,
|
|
1087
901
|
style: [
|
|
1088
|
-
|
|
1089
|
-
disabled ?
|
|
1090
|
-
Platform.OS === "web" ?
|
|
902
|
+
styles2.trigger,
|
|
903
|
+
disabled ? styles2.triggerDisabled : styles2.triggerEnabled,
|
|
904
|
+
Platform.OS === "web" ? styles2.triggerWeb : null
|
|
1091
905
|
],
|
|
1092
906
|
children: [
|
|
1093
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
1094
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
907
|
+
/* @__PURE__ */ jsx(Text, { style: styles2.flag, children: countryCodeToFlagEmoji(selected.code) }),
|
|
908
|
+
/* @__PURE__ */ jsx(Text, { style: [styles2.dialCode, { color: textColor }], children: selected.dialCode }),
|
|
1095
909
|
/* @__PURE__ */ jsx(ChevronDownIcon, { size: CHEVRON_SIZE, color: colors.stormGray100 })
|
|
1096
910
|
]
|
|
1097
911
|
}
|
|
@@ -1103,11 +917,11 @@ function CountryCodeSelector({
|
|
|
1103
917
|
transparent: true,
|
|
1104
918
|
animationType: "fade",
|
|
1105
919
|
onRequestClose: closeDropdown,
|
|
1106
|
-
children: /* @__PURE__ */ jsx(Pressable, { style:
|
|
920
|
+
children: /* @__PURE__ */ jsx(Pressable, { style: styles2.overlay, onPress: closeDropdown, children: anchor ? /* @__PURE__ */ jsx(
|
|
1107
921
|
View,
|
|
1108
922
|
{
|
|
1109
923
|
style: [
|
|
1110
|
-
|
|
924
|
+
styles2.dropdown,
|
|
1111
925
|
{
|
|
1112
926
|
top: dropdownTop,
|
|
1113
927
|
left: anchor.x,
|
|
@@ -1121,7 +935,7 @@ function CountryCodeSelector({
|
|
|
1121
935
|
)
|
|
1122
936
|
] });
|
|
1123
937
|
}
|
|
1124
|
-
var
|
|
938
|
+
var styles2 = StyleSheet.create({
|
|
1125
939
|
root: {
|
|
1126
940
|
alignSelf: "flex-start",
|
|
1127
941
|
flexShrink: 0
|
|
@@ -1242,26 +1056,26 @@ function PhoneInput({
|
|
|
1242
1056
|
onBlur?.(event);
|
|
1243
1057
|
}
|
|
1244
1058
|
const helperMessage = error ?? hint;
|
|
1245
|
-
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [
|
|
1059
|
+
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [styles3.wrapper, containerStyle], children: [
|
|
1246
1060
|
label ? /* @__PURE__ */ jsx(Label, { disabled: isDisabled, className: labelClassName, children: label }) : null,
|
|
1247
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1061
|
+
/* @__PURE__ */ jsxs(View, { style: styles3.row, children: [
|
|
1248
1062
|
/* @__PURE__ */ jsx(
|
|
1249
1063
|
CountryCodeSelector,
|
|
1250
1064
|
{
|
|
1251
1065
|
value: countryCode,
|
|
1252
1066
|
onValueChange: onCountryCodeChange,
|
|
1253
1067
|
disabled: isDisabled,
|
|
1254
|
-
style:
|
|
1068
|
+
style: styles3.countrySelector
|
|
1255
1069
|
}
|
|
1256
1070
|
),
|
|
1257
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1258
|
-
/* @__PURE__ */ jsx(View, { style: [phoneFieldStyles.outline,
|
|
1071
|
+
/* @__PURE__ */ jsxs(View, { style: styles3.phoneColumn, children: [
|
|
1072
|
+
/* @__PURE__ */ jsx(View, { style: [phoneFieldStyles.outline, styles3.phoneOutline], children: /* @__PURE__ */ jsx(
|
|
1259
1073
|
View,
|
|
1260
1074
|
{
|
|
1261
1075
|
style: [
|
|
1262
1076
|
inputFieldMetrics.container,
|
|
1263
1077
|
phoneFieldStyles.container,
|
|
1264
|
-
|
|
1078
|
+
styles3.phoneField
|
|
1265
1079
|
],
|
|
1266
1080
|
children: /* @__PURE__ */ jsx(
|
|
1267
1081
|
TextInput,
|
|
@@ -1283,12 +1097,12 @@ function PhoneInput({
|
|
|
1283
1097
|
)
|
|
1284
1098
|
}
|
|
1285
1099
|
) }),
|
|
1286
|
-
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ?
|
|
1100
|
+
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles3.error : styles3.hint, children: helperMessage }) : null
|
|
1287
1101
|
] })
|
|
1288
1102
|
] })
|
|
1289
1103
|
] });
|
|
1290
1104
|
}
|
|
1291
|
-
var
|
|
1105
|
+
var styles3 = StyleSheet.create({
|
|
1292
1106
|
wrapper: {
|
|
1293
1107
|
width: "100%",
|
|
1294
1108
|
gap: spacing.sm
|
|
@@ -1332,7 +1146,7 @@ function ChevronLeftIcon({
|
|
|
1332
1146
|
color = "#151a1e",
|
|
1333
1147
|
strokeWidth = 2
|
|
1334
1148
|
}) {
|
|
1335
|
-
return /* @__PURE__ */ jsx(
|
|
1149
|
+
return /* @__PURE__ */ jsx(Svg2, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx(
|
|
1336
1150
|
Path,
|
|
1337
1151
|
{
|
|
1338
1152
|
d: CHEVRON_LEFT_PATH,
|
|
@@ -1348,7 +1162,7 @@ function ChevronRightIcon({
|
|
|
1348
1162
|
color = "#151a1e",
|
|
1349
1163
|
strokeWidth = 2
|
|
1350
1164
|
}) {
|
|
1351
|
-
return /* @__PURE__ */ jsx(
|
|
1165
|
+
return /* @__PURE__ */ jsx(Svg2, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx(
|
|
1352
1166
|
Path,
|
|
1353
1167
|
{
|
|
1354
1168
|
d: CHEVRON_RIGHT_PATH,
|
|
@@ -2328,7 +2142,7 @@ function CalendarIcon({
|
|
|
2328
2142
|
color = "#C7CDD1",
|
|
2329
2143
|
strokeWidth = 2
|
|
2330
2144
|
}) {
|
|
2331
|
-
return /* @__PURE__ */ jsx(
|
|
2145
|
+
return /* @__PURE__ */ jsx(Svg2, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx(
|
|
2332
2146
|
Path,
|
|
2333
2147
|
{
|
|
2334
2148
|
d: CALENDAR_ICON_BODY_PATH,
|
|
@@ -2358,6 +2172,8 @@ function DatePicker(props) {
|
|
|
2358
2172
|
containerStyle,
|
|
2359
2173
|
className,
|
|
2360
2174
|
fieldClassName,
|
|
2175
|
+
fieldStyle,
|
|
2176
|
+
fieldOutlineStyle,
|
|
2361
2177
|
panelClassName,
|
|
2362
2178
|
labelClassName,
|
|
2363
2179
|
errorClassName,
|
|
@@ -2451,108 +2267,145 @@ function DatePicker(props) {
|
|
|
2451
2267
|
closePicker();
|
|
2452
2268
|
}
|
|
2453
2269
|
}
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2270
|
+
const isFluidField = Boolean(fieldStyle) || Boolean(fieldOutlineStyle);
|
|
2271
|
+
return /* @__PURE__ */ jsxs(
|
|
2272
|
+
View,
|
|
2273
|
+
{
|
|
2274
|
+
ref: wrapperRef,
|
|
2275
|
+
style: [styles4.wrapper, isFluidField && styles4.wrapperFluid, containerStyle],
|
|
2276
|
+
children: [
|
|
2277
|
+
label ? /* @__PURE__ */ jsx(Label, { disabled, style: styles4.label, className: labelClassName, children: label }) : null,
|
|
2278
|
+
/* @__PURE__ */ jsx(
|
|
2279
|
+
View,
|
|
2280
|
+
{
|
|
2281
|
+
style: [
|
|
2282
|
+
fieldStyles.outline,
|
|
2283
|
+
styles4.fieldOutline,
|
|
2284
|
+
isFluidField && styles4.fieldOutlineFluid,
|
|
2285
|
+
fieldOutlineStyle
|
|
2286
|
+
],
|
|
2287
|
+
children: /* @__PURE__ */ jsxs(
|
|
2288
|
+
Pressable,
|
|
2289
|
+
{
|
|
2290
|
+
ref: triggerRef,
|
|
2291
|
+
accessibilityRole: "button",
|
|
2292
|
+
accessibilityState: { disabled, expanded: open },
|
|
2293
|
+
disabled,
|
|
2294
|
+
onPress: openPicker,
|
|
2295
|
+
style: [
|
|
2296
|
+
calendarFieldMetrics.container,
|
|
2297
|
+
isFluidField && styles4.fieldContainerFluid,
|
|
2298
|
+
fieldStyles.container,
|
|
2299
|
+
fieldStyle
|
|
2300
|
+
],
|
|
2301
|
+
children: [
|
|
2302
|
+
/* @__PURE__ */ jsx(
|
|
2303
|
+
Text,
|
|
2304
|
+
{
|
|
2305
|
+
style: [calendarFieldMetrics.value, valueTextStyle],
|
|
2306
|
+
numberOfLines: 1,
|
|
2307
|
+
children: displayValue
|
|
2308
|
+
}
|
|
2309
|
+
),
|
|
2310
|
+
/* @__PURE__ */ jsx(View, { style: styles4.iconSlot, children: /* @__PURE__ */ jsx(
|
|
2311
|
+
CalendarIcon,
|
|
2312
|
+
{
|
|
2313
|
+
size: CALENDAR_FIELD_ICON_SIZE,
|
|
2314
|
+
color: disabled ? colors.stormGray200 : colors.stormGray150
|
|
2315
|
+
}
|
|
2316
|
+
) })
|
|
2317
|
+
]
|
|
2318
|
+
}
|
|
2319
|
+
)
|
|
2320
|
+
}
|
|
2321
|
+
),
|
|
2322
|
+
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles4.error : styles4.hint, children: helperMessage }) : null,
|
|
2323
|
+
/* @__PURE__ */ jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: closePicker, children: /* @__PURE__ */ jsxs(View, { style: styles4.modalRoot, children: [
|
|
2466
2324
|
/* @__PURE__ */ jsx(
|
|
2467
|
-
|
|
2325
|
+
Pressable,
|
|
2468
2326
|
{
|
|
2469
|
-
style:
|
|
2470
|
-
|
|
2471
|
-
|
|
2327
|
+
style: styles4.backdrop,
|
|
2328
|
+
onPress: closePicker,
|
|
2329
|
+
accessibilityRole: "button",
|
|
2330
|
+
accessibilityLabel: labels?.closeCalendar ?? translations.closeCalendar
|
|
2472
2331
|
}
|
|
2473
2332
|
),
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
{
|
|
2477
|
-
size: CALENDAR_FIELD_ICON_SIZE,
|
|
2478
|
-
color: disabled ? colors.stormGray200 : colors.stormGray150
|
|
2479
|
-
}
|
|
2480
|
-
) })
|
|
2481
|
-
]
|
|
2482
|
-
}
|
|
2483
|
-
) }),
|
|
2484
|
-
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles5.error : styles5.hint, children: helperMessage }) : null,
|
|
2485
|
-
/* @__PURE__ */ jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: closePicker, children: /* @__PURE__ */ jsxs(View, { style: styles5.modalRoot, children: [
|
|
2486
|
-
/* @__PURE__ */ jsx(
|
|
2487
|
-
Pressable,
|
|
2488
|
-
{
|
|
2489
|
-
style: styles5.backdrop,
|
|
2490
|
-
onPress: closePicker,
|
|
2491
|
-
accessibilityRole: "button",
|
|
2492
|
-
accessibilityLabel: labels?.closeCalendar ?? translations.closeCalendar
|
|
2493
|
-
}
|
|
2494
|
-
),
|
|
2495
|
-
anchor ? /* @__PURE__ */ jsx(
|
|
2496
|
-
View,
|
|
2497
|
-
{
|
|
2498
|
-
style: [
|
|
2499
|
-
styles5.panelPosition,
|
|
2500
|
-
{
|
|
2501
|
-
top: dropdownTop,
|
|
2502
|
-
left: panelLeft,
|
|
2503
|
-
width: panelWidth,
|
|
2504
|
-
height: CALENDAR_PANEL_HEIGHT
|
|
2505
|
-
}
|
|
2506
|
-
],
|
|
2507
|
-
children: props.mode === "range" ? /* @__PURE__ */ jsx(
|
|
2508
|
-
Calendar,
|
|
2509
|
-
{
|
|
2510
|
-
mode: "range",
|
|
2511
|
-
value: props.value,
|
|
2512
|
-
onChange: handleRangeSelect,
|
|
2513
|
-
viewDate,
|
|
2514
|
-
defaultViewDate: resolvedDefaultViewDate,
|
|
2515
|
-
onViewDateChange,
|
|
2516
|
-
locale: resolvedLocale,
|
|
2517
|
-
labels,
|
|
2518
|
-
minDate,
|
|
2519
|
-
maxDate,
|
|
2520
|
-
today,
|
|
2521
|
-
className: panelClassName
|
|
2522
|
-
}
|
|
2523
|
-
) : /* @__PURE__ */ jsx(
|
|
2524
|
-
Calendar,
|
|
2333
|
+
anchor ? /* @__PURE__ */ jsx(
|
|
2334
|
+
View,
|
|
2525
2335
|
{
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2336
|
+
style: [
|
|
2337
|
+
styles4.panelPosition,
|
|
2338
|
+
{
|
|
2339
|
+
top: dropdownTop,
|
|
2340
|
+
left: panelLeft,
|
|
2341
|
+
width: panelWidth,
|
|
2342
|
+
height: CALENDAR_PANEL_HEIGHT
|
|
2343
|
+
}
|
|
2344
|
+
],
|
|
2345
|
+
children: props.mode === "range" ? /* @__PURE__ */ jsx(
|
|
2346
|
+
Calendar,
|
|
2347
|
+
{
|
|
2348
|
+
mode: "range",
|
|
2349
|
+
value: props.value,
|
|
2350
|
+
onChange: handleRangeSelect,
|
|
2351
|
+
viewDate,
|
|
2352
|
+
defaultViewDate: resolvedDefaultViewDate,
|
|
2353
|
+
onViewDateChange,
|
|
2354
|
+
locale: resolvedLocale,
|
|
2355
|
+
labels,
|
|
2356
|
+
minDate,
|
|
2357
|
+
maxDate,
|
|
2358
|
+
today,
|
|
2359
|
+
className: panelClassName
|
|
2360
|
+
}
|
|
2361
|
+
) : /* @__PURE__ */ jsx(
|
|
2362
|
+
Calendar,
|
|
2363
|
+
{
|
|
2364
|
+
mode: "single",
|
|
2365
|
+
value: props.value,
|
|
2366
|
+
onChange: handleSingleSelect,
|
|
2367
|
+
viewDate,
|
|
2368
|
+
defaultViewDate: resolvedDefaultViewDate,
|
|
2369
|
+
onViewDateChange,
|
|
2370
|
+
locale: resolvedLocale,
|
|
2371
|
+
labels,
|
|
2372
|
+
minDate,
|
|
2373
|
+
maxDate,
|
|
2374
|
+
today,
|
|
2375
|
+
className: panelClassName
|
|
2376
|
+
}
|
|
2377
|
+
)
|
|
2538
2378
|
}
|
|
2539
|
-
)
|
|
2540
|
-
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2379
|
+
) : null
|
|
2380
|
+
] }) })
|
|
2381
|
+
]
|
|
2382
|
+
}
|
|
2383
|
+
);
|
|
2544
2384
|
}
|
|
2545
|
-
var
|
|
2385
|
+
var styles4 = StyleSheet.create({
|
|
2546
2386
|
wrapper: {
|
|
2547
2387
|
width: CALENDAR_FIELD_WIDTH,
|
|
2548
2388
|
maxWidth: "100%",
|
|
2549
2389
|
gap: SELECT_LABEL_GAP
|
|
2550
2390
|
},
|
|
2391
|
+
wrapperFluid: {
|
|
2392
|
+
width: "100%"
|
|
2393
|
+
},
|
|
2551
2394
|
fieldOutline: {
|
|
2552
2395
|
width: CALENDAR_FIELD_WIDTH,
|
|
2553
2396
|
maxWidth: "100%",
|
|
2554
2397
|
alignSelf: "flex-start"
|
|
2555
2398
|
},
|
|
2399
|
+
fieldOutlineFluid: {
|
|
2400
|
+
width: "100%",
|
|
2401
|
+
alignSelf: "stretch"
|
|
2402
|
+
},
|
|
2403
|
+
fieldContainerFluid: {
|
|
2404
|
+
width: "100%",
|
|
2405
|
+
minWidth: 0,
|
|
2406
|
+
maxWidth: "100%",
|
|
2407
|
+
alignSelf: "stretch"
|
|
2408
|
+
},
|
|
2556
2409
|
label: {
|
|
2557
2410
|
...calendarLabelTypography
|
|
2558
2411
|
},
|
|
@@ -2593,7 +2446,7 @@ function LockIcon({
|
|
|
2593
2446
|
color = "#c7cdd1",
|
|
2594
2447
|
strokeWidth = 2
|
|
2595
2448
|
}) {
|
|
2596
|
-
return /* @__PURE__ */ jsx(
|
|
2449
|
+
return /* @__PURE__ */ jsx(Svg2, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx(
|
|
2597
2450
|
Path,
|
|
2598
2451
|
{
|
|
2599
2452
|
d: LOCK_ICON_PATH,
|
|
@@ -2605,6 +2458,6 @@ function LockIcon({
|
|
|
2605
2458
|
) });
|
|
2606
2459
|
}
|
|
2607
2460
|
|
|
2608
|
-
export {
|
|
2461
|
+
export { Calendar, CalendarIcon, CalendarLocaleProvider, CountryCodeSelector, DatePicker, LockIcon, PhoneInput, Select, calendarTranslations, countries, defaultCountry, findCountry, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, resolveCalendarLocale, resolveWeekdayLabels, useCalendarLocale };
|
|
2609
2462
|
//# sourceMappingURL=index.js.map
|
|
2610
2463
|
//# sourceMappingURL=index.js.map
|