@vellira-ui/react-native 2.33.0 → 2.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +201 -130
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
// src/components/Dropdown/Content/DropdownContent.tsx
|
|
2
|
-
import {
|
|
2
|
+
import { useEffect, useMemo as useMemo3, useRef, useState } from "react";
|
|
3
|
+
import {
|
|
4
|
+
AccessibilityInfo,
|
|
5
|
+
Animated,
|
|
6
|
+
Modal,
|
|
7
|
+
Pressable,
|
|
8
|
+
StyleSheet as StyleSheet2,
|
|
9
|
+
View
|
|
10
|
+
} from "react-native";
|
|
3
11
|
|
|
4
12
|
// src/theme/ThemeProvider.tsx
|
|
5
13
|
import { useMemo } from "react";
|
|
@@ -138,29 +146,92 @@ function DropdownContent({
|
|
|
138
146
|
}) {
|
|
139
147
|
const styles = useThemeStyles(createStyles);
|
|
140
148
|
const isSheet = presentation === "sheet";
|
|
149
|
+
const animation = useRef(new Animated.Value(isOpen ? 1 : 0)).current;
|
|
150
|
+
const [reduceMotion, setReduceMotion] = useState(false);
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
AccessibilityInfo.isReduceMotionEnabled?.().then(setReduceMotion);
|
|
153
|
+
const subscription = AccessibilityInfo.addEventListener?.(
|
|
154
|
+
"reduceMotionChanged",
|
|
155
|
+
setReduceMotion
|
|
156
|
+
);
|
|
157
|
+
return () => {
|
|
158
|
+
subscription?.remove();
|
|
159
|
+
};
|
|
160
|
+
}, []);
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (!isOpen) {
|
|
163
|
+
animation.setValue(0);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (reduceMotion) {
|
|
167
|
+
animation.setValue(1);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
animation.setValue(0);
|
|
171
|
+
Animated.timing(animation, {
|
|
172
|
+
toValue: 1,
|
|
173
|
+
duration: isSheet ? 220 : 160,
|
|
174
|
+
useNativeDriver: true
|
|
175
|
+
}).start();
|
|
176
|
+
}, [animation, isOpen, isSheet, reduceMotion]);
|
|
177
|
+
const backdropAnimatedStyle = useMemo3(
|
|
178
|
+
() => ({
|
|
179
|
+
opacity: animation.interpolate({
|
|
180
|
+
inputRange: [0, 1],
|
|
181
|
+
outputRange: [0, 1]
|
|
182
|
+
})
|
|
183
|
+
}),
|
|
184
|
+
[animation]
|
|
185
|
+
);
|
|
186
|
+
const menuAnimatedStyle = useMemo3(() => {
|
|
187
|
+
const translateY = animation.interpolate({
|
|
188
|
+
inputRange: [0, 1],
|
|
189
|
+
outputRange: isSheet ? [24, 0] : [-6, 0]
|
|
190
|
+
});
|
|
191
|
+
const scale = animation.interpolate({
|
|
192
|
+
inputRange: [0, 1],
|
|
193
|
+
outputRange: isSheet ? [1, 1] : [0.98, 1]
|
|
194
|
+
});
|
|
195
|
+
return {
|
|
196
|
+
opacity: animation,
|
|
197
|
+
transform: [{ translateY }, { scale }]
|
|
198
|
+
};
|
|
199
|
+
}, [animation, isSheet]);
|
|
141
200
|
return /* @__PURE__ */ jsx2(
|
|
142
201
|
Modal,
|
|
143
202
|
{
|
|
144
203
|
transparent: true,
|
|
145
204
|
visible: isOpen,
|
|
146
|
-
animationType:
|
|
205
|
+
animationType: "none",
|
|
147
206
|
onRequestClose: onClose,
|
|
148
207
|
children: /* @__PURE__ */ jsxs(View, { style: [styles.modalRoot, styles[presentation]], children: [
|
|
149
208
|
/* @__PURE__ */ jsx2(
|
|
150
|
-
|
|
209
|
+
Animated.View,
|
|
151
210
|
{
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
211
|
+
pointerEvents: "box-none",
|
|
212
|
+
style: [styles.backdrop, backdropAnimatedStyle],
|
|
213
|
+
children: /* @__PURE__ */ jsx2(
|
|
214
|
+
Pressable,
|
|
215
|
+
{
|
|
216
|
+
accessibilityRole: "button",
|
|
217
|
+
accessibilityLabel: "Close menu",
|
|
218
|
+
style: StyleSheet2.absoluteFill,
|
|
219
|
+
onPress: onClose
|
|
220
|
+
}
|
|
221
|
+
)
|
|
156
222
|
}
|
|
157
223
|
),
|
|
158
224
|
/* @__PURE__ */ jsx2(
|
|
159
|
-
View,
|
|
225
|
+
Animated.View,
|
|
160
226
|
{
|
|
161
227
|
accessibilityRole: "menu",
|
|
162
228
|
accessibilityLabel,
|
|
163
|
-
style: [
|
|
229
|
+
style: [
|
|
230
|
+
styles.menu,
|
|
231
|
+
styles[`${presentation}Menu`],
|
|
232
|
+
contentStyle,
|
|
233
|
+
menuAnimatedStyle
|
|
234
|
+
],
|
|
164
235
|
children
|
|
165
236
|
}
|
|
166
237
|
)
|
|
@@ -171,10 +242,10 @@ function DropdownContent({
|
|
|
171
242
|
DropdownContent.displayName = "DropdownContent";
|
|
172
243
|
|
|
173
244
|
// src/components/Dropdown/Dropdown.tsx
|
|
174
|
-
import { useCallback, useEffect as
|
|
245
|
+
import { useCallback, useEffect as useEffect3, useMemo as useMemo4, useRef as useRef3 } from "react";
|
|
175
246
|
import { useDropdown } from "@vellira-ui/core";
|
|
176
247
|
import {
|
|
177
|
-
AccessibilityInfo,
|
|
248
|
+
AccessibilityInfo as AccessibilityInfo2,
|
|
178
249
|
findNodeHandle,
|
|
179
250
|
FlatList,
|
|
180
251
|
Text as Text4,
|
|
@@ -186,8 +257,8 @@ import {
|
|
|
186
257
|
import { Text } from "react-native";
|
|
187
258
|
|
|
188
259
|
// src/components/Dropdown/Group/DropdownGroup.styles.ts
|
|
189
|
-
import { StyleSheet as
|
|
190
|
-
var createStyles2 = (theme) =>
|
|
260
|
+
import { StyleSheet as StyleSheet3 } from "react-native";
|
|
261
|
+
var createStyles2 = (theme) => StyleSheet3.create({
|
|
191
262
|
groupLabel: {
|
|
192
263
|
paddingHorizontal: theme.tokens.spacing[4],
|
|
193
264
|
paddingVertical: theme.tokens.spacing[2],
|
|
@@ -304,8 +375,8 @@ import { cloneElement, isValidElement as isValidElement2 } from "react";
|
|
|
304
375
|
import { Pressable as Pressable2, Text as Text2 } from "react-native";
|
|
305
376
|
|
|
306
377
|
// src/components/Dropdown/Item/DropdownItem.styles.ts
|
|
307
|
-
import { StyleSheet as
|
|
308
|
-
var createStyles3 = (theme) =>
|
|
378
|
+
import { StyleSheet as StyleSheet4 } from "react-native";
|
|
379
|
+
var createStyles3 = (theme) => StyleSheet4.create({
|
|
309
380
|
item: {
|
|
310
381
|
minWidth: 0,
|
|
311
382
|
minHeight: 44,
|
|
@@ -433,8 +504,8 @@ DropdownItem.displayName = "DropdownItem";
|
|
|
433
504
|
import { View as View2 } from "react-native";
|
|
434
505
|
|
|
435
506
|
// src/components/Dropdown/Separator/DropdownSeparator.styles.ts
|
|
436
|
-
import { StyleSheet as
|
|
437
|
-
var createStyles4 = (theme) =>
|
|
507
|
+
import { StyleSheet as StyleSheet5 } from "react-native";
|
|
508
|
+
var createStyles4 = (theme) => StyleSheet5.create({
|
|
438
509
|
separator: {
|
|
439
510
|
height: 1,
|
|
440
511
|
backgroundColor: theme.components.dropdown.separator.bg
|
|
@@ -453,16 +524,16 @@ DropdownSeparator.displayName = "DropdownSeparator";
|
|
|
453
524
|
import {
|
|
454
525
|
cloneElement as cloneElement2,
|
|
455
526
|
isValidElement as isValidElement3,
|
|
456
|
-
useEffect,
|
|
457
|
-
useRef,
|
|
458
|
-
useState
|
|
527
|
+
useEffect as useEffect2,
|
|
528
|
+
useRef as useRef2,
|
|
529
|
+
useState as useState2
|
|
459
530
|
} from "react";
|
|
460
531
|
import { ChevronDown } from "@vellira-ui/icons";
|
|
461
|
-
import { Animated, Pressable as Pressable3, Text as Text3, View as View3 } from "react-native";
|
|
532
|
+
import { Animated as Animated2, Pressable as Pressable3, Text as Text3, View as View3 } from "react-native";
|
|
462
533
|
|
|
463
534
|
// src/components/Dropdown/Trigger/DropdownTrigger.styles.ts
|
|
464
|
-
import { StyleSheet as
|
|
465
|
-
var createStyles5 = (theme) =>
|
|
535
|
+
import { StyleSheet as StyleSheet6 } from "react-native";
|
|
536
|
+
var createStyles5 = (theme) => StyleSheet6.create({
|
|
466
537
|
trigger: {
|
|
467
538
|
alignItems: "center",
|
|
468
539
|
justifyContent: "center",
|
|
@@ -590,10 +661,10 @@ function DropdownTrigger({
|
|
|
590
661
|
}[size];
|
|
591
662
|
const hasIcon = Boolean(icon);
|
|
592
663
|
const isIconOnly = !trigger && hasIcon && !showArrow;
|
|
593
|
-
const [isPressed, setIsPressed] =
|
|
594
|
-
const rotateAnim =
|
|
595
|
-
|
|
596
|
-
|
|
664
|
+
const [isPressed, setIsPressed] = useState2(false);
|
|
665
|
+
const rotateAnim = useRef2(new Animated2.Value(isOpen ? 1 : 0)).current;
|
|
666
|
+
useEffect2(() => {
|
|
667
|
+
Animated2.timing(rotateAnim, {
|
|
597
668
|
toValue: isOpen ? 1 : 0,
|
|
598
669
|
duration: 180,
|
|
599
670
|
useNativeDriver: true
|
|
@@ -680,7 +751,7 @@ function DropdownTrigger({
|
|
|
680
751
|
}
|
|
681
752
|
)),
|
|
682
753
|
showArrow && /* @__PURE__ */ jsx6(
|
|
683
|
-
|
|
754
|
+
Animated2.View,
|
|
684
755
|
{
|
|
685
756
|
style: [styles.arrow, { transform: [{ rotate: arrowRotate }] }],
|
|
686
757
|
children: arrow
|
|
@@ -693,8 +764,8 @@ function DropdownTrigger({
|
|
|
693
764
|
DropdownTrigger.displayName = "DropdownTrigger";
|
|
694
765
|
|
|
695
766
|
// src/components/Dropdown/Dropdown.styles.ts
|
|
696
|
-
import { StyleSheet as
|
|
697
|
-
var createStyles6 = (theme) =>
|
|
767
|
+
import { StyleSheet as StyleSheet7 } from "react-native";
|
|
768
|
+
var createStyles6 = (theme) => StyleSheet7.create({
|
|
698
769
|
root: {
|
|
699
770
|
alignSelf: "flex-start"
|
|
700
771
|
},
|
|
@@ -737,14 +808,14 @@ function DropdownRoot({
|
|
|
737
808
|
}) {
|
|
738
809
|
const styles = useThemeStyles(createStyles6);
|
|
739
810
|
const { width } = useWindowDimensions();
|
|
740
|
-
const triggerRef =
|
|
741
|
-
const parsed =
|
|
811
|
+
const triggerRef = useRef3(null);
|
|
812
|
+
const parsed = useMemo4(() => parseDropdownChildren(children), [children]);
|
|
742
813
|
const resolvedPresentation = presentation === "auto" ? width < 768 ? "sheet" : "popover" : presentation;
|
|
743
|
-
const menuAccessibilityLabel =
|
|
814
|
+
const menuAccessibilityLabel = useMemo4(() => {
|
|
744
815
|
if (accessibilityLabel) return accessibilityLabel;
|
|
745
816
|
return typeof label === "string" ? label : "Menu";
|
|
746
817
|
}, [accessibilityLabel, label]);
|
|
747
|
-
const navigableItems =
|
|
818
|
+
const navigableItems = useMemo4(
|
|
748
819
|
() => parsed.items.map((item) => ({
|
|
749
820
|
disabled: item.disabled,
|
|
750
821
|
label: item.label,
|
|
@@ -761,17 +832,17 @@ function DropdownRoot({
|
|
|
761
832
|
getItemValue: (item) => item.value,
|
|
762
833
|
getItemText: (item) => typeof item.label === "string" ? item.label : item.value
|
|
763
834
|
});
|
|
764
|
-
|
|
835
|
+
useEffect3(() => {
|
|
765
836
|
if (!isOpen) return;
|
|
766
|
-
|
|
837
|
+
AccessibilityInfo2.announceForAccessibility(
|
|
767
838
|
`${menuAccessibilityLabel} opened`
|
|
768
839
|
);
|
|
769
840
|
}, [isOpen, menuAccessibilityLabel]);
|
|
770
841
|
const focusTrigger = useCallback(() => {
|
|
771
842
|
if (typeof findNodeHandle !== "function") return;
|
|
772
843
|
const handle = findNodeHandle(triggerRef.current);
|
|
773
|
-
if (handle &&
|
|
774
|
-
|
|
844
|
+
if (handle && AccessibilityInfo2.setAccessibilityFocus) {
|
|
845
|
+
AccessibilityInfo2.setAccessibilityFocus(handle);
|
|
775
846
|
}
|
|
776
847
|
}, []);
|
|
777
848
|
const closeAndFocusTrigger = useCallback(() => {
|
|
@@ -936,8 +1007,8 @@ import { Children as Children2, cloneElement as cloneElement3, isValidElement as
|
|
|
936
1007
|
import { Text as Text5, View as View5 } from "react-native";
|
|
937
1008
|
|
|
938
1009
|
// src/components/Modal/Body/ModalBody.styles.ts
|
|
939
|
-
import { StyleSheet as
|
|
940
|
-
var createStyles7 = (theme) =>
|
|
1010
|
+
import { StyleSheet as StyleSheet8 } from "react-native";
|
|
1011
|
+
var createStyles7 = (theme) => StyleSheet8.create({
|
|
941
1012
|
body: {
|
|
942
1013
|
paddingBottom: theme.tokens.spacing[4]
|
|
943
1014
|
},
|
|
@@ -979,8 +1050,8 @@ ModalBody.displayName = "ModalBody";
|
|
|
979
1050
|
import { View as View6 } from "react-native";
|
|
980
1051
|
|
|
981
1052
|
// src/components/Modal/Content/ModalContent.styles.ts
|
|
982
|
-
import { StyleSheet as
|
|
983
|
-
var createStyles8 = (theme) =>
|
|
1053
|
+
import { StyleSheet as StyleSheet9 } from "react-native";
|
|
1054
|
+
var createStyles8 = (theme) => StyleSheet9.create({
|
|
984
1055
|
content: {
|
|
985
1056
|
width: "100%",
|
|
986
1057
|
maxWidth: 600,
|
|
@@ -1014,8 +1085,8 @@ ModalContent.displayName = "ModalContent";
|
|
|
1014
1085
|
import { View as View7 } from "react-native";
|
|
1015
1086
|
|
|
1016
1087
|
// src/components/Modal/Footer/ModalFooter.styles.ts
|
|
1017
|
-
import { StyleSheet as
|
|
1018
|
-
var createStyles9 = (theme) =>
|
|
1088
|
+
import { StyleSheet as StyleSheet10 } from "react-native";
|
|
1089
|
+
var createStyles9 = (theme) => StyleSheet10.create({
|
|
1019
1090
|
footer: {
|
|
1020
1091
|
flexDirection: "row",
|
|
1021
1092
|
gap: theme.tokens.spacing[3],
|
|
@@ -1050,8 +1121,8 @@ var useModalContext = () => {
|
|
|
1050
1121
|
var ModalContext_default = ModalContext;
|
|
1051
1122
|
|
|
1052
1123
|
// src/components/Modal/Header/ModalHeader.styles.ts
|
|
1053
|
-
import { StyleSheet as
|
|
1054
|
-
var createStyles10 = (theme) =>
|
|
1124
|
+
import { StyleSheet as StyleSheet11 } from "react-native";
|
|
1125
|
+
var createStyles10 = (theme) => StyleSheet11.create({
|
|
1055
1126
|
header: {
|
|
1056
1127
|
alignItems: "center",
|
|
1057
1128
|
flexDirection: "row",
|
|
@@ -1118,8 +1189,8 @@ import { useModal } from "@vellira-ui/core";
|
|
|
1118
1189
|
import { Modal as RNModal, Pressable as Pressable5, View as View9 } from "react-native";
|
|
1119
1190
|
|
|
1120
1191
|
// src/components/Modal/Modal.styles.ts
|
|
1121
|
-
import { StyleSheet as
|
|
1122
|
-
var createStyles11 = (theme) =>
|
|
1192
|
+
import { StyleSheet as StyleSheet12 } from "react-native";
|
|
1193
|
+
var createStyles11 = (theme) => StyleSheet12.create({
|
|
1123
1194
|
overlay: {
|
|
1124
1195
|
alignItems: "center",
|
|
1125
1196
|
flex: 1,
|
|
@@ -1127,7 +1198,7 @@ var createStyles11 = (theme) => StyleSheet11.create({
|
|
|
1127
1198
|
padding: theme.tokens.spacing[5]
|
|
1128
1199
|
},
|
|
1129
1200
|
backdrop: {
|
|
1130
|
-
...
|
|
1201
|
+
...StyleSheet12.absoluteFill,
|
|
1131
1202
|
backgroundColor: theme.components.modal.overlay.bg
|
|
1132
1203
|
}
|
|
1133
1204
|
});
|
|
@@ -1212,9 +1283,9 @@ import { useId } from "react";
|
|
|
1212
1283
|
import { Text as Text7, View as View10 } from "react-native";
|
|
1213
1284
|
|
|
1214
1285
|
// src/patterns/FormField/FormField.styles.ts
|
|
1215
|
-
import { StyleSheet as
|
|
1286
|
+
import { StyleSheet as StyleSheet13 } from "react-native";
|
|
1216
1287
|
var fontWeight = (value) => value;
|
|
1217
|
-
var createStyles12 = (theme) =>
|
|
1288
|
+
var createStyles12 = (theme) => StyleSheet13.create({
|
|
1218
1289
|
root: {
|
|
1219
1290
|
width: "100%",
|
|
1220
1291
|
minWidth: 0,
|
|
@@ -1438,8 +1509,8 @@ function FormField({
|
|
|
1438
1509
|
}
|
|
1439
1510
|
|
|
1440
1511
|
// src/components/RadioGroup/RadioGroup.styles.ts
|
|
1441
|
-
import { StyleSheet as
|
|
1442
|
-
var createStyles13 = (theme) =>
|
|
1512
|
+
import { StyleSheet as StyleSheet14 } from "react-native";
|
|
1513
|
+
var createStyles13 = (theme) => StyleSheet14.create({
|
|
1443
1514
|
items: {
|
|
1444
1515
|
width: "100%",
|
|
1445
1516
|
minWidth: 0,
|
|
@@ -1553,7 +1624,7 @@ var RadioGroup = forwardRef(
|
|
|
1553
1624
|
RadioGroup.displayName = "RadioGroup";
|
|
1554
1625
|
|
|
1555
1626
|
// src/components/Select/Content/SelectContent.tsx
|
|
1556
|
-
import { useEffect as
|
|
1627
|
+
import { useEffect as useEffect5, useRef as useRef4, useState as useState3 } from "react";
|
|
1557
1628
|
import { FlatList as FlatList2, Pressable as Pressable10, Text as Text12, View as View21 } from "react-native";
|
|
1558
1629
|
|
|
1559
1630
|
// src/components/Select/Group/SelectGroup.tsx
|
|
@@ -1691,8 +1762,8 @@ var parseSelectChildren = (children) => {
|
|
|
1691
1762
|
};
|
|
1692
1763
|
|
|
1693
1764
|
// src/components/Select/Group/SelectGroup.styles.ts
|
|
1694
|
-
import { StyleSheet as
|
|
1695
|
-
var createGroupStyles = (theme) =>
|
|
1765
|
+
import { StyleSheet as StyleSheet15 } from "react-native";
|
|
1766
|
+
var createGroupStyles = (theme) => StyleSheet15.create({
|
|
1696
1767
|
groupLabel: {
|
|
1697
1768
|
paddingHorizontal: theme.tokens.spacing[3],
|
|
1698
1769
|
paddingTop: theme.tokens.spacing[4],
|
|
@@ -1818,8 +1889,8 @@ import { Check } from "@vellira-ui/icons";
|
|
|
1818
1889
|
import { Pressable as Pressable7, Text as Text9, View as View13 } from "react-native";
|
|
1819
1890
|
|
|
1820
1891
|
// src/components/Select/Item/SelectItem.styles.ts
|
|
1821
|
-
import { StyleSheet as
|
|
1822
|
-
var createItemStyles = (theme) =>
|
|
1892
|
+
import { StyleSheet as StyleSheet16 } from "react-native";
|
|
1893
|
+
var createItemStyles = (theme) => StyleSheet16.create({
|
|
1823
1894
|
option: {
|
|
1824
1895
|
minHeight: 44,
|
|
1825
1896
|
flexDirection: "row",
|
|
@@ -2017,8 +2088,8 @@ var SelectItemIcon = createSelectSlot(
|
|
|
2017
2088
|
import { Pressable as Pressable8 } from "react-native";
|
|
2018
2089
|
|
|
2019
2090
|
// src/components/Select/Presentation/SelectPresentation.styles.ts
|
|
2020
|
-
import { StyleSheet as
|
|
2021
|
-
var createPresentationStyles = (theme) =>
|
|
2091
|
+
import { StyleSheet as StyleSheet17 } from "react-native";
|
|
2092
|
+
var createPresentationStyles = (theme) => StyleSheet17.create({
|
|
2022
2093
|
modalRoot: {
|
|
2023
2094
|
flex: 1
|
|
2024
2095
|
},
|
|
@@ -2040,7 +2111,7 @@ var createPresentationStyles = (theme) => StyleSheet16.create({
|
|
|
2040
2111
|
justifyContent: "flex-end"
|
|
2041
2112
|
},
|
|
2042
2113
|
backdrop: {
|
|
2043
|
-
...
|
|
2114
|
+
...StyleSheet17.absoluteFill,
|
|
2044
2115
|
backgroundColor: theme.semantic.overlay.backdrop
|
|
2045
2116
|
},
|
|
2046
2117
|
content: {
|
|
@@ -2274,8 +2345,8 @@ var SelectSheet = ({
|
|
|
2274
2345
|
SelectSheet.displayName = "Select.Sheet";
|
|
2275
2346
|
|
|
2276
2347
|
// src/components/Select/Content/SelectContent.styles.ts
|
|
2277
|
-
import { StyleSheet as
|
|
2278
|
-
var createContentStyles = (theme) =>
|
|
2348
|
+
import { StyleSheet as StyleSheet18 } from "react-native";
|
|
2349
|
+
var createContentStyles = (theme) => StyleSheet18.create({
|
|
2279
2350
|
toolbar: {
|
|
2280
2351
|
minHeight: 52,
|
|
2281
2352
|
flexDirection: "row",
|
|
@@ -2400,13 +2471,13 @@ var SelectLoadingState = () => {
|
|
|
2400
2471
|
SelectLoadingState.displayName = "Select.LoadingState";
|
|
2401
2472
|
|
|
2402
2473
|
// src/components/Select/Content/SelectSearch.tsx
|
|
2403
|
-
import { useEffect as
|
|
2474
|
+
import { useEffect as useEffect4 } from "react";
|
|
2404
2475
|
import { Close as Close2, Search } from "@vellira-ui/icons";
|
|
2405
2476
|
import { Pressable as Pressable9, TextInput, View as View20 } from "react-native";
|
|
2406
2477
|
|
|
2407
2478
|
// src/components/Select/Content/SelectSearch.styles.ts
|
|
2408
|
-
import { StyleSheet as
|
|
2409
|
-
var createSearchStyles = (theme) =>
|
|
2479
|
+
import { StyleSheet as StyleSheet19 } from "react-native";
|
|
2480
|
+
var createSearchStyles = (theme) => StyleSheet19.create({
|
|
2410
2481
|
searchWrap: {
|
|
2411
2482
|
flexDirection: "row",
|
|
2412
2483
|
alignItems: "center",
|
|
@@ -2466,7 +2537,7 @@ var SelectSearchField = () => {
|
|
|
2466
2537
|
virtual
|
|
2467
2538
|
} = useSelectContext();
|
|
2468
2539
|
const shouldAutoFocus = !virtual || selectedRowIndex === 0;
|
|
2469
|
-
|
|
2540
|
+
useEffect4(() => {
|
|
2470
2541
|
if (!shouldAutoFocus) return;
|
|
2471
2542
|
const focusTimer = setTimeout(() => {
|
|
2472
2543
|
searchInputRef.current?.focus();
|
|
@@ -2534,8 +2605,8 @@ var SelectContent = createSelectSlot(
|
|
|
2534
2605
|
);
|
|
2535
2606
|
var SelectContentSurface = () => {
|
|
2536
2607
|
const styles = useThemeStyles(createContentStyles);
|
|
2537
|
-
const wasOpenRef =
|
|
2538
|
-
const [openCycle, setOpenCycle] =
|
|
2608
|
+
const wasOpenRef = useRef4(false);
|
|
2609
|
+
const [openCycle, setOpenCycle] = useState3(0);
|
|
2539
2610
|
const context = useSelectContext();
|
|
2540
2611
|
const {
|
|
2541
2612
|
isOpen,
|
|
@@ -2562,7 +2633,7 @@ var SelectContentSurface = () => {
|
|
|
2562
2633
|
} = context;
|
|
2563
2634
|
const shouldSeedSelectedPosition = Boolean(context.virtual) && selectedRowIndex > 0 && query === "";
|
|
2564
2635
|
const initialScrollIndex = shouldSeedSelectedPosition ? selectedRowIndex : void 0;
|
|
2565
|
-
|
|
2636
|
+
useEffect5(() => {
|
|
2566
2637
|
if (isOpen && !wasOpenRef.current) {
|
|
2567
2638
|
setOpenCycle((cycle) => cycle + 1);
|
|
2568
2639
|
}
|
|
@@ -2704,12 +2775,12 @@ var SelectContentSurface = () => {
|
|
|
2704
2775
|
SelectContentSurface.displayName = "Select.ContentSurface";
|
|
2705
2776
|
|
|
2706
2777
|
// src/components/Select/Root/SelectRoot.tsx
|
|
2707
|
-
import { useMemo as
|
|
2778
|
+
import { useMemo as useMemo7, useRef as useRef5, useState as useState5 } from "react";
|
|
2708
2779
|
import { useSelect } from "@vellira-ui/core";
|
|
2709
2780
|
import { View as View23 } from "react-native";
|
|
2710
2781
|
|
|
2711
2782
|
// src/components/Select/internal/useSelectAccessibility.ts
|
|
2712
|
-
import { AccessibilityInfo as
|
|
2783
|
+
import { AccessibilityInfo as AccessibilityInfo3 } from "react-native";
|
|
2713
2784
|
var useSelectAccessibility = ({
|
|
2714
2785
|
accessibilityLabel,
|
|
2715
2786
|
accessibilityHint,
|
|
@@ -2730,23 +2801,23 @@ var useSelectAccessibility = ({
|
|
|
2730
2801
|
resolvedLabel,
|
|
2731
2802
|
resolvedHint,
|
|
2732
2803
|
announce: (message) => {
|
|
2733
|
-
|
|
2804
|
+
AccessibilityInfo3.announceForAccessibility?.(message);
|
|
2734
2805
|
}
|
|
2735
2806
|
};
|
|
2736
2807
|
};
|
|
2737
2808
|
|
|
2738
2809
|
// src/components/Select/internal/useSelectCollection.ts
|
|
2739
|
-
import { useMemo as
|
|
2810
|
+
import { useMemo as useMemo5 } from "react";
|
|
2740
2811
|
var useSelectCollection = (children, optionsProp) => {
|
|
2741
|
-
const parsedChildren =
|
|
2812
|
+
const parsedChildren = useMemo5(
|
|
2742
2813
|
() => parseSelectChildren(children),
|
|
2743
2814
|
[children]
|
|
2744
2815
|
);
|
|
2745
|
-
const options =
|
|
2816
|
+
const options = useMemo5(
|
|
2746
2817
|
() => [...optionsProp ?? [], ...parsedChildren.options],
|
|
2747
2818
|
[optionsProp, parsedChildren.options]
|
|
2748
2819
|
);
|
|
2749
|
-
const rows =
|
|
2820
|
+
const rows = useMemo5(() => {
|
|
2750
2821
|
if (parsedChildren.rows.length > 0) {
|
|
2751
2822
|
return parsedChildren.rows;
|
|
2752
2823
|
}
|
|
@@ -2777,7 +2848,7 @@ var useSelectPresentation = (presentation = "auto") => {
|
|
|
2777
2848
|
};
|
|
2778
2849
|
|
|
2779
2850
|
// src/components/Select/internal/useSelectSearch.ts
|
|
2780
|
-
import { useEffect as
|
|
2851
|
+
import { useEffect as useEffect6, useMemo as useMemo6, useState as useState4 } from "react";
|
|
2781
2852
|
var useSelectSearch = ({
|
|
2782
2853
|
rows,
|
|
2783
2854
|
isOpen,
|
|
@@ -2787,10 +2858,10 @@ var useSelectSearch = ({
|
|
|
2787
2858
|
filterOptions,
|
|
2788
2859
|
filter = defaultSelectFilter
|
|
2789
2860
|
}) => {
|
|
2790
|
-
const [query, setQuery] =
|
|
2861
|
+
const [query, setQuery] = useState4("");
|
|
2791
2862
|
const shouldSearch = searchable ?? searchableFromChildren ?? Boolean(onSearch);
|
|
2792
2863
|
const shouldFilter = filterOptions ?? !onSearch;
|
|
2793
|
-
const filteredRows =
|
|
2864
|
+
const filteredRows = useMemo6(() => {
|
|
2794
2865
|
if (!query || !shouldFilter) return rows;
|
|
2795
2866
|
const visibleRows = [];
|
|
2796
2867
|
let pendingGroup;
|
|
@@ -2817,7 +2888,7 @@ var useSelectSearch = ({
|
|
|
2817
2888
|
return index > 0 && index < collection.length - 1 && collection[index - 1]?.type !== "separator";
|
|
2818
2889
|
});
|
|
2819
2890
|
}, [filter, query, rows, shouldFilter]);
|
|
2820
|
-
|
|
2891
|
+
useEffect6(() => {
|
|
2821
2892
|
if (!isOpen) {
|
|
2822
2893
|
setQuery("");
|
|
2823
2894
|
return;
|
|
@@ -2846,8 +2917,8 @@ import { ChevronDown as ChevronDown2, Close as Close3 } from "@vellira-ui/icons"
|
|
|
2846
2917
|
import { ActivityIndicator as ActivityIndicator2, Pressable as Pressable11, Text as Text13, View as View22 } from "react-native";
|
|
2847
2918
|
|
|
2848
2919
|
// src/components/Select/Trigger/SelectTrigger.styles.ts
|
|
2849
|
-
import { StyleSheet as
|
|
2850
|
-
var createTriggerStyles = (theme) =>
|
|
2920
|
+
import { StyleSheet as StyleSheet20 } from "react-native";
|
|
2921
|
+
var createTriggerStyles = (theme) => StyleSheet20.create({
|
|
2851
2922
|
trigger: {
|
|
2852
2923
|
width: "100%",
|
|
2853
2924
|
minWidth: 0,
|
|
@@ -3155,9 +3226,9 @@ function SelectRoot(props) {
|
|
|
3155
3226
|
} = props;
|
|
3156
3227
|
const field = useFormFieldContext();
|
|
3157
3228
|
const hasOwnField = Boolean(label || description || error);
|
|
3158
|
-
const [triggerWidth, setTriggerWidth] =
|
|
3159
|
-
const searchInputRef =
|
|
3160
|
-
const selectedFocusValueRef =
|
|
3229
|
+
const [triggerWidth, setTriggerWidth] = useState5();
|
|
3230
|
+
const searchInputRef = useRef5(null);
|
|
3231
|
+
const selectedFocusValueRef = useRef5(void 0);
|
|
3161
3232
|
const resolvedPresentation = useSelectPresentation(presentation);
|
|
3162
3233
|
const {
|
|
3163
3234
|
options,
|
|
@@ -3210,7 +3281,7 @@ function SelectRoot(props) {
|
|
|
3210
3281
|
const selectedOptions = options.filter(
|
|
3211
3282
|
(option) => selectedValues.includes(option.value)
|
|
3212
3283
|
);
|
|
3213
|
-
const optionsByValue =
|
|
3284
|
+
const optionsByValue = useMemo7(
|
|
3214
3285
|
() => new Map(
|
|
3215
3286
|
options.filter((option) => !option.disabled).map((option) => [option.value, option])
|
|
3216
3287
|
),
|
|
@@ -3235,7 +3306,7 @@ function SelectRoot(props) {
|
|
|
3235
3306
|
)
|
|
3236
3307
|
);
|
|
3237
3308
|
const itemHeight = typeof virtual === "object" ? virtual.estimatedItemSize ?? 46 : 46;
|
|
3238
|
-
const displayValue =
|
|
3309
|
+
const displayValue = useMemo7(() => {
|
|
3239
3310
|
if (renderValue) {
|
|
3240
3311
|
return renderValue(
|
|
3241
3312
|
props.multiple ? selectedOptions : selectedOption ?? null,
|
|
@@ -3469,8 +3540,8 @@ var useTabs = () => {
|
|
|
3469
3540
|
TabsContext.displayName = "TabsContext";
|
|
3470
3541
|
|
|
3471
3542
|
// src/components/Tabs/List/TabsList.styles.ts
|
|
3472
|
-
import { StyleSheet as
|
|
3473
|
-
var createStyles14 = (theme) =>
|
|
3543
|
+
import { StyleSheet as StyleSheet21 } from "react-native";
|
|
3544
|
+
var createStyles14 = (theme) => StyleSheet21.create({
|
|
3474
3545
|
list: {
|
|
3475
3546
|
flexDirection: "row",
|
|
3476
3547
|
alignSelf: "stretch",
|
|
@@ -3520,8 +3591,8 @@ TabsList.displayName = "TabsList";
|
|
|
3520
3591
|
import { View as View25 } from "react-native";
|
|
3521
3592
|
|
|
3522
3593
|
// src/components/Tabs/Panel/TabsPanel.styles.ts
|
|
3523
|
-
import { StyleSheet as
|
|
3524
|
-
var createStyles15 = (theme) =>
|
|
3594
|
+
import { StyleSheet as StyleSheet22 } from "react-native";
|
|
3595
|
+
var createStyles15 = (theme) => StyleSheet22.create({
|
|
3525
3596
|
panel: {
|
|
3526
3597
|
width: "100%",
|
|
3527
3598
|
minWidth: 0,
|
|
@@ -3572,9 +3643,9 @@ import { cloneElement as cloneElement6, isValidElement as isValidElement8 } from
|
|
|
3572
3643
|
import { Pressable as Pressable12, Text as Text14, View as View26 } from "react-native";
|
|
3573
3644
|
|
|
3574
3645
|
// src/components/Tabs/Tab/Tab.styles.ts
|
|
3575
|
-
import { StyleSheet as
|
|
3646
|
+
import { StyleSheet as StyleSheet23 } from "react-native";
|
|
3576
3647
|
var fontWeight2 = (value) => value;
|
|
3577
|
-
var createStyles16 = (theme) =>
|
|
3648
|
+
var createStyles16 = (theme) => StyleSheet23.create({
|
|
3578
3649
|
tab: {
|
|
3579
3650
|
minHeight: 40,
|
|
3580
3651
|
alignItems: "center",
|
|
@@ -3779,13 +3850,13 @@ var Tab = ({
|
|
|
3779
3850
|
Tab.displayName = "Tab";
|
|
3780
3851
|
|
|
3781
3852
|
// src/components/Tabs/Tabs.tsx
|
|
3782
|
-
import { useMemo as
|
|
3853
|
+
import { useMemo as useMemo8 } from "react";
|
|
3783
3854
|
import { useTabs as useTabs2 } from "@vellira-ui/core";
|
|
3784
3855
|
import { View as View27 } from "react-native";
|
|
3785
3856
|
|
|
3786
3857
|
// src/components/Tabs/Tabs.styles.ts
|
|
3787
|
-
import { StyleSheet as
|
|
3788
|
-
var createStyles17 = (theme) =>
|
|
3858
|
+
import { StyleSheet as StyleSheet24 } from "react-native";
|
|
3859
|
+
var createStyles17 = (theme) => StyleSheet24.create({
|
|
3789
3860
|
root: {
|
|
3790
3861
|
width: "100%",
|
|
3791
3862
|
minWidth: 0
|
|
@@ -3817,7 +3888,7 @@ var TabsRoot = ({
|
|
|
3817
3888
|
onChange,
|
|
3818
3889
|
orientation
|
|
3819
3890
|
});
|
|
3820
|
-
const value =
|
|
3891
|
+
const value = useMemo8(
|
|
3821
3892
|
() => ({ activeIndex, appearance, orientation, setActiveIndex }),
|
|
3822
3893
|
[activeIndex, appearance, orientation, setActiveIndex]
|
|
3823
3894
|
);
|
|
@@ -3843,20 +3914,20 @@ var Tabs = Object.assign(TabsRoot, {
|
|
|
3843
3914
|
});
|
|
3844
3915
|
|
|
3845
3916
|
// src/components/Tooltip/Tooltip.tsx
|
|
3846
|
-
import { useEffect as
|
|
3917
|
+
import { useEffect as useEffect7, useRef as useRef7, useState as useState7 } from "react";
|
|
3847
3918
|
import { Modal as Modal6, Pressable as Pressable13, Text as Text15, View as View28 } from "react-native";
|
|
3848
3919
|
|
|
3849
3920
|
// src/hooks/useNativeFloatingPosition.ts
|
|
3850
|
-
import { useCallback as useCallback2, useRef as
|
|
3921
|
+
import { useCallback as useCallback2, useRef as useRef6, useState as useState6 } from "react";
|
|
3851
3922
|
import { Dimensions } from "react-native";
|
|
3852
3923
|
var safePadding = 12;
|
|
3853
3924
|
function useNativeFloatingPosition(placement = "top", offset = 8) {
|
|
3854
|
-
const [position, setPosition] =
|
|
3855
|
-
const floatingSizeRef =
|
|
3925
|
+
const [position, setPosition] = useState6({ top: 0, left: 0 });
|
|
3926
|
+
const floatingSizeRef = useRef6({
|
|
3856
3927
|
width: 0,
|
|
3857
3928
|
height: 0
|
|
3858
3929
|
});
|
|
3859
|
-
const lastTriggerRef =
|
|
3930
|
+
const lastTriggerRef = useRef6(null);
|
|
3860
3931
|
const clamp = useCallback2((value, min, max) => {
|
|
3861
3932
|
return Math.min(Math.max(value, min), Math.max(min, max));
|
|
3862
3933
|
}, []);
|
|
@@ -3913,13 +3984,13 @@ function useNativeFloatingPosition(placement = "top", offset = 8) {
|
|
|
3913
3984
|
}
|
|
3914
3985
|
|
|
3915
3986
|
// src/components/Tooltip/Tooltip.styles.ts
|
|
3916
|
-
import { StyleSheet as
|
|
3917
|
-
var createStyles18 = (theme) =>
|
|
3987
|
+
import { StyleSheet as StyleSheet25 } from "react-native";
|
|
3988
|
+
var createStyles18 = (theme) => StyleSheet25.create({
|
|
3918
3989
|
root: {
|
|
3919
3990
|
alignSelf: "flex-start"
|
|
3920
3991
|
},
|
|
3921
3992
|
overlay: {
|
|
3922
|
-
...
|
|
3993
|
+
...StyleSheet25.absoluteFill
|
|
3923
3994
|
},
|
|
3924
3995
|
bubble: {
|
|
3925
3996
|
position: "absolute",
|
|
@@ -3964,9 +4035,9 @@ function Tooltip({
|
|
|
3964
4035
|
textStyle
|
|
3965
4036
|
}) {
|
|
3966
4037
|
const styles = useThemeStyles(createStyles18);
|
|
3967
|
-
const [visible, setVisible] =
|
|
3968
|
-
const triggerRef =
|
|
3969
|
-
const closeTimerRef =
|
|
4038
|
+
const [visible, setVisible] = useState7(false);
|
|
4039
|
+
const triggerRef = useRef7(null);
|
|
4040
|
+
const closeTimerRef = useRef7(null);
|
|
3970
4041
|
const { position, updatePosition, onFloatingLayout } = useNativeFloatingPosition(placement, 8);
|
|
3971
4042
|
const hideDelay = delay?.close ?? 2500;
|
|
3972
4043
|
const clearCloseTimer = () => {
|
|
@@ -3985,7 +4056,7 @@ function Tooltip({
|
|
|
3985
4056
|
closeTimerRef.current = null;
|
|
3986
4057
|
}, hideDelay);
|
|
3987
4058
|
};
|
|
3988
|
-
|
|
4059
|
+
useEffect7(() => {
|
|
3989
4060
|
return clearCloseTimer;
|
|
3990
4061
|
}, []);
|
|
3991
4062
|
return /* @__PURE__ */ jsxs19(View28, { style: [styles.root, style], children: [
|
|
@@ -4022,7 +4093,7 @@ function Tooltip({
|
|
|
4022
4093
|
Tooltip.displayName = "Tooltip";
|
|
4023
4094
|
|
|
4024
4095
|
// src/primitives/Button/Button.tsx
|
|
4025
|
-
import { cloneElement as cloneElement7, useState as
|
|
4096
|
+
import { cloneElement as cloneElement7, useState as useState8 } from "react";
|
|
4026
4097
|
import { ActivityIndicator as ActivityIndicator3, Pressable as Pressable14, Text as Text16, View as View29 } from "react-native";
|
|
4027
4098
|
|
|
4028
4099
|
// src/utils/devWarning.ts
|
|
@@ -4033,9 +4104,9 @@ var devWarning = (condition, message) => {
|
|
|
4033
4104
|
};
|
|
4034
4105
|
|
|
4035
4106
|
// src/primitives/Button/Button.styles.ts
|
|
4036
|
-
import { StyleSheet as
|
|
4107
|
+
import { StyleSheet as StyleSheet26 } from "react-native";
|
|
4037
4108
|
var fontWeight3 = (value) => value;
|
|
4038
|
-
var createStyles19 = (theme) =>
|
|
4109
|
+
var createStyles19 = (theme) => StyleSheet26.create({
|
|
4039
4110
|
button: {
|
|
4040
4111
|
flexDirection: "row",
|
|
4041
4112
|
alignItems: "center",
|
|
@@ -4156,9 +4227,9 @@ function Button({
|
|
|
4156
4227
|
const config = sizeMap[size];
|
|
4157
4228
|
const radius = shape === "square" ? theme.tokens.radius.sm : shape === "rounded" ? theme.tokens.radius.md : theme.tokens.radius.full;
|
|
4158
4229
|
const appearanceTheme = theme.components.button[color][appearance];
|
|
4159
|
-
const [isHovered, setIsHovered] =
|
|
4160
|
-
const [isFocused, setIsFocused] =
|
|
4161
|
-
const [labelWidth, setLabelWidth] =
|
|
4230
|
+
const [isHovered, setIsHovered] = useState8(false);
|
|
4231
|
+
const [isFocused, setIsFocused] = useState8(false);
|
|
4232
|
+
const [labelWidth, setLabelWidth] = useState8(0);
|
|
4162
4233
|
const isDisabled = disabled || loading;
|
|
4163
4234
|
const iconOnly = iconOnlyProp || !children && Boolean(iconStart || iconEnd);
|
|
4164
4235
|
const content = loading && loadingText ? loadingText : children;
|
|
@@ -4303,14 +4374,14 @@ function Button({
|
|
|
4303
4374
|
}
|
|
4304
4375
|
|
|
4305
4376
|
// src/primitives/Checkbox/Checkbox.tsx
|
|
4306
|
-
import { forwardRef as forwardRef2, useEffect as
|
|
4377
|
+
import { forwardRef as forwardRef2, useEffect as useEffect8 } from "react";
|
|
4307
4378
|
import { useControllableState as useControllableState3 } from "@vellira-ui/core";
|
|
4308
4379
|
import { Check as Check2 } from "@vellira-ui/icons";
|
|
4309
4380
|
import { Pressable as Pressable15, Text as Text17, View as View30 } from "react-native";
|
|
4310
4381
|
|
|
4311
4382
|
// src/primitives/Checkbox/Checkbox.styles.ts
|
|
4312
|
-
import { StyleSheet as
|
|
4313
|
-
var createStyles20 = (theme) =>
|
|
4383
|
+
import { StyleSheet as StyleSheet27 } from "react-native";
|
|
4384
|
+
var createStyles20 = (theme) => StyleSheet27.create({
|
|
4314
4385
|
container: {
|
|
4315
4386
|
gap: theme.tokens.spacing[2]
|
|
4316
4387
|
},
|
|
@@ -4511,7 +4582,7 @@ var Checkbox = forwardRef2(
|
|
|
4511
4582
|
const resolvedAccessibilityLabel = accessibilityLabel ?? label;
|
|
4512
4583
|
const resolvedAccessibilityHint = [accessibilityHint, description, error].filter(Boolean).join(" ");
|
|
4513
4584
|
const accessibilityChecked = indeterminate ? "mixed" : isChecked;
|
|
4514
|
-
|
|
4585
|
+
useEffect8(() => {
|
|
4515
4586
|
devWarning(
|
|
4516
4587
|
Boolean(resolvedAccessibilityLabel),
|
|
4517
4588
|
"Checkbox: an accessible label must be provided through label or accessibilityLabel."
|
|
@@ -4614,14 +4685,14 @@ var Checkbox = forwardRef2(
|
|
|
4614
4685
|
Checkbox.displayName = "Checkbox";
|
|
4615
4686
|
|
|
4616
4687
|
// src/primitives/Input/Input.tsx
|
|
4617
|
-
import { cloneElement as cloneElement8, forwardRef as forwardRef3, useState as
|
|
4688
|
+
import { cloneElement as cloneElement8, forwardRef as forwardRef3, useState as useState9 } from "react";
|
|
4618
4689
|
import { Pressable as Pressable16, Text as Text18, TextInput as TextInput2, View as View31 } from "react-native";
|
|
4619
4690
|
|
|
4620
4691
|
// src/primitives/Input/Input.styles.ts
|
|
4621
|
-
import { StyleSheet as
|
|
4692
|
+
import { StyleSheet as StyleSheet28 } from "react-native";
|
|
4622
4693
|
var getDisabledPlaceholderTextColor = (theme) => theme.components.input.disabled.placeholder;
|
|
4623
4694
|
var resolveRingColor = (ring) => typeof ring === "string" ? ring : ring.color;
|
|
4624
|
-
var createStyles21 = (theme) =>
|
|
4695
|
+
var createStyles21 = (theme) => StyleSheet28.create({
|
|
4625
4696
|
inputWrapper: {
|
|
4626
4697
|
position: "relative",
|
|
4627
4698
|
width: "100%",
|
|
@@ -4866,8 +4937,8 @@ var Input = forwardRef3(
|
|
|
4866
4937
|
const styles = useThemeStyles(createStyles21);
|
|
4867
4938
|
const field = useFormFieldContext();
|
|
4868
4939
|
const hasOwnField = Boolean(label || description || error);
|
|
4869
|
-
const [isFocused, setIsFocused] =
|
|
4870
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
4940
|
+
const [isFocused, setIsFocused] = useState9(false);
|
|
4941
|
+
const [uncontrolledValue, setUncontrolledValue] = useState9(
|
|
4871
4942
|
defaultValue ?? ""
|
|
4872
4943
|
);
|
|
4873
4944
|
const isControlled = value !== void 0;
|
|
@@ -4884,7 +4955,7 @@ var Input = forwardRef3(
|
|
|
4884
4955
|
const isReadOnly = readOnly || loading;
|
|
4885
4956
|
const placeholderTextColor = isDisabled ? getDisabledPlaceholderTextColor(theme) : readOnly ? theme.components.input.readOnly.placeholder : inputState.placeholder;
|
|
4886
4957
|
const isPassword = type === "password";
|
|
4887
|
-
const [isPasswordRevealed, setIsPasswordRevealed] =
|
|
4958
|
+
const [isPasswordRevealed, setIsPasswordRevealed] = useState9(false);
|
|
4888
4959
|
const resolvedIconSize = iconSize ?? 16;
|
|
4889
4960
|
const handleFocus = (event) => {
|
|
4890
4961
|
setIsFocused(true);
|
|
@@ -5044,7 +5115,7 @@ var Input = forwardRef3(
|
|
|
5044
5115
|
Input.displayName = "Input";
|
|
5045
5116
|
|
|
5046
5117
|
// src/primitives/Radio/Radio.tsx
|
|
5047
|
-
import { forwardRef as forwardRef4, useEffect as
|
|
5118
|
+
import { forwardRef as forwardRef4, useEffect as useEffect9 } from "react";
|
|
5048
5119
|
import { useControllableState as useControllableState4 } from "@vellira-ui/core";
|
|
5049
5120
|
import {
|
|
5050
5121
|
Pressable as Pressable17,
|
|
@@ -5053,8 +5124,8 @@ import {
|
|
|
5053
5124
|
} from "react-native";
|
|
5054
5125
|
|
|
5055
5126
|
// src/primitives/Radio/Radio.styles.ts
|
|
5056
|
-
import { StyleSheet as
|
|
5057
|
-
var createStyles22 = (theme) =>
|
|
5127
|
+
import { StyleSheet as StyleSheet29 } from "react-native";
|
|
5128
|
+
var createStyles22 = (theme) => StyleSheet29.create({
|
|
5058
5129
|
root: {
|
|
5059
5130
|
alignSelf: "flex-start"
|
|
5060
5131
|
},
|
|
@@ -5213,7 +5284,7 @@ var Radio = forwardRef4(
|
|
|
5213
5284
|
};
|
|
5214
5285
|
const typographySize = typographySizeByRadioSize[resolvedSize];
|
|
5215
5286
|
const controlMarginTop = (typographySize.labelLineHeight - controlSize) / 2;
|
|
5216
|
-
|
|
5287
|
+
useEffect9(() => {
|
|
5217
5288
|
if (typeof __DEV__ !== "undefined" && __DEV__ && !label && !accessibilityLabel) {
|
|
5218
5289
|
console.warn(
|
|
5219
5290
|
"Radio requires either a visible label or accessibilityLabel."
|