@thewhileloop/whileui 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -5
- package/dist/blocks/commerce/metric-card.d.ts +9 -29
- package/dist/blocks/datepicker/date-range-picker-modal.d.ts +1 -1
- package/dist/blocks/datepicker/date-range-picker-modal.js +6 -14
- package/dist/blocks/datepicker/datepicker-modal.d.ts +1 -1
- package/dist/blocks/datepicker/datepicker-modal.js +6 -12
- package/dist/blocks/layout/smart-input.d.ts +3 -2
- package/dist/blocks/layout/smart-input.js +33 -18
- package/dist/blocks/media/smart-image.d.ts +39 -98
- package/dist/blocks/navigation/drawer-menu.js +88 -72
- package/dist/components/alert/alert.d.ts +23 -55
- package/dist/components/alert/alert.js +1 -1
- package/dist/components/alert-dialog/alert-dialog.js +1 -4
- package/dist/components/avatar/avatar.d.ts +18 -45
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/badge/badge.d.ts +84 -212
- package/dist/components/button/button.d.ts +69 -188
- package/dist/components/card/card.d.ts +29 -73
- package/dist/components/card/card.js +1 -1
- package/dist/components/container/container.d.ts +24 -96
- package/dist/components/data-row/data-row.d.ts +18 -38
- package/dist/components/data-row/data-row.js +1 -1
- package/dist/components/form-field/form-field.d.ts +31 -87
- package/dist/components/form-field/form-field.js +1 -1
- package/dist/components/hover-card/hover-card.d.ts +3 -2
- package/dist/components/input/input.d.ts +12 -31
- package/dist/components/label/label.d.ts +3 -3
- package/dist/components/labeled-field/labeled-field.d.ts +3 -2
- package/dist/components/numeric-input/numeric-input.d.ts +27 -82
- package/dist/components/numeric-input/numeric-input.js +69 -78
- package/dist/components/otp-input/otp-input.d.ts +21 -65
- package/dist/components/popover/popover.d.ts +4 -3
- package/dist/components/pressable/pressable.d.ts +3 -3
- package/dist/components/progress/progress.d.ts +15 -39
- package/dist/components/row/row.d.ts +63 -163
- package/dist/components/segmented-control/segmented-control.d.ts +69 -241
- package/dist/components/select/select.d.ts +10 -22
- package/dist/components/select/select.js +2 -2
- package/dist/components/separator/separator.d.ts +3 -3
- package/dist/components/skeleton/skeleton.d.ts +9 -29
- package/dist/components/spinner/spinner.d.ts +12 -36
- package/dist/components/stack/stack.d.ts +63 -163
- package/dist/components/tabs/tabs.d.ts +9 -29
- package/dist/components/text/text.d.ts +51 -131
- package/dist/components/textarea/textarea.d.ts +15 -39
- package/dist/components/textarea/textarea.js +1 -1
- package/dist/components/toast/toast.d.ts +12 -36
- package/dist/components/toggle/toggle.d.ts +42 -138
- package/dist/components/toggle-group/toggle-group.d.ts +42 -138
- package/dist/components/tooltip/tooltip.d.ts +3 -2
- package/dist/components/view/view.d.ts +3 -3
- package/dist/lib/ref-types.d.ts +3 -0
- package/dist/lib/ref-types.js +1 -0
- package/dist/lib/theme-bridge.d.ts +4 -2
- package/dist/lib/theme-bridge.js +13 -9
- package/package.json +29 -28
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { View, Pressable, Platform, Modal, I18nManager,
|
|
3
|
+
import { View, Pressable, Platform, Modal, I18nManager, SectionList, useWindowDimensions, StyleSheet, } from 'react-native';
|
|
4
4
|
import Animated, { useSharedValue, useAnimatedStyle, withTiming, Easing, interpolate, } from 'react-native-reanimated';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
6
|
import { Text } from '../../components/text';
|
|
@@ -12,43 +12,35 @@ import { shadowStyle, surfaceRadius } from '../../lib/recipes';
|
|
|
12
12
|
import { useMotionPolicy } from '../../lib/motion-policy';
|
|
13
13
|
import { useTapOnly } from '../../lib/tap-only';
|
|
14
14
|
import { useFrostedSurface, useFrostedBackdrop, } from '../../lib/frosted-surface';
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const effectiveMaxWidth = maxWidth ?? (Platform.OS === 'web' ? visual.drawerMaxWidthWeb : undefined);
|
|
39
|
-
const drawerWidth = effectiveMaxWidth != null ? Math.min(rawWidth, effectiveMaxWidth) : rawWidth;
|
|
40
|
-
const frostedInset = frosted ? visual.drawerFrostedInset : 0;
|
|
41
|
-
const cornerRadius = frosted ? visual.drawerFrostedRadius : surfaceRadius(visual, 'xl');
|
|
42
|
-
const useFloatingFrostedDrawer = frosted && frostedInset > 0;
|
|
43
|
-
const contentTopPadding = insets.top + visual.drawerContentTopPadding;
|
|
15
|
+
function DrawerItemRow({ item, active, onSelect, interaction, visual }) {
|
|
16
|
+
const handlePress = React.useCallback(() => onSelect(item.key), [item.key, onSelect]);
|
|
17
|
+
const pressStyle = React.useMemo(() => withInteractivePressableStyle({
|
|
18
|
+
borderRadius: visual.radiusLg,
|
|
19
|
+
paddingHorizontal: visual.controlPaddingXDefault,
|
|
20
|
+
paddingVertical: visual.controlPaddingYDefault,
|
|
21
|
+
minHeight: visual.touchTargetMinSize,
|
|
22
|
+
}, interaction, { pressedVariant: 'default' }), [interaction, visual]);
|
|
23
|
+
return (_jsxs(Pressable, { accessibilityRole: "button", onPress: handlePress, className: cn('flex-row items-center gap-3 mx-1 transition-colors', active && 'bg-primary-soft-subtle'), style: pressStyle, children: [item.icon, _jsx(Text, { className: cn('flex-1 font-semibold tracking-tight', item.destructive ? 'text-destructive' : active ? 'text-primary' : 'text-foreground'), style: { fontSize: visual.drawerItemFontSize }, children: item.label }), item.badge === undefined ? null : (_jsx(View, { className: "bg-primary px-2 py-0.5 items-center", style: { minWidth: visual.drawerBadgeMinWidth, borderRadius: visual.badgeRadius }, children: _jsx(Text, { className: "font-semibold text-primary-foreground", style: { fontSize: visual.navItemBadgeFontSize }, children: item.badge }) }))] }));
|
|
24
|
+
}
|
|
25
|
+
function DrawerSectionGap() {
|
|
26
|
+
return _jsx(View, { className: "mb-4" });
|
|
27
|
+
}
|
|
28
|
+
function DrawerItemGap() {
|
|
29
|
+
return _jsx(View, { className: "h-0.5" });
|
|
30
|
+
}
|
|
31
|
+
function DrawerSectionList({ sections, activeKey, onSelect, interaction, visual, }) {
|
|
32
|
+
const data = React.useMemo(() => sections.map((section) => ({ title: section.title, data: section.items })), [sections]);
|
|
33
|
+
const renderItem = React.useCallback(({ item }) => (_jsx(DrawerItemRow, { item: item, active: activeKey === item.key, onSelect: onSelect, interaction: interaction, visual: visual })), [activeKey, interaction, onSelect, visual]);
|
|
34
|
+
const renderSectionHeader = React.useCallback(({ section }) => section.title ? (_jsx(Text, { accessibilityRole: "header", className: "font-medium text-muted-foreground uppercase tracking-wide px-3 mb-2", style: { fontSize: visual.navSectionTitleFontSize }, children: section.title })) : null, [visual.navSectionTitleFontSize]);
|
|
35
|
+
return (_jsx(SectionList, { sections: data, keyExtractor: (item) => item.key, className: "flex-1 px-3", keyboardShouldPersistTaps: "handled", showsVerticalScrollIndicator: false, renderSectionHeader: renderSectionHeader, renderSectionFooter: DrawerSectionGap, ItemSeparatorComponent: DrawerItemGap, renderItem: renderItem }));
|
|
36
|
+
}
|
|
37
|
+
function useDrawerAnimation({ visible, drawerWidth, interaction, motion }) {
|
|
44
38
|
const progress = useSharedValue(0);
|
|
45
39
|
const [mounted, setMounted] = React.useState(visible);
|
|
46
40
|
const closeTimerRef = React.useRef(null);
|
|
47
|
-
// Mounting has to happen in the same commit that `visible` flips, or the drawer's
|
|
48
|
-
// entrance animation loses its first frame. React's documented way to do that is to
|
|
49
|
-
// adjust state during render on a props change rather than in an effect; the close
|
|
50
|
-
// path is the asymmetric one and stays below, on a timer, so the exit can finish.
|
|
51
41
|
const [prevVisible, setPrevVisible] = React.useState(visible);
|
|
42
|
+
// Open in the prop-change render so the first animation frame has a mounted panel;
|
|
43
|
+
// closing stays mounted on the timer until the exit animation finishes.
|
|
52
44
|
if (prevVisible !== visible) {
|
|
53
45
|
setPrevVisible(visible);
|
|
54
46
|
if (visible)
|
|
@@ -69,14 +61,10 @@ export function DrawerMenu({ visible, onClose, sections, activeKey, onSelect, he
|
|
|
69
61
|
progress.value = withTiming(visible ? 1 : 0, {
|
|
70
62
|
duration,
|
|
71
63
|
reduceMotion: motion.reanimatedReduceMotion,
|
|
72
|
-
easing: visible
|
|
73
|
-
? Easing.bezier(0.2, 0.8, 0.2, 1) // Swift, decelerating entrance
|
|
74
|
-
: Easing.bezier(0.4, 0, 1, 1), // Accelerating, sharp exit
|
|
64
|
+
easing: visible ? Easing.bezier(0.2, 0.8, 0.2, 1) : Easing.bezier(0.4, 0, 1, 1),
|
|
75
65
|
});
|
|
76
66
|
if (!visible) {
|
|
77
|
-
closeTimerRef.current = setTimeout(() =>
|
|
78
|
-
setMounted(false);
|
|
79
|
-
}, duration);
|
|
67
|
+
closeTimerRef.current = setTimeout(() => setMounted(false), duration);
|
|
80
68
|
}
|
|
81
69
|
return () => {
|
|
82
70
|
if (closeTimerRef.current) {
|
|
@@ -98,8 +86,7 @@ export function DrawerMenu({ visible, onClose, sections, activeKey, onSelect, he
|
|
|
98
86
|
opacity: progress.value,
|
|
99
87
|
pointerEvents: progress.value > 0 ? 'auto' : 'none',
|
|
100
88
|
}));
|
|
101
|
-
//
|
|
102
|
-
// trailing edge; the translate has to start off-screen on that same side.
|
|
89
|
+
// RN mirrors the anchored edge in RTL, so the off-screen translation mirrors too.
|
|
103
90
|
const offscreenX = I18nManager.isRTL ? drawerWidth : -drawerWidth;
|
|
104
91
|
const drawerStyle = useAnimatedStyle(() => ({
|
|
105
92
|
transform: [{ translateX: interpolate(progress.value, [0, 1], [offscreenX, 0]) }],
|
|
@@ -107,9 +94,57 @@ export function DrawerMenu({ visible, onClose, sections, activeKey, onSelect, he
|
|
|
107
94
|
const containerStyle = useAnimatedStyle(() => ({
|
|
108
95
|
pointerEvents: progress.value > 0 ? 'auto' : 'none',
|
|
109
96
|
}));
|
|
110
|
-
|
|
97
|
+
return { mounted, backdropStyle, drawerStyle, containerStyle };
|
|
98
|
+
}
|
|
99
|
+
function resolveDrawerLayout(screenWidth, maxWidth, frosted, visual) {
|
|
100
|
+
const rawWidth = screenWidth * visual.drawerWidthRatio;
|
|
101
|
+
const effectiveMaxWidth = maxWidth ?? (Platform.OS === 'web' ? visual.drawerMaxWidthWeb : undefined);
|
|
102
|
+
const width = effectiveMaxWidth == null ? rawWidth : Math.min(rawWidth, effectiveMaxWidth);
|
|
103
|
+
const inset = frosted ? visual.drawerFrostedInset : 0;
|
|
104
|
+
const radius = frosted ? visual.drawerFrostedRadius : surfaceRadius(visual, 'xl');
|
|
105
|
+
return { width, inset, radius, floating: frosted && inset > 0 };
|
|
106
|
+
}
|
|
107
|
+
function resolveBackdropBlur(blurIntensity, scale) {
|
|
108
|
+
return typeof blurIntensity === 'number' && Number.isFinite(blurIntensity)
|
|
109
|
+
? blurIntensity * scale
|
|
110
|
+
: undefined;
|
|
111
|
+
}
|
|
112
|
+
function drawerPanelClassName(frosted, className) {
|
|
113
|
+
return cn(frosted
|
|
114
|
+
? 'border border-border relative overflow-hidden'
|
|
115
|
+
: 'border-r border-border relative overflow-hidden', frosted ? 'bg-transparent' : 'bg-background', className);
|
|
116
|
+
}
|
|
117
|
+
export function DrawerMenu({ visible, onClose, sections, activeKey, onSelect, header, footer, maxWidth, className, style, frosted = false, blurIntensity, blurTintToken, }) {
|
|
118
|
+
const insets = useSafeAreaInsets();
|
|
119
|
+
const colors = useThemeColors();
|
|
120
|
+
const interaction = useInteractionTokens();
|
|
121
|
+
const visual = useVisualTokens();
|
|
122
|
+
const motion = useMotionPolicy();
|
|
123
|
+
const backdropPress = useTapOnly(onClose);
|
|
124
|
+
const frostedSurface = useFrostedSurface({
|
|
125
|
+
frosted,
|
|
126
|
+
blurIntensity,
|
|
127
|
+
blurTintToken,
|
|
128
|
+
defaultTintToken: 'surfaceTranslucent',
|
|
129
|
+
defaultBlurPreset: 'medium',
|
|
130
|
+
});
|
|
131
|
+
const frostedBackdrop = useFrostedBackdrop({
|
|
132
|
+
frosted,
|
|
133
|
+
blurIntensity: resolveBackdropBlur(blurIntensity, visual.frostedBackdropBlurScale),
|
|
134
|
+
tintColor: colors.overlay,
|
|
135
|
+
});
|
|
136
|
+
const { width: screenWidth } = useWindowDimensions();
|
|
137
|
+
const layout = resolveDrawerLayout(screenWidth, maxWidth, frosted, visual);
|
|
138
|
+
const contentTopPadding = insets.top + visual.drawerContentTopPadding;
|
|
139
|
+
const { mounted, backdropStyle, drawerStyle, containerStyle } = useDrawerAnimation({
|
|
140
|
+
visible,
|
|
141
|
+
drawerWidth: layout.width,
|
|
142
|
+
interaction,
|
|
143
|
+
motion,
|
|
144
|
+
});
|
|
145
|
+
const handleItemPress = React.useCallback((key) => {
|
|
111
146
|
onSelect?.(key);
|
|
112
|
-
};
|
|
147
|
+
}, [onSelect]);
|
|
113
148
|
if (!mounted)
|
|
114
149
|
return null;
|
|
115
150
|
const drawerTree = (_jsxs(Animated.View, { style: [StyleSheet.absoluteFill, containerStyle], children: [_jsxs(Animated.View, { style: [
|
|
@@ -119,39 +154,20 @@ export function DrawerMenu({ visible, onClose, sections, activeKey, onSelect, he
|
|
|
119
154
|
], children: [frostedBackdrop, _jsx(Pressable, { accessible: false, importantForAccessibility: "no", style: StyleSheet.absoluteFill, ...backdropPress })] }), _jsxs(Animated.View, { style: [
|
|
120
155
|
{
|
|
121
156
|
position: 'absolute',
|
|
122
|
-
top:
|
|
123
|
-
bottom:
|
|
124
|
-
left:
|
|
125
|
-
width: Math.max(
|
|
126
|
-
borderTopRightRadius:
|
|
127
|
-
borderBottomRightRadius:
|
|
128
|
-
borderTopLeftRadius:
|
|
129
|
-
borderBottomLeftRadius:
|
|
157
|
+
top: layout.inset,
|
|
158
|
+
bottom: layout.inset,
|
|
159
|
+
left: layout.inset,
|
|
160
|
+
width: Math.max(layout.width - layout.inset, 0),
|
|
161
|
+
borderTopRightRadius: layout.radius,
|
|
162
|
+
borderBottomRightRadius: layout.radius,
|
|
163
|
+
borderTopLeftRadius: layout.floating ? layout.radius : 0,
|
|
164
|
+
borderBottomLeftRadius: layout.floating ? layout.radius : 0,
|
|
130
165
|
},
|
|
131
166
|
shadowStyle(visual, colors, frosted ? 'lg' : 'md'),
|
|
132
167
|
drawerStyle,
|
|
133
168
|
frostedSurface.surfaceStyle,
|
|
134
169
|
style,
|
|
135
|
-
], className:
|
|
136
|
-
? 'border border-border relative overflow-hidden'
|
|
137
|
-
: 'border-r border-border relative overflow-hidden', frosted ? 'bg-transparent' : 'bg-background', className), children: [frostedSurface.overlay, _jsxs(View, { className: "flex-1 pb-8", style: { paddingTop: contentTopPadding }, children: [header && _jsx(View, { className: "px-5 pb-4 mb-2 border-b border-border", children: header }), _jsx(ScrollView, { className: "flex-1 px-3", keyboardShouldPersistTaps: "handled", showsVerticalScrollIndicator: false, children: sections.map((section, sectionIndex) => (_jsxs(View, { className: "mb-4", children: [section.title && (_jsx(Text, { className: "font-medium text-muted-foreground uppercase tracking-wide px-3 mb-2", style: { fontSize: visual.navSectionTitleFontSize }, children: section.title })), _jsx(View, { className: "gap-0.5", children: section.items.map((item) => {
|
|
138
|
-
const isActive = activeKey === item.key;
|
|
139
|
-
return (_jsxs(Pressable, { accessibilityRole: "button", onPress: () => handleItemPress(item.key), className: cn('flex-row items-center gap-3 mx-1 transition-colors', isActive && 'bg-primary-soft-subtle'), style: withInteractivePressableStyle({
|
|
140
|
-
borderRadius: visual.radiusLg,
|
|
141
|
-
paddingHorizontal: visual.controlPaddingXDefault,
|
|
142
|
-
paddingVertical: visual.controlPaddingYDefault,
|
|
143
|
-
minHeight: visual.touchTargetMinSize,
|
|
144
|
-
}, interaction, {
|
|
145
|
-
pressedVariant: 'default',
|
|
146
|
-
}), children: [item.icon, _jsx(Text, { className: cn('flex-1 font-semibold tracking-tight', item.destructive
|
|
147
|
-
? 'text-destructive'
|
|
148
|
-
: isActive
|
|
149
|
-
? 'text-primary'
|
|
150
|
-
: 'text-foreground'), style: { fontSize: visual.drawerItemFontSize }, children: item.label }), item.badge !== undefined && (_jsx(View, { className: "bg-primary px-2 py-0.5 items-center", style: {
|
|
151
|
-
minWidth: visual.drawerBadgeMinWidth,
|
|
152
|
-
borderRadius: visual.badgeRadius,
|
|
153
|
-
}, children: _jsx(Text, { className: "font-semibold text-primary-foreground", style: { fontSize: visual.navItemBadgeFontSize }, children: item.badge }) }))] }, item.key));
|
|
154
|
-
}) })] }, sectionIndex))) }), footer && _jsx(View, { className: "px-5 py-4 mt-auto border-t border-border", children: footer })] })] })] }));
|
|
170
|
+
], className: drawerPanelClassName(frosted, className), children: [frostedSurface.overlay, _jsxs(View, { className: "flex-1 pb-8", style: { paddingTop: contentTopPadding }, children: [header && _jsx(View, { className: "px-5 pb-4 mb-2 border-b border-border", children: header }), _jsx(DrawerSectionList, { sections: sections, activeKey: activeKey, onSelect: handleItemPress, interaction: interaction, visual: visual }), footer && _jsx(View, { className: "px-5 py-4 mt-auto border-t border-border", children: footer })] })] })] }));
|
|
155
171
|
if (Platform.OS !== 'android')
|
|
156
172
|
return drawerTree;
|
|
157
173
|
return (_jsx(Modal, { visible: mounted, transparent: true, animationType: "none", onRequestClose: onClose, statusBarTranslucent: true, navigationBarTranslucent: true, presentationStyle: "overFullScreen", children: drawerTree }));
|
|
@@ -1,70 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { View, Text, type ViewProps, type TextProps } from 'react-native';
|
|
1
|
+
import { type ViewInstance, type ViewProps, type TextInstance, type TextProps } from 'react-native';
|
|
3
2
|
import { type VariantProps } from '../../lib/tv';
|
|
3
|
+
import type { ForwardRefComponent } from '../../lib/ref-types';
|
|
4
4
|
declare const alertVariants: import("tailwind-variants").TVReturnType<{
|
|
5
5
|
variant: {
|
|
6
|
-
default:
|
|
7
|
-
destructive:
|
|
8
|
-
success:
|
|
9
|
-
warning:
|
|
10
|
-
info:
|
|
6
|
+
default: "border-border bg-background";
|
|
7
|
+
destructive: "border-destructive-soft-border bg-destructive-soft";
|
|
8
|
+
success: "border-success-soft-border bg-success-soft";
|
|
9
|
+
warning: "border-warning-soft-border bg-warning-soft";
|
|
10
|
+
info: "border-info-soft-border bg-info-soft";
|
|
11
11
|
};
|
|
12
|
-
}, undefined, "w-full border",
|
|
12
|
+
}, undefined, "w-full border", {
|
|
13
13
|
variant: {
|
|
14
|
-
default:
|
|
15
|
-
destructive:
|
|
16
|
-
success:
|
|
17
|
-
warning:
|
|
18
|
-
info:
|
|
14
|
+
default: "border-border bg-background";
|
|
15
|
+
destructive: "border-destructive-soft-border bg-destructive-soft";
|
|
16
|
+
success: "border-success-soft-border bg-success-soft";
|
|
17
|
+
warning: "border-warning-soft-border bg-warning-soft";
|
|
18
|
+
info: "border-info-soft-border bg-info-soft";
|
|
19
19
|
};
|
|
20
|
-
}, {
|
|
20
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
21
21
|
variant: {
|
|
22
|
-
default:
|
|
23
|
-
destructive:
|
|
24
|
-
success:
|
|
25
|
-
warning:
|
|
26
|
-
info:
|
|
22
|
+
default: "border-border bg-background";
|
|
23
|
+
destructive: "border-destructive-soft-border bg-destructive-soft";
|
|
24
|
+
success: "border-success-soft-border bg-success-soft";
|
|
25
|
+
warning: "border-warning-soft-border bg-warning-soft";
|
|
26
|
+
info: "border-info-soft-border bg-info-soft";
|
|
27
27
|
};
|
|
28
|
-
}
|
|
29
|
-
variant: {
|
|
30
|
-
default: string;
|
|
31
|
-
destructive: string;
|
|
32
|
-
success: string;
|
|
33
|
-
warning: string;
|
|
34
|
-
info: string;
|
|
35
|
-
};
|
|
36
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
37
|
-
variant: {
|
|
38
|
-
default: string;
|
|
39
|
-
destructive: string;
|
|
40
|
-
success: string;
|
|
41
|
-
warning: string;
|
|
42
|
-
info: string;
|
|
43
|
-
};
|
|
44
|
-
}, undefined, "w-full border", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
45
|
-
variant: {
|
|
46
|
-
default: string;
|
|
47
|
-
destructive: string;
|
|
48
|
-
success: string;
|
|
49
|
-
warning: string;
|
|
50
|
-
info: string;
|
|
51
|
-
};
|
|
52
|
-
}, {
|
|
53
|
-
variant: {
|
|
54
|
-
default: string;
|
|
55
|
-
destructive: string;
|
|
56
|
-
success: string;
|
|
57
|
-
warning: string;
|
|
58
|
-
info: string;
|
|
59
|
-
};
|
|
60
|
-
}>, unknown, unknown, undefined>>;
|
|
28
|
+
}, undefined>>;
|
|
61
29
|
export interface AlertProps extends ViewProps, VariantProps<typeof alertVariants> {
|
|
62
30
|
}
|
|
63
|
-
declare const Alert:
|
|
31
|
+
declare const Alert: ForwardRefComponent<ViewInstance, AlertProps>;
|
|
64
32
|
export interface AlertTitleProps extends TextProps {
|
|
65
33
|
}
|
|
66
|
-
declare const AlertTitle:
|
|
34
|
+
declare const AlertTitle: ForwardRefComponent<TextInstance, AlertTitleProps>;
|
|
67
35
|
export interface AlertDescriptionProps extends TextProps {
|
|
68
36
|
}
|
|
69
|
-
declare const AlertDescription:
|
|
37
|
+
declare const AlertDescription: ForwardRefComponent<TextInstance, AlertDescriptionProps>;
|
|
70
38
|
export { Alert, AlertTitle, AlertDescription, alertVariants };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { View, Text } from 'react-native';
|
|
3
|
+
import { View, Text, } from 'react-native';
|
|
4
4
|
import { cn } from '../../lib/cn';
|
|
5
5
|
import { tv } from '../../lib/tv';
|
|
6
6
|
import { useVisualTokens } from '../../lib/visual-tokens';
|
|
@@ -229,10 +229,7 @@ function AlertDialogContent({ className, children, presentation = 'modal', frost
|
|
|
229
229
|
if (!open) {
|
|
230
230
|
return (_jsx(View, { pointerEvents: "none", style: nativeHiddenStyle, collapsable: false, importantForAccessibility: "no-hide-descendants", children: children }));
|
|
231
231
|
}
|
|
232
|
-
return (_jsx(View, { pointerEvents: "box-none", style: [
|
|
233
|
-
StyleSheet.absoluteFill,
|
|
234
|
-
{ zIndex: 100, elevation: Platform.OS === 'android' ? 24 : undefined },
|
|
235
|
-
], children: themedBody }));
|
|
232
|
+
return (_jsx(View, { pointerEvents: "box-none", style: [StyleSheet.absoluteFill, { zIndex: 100 }], children: themedBody }));
|
|
236
233
|
}
|
|
237
234
|
return (_jsx(Modal, { visible: open, transparent: true, animationType: "fade", presentationStyle: Platform.OS === 'ios' ? 'overFullScreen' : undefined, statusBarTranslucent: Platform.OS === 'android', navigationBarTranslucent: Platform.OS === 'android', onRequestClose: () => setOpen(false), children: themedBody }));
|
|
238
235
|
}
|
|
@@ -1,56 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type ViewInstance, type ViewProps, type ImageProps } from 'react-native';
|
|
3
3
|
import { type VariantProps } from '../../lib/tv';
|
|
4
|
+
import type { ForwardRefComponent } from '../../lib/ref-types';
|
|
4
5
|
declare const avatarVariants: import("tailwind-variants").TVReturnType<{
|
|
5
6
|
size: {
|
|
6
|
-
default:
|
|
7
|
-
sm:
|
|
8
|
-
lg:
|
|
9
|
-
xl:
|
|
7
|
+
default: "h-10 w-10";
|
|
8
|
+
sm: "h-8 w-8";
|
|
9
|
+
lg: "h-12 w-12";
|
|
10
|
+
xl: "h-16 w-16";
|
|
10
11
|
};
|
|
11
|
-
}, undefined, "relative flex shrink-0 overflow-hidden rounded-full",
|
|
12
|
+
}, undefined, "relative flex shrink-0 overflow-hidden rounded-full", {
|
|
12
13
|
size: {
|
|
13
|
-
default:
|
|
14
|
-
sm:
|
|
15
|
-
lg:
|
|
16
|
-
xl:
|
|
14
|
+
default: "h-10 w-10";
|
|
15
|
+
sm: "h-8 w-8";
|
|
16
|
+
lg: "h-12 w-12";
|
|
17
|
+
xl: "h-16 w-16";
|
|
17
18
|
};
|
|
18
|
-
}, {
|
|
19
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
19
20
|
size: {
|
|
20
|
-
default:
|
|
21
|
-
sm:
|
|
22
|
-
lg:
|
|
23
|
-
xl:
|
|
21
|
+
default: "h-10 w-10";
|
|
22
|
+
sm: "h-8 w-8";
|
|
23
|
+
lg: "h-12 w-12";
|
|
24
|
+
xl: "h-16 w-16";
|
|
24
25
|
};
|
|
25
|
-
}
|
|
26
|
-
size: {
|
|
27
|
-
default: string;
|
|
28
|
-
sm: string;
|
|
29
|
-
lg: string;
|
|
30
|
-
xl: string;
|
|
31
|
-
};
|
|
32
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
33
|
-
size: {
|
|
34
|
-
default: string;
|
|
35
|
-
sm: string;
|
|
36
|
-
lg: string;
|
|
37
|
-
xl: string;
|
|
38
|
-
};
|
|
39
|
-
}, undefined, "relative flex shrink-0 overflow-hidden rounded-full", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
40
|
-
size: {
|
|
41
|
-
default: string;
|
|
42
|
-
sm: string;
|
|
43
|
-
lg: string;
|
|
44
|
-
xl: string;
|
|
45
|
-
};
|
|
46
|
-
}, {
|
|
47
|
-
size: {
|
|
48
|
-
default: string;
|
|
49
|
-
sm: string;
|
|
50
|
-
lg: string;
|
|
51
|
-
xl: string;
|
|
52
|
-
};
|
|
53
|
-
}>, unknown, unknown, undefined>>;
|
|
26
|
+
}, undefined>>;
|
|
54
27
|
export interface AvatarProps extends ViewProps, VariantProps<typeof avatarVariants> {
|
|
55
28
|
className?: string;
|
|
56
29
|
}
|
|
@@ -61,7 +34,7 @@ export interface AvatarImageProps extends Omit<ImageProps, 'style'> {
|
|
|
61
34
|
export interface AvatarFallbackProps extends ViewProps {
|
|
62
35
|
className?: string;
|
|
63
36
|
}
|
|
64
|
-
declare const Avatar:
|
|
37
|
+
declare const Avatar: ForwardRefComponent<ViewInstance, AvatarProps>;
|
|
65
38
|
declare function AvatarImage({ className, onLoadingStatusChange, ...props }: AvatarImageProps): React.JSX.Element;
|
|
66
39
|
declare namespace AvatarImage {
|
|
67
40
|
var displayName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React, { useMemo, useState } from 'react';
|
|
3
|
-
import { View, Image, Text } from 'react-native';
|
|
3
|
+
import { View, Image, Text, } from 'react-native';
|
|
4
4
|
import { cn } from '../../lib/cn';
|
|
5
5
|
import { tv } from '../../lib/tv';
|
|
6
6
|
import { useVisualTokens } from '../../lib/visual-tokens';
|