radix-native-ui 0.1.0 → 0.1.1
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/LICENSE +21 -0
- package/README.md +4 -2
- package/dist/index.cjs +1416 -464
- package/dist/index.d.cts +341 -91
- package/dist/index.d.mts +328 -78
- package/dist/index.mjs +1412 -464
- package/package.json +18 -19
package/dist/index.mjs
CHANGED
|
@@ -3116,7 +3116,7 @@ const ToastRoot = forwardRef(({ toast, onDismiss, config, index, style }, ref) =
|
|
|
3116
3116
|
opacity,
|
|
3117
3117
|
transform: [{ translateY }, { translateX }],
|
|
3118
3118
|
backgroundColor: colors.backgroundColor,
|
|
3119
|
-
borderColor:
|
|
3119
|
+
borderColor: "transparent",
|
|
3120
3120
|
borderWidth: 1,
|
|
3121
3121
|
borderRadius: theme.radii.large,
|
|
3122
3122
|
padding: theme.space[4],
|
|
@@ -3141,23 +3141,23 @@ const ToastRoot = forwardRef(({ toast, onDismiss, config, index, style }, ref) =
|
|
|
3141
3141
|
accessibilityLiveRegion: "polite",
|
|
3142
3142
|
accessibilityLabel: toast.accessibilityLabel || toast.title,
|
|
3143
3143
|
children: /* @__PURE__ */ jsxs(View, {
|
|
3144
|
-
style: [styles$
|
|
3144
|
+
style: [styles$34.contentContainer, { alignItems: toast.description ? "flex-start" : "center" }],
|
|
3145
3145
|
children: [
|
|
3146
3146
|
toast.icon && /* @__PURE__ */ jsx(View, {
|
|
3147
|
-
style: styles$
|
|
3147
|
+
style: styles$34.iconContainer,
|
|
3148
3148
|
children: toast.icon
|
|
3149
3149
|
}),
|
|
3150
3150
|
/* @__PURE__ */ jsxs(View, {
|
|
3151
|
-
style: styles$
|
|
3152
|
-
children: [/* @__PURE__ */ jsx(
|
|
3153
|
-
style: [styles$
|
|
3151
|
+
style: styles$34.textContainer,
|
|
3152
|
+
children: [/* @__PURE__ */ jsx(TextComponent, {
|
|
3153
|
+
style: [styles$34.title, {
|
|
3154
3154
|
color: colors.textColor,
|
|
3155
3155
|
fontSize: theme.typography.fontSizes[3].fontSize
|
|
3156
3156
|
}],
|
|
3157
3157
|
numberOfLines: 1,
|
|
3158
3158
|
children: toast.title
|
|
3159
|
-
}), toast.description && /* @__PURE__ */ jsx(
|
|
3160
|
-
style: [styles$
|
|
3159
|
+
}), toast.description && /* @__PURE__ */ jsx(TextComponent, {
|
|
3160
|
+
style: [styles$34.description, {
|
|
3161
3161
|
fontSize: theme.typography.fontSizes[2].fontSize,
|
|
3162
3162
|
lineHeight: theme.typography.fontSizes[2].fontSize * 1.5,
|
|
3163
3163
|
opacity: .8
|
|
@@ -3168,14 +3168,14 @@ const ToastRoot = forwardRef(({ toast, onDismiss, config, index, style }, ref) =
|
|
|
3168
3168
|
}),
|
|
3169
3169
|
toast.action && /* @__PURE__ */ jsx(Pressable, {
|
|
3170
3170
|
onPress: toast.action.onPress,
|
|
3171
|
-
style: ({ pressed }) => [styles$
|
|
3172
|
-
children: /* @__PURE__ */ jsx(
|
|
3173
|
-
style: [styles$
|
|
3171
|
+
style: ({ pressed }) => [styles$34.actionButton, { opacity: pressed ? .7 : 1 }],
|
|
3172
|
+
children: /* @__PURE__ */ jsx(TextComponent, {
|
|
3173
|
+
style: [styles$34.actionText, { color: colors.accentColor }],
|
|
3174
3174
|
children: toast.action.label
|
|
3175
3175
|
})
|
|
3176
3176
|
}),
|
|
3177
3177
|
toast.showClose && /* @__PURE__ */ jsx(Button, {
|
|
3178
|
-
|
|
3178
|
+
color: getVariantColorName(toast.variant),
|
|
3179
3179
|
radius: "large",
|
|
3180
3180
|
size: 1,
|
|
3181
3181
|
onPress: () => handleDismiss(true),
|
|
@@ -3194,10 +3194,10 @@ const ToastViewport = forwardRef(({ style }, ref) => {
|
|
|
3194
3194
|
if (toasts.length === 0) return null;
|
|
3195
3195
|
return /* @__PURE__ */ jsxs(View, {
|
|
3196
3196
|
ref,
|
|
3197
|
-
style: [styles$
|
|
3197
|
+
style: [styles$34.viewport, style],
|
|
3198
3198
|
pointerEvents: "box-none",
|
|
3199
3199
|
children: [topToasts.length > 0 && /* @__PURE__ */ jsx(SafeAreaView, {
|
|
3200
|
-
style: styles$
|
|
3200
|
+
style: styles$34.topContainer,
|
|
3201
3201
|
pointerEvents: "box-none",
|
|
3202
3202
|
children: topToasts.map((toast, index) => /* @__PURE__ */ jsx(ToastRoot, {
|
|
3203
3203
|
toast,
|
|
@@ -3206,7 +3206,7 @@ const ToastViewport = forwardRef(({ style }, ref) => {
|
|
|
3206
3206
|
index
|
|
3207
3207
|
}, toast.id))
|
|
3208
3208
|
}), bottomToasts.length > 0 && /* @__PURE__ */ jsx(SafeAreaView, {
|
|
3209
|
-
style: styles$
|
|
3209
|
+
style: styles$34.bottomContainer,
|
|
3210
3210
|
pointerEvents: "box-none",
|
|
3211
3211
|
children: bottomToasts.map((toast, index) => /* @__PURE__ */ jsx(ToastRoot, {
|
|
3212
3212
|
toast,
|
|
@@ -3220,10 +3220,10 @@ const ToastViewport = forwardRef(({ style }, ref) => {
|
|
|
3220
3220
|
ToastViewport.displayName = "Toast.Viewport";
|
|
3221
3221
|
const ToastTitle = forwardRef(({ children, style }, ref) => {
|
|
3222
3222
|
const theme = useTheme$1();
|
|
3223
|
-
return /* @__PURE__ */ jsx(
|
|
3223
|
+
return /* @__PURE__ */ jsx(TextComponent, {
|
|
3224
3224
|
ref,
|
|
3225
3225
|
style: [
|
|
3226
|
-
styles$
|
|
3226
|
+
styles$34.title,
|
|
3227
3227
|
{ fontSize: theme.typography.fontSizes[2].fontSize },
|
|
3228
3228
|
style
|
|
3229
3229
|
],
|
|
@@ -3233,10 +3233,10 @@ const ToastTitle = forwardRef(({ children, style }, ref) => {
|
|
|
3233
3233
|
ToastTitle.displayName = "Toast.Title";
|
|
3234
3234
|
const ToastDescription = forwardRef(({ children, style }, ref) => {
|
|
3235
3235
|
const theme = useTheme$1();
|
|
3236
|
-
return /* @__PURE__ */ jsx(
|
|
3236
|
+
return /* @__PURE__ */ jsx(TextComponent, {
|
|
3237
3237
|
ref,
|
|
3238
3238
|
style: [
|
|
3239
|
-
styles$
|
|
3239
|
+
styles$34.description,
|
|
3240
3240
|
{ fontSize: theme.typography.fontSizes[1].fontSize },
|
|
3241
3241
|
style
|
|
3242
3242
|
],
|
|
@@ -3249,7 +3249,7 @@ const ToastClose = forwardRef(({ children, onPress, style }, ref) => {
|
|
|
3249
3249
|
ref,
|
|
3250
3250
|
onPress,
|
|
3251
3251
|
style: ({ pressed }) => [
|
|
3252
|
-
styles$
|
|
3252
|
+
styles$34.closeButton,
|
|
3253
3253
|
{ opacity: pressed ? .7 : 1 },
|
|
3254
3254
|
style
|
|
3255
3255
|
],
|
|
@@ -3259,7 +3259,7 @@ const ToastClose = forwardRef(({ children, onPress, style }, ref) => {
|
|
|
3259
3259
|
left: 8,
|
|
3260
3260
|
right: 8
|
|
3261
3261
|
},
|
|
3262
|
-
children: children || /* @__PURE__ */ jsx(
|
|
3262
|
+
children: children || /* @__PURE__ */ jsx(TextComponent, { children: "✕" })
|
|
3263
3263
|
});
|
|
3264
3264
|
});
|
|
3265
3265
|
ToastClose.displayName = "Toast.Close";
|
|
@@ -3269,18 +3269,18 @@ const ToastAction = forwardRef(({ label, onPress, style }, ref) => {
|
|
|
3269
3269
|
ref,
|
|
3270
3270
|
onPress,
|
|
3271
3271
|
style: ({ pressed }) => [
|
|
3272
|
-
styles$
|
|
3272
|
+
styles$34.actionButton,
|
|
3273
3273
|
{ opacity: pressed ? .7 : 1 },
|
|
3274
3274
|
style
|
|
3275
3275
|
],
|
|
3276
|
-
children: /* @__PURE__ */ jsx(
|
|
3277
|
-
style: [styles$
|
|
3276
|
+
children: /* @__PURE__ */ jsx(TextComponent, {
|
|
3277
|
+
style: [styles$34.actionText, { color: theme.accentColor === "indigo" ? theme.colors.indigo[9] : theme.colors[theme.accentColor]?.[9] || theme.colors.indigo[9] }],
|
|
3278
3278
|
children: label
|
|
3279
3279
|
})
|
|
3280
3280
|
});
|
|
3281
3281
|
});
|
|
3282
3282
|
ToastAction.displayName = "Toast.Action";
|
|
3283
|
-
const styles$
|
|
3283
|
+
const styles$34 = StyleSheet.create({
|
|
3284
3284
|
viewport: {
|
|
3285
3285
|
...StyleSheet.absoluteFillObject,
|
|
3286
3286
|
pointerEvents: "box-none"
|
|
@@ -3314,7 +3314,7 @@ const styles$32 = StyleSheet.create({
|
|
|
3314
3314
|
},
|
|
3315
3315
|
title: { fontWeight: "500" },
|
|
3316
3316
|
description: {
|
|
3317
|
-
marginTop:
|
|
3317
|
+
marginTop: 1,
|
|
3318
3318
|
opacity: .8
|
|
3319
3319
|
},
|
|
3320
3320
|
actionButton: {
|
|
@@ -3380,7 +3380,7 @@ const useThemeContext = () => {
|
|
|
3380
3380
|
* 2. themeOptions object (legacy support)
|
|
3381
3381
|
* 3. Default values
|
|
3382
3382
|
*/
|
|
3383
|
-
const ThemeProvider = ({ children, accentColor, grayColor, radius, scaling, panelBackground, mode: initialMode, appearance, forcedMode, onModeChange, themeOptions = {}, toastConfig: userToastConfig }) => {
|
|
3383
|
+
const ThemeProvider = ({ children, accentColor, grayColor, radius, scaling, panelBackground, mode: initialMode, appearance, forcedMode, onModeChange, themeOptions = {}, toastConfig: userToastConfig, haptics: globalHaptics }) => {
|
|
3384
3384
|
const parentContext = useContext(ThemeContext);
|
|
3385
3385
|
const deviceColorScheme = useDeviceColorScheme();
|
|
3386
3386
|
const resolvedInitialMode = appearance === "inherit" ? void 0 : appearance ?? initialMode;
|
|
@@ -3398,9 +3398,10 @@ const ThemeProvider = ({ children, accentColor, grayColor, radius, scaling, pane
|
|
|
3398
3398
|
parentContext?.mode,
|
|
3399
3399
|
deviceColorScheme
|
|
3400
3400
|
]);
|
|
3401
|
-
const handleSetMode = (
|
|
3402
|
-
setMode(
|
|
3403
|
-
|
|
3401
|
+
const handleSetMode = (newAppearance) => {
|
|
3402
|
+
if (newAppearance === "inherit") setMode(deviceColorScheme ?? "light");
|
|
3403
|
+
else setMode(newAppearance);
|
|
3404
|
+
onModeChange?.(newAppearance === "inherit" ? deviceColorScheme ?? "light" : newAppearance);
|
|
3404
3405
|
};
|
|
3405
3406
|
const toggleMode = () => {
|
|
3406
3407
|
handleSetMode(mode === "light" ? "dark" : "light");
|
|
@@ -3471,11 +3472,14 @@ const ThemeProvider = ({ children, accentColor, grayColor, radius, scaling, pane
|
|
|
3471
3472
|
...options
|
|
3472
3473
|
} : t));
|
|
3473
3474
|
}, []);
|
|
3475
|
+
const resolvedHaptics = globalHaptics ?? true;
|
|
3474
3476
|
const value = useMemo(() => ({
|
|
3475
3477
|
theme,
|
|
3476
3478
|
mode,
|
|
3479
|
+
appearance: appearance ?? "inherit",
|
|
3477
3480
|
setMode: handleSetMode,
|
|
3478
3481
|
toggleMode,
|
|
3482
|
+
haptics: resolvedHaptics,
|
|
3479
3483
|
toastConfig,
|
|
3480
3484
|
toasts,
|
|
3481
3485
|
showToast,
|
|
@@ -3485,7 +3489,9 @@ const ThemeProvider = ({ children, accentColor, grayColor, radius, scaling, pane
|
|
|
3485
3489
|
}), [
|
|
3486
3490
|
theme,
|
|
3487
3491
|
mode,
|
|
3492
|
+
appearance,
|
|
3488
3493
|
toggleMode,
|
|
3494
|
+
resolvedHaptics,
|
|
3489
3495
|
toastConfig,
|
|
3490
3496
|
toasts,
|
|
3491
3497
|
showToast,
|
|
@@ -3514,14 +3520,22 @@ const useThemeMode = () => {
|
|
|
3514
3520
|
* Hook to access theme mode setter and toggle
|
|
3515
3521
|
*/
|
|
3516
3522
|
const useThemeActions = () => {
|
|
3517
|
-
const { setMode, toggleMode, mode } = useThemeContext();
|
|
3523
|
+
const { setMode, toggleMode, mode, appearance } = useThemeContext();
|
|
3518
3524
|
return {
|
|
3519
3525
|
setMode,
|
|
3520
3526
|
toggleMode,
|
|
3521
|
-
mode
|
|
3527
|
+
mode,
|
|
3528
|
+
appearance
|
|
3522
3529
|
};
|
|
3523
3530
|
};
|
|
3524
3531
|
/**
|
|
3532
|
+
* Hook to access the global haptics setting
|
|
3533
|
+
* @returns boolean - whether haptics are enabled globally
|
|
3534
|
+
*/
|
|
3535
|
+
const useHaptics = () => {
|
|
3536
|
+
return useThemeContext().haptics;
|
|
3537
|
+
};
|
|
3538
|
+
/**
|
|
3525
3539
|
* Hook to access toast functionality
|
|
3526
3540
|
*/
|
|
3527
3541
|
const useToast = () => {
|
|
@@ -3593,6 +3607,15 @@ const useThemeColors = () => {
|
|
|
3593
3607
|
panel: isDark ? theme.colors.gray.dark[2] : "#ffffff"
|
|
3594
3608
|
};
|
|
3595
3609
|
};
|
|
3610
|
+
/**
|
|
3611
|
+
* Hook to access the global haptics setting
|
|
3612
|
+
* @returns boolean - whether haptics are enabled globally
|
|
3613
|
+
*/
|
|
3614
|
+
const useHaptics$1 = () => {
|
|
3615
|
+
const context = useContext(ThemeContext);
|
|
3616
|
+
if (!context) throw new Error("useHaptics must be used within a ThemeProvider");
|
|
3617
|
+
return context.haptics;
|
|
3618
|
+
};
|
|
3596
3619
|
|
|
3597
3620
|
//#endregion
|
|
3598
3621
|
//#region src/components/primitives/View.tsx
|
|
@@ -3610,7 +3633,6 @@ const RnView = React.memo(React.forwardRef(({ style, wrap, ...rest }, ref) => {
|
|
|
3610
3633
|
});
|
|
3611
3634
|
}));
|
|
3612
3635
|
RnView.displayName = "RnView";
|
|
3613
|
-
var View_default = RnView;
|
|
3614
3636
|
|
|
3615
3637
|
//#endregion
|
|
3616
3638
|
//#region src/components/primitives/Text.tsx
|
|
@@ -3662,7 +3684,6 @@ const RnPressable = React.memo(React.forwardRef(({ style, onPressIn, onPressOut,
|
|
|
3662
3684
|
});
|
|
3663
3685
|
}));
|
|
3664
3686
|
RnPressable.displayName = "RnPressable";
|
|
3665
|
-
var Pressable_default = RnPressable;
|
|
3666
3687
|
|
|
3667
3688
|
//#endregion
|
|
3668
3689
|
//#region src/components/primitives/TouchableOpacity.tsx
|
|
@@ -3782,10 +3803,67 @@ const RnActivityIndicator = React.memo(React.forwardRef(({ color, ...rest }, ref
|
|
|
3782
3803
|
}));
|
|
3783
3804
|
RnActivityIndicator.displayName = "RnActivityIndicator";
|
|
3784
3805
|
|
|
3806
|
+
//#endregion
|
|
3807
|
+
//#region src/utils/haptics.ts
|
|
3808
|
+
/**
|
|
3809
|
+
* Try to import expo-haptics, fallback to null if not available
|
|
3810
|
+
*/
|
|
3811
|
+
let Haptics = null;
|
|
3812
|
+
(async () => {
|
|
3813
|
+
try {
|
|
3814
|
+
Haptics = await import("expo-haptics");
|
|
3815
|
+
} catch {}
|
|
3816
|
+
})();
|
|
3817
|
+
/**
|
|
3818
|
+
* Triggers haptic feedback with graceful fallback
|
|
3819
|
+
*
|
|
3820
|
+
* On iOS with expo-haptics:
|
|
3821
|
+
* - Uses Taptic Engine for precise, varied feedback (10-20ms)
|
|
3822
|
+
*
|
|
3823
|
+
* On Android or without expo-haptics:
|
|
3824
|
+
* - Falls back to basic vibration (10ms on Android, 400ms on iOS)
|
|
3825
|
+
*
|
|
3826
|
+
* @param type - The type of haptic feedback to trigger (default: 'selection')
|
|
3827
|
+
*/
|
|
3828
|
+
const triggerHaptic = (type = "selection") => {
|
|
3829
|
+
if (Haptics) try {
|
|
3830
|
+
switch (type) {
|
|
3831
|
+
case "selection":
|
|
3832
|
+
Haptics.selectionAsync();
|
|
3833
|
+
break;
|
|
3834
|
+
case "press":
|
|
3835
|
+
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
|
|
3836
|
+
break;
|
|
3837
|
+
case "impactLight":
|
|
3838
|
+
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
|
|
3839
|
+
break;
|
|
3840
|
+
case "impactMedium":
|
|
3841
|
+
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
|
|
3842
|
+
break;
|
|
3843
|
+
case "impactHeavy":
|
|
3844
|
+
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy);
|
|
3845
|
+
break;
|
|
3846
|
+
case "notificationSuccess":
|
|
3847
|
+
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
|
3848
|
+
break;
|
|
3849
|
+
case "notificationWarning":
|
|
3850
|
+
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Warning);
|
|
3851
|
+
break;
|
|
3852
|
+
case "notificationError":
|
|
3853
|
+
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);
|
|
3854
|
+
break;
|
|
3855
|
+
}
|
|
3856
|
+
} catch (error) {
|
|
3857
|
+
Platform.OS === "android" && Vibration.vibrate(10);
|
|
3858
|
+
}
|
|
3859
|
+
else Platform.OS === "android" && Vibration.vibrate(10);
|
|
3860
|
+
};
|
|
3861
|
+
|
|
3785
3862
|
//#endregion
|
|
3786
3863
|
//#region src/components/primitives/AnimatedPressable.tsx
|
|
3787
|
-
const AnimatedPressableComponent = Animated.createAnimatedComponent(
|
|
3864
|
+
const AnimatedPressableComponent = Animated.createAnimatedComponent(RnPressable);
|
|
3788
3865
|
const AnimatedPressable = React.memo(React.forwardRef(({ children, onPressIn, onPressOut, disabled, pressedScale = .97, pressedOpacity = .9, animationDuration = 100, hapticFeedback = true, style, ...rest }, ref) => {
|
|
3866
|
+
const globalHaptics = useHaptics$1();
|
|
3789
3867
|
const scaleAnim = useRef(new Animated.Value(1)).current;
|
|
3790
3868
|
const opacityAnim = useRef(new Animated.Value(1)).current;
|
|
3791
3869
|
const animatePressIn = useCallback(() => {
|
|
@@ -3825,12 +3903,13 @@ const AnimatedPressable = React.memo(React.forwardRef(({ children, onPressIn, on
|
|
|
3825
3903
|
return /* @__PURE__ */ jsx(AnimatedPressableComponent, {
|
|
3826
3904
|
ref,
|
|
3827
3905
|
onPressIn: useCallback((event) => {
|
|
3828
|
-
if (hapticFeedback && !disabled)
|
|
3906
|
+
if (globalHaptics && hapticFeedback && !disabled) triggerHaptic("press");
|
|
3829
3907
|
animatePressIn();
|
|
3830
3908
|
onPressIn?.(event);
|
|
3831
3909
|
}, [
|
|
3832
3910
|
animatePressIn,
|
|
3833
3911
|
onPressIn,
|
|
3912
|
+
globalHaptics,
|
|
3834
3913
|
hapticFeedback,
|
|
3835
3914
|
disabled
|
|
3836
3915
|
]),
|
|
@@ -3849,7 +3928,6 @@ const AnimatedPressable = React.memo(React.forwardRef(({ children, onPressIn, on
|
|
|
3849
3928
|
});
|
|
3850
3929
|
}));
|
|
3851
3930
|
AnimatedPressable.displayName = "AnimatedPressable";
|
|
3852
|
-
var AnimatedPressable_default = AnimatedPressable;
|
|
3853
3931
|
|
|
3854
3932
|
//#endregion
|
|
3855
3933
|
//#region src/components/layout/Box.tsx
|
|
@@ -4721,12 +4799,12 @@ const Strong = React.memo(React.forwardRef(({ children, style = {}, color, ...re
|
|
|
4721
4799
|
const colors = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
4722
4800
|
const strongFont = theme.typography.fonts.strong;
|
|
4723
4801
|
return /* @__PURE__ */ jsx(TextComponent, {
|
|
4802
|
+
color,
|
|
4724
4803
|
ref,
|
|
4725
4804
|
style: [useMemo(() => ({
|
|
4726
4805
|
fontFamily: strongFont.fontFamily,
|
|
4727
4806
|
fontWeight: strongFont.fontWeight,
|
|
4728
|
-
fontStyle: strongFont.fontStyle
|
|
4729
|
-
color: color || colors[12]
|
|
4807
|
+
fontStyle: strongFont.fontStyle
|
|
4730
4808
|
}), [
|
|
4731
4809
|
strongFont,
|
|
4732
4810
|
color,
|
|
@@ -4987,7 +5065,7 @@ const areEqual = (prevProps, nextProps) => {
|
|
|
4987
5065
|
if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.variant === nextProps.variant && prevProps.color === nextProps.color && prevProps.radius === nextProps.radius && prevProps.size === nextProps.size && prevProps.disabled === nextProps.disabled && prevProps.loading === nextProps.loading && prevProps.onPress === nextProps.onPress && prevProps.onLongPress === nextProps.onLongPress && prevProps.delayLongPress === nextProps.delayLongPress && prevProps.width === nextProps.width && prevProps.highContrast === nextProps.highContrast) return true;
|
|
4988
5066
|
return false;
|
|
4989
5067
|
};
|
|
4990
|
-
const Button = React.memo(React.forwardRef(({ children, style, variant = "
|
|
5068
|
+
const Button = React.memo(React.forwardRef(({ children, style, variant = "solid", color, radius, size = 2, disabled, loading, onPress, accessibilityLabel, width, highContrast, hapticFeedback, ...rest }, ref) => {
|
|
4991
5069
|
const theme = useTheme$1();
|
|
4992
5070
|
const mode = useThemeMode$1();
|
|
4993
5071
|
const isDark = mode === "dark";
|
|
@@ -5141,7 +5219,7 @@ const Button = React.memo(React.forwardRef(({ children, style, variant = "classi
|
|
|
5141
5219
|
children: labelProps.children
|
|
5142
5220
|
}, "label");
|
|
5143
5221
|
};
|
|
5144
|
-
return /* @__PURE__ */ jsx(
|
|
5222
|
+
return /* @__PURE__ */ jsx(AnimatedPressable, {
|
|
5145
5223
|
ref,
|
|
5146
5224
|
style: [buttonStyle, style],
|
|
5147
5225
|
onPress: handlePress,
|
|
@@ -5174,52 +5252,48 @@ Button.Label = ButtonLabel;
|
|
|
5174
5252
|
|
|
5175
5253
|
//#endregion
|
|
5176
5254
|
//#region src/components/forms/IconButton.tsx
|
|
5177
|
-
const IconButton = React.forwardRef(({ children, style = {}, variant = "
|
|
5255
|
+
const IconButton = React.forwardRef(({ children, style = {}, variant = "solid", color, size = 2, radius, asChild = false, disabled, loading, onPress, accessibilityLabel, highContrast, hapticFeedback, ...rest }, ref) => {
|
|
5178
5256
|
const theme = useTheme$1();
|
|
5179
5257
|
const mode = useThemeMode$1();
|
|
5180
5258
|
mode === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
5181
5259
|
const grayAlpha = getGrayAlpha(theme);
|
|
5182
5260
|
getAccentColor(theme, mode);
|
|
5183
5261
|
getAccentAlpha(theme);
|
|
5184
|
-
const radii = theme.radii;
|
|
5185
|
-
const
|
|
5186
|
-
const
|
|
5187
|
-
if (radius) return radius === "full" ? 9999 : radii[radius];
|
|
5188
|
-
};
|
|
5189
|
-
const variantColors = getVariantColors(theme, activeColor, mode, variant, highContrast);
|
|
5262
|
+
const radii = theme.radii[radius || theme.radius] ?? theme.radii.medium;
|
|
5263
|
+
const selectedRadius = radius || theme.radius;
|
|
5264
|
+
const variantColors = getVariantColors(theme, color || theme.accentColor, mode, variant, highContrast);
|
|
5190
5265
|
const getSizeValues = () => {
|
|
5191
5266
|
switch (size) {
|
|
5192
5267
|
case 1: return {
|
|
5193
5268
|
size: 32,
|
|
5194
5269
|
iconSize: 16,
|
|
5195
|
-
borderRadius: radii
|
|
5270
|
+
borderRadius: selectedRadius === "full" ? 9999 : radii
|
|
5196
5271
|
};
|
|
5197
5272
|
case 3: return {
|
|
5198
5273
|
size: 56,
|
|
5199
5274
|
iconSize: 24,
|
|
5200
|
-
borderRadius: radii
|
|
5275
|
+
borderRadius: selectedRadius === "full" ? 9999 : radii
|
|
5201
5276
|
};
|
|
5202
5277
|
case 4: return {
|
|
5203
5278
|
size: 64,
|
|
5204
5279
|
iconSize: 28,
|
|
5205
|
-
borderRadius: radii
|
|
5280
|
+
borderRadius: selectedRadius === "full" ? 9999 : radii
|
|
5206
5281
|
};
|
|
5207
5282
|
default: return {
|
|
5208
5283
|
size: 40,
|
|
5209
5284
|
iconSize: 20,
|
|
5210
|
-
borderRadius: radii
|
|
5285
|
+
borderRadius: selectedRadius === "full" ? 9999 : radii
|
|
5211
5286
|
};
|
|
5212
5287
|
}
|
|
5213
5288
|
};
|
|
5214
5289
|
const sizeValues = getSizeValues();
|
|
5215
|
-
const customBorderRadius = getBorderRadius();
|
|
5216
5290
|
const buttonStyle = {
|
|
5217
5291
|
width: sizeValues.size,
|
|
5218
5292
|
height: sizeValues.size,
|
|
5219
5293
|
backgroundColor: disabled ? grayAlpha["3"] : variantColors.backgroundColor,
|
|
5220
5294
|
borderColor: variantColors.borderColor,
|
|
5221
5295
|
borderWidth: variant === "outline" ? 1 : 0,
|
|
5222
|
-
borderRadius:
|
|
5296
|
+
borderRadius: sizeValues.borderRadius,
|
|
5223
5297
|
opacity: disabled ? .5 : 1,
|
|
5224
5298
|
alignItems: "center",
|
|
5225
5299
|
justifyContent: "center"
|
|
@@ -5242,7 +5316,7 @@ const IconButton = React.forwardRef(({ children, style = {}, variant = "classic"
|
|
|
5242
5316
|
...child.props
|
|
5243
5317
|
});
|
|
5244
5318
|
}
|
|
5245
|
-
return /* @__PURE__ */ jsx(
|
|
5319
|
+
return /* @__PURE__ */ jsx(AnimatedPressable, {
|
|
5246
5320
|
ref,
|
|
5247
5321
|
style: [buttonStyle, style],
|
|
5248
5322
|
onPress,
|
|
@@ -5259,8 +5333,8 @@ const IconButton = React.forwardRef(({ children, style = {}, variant = "classic"
|
|
|
5259
5333
|
size: "small",
|
|
5260
5334
|
color: variantColors.textColor
|
|
5261
5335
|
}) : React.isValidElement(children) ? React.cloneElement(children, {
|
|
5262
|
-
size: sizeValues.iconSize,
|
|
5263
|
-
color: variantColors.textColor
|
|
5336
|
+
size: children.props?.size || sizeValues.iconSize,
|
|
5337
|
+
color: children.props?.color || variantColors.textColor
|
|
5264
5338
|
}) : children
|
|
5265
5339
|
});
|
|
5266
5340
|
});
|
|
@@ -5390,7 +5464,6 @@ const TextFieldRoot = React.forwardRef(({ children, ...props }, ref) => {
|
|
|
5390
5464
|
};
|
|
5391
5465
|
const inputContainerStyle = {
|
|
5392
5466
|
width: "100%",
|
|
5393
|
-
flex: 1,
|
|
5394
5467
|
flexDirection: "row",
|
|
5395
5468
|
alignItems: "center",
|
|
5396
5469
|
justifyContent: "space-between",
|
|
@@ -5414,7 +5487,8 @@ const TextFieldRoot = React.forwardRef(({ children, ...props }, ref) => {
|
|
|
5414
5487
|
paddingHorizontal: sizeValues.paddingHorizontal / 2,
|
|
5415
5488
|
minHeight: multiline ? sizeValues.height : void 0,
|
|
5416
5489
|
height: multiline ? void 0 : sizeValues.height,
|
|
5417
|
-
textAlignVertical: multiline ? "top" : "center"
|
|
5490
|
+
textAlignVertical: multiline ? "top" : "center",
|
|
5491
|
+
borderRadius: sizeValues.borderRadius
|
|
5418
5492
|
};
|
|
5419
5493
|
const errorStyle = {
|
|
5420
5494
|
color: theme.colors.ruby[10],
|
|
@@ -5440,7 +5514,7 @@ const TextFieldRoot = React.forwardRef(({ children, ...props }, ref) => {
|
|
|
5440
5514
|
};
|
|
5441
5515
|
return /* @__PURE__ */ jsxs(View, {
|
|
5442
5516
|
style: [
|
|
5443
|
-
styles$
|
|
5517
|
+
styles$33.container,
|
|
5444
5518
|
containerStyle,
|
|
5445
5519
|
style
|
|
5446
5520
|
],
|
|
@@ -5458,7 +5532,7 @@ const TextFieldRoot = React.forwardRef(({ children, ...props }, ref) => {
|
|
|
5458
5532
|
style: inputInnerContainerStyle,
|
|
5459
5533
|
children: [
|
|
5460
5534
|
leftSlots.length > 0 && /* @__PURE__ */ jsx(View, {
|
|
5461
|
-
style: [styles$
|
|
5535
|
+
style: [styles$33.leftSlots, slotWrapperStyle],
|
|
5462
5536
|
children: leftSlots.map((child, index) => isValidElement(child) ? React.cloneElement(child, {
|
|
5463
5537
|
key: index,
|
|
5464
5538
|
side: "left"
|
|
@@ -5469,11 +5543,11 @@ const TextFieldRoot = React.forwardRef(({ children, ...props }, ref) => {
|
|
|
5469
5543
|
style: { flex: 1 },
|
|
5470
5544
|
children: /* @__PURE__ */ jsx(RnTextInput, {
|
|
5471
5545
|
...commonInputProps,
|
|
5472
|
-
style: [styles$
|
|
5546
|
+
style: [styles$33.input, inputStyle]
|
|
5473
5547
|
})
|
|
5474
5548
|
}),
|
|
5475
5549
|
rightSlots.length > 0 && /* @__PURE__ */ jsx(View, {
|
|
5476
|
-
style: [styles$
|
|
5550
|
+
style: [styles$33.rightSlots, slotWrapperStyle],
|
|
5477
5551
|
children: rightSlots.map((child, index) => isValidElement(child) ? React.cloneElement(child, {
|
|
5478
5552
|
key: index,
|
|
5479
5553
|
side: "right"
|
|
@@ -5499,11 +5573,8 @@ const TextField = React.forwardRef((props, ref) => {
|
|
|
5499
5573
|
TextField.displayName = "TextField";
|
|
5500
5574
|
TextField.Root = TextFieldRoot;
|
|
5501
5575
|
TextField.Slot = TextFieldSlot;
|
|
5502
|
-
const styles$
|
|
5503
|
-
container: {
|
|
5504
|
-
flex: 1,
|
|
5505
|
-
width: "100%"
|
|
5506
|
-
},
|
|
5576
|
+
const styles$33 = StyleSheet.create({
|
|
5577
|
+
container: { width: "100%" },
|
|
5507
5578
|
leftSlots: {
|
|
5508
5579
|
flexDirection: "row",
|
|
5509
5580
|
alignItems: "center"
|
|
@@ -5515,25 +5586,73 @@ const styles$31 = StyleSheet.create({
|
|
|
5515
5586
|
input: {
|
|
5516
5587
|
flexDirection: "row",
|
|
5517
5588
|
width: "100%",
|
|
5518
|
-
minWidth: "100%"
|
|
5519
|
-
flex: 1
|
|
5589
|
+
minWidth: "100%"
|
|
5520
5590
|
}
|
|
5521
5591
|
});
|
|
5522
5592
|
|
|
5523
5593
|
//#endregion
|
|
5524
5594
|
//#region src/components/forms/TextArea.tsx
|
|
5525
|
-
const
|
|
5595
|
+
const TextAreaSlot = React.forwardRef(({ side, color, gap, paddingHorizontal, paddingLeft, paddingRight, children, ...props }, ref) => {
|
|
5596
|
+
const theme = useTheme$1();
|
|
5597
|
+
const isDark = useThemeMode$1() === "dark";
|
|
5598
|
+
const slotStyle = {
|
|
5599
|
+
...props.style,
|
|
5600
|
+
gap: gap !== void 0 ? gap : void 0,
|
|
5601
|
+
paddingHorizontal: paddingHorizontal !== void 0 ? paddingHorizontal : void 0,
|
|
5602
|
+
paddingLeft: paddingLeft !== void 0 ? paddingLeft : void 0,
|
|
5603
|
+
paddingRight: paddingRight !== void 0 ? paddingRight : void 0
|
|
5604
|
+
};
|
|
5605
|
+
const coloredChild = useMemo(() => {
|
|
5606
|
+
if (!color || !isValidElement(children)) return children;
|
|
5607
|
+
return React.cloneElement(children, { color: theme.colors[color][9] });
|
|
5608
|
+
}, [
|
|
5609
|
+
children,
|
|
5610
|
+
color,
|
|
5611
|
+
theme,
|
|
5612
|
+
isDark
|
|
5613
|
+
]);
|
|
5614
|
+
return /* @__PURE__ */ jsx(Slot, {
|
|
5615
|
+
ref,
|
|
5616
|
+
style: slotStyle,
|
|
5617
|
+
...props,
|
|
5618
|
+
children: coloredChild
|
|
5619
|
+
});
|
|
5620
|
+
});
|
|
5621
|
+
TextAreaSlot.displayName = "TextAreaSlot";
|
|
5622
|
+
const TextAreaRoot = React.forwardRef(({ children, ...props }, ref) => {
|
|
5526
5623
|
const theme = useTheme$1();
|
|
5527
5624
|
const mode = useThemeMode$1();
|
|
5528
5625
|
const isDark = mode === "dark";
|
|
5529
5626
|
const grayScale = isDark ? theme.colors.gray.dark : theme.colors.gray;
|
|
5530
5627
|
const grayAlpha = getGrayAlpha(theme);
|
|
5531
5628
|
const { value, onChangeText, placeholder, label, error, disabled = false, color = "gray", highContrast = false, radius = "medium", size = "2", variant = "outline", rows = 4, autoGrow = false, accessibilityLabel, accessibilityHint, style, ...rest } = props;
|
|
5629
|
+
const { leftSlots, rightSlots } = useMemo(() => {
|
|
5630
|
+
const slotChildren = [];
|
|
5631
|
+
Children.forEach(children, (child) => {
|
|
5632
|
+
if (!isValidElement(child)) return;
|
|
5633
|
+
if (child.type?.displayName === "TextAreaSlot") slotChildren.push(child);
|
|
5634
|
+
});
|
|
5635
|
+
const leftSlots = [];
|
|
5636
|
+
const rightSlots = [];
|
|
5637
|
+
slotChildren.forEach((child) => {
|
|
5638
|
+
if (!isValidElement(child)) return;
|
|
5639
|
+
const explicitSide = child.props.side;
|
|
5640
|
+
if (explicitSide === "left") leftSlots.push(child);
|
|
5641
|
+
else if (explicitSide === "right") rightSlots.push(child);
|
|
5642
|
+
else if (slotChildren.filter((c) => isValidElement(c) && !c.props?.side).indexOf(child) === 0) leftSlots.push(child);
|
|
5643
|
+
else rightSlots.push(child);
|
|
5644
|
+
});
|
|
5645
|
+
return {
|
|
5646
|
+
leftSlots,
|
|
5647
|
+
rightSlots
|
|
5648
|
+
};
|
|
5649
|
+
}, [children]);
|
|
5532
5650
|
const [isFocused, setIsFocused] = useState(false);
|
|
5533
5651
|
const activeColor = color || theme.accentColor;
|
|
5534
5652
|
const radii = theme.radii[radius] ?? theme.radii.medium;
|
|
5535
5653
|
const selectedRadius = radius || theme.radius;
|
|
5536
5654
|
const variantColors = getVariantColors(theme, activeColor, mode, variant, highContrast);
|
|
5655
|
+
const accentColorScale = getColorScale(theme, activeColor, mode);
|
|
5537
5656
|
const getSizeValues = () => {
|
|
5538
5657
|
switch (size) {
|
|
5539
5658
|
case "1": return {
|
|
@@ -5562,10 +5681,10 @@ const TextAreaRoot = React.forwardRef((props, ref) => {
|
|
|
5562
5681
|
};
|
|
5563
5682
|
const inputContainerBorderColor = () => {
|
|
5564
5683
|
if (error) return theme.colors.ruby[9];
|
|
5565
|
-
else return isFocused ?
|
|
5684
|
+
else return isFocused ? accentColorScale["8"] : "transparent";
|
|
5566
5685
|
};
|
|
5567
5686
|
const inputContainerBackgroundColor = () => {
|
|
5568
|
-
if (disabled) return isDark ? grayAlpha["
|
|
5687
|
+
if (disabled) return isDark ? grayAlpha["2"] : grayAlpha["2"];
|
|
5569
5688
|
else return variantColors.backgroundColor;
|
|
5570
5689
|
};
|
|
5571
5690
|
const inputBorderColor = () => {
|
|
@@ -5574,16 +5693,21 @@ const TextAreaRoot = React.forwardRef((props, ref) => {
|
|
|
5574
5693
|
};
|
|
5575
5694
|
const inputContainerStyle = {
|
|
5576
5695
|
width: "100%",
|
|
5577
|
-
|
|
5696
|
+
flexDirection: "row",
|
|
5697
|
+
alignItems: "flex-start",
|
|
5698
|
+
justifyContent: "space-between",
|
|
5699
|
+
borderWidth: variant === "soft" ? 1.4 : 2,
|
|
5578
5700
|
borderColor: inputContainerBorderColor(),
|
|
5579
5701
|
backgroundColor: inputContainerBackgroundColor(),
|
|
5580
5702
|
borderRadius: selectedRadius === "full" ? theme.radii.large : radii,
|
|
5581
5703
|
opacity: disabled ? .6 : 1
|
|
5582
5704
|
};
|
|
5583
|
-
const
|
|
5705
|
+
const inputInnerContainerStyle = {
|
|
5584
5706
|
borderWidth: 1,
|
|
5585
5707
|
borderColor: inputBorderColor(),
|
|
5586
|
-
borderRadius: selectedRadius === "full" ? theme.radii.large : radii
|
|
5708
|
+
borderRadius: selectedRadius === "full" ? theme.radii.large : radii
|
|
5709
|
+
};
|
|
5710
|
+
const inputStyle = {
|
|
5587
5711
|
fontSize: sizeValues.fontSize,
|
|
5588
5712
|
color: color !== "gray" ? variantColors.textColor : grayScale[12],
|
|
5589
5713
|
padding: sizeValues.padding,
|
|
@@ -5597,7 +5721,7 @@ const TextAreaRoot = React.forwardRef((props, ref) => {
|
|
|
5597
5721
|
};
|
|
5598
5722
|
return /* @__PURE__ */ jsxs(View, {
|
|
5599
5723
|
style: [
|
|
5600
|
-
styles$
|
|
5724
|
+
styles$32.container,
|
|
5601
5725
|
containerStyle,
|
|
5602
5726
|
style
|
|
5603
5727
|
],
|
|
@@ -5609,21 +5733,47 @@ const TextAreaRoot = React.forwardRef((props, ref) => {
|
|
|
5609
5733
|
}),
|
|
5610
5734
|
/* @__PURE__ */ jsx(View, {
|
|
5611
5735
|
style: inputContainerStyle,
|
|
5612
|
-
children: /* @__PURE__ */
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5736
|
+
children: /* @__PURE__ */ jsxs(Flex, {
|
|
5737
|
+
align: "stretch",
|
|
5738
|
+
direction: "row",
|
|
5739
|
+
style: inputInnerContainerStyle,
|
|
5740
|
+
children: [
|
|
5741
|
+
leftSlots.length > 0 && /* @__PURE__ */ jsx(View, {
|
|
5742
|
+
style: styles$32.leftSlots,
|
|
5743
|
+
children: leftSlots.map((child, index) => isValidElement(child) ? React.cloneElement(child, {
|
|
5744
|
+
key: index,
|
|
5745
|
+
side: "left"
|
|
5746
|
+
}) : child)
|
|
5747
|
+
}),
|
|
5748
|
+
/* @__PURE__ */ jsx(Flex, {
|
|
5749
|
+
direction: "row",
|
|
5750
|
+
style: { flex: 1 },
|
|
5751
|
+
wrap: "wrap",
|
|
5752
|
+
children: /* @__PURE__ */ jsx(RnTextInput, {
|
|
5753
|
+
ref,
|
|
5754
|
+
value,
|
|
5755
|
+
onChangeText,
|
|
5756
|
+
placeholder,
|
|
5757
|
+
placeholderTextColor: color !== "gray" ? theme.colors[color][12] + "99" : theme.colors.gray[9],
|
|
5758
|
+
editable: !disabled,
|
|
5759
|
+
multiline: true,
|
|
5760
|
+
accessibilityLabel: accessibilityLabel || label,
|
|
5761
|
+
accessibilityHint,
|
|
5762
|
+
accessibilityState: { disabled },
|
|
5763
|
+
style: [styles$32.input, inputStyle],
|
|
5764
|
+
onFocus: () => setIsFocused(true),
|
|
5765
|
+
onBlur: () => setIsFocused(false),
|
|
5766
|
+
...rest
|
|
5767
|
+
})
|
|
5768
|
+
}),
|
|
5769
|
+
rightSlots.length > 0 && /* @__PURE__ */ jsx(View, {
|
|
5770
|
+
style: styles$32.rightSlots,
|
|
5771
|
+
children: rightSlots.map((child, index) => isValidElement(child) ? React.cloneElement(child, {
|
|
5772
|
+
key: index,
|
|
5773
|
+
side: "right"
|
|
5774
|
+
}) : child)
|
|
5775
|
+
})
|
|
5776
|
+
]
|
|
5627
5777
|
})
|
|
5628
5778
|
}),
|
|
5629
5779
|
error && /* @__PURE__ */ jsx(RnText, {
|
|
@@ -5641,12 +5791,19 @@ const TextArea = React.forwardRef((props, ref) => {
|
|
|
5641
5791
|
});
|
|
5642
5792
|
});
|
|
5643
5793
|
TextArea.displayName = "TextArea";
|
|
5644
|
-
|
|
5794
|
+
TextArea.Root = TextAreaRoot;
|
|
5795
|
+
TextArea.Slot = TextAreaSlot;
|
|
5796
|
+
const styles$32 = StyleSheet.create({
|
|
5645
5797
|
container: { width: "100%" },
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
}
|
|
5798
|
+
leftSlots: {
|
|
5799
|
+
flexDirection: "row",
|
|
5800
|
+
alignItems: "flex-start"
|
|
5801
|
+
},
|
|
5802
|
+
rightSlots: {
|
|
5803
|
+
flexDirection: "row",
|
|
5804
|
+
alignItems: "flex-start"
|
|
5805
|
+
},
|
|
5806
|
+
input: { minWidth: "100%" }
|
|
5650
5807
|
});
|
|
5651
5808
|
|
|
5652
5809
|
//#endregion
|
|
@@ -5657,6 +5814,7 @@ const Checkbox = React.forwardRef(({ checked, defaultChecked = false, onCheckedC
|
|
|
5657
5814
|
const isChecked = isControlled ? checked : internalChecked;
|
|
5658
5815
|
const theme = useTheme$1();
|
|
5659
5816
|
const mode = useThemeMode$1();
|
|
5817
|
+
const globalHaptics = useHaptics$1();
|
|
5660
5818
|
const isDark = mode === "dark";
|
|
5661
5819
|
const grayScale = isDark ? theme.colors.gray.dark : theme.colors.gray;
|
|
5662
5820
|
const grayAlpha = getGrayAlpha(theme);
|
|
@@ -5702,7 +5860,7 @@ const Checkbox = React.forwardRef(({ checked, defaultChecked = false, onCheckedC
|
|
|
5702
5860
|
setInternalChecked(newChecked);
|
|
5703
5861
|
onCheckedChange?.(newChecked);
|
|
5704
5862
|
}
|
|
5705
|
-
if (hapticFeedback)
|
|
5863
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("press");
|
|
5706
5864
|
}
|
|
5707
5865
|
};
|
|
5708
5866
|
const boxStyle = {
|
|
@@ -5724,9 +5882,9 @@ const Checkbox = React.forwardRef(({ checked, defaultChecked = false, onCheckedC
|
|
|
5724
5882
|
color: theme.colors.gray || grayScale[12],
|
|
5725
5883
|
fontSize: sizeValues.fontSize
|
|
5726
5884
|
};
|
|
5727
|
-
return /* @__PURE__ */ jsxs(
|
|
5885
|
+
return /* @__PURE__ */ jsxs(AnimatedPressable, {
|
|
5728
5886
|
ref,
|
|
5729
|
-
style: styles$
|
|
5887
|
+
style: styles$31.container,
|
|
5730
5888
|
onPress: handlePress,
|
|
5731
5889
|
disabled,
|
|
5732
5890
|
accessibilityRole: "checkbox",
|
|
@@ -5742,9 +5900,9 @@ const Checkbox = React.forwardRef(({ checked, defaultChecked = false, onCheckedC
|
|
|
5742
5900
|
hapticFeedback: false,
|
|
5743
5901
|
...rest,
|
|
5744
5902
|
children: [/* @__PURE__ */ jsx(RnView, {
|
|
5745
|
-
style: [styles$
|
|
5903
|
+
style: [styles$31.checkbox, boxStyle],
|
|
5746
5904
|
children: (isChecked || indeterminate) && /* @__PURE__ */ jsx(RnView, {
|
|
5747
|
-
style: [styles$
|
|
5905
|
+
style: [styles$31.icon, iconStyle],
|
|
5748
5906
|
children: indeterminate ? /* @__PURE__ */ jsx(RnView, { style: {
|
|
5749
5907
|
width: sizeValues.iconSize * .9,
|
|
5750
5908
|
height: 2.8,
|
|
@@ -5775,13 +5933,13 @@ const Checkbox = React.forwardRef(({ checked, defaultChecked = false, onCheckedC
|
|
|
5775
5933
|
} })] })
|
|
5776
5934
|
})
|
|
5777
5935
|
}), label && /* @__PURE__ */ jsx(TextComponent, {
|
|
5778
|
-
style: [styles$
|
|
5936
|
+
style: [styles$31.label, labelStyle],
|
|
5779
5937
|
children: label
|
|
5780
5938
|
})]
|
|
5781
5939
|
});
|
|
5782
5940
|
});
|
|
5783
5941
|
Checkbox.displayName = "Checkbox";
|
|
5784
|
-
const styles$
|
|
5942
|
+
const styles$31 = StyleSheet.create({
|
|
5785
5943
|
container: {
|
|
5786
5944
|
flexDirection: "row",
|
|
5787
5945
|
alignItems: "center"
|
|
@@ -5811,7 +5969,7 @@ const CheckboxGroup = React.forwardRef(({ value, onValueChange, items, disabled
|
|
|
5811
5969
|
return /* @__PURE__ */ jsx(RnView, {
|
|
5812
5970
|
ref,
|
|
5813
5971
|
style: [
|
|
5814
|
-
styles$
|
|
5972
|
+
styles$30.container,
|
|
5815
5973
|
containerStyle,
|
|
5816
5974
|
style
|
|
5817
5975
|
],
|
|
@@ -5830,7 +5988,7 @@ const CheckboxGroup = React.forwardRef(({ value, onValueChange, items, disabled
|
|
|
5830
5988
|
});
|
|
5831
5989
|
});
|
|
5832
5990
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
5833
|
-
const styles$
|
|
5991
|
+
const styles$30 = StyleSheet.create({ container: { width: "100%" } });
|
|
5834
5992
|
|
|
5835
5993
|
//#endregion
|
|
5836
5994
|
//#region src/components/forms/CheckboxCards.tsx
|
|
@@ -5868,7 +6026,7 @@ const CheckboxCardsRoot = React.forwardRef(({ value: controlledValue, defaultVal
|
|
|
5868
6026
|
children: /* @__PURE__ */ jsx(RnView, {
|
|
5869
6027
|
ref,
|
|
5870
6028
|
style: [
|
|
5871
|
-
styles$
|
|
6029
|
+
styles$29.rootContainer,
|
|
5872
6030
|
containerStyle,
|
|
5873
6031
|
style
|
|
5874
6032
|
],
|
|
@@ -5882,6 +6040,7 @@ const CheckboxCardsItem = React.forwardRef(({ value, side: itemSide, disabled: i
|
|
|
5882
6040
|
const context = useCheckboxCardsContext();
|
|
5883
6041
|
const theme = useTheme$1();
|
|
5884
6042
|
const mode = useThemeMode$1();
|
|
6043
|
+
const globalHaptics = useHaptics$1();
|
|
5885
6044
|
const isDark = mode === "dark";
|
|
5886
6045
|
const { value: selectedValues, onValueChange, variant, size, color, highContrast, radius, side: rootSide, disabled: rootDisabled } = context;
|
|
5887
6046
|
const isChecked = selectedValues.includes(value);
|
|
@@ -5921,7 +6080,7 @@ const CheckboxCardsItem = React.forwardRef(({ value, side: itemSide, disabled: i
|
|
|
5921
6080
|
if (!isDisabled) {
|
|
5922
6081
|
if (isChecked) onValueChange(selectedValues.filter((v) => v !== value));
|
|
5923
6082
|
else onValueChange([...selectedValues, value]);
|
|
5924
|
-
|
|
6083
|
+
if (globalHaptics) triggerHaptic("press");
|
|
5925
6084
|
}
|
|
5926
6085
|
};
|
|
5927
6086
|
const cardStyle = {
|
|
@@ -5936,10 +6095,10 @@ const CheckboxCardsItem = React.forwardRef(({ value, side: itemSide, disabled: i
|
|
|
5936
6095
|
gap: theme.space[3]
|
|
5937
6096
|
};
|
|
5938
6097
|
sizeValues.indicatorSize, sizeValues.indicatorSize, sizeValues.borderWidth, isChecked ? variantColors.borderColor : grayAlpha["8"], isChecked && variantColors.backgroundColor;
|
|
5939
|
-
return /* @__PURE__ */ jsxs(
|
|
6098
|
+
return /* @__PURE__ */ jsxs(AnimatedPressable, {
|
|
5940
6099
|
ref,
|
|
5941
6100
|
style: [
|
|
5942
|
-
styles$
|
|
6101
|
+
styles$29.itemContainer,
|
|
5943
6102
|
cardStyle,
|
|
5944
6103
|
style
|
|
5945
6104
|
],
|
|
@@ -5966,13 +6125,13 @@ const CheckboxCardsItem = React.forwardRef(({ value, side: itemSide, disabled: i
|
|
|
5966
6125
|
size,
|
|
5967
6126
|
onCheckedChange: handlePress
|
|
5968
6127
|
}), /* @__PURE__ */ jsx(RnView, {
|
|
5969
|
-
style: styles$
|
|
6128
|
+
style: styles$29.content,
|
|
5970
6129
|
children
|
|
5971
6130
|
})]
|
|
5972
6131
|
});
|
|
5973
6132
|
});
|
|
5974
6133
|
CheckboxCardsItem.displayName = "CheckboxCards.Item";
|
|
5975
|
-
const styles$
|
|
6134
|
+
const styles$29 = StyleSheet.create({
|
|
5976
6135
|
rootContainer: { width: "100%" },
|
|
5977
6136
|
itemContainer: { flex: 1 },
|
|
5978
6137
|
content: { flex: 1 }
|
|
@@ -5987,6 +6146,7 @@ const CheckboxCards = {
|
|
|
5987
6146
|
const Radio = React.forwardRef(({ defaultChecked, value, selected, onSelect, disabled = false, size = "2", variant = "solid", color, label, children, highContrast = false, accessibilityLabel, accessibilityHint, hapticFeedback = true, ...rest }, ref) => {
|
|
5988
6147
|
const theme = useTheme$1();
|
|
5989
6148
|
const mode = useThemeMode$1();
|
|
6149
|
+
const globalHaptics = useHaptics$1();
|
|
5990
6150
|
const grayScale = mode === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
5991
6151
|
getGrayAlpha(theme);
|
|
5992
6152
|
const accentScale = getAccentColor(theme, mode);
|
|
@@ -6026,7 +6186,7 @@ const Radio = React.forwardRef(({ defaultChecked, value, selected, onSelect, dis
|
|
|
6026
6186
|
if (!disabled) {
|
|
6027
6187
|
if (onSelect) onSelect(value);
|
|
6028
6188
|
if (selected === void 0) setIsInternallySelected(true);
|
|
6029
|
-
if (hapticFeedback)
|
|
6189
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("press");
|
|
6030
6190
|
}
|
|
6031
6191
|
};
|
|
6032
6192
|
const outerStyle = {
|
|
@@ -6050,9 +6210,9 @@ const Radio = React.forwardRef(({ defaultChecked, value, selected, onSelect, dis
|
|
|
6050
6210
|
color: grayScale[12],
|
|
6051
6211
|
fontSize: sizeValues.fontSize
|
|
6052
6212
|
};
|
|
6053
|
-
return /* @__PURE__ */ jsxs(
|
|
6213
|
+
return /* @__PURE__ */ jsxs(AnimatedPressable, {
|
|
6054
6214
|
ref,
|
|
6055
|
-
style: styles$
|
|
6215
|
+
style: styles$28.container,
|
|
6056
6216
|
onPress: handlePress,
|
|
6057
6217
|
disabled,
|
|
6058
6218
|
accessibilityRole: "radio",
|
|
@@ -6068,19 +6228,19 @@ const Radio = React.forwardRef(({ defaultChecked, value, selected, onSelect, dis
|
|
|
6068
6228
|
hapticFeedback: false,
|
|
6069
6229
|
...rest,
|
|
6070
6230
|
children: [/* @__PURE__ */ jsx(RnView, {
|
|
6071
|
-
style: [styles$
|
|
6072
|
-
children: /* @__PURE__ */ jsx(RnView, { style: [styles$
|
|
6231
|
+
style: [styles$28.radioOuter, outerStyle],
|
|
6232
|
+
children: /* @__PURE__ */ jsx(RnView, { style: [styles$28.radioInner, innerStyle] })
|
|
6073
6233
|
}), children ? /* @__PURE__ */ jsx(RnView, {
|
|
6074
|
-
style: styles$
|
|
6234
|
+
style: styles$28.content,
|
|
6075
6235
|
children
|
|
6076
6236
|
}) : label ? /* @__PURE__ */ jsx(TextComponent, {
|
|
6077
|
-
style: [styles$
|
|
6237
|
+
style: [styles$28.label, labelStyle],
|
|
6078
6238
|
children: label
|
|
6079
6239
|
}) : null]
|
|
6080
6240
|
});
|
|
6081
6241
|
});
|
|
6082
6242
|
Radio.displayName = "Radio";
|
|
6083
|
-
const styles$
|
|
6243
|
+
const styles$28 = StyleSheet.create({
|
|
6084
6244
|
container: {
|
|
6085
6245
|
flexDirection: "row",
|
|
6086
6246
|
alignItems: "center"
|
|
@@ -6131,7 +6291,7 @@ const RadioGroupRoot = React.forwardRef(({ value: controlledValue, defaultValue,
|
|
|
6131
6291
|
children: /* @__PURE__ */ jsx(RnView, {
|
|
6132
6292
|
ref,
|
|
6133
6293
|
style: [
|
|
6134
|
-
styles$
|
|
6294
|
+
styles$27.container,
|
|
6135
6295
|
containerStyle,
|
|
6136
6296
|
style
|
|
6137
6297
|
],
|
|
@@ -6162,7 +6322,7 @@ const RadioGroupItem = React.forwardRef(({ value, disabled: itemDisabled, ...pro
|
|
|
6162
6322
|
});
|
|
6163
6323
|
});
|
|
6164
6324
|
RadioGroupItem.displayName = "RadioGroup.Item";
|
|
6165
|
-
const styles$
|
|
6325
|
+
const styles$27 = StyleSheet.create({ container: { width: "100%" } });
|
|
6166
6326
|
const RadioGroup = {
|
|
6167
6327
|
Root: RadioGroupRoot,
|
|
6168
6328
|
Item: RadioGroupItem
|
|
@@ -6204,7 +6364,7 @@ const RadioCardsRoot = React.forwardRef(({ value: controlledValue, defaultValue,
|
|
|
6204
6364
|
children: /* @__PURE__ */ jsx(RnView, {
|
|
6205
6365
|
ref,
|
|
6206
6366
|
style: [
|
|
6207
|
-
styles$
|
|
6367
|
+
styles$26.rootContainer,
|
|
6208
6368
|
containerStyle,
|
|
6209
6369
|
style
|
|
6210
6370
|
],
|
|
@@ -6218,6 +6378,7 @@ const RadioCardsItem = React.forwardRef(({ value, side: itemSide, disabled: item
|
|
|
6218
6378
|
const context = useRadioCardsContext();
|
|
6219
6379
|
const theme = useTheme$1();
|
|
6220
6380
|
const mode = useThemeMode$1();
|
|
6381
|
+
const globalHaptics = useHaptics$1();
|
|
6221
6382
|
const isDark = mode === "dark";
|
|
6222
6383
|
const { value: selectedValue, onValueChange, variant, size, color, highContrast, radius, side: rootSide, disabled: rootDisabled } = context;
|
|
6223
6384
|
const isSelected = selectedValue === value;
|
|
@@ -6253,14 +6414,14 @@ const RadioCardsItem = React.forwardRef(({ value, side: itemSide, disabled: item
|
|
|
6253
6414
|
const handlePress = () => {
|
|
6254
6415
|
if (!isDisabled) {
|
|
6255
6416
|
onValueChange(value);
|
|
6256
|
-
|
|
6417
|
+
if (globalHaptics) triggerHaptic("press");
|
|
6257
6418
|
}
|
|
6258
6419
|
};
|
|
6259
6420
|
const cardStyle = {
|
|
6260
6421
|
padding: sizeValues.padding,
|
|
6261
6422
|
borderRadius: radius === "full" ? 9999 : radii,
|
|
6262
6423
|
borderWidth: isSelected ? 1.5 : 1,
|
|
6263
|
-
borderColor: isSelected ? variantColors.borderColor : isDark ? grayAlpha["6"] : grayAlpha["6"],
|
|
6424
|
+
borderColor: isSelected ? variantColors.borderColor : ["outline", "surface"].includes(variant) ? isDark ? grayAlpha["6"] : grayAlpha["6"] : "transparent",
|
|
6264
6425
|
backgroundColor: isSelected ? variantColors.backgroundColor : isDark ? grayAlpha["2"] : grayAlpha["2"],
|
|
6265
6426
|
opacity: isDisabled ? .5 : 1,
|
|
6266
6427
|
flexDirection: indicatorSide === "left" ? "row" : "row-reverse",
|
|
@@ -6283,10 +6444,10 @@ const RadioCardsItem = React.forwardRef(({ value, side: itemSide, disabled: item
|
|
|
6283
6444
|
borderRadius: sizeValues.innerIndicatorSize / 2,
|
|
6284
6445
|
backgroundColor: variantColors.textColor
|
|
6285
6446
|
};
|
|
6286
|
-
return /* @__PURE__ */ jsxs(
|
|
6447
|
+
return /* @__PURE__ */ jsxs(AnimatedPressable, {
|
|
6287
6448
|
ref,
|
|
6288
6449
|
style: [
|
|
6289
|
-
styles$
|
|
6450
|
+
styles$26.itemContainer,
|
|
6290
6451
|
cardStyle,
|
|
6291
6452
|
style
|
|
6292
6453
|
],
|
|
@@ -6311,15 +6472,15 @@ const RadioCardsItem = React.forwardRef(({ value, side: itemSide, disabled: item
|
|
|
6311
6472
|
style: indicatorStyle,
|
|
6312
6473
|
children: isSelected && /* @__PURE__ */ jsx(RnView, { style: innerDotStyle })
|
|
6313
6474
|
}), /* @__PURE__ */ jsx(RnView, {
|
|
6314
|
-
style: styles$
|
|
6475
|
+
style: styles$26.content,
|
|
6315
6476
|
children
|
|
6316
6477
|
})]
|
|
6317
6478
|
});
|
|
6318
6479
|
});
|
|
6319
6480
|
RadioCardsItem.displayName = "RadioCards.Item";
|
|
6320
|
-
const styles$
|
|
6481
|
+
const styles$26 = StyleSheet.create({
|
|
6321
6482
|
rootContainer: { width: "100%" },
|
|
6322
|
-
itemContainer: {
|
|
6483
|
+
itemContainer: {},
|
|
6323
6484
|
content: { flex: 1 }
|
|
6324
6485
|
});
|
|
6325
6486
|
const RadioCards = {
|
|
@@ -6332,6 +6493,7 @@ const RadioCards = {
|
|
|
6332
6493
|
const Switch = React.forwardRef(({ defaultChecked, checked, onCheckedChange, disabled = false, radius = "full", size = "2", color, variant = "solid", thumbColor, label, highContrast, accessibilityLabel, accessibilityHint, hapticFeedback = true, ...rest }, ref) => {
|
|
6333
6494
|
const theme = useTheme$1();
|
|
6334
6495
|
const mode = useThemeMode$1();
|
|
6496
|
+
const globalHaptics = useHaptics$1();
|
|
6335
6497
|
const isDark = mode === "dark";
|
|
6336
6498
|
const grayScale = isDark ? theme.colors.gray.dark : theme.colors.gray;
|
|
6337
6499
|
const grayAlpha = getGrayAlpha(theme);
|
|
@@ -6349,7 +6511,7 @@ const Switch = React.forwardRef(({ defaultChecked, checked, onCheckedChange, dis
|
|
|
6349
6511
|
const setChecked = (value) => {
|
|
6350
6512
|
if (checked === void 0) setInternalChecked(value);
|
|
6351
6513
|
if (onCheckedChange) onCheckedChange(value);
|
|
6352
|
-
if (hapticFeedback && !disabled)
|
|
6514
|
+
if (globalHaptics && hapticFeedback && !disabled) triggerHaptic("press");
|
|
6353
6515
|
};
|
|
6354
6516
|
const animatedValue = useRef(new Animated.Value(isChecked ? 1 : 0));
|
|
6355
6517
|
useEffect(() => {
|
|
@@ -6415,9 +6577,9 @@ const Switch = React.forwardRef(({ defaultChecked, checked, onCheckedChange, dis
|
|
|
6415
6577
|
color: grayScale[12],
|
|
6416
6578
|
fontSize: sizeValues.fontSize
|
|
6417
6579
|
};
|
|
6418
|
-
return /* @__PURE__ */ jsxs(
|
|
6580
|
+
return /* @__PURE__ */ jsxs(AnimatedPressable, {
|
|
6419
6581
|
ref,
|
|
6420
|
-
style: styles$
|
|
6582
|
+
style: styles$25.container,
|
|
6421
6583
|
onPress: handlePress,
|
|
6422
6584
|
disabled,
|
|
6423
6585
|
accessibilityRole: "switch",
|
|
@@ -6433,16 +6595,16 @@ const Switch = React.forwardRef(({ defaultChecked, checked, onCheckedChange, dis
|
|
|
6433
6595
|
hapticFeedback: false,
|
|
6434
6596
|
...rest,
|
|
6435
6597
|
children: [/* @__PURE__ */ jsx(RnView, {
|
|
6436
|
-
style: [styles$
|
|
6437
|
-
children: /* @__PURE__ */ jsx(Animated.View, { style: [styles$
|
|
6598
|
+
style: [styles$25.track, trackStyle],
|
|
6599
|
+
children: /* @__PURE__ */ jsx(Animated.View, { style: [styles$25.thumb, thumbStyle] })
|
|
6438
6600
|
}), label && /* @__PURE__ */ jsx(TextComponent, {
|
|
6439
|
-
style: [styles$
|
|
6601
|
+
style: [styles$25.label, labelStyle],
|
|
6440
6602
|
children: label
|
|
6441
6603
|
})]
|
|
6442
6604
|
});
|
|
6443
6605
|
});
|
|
6444
6606
|
Switch.displayName = "Switch";
|
|
6445
|
-
const styles$
|
|
6607
|
+
const styles$25 = StyleSheet.create({
|
|
6446
6608
|
container: {
|
|
6447
6609
|
flexDirection: "row",
|
|
6448
6610
|
alignItems: "center"
|
|
@@ -6640,25 +6802,25 @@ function calculateContextMenuPosition(touchPoint, contentSize, screenSize, side
|
|
|
6640
6802
|
* ChevronDownIcon - A chevron pointing down using React Native View
|
|
6641
6803
|
* Can be rotated to point in different directions
|
|
6642
6804
|
*/
|
|
6643
|
-
const ChevronDownIcon
|
|
6805
|
+
const ChevronDownIcon = React.forwardRef(({ width = 9, height = 9, style, color = "currentColor" }, _forwardedRef) => {
|
|
6644
6806
|
const armWidth = width * .55;
|
|
6645
6807
|
const armHeight = 2;
|
|
6646
6808
|
const armOffset = width * .22;
|
|
6647
6809
|
return /* @__PURE__ */ jsxs(View, {
|
|
6648
6810
|
style: [
|
|
6649
|
-
styles$
|
|
6811
|
+
styles$24.chevronContainer,
|
|
6650
6812
|
{
|
|
6651
6813
|
width,
|
|
6652
6814
|
height
|
|
6653
6815
|
},
|
|
6654
6816
|
style
|
|
6655
6817
|
],
|
|
6656
|
-
children: [/* @__PURE__ */ jsx(View, { style: [styles$
|
|
6818
|
+
children: [/* @__PURE__ */ jsx(View, { style: [styles$24.chevronArm, {
|
|
6657
6819
|
width: armWidth,
|
|
6658
6820
|
height: armHeight,
|
|
6659
6821
|
backgroundColor: color,
|
|
6660
6822
|
transform: [{ rotate: "45deg" }, { translateX: -armOffset }]
|
|
6661
|
-
}] }), /* @__PURE__ */ jsx(View, { style: [styles$
|
|
6823
|
+
}] }), /* @__PURE__ */ jsx(View, { style: [styles$24.chevronArm, {
|
|
6662
6824
|
width: armWidth,
|
|
6663
6825
|
height: armHeight,
|
|
6664
6826
|
backgroundColor: color,
|
|
@@ -6666,7 +6828,7 @@ const ChevronDownIcon$1 = React.forwardRef(({ width = 9, height = 9, style, colo
|
|
|
6666
6828
|
}] })]
|
|
6667
6829
|
});
|
|
6668
6830
|
});
|
|
6669
|
-
ChevronDownIcon
|
|
6831
|
+
ChevronDownIcon.displayName = "ChevronDownIcon";
|
|
6670
6832
|
/**
|
|
6671
6833
|
* ThickChevronRightIcon - A thick chevron pointing right using React Native View
|
|
6672
6834
|
*/
|
|
@@ -6675,19 +6837,19 @@ const ThickChevronRightIcon = React.forwardRef(({ width = 9, height = 9, style,
|
|
|
6675
6837
|
const armHeight = 2.5;
|
|
6676
6838
|
return /* @__PURE__ */ jsxs(View, {
|
|
6677
6839
|
style: [
|
|
6678
|
-
styles$
|
|
6840
|
+
styles$24.chevronContainer,
|
|
6679
6841
|
{
|
|
6680
6842
|
width,
|
|
6681
6843
|
height
|
|
6682
6844
|
},
|
|
6683
6845
|
style
|
|
6684
6846
|
],
|
|
6685
|
-
children: [/* @__PURE__ */ jsx(View, { style: [styles$
|
|
6847
|
+
children: [/* @__PURE__ */ jsx(View, { style: [styles$24.chevronArm, {
|
|
6686
6848
|
width: armWidth,
|
|
6687
6849
|
height: armHeight,
|
|
6688
6850
|
backgroundColor: color,
|
|
6689
6851
|
transform: [{ rotate: "45deg" }, { translateY: -1 }]
|
|
6690
|
-
}] }), /* @__PURE__ */ jsx(View, { style: [styles$
|
|
6852
|
+
}] }), /* @__PURE__ */ jsx(View, { style: [styles$24.chevronArm, {
|
|
6691
6853
|
width: armWidth,
|
|
6692
6854
|
height: armHeight,
|
|
6693
6855
|
backgroundColor: color,
|
|
@@ -6702,14 +6864,14 @@ ThickChevronRightIcon.displayName = "ThickChevronRightIcon";
|
|
|
6702
6864
|
const ThickCheckIcon = React.forwardRef(({ width = 9, height = 9, style, color = "currentColor" }, _forwardedRef) => {
|
|
6703
6865
|
return /* @__PURE__ */ jsxs(View, {
|
|
6704
6866
|
style: [
|
|
6705
|
-
styles$
|
|
6867
|
+
styles$24.checkContainer,
|
|
6706
6868
|
{
|
|
6707
6869
|
width,
|
|
6708
6870
|
height
|
|
6709
6871
|
},
|
|
6710
6872
|
style
|
|
6711
6873
|
],
|
|
6712
|
-
children: [/* @__PURE__ */ jsx(View, { style: [styles$
|
|
6874
|
+
children: [/* @__PURE__ */ jsx(View, { style: [styles$24.checkShortArm, { backgroundColor: color }] }), /* @__PURE__ */ jsx(View, { style: [styles$24.checkLongArm, { backgroundColor: color }] })]
|
|
6713
6875
|
});
|
|
6714
6876
|
});
|
|
6715
6877
|
ThickCheckIcon.displayName = "ThickCheckIcon";
|
|
@@ -6719,21 +6881,21 @@ ThickCheckIcon.displayName = "ThickCheckIcon";
|
|
|
6719
6881
|
const ThickDividerHorizontalIcon = React.forwardRef(({ width = 9, height = 9, style, color = "currentColor" }, _forwardedRef) => {
|
|
6720
6882
|
return /* @__PURE__ */ jsx(View, {
|
|
6721
6883
|
style: [
|
|
6722
|
-
styles$
|
|
6884
|
+
styles$24.dividerContainer,
|
|
6723
6885
|
{
|
|
6724
6886
|
width,
|
|
6725
6887
|
height
|
|
6726
6888
|
},
|
|
6727
6889
|
style
|
|
6728
6890
|
],
|
|
6729
|
-
children: /* @__PURE__ */ jsx(View, { style: [styles$
|
|
6891
|
+
children: /* @__PURE__ */ jsx(View, { style: [styles$24.dividerLine, {
|
|
6730
6892
|
width: width * .9,
|
|
6731
6893
|
backgroundColor: color
|
|
6732
6894
|
}] })
|
|
6733
6895
|
});
|
|
6734
6896
|
});
|
|
6735
6897
|
ThickDividerHorizontalIcon.displayName = "ThickDividerHorizontalIcon";
|
|
6736
|
-
const styles$
|
|
6898
|
+
const styles$24 = StyleSheet.create({
|
|
6737
6899
|
chevronContainer: {
|
|
6738
6900
|
alignItems: "center",
|
|
6739
6901
|
justifyContent: "center"
|
|
@@ -6887,10 +7049,11 @@ const SelectRoot = ({ defaultValue, value: controlledValue, onValueChange, open:
|
|
|
6887
7049
|
};
|
|
6888
7050
|
const SelectTrigger = ({ children, asChild = false }) => {
|
|
6889
7051
|
const { onOpenChange, open, anchorRef, measureAnchor, disabled } = useSelect();
|
|
7052
|
+
const globalHaptics = useHaptics$1();
|
|
6890
7053
|
const handlePress = () => {
|
|
6891
7054
|
measureAnchor();
|
|
6892
7055
|
onOpenChange(!open);
|
|
6893
|
-
|
|
7056
|
+
if (globalHaptics) triggerHaptic("press");
|
|
6894
7057
|
};
|
|
6895
7058
|
if (asChild && React.isValidElement(children)) {
|
|
6896
7059
|
const child = children;
|
|
@@ -6943,7 +7106,7 @@ const SelectValue = ({ placeholder = "Select an option", style }) => {
|
|
|
6943
7106
|
flexShrink: 1
|
|
6944
7107
|
}, style || {}],
|
|
6945
7108
|
children: selectedText || placeholder
|
|
6946
|
-
}), /* @__PURE__ */ jsx(ChevronDownIcon
|
|
7109
|
+
}), /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
6947
7110
|
color: selectedText ? variantColors.textColor : grayAlpha[9],
|
|
6948
7111
|
width: sizeStyles(),
|
|
6949
7112
|
height: sizeStyles(),
|
|
@@ -6967,7 +7130,7 @@ const SelectOverlay = ({ style }) => {
|
|
|
6967
7130
|
const { onOpenChange } = useSelect();
|
|
6968
7131
|
return /* @__PURE__ */ jsx(TouchableWithoutFeedback, {
|
|
6969
7132
|
onPress: () => onOpenChange(false),
|
|
6970
|
-
children: /* @__PURE__ */ jsx(View, { style: [styles$
|
|
7133
|
+
children: /* @__PURE__ */ jsx(View, { style: [styles$23.overlay, style] })
|
|
6971
7134
|
});
|
|
6972
7135
|
};
|
|
6973
7136
|
const SelectContent = ({ children, side = "bottom", sideOffset = 4, align = "start", alignOffset = 0, avoidCollisions = true, size = 2, style }) => {
|
|
@@ -7052,7 +7215,7 @@ const SelectContent = ({ children, side = "bottom", sideOffset = 4, align = "sta
|
|
|
7052
7215
|
ref: contentRef,
|
|
7053
7216
|
onLayout: handleLayout,
|
|
7054
7217
|
style: [
|
|
7055
|
-
styles$
|
|
7218
|
+
styles$23.content,
|
|
7056
7219
|
{
|
|
7057
7220
|
backgroundColor: isDark ? colors[3] : colors[1],
|
|
7058
7221
|
borderRadius: radii.medium,
|
|
@@ -7089,6 +7252,7 @@ const SelectItem = ({ children, value: itemValue, disabled = false, style }) =>
|
|
|
7089
7252
|
const { value, onValueChange, colors, onOpenChange, size, registerItem, unregisterItem, setSelectedItemText, color } = useSelect();
|
|
7090
7253
|
const theme = useTheme$1();
|
|
7091
7254
|
const mode = useThemeMode$1();
|
|
7255
|
+
const globalHaptics = useHaptics$1();
|
|
7092
7256
|
const isSelected = value === itemValue;
|
|
7093
7257
|
const extractText = useCallback((node) => {
|
|
7094
7258
|
if (typeof node === "string") return node;
|
|
@@ -7169,7 +7333,7 @@ const SelectItem = ({ children, value: itemValue, disabled = false, style }) =>
|
|
|
7169
7333
|
if (!disabled) {
|
|
7170
7334
|
setSelectedItemText(extractText(children));
|
|
7171
7335
|
onValueChange(itemValue);
|
|
7172
|
-
|
|
7336
|
+
if (globalHaptics) triggerHaptic("press");
|
|
7173
7337
|
}
|
|
7174
7338
|
};
|
|
7175
7339
|
const itemPadding = getItemPadding();
|
|
@@ -7184,8 +7348,8 @@ const SelectItem = ({ children, value: itemValue, disabled = false, style }) =>
|
|
|
7184
7348
|
onPress: handlePress,
|
|
7185
7349
|
disabled,
|
|
7186
7350
|
style: [
|
|
7187
|
-
styles$
|
|
7188
|
-
disabled && styles$
|
|
7351
|
+
styles$23.item,
|
|
7352
|
+
disabled && styles$23.itemDisabled,
|
|
7189
7353
|
itemPadding,
|
|
7190
7354
|
style,
|
|
7191
7355
|
{
|
|
@@ -7249,7 +7413,7 @@ const SelectItem = ({ children, value: itemValue, disabled = false, style }) =>
|
|
|
7249
7413
|
const SelectSeparator = ({ style }) => {
|
|
7250
7414
|
const { colors } = useSelect();
|
|
7251
7415
|
return /* @__PURE__ */ jsx(View, { style: [
|
|
7252
|
-
styles$
|
|
7416
|
+
styles$23.separator,
|
|
7253
7417
|
{ backgroundColor: colors[6] },
|
|
7254
7418
|
style
|
|
7255
7419
|
] });
|
|
@@ -7293,7 +7457,7 @@ const SelectLabel = ({ children, style = {} }) => {
|
|
|
7293
7457
|
children
|
|
7294
7458
|
});
|
|
7295
7459
|
};
|
|
7296
|
-
const styles$
|
|
7460
|
+
const styles$23 = StyleSheet.create({
|
|
7297
7461
|
overlay: {
|
|
7298
7462
|
flex: 1,
|
|
7299
7463
|
backgroundColor: "rgba(0, 0, 0, 0.01)"
|
|
@@ -7351,6 +7515,7 @@ const isRangeValue = (value) => {
|
|
|
7351
7515
|
const Slider = React.forwardRef(({ value: controlledValue, defaultValue, onValueChange, onValueChangeEnd, min = 0, max = 100, step = 1, disabled = false, size = "2", variant = "solid", color, radius = "full", highContrast = false, minStepsBetweenThumbs = 0, label, showValueLabel = false, valueLabelFormatter = (v) => v.toString(), accessibilityLabel, accessibilityHint, style, hapticFeedback = true, ...rest }, ref) => {
|
|
7352
7516
|
const theme = useTheme$1();
|
|
7353
7517
|
const mode = useThemeMode$1();
|
|
7518
|
+
const globalHaptics = useHaptics$1();
|
|
7354
7519
|
const isDark = mode === "dark";
|
|
7355
7520
|
const grayScale = isDark ? theme.colors.gray.dark : theme.colors.gray;
|
|
7356
7521
|
const grayAlpha = getGrayAlpha(theme);
|
|
@@ -7499,7 +7664,7 @@ const Slider = React.forwardRef(({ value: controlledValue, defaultValue, onValue
|
|
|
7499
7664
|
const touchX = event.nativeEvent.locationX;
|
|
7500
7665
|
const position = Math.max(0, Math.min(1, touchX / currentTrackLayout.width));
|
|
7501
7666
|
const newValue = positionToValue(position);
|
|
7502
|
-
if (hapticFeedback)
|
|
7667
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("press");
|
|
7503
7668
|
if (valuesRef.current.length === 1) {
|
|
7504
7669
|
updateValue([newValue]);
|
|
7505
7670
|
handleValueChangeEnd([newValue]);
|
|
@@ -7555,7 +7720,7 @@ const Slider = React.forwardRef(({ value: controlledValue, defaultValue, onValue
|
|
|
7555
7720
|
const nearestIndex = getNearestThumbIndex(Math.max(0, Math.min(1, touchX / trackLayoutRef2.current.width)));
|
|
7556
7721
|
setActiveThumbIndex(nearestIndex);
|
|
7557
7722
|
activeThumbIndexRef.current = nearestIndex;
|
|
7558
|
-
if (hapticFeedback)
|
|
7723
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("selection");
|
|
7559
7724
|
},
|
|
7560
7725
|
onPanResponderMove: (_event, gestureState) => {
|
|
7561
7726
|
if (activeThumbIndexRef.current !== null) handleDrag(gestureState, activeThumbIndexRef.current);
|
|
@@ -7564,13 +7729,13 @@ const Slider = React.forwardRef(({ value: controlledValue, defaultValue, onValue
|
|
|
7564
7729
|
setActiveThumbIndex(null);
|
|
7565
7730
|
activeThumbIndexRef.current = null;
|
|
7566
7731
|
handleValueChangeEnd(valuesRef.current);
|
|
7567
|
-
if (hapticFeedback)
|
|
7732
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("selection");
|
|
7568
7733
|
},
|
|
7569
7734
|
onPanResponderTerminate: () => {
|
|
7570
7735
|
setActiveThumbIndex(null);
|
|
7571
7736
|
activeThumbIndexRef.current = null;
|
|
7572
7737
|
handleValueChangeEnd(valuesRef.current);
|
|
7573
|
-
if (hapticFeedback)
|
|
7738
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("selection");
|
|
7574
7739
|
},
|
|
7575
7740
|
onPanResponderTerminationRequest: () => false
|
|
7576
7741
|
})).current;
|
|
@@ -7716,7 +7881,7 @@ const Slider = React.forwardRef(({ value: controlledValue, defaultValue, onValue
|
|
|
7716
7881
|
]);
|
|
7717
7882
|
return /* @__PURE__ */ jsxs(RnView, {
|
|
7718
7883
|
ref,
|
|
7719
|
-
style: [styles$
|
|
7884
|
+
style: [styles$22.container, style],
|
|
7720
7885
|
accessibilityRole: "adjustable",
|
|
7721
7886
|
accessibilityLabel: accessibilityLabel || label || "Slider",
|
|
7722
7887
|
accessibilityHint: accessibilityHint || `Value: ${formatValueLabel()}, range: ${min} to ${max}`,
|
|
@@ -7724,17 +7889,17 @@ const Slider = React.forwardRef(({ value: controlledValue, defaultValue, onValue
|
|
|
7724
7889
|
accessibilityState: { disabled },
|
|
7725
7890
|
...rest,
|
|
7726
7891
|
children: [(label || showValueLabel) && /* @__PURE__ */ jsxs(RnView, {
|
|
7727
|
-
style: styles$
|
|
7892
|
+
style: styles$22.labelContainer,
|
|
7728
7893
|
children: [label && /* @__PURE__ */ jsx(TextComponent, {
|
|
7729
|
-
style: [styles$
|
|
7894
|
+
style: [styles$22.label, labelStyle],
|
|
7730
7895
|
children: label
|
|
7731
7896
|
}), showValueLabel && /* @__PURE__ */ jsx(TextComponent, {
|
|
7732
|
-
style: [styles$
|
|
7897
|
+
style: [styles$22.valueLabel, labelStyle],
|
|
7733
7898
|
children: formatValueLabel()
|
|
7734
7899
|
})]
|
|
7735
7900
|
}), /* @__PURE__ */ jsxs(RnView, {
|
|
7736
7901
|
ref: trackLayoutRef,
|
|
7737
|
-
style: [styles$
|
|
7902
|
+
style: [styles$22.track, {
|
|
7738
7903
|
height: sizeValues.trackHeight,
|
|
7739
7904
|
borderRadius,
|
|
7740
7905
|
backgroundColor: trackBackgroundColor,
|
|
@@ -7747,15 +7912,15 @@ const Slider = React.forwardRef(({ value: controlledValue, defaultValue, onValue
|
|
|
7747
7912
|
values.length === 1 && thumbAnimations[0] && /* @__PURE__ */ jsx(Animated.View, { style: getFilledTrackStyle(thumbAnimations[0], 0) }),
|
|
7748
7913
|
values.length === 2 && thumbAnimations[0] && thumbAnimations[1] && /* @__PURE__ */ jsx(Animated.View, { style: getFilledTrackStyle(thumbAnimations[1], 1) }),
|
|
7749
7914
|
thumbAnimations.slice(0, values.length).map((animatedValue, index) => /* @__PURE__ */ jsx(Animated.View, {
|
|
7750
|
-
style: [styles$
|
|
7751
|
-
children: !disabled && /* @__PURE__ */ jsx(RnView, { style: [styles$
|
|
7915
|
+
style: [styles$22.thumb, getThumbStyle(animatedValue)],
|
|
7916
|
+
children: !disabled && /* @__PURE__ */ jsx(RnView, { style: [styles$22.thumbInner, thumbInnerStyle] })
|
|
7752
7917
|
}, index))
|
|
7753
7918
|
]
|
|
7754
7919
|
})]
|
|
7755
7920
|
});
|
|
7756
7921
|
});
|
|
7757
7922
|
Slider.displayName = "Slider";
|
|
7758
|
-
const styles$
|
|
7923
|
+
const styles$22 = StyleSheet.create({
|
|
7759
7924
|
container: { width: "100%" },
|
|
7760
7925
|
labelContainer: {
|
|
7761
7926
|
flexDirection: "row",
|
|
@@ -7835,7 +8000,7 @@ const DialogOverlay = ({ style }) => {
|
|
|
7835
8000
|
const { grayAlpha } = useDialog();
|
|
7836
8001
|
const overlayColor = useThemeMode$1() === "dark" ? "rgba(0, 0, 0, 0.6)" : "rgba(10, 10, 10, 0.6)";
|
|
7837
8002
|
return /* @__PURE__ */ jsx(TouchableWithoutFeedback, { children: /* @__PURE__ */ jsx(View, { style: [
|
|
7838
|
-
styles$
|
|
8003
|
+
styles$21.overlay,
|
|
7839
8004
|
{ backgroundColor: overlayColor },
|
|
7840
8005
|
style
|
|
7841
8006
|
] }) });
|
|
@@ -7877,7 +8042,7 @@ const DialogContent = ({ children, style, hideCloseButton = false, size = 2 }) =
|
|
|
7877
8042
|
const maxWidth = size <= 2 ? Math.min(screenWidth - 64, 400) : Math.min(screenWidth - 64, 500);
|
|
7878
8043
|
return /* @__PURE__ */ jsxs(View, {
|
|
7879
8044
|
style: [
|
|
7880
|
-
styles$
|
|
8045
|
+
styles$21.content,
|
|
7881
8046
|
{
|
|
7882
8047
|
backgroundColor: isDark ? theme.colors.gray.dark[2] : "#ffffff",
|
|
7883
8048
|
borderRadius: sizeStyles.radius,
|
|
@@ -7891,14 +8056,14 @@ const DialogContent = ({ children, style, hideCloseButton = false, size = 2 }) =
|
|
|
7891
8056
|
style
|
|
7892
8057
|
],
|
|
7893
8058
|
children: [/* @__PURE__ */ jsx(ScrollView, {
|
|
7894
|
-
style: styles$
|
|
7895
|
-
contentContainerStyle: styles$
|
|
8059
|
+
style: styles$21.scrollContent,
|
|
8060
|
+
contentContainerStyle: styles$21.scrollContentContainer,
|
|
7896
8061
|
showsVerticalScrollIndicator: true,
|
|
7897
8062
|
bounces: true,
|
|
7898
8063
|
children
|
|
7899
8064
|
}), !hideCloseButton && /* @__PURE__ */ jsx(Pressable, {
|
|
7900
8065
|
onPress: handleClose,
|
|
7901
|
-
style: [styles$
|
|
8066
|
+
style: [styles$21.closeButton, { backgroundColor: isDark ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.1)" }],
|
|
7902
8067
|
accessibilityRole: "button",
|
|
7903
8068
|
accessibilityLabel: "Close dialog",
|
|
7904
8069
|
children: /* @__PURE__ */ jsx(TextComponent, {
|
|
@@ -7983,7 +8148,7 @@ const DialogAction = ({ children, onPress, ...buttonProps }) => {
|
|
|
7983
8148
|
children
|
|
7984
8149
|
});
|
|
7985
8150
|
};
|
|
7986
|
-
const styles$
|
|
8151
|
+
const styles$21 = StyleSheet.create({
|
|
7987
8152
|
overlay: {
|
|
7988
8153
|
flex: 1,
|
|
7989
8154
|
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
@@ -8080,7 +8245,7 @@ const AlertDialogPortal = ({ children, hostId }) => {
|
|
|
8080
8245
|
const AlertDialogOverlay = ({ style }) => {
|
|
8081
8246
|
const overlayColor = useThemeMode$1() === "dark" ? "rgba(0, 0, 0, 0.6)" : "rgba(10, 10, 10, 0.6)";
|
|
8082
8247
|
return /* @__PURE__ */ jsx(TouchableWithoutFeedback, { children: /* @__PURE__ */ jsx(View, { style: [
|
|
8083
|
-
styles$
|
|
8248
|
+
styles$20.overlay,
|
|
8084
8249
|
{ backgroundColor: overlayColor },
|
|
8085
8250
|
style
|
|
8086
8251
|
] }) });
|
|
@@ -8121,7 +8286,7 @@ const AlertDialogContent = ({ children, style, hideCloseButton = true, size = 2
|
|
|
8121
8286
|
};
|
|
8122
8287
|
return /* @__PURE__ */ jsxs(View, {
|
|
8123
8288
|
style: [
|
|
8124
|
-
styles$
|
|
8289
|
+
styles$20.content,
|
|
8125
8290
|
{
|
|
8126
8291
|
backgroundColor: isDark ? theme.colors.gray.dark[2] : theme.colors.gray[1],
|
|
8127
8292
|
borderRadius: sizeStyles.radius,
|
|
@@ -8135,14 +8300,14 @@ const AlertDialogContent = ({ children, style, hideCloseButton = true, size = 2
|
|
|
8135
8300
|
style
|
|
8136
8301
|
],
|
|
8137
8302
|
children: [/* @__PURE__ */ jsx(ScrollView, {
|
|
8138
|
-
style: styles$
|
|
8139
|
-
contentContainerStyle: styles$
|
|
8303
|
+
style: styles$20.scrollContent,
|
|
8304
|
+
contentContainerStyle: styles$20.scrollContentContainer,
|
|
8140
8305
|
showsVerticalScrollIndicator: true,
|
|
8141
8306
|
bounces: true,
|
|
8142
8307
|
children
|
|
8143
8308
|
}), !hideCloseButton && /* @__PURE__ */ jsx(Pressable, {
|
|
8144
8309
|
onPress: handleClose,
|
|
8145
|
-
style: [styles$
|
|
8310
|
+
style: [styles$20.closeButton, { backgroundColor: isDark ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.1)" }],
|
|
8146
8311
|
accessibilityRole: "button",
|
|
8147
8312
|
accessibilityLabel: "Close dialog",
|
|
8148
8313
|
children: /* @__PURE__ */ jsx(TextComponent, {
|
|
@@ -8232,7 +8397,7 @@ const AlertDialog = ({ open, onOpenChange, title, description, cancel, action, c
|
|
|
8232
8397
|
description && /* @__PURE__ */ jsx(AlertDialogDescription, { children: description }),
|
|
8233
8398
|
children,
|
|
8234
8399
|
/* @__PURE__ */ jsxs(View, {
|
|
8235
|
-
style: styles$
|
|
8400
|
+
style: styles$20.actionRow,
|
|
8236
8401
|
children: [cancel && /* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
8237
8402
|
variant: "ghost",
|
|
8238
8403
|
children: cancel.label || "Cancel"
|
|
@@ -8246,7 +8411,7 @@ const AlertDialog = ({ open, onOpenChange, title, description, cancel, action, c
|
|
|
8246
8411
|
] })] })
|
|
8247
8412
|
});
|
|
8248
8413
|
};
|
|
8249
|
-
const styles$
|
|
8414
|
+
const styles$20 = StyleSheet.create({
|
|
8250
8415
|
overlay: {
|
|
8251
8416
|
flex: 1,
|
|
8252
8417
|
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
@@ -8440,7 +8605,7 @@ const PopoverOverlay = ({ style }) => {
|
|
|
8440
8605
|
const { onOpenChange } = usePopover();
|
|
8441
8606
|
return /* @__PURE__ */ jsx(TouchableWithoutFeedback, {
|
|
8442
8607
|
onPress: () => onOpenChange(false),
|
|
8443
|
-
children: /* @__PURE__ */ jsx(View, { style: [styles$
|
|
8608
|
+
children: /* @__PURE__ */ jsx(View, { style: [styles$19.overlay, style] })
|
|
8444
8609
|
});
|
|
8445
8610
|
};
|
|
8446
8611
|
const PopoverContent = ({ children, side = "bottom", sideOffset = 4, align = "center", alignOffset = 0, avoidCollisions = true, size = 2, style }) => {
|
|
@@ -8509,7 +8674,7 @@ const PopoverContent = ({ children, side = "bottom", sideOffset = 4, align = "ce
|
|
|
8509
8674
|
ref: contentRef,
|
|
8510
8675
|
onLayout: handleLayout,
|
|
8511
8676
|
style: [
|
|
8512
|
-
styles$
|
|
8677
|
+
styles$19.content,
|
|
8513
8678
|
{
|
|
8514
8679
|
backgroundColor: colors["1"] || grayAlpha["12"],
|
|
8515
8680
|
borderRadius: radii.medium,
|
|
@@ -8575,7 +8740,7 @@ const PopoverClose = ({ children, ariaLabel = "Close popover" }) => {
|
|
|
8575
8740
|
const { onOpenChange, colors } = usePopover();
|
|
8576
8741
|
return /* @__PURE__ */ jsx(Pressable, {
|
|
8577
8742
|
onPress: () => onOpenChange(false),
|
|
8578
|
-
style: styles$
|
|
8743
|
+
style: styles$19.closeButton,
|
|
8579
8744
|
accessibilityLabel: ariaLabel,
|
|
8580
8745
|
accessibilityRole: "button",
|
|
8581
8746
|
children: children || /* @__PURE__ */ jsx(TextComponent, {
|
|
@@ -8587,7 +8752,7 @@ const PopoverClose = ({ children, ariaLabel = "Close popover" }) => {
|
|
|
8587
8752
|
})
|
|
8588
8753
|
});
|
|
8589
8754
|
};
|
|
8590
|
-
const styles$
|
|
8755
|
+
const styles$19 = StyleSheet.create({
|
|
8591
8756
|
overlay: {
|
|
8592
8757
|
flex: 1,
|
|
8593
8758
|
backgroundColor: "rgba(0, 0, 0, 0.01)"
|
|
@@ -8748,7 +8913,7 @@ const TooltipPortal = ({ children }) => {
|
|
|
8748
8913
|
children: /* @__PURE__ */ jsx(TouchableWithoutFeedback, {
|
|
8749
8914
|
onPress: () => onOpenChange(false),
|
|
8750
8915
|
children: /* @__PURE__ */ jsx(View, {
|
|
8751
|
-
style: styles$
|
|
8916
|
+
style: styles$18.overlay,
|
|
8752
8917
|
children
|
|
8753
8918
|
})
|
|
8754
8919
|
})
|
|
@@ -8809,7 +8974,7 @@ const TooltipContent = ({ children, side = "top", sideOffset = 8, align = "cente
|
|
|
8809
8974
|
ref: contentRef,
|
|
8810
8975
|
onLayout: handleLayout,
|
|
8811
8976
|
style: [
|
|
8812
|
-
styles$
|
|
8977
|
+
styles$18.content,
|
|
8813
8978
|
{
|
|
8814
8979
|
backgroundColor: tooltipBackground,
|
|
8815
8980
|
borderRadius,
|
|
@@ -8835,15 +9000,15 @@ const TooltipContent = ({ children, side = "top", sideOffset = 8, align = "cente
|
|
|
8835
9000
|
},
|
|
8836
9001
|
children
|
|
8837
9002
|
}), /* @__PURE__ */ jsx(View, { style: [
|
|
8838
|
-
styles$
|
|
8839
|
-
actualSide === "top" && [styles$
|
|
8840
|
-
actualSide === "bottom" && [styles$
|
|
8841
|
-
actualSide === "left" && [styles$
|
|
9003
|
+
styles$18.arrow,
|
|
9004
|
+
actualSide === "top" && [styles$18.arrowBottom, { borderTopColor: arrowColor }],
|
|
9005
|
+
actualSide === "bottom" && [styles$18.arrowTop, { borderBottomColor: arrowColor }],
|
|
9006
|
+
actualSide === "left" && [styles$18.arrowRight, {
|
|
8842
9007
|
borderLeftColor: arrowColor,
|
|
8843
9008
|
borderTopColor: "transparent",
|
|
8844
9009
|
borderBottomColor: "transparent"
|
|
8845
9010
|
}],
|
|
8846
|
-
actualSide === "right" && [styles$
|
|
9011
|
+
actualSide === "right" && [styles$18.arrowLeft, {
|
|
8847
9012
|
borderRightColor: arrowColor,
|
|
8848
9013
|
borderTopColor: "transparent",
|
|
8849
9014
|
borderBottomColor: "transparent"
|
|
@@ -8882,7 +9047,7 @@ const Tooltip = ({ children, content, side = "top", sideOffset = 8, align = "cen
|
|
|
8882
9047
|
}) })]
|
|
8883
9048
|
});
|
|
8884
9049
|
};
|
|
8885
|
-
const styles$
|
|
9050
|
+
const styles$18 = StyleSheet.create({
|
|
8886
9051
|
overlay: {
|
|
8887
9052
|
flex: 1,
|
|
8888
9053
|
backgroundColor: "rgba(0, 0, 0, 0.01)"
|
|
@@ -8993,10 +9158,11 @@ const DropdownMenuRoot = ({ children, open: controlledOpen, onOpenChange, defaul
|
|
|
8993
9158
|
};
|
|
8994
9159
|
const DropdownMenuTrigger = ({ children, asChild = false, hapticFeedback = true }) => {
|
|
8995
9160
|
const { onOpenChange, open, anchorRef, measureAnchor } = useDropdownMenu();
|
|
9161
|
+
const globalHaptics = useHaptics$1();
|
|
8996
9162
|
const handlePress = () => {
|
|
8997
9163
|
measureAnchor();
|
|
8998
9164
|
onOpenChange(!open);
|
|
8999
|
-
if (hapticFeedback)
|
|
9165
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("press");
|
|
9000
9166
|
};
|
|
9001
9167
|
if (asChild && React.isValidElement(children)) {
|
|
9002
9168
|
const child = children;
|
|
@@ -9008,7 +9174,7 @@ const DropdownMenuTrigger = ({ children, asChild = false, hapticFeedback = true
|
|
|
9008
9174
|
}
|
|
9009
9175
|
});
|
|
9010
9176
|
}
|
|
9011
|
-
return /* @__PURE__ */ jsx(
|
|
9177
|
+
return /* @__PURE__ */ jsx(AnimatedPressable, {
|
|
9012
9178
|
ref: anchorRef,
|
|
9013
9179
|
onPress: handlePress,
|
|
9014
9180
|
pressedScale: .98,
|
|
@@ -9018,18 +9184,6 @@ const DropdownMenuTrigger = ({ children, asChild = false, hapticFeedback = true
|
|
|
9018
9184
|
children
|
|
9019
9185
|
});
|
|
9020
9186
|
};
|
|
9021
|
-
/**
|
|
9022
|
-
* Default down chevron icon for dropdown menu trigger
|
|
9023
|
-
* Uses Unicode character for React Native compatibility
|
|
9024
|
-
*/
|
|
9025
|
-
const ChevronDownIcon = ({ size, color }) => /* @__PURE__ */ jsx(TextComponent, {
|
|
9026
|
-
style: {
|
|
9027
|
-
fontSize: size || 16,
|
|
9028
|
-
color: color || "currentColor",
|
|
9029
|
-
lineHeight: size ? size + 2 : 18
|
|
9030
|
-
},
|
|
9031
|
-
children: "▾"
|
|
9032
|
-
});
|
|
9033
9187
|
const DropdownMenuTriggerIcon = ({ icon, variant = "ghost", color, size = 2, disabled, accessibilityLabel = "Open menu", highContrast, style }) => {
|
|
9034
9188
|
const { onOpenChange, open, anchorRef, measureAnchor } = useDropdownMenu();
|
|
9035
9189
|
const handlePress = () => {
|
|
@@ -9065,7 +9219,7 @@ const DropdownMenuOverlay = ({ style }) => {
|
|
|
9065
9219
|
const { onOpenChange } = useDropdownMenu();
|
|
9066
9220
|
return /* @__PURE__ */ jsx(TouchableWithoutFeedback, {
|
|
9067
9221
|
onPress: () => onOpenChange(false),
|
|
9068
|
-
children: /* @__PURE__ */ jsx(View, { style: [styles$
|
|
9222
|
+
children: /* @__PURE__ */ jsx(View, { style: [styles$17.overlay, style] })
|
|
9069
9223
|
});
|
|
9070
9224
|
};
|
|
9071
9225
|
const DropdownMenuContent = ({ children, side = "bottom", sideOffset = 4, align = "start", alignOffset = 0, avoidCollisions = true, size = 2, style }) => {
|
|
@@ -9149,7 +9303,7 @@ const DropdownMenuContent = ({ children, side = "bottom", sideOffset = 4, align
|
|
|
9149
9303
|
ref: contentRef,
|
|
9150
9304
|
onLayout: handleLayout,
|
|
9151
9305
|
style: [
|
|
9152
|
-
styles$
|
|
9306
|
+
styles$17.content,
|
|
9153
9307
|
{
|
|
9154
9308
|
backgroundColor: colors[1],
|
|
9155
9309
|
borderRadius: radii.medium,
|
|
@@ -9180,6 +9334,7 @@ const DropdownMenuGroup = ({ children }) => {
|
|
|
9180
9334
|
};
|
|
9181
9335
|
const DropdownMenuItem = ({ children, color, onSelect, disabled = false, shortcut, style, hapticFeedback = true }) => {
|
|
9182
9336
|
const { colors, onOpenChange, size } = useDropdownMenu();
|
|
9337
|
+
const globalHaptics = useHaptics$1();
|
|
9183
9338
|
const theme = useTheme$1();
|
|
9184
9339
|
const mode = useThemeMode$1();
|
|
9185
9340
|
const activeColor = color || theme.accentColor;
|
|
@@ -9224,17 +9379,17 @@ const DropdownMenuItem = ({ children, color, onSelect, disabled = false, shortcu
|
|
|
9224
9379
|
if (!disabled) {
|
|
9225
9380
|
onSelect?.();
|
|
9226
9381
|
onOpenChange(false);
|
|
9227
|
-
if (hapticFeedback)
|
|
9382
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("press");
|
|
9228
9383
|
}
|
|
9229
9384
|
};
|
|
9230
9385
|
const itemPadding = getItemPadding();
|
|
9231
9386
|
const fontSize = getFontSize();
|
|
9232
|
-
return /* @__PURE__ */ jsxs(
|
|
9387
|
+
return /* @__PURE__ */ jsxs(AnimatedPressable, {
|
|
9233
9388
|
onPress: handlePress,
|
|
9234
9389
|
disabled,
|
|
9235
9390
|
style: [
|
|
9236
|
-
styles$
|
|
9237
|
-
disabled && styles$
|
|
9391
|
+
styles$17.item,
|
|
9392
|
+
disabled && styles$17.itemDisabled,
|
|
9238
9393
|
{ backgroundColor: disabled ? "transparent" : "transparent" },
|
|
9239
9394
|
itemPadding,
|
|
9240
9395
|
style
|
|
@@ -9264,7 +9419,7 @@ const DropdownMenuItem = ({ children, color, onSelect, disabled = false, shortcu
|
|
|
9264
9419
|
const DropdownMenuSeparator = ({ style }) => {
|
|
9265
9420
|
const { colors } = useDropdownMenu();
|
|
9266
9421
|
return /* @__PURE__ */ jsx(View, { style: [
|
|
9267
|
-
styles$
|
|
9422
|
+
styles$17.separator,
|
|
9268
9423
|
{ backgroundColor: colors[6] },
|
|
9269
9424
|
style
|
|
9270
9425
|
] });
|
|
@@ -9337,7 +9492,7 @@ const DropdownMenuCheckboxItem = ({ children, checked, onCheckedChange, disabled
|
|
|
9337
9492
|
alignItems: "center"
|
|
9338
9493
|
},
|
|
9339
9494
|
children: [/* @__PURE__ */ jsx(View, {
|
|
9340
|
-
style: [styles$
|
|
9495
|
+
style: [styles$17.checkbox, {
|
|
9341
9496
|
width: checkboxSize,
|
|
9342
9497
|
height: checkboxSize,
|
|
9343
9498
|
borderColor: colors[9],
|
|
@@ -9364,6 +9519,7 @@ const DropdownMenuCheckboxItem = ({ children, checked, onCheckedChange, disabled
|
|
|
9364
9519
|
};
|
|
9365
9520
|
const DropdownMenuRadioItem = ({ children, value, checked, onCheckedChange, disabled = false, hapticFeedback = true }) => {
|
|
9366
9521
|
const { colors, size } = useDropdownMenu();
|
|
9522
|
+
const globalHaptics = useHaptics$1();
|
|
9367
9523
|
const theme = useTheme$1();
|
|
9368
9524
|
const getFontSize = useCallback(() => {
|
|
9369
9525
|
switch (size) {
|
|
@@ -9384,7 +9540,7 @@ const DropdownMenuRadioItem = ({ children, value, checked, onCheckedChange, disa
|
|
|
9384
9540
|
const handlePress = () => {
|
|
9385
9541
|
if (!disabled) {
|
|
9386
9542
|
onCheckedChange(value);
|
|
9387
|
-
if (hapticFeedback)
|
|
9543
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("press");
|
|
9388
9544
|
}
|
|
9389
9545
|
};
|
|
9390
9546
|
const itemPadding = useCallback(() => {
|
|
@@ -9403,12 +9559,12 @@ const DropdownMenuRadioItem = ({ children, value, checked, onCheckedChange, disa
|
|
|
9403
9559
|
};
|
|
9404
9560
|
}
|
|
9405
9561
|
}, [size, theme.space])();
|
|
9406
|
-
return /* @__PURE__ */ jsx(
|
|
9562
|
+
return /* @__PURE__ */ jsx(AnimatedPressable, {
|
|
9407
9563
|
onPress: handlePress,
|
|
9408
9564
|
disabled,
|
|
9409
9565
|
style: [
|
|
9410
|
-
styles$
|
|
9411
|
-
disabled && styles$
|
|
9566
|
+
styles$17.item,
|
|
9567
|
+
disabled && styles$17.itemDisabled,
|
|
9412
9568
|
itemPadding
|
|
9413
9569
|
],
|
|
9414
9570
|
accessibilityRole: "menuitem",
|
|
@@ -9427,7 +9583,7 @@ const DropdownMenuRadioItem = ({ children, value, checked, onCheckedChange, disa
|
|
|
9427
9583
|
flex: 1
|
|
9428
9584
|
},
|
|
9429
9585
|
children: [/* @__PURE__ */ jsx(View, {
|
|
9430
|
-
style: [styles$
|
|
9586
|
+
style: [styles$17.radio, {
|
|
9431
9587
|
width: radioSize,
|
|
9432
9588
|
height: radioSize,
|
|
9433
9589
|
borderRadius: radioSize / 2,
|
|
@@ -9456,6 +9612,7 @@ const DropdownMenuSub = ({ children }) => {
|
|
|
9456
9612
|
};
|
|
9457
9613
|
const DropdownMenuSubTrigger = ({ children, hapticFeedback = true }) => {
|
|
9458
9614
|
const { colors, openSubmenu, onOpenSubmenu, size } = useDropdownMenu();
|
|
9615
|
+
const globalHaptics = useHaptics$1();
|
|
9459
9616
|
const theme = useTheme$1();
|
|
9460
9617
|
const submenuId = "submenu";
|
|
9461
9618
|
const getFontSize = useCallback(() => {
|
|
@@ -9483,13 +9640,13 @@ const DropdownMenuSubTrigger = ({ children, hapticFeedback = true }) => {
|
|
|
9483
9640
|
}, [size, theme.space]);
|
|
9484
9641
|
const handlePress = () => {
|
|
9485
9642
|
onOpenSubmenu(openSubmenu === submenuId ? null : submenuId);
|
|
9486
|
-
if (hapticFeedback)
|
|
9643
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("press");
|
|
9487
9644
|
};
|
|
9488
9645
|
const itemPadding = getItemPadding();
|
|
9489
9646
|
const fontSize = getFontSize();
|
|
9490
|
-
return /* @__PURE__ */ jsxs(
|
|
9647
|
+
return /* @__PURE__ */ jsxs(AnimatedPressable, {
|
|
9491
9648
|
onPress: handlePress,
|
|
9492
|
-
style: [styles$
|
|
9649
|
+
style: [styles$17.item, itemPadding],
|
|
9493
9650
|
pressedScale: .98,
|
|
9494
9651
|
pressedOpacity: .95,
|
|
9495
9652
|
animationDuration: 100,
|
|
@@ -9530,7 +9687,7 @@ const DropdownMenuSubContent = ({ children }) => {
|
|
|
9530
9687
|
}
|
|
9531
9688
|
}, [size, theme.space])();
|
|
9532
9689
|
return /* @__PURE__ */ jsx(View, {
|
|
9533
|
-
style: [styles$
|
|
9690
|
+
style: [styles$17.content, {
|
|
9534
9691
|
backgroundColor: colors[1],
|
|
9535
9692
|
borderRadius: radii.medium,
|
|
9536
9693
|
borderWidth: 1,
|
|
@@ -9545,7 +9702,7 @@ const DropdownMenuSubContent = ({ children }) => {
|
|
|
9545
9702
|
children
|
|
9546
9703
|
});
|
|
9547
9704
|
};
|
|
9548
|
-
const styles$
|
|
9705
|
+
const styles$17 = StyleSheet.create({
|
|
9549
9706
|
overlay: {
|
|
9550
9707
|
flex: 1,
|
|
9551
9708
|
backgroundColor: "rgba(0, 0, 0, 0.01)"
|
|
@@ -9639,6 +9796,7 @@ const ContextMenuRoot = ({ children, open: controlledOpen, onOpenChange, default
|
|
|
9639
9796
|
};
|
|
9640
9797
|
const ContextMenuTrigger = ({ children, onLongPress, asChild = false, hapticFeedback = true }) => {
|
|
9641
9798
|
const { setPosition, onOpenChange } = useContextMenuContext();
|
|
9799
|
+
const globalHaptics = useHaptics$1();
|
|
9642
9800
|
const handleLongPress = (event) => {
|
|
9643
9801
|
const { pageX, pageY } = event.nativeEvent;
|
|
9644
9802
|
setPosition({
|
|
@@ -9647,7 +9805,7 @@ const ContextMenuTrigger = ({ children, onLongPress, asChild = false, hapticFeed
|
|
|
9647
9805
|
});
|
|
9648
9806
|
onOpenChange(true);
|
|
9649
9807
|
onLongPress?.(event);
|
|
9650
|
-
if (hapticFeedback)
|
|
9808
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("press");
|
|
9651
9809
|
};
|
|
9652
9810
|
if (asChild && React.isValidElement(children)) {
|
|
9653
9811
|
const child = children;
|
|
@@ -9656,7 +9814,7 @@ const ContextMenuTrigger = ({ children, onLongPress, asChild = false, hapticFeed
|
|
|
9656
9814
|
handleLongPress(e);
|
|
9657
9815
|
} });
|
|
9658
9816
|
}
|
|
9659
|
-
return /* @__PURE__ */ jsx(
|
|
9817
|
+
return /* @__PURE__ */ jsx(AnimatedPressable, {
|
|
9660
9818
|
onLongPress: handleLongPress,
|
|
9661
9819
|
pressedScale: .98,
|
|
9662
9820
|
pressedOpacity: .95,
|
|
@@ -9681,7 +9839,7 @@ const ContextMenuOverlay = ({ style }) => {
|
|
|
9681
9839
|
const { onOpenChange } = useContextMenuContext();
|
|
9682
9840
|
return /* @__PURE__ */ jsx(TouchableWithoutFeedback, {
|
|
9683
9841
|
onPress: () => onOpenChange(false),
|
|
9684
|
-
children: /* @__PURE__ */ jsx(View, { style: [styles$
|
|
9842
|
+
children: /* @__PURE__ */ jsx(View, { style: [styles$16.overlay, style] })
|
|
9685
9843
|
});
|
|
9686
9844
|
};
|
|
9687
9845
|
/**
|
|
@@ -9718,6 +9876,7 @@ const getSizeStyles$2 = (size, theme) => {
|
|
|
9718
9876
|
const ContextMenuContent = ({ children, side = "bottom", sideOffset = 4, align = "start", alignOffset = 0, avoidCollisions = true, size = 2, style }) => {
|
|
9719
9877
|
const { colors, radii, position } = useContextMenuContext();
|
|
9720
9878
|
const theme = useTheme$1();
|
|
9879
|
+
const mode = useThemeMode$1();
|
|
9721
9880
|
const contentRef = useRef(null);
|
|
9722
9881
|
const [contentSize, setContentSize] = useState({
|
|
9723
9882
|
width: 0,
|
|
@@ -9763,12 +9922,11 @@ const ContextMenuContent = ({ children, side = "bottom", sideOffset = 4, align =
|
|
|
9763
9922
|
ref: contentRef,
|
|
9764
9923
|
onLayout: handleLayout,
|
|
9765
9924
|
style: [
|
|
9766
|
-
styles$
|
|
9925
|
+
styles$16.content,
|
|
9767
9926
|
{
|
|
9768
|
-
backgroundColor: colors[1],
|
|
9769
|
-
borderRadius: radii.medium,
|
|
9770
|
-
|
|
9771
|
-
borderColor: colors[6],
|
|
9927
|
+
backgroundColor: mode === "dark" ? colors[3] : colors[1],
|
|
9928
|
+
borderRadius: theme.radii[theme.radius] || radii.medium,
|
|
9929
|
+
borderColor: colors[2],
|
|
9772
9930
|
paddingVertical: sizeStyles.paddingVertical,
|
|
9773
9931
|
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
9774
9932
|
minWidth: sizeStyles.minWidth,
|
|
@@ -9798,11 +9956,12 @@ const ContextMenuGroup = ({ children }) => {
|
|
|
9798
9956
|
const ContextMenuItem = ({ children, color, onSelect, disabled = false, destructive = false, icon, shortcut, style, hapticFeedback = true }) => {
|
|
9799
9957
|
const { colors, onOpenChange, size } = useContextMenuContext();
|
|
9800
9958
|
const theme = useTheme$1();
|
|
9959
|
+
const globalHaptics = useHaptics$1();
|
|
9801
9960
|
const handlePress = () => {
|
|
9802
9961
|
if (!disabled) {
|
|
9803
9962
|
onSelect?.();
|
|
9804
9963
|
onOpenChange(false);
|
|
9805
|
-
if (hapticFeedback)
|
|
9964
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("press");
|
|
9806
9965
|
}
|
|
9807
9966
|
};
|
|
9808
9967
|
const getFontSize = useCallback(() => {
|
|
@@ -9837,12 +9996,12 @@ const ContextMenuItem = ({ children, color, onSelect, disabled = false, destruct
|
|
|
9837
9996
|
const itemPadding = getItemPadding();
|
|
9838
9997
|
const destructiveColor = theme.colors.red[11];
|
|
9839
9998
|
const textColor = disabled ? colors[8] : destructive ? destructiveColor : colors[12];
|
|
9840
|
-
return /* @__PURE__ */ jsxs(
|
|
9999
|
+
return /* @__PURE__ */ jsxs(AnimatedPressable, {
|
|
9841
10000
|
onPress: handlePress,
|
|
9842
10001
|
disabled,
|
|
9843
10002
|
style: [
|
|
9844
|
-
styles$
|
|
9845
|
-
disabled && styles$
|
|
10003
|
+
styles$16.item,
|
|
10004
|
+
disabled && styles$16.itemDisabled,
|
|
9846
10005
|
itemPadding,
|
|
9847
10006
|
style
|
|
9848
10007
|
],
|
|
@@ -9878,7 +10037,7 @@ const ContextMenuItem = ({ children, color, onSelect, disabled = false, destruct
|
|
|
9878
10037
|
const ContextMenuSeparator = ({ style }) => {
|
|
9879
10038
|
const { colors } = useContextMenuContext();
|
|
9880
10039
|
return /* @__PURE__ */ jsx(View, { style: [
|
|
9881
|
-
styles$
|
|
10040
|
+
styles$16.separator,
|
|
9882
10041
|
{ backgroundColor: colors[6] },
|
|
9883
10042
|
style
|
|
9884
10043
|
] });
|
|
@@ -9952,7 +10111,7 @@ const ContextMenuCheckboxItem = ({ children, checked, onCheckedChange, disabled
|
|
|
9952
10111
|
flex: 1
|
|
9953
10112
|
},
|
|
9954
10113
|
children: [/* @__PURE__ */ jsx(View, {
|
|
9955
|
-
style: [styles$
|
|
10114
|
+
style: [styles$16.checkbox, {
|
|
9956
10115
|
width: checkboxSize,
|
|
9957
10116
|
height: checkboxSize,
|
|
9958
10117
|
borderColor: colors[9],
|
|
@@ -9977,9 +10136,10 @@ const ContextMenuCheckboxItem = ({ children, checked, onCheckedChange, disabled
|
|
|
9977
10136
|
})
|
|
9978
10137
|
});
|
|
9979
10138
|
};
|
|
9980
|
-
const ContextMenuRadioItem = ({ children, value, checked, onCheckedChange, disabled = false }) => {
|
|
10139
|
+
const ContextMenuRadioItem = ({ children, value, checked, onCheckedChange, disabled = false, hapticFeedback = true }) => {
|
|
9981
10140
|
const { colors, size } = useContextMenuContext();
|
|
9982
10141
|
const theme = useTheme$1();
|
|
10142
|
+
const globalHaptics = useHaptics$1();
|
|
9983
10143
|
const getFontSize = useCallback(() => {
|
|
9984
10144
|
switch (size) {
|
|
9985
10145
|
case 1: return theme.typography.fontSizes[1].fontSize;
|
|
@@ -9999,7 +10159,7 @@ const ContextMenuRadioItem = ({ children, value, checked, onCheckedChange, disab
|
|
|
9999
10159
|
const handlePress = () => {
|
|
10000
10160
|
if (!disabled) {
|
|
10001
10161
|
onCheckedChange(value);
|
|
10002
|
-
|
|
10162
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("press");
|
|
10003
10163
|
}
|
|
10004
10164
|
};
|
|
10005
10165
|
const itemPadding = useCallback(() => {
|
|
@@ -10018,12 +10178,12 @@ const ContextMenuRadioItem = ({ children, value, checked, onCheckedChange, disab
|
|
|
10018
10178
|
};
|
|
10019
10179
|
}
|
|
10020
10180
|
}, [size, theme.space])();
|
|
10021
|
-
return /* @__PURE__ */ jsx(
|
|
10181
|
+
return /* @__PURE__ */ jsx(AnimatedPressable, {
|
|
10022
10182
|
onPress: handlePress,
|
|
10023
10183
|
disabled,
|
|
10024
10184
|
style: [
|
|
10025
|
-
styles$
|
|
10026
|
-
disabled && styles$
|
|
10185
|
+
styles$16.item,
|
|
10186
|
+
disabled && styles$16.itemDisabled,
|
|
10027
10187
|
itemPadding
|
|
10028
10188
|
],
|
|
10029
10189
|
accessibilityRole: "menuitem",
|
|
@@ -10042,7 +10202,7 @@ const ContextMenuRadioItem = ({ children, value, checked, onCheckedChange, disab
|
|
|
10042
10202
|
flex: 1
|
|
10043
10203
|
},
|
|
10044
10204
|
children: [/* @__PURE__ */ jsx(View, {
|
|
10045
|
-
style: [styles$
|
|
10205
|
+
style: [styles$16.radio, {
|
|
10046
10206
|
width: radioSize,
|
|
10047
10207
|
height: radioSize,
|
|
10048
10208
|
borderRadius: radioSize / 2,
|
|
@@ -10066,7 +10226,7 @@ const ContextMenuRadioItem = ({ children, value, checked, onCheckedChange, disab
|
|
|
10066
10226
|
})
|
|
10067
10227
|
});
|
|
10068
10228
|
};
|
|
10069
|
-
const styles$
|
|
10229
|
+
const styles$16 = StyleSheet.create({
|
|
10070
10230
|
overlay: {
|
|
10071
10231
|
flex: 1,
|
|
10072
10232
|
backgroundColor: "rgba(0, 0, 0, 0.01)"
|
|
@@ -10231,7 +10391,7 @@ const BottomSheetRoot = ({ children, open: controlledOpen, onOpenChange, snapPoi
|
|
|
10231
10391
|
},
|
|
10232
10392
|
onPanResponderRelease: (_, gestureState) => {
|
|
10233
10393
|
if (gestureState.dy > 100 || gestureState.vy > 500 / 1e3) {
|
|
10234
|
-
|
|
10394
|
+
if (globalHaptics) triggerHaptic("selection");
|
|
10235
10395
|
Animated.timing(translateY, {
|
|
10236
10396
|
toValue: targetSnapHeight,
|
|
10237
10397
|
duration: 200,
|
|
@@ -10263,7 +10423,9 @@ const BottomSheetRoot = ({ children, open: controlledOpen, onOpenChange, snapPoi
|
|
|
10263
10423
|
}
|
|
10264
10424
|
}, [open]);
|
|
10265
10425
|
const theme = useTheme$1();
|
|
10266
|
-
const
|
|
10426
|
+
const mode = useThemeMode$1();
|
|
10427
|
+
const globalHaptics = useHaptics$1();
|
|
10428
|
+
const colors = mode === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
10267
10429
|
const grayAlpha = getGrayAlpha(theme);
|
|
10268
10430
|
const radii = theme.radii;
|
|
10269
10431
|
return /* @__PURE__ */ jsx(BottomSheetContext.Provider, {
|
|
@@ -10287,15 +10449,16 @@ const BottomSheetRoot = ({ children, open: controlledOpen, onOpenChange, snapPoi
|
|
|
10287
10449
|
};
|
|
10288
10450
|
const BottomSheetTrigger = ({ children, asChild = true, hapticFeedback = false }) => {
|
|
10289
10451
|
const { onOpenChange, open } = useBottomSheet();
|
|
10452
|
+
const globalHaptics = useHaptics$1();
|
|
10290
10453
|
const handlePress = () => {
|
|
10291
10454
|
onOpenChange(true);
|
|
10292
|
-
if (hapticFeedback)
|
|
10455
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("press");
|
|
10293
10456
|
};
|
|
10294
10457
|
if (asChild && React.isValidElement(children)) return React.cloneElement(children, { onPress: (e) => {
|
|
10295
10458
|
children.props?.onPress?.(e);
|
|
10296
10459
|
handlePress();
|
|
10297
10460
|
} });
|
|
10298
|
-
return /* @__PURE__ */ jsx(
|
|
10461
|
+
return /* @__PURE__ */ jsx(AnimatedPressable, {
|
|
10299
10462
|
onPress: handlePress,
|
|
10300
10463
|
pressedScale: .98,
|
|
10301
10464
|
pressedOpacity: .95,
|
|
@@ -10317,15 +10480,17 @@ const BottomSheetPortal = ({ children, hostId }) => {
|
|
|
10317
10480
|
};
|
|
10318
10481
|
const BottomSheetOverlay = ({ style, hapticFeedback = true }) => {
|
|
10319
10482
|
const { onOpenChange } = useBottomSheet();
|
|
10320
|
-
const
|
|
10483
|
+
const mode = useThemeMode$1();
|
|
10484
|
+
const globalHaptics = useHaptics$1();
|
|
10485
|
+
const overlayColor = mode === "dark" ? "rgba(0, 0, 0, 0.6)" : "rgba(10, 10, 10, 0.6)";
|
|
10321
10486
|
const handlePress = () => {
|
|
10322
10487
|
onOpenChange(false);
|
|
10323
|
-
if (hapticFeedback)
|
|
10488
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("selection");
|
|
10324
10489
|
};
|
|
10325
10490
|
return /* @__PURE__ */ jsx(TouchableWithoutFeedback, {
|
|
10326
10491
|
onPress: handlePress,
|
|
10327
10492
|
children: /* @__PURE__ */ jsx(View, { style: [
|
|
10328
|
-
styles$
|
|
10493
|
+
styles$15.overlay,
|
|
10329
10494
|
{ backgroundColor: overlayColor },
|
|
10330
10495
|
style
|
|
10331
10496
|
] })
|
|
@@ -10336,10 +10501,10 @@ const BottomSheetHandle = ({ style }) => {
|
|
|
10336
10501
|
const theme = useTheme$1();
|
|
10337
10502
|
const handleColor = useThemeMode$1() === "dark" ? theme.colors.gray.dark[8] : theme.colors.gray[8];
|
|
10338
10503
|
return /* @__PURE__ */ jsx(Pressable, {
|
|
10339
|
-
style: styles$
|
|
10504
|
+
style: styles$15.handleContainer,
|
|
10340
10505
|
...panHandlers,
|
|
10341
10506
|
children: /* @__PURE__ */ jsx(View, { style: [
|
|
10342
|
-
styles$
|
|
10507
|
+
styles$15.handle,
|
|
10343
10508
|
{ backgroundColor: handleColor },
|
|
10344
10509
|
style
|
|
10345
10510
|
] })
|
|
@@ -10349,7 +10514,9 @@ const BottomSheetContent = ({ children, style, snapPoints: localSnapPoints, size
|
|
|
10349
10514
|
const { radii, snapPoints: contextSnapPoints, currentSnapIndex, translateY, snapHeights, panHandlers } = useBottomSheet();
|
|
10350
10515
|
const theme = useTheme$1();
|
|
10351
10516
|
const isDark = useThemeMode$1() === "dark";
|
|
10517
|
+
const effectiveSnapPoints = localSnapPoints || contextSnapPoints;
|
|
10352
10518
|
const targetSnapHeight = snapHeights[currentSnapIndex] || snapHeights[0];
|
|
10519
|
+
const maxTargetSnapHeight = snapHeights[effectiveSnapPoints.length - 1] || snapHeights[0];
|
|
10353
10520
|
const sizeStyles = getSizeStyles$1(size, theme.space, radii);
|
|
10354
10521
|
const shadow = getShadow(6, isDark);
|
|
10355
10522
|
const backgroundColor = isDark ? theme.colors.gray.dark[2] : "#ffffff";
|
|
@@ -10357,27 +10524,22 @@ const BottomSheetContent = ({ children, style, snapPoints: localSnapPoints, size
|
|
|
10357
10524
|
const borderTopRightRadius = radii.large;
|
|
10358
10525
|
return /* @__PURE__ */ jsxs(Animated.View, {
|
|
10359
10526
|
style: [
|
|
10360
|
-
styles$
|
|
10527
|
+
styles$15.content,
|
|
10361
10528
|
{
|
|
10362
10529
|
backgroundColor,
|
|
10363
10530
|
borderTopLeftRadius,
|
|
10364
10531
|
borderTopRightRadius,
|
|
10365
10532
|
flex: 1,
|
|
10366
10533
|
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
10367
|
-
|
|
10534
|
+
minHeight: targetSnapHeight,
|
|
10535
|
+
maxHeight: maxTargetSnapHeight,
|
|
10368
10536
|
transform: [{ translateY }],
|
|
10369
10537
|
...shadow || {}
|
|
10370
10538
|
},
|
|
10371
10539
|
style
|
|
10372
10540
|
],
|
|
10373
10541
|
...panHandlers,
|
|
10374
|
-
children: [!hideHandle && /* @__PURE__ */ jsx(BottomSheetHandle, {}),
|
|
10375
|
-
style: styles$13.scrollContent,
|
|
10376
|
-
contentContainerStyle: styles$13.scrollContentContainer,
|
|
10377
|
-
showsVerticalScrollIndicator: true,
|
|
10378
|
-
bounces: true,
|
|
10379
|
-
children
|
|
10380
|
-
})]
|
|
10542
|
+
children: [!hideHandle && /* @__PURE__ */ jsx(BottomSheetHandle, {}), children]
|
|
10381
10543
|
});
|
|
10382
10544
|
};
|
|
10383
10545
|
const BottomSheetTitle = ({ children, style = {}, size = 4, weight = "bold", align, color, truncate, numberOfLines, fontFamily, opacity, asChild = false, ...rest }) => {
|
|
@@ -10427,7 +10589,7 @@ const BottomSheetFooter = ({ children, style, withBorder = true, withPadding = t
|
|
|
10427
10589
|
const borderColor = useThemeMode$1() === "dark" ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.1)";
|
|
10428
10590
|
return /* @__PURE__ */ jsx(View, {
|
|
10429
10591
|
style: [
|
|
10430
|
-
styles$
|
|
10592
|
+
styles$15.footer,
|
|
10431
10593
|
withBorder && {
|
|
10432
10594
|
borderTopWidth: 1,
|
|
10433
10595
|
borderTopColor: borderColor
|
|
@@ -10439,16 +10601,17 @@ const BottomSheetFooter = ({ children, style, withBorder = true, withPadding = t
|
|
|
10439
10601
|
style
|
|
10440
10602
|
],
|
|
10441
10603
|
children: /* @__PURE__ */ jsx(View, {
|
|
10442
|
-
style: styles$
|
|
10604
|
+
style: styles$15.footerContent,
|
|
10443
10605
|
children
|
|
10444
10606
|
})
|
|
10445
10607
|
});
|
|
10446
10608
|
};
|
|
10447
10609
|
const BottomSheetClose = ({ children, asChild = true, hapticFeedback = false, ...buttonProps }) => {
|
|
10448
10610
|
const { onOpenChange } = useBottomSheet();
|
|
10611
|
+
const globalHaptics = useHaptics$1();
|
|
10449
10612
|
const handlePress = () => {
|
|
10450
10613
|
onOpenChange(false);
|
|
10451
|
-
if (hapticFeedback)
|
|
10614
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("selection");
|
|
10452
10615
|
};
|
|
10453
10616
|
if (asChild && children && React.isValidElement(children)) return React.cloneElement(children, { onPress: (e) => {
|
|
10454
10617
|
children.props?.onPress?.(e);
|
|
@@ -10463,10 +10626,11 @@ const BottomSheetClose = ({ children, asChild = true, hapticFeedback = false, ..
|
|
|
10463
10626
|
};
|
|
10464
10627
|
const BottomSheetAction = ({ children, onPress, hapticFeedback = true, ...buttonProps }) => {
|
|
10465
10628
|
const { onOpenChange } = useBottomSheet();
|
|
10629
|
+
const globalHaptics = useHaptics$1();
|
|
10466
10630
|
const handlePress = () => {
|
|
10467
10631
|
onPress?.();
|
|
10468
10632
|
onOpenChange(false);
|
|
10469
|
-
if (hapticFeedback)
|
|
10633
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("selection");
|
|
10470
10634
|
};
|
|
10471
10635
|
return /* @__PURE__ */ jsx(Button, {
|
|
10472
10636
|
...buttonProps,
|
|
@@ -10474,7 +10638,7 @@ const BottomSheetAction = ({ children, onPress, hapticFeedback = true, ...button
|
|
|
10474
10638
|
children
|
|
10475
10639
|
});
|
|
10476
10640
|
};
|
|
10477
|
-
const styles$
|
|
10641
|
+
const styles$15 = StyleSheet.create({
|
|
10478
10642
|
overlay: {
|
|
10479
10643
|
flex: 1,
|
|
10480
10644
|
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
@@ -10484,7 +10648,8 @@ const styles$13 = StyleSheet.create({
|
|
|
10484
10648
|
left: 0,
|
|
10485
10649
|
right: 0,
|
|
10486
10650
|
bottom: 0,
|
|
10487
|
-
elevation: 4
|
|
10651
|
+
elevation: 4,
|
|
10652
|
+
paddingBottom: 16
|
|
10488
10653
|
},
|
|
10489
10654
|
handleContainer: {
|
|
10490
10655
|
alignItems: "center",
|
|
@@ -10503,8 +10668,7 @@ const styles$13 = StyleSheet.create({
|
|
|
10503
10668
|
footer: {
|
|
10504
10669
|
flexDirection: "row",
|
|
10505
10670
|
justifyContent: "flex-end",
|
|
10506
|
-
alignItems: "center"
|
|
10507
|
-
marginTop: 8
|
|
10671
|
+
alignItems: "center"
|
|
10508
10672
|
},
|
|
10509
10673
|
footerContent: {
|
|
10510
10674
|
flexDirection: "row",
|
|
@@ -10526,51 +10690,619 @@ const BottomSheet = {
|
|
|
10526
10690
|
};
|
|
10527
10691
|
|
|
10528
10692
|
//#endregion
|
|
10529
|
-
//#region src/components/
|
|
10530
|
-
const
|
|
10531
|
-
|
|
10532
|
-
const
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
const
|
|
10539
|
-
const
|
|
10540
|
-
const
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
}
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
|
|
10570
|
-
|
|
10571
|
-
|
|
10572
|
-
|
|
10573
|
-
|
|
10693
|
+
//#region src/components/overlays/Sidebar.tsx
|
|
10694
|
+
const SidebarContext = createContext(null);
|
|
10695
|
+
const useSidebar = () => {
|
|
10696
|
+
const context = useContext(SidebarContext);
|
|
10697
|
+
if (!context) throw new Error("Sidebar components must be used within a Sidebar.Root");
|
|
10698
|
+
return context;
|
|
10699
|
+
};
|
|
10700
|
+
const { width: SCREEN_WIDTH } = Dimensions.get("window");
|
|
10701
|
+
const SidebarRoot = ({ children, open: controlledOpen, onOpenChange, side = "left", variant = "overlay", width = 280, animationDuration = 300 }) => {
|
|
10702
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
10703
|
+
const open = controlledOpen !== void 0 ? controlledOpen : internalOpen;
|
|
10704
|
+
const initialTranslateX = side === "left" ? -width : width;
|
|
10705
|
+
const translateX = useRef(new Animated.Value(open ? 0 : initialTranslateX)).current;
|
|
10706
|
+
const mainTranslateX = useRef(new Animated.Value(0)).current;
|
|
10707
|
+
const skipAnimationRef = useRef(false);
|
|
10708
|
+
const swipeDistance = useRef(0);
|
|
10709
|
+
const isSwiping = useRef(false);
|
|
10710
|
+
const startX = useRef(0);
|
|
10711
|
+
const handleOpenChange = useCallback((newOpen, skipAnimation = false) => {
|
|
10712
|
+
skipAnimationRef.current = skipAnimation;
|
|
10713
|
+
if (controlledOpen === void 0) setInternalOpen(newOpen);
|
|
10714
|
+
onOpenChange?.(newOpen);
|
|
10715
|
+
}, [controlledOpen, onOpenChange]);
|
|
10716
|
+
const panResponder = useMemo(() => {
|
|
10717
|
+
return PanResponder.create({
|
|
10718
|
+
onStartShouldSetPanResponder: () => false,
|
|
10719
|
+
onMoveShouldSetPanResponder: (_, gestureState) => {
|
|
10720
|
+
return Math.abs(gestureState.dx) > 10 && Math.abs(gestureState.dx) > Math.abs(gestureState.dy);
|
|
10721
|
+
},
|
|
10722
|
+
onPanResponderGrant: () => {
|
|
10723
|
+
startX.current = 0;
|
|
10724
|
+
isSwiping.current = true;
|
|
10725
|
+
},
|
|
10726
|
+
onPanResponderMove: (_, gestureState) => {
|
|
10727
|
+
isSwiping.current = true;
|
|
10728
|
+
swipeDistance.current = gestureState.dx;
|
|
10729
|
+
if (side === "left") {
|
|
10730
|
+
const newTranslateX = initialTranslateX + gestureState.dx;
|
|
10731
|
+
const clampedValue = Math.max(-width, Math.min(0, newTranslateX));
|
|
10732
|
+
translateX.setValue(clampedValue);
|
|
10733
|
+
} else {
|
|
10734
|
+
const newTranslateX = initialTranslateX + gestureState.dx;
|
|
10735
|
+
const clampedValue = Math.max(0, Math.min(width, newTranslateX));
|
|
10736
|
+
translateX.setValue(clampedValue);
|
|
10737
|
+
}
|
|
10738
|
+
},
|
|
10739
|
+
onPanResponderRelease: (_, gestureState) => {
|
|
10740
|
+
const threshold = width * .25;
|
|
10741
|
+
const velocityThreshold = 500;
|
|
10742
|
+
if (side === "left") if (gestureState.dx > threshold || gestureState.vx > velocityThreshold / 1e3) Animated.timing(translateX, {
|
|
10743
|
+
toValue: 0,
|
|
10744
|
+
duration: animationDuration,
|
|
10745
|
+
useNativeDriver: true
|
|
10746
|
+
}).start();
|
|
10747
|
+
else if (gestureState.dx < -threshold || gestureState.vx < -velocityThreshold / 1e3) {
|
|
10748
|
+
if (globalHaptics) triggerHaptic("selection");
|
|
10749
|
+
Animated.timing(translateX, {
|
|
10750
|
+
toValue: -width,
|
|
10751
|
+
duration: animationDuration,
|
|
10752
|
+
useNativeDriver: true
|
|
10753
|
+
}).start();
|
|
10754
|
+
} else Animated.spring(translateX, {
|
|
10755
|
+
toValue: open ? 0 : -width,
|
|
10756
|
+
tension: 65,
|
|
10757
|
+
friction: 11,
|
|
10758
|
+
useNativeDriver: true
|
|
10759
|
+
}).start();
|
|
10760
|
+
else if (gestureState.dx < -threshold || gestureState.vx < -velocityThreshold / 1e3) Animated.timing(translateX, {
|
|
10761
|
+
toValue: 0,
|
|
10762
|
+
duration: animationDuration,
|
|
10763
|
+
useNativeDriver: true
|
|
10764
|
+
}).start();
|
|
10765
|
+
else if (gestureState.dx > threshold || gestureState.vx > velocityThreshold / 1e3) {
|
|
10766
|
+
if (globalHaptics) triggerHaptic("selection");
|
|
10767
|
+
Animated.timing(translateX, {
|
|
10768
|
+
toValue: width,
|
|
10769
|
+
duration: animationDuration,
|
|
10770
|
+
useNativeDriver: true
|
|
10771
|
+
}).start();
|
|
10772
|
+
} else Animated.spring(translateX, {
|
|
10773
|
+
toValue: open ? 0 : width,
|
|
10774
|
+
tension: 65,
|
|
10775
|
+
friction: 11,
|
|
10776
|
+
useNativeDriver: true
|
|
10777
|
+
}).start();
|
|
10778
|
+
isSwiping.current = false;
|
|
10779
|
+
}
|
|
10780
|
+
});
|
|
10781
|
+
}, [
|
|
10782
|
+
translateX,
|
|
10783
|
+
width,
|
|
10784
|
+
side,
|
|
10785
|
+
open,
|
|
10786
|
+
initialTranslateX,
|
|
10787
|
+
handleOpenChange,
|
|
10788
|
+
globalHaptics
|
|
10789
|
+
]);
|
|
10790
|
+
useEffect(() => {
|
|
10791
|
+
if (skipAnimationRef.current) {
|
|
10792
|
+
skipAnimationRef.current = false;
|
|
10793
|
+
return;
|
|
10794
|
+
}
|
|
10795
|
+
if (open) {
|
|
10796
|
+
translateX.setValue(side === "left" ? -width : width);
|
|
10797
|
+
Animated.timing(translateX, {
|
|
10798
|
+
toValue: 0,
|
|
10799
|
+
duration: animationDuration,
|
|
10800
|
+
useNativeDriver: true
|
|
10801
|
+
}).start();
|
|
10802
|
+
} else Animated.timing(translateX, {
|
|
10803
|
+
toValue: side === "left" ? -width : width,
|
|
10804
|
+
duration: animationDuration,
|
|
10805
|
+
useNativeDriver: true
|
|
10806
|
+
}).start();
|
|
10807
|
+
}, [
|
|
10808
|
+
open,
|
|
10809
|
+
width,
|
|
10810
|
+
side,
|
|
10811
|
+
translateX,
|
|
10812
|
+
animationDuration
|
|
10813
|
+
]);
|
|
10814
|
+
useEffect(() => {
|
|
10815
|
+
if (skipAnimationRef.current) return;
|
|
10816
|
+
if (variant === "push") if (open) Animated.timing(mainTranslateX, {
|
|
10817
|
+
toValue: side === "left" ? width : -width,
|
|
10818
|
+
duration: animationDuration,
|
|
10819
|
+
useNativeDriver: true
|
|
10820
|
+
}).start();
|
|
10821
|
+
else Animated.timing(mainTranslateX, {
|
|
10822
|
+
toValue: 0,
|
|
10823
|
+
duration: animationDuration,
|
|
10824
|
+
useNativeDriver: true
|
|
10825
|
+
}).start();
|
|
10826
|
+
}, [
|
|
10827
|
+
open,
|
|
10828
|
+
width,
|
|
10829
|
+
side,
|
|
10830
|
+
variant,
|
|
10831
|
+
mainTranslateX,
|
|
10832
|
+
animationDuration
|
|
10833
|
+
]);
|
|
10834
|
+
const theme = useTheme$1();
|
|
10835
|
+
const mode = useThemeMode$1();
|
|
10836
|
+
const globalHaptics = useHaptics$1();
|
|
10837
|
+
const colors = mode === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
10838
|
+
const grayAlpha = getGrayAlpha(theme);
|
|
10839
|
+
const radii = theme.radii;
|
|
10840
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, {
|
|
10841
|
+
value: {
|
|
10842
|
+
open,
|
|
10843
|
+
onOpenChange: handleOpenChange,
|
|
10844
|
+
side,
|
|
10845
|
+
variant,
|
|
10846
|
+
width,
|
|
10847
|
+
animationDuration,
|
|
10848
|
+
colors,
|
|
10849
|
+
grayAlpha,
|
|
10850
|
+
radii,
|
|
10851
|
+
translateX,
|
|
10852
|
+
mainTranslateX,
|
|
10853
|
+
panHandlers: panResponder.panHandlers,
|
|
10854
|
+
globalHaptics
|
|
10855
|
+
},
|
|
10856
|
+
children
|
|
10857
|
+
});
|
|
10858
|
+
};
|
|
10859
|
+
const SidebarTrigger = ({ children, asChild = true, hapticFeedback = false }) => {
|
|
10860
|
+
const { onOpenChange, globalHaptics } = useSidebar();
|
|
10861
|
+
const handlePress = () => {
|
|
10862
|
+
onOpenChange(true);
|
|
10863
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("selection");
|
|
10864
|
+
};
|
|
10865
|
+
if (asChild && React.isValidElement(children)) return React.cloneElement(children, { onPress: (e) => {
|
|
10866
|
+
children.props?.onPress?.(e);
|
|
10867
|
+
handlePress();
|
|
10868
|
+
} });
|
|
10869
|
+
return /* @__PURE__ */ jsx(AnimatedPressable, {
|
|
10870
|
+
onPress: handlePress,
|
|
10871
|
+
pressedScale: .98,
|
|
10872
|
+
pressedOpacity: .95,
|
|
10873
|
+
animationDuration: 100,
|
|
10874
|
+
hapticFeedback: false,
|
|
10875
|
+
children
|
|
10876
|
+
});
|
|
10877
|
+
};
|
|
10878
|
+
const SidebarPortal = ({ children }) => {
|
|
10879
|
+
const { open, variant } = useSidebar();
|
|
10880
|
+
if (variant === "push") return null;
|
|
10881
|
+
return /* @__PURE__ */ jsx(Modal, {
|
|
10882
|
+
transparent: true,
|
|
10883
|
+
visible: open,
|
|
10884
|
+
animationType: "none",
|
|
10885
|
+
supportedOrientations: ["portrait", "landscape"],
|
|
10886
|
+
onRequestClose: () => {},
|
|
10887
|
+
children
|
|
10888
|
+
});
|
|
10889
|
+
};
|
|
10890
|
+
const SidebarOverlay = ({ style, hapticFeedback = true }) => {
|
|
10891
|
+
const { onOpenChange, variant, globalHaptics } = useSidebar();
|
|
10892
|
+
const isDark = useThemeMode$1() === "dark";
|
|
10893
|
+
if (variant === "push") return null;
|
|
10894
|
+
const overlayColor = isDark ? "rgba(0, 0, 0, 0.6)" : "rgba(10, 10, 10, 0.6)";
|
|
10895
|
+
const handlePress = () => {
|
|
10896
|
+
onOpenChange(false);
|
|
10897
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("press");
|
|
10898
|
+
};
|
|
10899
|
+
return /* @__PURE__ */ jsx(TouchableWithoutFeedback, {
|
|
10900
|
+
onPress: handlePress,
|
|
10901
|
+
children: /* @__PURE__ */ jsx(View, { style: [
|
|
10902
|
+
styles$14.overlay,
|
|
10903
|
+
{ backgroundColor: overlayColor },
|
|
10904
|
+
style
|
|
10905
|
+
] })
|
|
10906
|
+
});
|
|
10907
|
+
};
|
|
10908
|
+
const SidebarContent = ({ children, style }) => {
|
|
10909
|
+
const { side, variant, width, translateX, panHandlers, radii, colors } = useSidebar();
|
|
10910
|
+
const theme = useTheme$1();
|
|
10911
|
+
const isDark = useThemeMode$1() === "dark";
|
|
10912
|
+
const backgroundColor = isDark ? theme.colors.gray.dark[2] : "#ffffff";
|
|
10913
|
+
const shadow = getShadow(6, isDark);
|
|
10914
|
+
const borderRadius = side === "left" ? {
|
|
10915
|
+
borderTopRightRadius: radii.large,
|
|
10916
|
+
borderBottomRightRadius: radii.large
|
|
10917
|
+
} : {
|
|
10918
|
+
borderTopLeftRadius: radii.large,
|
|
10919
|
+
borderBottomLeftRadius: radii.large
|
|
10920
|
+
};
|
|
10921
|
+
if (variant === "push") {
|
|
10922
|
+
const positionStyle = side === "left" ? { marginRight: -width } : { marginLeft: -width };
|
|
10923
|
+
return /* @__PURE__ */ jsx(Animated.View, {
|
|
10924
|
+
style: [{
|
|
10925
|
+
backgroundColor,
|
|
10926
|
+
width,
|
|
10927
|
+
...borderRadius,
|
|
10928
|
+
transform: [{ translateX }],
|
|
10929
|
+
...shadow || {},
|
|
10930
|
+
...positionStyle
|
|
10931
|
+
}, style],
|
|
10932
|
+
...panHandlers,
|
|
10933
|
+
children
|
|
10934
|
+
});
|
|
10935
|
+
}
|
|
10936
|
+
const positionStyle = side === "left" ? { left: 0 } : { right: 0 };
|
|
10937
|
+
return /* @__PURE__ */ jsx(Animated.View, {
|
|
10938
|
+
style: [
|
|
10939
|
+
styles$14.content,
|
|
10940
|
+
{
|
|
10941
|
+
backgroundColor,
|
|
10942
|
+
width,
|
|
10943
|
+
...borderRadius,
|
|
10944
|
+
...positionStyle,
|
|
10945
|
+
transform: [{ translateX }],
|
|
10946
|
+
...shadow || {}
|
|
10947
|
+
},
|
|
10948
|
+
style
|
|
10949
|
+
],
|
|
10950
|
+
...panHandlers,
|
|
10951
|
+
children
|
|
10952
|
+
});
|
|
10953
|
+
};
|
|
10954
|
+
const SidebarHeader = ({ children, style }) => {
|
|
10955
|
+
const theme = useTheme$1();
|
|
10956
|
+
const borderColor = useThemeMode$1() === "dark" ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.1)";
|
|
10957
|
+
return /* @__PURE__ */ jsx(View, {
|
|
10958
|
+
style: [
|
|
10959
|
+
styles$14.header,
|
|
10960
|
+
{
|
|
10961
|
+
paddingHorizontal: theme.space[4],
|
|
10962
|
+
paddingVertical: theme.space[3],
|
|
10963
|
+
borderBottomWidth: 1,
|
|
10964
|
+
borderBottomColor: borderColor
|
|
10965
|
+
},
|
|
10966
|
+
style
|
|
10967
|
+
],
|
|
10968
|
+
children
|
|
10969
|
+
});
|
|
10970
|
+
};
|
|
10971
|
+
const SidebarItem = ({ children, onPress, style, hapticFeedback = true }) => {
|
|
10972
|
+
const { onOpenChange, globalHaptics } = useSidebar();
|
|
10973
|
+
const theme = useTheme$1();
|
|
10974
|
+
const isDark = useThemeMode$1() === "dark";
|
|
10975
|
+
const handlePress = () => {
|
|
10976
|
+
onPress?.();
|
|
10977
|
+
onOpenChange(false);
|
|
10978
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("selection");
|
|
10979
|
+
};
|
|
10980
|
+
return /* @__PURE__ */ jsx(Pressable, {
|
|
10981
|
+
style: ({ pressed }) => [
|
|
10982
|
+
styles$14.item,
|
|
10983
|
+
{
|
|
10984
|
+
paddingHorizontal: theme.space[4],
|
|
10985
|
+
paddingVertical: theme.space[3],
|
|
10986
|
+
backgroundColor: pressed ? isDark ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)" : "transparent"
|
|
10987
|
+
},
|
|
10988
|
+
style
|
|
10989
|
+
],
|
|
10990
|
+
onPress: handlePress,
|
|
10991
|
+
children
|
|
10992
|
+
});
|
|
10993
|
+
};
|
|
10994
|
+
const SidebarSeparator = ({ style }) => {
|
|
10995
|
+
const theme = useTheme$1();
|
|
10996
|
+
const borderColor = useThemeMode$1() === "dark" ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.1)";
|
|
10997
|
+
return /* @__PURE__ */ jsx(View, { style: [
|
|
10998
|
+
styles$14.separator,
|
|
10999
|
+
{
|
|
11000
|
+
marginHorizontal: theme.space[4],
|
|
11001
|
+
borderBottomWidth: 1,
|
|
11002
|
+
borderBottomColor: borderColor
|
|
11003
|
+
},
|
|
11004
|
+
style
|
|
11005
|
+
] });
|
|
11006
|
+
};
|
|
11007
|
+
const SidebarBackdrop = ({ style, hapticFeedback = true }) => {
|
|
11008
|
+
const { onOpenChange, variant, globalHaptics } = useSidebar();
|
|
11009
|
+
const isDark = useThemeMode$1() === "dark";
|
|
11010
|
+
if (variant === "overlay") return null;
|
|
11011
|
+
const overlayColor = isDark ? "rgba(0, 0, 0, 0.3)" : "rgba(0, 0, 0, 0.2)";
|
|
11012
|
+
const handlePress = () => {
|
|
11013
|
+
onOpenChange(false);
|
|
11014
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("selection");
|
|
11015
|
+
};
|
|
11016
|
+
return /* @__PURE__ */ jsx(TouchableWithoutFeedback, {
|
|
11017
|
+
onPress: handlePress,
|
|
11018
|
+
children: /* @__PURE__ */ jsx(Animated.View, { style: [
|
|
11019
|
+
styles$14.backdrop,
|
|
11020
|
+
{ backgroundColor: overlayColor },
|
|
11021
|
+
style
|
|
11022
|
+
] })
|
|
11023
|
+
});
|
|
11024
|
+
};
|
|
11025
|
+
const SidebarContainer = ({ children }) => {
|
|
11026
|
+
const { animationDuration, variant, side, width, open, onOpenChange, translateX, mainTranslateX } = useSidebar();
|
|
11027
|
+
if (variant !== "push") return /* @__PURE__ */ jsx(Fragment, { children });
|
|
11028
|
+
const containerPanResponder = useMemo(() => {
|
|
11029
|
+
return PanResponder.create({
|
|
11030
|
+
onStartShouldSetPanResponder: () => false,
|
|
11031
|
+
onMoveShouldSetPanResponder: (_, gestureState) => {
|
|
11032
|
+
if (Math.abs(gestureState.dx) <= 10 || Math.abs(gestureState.dx) <= Math.abs(gestureState.dy)) return false;
|
|
11033
|
+
if (!open) if (side === "left") return gestureState.dx > 10;
|
|
11034
|
+
else return gestureState.dx < -10;
|
|
11035
|
+
return true;
|
|
11036
|
+
},
|
|
11037
|
+
onPanResponderGrant: () => {},
|
|
11038
|
+
onPanResponderMove: (_, gestureState) => {
|
|
11039
|
+
if (side === "left") if (open) {
|
|
11040
|
+
const newTranslateX = gestureState.dx;
|
|
11041
|
+
const clampedValue = Math.max(-width, Math.min(0, newTranslateX));
|
|
11042
|
+
translateX.setValue(clampedValue);
|
|
11043
|
+
mainTranslateX.setValue(clampedValue + width);
|
|
11044
|
+
} else {
|
|
11045
|
+
const newTranslateX = -width + gestureState.dx;
|
|
11046
|
+
const clampedValue = Math.max(-width, Math.min(0, newTranslateX));
|
|
11047
|
+
translateX.setValue(clampedValue);
|
|
11048
|
+
mainTranslateX.setValue(gestureState.dx);
|
|
11049
|
+
}
|
|
11050
|
+
else if (open) {
|
|
11051
|
+
const newTranslateX = width + gestureState.dx;
|
|
11052
|
+
const clampedValue = Math.max(0, Math.min(width, newTranslateX));
|
|
11053
|
+
translateX.setValue(clampedValue);
|
|
11054
|
+
mainTranslateX.setValue(clampedValue - width);
|
|
11055
|
+
} else {
|
|
11056
|
+
const newTranslateX = width + gestureState.dx;
|
|
11057
|
+
const clampedValue = Math.max(0, Math.min(width, newTranslateX));
|
|
11058
|
+
translateX.setValue(clampedValue);
|
|
11059
|
+
mainTranslateX.setValue(gestureState.dx);
|
|
11060
|
+
}
|
|
11061
|
+
},
|
|
11062
|
+
onPanResponderRelease: (_, gestureState) => {
|
|
11063
|
+
const threshold = width * .25;
|
|
11064
|
+
const velocityThreshold = 500;
|
|
11065
|
+
if (side === "left") if (open) if (gestureState.dx < -threshold || gestureState.vx < -velocityThreshold / 1e3) {
|
|
11066
|
+
triggerHaptic("selection");
|
|
11067
|
+
onOpenChange(false, true);
|
|
11068
|
+
Animated.timing(translateX, {
|
|
11069
|
+
toValue: -width,
|
|
11070
|
+
duration: animationDuration,
|
|
11071
|
+
useNativeDriver: true
|
|
11072
|
+
}).start();
|
|
11073
|
+
Animated.timing(mainTranslateX, {
|
|
11074
|
+
toValue: 0,
|
|
11075
|
+
duration: animationDuration,
|
|
11076
|
+
useNativeDriver: true
|
|
11077
|
+
}).start();
|
|
11078
|
+
} else {
|
|
11079
|
+
Animated.spring(translateX, {
|
|
11080
|
+
toValue: 0,
|
|
11081
|
+
tension: 65,
|
|
11082
|
+
friction: 11,
|
|
11083
|
+
useNativeDriver: true
|
|
11084
|
+
}).start();
|
|
11085
|
+
Animated.spring(mainTranslateX, {
|
|
11086
|
+
toValue: width,
|
|
11087
|
+
tension: 65,
|
|
11088
|
+
friction: 11,
|
|
11089
|
+
useNativeDriver: true
|
|
11090
|
+
}).start();
|
|
11091
|
+
}
|
|
11092
|
+
else if (gestureState.dx > threshold || gestureState.vx > velocityThreshold / 1e3) {
|
|
11093
|
+
Animated.timing(translateX, {
|
|
11094
|
+
toValue: 0,
|
|
11095
|
+
duration: animationDuration,
|
|
11096
|
+
useNativeDriver: true
|
|
11097
|
+
}).start();
|
|
11098
|
+
Animated.timing(mainTranslateX, {
|
|
11099
|
+
toValue: width,
|
|
11100
|
+
duration: animationDuration,
|
|
11101
|
+
useNativeDriver: true
|
|
11102
|
+
}).start();
|
|
11103
|
+
onOpenChange(true, true);
|
|
11104
|
+
} else {
|
|
11105
|
+
Animated.spring(translateX, {
|
|
11106
|
+
toValue: -width,
|
|
11107
|
+
tension: 65,
|
|
11108
|
+
friction: 11,
|
|
11109
|
+
useNativeDriver: true
|
|
11110
|
+
}).start();
|
|
11111
|
+
Animated.spring(mainTranslateX, {
|
|
11112
|
+
toValue: 0,
|
|
11113
|
+
tension: 65,
|
|
11114
|
+
friction: 11,
|
|
11115
|
+
useNativeDriver: true
|
|
11116
|
+
}).start();
|
|
11117
|
+
}
|
|
11118
|
+
else if (open) if (gestureState.dx > threshold || gestureState.vx > velocityThreshold / 1e3) {
|
|
11119
|
+
triggerHaptic("selection");
|
|
11120
|
+
onOpenChange(false, true);
|
|
11121
|
+
Animated.timing(translateX, {
|
|
11122
|
+
toValue: width,
|
|
11123
|
+
duration: animationDuration,
|
|
11124
|
+
useNativeDriver: true
|
|
11125
|
+
}).start();
|
|
11126
|
+
Animated.timing(mainTranslateX, {
|
|
11127
|
+
toValue: 0,
|
|
11128
|
+
duration: animationDuration,
|
|
11129
|
+
useNativeDriver: true
|
|
11130
|
+
}).start();
|
|
11131
|
+
} else {
|
|
11132
|
+
Animated.spring(translateX, {
|
|
11133
|
+
toValue: 0,
|
|
11134
|
+
tension: 65,
|
|
11135
|
+
friction: 11,
|
|
11136
|
+
useNativeDriver: true
|
|
11137
|
+
}).start();
|
|
11138
|
+
Animated.spring(mainTranslateX, {
|
|
11139
|
+
toValue: -width,
|
|
11140
|
+
tension: 65,
|
|
11141
|
+
friction: 11,
|
|
11142
|
+
useNativeDriver: true
|
|
11143
|
+
}).start();
|
|
11144
|
+
}
|
|
11145
|
+
else if (gestureState.dx < -threshold || gestureState.vx < -velocityThreshold / 1e3) {
|
|
11146
|
+
Animated.timing(translateX, {
|
|
11147
|
+
toValue: 0,
|
|
11148
|
+
duration: animationDuration,
|
|
11149
|
+
useNativeDriver: true
|
|
11150
|
+
}).start();
|
|
11151
|
+
Animated.timing(mainTranslateX, {
|
|
11152
|
+
toValue: -width,
|
|
11153
|
+
duration: animationDuration,
|
|
11154
|
+
useNativeDriver: true
|
|
11155
|
+
}).start();
|
|
11156
|
+
onOpenChange(true, true);
|
|
11157
|
+
} else {
|
|
11158
|
+
Animated.spring(translateX, {
|
|
11159
|
+
toValue: width,
|
|
11160
|
+
tension: 65,
|
|
11161
|
+
friction: 11,
|
|
11162
|
+
useNativeDriver: true
|
|
11163
|
+
}).start();
|
|
11164
|
+
Animated.spring(mainTranslateX, {
|
|
11165
|
+
toValue: 0,
|
|
11166
|
+
tension: 65,
|
|
11167
|
+
friction: 11,
|
|
11168
|
+
useNativeDriver: true
|
|
11169
|
+
}).start();
|
|
11170
|
+
}
|
|
11171
|
+
}
|
|
11172
|
+
});
|
|
11173
|
+
}, [
|
|
11174
|
+
side,
|
|
11175
|
+
width,
|
|
11176
|
+
open,
|
|
11177
|
+
onOpenChange,
|
|
11178
|
+
translateX,
|
|
11179
|
+
mainTranslateX,
|
|
11180
|
+
animationDuration
|
|
11181
|
+
]);
|
|
11182
|
+
const childArray = React.Children.toArray(children);
|
|
11183
|
+
let contentChild = null;
|
|
11184
|
+
let mainChild = null;
|
|
11185
|
+
childArray.forEach((child) => {
|
|
11186
|
+
if (React.isValidElement(child) && child.type === SidebarContent) contentChild = child;
|
|
11187
|
+
else if (React.isValidElement(child) && child.type === SidebarMain) mainChild = child;
|
|
11188
|
+
});
|
|
11189
|
+
if (side === "right" && mainChild && contentChild) return /* @__PURE__ */ jsxs(View, {
|
|
11190
|
+
style: styles$14.container,
|
|
11191
|
+
...containerPanResponder.panHandlers,
|
|
11192
|
+
children: [mainChild, contentChild]
|
|
11193
|
+
});
|
|
11194
|
+
return /* @__PURE__ */ jsx(View, {
|
|
11195
|
+
style: styles$14.container,
|
|
11196
|
+
...containerPanResponder.panHandlers,
|
|
11197
|
+
children
|
|
11198
|
+
});
|
|
11199
|
+
};
|
|
11200
|
+
const SidebarMain = ({ children, style }) => {
|
|
11201
|
+
const { side, variant, width, open, mainTranslateX } = useSidebar();
|
|
11202
|
+
useTheme$1();
|
|
11203
|
+
if (variant === "push") return /* @__PURE__ */ jsx(Animated.View, {
|
|
11204
|
+
style: [
|
|
11205
|
+
styles$14.mainContent,
|
|
11206
|
+
{
|
|
11207
|
+
flex: 1,
|
|
11208
|
+
transform: [{ translateX: mainTranslateX }]
|
|
11209
|
+
},
|
|
11210
|
+
style
|
|
11211
|
+
],
|
|
11212
|
+
children
|
|
11213
|
+
});
|
|
11214
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
11215
|
+
};
|
|
11216
|
+
const styles$14 = StyleSheet.create({
|
|
11217
|
+
container: {
|
|
11218
|
+
flexDirection: "row",
|
|
11219
|
+
flex: 1
|
|
11220
|
+
},
|
|
11221
|
+
overlay: {
|
|
11222
|
+
...StyleSheet.absoluteFillObject,
|
|
11223
|
+
zIndex: 1
|
|
11224
|
+
},
|
|
11225
|
+
backdrop: {
|
|
11226
|
+
...StyleSheet.absoluteFillObject,
|
|
11227
|
+
zIndex: 1
|
|
11228
|
+
},
|
|
11229
|
+
content: {
|
|
11230
|
+
position: "absolute",
|
|
11231
|
+
top: 0,
|
|
11232
|
+
bottom: 0,
|
|
11233
|
+
zIndex: 2,
|
|
11234
|
+
elevation: 4
|
|
11235
|
+
},
|
|
11236
|
+
scrollContent: { flex: 1 },
|
|
11237
|
+
scrollContentContainer: {
|
|
11238
|
+
flexGrow: 1,
|
|
11239
|
+
paddingBottom: 4
|
|
11240
|
+
},
|
|
11241
|
+
header: {},
|
|
11242
|
+
item: {},
|
|
11243
|
+
separator: { height: 1 },
|
|
11244
|
+
mainContent: {}
|
|
11245
|
+
});
|
|
11246
|
+
const Sidebar = {
|
|
11247
|
+
Root: SidebarRoot,
|
|
11248
|
+
Trigger: SidebarTrigger,
|
|
11249
|
+
Portal: SidebarPortal,
|
|
11250
|
+
Overlay: SidebarOverlay,
|
|
11251
|
+
Content: SidebarContent,
|
|
11252
|
+
Header: SidebarHeader,
|
|
11253
|
+
Item: SidebarItem,
|
|
11254
|
+
Separator: SidebarSeparator,
|
|
11255
|
+
Main: SidebarMain,
|
|
11256
|
+
Backdrop: SidebarBackdrop,
|
|
11257
|
+
Container: SidebarContainer
|
|
11258
|
+
};
|
|
11259
|
+
|
|
11260
|
+
//#endregion
|
|
11261
|
+
//#region src/components/data-display/Avatar.tsx
|
|
11262
|
+
const Avatar = React.forwardRef(({ src, alt = "Avatar", color, variant = "solid", highContrast, radius, size = 2, fallback, fallbackBehavior = "character", style, accessibilityLabel, children }, ref) => {
|
|
11263
|
+
const theme = useTheme$1();
|
|
11264
|
+
const mode = useThemeMode$1();
|
|
11265
|
+
const isDark = mode === "dark";
|
|
11266
|
+
const grayScale = isDark ? theme.colors.gray.dark : theme.colors.gray;
|
|
11267
|
+
const grayAlpha = getGrayAlpha(theme);
|
|
11268
|
+
const activeColor = color || theme.accentColor;
|
|
11269
|
+
const radii = theme.radii[radius] ?? theme.radii.medium;
|
|
11270
|
+
const selectedRadius = radius || theme.radius;
|
|
11271
|
+
const [imageError, setImageError] = useState(false);
|
|
11272
|
+
const variantColors = useMemo(() => getVariantColors(theme, activeColor, mode, variant, highContrast), [
|
|
11273
|
+
getVariantColors,
|
|
11274
|
+
color,
|
|
11275
|
+
variant,
|
|
11276
|
+
highContrast,
|
|
11277
|
+
isDark,
|
|
11278
|
+
theme
|
|
11279
|
+
]);
|
|
11280
|
+
const getSizeValues = () => {
|
|
11281
|
+
switch (size) {
|
|
11282
|
+
case 1: return {
|
|
11283
|
+
size: 24,
|
|
11284
|
+
fontSize: 10,
|
|
11285
|
+
borderWidth: 0,
|
|
11286
|
+
borderRadius: selectedRadius === "full" ? 9999 : radii
|
|
11287
|
+
};
|
|
11288
|
+
case 2: return {
|
|
11289
|
+
size: 32,
|
|
11290
|
+
fontSize: 12,
|
|
11291
|
+
borderWidth: 0,
|
|
11292
|
+
borderRadius: selectedRadius === "full" ? 9999 : radii
|
|
11293
|
+
};
|
|
11294
|
+
case 3: return {
|
|
11295
|
+
size: 48,
|
|
11296
|
+
fontSize: 18,
|
|
11297
|
+
borderWidth: 0,
|
|
11298
|
+
borderRadius: selectedRadius === "full" ? 9999 : radii
|
|
11299
|
+
};
|
|
11300
|
+
case 4: return {
|
|
11301
|
+
size: 64,
|
|
11302
|
+
fontSize: 24,
|
|
11303
|
+
borderWidth: 0,
|
|
11304
|
+
borderRadius: selectedRadius === "full" ? 9999 : radii
|
|
11305
|
+
};
|
|
10574
11306
|
case 5: return {
|
|
10575
11307
|
size: 80,
|
|
10576
11308
|
fontSize: 32,
|
|
@@ -10620,10 +11352,10 @@ const Avatar = React.forwardRef(({ src, alt = "Avatar", color, variant = "solid"
|
|
|
10620
11352
|
if (!trimmed) return null;
|
|
10621
11353
|
return trimmed.split(/\s+/).map((word) => word[0]).join("").slice(0, 2).toUpperCase() || null;
|
|
10622
11354
|
})();
|
|
10623
|
-
return /* @__PURE__ */ jsxs(
|
|
11355
|
+
return /* @__PURE__ */ jsxs(RnView, {
|
|
10624
11356
|
ref,
|
|
10625
11357
|
style: [
|
|
10626
|
-
styles$
|
|
11358
|
+
styles$13.avatar,
|
|
10627
11359
|
{
|
|
10628
11360
|
width: sizeValues.size,
|
|
10629
11361
|
height: sizeValues.size,
|
|
@@ -10648,8 +11380,8 @@ const Avatar = React.forwardRef(({ src, alt = "Avatar", color, variant = "solid"
|
|
|
10648
11380
|
onError: () => setImageError(true),
|
|
10649
11381
|
accessibilityLabel: alt,
|
|
10650
11382
|
testID: "avatar-image"
|
|
10651
|
-
}) : /* @__PURE__ */ jsx(
|
|
10652
|
-
style: [styles$
|
|
11383
|
+
}) : /* @__PURE__ */ jsx(RnView, {
|
|
11384
|
+
style: [styles$13.fallback, {
|
|
10653
11385
|
backgroundColor: variantColors.backgroundColor,
|
|
10654
11386
|
flex: 1,
|
|
10655
11387
|
width: "100%",
|
|
@@ -10673,7 +11405,7 @@ const AvatarFallback = ({ children }) => {
|
|
|
10673
11405
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
10674
11406
|
};
|
|
10675
11407
|
Avatar.Fallback = AvatarFallback;
|
|
10676
|
-
const styles$
|
|
11408
|
+
const styles$13 = StyleSheet.create({
|
|
10677
11409
|
avatar: {
|
|
10678
11410
|
alignItems: "center",
|
|
10679
11411
|
justifyContent: "center"
|
|
@@ -10741,7 +11473,7 @@ const Badge = React.forwardRef(({ children, variant = "soft", color, radius = "m
|
|
|
10741
11473
|
return /* @__PURE__ */ jsx(RnView, {
|
|
10742
11474
|
ref,
|
|
10743
11475
|
style: [
|
|
10744
|
-
styles$
|
|
11476
|
+
styles$12.badge,
|
|
10745
11477
|
badgeStyle,
|
|
10746
11478
|
style
|
|
10747
11479
|
],
|
|
@@ -10749,13 +11481,13 @@ const Badge = React.forwardRef(({ children, variant = "soft", color, radius = "m
|
|
|
10749
11481
|
accessibilityRole: "none",
|
|
10750
11482
|
...rest,
|
|
10751
11483
|
children: typeof children === "string" ? /* @__PURE__ */ jsx(TextComponent, {
|
|
10752
|
-
style: [styles$
|
|
11484
|
+
style: [styles$12.text, textStyle],
|
|
10753
11485
|
children
|
|
10754
11486
|
}) : children
|
|
10755
11487
|
});
|
|
10756
11488
|
});
|
|
10757
11489
|
Badge.displayName = "Badge";
|
|
10758
|
-
const styles$
|
|
11490
|
+
const styles$12 = StyleSheet.create({
|
|
10759
11491
|
badge: {
|
|
10760
11492
|
flexDirection: "row",
|
|
10761
11493
|
alignItems: "center"
|
|
@@ -10991,14 +11723,14 @@ const Card = React.forwardRef(({ asChild = false, children, color, radius = "med
|
|
|
10991
11723
|
style,
|
|
10992
11724
|
...rest,
|
|
10993
11725
|
children: /* @__PURE__ */ jsx(RnView, {
|
|
10994
|
-
style: [styles$
|
|
11726
|
+
style: [styles$11.card, cardStyle],
|
|
10995
11727
|
children
|
|
10996
11728
|
})
|
|
10997
11729
|
});
|
|
10998
11730
|
return /* @__PURE__ */ jsx(RnView, {
|
|
10999
11731
|
ref,
|
|
11000
11732
|
style: [
|
|
11001
|
-
styles$
|
|
11733
|
+
styles$11.card,
|
|
11002
11734
|
cardStyle,
|
|
11003
11735
|
style
|
|
11004
11736
|
],
|
|
@@ -11012,7 +11744,7 @@ const CardFooter = ({ children, separate = true }) => {
|
|
|
11012
11744
|
useThemeMode$1();
|
|
11013
11745
|
const grayAlpha = getGrayAlpha(theme);
|
|
11014
11746
|
return /* @__PURE__ */ jsx(RnView, {
|
|
11015
|
-
style: [styles$
|
|
11747
|
+
style: [styles$11.footer, separate && {
|
|
11016
11748
|
borderTopWidth: 1,
|
|
11017
11749
|
borderTopColor: grayAlpha["6"],
|
|
11018
11750
|
marginTop: theme.space[4],
|
|
@@ -11022,7 +11754,7 @@ const CardFooter = ({ children, separate = true }) => {
|
|
|
11022
11754
|
});
|
|
11023
11755
|
};
|
|
11024
11756
|
Card.Footer = CardFooter;
|
|
11025
|
-
const styles$
|
|
11757
|
+
const styles$11 = StyleSheet.create({
|
|
11026
11758
|
card: { overflow: "hidden" },
|
|
11027
11759
|
footer: {
|
|
11028
11760
|
flexDirection: "row",
|
|
@@ -11069,7 +11801,7 @@ const DataListRoot = ({ children, orientation = "horizontal", size = 2, trim = "
|
|
|
11069
11801
|
},
|
|
11070
11802
|
children: /* @__PURE__ */ jsx(View, {
|
|
11071
11803
|
style: [
|
|
11072
|
-
styles$
|
|
11804
|
+
styles$10.root,
|
|
11073
11805
|
rootStyle,
|
|
11074
11806
|
trimStyles,
|
|
11075
11807
|
style
|
|
@@ -11093,7 +11825,7 @@ const DataListItem = ({ children, align = "baseline", style }) => {
|
|
|
11093
11825
|
};
|
|
11094
11826
|
return /* @__PURE__ */ jsx(View, {
|
|
11095
11827
|
style: [
|
|
11096
|
-
styles$
|
|
11828
|
+
styles$10.item,
|
|
11097
11829
|
itemStyle,
|
|
11098
11830
|
style
|
|
11099
11831
|
],
|
|
@@ -11163,7 +11895,7 @@ const DataListValue = ({ children, style }) => {
|
|
|
11163
11895
|
});
|
|
11164
11896
|
};
|
|
11165
11897
|
DataListValue.displayName = "DataList.Value";
|
|
11166
|
-
const styles$
|
|
11898
|
+
const styles$10 = StyleSheet.create({
|
|
11167
11899
|
root: { width: "100%" },
|
|
11168
11900
|
item: { width: "100%" }
|
|
11169
11901
|
});
|
|
@@ -11195,7 +11927,7 @@ const FancyList = ({ data, renderItem, keyExtractor, style, showDividers = true,
|
|
|
11195
11927
|
borderBottomColor: dividerColor
|
|
11196
11928
|
};
|
|
11197
11929
|
return /* @__PURE__ */ jsx(RnView, {
|
|
11198
|
-
style: [styles$
|
|
11930
|
+
style: [styles$9.item, itemStyle],
|
|
11199
11931
|
children: renderItem({
|
|
11200
11932
|
item: info.item,
|
|
11201
11933
|
index: info.index,
|
|
@@ -11210,14 +11942,14 @@ const FancyList = ({ data, renderItem, keyExtractor, style, showDividers = true,
|
|
|
11210
11942
|
};
|
|
11211
11943
|
if (!scrollable) return /* @__PURE__ */ jsxs(RnView, {
|
|
11212
11944
|
style: [
|
|
11213
|
-
styles$
|
|
11945
|
+
styles$9.container,
|
|
11214
11946
|
listContainerStyle,
|
|
11215
11947
|
style
|
|
11216
11948
|
],
|
|
11217
11949
|
children: [
|
|
11218
11950
|
ListHeaderComponent,
|
|
11219
11951
|
data.map((item, index) => /* @__PURE__ */ jsx(RnView, {
|
|
11220
|
-
style: styles$
|
|
11952
|
+
style: styles$9.nonScrollableItem,
|
|
11221
11953
|
children: renderItem({
|
|
11222
11954
|
item,
|
|
11223
11955
|
index,
|
|
@@ -11228,28 +11960,28 @@ const FancyList = ({ data, renderItem, keyExtractor, style, showDividers = true,
|
|
|
11228
11960
|
]
|
|
11229
11961
|
});
|
|
11230
11962
|
return /* @__PURE__ */ jsx(RnView, {
|
|
11231
|
-
style: [styles$
|
|
11963
|
+
style: [styles$9.container, style],
|
|
11232
11964
|
children: /* @__PURE__ */ jsx(RnFlatList, {
|
|
11233
11965
|
data,
|
|
11234
11966
|
renderItem: renderListItem,
|
|
11235
11967
|
keyExtractor: defaultKeyExtractor,
|
|
11236
|
-
style: [styles$
|
|
11237
|
-
contentContainerStyle: styles$
|
|
11968
|
+
style: [styles$9.flatList, listContainerStyle],
|
|
11969
|
+
contentContainerStyle: styles$9.contentContainer,
|
|
11238
11970
|
showsVerticalScrollIndicator: true,
|
|
11239
11971
|
ListEmptyComponent,
|
|
11240
11972
|
ListHeaderComponent,
|
|
11241
11973
|
ListFooterComponent,
|
|
11242
|
-
ItemSeparatorComponent: () => showDividers ? /* @__PURE__ */ jsx(RnView, { style: [styles$
|
|
11974
|
+
ItemSeparatorComponent: () => showDividers ? /* @__PURE__ */ jsx(RnView, { style: [styles$9.divider, {
|
|
11243
11975
|
backgroundColor: dividerColor,
|
|
11244
11976
|
marginHorizontal: theme.space[4]
|
|
11245
11977
|
}] }) : null,
|
|
11246
|
-
ListHeaderComponentStyle: styles$
|
|
11247
|
-
ListFooterComponentStyle: styles$
|
|
11978
|
+
ListHeaderComponentStyle: styles$9.listHeaderFooter,
|
|
11979
|
+
ListFooterComponentStyle: styles$9.listHeaderFooter
|
|
11248
11980
|
})
|
|
11249
11981
|
});
|
|
11250
11982
|
};
|
|
11251
11983
|
FancyList.displayName = "FancyList";
|
|
11252
|
-
const styles$
|
|
11984
|
+
const styles$9 = StyleSheet.create({
|
|
11253
11985
|
container: { width: "100%" },
|
|
11254
11986
|
flatList: { flex: 1 },
|
|
11255
11987
|
contentContainer: { flexGrow: 1 },
|
|
@@ -11353,7 +12085,7 @@ const Progress = forwardRef(({ value, max = 100, size = 2, variant = "solid", co
|
|
|
11353
12085
|
return /* @__PURE__ */ jsx(RnView, {
|
|
11354
12086
|
ref,
|
|
11355
12087
|
style: [
|
|
11356
|
-
styles$
|
|
12088
|
+
styles$8.track,
|
|
11357
12089
|
{
|
|
11358
12090
|
backgroundColor: trackBackgroundColor,
|
|
11359
12091
|
borderColor: trackBorder.borderColor,
|
|
@@ -11372,7 +12104,7 @@ const Progress = forwardRef(({ value, max = 100, size = 2, variant = "solid", co
|
|
|
11372
12104
|
},
|
|
11373
12105
|
accessibilityRole: "progressbar",
|
|
11374
12106
|
testID,
|
|
11375
|
-
children: /* @__PURE__ */ jsx(Animated.View, { style: [styles$
|
|
12107
|
+
children: /* @__PURE__ */ jsx(Animated.View, { style: [styles$8.indicator, {
|
|
11376
12108
|
width: animatedWidth,
|
|
11377
12109
|
backgroundColor: indicatorColor,
|
|
11378
12110
|
borderRadius: selectedRadius
|
|
@@ -11380,7 +12112,7 @@ const Progress = forwardRef(({ value, max = 100, size = 2, variant = "solid", co
|
|
|
11380
12112
|
});
|
|
11381
12113
|
});
|
|
11382
12114
|
Progress.displayName = "Progress";
|
|
11383
|
-
const styles$
|
|
12115
|
+
const styles$8 = StyleSheet.create({
|
|
11384
12116
|
track: {
|
|
11385
12117
|
width: "100%",
|
|
11386
12118
|
overflow: "hidden"
|
|
@@ -11413,7 +12145,7 @@ const Spinner = React.forwardRef(({ size = "medium", color, highContrast = false
|
|
|
11413
12145
|
return /* @__PURE__ */ jsx(RnView, {
|
|
11414
12146
|
ref,
|
|
11415
12147
|
style: [
|
|
11416
|
-
styles$
|
|
12148
|
+
styles$7.container,
|
|
11417
12149
|
{
|
|
11418
12150
|
width: sizeConfig.dimension,
|
|
11419
12151
|
height: sizeConfig.dimension
|
|
@@ -11430,148 +12162,312 @@ const Spinner = React.forwardRef(({ size = "medium", color, highContrast = false
|
|
|
11430
12162
|
});
|
|
11431
12163
|
});
|
|
11432
12164
|
Spinner.displayName = "Spinner";
|
|
11433
|
-
const styles$
|
|
12165
|
+
const styles$7 = StyleSheet.create({ container: {
|
|
11434
12166
|
justifyContent: "center",
|
|
11435
12167
|
alignItems: "center"
|
|
11436
12168
|
} });
|
|
11437
12169
|
|
|
12170
|
+
//#endregion
|
|
12171
|
+
//#region src/components/data-display/Skeleton.tsx
|
|
12172
|
+
const PULSE_ANIMATION = {
|
|
12173
|
+
duration: 1e3,
|
|
12174
|
+
useNativeDriver: true
|
|
12175
|
+
};
|
|
12176
|
+
const SKELEON_COLORS = {
|
|
12177
|
+
light: "#E5E7EB",
|
|
12178
|
+
dark: "#D1D5DB"
|
|
12179
|
+
};
|
|
12180
|
+
const Skeleton = React.forwardRef(({ children, loading = true, style, textStyle, width, height, accessibilityLabel = "Loading", testID }, ref) => {
|
|
12181
|
+
const pulseAnim = useRef(new Animated.Value(0)).current;
|
|
12182
|
+
useEffect(() => {
|
|
12183
|
+
const animation = Animated.loop(Animated.sequence([Animated.timing(pulseAnim, {
|
|
12184
|
+
toValue: 1,
|
|
12185
|
+
...PULSE_ANIMATION
|
|
12186
|
+
}), Animated.timing(pulseAnim, {
|
|
12187
|
+
toValue: 0,
|
|
12188
|
+
...PULSE_ANIMATION
|
|
12189
|
+
})]));
|
|
12190
|
+
animation.start();
|
|
12191
|
+
return () => {
|
|
12192
|
+
animation.stop();
|
|
12193
|
+
};
|
|
12194
|
+
}, [pulseAnim]);
|
|
12195
|
+
const pulseStyle = { backgroundColor: pulseAnim.interpolate({
|
|
12196
|
+
inputRange: [0, 1],
|
|
12197
|
+
outputRange: [SKELEON_COLORS.light, SKELEON_COLORS.dark]
|
|
12198
|
+
}) };
|
|
12199
|
+
if (!loading) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
12200
|
+
if (!React.isValidElement(children) && typeof children === "string") return /* @__PURE__ */ jsx(Animated.Text, {
|
|
12201
|
+
ref,
|
|
12202
|
+
style: [
|
|
12203
|
+
textStyle,
|
|
12204
|
+
pulseStyle,
|
|
12205
|
+
width !== void 0 ? { width } : void 0,
|
|
12206
|
+
height !== void 0 ? { height } : void 0
|
|
12207
|
+
],
|
|
12208
|
+
accessibilityLabel,
|
|
12209
|
+
accessibilityRole: "progressbar",
|
|
12210
|
+
testID,
|
|
12211
|
+
children
|
|
12212
|
+
});
|
|
12213
|
+
return /* @__PURE__ */ jsx(Animated.View, {
|
|
12214
|
+
ref,
|
|
12215
|
+
style: [
|
|
12216
|
+
styles$6.blockContainer,
|
|
12217
|
+
pulseStyle,
|
|
12218
|
+
width !== void 0 ? { width } : void 0,
|
|
12219
|
+
height !== void 0 ? { height } : void 0,
|
|
12220
|
+
style
|
|
12221
|
+
],
|
|
12222
|
+
accessibilityLabel,
|
|
12223
|
+
accessibilityRole: "progressbar",
|
|
12224
|
+
testID,
|
|
12225
|
+
children: children && /* @__PURE__ */ jsx(View, {
|
|
12226
|
+
style: styles$6.hiddenChildren,
|
|
12227
|
+
pointerEvents: "none",
|
|
12228
|
+
children
|
|
12229
|
+
})
|
|
12230
|
+
});
|
|
12231
|
+
});
|
|
12232
|
+
Skeleton.displayName = "Skeleton";
|
|
12233
|
+
const styles$6 = StyleSheet.create({
|
|
12234
|
+
inlineText: {
|
|
12235
|
+
color: "transparent",
|
|
12236
|
+
fontSize: 14,
|
|
12237
|
+
lineHeight: 20,
|
|
12238
|
+
overflow: "hidden"
|
|
12239
|
+
},
|
|
12240
|
+
blockContainer: {
|
|
12241
|
+
minHeight: 20,
|
|
12242
|
+
overflow: "hidden"
|
|
12243
|
+
},
|
|
12244
|
+
hiddenChildren: { opacity: 0 }
|
|
12245
|
+
});
|
|
12246
|
+
|
|
11438
12247
|
//#endregion
|
|
11439
12248
|
//#region src/components/data-display/Table.tsx
|
|
11440
|
-
const
|
|
12249
|
+
const TableContext = createContext(null);
|
|
12250
|
+
const useTableContext = () => {
|
|
12251
|
+
const context = useContext(TableContext);
|
|
12252
|
+
if (!context) throw new Error("Table sub-components must be used within Table.Root");
|
|
12253
|
+
return context;
|
|
12254
|
+
};
|
|
12255
|
+
const TableRoot = React.forwardRef(({ children, size = "2", scrollable = true, style }, ref) => {
|
|
11441
12256
|
const theme = useTheme$1();
|
|
11442
|
-
useThemeMode$1()
|
|
11443
|
-
|
|
12257
|
+
const mode = useThemeMode$1();
|
|
12258
|
+
const isDark = mode === "dark";
|
|
12259
|
+
const grayAlpha = getGrayAlpha(theme, mode);
|
|
11444
12260
|
const tableStyle = {
|
|
11445
12261
|
borderRadius: theme.radii.medium,
|
|
11446
|
-
overflow: "hidden"
|
|
12262
|
+
overflow: "hidden",
|
|
12263
|
+
backgroundColor: isDark ? grayAlpha["2"] : grayAlpha["1"]
|
|
12264
|
+
};
|
|
12265
|
+
const contextValue = {
|
|
12266
|
+
size,
|
|
12267
|
+
isRoot: true
|
|
11447
12268
|
};
|
|
11448
|
-
const
|
|
11449
|
-
|
|
11450
|
-
children:
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11459
|
-
|
|
11460
|
-
|
|
11461
|
-
});
|
|
11462
|
-
if (scrollable) return /* @__PURE__ */ jsx(RnScrollView, {
|
|
12269
|
+
const content = /* @__PURE__ */ jsx(TableContext.Provider, {
|
|
12270
|
+
value: contextValue,
|
|
12271
|
+
children: /* @__PURE__ */ jsx(View, {
|
|
12272
|
+
ref,
|
|
12273
|
+
style: [
|
|
12274
|
+
styles$5.root,
|
|
12275
|
+
tableStyle,
|
|
12276
|
+
style
|
|
12277
|
+
],
|
|
12278
|
+
children
|
|
12279
|
+
})
|
|
12280
|
+
});
|
|
12281
|
+
if (scrollable) return /* @__PURE__ */ jsx(ScrollView, {
|
|
11463
12282
|
horizontal: true,
|
|
11464
|
-
style: [styles$5.scrollContainer, style],
|
|
11465
12283
|
showsHorizontalScrollIndicator: false,
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
return /* @__PURE__ */ jsx(RnView, {
|
|
11469
|
-
style: [styles$5.container, style],
|
|
11470
|
-
children: /* @__PURE__ */ jsx(TableContent, {})
|
|
12284
|
+
contentContainerStyle: styles$5.scrollContent,
|
|
12285
|
+
children: content
|
|
11471
12286
|
});
|
|
11472
|
-
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
|
|
11476
|
-
|
|
12287
|
+
return content;
|
|
12288
|
+
});
|
|
12289
|
+
TableRoot.displayName = "Table.Root";
|
|
12290
|
+
const TableHeader = React.forwardRef(({ children, style }, ref) => {
|
|
12291
|
+
const theme = useTheme$1();
|
|
12292
|
+
const mode = useThemeMode$1();
|
|
12293
|
+
const isDark = mode === "dark";
|
|
12294
|
+
const grayAlpha = getGrayAlpha(theme, mode);
|
|
12295
|
+
return /* @__PURE__ */ jsx(View, {
|
|
12296
|
+
ref,
|
|
12297
|
+
style: [
|
|
12298
|
+
styles$5.header,
|
|
12299
|
+
{
|
|
12300
|
+
backgroundColor: isDark ? grayAlpha["3"] : grayAlpha["2"],
|
|
12301
|
+
borderBottomWidth: 0,
|
|
12302
|
+
borderBottomColor: isDark ? grayAlpha["6"] : grayAlpha["5"]
|
|
12303
|
+
},
|
|
12304
|
+
style
|
|
12305
|
+
],
|
|
11477
12306
|
children
|
|
11478
12307
|
});
|
|
11479
|
-
};
|
|
11480
|
-
|
|
11481
|
-
|
|
11482
|
-
|
|
12308
|
+
});
|
|
12309
|
+
TableHeader.displayName = "Table.Header";
|
|
12310
|
+
const TableBody = React.forwardRef(({ children, style }, ref) => {
|
|
12311
|
+
return /* @__PURE__ */ jsx(View, {
|
|
12312
|
+
ref,
|
|
12313
|
+
style: [styles$5.body, style],
|
|
11483
12314
|
children
|
|
11484
12315
|
});
|
|
11485
|
-
};
|
|
11486
|
-
|
|
12316
|
+
});
|
|
12317
|
+
TableBody.displayName = "Table.Body";
|
|
12318
|
+
const TableRow = React.forwardRef(({ children, style }, ref) => {
|
|
11487
12319
|
const theme = useTheme$1();
|
|
11488
|
-
const
|
|
11489
|
-
isDark
|
|
11490
|
-
const grayAlpha = getGrayAlpha(theme);
|
|
11491
|
-
|
|
11492
|
-
|
|
11493
|
-
return /* @__PURE__ */ jsx(RnView, {
|
|
12320
|
+
const mode = useThemeMode$1();
|
|
12321
|
+
const isDark = mode === "dark";
|
|
12322
|
+
const grayAlpha = getGrayAlpha(theme, mode);
|
|
12323
|
+
return /* @__PURE__ */ jsx(View, {
|
|
12324
|
+
ref,
|
|
11494
12325
|
style: [
|
|
11495
|
-
styles$5.
|
|
11496
|
-
|
|
11497
|
-
|
|
12326
|
+
styles$5.row,
|
|
12327
|
+
{
|
|
12328
|
+
flex: 1,
|
|
11498
12329
|
borderBottomWidth: 1,
|
|
11499
|
-
borderBottomColor:
|
|
12330
|
+
borderBottomColor: isDark ? grayAlpha["6"] : grayAlpha["5"]
|
|
11500
12331
|
},
|
|
11501
|
-
|
|
11502
|
-
borderBottomWidth: 1,
|
|
11503
|
-
borderBottomColor: borderColor
|
|
11504
|
-
}
|
|
12332
|
+
style
|
|
11505
12333
|
],
|
|
11506
12334
|
children
|
|
11507
12335
|
});
|
|
11508
|
-
};
|
|
11509
|
-
|
|
12336
|
+
});
|
|
12337
|
+
TableRow.displayName = "Table.Row";
|
|
12338
|
+
const TableColumnHeaderCell = React.forwardRef(({ children, width, align = "left", style }, ref) => {
|
|
12339
|
+
const context = useTableContext();
|
|
11510
12340
|
const theme = useTheme$1();
|
|
11511
12341
|
const grayScale = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
11512
|
-
const
|
|
11513
|
-
|
|
12342
|
+
const getSizePadding = () => {
|
|
12343
|
+
switch (context.size) {
|
|
12344
|
+
case "1": return {
|
|
12345
|
+
paddingVertical: theme.space[2],
|
|
12346
|
+
paddingHorizontal: theme.space[3]
|
|
12347
|
+
};
|
|
12348
|
+
case "3": return {
|
|
12349
|
+
paddingVertical: theme.space[4],
|
|
12350
|
+
paddingHorizontal: theme.space[5]
|
|
12351
|
+
};
|
|
12352
|
+
default: return {
|
|
12353
|
+
paddingVertical: theme.space[3],
|
|
12354
|
+
paddingHorizontal: theme.space[4]
|
|
12355
|
+
};
|
|
12356
|
+
}
|
|
12357
|
+
};
|
|
12358
|
+
const getSizeFont = () => {
|
|
12359
|
+
switch (context.size) {
|
|
12360
|
+
case "1": return { fontSize: theme.typography.fontSizes[1].fontSize };
|
|
12361
|
+
case "3": return { fontSize: theme.typography.fontSizes[3].fontSize };
|
|
12362
|
+
default: return { fontSize: theme.typography.fontSizes[2].fontSize };
|
|
12363
|
+
}
|
|
12364
|
+
};
|
|
12365
|
+
const padding = getSizePadding();
|
|
12366
|
+
const fontSize = getSizeFont();
|
|
12367
|
+
return /* @__PURE__ */ jsx(View, {
|
|
12368
|
+
ref,
|
|
11514
12369
|
style: [
|
|
11515
|
-
styles$5.
|
|
11516
|
-
|
|
11517
|
-
|
|
12370
|
+
styles$5.cell,
|
|
12371
|
+
{
|
|
12372
|
+
width,
|
|
12373
|
+
alignItems: {
|
|
12374
|
+
left: "flex-start",
|
|
12375
|
+
center: "center",
|
|
12376
|
+
right: "flex-end"
|
|
12377
|
+
}[align],
|
|
12378
|
+
...padding
|
|
12379
|
+
},
|
|
12380
|
+
style
|
|
11518
12381
|
],
|
|
11519
12382
|
children: /* @__PURE__ */ jsx(TextComponent, {
|
|
11520
12383
|
style: {
|
|
11521
12384
|
color: grayScale[12],
|
|
11522
12385
|
fontWeight: "600",
|
|
11523
|
-
fontSize
|
|
12386
|
+
...fontSize
|
|
11524
12387
|
},
|
|
11525
12388
|
children
|
|
11526
12389
|
})
|
|
11527
12390
|
});
|
|
11528
|
-
};
|
|
11529
|
-
|
|
12391
|
+
});
|
|
12392
|
+
TableColumnHeaderCell.displayName = "Table.ColumnHeaderCell";
|
|
12393
|
+
const TableCell = React.forwardRef(({ children, align = "left", style }, ref) => {
|
|
12394
|
+
const context = useTableContext();
|
|
11530
12395
|
const theme = useTheme$1();
|
|
11531
12396
|
const grayScale = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
11532
|
-
|
|
11533
|
-
|
|
12397
|
+
const getSizePadding = () => {
|
|
12398
|
+
switch (context.size) {
|
|
12399
|
+
case "1": return {
|
|
12400
|
+
paddingVertical: theme.space[2],
|
|
12401
|
+
paddingHorizontal: theme.space[3]
|
|
12402
|
+
};
|
|
12403
|
+
case "3": return {
|
|
12404
|
+
paddingVertical: theme.space[4],
|
|
12405
|
+
paddingHorizontal: theme.space[5]
|
|
12406
|
+
};
|
|
12407
|
+
default: return {
|
|
12408
|
+
paddingVertical: theme.space[3],
|
|
12409
|
+
paddingHorizontal: theme.space[4]
|
|
12410
|
+
};
|
|
12411
|
+
}
|
|
12412
|
+
};
|
|
12413
|
+
const getSizeFont = () => {
|
|
12414
|
+
switch (context.size) {
|
|
12415
|
+
case "1": return { fontSize: theme.typography.fontSizes[1].fontSize };
|
|
12416
|
+
case "3": return { fontSize: theme.typography.fontSizes[3].fontSize };
|
|
12417
|
+
default: return { fontSize: theme.typography.fontSizes[2].fontSize };
|
|
12418
|
+
}
|
|
12419
|
+
};
|
|
12420
|
+
const padding = getSizePadding();
|
|
12421
|
+
const fontSize = getSizeFont();
|
|
12422
|
+
return /* @__PURE__ */ jsx(View, {
|
|
12423
|
+
ref,
|
|
12424
|
+
style: [
|
|
12425
|
+
styles$5.cell,
|
|
12426
|
+
{
|
|
12427
|
+
alignItems: {
|
|
12428
|
+
left: "flex-start",
|
|
12429
|
+
center: "center",
|
|
12430
|
+
right: "flex-end"
|
|
12431
|
+
}[align],
|
|
12432
|
+
...padding
|
|
12433
|
+
},
|
|
12434
|
+
style
|
|
12435
|
+
],
|
|
11534
12436
|
children: /* @__PURE__ */ jsx(TextComponent, {
|
|
11535
12437
|
style: {
|
|
11536
12438
|
color: grayScale[11],
|
|
11537
|
-
fontSize
|
|
12439
|
+
...fontSize
|
|
11538
12440
|
},
|
|
11539
12441
|
children
|
|
11540
12442
|
})
|
|
11541
12443
|
});
|
|
11542
|
-
};
|
|
11543
|
-
|
|
11544
|
-
left: { justifyContent: "flex-start" },
|
|
11545
|
-
center: { justifyContent: "center" },
|
|
11546
|
-
right: { justifyContent: "flex-end" }
|
|
11547
|
-
};
|
|
11548
|
-
Table.Thead = Thead;
|
|
11549
|
-
Table.Tbody = Tbody;
|
|
11550
|
-
Table.Tr = Tr;
|
|
11551
|
-
Table.Th = Th;
|
|
11552
|
-
Table.Td = Td;
|
|
12444
|
+
});
|
|
12445
|
+
TableCell.displayName = "Table.Cell";
|
|
11553
12446
|
const styles$5 = StyleSheet.create({
|
|
11554
|
-
|
|
11555
|
-
|
|
11556
|
-
|
|
11557
|
-
thead: { flexDirection: "row" },
|
|
11558
|
-
tbody: { flexDirection: "column" },
|
|
11559
|
-
tr: {
|
|
12447
|
+
scrollContent: { flexGrow: 1 },
|
|
12448
|
+
root: { minWidth: "100%" },
|
|
12449
|
+
header: {
|
|
11560
12450
|
flexDirection: "row",
|
|
11561
|
-
minHeight: 44,
|
|
11562
|
-
alignItems: "center",
|
|
11563
|
-
borderBottomWidth: 1,
|
|
11564
|
-
borderBottomColor: "transparent"
|
|
11565
|
-
},
|
|
11566
|
-
th: {
|
|
11567
|
-
padding: 12,
|
|
11568
12451
|
minHeight: 44
|
|
11569
12452
|
},
|
|
11570
|
-
|
|
11571
|
-
|
|
12453
|
+
body: { flexDirection: "column" },
|
|
12454
|
+
row: {
|
|
12455
|
+
flexDirection: "row",
|
|
11572
12456
|
minHeight: 44
|
|
12457
|
+
},
|
|
12458
|
+
cell: {
|
|
12459
|
+
flex: 1,
|
|
12460
|
+
minWidth: 80
|
|
11573
12461
|
}
|
|
11574
12462
|
});
|
|
12463
|
+
const Table = {
|
|
12464
|
+
Root: TableRoot,
|
|
12465
|
+
Header: TableHeader,
|
|
12466
|
+
Body: TableBody,
|
|
12467
|
+
Row: TableRow,
|
|
12468
|
+
ColumnHeaderCell: TableColumnHeaderCell,
|
|
12469
|
+
Cell: TableCell
|
|
12470
|
+
};
|
|
11575
12471
|
|
|
11576
12472
|
//#endregion
|
|
11577
12473
|
//#region src/components/navigation/SegmentedControl.tsx
|
|
@@ -11581,19 +12477,57 @@ function useSegmentedControlContext() {
|
|
|
11581
12477
|
if (!context) throw new Error("SegmentedControl.Item must be used within SegmentedControl.Root");
|
|
11582
12478
|
return context;
|
|
11583
12479
|
}
|
|
12480
|
+
const SegmentedControlValue = ({ children }) => {
|
|
12481
|
+
const { value: selectedValue, color, isDark, grayScale, activeColor, solidVariantColors, softVariantColors, sizeValues, theme, itemValue, isItemSelected, itemDisabled } = useSegmentedControlContext();
|
|
12482
|
+
return /* @__PURE__ */ jsx(TextComponent, {
|
|
12483
|
+
style: {
|
|
12484
|
+
color: itemDisabled ? grayScale["9"] : color ? isItemSelected ? solidVariantColors.textColor : softVariantColors.textColor : isItemSelected ? grayScale[12] : grayScale[10],
|
|
12485
|
+
fontWeight: isItemSelected ? theme.typography.fontWeights.semibold : theme.typography.fontWeights.regular,
|
|
12486
|
+
fontSize: sizeValues.fontSize
|
|
12487
|
+
},
|
|
12488
|
+
children
|
|
12489
|
+
});
|
|
12490
|
+
};
|
|
12491
|
+
SegmentedControlValue.displayName = "SegmentedControlValue";
|
|
12492
|
+
const SegmentedControlIcon = ({ children }) => {
|
|
12493
|
+
const { color, isDark, grayScale, activeColor, solidVariantColors, softVariantColors, sizeValues, itemValue, isItemSelected, itemDisabled } = useSegmentedControlContext();
|
|
12494
|
+
const iconColor = itemDisabled ? grayScale["9"] : color ? isItemSelected ? solidVariantColors.textColor : softVariantColors.textColor : isItemSelected ? grayScale[12] : grayScale[10];
|
|
12495
|
+
const iconSize = sizeValues.fontSize;
|
|
12496
|
+
return React.cloneElement(children, {
|
|
12497
|
+
...children.props,
|
|
12498
|
+
color: iconColor,
|
|
12499
|
+
size: children.props.size ?? iconSize
|
|
12500
|
+
});
|
|
12501
|
+
};
|
|
12502
|
+
SegmentedControlIcon.displayName = "SegmentedControlIcon";
|
|
12503
|
+
const SegmentedControlItemContext = createContext(null);
|
|
11584
12504
|
const SegmentedControlItem = ({ value, disabled: itemDisabled, children }) => {
|
|
11585
|
-
const { value: selectedValue, onValueChange, disabled, sizeValues, isDark, grayScale, grayAlpha, activeColor, radii, selectedRadius, softVariantColors, solidVariantColors, color, onItemLayout, theme, pillBackgroundColor, hapticFeedback } = useSegmentedControlContext();
|
|
12505
|
+
const { value: selectedValue, onValueChange, disabled, sizeValues, isDark, grayScale, grayAlpha, activeColor, radii, selectedRadius, softVariantColors, solidVariantColors, color, onItemLayout, theme, pillBackgroundColor, hapticFeedback, globalHaptics } = useSegmentedControlContext();
|
|
11586
12506
|
const isSelected = value === selectedValue;
|
|
11587
12507
|
const isDisabled = disabled || itemDisabled;
|
|
12508
|
+
const hasValueChild = isValidElement(children) && children.type?.displayName === "SegmentedControlValue";
|
|
12509
|
+
const hasIconChild = isValidElement(children) && children.type?.displayName === "SegmentedControlIcon";
|
|
12510
|
+
const itemContextValue = {
|
|
12511
|
+
itemValue: value,
|
|
12512
|
+
isSelected,
|
|
12513
|
+
isDisabled
|
|
12514
|
+
};
|
|
12515
|
+
const mergedContext = {
|
|
12516
|
+
...useSegmentedControlContext(),
|
|
12517
|
+
itemValue: value,
|
|
12518
|
+
isItemSelected: isSelected,
|
|
12519
|
+
itemDisabled: isDisabled
|
|
12520
|
+
};
|
|
11588
12521
|
const handlePress = useCallback(() => {
|
|
11589
12522
|
if (!isDisabled) {
|
|
11590
12523
|
onValueChange(value);
|
|
11591
|
-
if (hapticFeedback)
|
|
12524
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("press");
|
|
11592
12525
|
}
|
|
11593
12526
|
}, [
|
|
11594
12527
|
isDisabled,
|
|
11595
12528
|
onValueChange,
|
|
11596
12529
|
value,
|
|
12530
|
+
globalHaptics,
|
|
11597
12531
|
hapticFeedback
|
|
11598
12532
|
]);
|
|
11599
12533
|
const handleLayout = useCallback((event) => {
|
|
@@ -11613,23 +12547,29 @@ const SegmentedControlItem = ({ value, disabled: itemDisabled, children }) => {
|
|
|
11613
12547
|
fontWeight: isSelected ? theme.typography.fontWeights.semibold : theme.typography.fontWeights.regular,
|
|
11614
12548
|
fontSize: sizeValues.fontSize
|
|
11615
12549
|
};
|
|
11616
|
-
return /* @__PURE__ */ jsx(
|
|
11617
|
-
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
|
|
11621
|
-
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
|
|
11625
|
-
|
|
11626
|
-
|
|
11627
|
-
|
|
11628
|
-
|
|
11629
|
-
|
|
11630
|
-
|
|
11631
|
-
|
|
11632
|
-
|
|
12550
|
+
return /* @__PURE__ */ jsx(SegmentedControlItemContext.Provider, {
|
|
12551
|
+
value: itemContextValue,
|
|
12552
|
+
children: /* @__PURE__ */ jsx(SegmentedControlContext.Provider, {
|
|
12553
|
+
value: mergedContext,
|
|
12554
|
+
children: /* @__PURE__ */ jsx(AnimatedPressable, {
|
|
12555
|
+
style: optionStyle,
|
|
12556
|
+
onPress: handlePress,
|
|
12557
|
+
onLayout: handleLayout,
|
|
12558
|
+
disabled: isDisabled,
|
|
12559
|
+
accessibilityRole: "radio",
|
|
12560
|
+
accessibilityState: {
|
|
12561
|
+
checked: isSelected,
|
|
12562
|
+
disabled: isDisabled
|
|
12563
|
+
},
|
|
12564
|
+
pressedScale: .975,
|
|
12565
|
+
pressedOpacity: .9,
|
|
12566
|
+
animationDuration: 100,
|
|
12567
|
+
hapticFeedback: false,
|
|
12568
|
+
children: hasValueChild || hasIconChild ? children : /* @__PURE__ */ jsx(TextComponent, {
|
|
12569
|
+
style: textStyle,
|
|
12570
|
+
children
|
|
12571
|
+
})
|
|
12572
|
+
})
|
|
11633
12573
|
})
|
|
11634
12574
|
});
|
|
11635
12575
|
};
|
|
@@ -11637,6 +12577,7 @@ SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
|
11637
12577
|
const SegmentedControlRoot = ({ defaultValue, value: controlledValue, onValueChange, disabled = false, color, radius, size = 3, style, highContrast = false, children, hapticFeedback = true }) => {
|
|
11638
12578
|
const theme = useTheme$1();
|
|
11639
12579
|
const mode = useThemeMode$1();
|
|
12580
|
+
const globalHaptics = useHaptics$1();
|
|
11640
12581
|
const isDark = mode === "dark";
|
|
11641
12582
|
const grayScale = isDark ? theme.colors.gray.dark : theme.colors.gray;
|
|
11642
12583
|
const grayAlpha = getGrayAlpha(theme);
|
|
@@ -11733,7 +12674,11 @@ const SegmentedControlRoot = ({ defaultValue, value: controlledValue, onValueCha
|
|
|
11733
12674
|
onItemLayout: handleItemLayout,
|
|
11734
12675
|
theme,
|
|
11735
12676
|
pillBackgroundColor,
|
|
11736
|
-
hapticFeedback
|
|
12677
|
+
hapticFeedback,
|
|
12678
|
+
globalHaptics,
|
|
12679
|
+
itemValue: null,
|
|
12680
|
+
isItemSelected: false,
|
|
12681
|
+
itemDisabled: false
|
|
11737
12682
|
};
|
|
11738
12683
|
const pillWidth = itemLayouts[currentValue]?.width || 0;
|
|
11739
12684
|
const pillInnerRadius = selectedRadius === "full" ? 9999 : radii;
|
|
@@ -11762,7 +12707,9 @@ const SegmentedControlRoot = ({ defaultValue, value: controlledValue, onValueCha
|
|
|
11762
12707
|
SegmentedControlRoot.displayName = "SegmentedControlRoot";
|
|
11763
12708
|
const SegmentedControl = {
|
|
11764
12709
|
Item: SegmentedControlItem,
|
|
11765
|
-
Root: SegmentedControlRoot
|
|
12710
|
+
Root: SegmentedControlRoot,
|
|
12711
|
+
Value: SegmentedControlValue,
|
|
12712
|
+
Icon: SegmentedControlIcon
|
|
11766
12713
|
};
|
|
11767
12714
|
const styles$4 = StyleSheet.create({
|
|
11768
12715
|
container: {
|
|
@@ -12121,6 +13068,7 @@ const AccordionTrigger = React.forwardRef(({ children, style, icon, hapticFeedba
|
|
|
12121
13068
|
const itemContext = useAccordionItemContext();
|
|
12122
13069
|
const theme = useTheme$1();
|
|
12123
13070
|
const mode = useThemeMode$1();
|
|
13071
|
+
const globalHaptics = useHaptics$1();
|
|
12124
13072
|
const { value, open, disabled } = itemContext;
|
|
12125
13073
|
const { size, dir, collapsible, type, onValueChange } = accordionContext;
|
|
12126
13074
|
const grayAlpha = getGrayAlpha(theme, mode);
|
|
@@ -12168,7 +13116,7 @@ const AccordionTrigger = React.forwardRef(({ children, style, icon, hapticFeedba
|
|
|
12168
13116
|
if (open) onValueChange(currentValue.filter((v) => v !== value));
|
|
12169
13117
|
else onValueChange([...currentValue, value]);
|
|
12170
13118
|
}
|
|
12171
|
-
if (hapticFeedback)
|
|
13119
|
+
if (globalHaptics && hapticFeedback) triggerHaptic("selection");
|
|
12172
13120
|
};
|
|
12173
13121
|
const rtlRotationInterpolate = rotationAnim.interpolate({
|
|
12174
13122
|
inputRange: [0, 1],
|
|
@@ -12188,7 +13136,7 @@ const AccordionTrigger = React.forwardRef(({ children, style, icon, hapticFeedba
|
|
|
12188
13136
|
const getIconColor = () => {
|
|
12189
13137
|
return grayAlpha["11"];
|
|
12190
13138
|
};
|
|
12191
|
-
return /* @__PURE__ */ jsxs(
|
|
13139
|
+
return /* @__PURE__ */ jsxs(AnimatedPressable, {
|
|
12192
13140
|
ref,
|
|
12193
13141
|
style: [triggerStyle, style],
|
|
12194
13142
|
onPress: handlePress,
|
|
@@ -12226,7 +13174,7 @@ const AccordionTrigger = React.forwardRef(({ children, style, icon, hapticFeedba
|
|
|
12226
13174
|
transform: [{ rotate: rtlRotationInterpolate }],
|
|
12227
13175
|
marginLeft: theme.space[2]
|
|
12228
13176
|
},
|
|
12229
|
-
children: /* @__PURE__ */ jsx(ChevronDownIcon
|
|
13177
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
12230
13178
|
width: sizeStyles.iconSize,
|
|
12231
13179
|
height: sizeStyles.iconSize,
|
|
12232
13180
|
color: getIconColor()
|
|
@@ -12376,4 +13324,4 @@ const useResponsive = (breakpoints = defaultBreakpoints) => {
|
|
|
12376
13324
|
};
|
|
12377
13325
|
|
|
12378
13326
|
//#endregion
|
|
12379
|
-
export { AbsoluteCenter, Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionRoot, AccordionTrigger, RnActivityIndicator as ActivityIndicator, AlertDialogComponent as AlertDialog, AnimatedPressable, AspectRatio, Avatar, Badge, Blockquote, BottomSheet, Box, Button, ButtonIcon, ButtonLabel, Callout, CalloutIcon, CalloutRoot, CalloutText, Card, Center, Checkbox, CheckboxCards, CheckboxCardsItem, CheckboxCardsRoot, CheckboxGroup, Code, Container, ContextMenu, DataList, DataListItem, DataListLabel, DataListRoot, DataListValue, Dialog, DropdownMenu, Em, FancyList, RnFlatList as FlatList, Flex, Grid, HCenter, HStack, Heading, IconButton, RnImage as Image, Inset, Kbd, Link, ManagedPortal, Popover, Portal, PortalProvider, RnPressable as Pressable, RnText as PrimitiveText, Progress, Radio, RadioCards, RadioCardsItem, RadioCardsRoot, RadioGroup, RadioGroupItem, RadioGroupRoot, ScrollArea, RnScrollView as ScrollView, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectOverlay, SelectPortal, SelectRoot, SelectSeparator, SelectTrigger, SelectValue, Separator, Slider, Slot, Spacer, Spinner, Stack, Strong, Switch, TabNav, Table, Tabs, TextComponent as Text, TextArea, TextField, RnTextInput as TextInput, ThemeProvider, Toast, TooltipExport as Tooltip, RnTouchableHighlight as TouchableHighlight, RnTouchableOpacity as TouchableOpacity, VCenter, VStack, RnView as View, VisuallyHidden, addColorSchemeListener, amber, amberAlpha, black, blackAlpha, blue, blueAlpha, bronze, bronzeAlpha, brown, brownAlpha, calculatePopoverPosition, createTheme, crimson, crimsonAlpha, cyan, cyanAlpha, defaultTheme, fontFamilies, getAccentAlpha, getAccentAlphaScale, getAccentColor, getAccentContrast, getAccentScale, getAccentTextColor, getActiveColors, getColorAlpha, getColorScale, getColorScheme, getContrast, getDisabledColors, getExtendedAccentScale, getFocusColor, getForegroundColor, getGrayAlpha, getGrayScale, getHighContrastBackground, getHighContrastTextColor, getHoverColors, getRadii, getSelectionColor, getShadow, getShadows, getSpace, getThemeColors, getThemeShadow, getTypography, getVariantColors, gold, goldAlpha, grass, grassAlpha, gray, grayAlpha, green, greenAlpha, indigo, indigoAlpha, iris, irisAlpha, jade, jadeAlpha, lime, limeAlpha, mauve, mauveAlpha, mint, mintAlpha, needsDarkText, olive, oliveAlpha, orange, orangeAlpha, pink, pinkAlpha, plum, plumAlpha, purple, purpleAlpha, radii, radiusFactors, red, redAlpha, ruby, rubyAlpha, sage, sageAlpha, sand, sandAlpha, scalingOptions, shadows, sky, skyAlpha, slate, slateAlpha, space, teal, tealAlpha, tomato, tomatoAlpha, typography, useAnchorPosition, useDeviceColorScheme, usePortal, useResponsive, useTheme, useThemeActions, useThemeColors, useThemeContext, useThemeMode, useToast, useToastContext, violet, violetAlpha, white, whiteAlpha, yellow, yellowAlpha };
|
|
13327
|
+
export { AbsoluteCenter, Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionRoot, AccordionTrigger, RnActivityIndicator as ActivityIndicator, AlertDialogComponent as AlertDialog, AnimatedPressable, AspectRatio, Avatar, Badge, Blockquote, BottomSheet, Box, Button, ButtonIcon, ButtonLabel, Callout, CalloutIcon, CalloutRoot, CalloutText, Card, Center, Checkbox, CheckboxCards, CheckboxCardsItem, CheckboxCardsRoot, CheckboxGroup, Code, Container, ContextMenu, DataList, DataListItem, DataListLabel, DataListRoot, DataListValue, Dialog, DropdownMenu, Em, FancyList, RnFlatList as FlatList, Flex, Grid, HCenter, HStack, Heading, IconButton, RnImage as Image, Inset, Kbd, Link, ManagedPortal, Popover, Portal, PortalProvider, RnPressable as Pressable, RnText as PrimitiveText, Progress, Radio, RadioCards, RadioCardsItem, RadioCardsRoot, RadioGroup, RadioGroupItem, RadioGroupRoot, ScrollArea, RnScrollView as ScrollView, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectOverlay, SelectPortal, SelectRoot, SelectSeparator, SelectTrigger, SelectValue, Separator, Sidebar, Skeleton, Slider, Slot, Spacer, Spinner, Stack, Strong, Switch, TabNav, Table, Tabs, TextComponent as Text, TextArea, TextField, RnTextInput as TextInput, ThemeProvider, Toast, TooltipExport as Tooltip, RnTouchableHighlight as TouchableHighlight, RnTouchableOpacity as TouchableOpacity, VCenter, VStack, RnView as View, VisuallyHidden, addColorSchemeListener, amber, amberAlpha, black, blackAlpha, blue, blueAlpha, bronze, bronzeAlpha, brown, brownAlpha, calculatePopoverPosition, createTheme, crimson, crimsonAlpha, cyan, cyanAlpha, defaultTheme, fontFamilies, getAccentAlpha, getAccentAlphaScale, getAccentColor, getAccentContrast, getAccentScale, getAccentTextColor, getActiveColors, getColorAlpha, getColorScale, getColorScheme, getContrast, getDisabledColors, getExtendedAccentScale, getFocusColor, getForegroundColor, getGrayAlpha, getGrayScale, getHighContrastBackground, getHighContrastTextColor, getHoverColors, getRadii, getSelectionColor, getShadow, getShadows, getSpace, getThemeColors, getThemeShadow, getTypography, getVariantColors, gold, goldAlpha, grass, grassAlpha, gray, grayAlpha, green, greenAlpha, indigo, indigoAlpha, iris, irisAlpha, jade, jadeAlpha, lime, limeAlpha, mauve, mauveAlpha, mint, mintAlpha, needsDarkText, olive, oliveAlpha, orange, orangeAlpha, pink, pinkAlpha, plum, plumAlpha, purple, purpleAlpha, radii, radiusFactors, red, redAlpha, ruby, rubyAlpha, sage, sageAlpha, sand, sandAlpha, scalingOptions, shadows, sky, skyAlpha, slate, slateAlpha, space, teal, tealAlpha, tomato, tomatoAlpha, typography, useAnchorPosition, useDeviceColorScheme, useHaptics, usePortal, useResponsive, useTheme, useThemeActions, useThemeColors, useThemeContext, useThemeMode, useToast, useToastContext, violet, violetAlpha, white, whiteAlpha, yellow, yellowAlpha };
|