@mrmeg/expo-ui 0.7.3 → 0.9.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/LLM_USAGE.md +24 -13
- package/README.md +8 -10
- package/dist/components/Accordion.d.ts +4 -4
- package/dist/components/AnimatedView.d.ts +1 -1
- package/dist/components/Badge.d.ts +1 -1
- package/dist/components/BottomSheet.d.ts +7 -7
- package/dist/components/Button.d.ts +3 -3
- package/dist/components/Button.js +17 -1
- package/dist/components/Card.d.ts +6 -6
- package/dist/components/Checkbox.d.ts +2 -1
- package/dist/components/Collapsible.d.ts +4 -3
- package/dist/components/Dialog.d.ts +10 -10
- package/dist/components/DismissKeyboard.d.ts +1 -1
- package/dist/components/Drawer.d.ts +7 -7
- package/dist/components/DropdownMenu.d.ts +10 -10
- package/dist/components/EmptyState.d.ts +1 -1
- package/dist/components/ErrorBoundary.d.ts +1 -1
- package/dist/components/Icon.d.ts +1 -1
- package/dist/components/InputOTP.d.ts +2 -1
- package/dist/components/Label.d.ts +1 -1
- package/dist/components/MaxWidthContainer.d.ts +1 -1
- package/dist/components/Notification.d.ts +4 -10
- package/dist/components/Notification.js +12 -13
- package/dist/components/Popover.d.ts +4 -4
- package/dist/components/Progress.d.ts +2 -1
- package/dist/components/RadioGroup.d.ts +3 -2
- package/dist/components/SegmentedControl.d.ts +2 -1
- package/dist/components/Select.d.ts +7 -7
- package/dist/components/Separator.d.ts +2 -1
- package/dist/components/Skeleton.d.ts +5 -4
- package/dist/components/Slider.d.ts +2 -1
- package/dist/components/StatusBar.d.ts +1 -1
- package/dist/components/StyledText.d.ts +12 -12
- package/dist/components/Switch.d.ts +2 -1
- package/dist/components/Tabs.d.ts +5 -5
- package/dist/components/TextInput.d.ts +1 -1
- package/dist/components/TextInput.js +9 -1
- package/dist/components/Toggle.d.ts +3 -2
- package/dist/components/ToggleGroup.d.ts +4 -3
- package/dist/components/ToggleGroup.js +2 -7
- package/dist/components/Tooltip.d.ts +3 -3
- package/dist/components/UIProvider.d.ts +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/hooks/useTheme.js +28 -93
- package/dist/state/globalUIStore.d.ts +9 -1
- package/dist/state/globalUIStore.js +9 -1
- package/dist/state/index.d.ts +1 -0
- package/dist/state/index.js +1 -0
- package/dist/state/notify.d.ts +50 -0
- package/dist/state/notify.js +31 -0
- package/dist/state/themeColorScope.d.ts +1 -1
- package/llms-full.md +34 -3
- package/package.json +2 -2
|
@@ -8,6 +8,7 @@ import { useTheme } from "../hooks/useTheme.js";
|
|
|
8
8
|
import { useReducedMotion } from "../hooks/useReduceMotion.js";
|
|
9
9
|
import { spacing } from "../constants/spacing.js";
|
|
10
10
|
import { StyledText } from "./StyledText.js";
|
|
11
|
+
import { palette } from "../constants/colors.js";
|
|
11
12
|
import { translateText } from "../lib/i18n.js";
|
|
12
13
|
import { globalUIStore } from "../state/globalUIStore.js";
|
|
13
14
|
const timingIn = { duration: 150, easing: Easing.out(Easing.quad), useNativeDriver: true };
|
|
@@ -21,20 +22,13 @@ const timingOut = { duration: 100, easing: Easing.in(Easing.quad), useNativeDriv
|
|
|
21
22
|
* Usage:
|
|
22
23
|
* ```ts
|
|
23
24
|
* // Top notification (default)
|
|
24
|
-
*
|
|
25
|
-
* type: "success",
|
|
26
|
-
* title: "Saved",
|
|
25
|
+
* notify.success("Saved", {
|
|
27
26
|
* messages: ["Your changes have been saved."],
|
|
28
27
|
* duration: 3000,
|
|
29
28
|
* });
|
|
30
29
|
*
|
|
31
30
|
* // Bottom toast
|
|
32
|
-
*
|
|
33
|
-
* type: "info",
|
|
34
|
-
* title: "Copied to clipboard",
|
|
35
|
-
* duration: 2000,
|
|
36
|
-
* position: "bottom",
|
|
37
|
-
* });
|
|
31
|
+
* notify.info("Copied to clipboard", { duration: 2000, position: "bottom" });
|
|
38
32
|
* ```
|
|
39
33
|
*/
|
|
40
34
|
export const Notification = () => {
|
|
@@ -135,7 +129,10 @@ export const Notification = () => {
|
|
|
135
129
|
}
|
|
136
130
|
}
|
|
137
131
|
wasVisibleRef.current = isNowVisible;
|
|
138
|
-
|
|
132
|
+
// Schedule on every alert change, not just hidden→visible: a notification
|
|
133
|
+
// that replaces a visible one (e.g. loading → success) still needs its
|
|
134
|
+
// auto-dismiss timer. The cleanup below clears the previous alert's timer.
|
|
135
|
+
if (isNowVisible && alert?.duration) {
|
|
139
136
|
timerRef.current = setTimeout(() => {
|
|
140
137
|
onAutoDismiss();
|
|
141
138
|
}, alert.duration);
|
|
@@ -221,7 +218,7 @@ export const Notification = () => {
|
|
|
221
218
|
], children: _jsxs(View, { style: [
|
|
222
219
|
styles.alert,
|
|
223
220
|
isBottom && styles.alertBottom,
|
|
224
|
-
getShadowStyle("
|
|
221
|
+
getShadowStyle("elevated"),
|
|
225
222
|
], children: [_jsx(View, { style: [styles.iconBadge, { backgroundColor: iconBgColor }], children: alert?.loading ? (_jsx(ActivityIndicator, { size: "small", color: iconColor })) : (_jsx(Icon, { name: icon, size: 18, color: iconColor })) }), _jsxs(View, { style: styles.alertContent, children: [!!title && (_jsx(StyledText, { selectable: false, style: [styles.alertTitle, { color: theme.colors.foreground }], numberOfLines: 1, children: title })), hasMessage && (_jsx(StyledText, { selectable: false, style: [styles.alertDescription, { color: theme.colors.mutedForeground }], numberOfLines: 2, children: message }))] }), action && (_jsx(Pressable, { style: ({ pressed }) => [
|
|
226
223
|
styles.actionButton,
|
|
227
224
|
{
|
|
@@ -249,8 +246,10 @@ const createStyles = (theme) => StyleSheet.create({
|
|
|
249
246
|
paddingRight: spacing.xl + spacing.sm,
|
|
250
247
|
borderRadius: spacing.radiusLg,
|
|
251
248
|
borderWidth: 1,
|
|
252
|
-
|
|
253
|
-
|
|
249
|
+
// Shadows barely read on dark backgrounds, so dark mode separates the
|
|
250
|
+
// toast from the page by lifting the surface a step above `card` instead.
|
|
251
|
+
borderColor: theme.dark ? palette.dark600 : theme.colors.border,
|
|
252
|
+
backgroundColor: theme.dark ? palette.dark700 : theme.colors.card,
|
|
254
253
|
flexDirection: "row",
|
|
255
254
|
alignItems: "center",
|
|
256
255
|
gap: spacing.md,
|
|
@@ -25,7 +25,7 @@ interface PopoverContentProps extends PopoverPrimitive.ContentProps {
|
|
|
25
25
|
* The content that appears in the popover overlay
|
|
26
26
|
* Supports smart positioning, animations, and theme integration
|
|
27
27
|
*/
|
|
28
|
-
declare function PopoverContent({ side, align, sideOffset, portalHost, ...props }: PopoverContentProps):
|
|
28
|
+
declare function PopoverContent({ side, align, sideOffset, portalHost, ...props }: PopoverContentProps): React.JSX.Element;
|
|
29
29
|
/**
|
|
30
30
|
* Popover Header Component
|
|
31
31
|
* Optional header section for the popover content
|
|
@@ -33,7 +33,7 @@ declare function PopoverContent({ side, align, sideOffset, portalHost, ...props
|
|
|
33
33
|
interface PopoverHeaderProps extends ViewProps {
|
|
34
34
|
children: React.ReactNode;
|
|
35
35
|
}
|
|
36
|
-
declare function PopoverHeader({ children, style, ...props }: PopoverHeaderProps):
|
|
36
|
+
declare function PopoverHeader({ children, style, ...props }: PopoverHeaderProps): React.JSX.Element;
|
|
37
37
|
/**
|
|
38
38
|
* Popover Body Component
|
|
39
39
|
* Main content area of the popover
|
|
@@ -41,7 +41,7 @@ declare function PopoverHeader({ children, style, ...props }: PopoverHeaderProps
|
|
|
41
41
|
interface PopoverBodyProps extends ViewProps {
|
|
42
42
|
children: React.ReactNode;
|
|
43
43
|
}
|
|
44
|
-
declare function PopoverBody({ children, style, ...props }: PopoverBodyProps):
|
|
44
|
+
declare function PopoverBody({ children, style, ...props }: PopoverBodyProps): React.JSX.Element;
|
|
45
45
|
/**
|
|
46
46
|
* Popover Footer Component
|
|
47
47
|
* Optional footer section for the popover content
|
|
@@ -49,7 +49,7 @@ declare function PopoverBody({ children, style, ...props }: PopoverBodyProps): i
|
|
|
49
49
|
interface PopoverFooterProps extends ViewProps {
|
|
50
50
|
children: React.ReactNode;
|
|
51
51
|
}
|
|
52
|
-
declare function PopoverFooter({ children, style, ...props }: PopoverFooterProps):
|
|
52
|
+
declare function PopoverFooter({ children, style, ...props }: PopoverFooterProps): React.JSX.Element;
|
|
53
53
|
/**
|
|
54
54
|
* Popover Component with Sub-components
|
|
55
55
|
* Properly typed interface for dot notation access (e.g., Popover.Trigger)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
2
3
|
export type ProgressVariant = "default" | "accent" | "destructive";
|
|
3
4
|
export type ProgressSize = "sm" | "md" | "lg";
|
|
@@ -25,4 +26,4 @@ export interface ProgressProps {
|
|
|
25
26
|
* <Progress /> // indeterminate
|
|
26
27
|
* ```
|
|
27
28
|
*/
|
|
28
|
-
export declare function Progress({ value, variant, size, style, }: ProgressProps):
|
|
29
|
+
export declare function Progress({ value, variant, size, style, }: ProgressProps): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
2
3
|
import * as RadioGroupPrimitive from "@rn-primitives/radio-group";
|
|
3
4
|
/**
|
|
@@ -34,7 +35,7 @@ export interface RadioGroupProps extends Omit<RadioGroupPrimitive.RootProps, "st
|
|
|
34
35
|
* </RadioGroup>
|
|
35
36
|
* ```
|
|
36
37
|
*/
|
|
37
|
-
declare function RadioGroupRoot({ size, error, value, onValueChange, style: styleOverride, children, ...props }: RadioGroupProps):
|
|
38
|
+
declare function RadioGroupRoot({ size, error, value, onValueChange, style: styleOverride, children, ...props }: RadioGroupProps): React.JSX.Element;
|
|
38
39
|
export interface RadioGroupItemProps extends Omit<RadioGroupPrimitive.ItemProps, "style"> {
|
|
39
40
|
/**
|
|
40
41
|
* Optional label text displayed next to the radio button
|
|
@@ -58,7 +59,7 @@ export interface RadioGroupItemProps extends Omit<RadioGroupPrimitive.ItemProps,
|
|
|
58
59
|
* Individual radio button with optional label.
|
|
59
60
|
* Must be rendered inside a RadioGroup.
|
|
60
61
|
*/
|
|
61
|
-
declare function RadioGroupItem({ label, required, style: styleOverride, labelStyle, value: itemValue, disabled, ...props }: RadioGroupItemProps):
|
|
62
|
+
declare function RadioGroupItem({ label, required, style: styleOverride, labelStyle, value: itemValue, disabled, ...props }: RadioGroupItemProps): React.JSX.Element;
|
|
62
63
|
declare const RadioGroupComponent: typeof RadioGroupRoot & {
|
|
63
64
|
Item: typeof RadioGroupItem;
|
|
64
65
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { type StyleProp, type ViewStyle } from "react-native";
|
|
2
3
|
/**
|
|
3
4
|
* SegmentedControl — a horizontal single-select control backed by the
|
|
@@ -48,5 +49,5 @@ export interface SegmentedControlProps {
|
|
|
48
49
|
/** Style override for the control. */
|
|
49
50
|
style?: StyleProp<ViewStyle>;
|
|
50
51
|
}
|
|
51
|
-
declare function SegmentedControl({ values, value: controlledValue, defaultValue, onValueChange, disabled, tintColor, appearance, style, }: SegmentedControlProps):
|
|
52
|
+
declare function SegmentedControl({ values, value: controlledValue, defaultValue, onValueChange, disabled, tintColor, appearance, style, }: SegmentedControlProps): React.JSX.Element;
|
|
52
53
|
export { SegmentedControl };
|
|
@@ -14,7 +14,7 @@ type SelectTriggerProps = SelectPrimitive.TriggerProps & {
|
|
|
14
14
|
size?: SelectSize;
|
|
15
15
|
error?: boolean;
|
|
16
16
|
};
|
|
17
|
-
declare function SelectTrigger({ size, error, children, style: styleOverride, disabled, ...props }: SelectTriggerProps):
|
|
17
|
+
declare function SelectTrigger({ size, error, children, style: styleOverride, disabled, ...props }: SelectTriggerProps): React.JSX.Element;
|
|
18
18
|
/**
|
|
19
19
|
* SelectValue Component
|
|
20
20
|
* Displays the selected value text or placeholder
|
|
@@ -22,7 +22,7 @@ declare function SelectTrigger({ size, error, children, style: styleOverride, di
|
|
|
22
22
|
type SelectValueProps = SelectPrimitive.ValueProps & {
|
|
23
23
|
size?: SelectSize;
|
|
24
24
|
};
|
|
25
|
-
declare function SelectValue({ size, placeholder, style: styleOverride, ...props }: SelectValueProps):
|
|
25
|
+
declare function SelectValue({ size, placeholder, style: styleOverride, ...props }: SelectValueProps): React.JSX.Element;
|
|
26
26
|
/**
|
|
27
27
|
* SelectContent Component
|
|
28
28
|
* Dropdown overlay following the DropdownMenu.Content pattern
|
|
@@ -31,32 +31,32 @@ declare function SelectValue({ size, placeholder, style: styleOverride, ...props
|
|
|
31
31
|
type SelectContentProps = SelectPrimitive.ContentProps & {
|
|
32
32
|
portalHost?: string;
|
|
33
33
|
};
|
|
34
|
-
declare function SelectContent({ side, align, sideOffset, portalHost, style: styleOverride, ...props }: SelectContentProps):
|
|
34
|
+
declare function SelectContent({ side, align, sideOffset, portalHost, style: styleOverride, ...props }: SelectContentProps): React.JSX.Element;
|
|
35
35
|
/**
|
|
36
36
|
* SelectItem Component
|
|
37
37
|
* Individual option in the select dropdown
|
|
38
38
|
* Shows a check icon on the left when selected
|
|
39
39
|
*/
|
|
40
40
|
type SelectItemProps = SelectPrimitive.ItemProps;
|
|
41
|
-
declare function SelectItem({ children, style: styleOverride, ...props }: SelectItemProps):
|
|
41
|
+
declare function SelectItem({ children, style: styleOverride, ...props }: SelectItemProps): React.JSX.Element;
|
|
42
42
|
/**
|
|
43
43
|
* SelectGroup Component
|
|
44
44
|
* Groups related select items together
|
|
45
45
|
*/
|
|
46
46
|
type SelectGroupProps = SelectPrimitive.GroupProps;
|
|
47
|
-
declare function SelectGroup({ style: styleOverride, ...props }: SelectGroupProps):
|
|
47
|
+
declare function SelectGroup({ style: styleOverride, ...props }: SelectGroupProps): React.JSX.Element;
|
|
48
48
|
/**
|
|
49
49
|
* SelectLabel Component
|
|
50
50
|
* Label for a group of select items
|
|
51
51
|
*/
|
|
52
52
|
type SelectLabelProps = SelectPrimitive.LabelProps;
|
|
53
|
-
declare function SelectLabel({ style: styleOverride, ...props }: SelectLabelProps):
|
|
53
|
+
declare function SelectLabel({ style: styleOverride, ...props }: SelectLabelProps): React.JSX.Element;
|
|
54
54
|
/**
|
|
55
55
|
* SelectSeparator Component
|
|
56
56
|
* Visual divider between select item groups
|
|
57
57
|
*/
|
|
58
58
|
type SelectSeparatorProps = SelectPrimitive.SeparatorProps;
|
|
59
|
-
declare function SelectSeparator({ style: styleOverride, ...props }: SelectSeparatorProps):
|
|
59
|
+
declare function SelectSeparator({ style: styleOverride, ...props }: SelectSeparatorProps): React.JSX.Element;
|
|
60
60
|
/**
|
|
61
61
|
* Select Component with Sub-components
|
|
62
62
|
* Properly typed interface for dot notation access (e.g., Select.Trigger)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
2
3
|
import * as SeparatorPrimitive from "@rn-primitives/separator";
|
|
3
4
|
/**
|
|
@@ -79,5 +80,5 @@ export interface SeparatorProps extends Omit<SeparatorPrimitive.RootProps, "styl
|
|
|
79
80
|
* <Separator style={{ opacity: 0.5 }} />
|
|
80
81
|
* ```
|
|
81
82
|
*/
|
|
82
|
-
declare function Separator({ orientation, decorative, size, variant, style: styleOverride, margin, ...props }: SeparatorProps):
|
|
83
|
+
declare function Separator({ orientation, decorative, size, variant, style: styleOverride, margin, ...props }: SeparatorProps): React.JSX.Element;
|
|
83
84
|
export { Separator };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
2
3
|
export interface SkeletonProps {
|
|
3
4
|
/** Width of the skeleton element */
|
|
@@ -23,7 +24,7 @@ export interface SkeletonProps {
|
|
|
23
24
|
* <Skeleton width={40} height={40} circle />
|
|
24
25
|
* ```
|
|
25
26
|
*/
|
|
26
|
-
export declare function Skeleton({ width, height, borderRadius, circle, style, }: SkeletonProps):
|
|
27
|
+
export declare function Skeleton({ width, height, borderRadius, circle, style, }: SkeletonProps): React.JSX.Element;
|
|
27
28
|
export interface SkeletonTextProps {
|
|
28
29
|
/** Number of text lines to render */
|
|
29
30
|
lines?: number;
|
|
@@ -38,7 +39,7 @@ export interface SkeletonTextProps {
|
|
|
38
39
|
* SkeletonText renders N horizontal bars simulating text.
|
|
39
40
|
* The last line is rendered at 60% width for a natural look.
|
|
40
41
|
*/
|
|
41
|
-
export declare function SkeletonText({ lines, lineHeight, gap, style, }: SkeletonTextProps):
|
|
42
|
+
export declare function SkeletonText({ lines, lineHeight, gap, style, }: SkeletonTextProps): React.JSX.Element;
|
|
42
43
|
export interface SkeletonAvatarProps {
|
|
43
44
|
/** Diameter of the circular avatar placeholder */
|
|
44
45
|
size?: number;
|
|
@@ -48,7 +49,7 @@ export interface SkeletonAvatarProps {
|
|
|
48
49
|
/**
|
|
49
50
|
* SkeletonAvatar is a circular skeleton shorthand.
|
|
50
51
|
*/
|
|
51
|
-
export declare function SkeletonAvatar({ size, style }: SkeletonAvatarProps):
|
|
52
|
+
export declare function SkeletonAvatar({ size, style }: SkeletonAvatarProps): React.JSX.Element;
|
|
52
53
|
export interface SkeletonCardProps {
|
|
53
54
|
/** Whether to show an image placeholder area */
|
|
54
55
|
showImage?: boolean;
|
|
@@ -65,4 +66,4 @@ export interface SkeletonCardProps {
|
|
|
65
66
|
* SkeletonCard composes an image placeholder, optional avatar row,
|
|
66
67
|
* and text lines in a Card-styled wrapper.
|
|
67
68
|
*/
|
|
68
|
-
export declare function SkeletonCard({ showImage, imageHeight, showAvatar, textLines, style, }: SkeletonCardProps):
|
|
69
|
+
export declare function SkeletonCard({ showImage, imageHeight, showAvatar, textLines, style, }: SkeletonCardProps): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
2
3
|
/**
|
|
3
4
|
* Slider — a themed range input backed by the platform's native slider via
|
|
@@ -40,5 +41,5 @@ export interface SliderProps {
|
|
|
40
41
|
/** Style override for outer container */
|
|
41
42
|
style?: StyleProp<ViewStyle>;
|
|
42
43
|
}
|
|
43
|
-
declare function Slider({ value, onValueChange, min, max, step, size: _size, disabled, showValue, style: styleOverride, }: SliderProps):
|
|
44
|
+
declare function Slider({ value, onValueChange, min, max, step, size: _size, disabled, showValue, style: styleOverride, }: SliderProps): React.JSX.Element;
|
|
44
45
|
export { Slider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const StatusBar: () => import("react
|
|
1
|
+
export declare const StatusBar: () => import("react").JSX.Element;
|
|
@@ -69,53 +69,53 @@ export type TextProps = RNTextProps & {
|
|
|
69
69
|
* chrome such as button labels, tabs, badges, and field labels
|
|
70
70
|
* - numberOfLines and ellipsizeMode support from RN TextProps
|
|
71
71
|
*/
|
|
72
|
-
export declare function StyledText(props: TextProps): import("react
|
|
72
|
+
export declare function StyledText(props: TextProps): import("react").JSX.Element;
|
|
73
73
|
/**
|
|
74
74
|
* Serif Text Component
|
|
75
75
|
* Uses serif font family (DM Serif Display)
|
|
76
76
|
*/
|
|
77
|
-
export declare function SerifText(props: TextProps): import("react
|
|
77
|
+
export declare function SerifText(props: TextProps): import("react").JSX.Element;
|
|
78
78
|
/**
|
|
79
79
|
* Sans-Serif Text Component
|
|
80
80
|
* Uses sans-serif font family (DM Sans)
|
|
81
81
|
*/
|
|
82
|
-
export declare function SansSerifText(props: TextProps): import("react
|
|
82
|
+
export declare function SansSerifText(props: TextProps): import("react").JSX.Element;
|
|
83
83
|
/**
|
|
84
84
|
* Serif Bold Text Component
|
|
85
85
|
* Uses serif font family — DM Serif Display only has regular weight
|
|
86
86
|
*/
|
|
87
|
-
export declare function SerifBoldText(props: TextProps): import("react
|
|
87
|
+
export declare function SerifBoldText(props: TextProps): import("react").JSX.Element;
|
|
88
88
|
/**
|
|
89
89
|
* Sans-Serif Bold Text Component
|
|
90
90
|
* Uses sans-serif font family with semibold weight (DM Sans 600)
|
|
91
91
|
*/
|
|
92
|
-
export declare function SansSerifBoldText(props: TextProps): import("react
|
|
92
|
+
export declare function SansSerifBoldText(props: TextProps): import("react").JSX.Element;
|
|
93
93
|
/**
|
|
94
94
|
* Display Text Component
|
|
95
95
|
* Uses DM Serif Display at display size — for hero text and splash screens
|
|
96
96
|
*/
|
|
97
|
-
export declare function DisplayText(props: TextProps): import("react
|
|
97
|
+
export declare function DisplayText(props: TextProps): import("react").JSX.Element;
|
|
98
98
|
/**
|
|
99
99
|
* Title Text - Large semibold text for page titles
|
|
100
100
|
*/
|
|
101
|
-
export declare function TitleText(props: TextProps): import("react
|
|
101
|
+
export declare function TitleText(props: TextProps): import("react").JSX.Element;
|
|
102
102
|
/**
|
|
103
103
|
* Heading Text - Section heading text
|
|
104
104
|
*/
|
|
105
|
-
export declare function HeadingText(props: TextProps): import("react
|
|
105
|
+
export declare function HeadingText(props: TextProps): import("react").JSX.Element;
|
|
106
106
|
/**
|
|
107
107
|
* Subheading Text - Subsection heading text
|
|
108
108
|
*/
|
|
109
|
-
export declare function SubheadingText(props: TextProps): import("react
|
|
109
|
+
export declare function SubheadingText(props: TextProps): import("react").JSX.Element;
|
|
110
110
|
/**
|
|
111
111
|
* Body Text - Default text for paragraphs and content
|
|
112
112
|
*/
|
|
113
|
-
export declare function BodyText(props: TextProps): import("react
|
|
113
|
+
export declare function BodyText(props: TextProps): import("react").JSX.Element;
|
|
114
114
|
/**
|
|
115
115
|
* Caption Text - Small text for captions and secondary content
|
|
116
116
|
*/
|
|
117
|
-
export declare function CaptionText(props: TextProps): import("react
|
|
117
|
+
export declare function CaptionText(props: TextProps): import("react").JSX.Element;
|
|
118
118
|
/**
|
|
119
119
|
* Label Text - Medium weight text for form labels
|
|
120
120
|
*/
|
|
121
|
-
export declare function LabelText(props: TextProps): import("react
|
|
121
|
+
export declare function LabelText(props: TextProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as SwitchPrimitives from "@rn-primitives/switch";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { StyleProp, ViewStyle } from "react-native";
|
|
3
4
|
/**
|
|
4
5
|
* Switch variant styles
|
|
@@ -40,5 +41,5 @@ interface SwitchProps extends Omit<SwitchPrimitives.RootProps, "style"> {
|
|
|
40
41
|
*/
|
|
41
42
|
style?: StyleProp<ViewStyle>;
|
|
42
43
|
}
|
|
43
|
-
declare function Switch({ variant, labelOn, labelOff, size, thumbSize, loading, style: styleOverride, ...props }: SwitchProps):
|
|
44
|
+
declare function Switch({ variant, labelOn, labelOff, size, thumbSize, loading, style: styleOverride, ...props }: SwitchProps): React.JSX.Element;
|
|
44
45
|
export { Switch };
|
|
@@ -9,16 +9,16 @@ export interface TabsProps extends TabsPrimitive.RootProps {
|
|
|
9
9
|
variant?: TabsVariant;
|
|
10
10
|
size?: TabsSize;
|
|
11
11
|
}
|
|
12
|
-
declare function TabsRoot({ variant, size, children, ...props }: TabsProps):
|
|
12
|
+
declare function TabsRoot({ variant, size, children, ...props }: TabsProps): React.JSX.Element;
|
|
13
13
|
export interface TabsListProps extends TabsPrimitive.ListProps {
|
|
14
14
|
style?: StyleProp<ViewStyle>;
|
|
15
15
|
}
|
|
16
|
-
declare function TabsList({ style, children, ...props }: TabsListProps):
|
|
16
|
+
declare function TabsList({ style, children, ...props }: TabsListProps): React.JSX.Element;
|
|
17
17
|
export interface TabsTriggerProps extends TabsPrimitive.TriggerProps {
|
|
18
18
|
icon?: IconName;
|
|
19
19
|
style?: StyleProp<ViewStyle>;
|
|
20
20
|
}
|
|
21
|
-
declare function TabsTriggerInner({ icon, style, children, value, ...props }: TabsTriggerProps):
|
|
21
|
+
declare function TabsTriggerInner({ icon, style, children, value, ...props }: TabsTriggerProps): React.JSX.Element;
|
|
22
22
|
/**
|
|
23
23
|
* TabsTrigger.Text
|
|
24
24
|
* Label text for a TabsTrigger. Reads the tab size from context and applies the
|
|
@@ -32,11 +32,11 @@ declare function TabsTriggerInner({ icon, style, children, value, ...props }: Ta
|
|
|
32
32
|
* </Tabs.Trigger>
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
declare function TabsTriggerText({ style, numberOfLines, ...props }: React.ComponentProps<typeof StyledText>):
|
|
35
|
+
declare function TabsTriggerText({ style, numberOfLines, ...props }: React.ComponentProps<typeof StyledText>): React.JSX.Element;
|
|
36
36
|
export interface TabsContentProps extends TabsPrimitive.ContentProps {
|
|
37
37
|
style?: StyleProp<ViewStyle>;
|
|
38
38
|
}
|
|
39
|
-
declare function TabsContent({ style, children, ...props }: TabsContentProps):
|
|
39
|
+
declare function TabsContent({ style, children, ...props }: TabsContentProps): React.JSX.Element;
|
|
40
40
|
declare const TabsTriggerCompound: typeof TabsTriggerInner & {
|
|
41
41
|
Text: typeof TabsTriggerText;
|
|
42
42
|
};
|
|
@@ -120,5 +120,5 @@ interface TextInputCustomProps extends TextInputProps {
|
|
|
120
120
|
* />
|
|
121
121
|
* ```
|
|
122
122
|
*/
|
|
123
|
-
export declare function TextInput(props: TextInputCustomProps): import("react
|
|
123
|
+
export declare function TextInput(props: TextInputCustomProps): import("react").JSX.Element;
|
|
124
124
|
export {};
|
|
@@ -255,10 +255,18 @@ leftElement, rightElement, clearable, focusedStyle, style, ...rest }) {
|
|
|
255
255
|
opacity: editable === false ? 0.6 : 1,
|
|
256
256
|
...(multiline ? null : { height: sizeConfig.height }),
|
|
257
257
|
};
|
|
258
|
+
// "System" is an RN-only sentinel (RCTFont resolves it to the system font).
|
|
259
|
+
// @expo/ui passes the family verbatim to SwiftUI's Font.custom / Compose,
|
|
260
|
+
// where no such font exists — the fallback ignores fontSize and renders at
|
|
261
|
+
// the 17pt default, blowing up text and secure-entry dots. Omit the family
|
|
262
|
+
// so the native side uses the system font at our requested size.
|
|
263
|
+
const nativeFontFamily = fontFamilies.sansSerif.regular === "System"
|
|
264
|
+
? undefined
|
|
265
|
+
: fontFamilies.sansSerif.regular;
|
|
258
266
|
const textStyle = {
|
|
259
267
|
color: textColor,
|
|
260
268
|
fontSize: sizeConfig.fontSize,
|
|
261
|
-
fontFamily:
|
|
269
|
+
...(nativeFontFamily ? { fontFamily: nativeFontFamily } : null),
|
|
262
270
|
};
|
|
263
271
|
return (_jsxs(View, { style: wrapperStyle, children: [!!label && (_jsx(View, { style: styles.labelContainer, children: _jsxs(StyledText, { selectable: false, style: styles.label, children: [label, required && _jsx(StyledText, { selectable: false, style: styles.required, children: " *" })] }) })), _jsxs(View, { style: hasSecureToggle ? styles.nativeRow : undefined, children: [_jsx(Host, { matchContents: { vertical: true }, style: hasSecureToggle ? styles.nativeHostFlex : styles.nativeHost, children: _jsx(ExpoTextInput, { ...rest, ref: innerRef, value: state, defaultValue: defaultValue, onChangeText: onChangeText, editable: editable, multiline: multiline, rows: rows, inputMode: inputMode, secureTextEntry: effectiveSecureTextEntry, placeholderTextColor: theme.colors.textDim, style: boxStyle, textStyle: textStyle }) }), hasSecureToggle && (_jsx(Pressable, { style: styles.nativePasswordToggle, onPress: () => setPasswordVisible((v) => !v), accessibilityLabel: passwordVisible ? "Hide password" : "Show password", accessibilityRole: "button", children: _jsx(Icon, { name: passwordVisible ? "eye-off" : "eye", size: spacing.iconSm + 4, color: "textDim" }) }))] }), !!(helperText || errorText) && (_jsx(StyledText, { selectable: false, style: [styles.helperText, hasError && styles.errorText], children: errorText || helperText }))] }));
|
|
264
272
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import * as TogglePrimitive from "@rn-primitives/toggle";
|
|
2
3
|
import { ViewStyle, StyleProp } from "react-native";
|
|
3
4
|
import type { IconName } from "./Icon";
|
|
@@ -83,7 +84,7 @@ interface ToggleProps extends Omit<TogglePrimitive.RootProps, "style"> {
|
|
|
83
84
|
* </Toggle>
|
|
84
85
|
* ```
|
|
85
86
|
*/
|
|
86
|
-
declare function Toggle({ variant, size, shape, loading, iconOnly, style: styleOverride, ...props }: ToggleProps):
|
|
87
|
+
declare function Toggle({ variant, size, shape, loading, iconOnly, style: styleOverride, ...props }: ToggleProps): React.JSX.Element;
|
|
87
88
|
/**
|
|
88
89
|
* ToggleIcon Component
|
|
89
90
|
* Icon wrapper for use inside Toggle buttons
|
|
@@ -101,6 +102,6 @@ interface ToggleIconProps {
|
|
|
101
102
|
size?: number;
|
|
102
103
|
color?: string;
|
|
103
104
|
}
|
|
104
|
-
declare function ToggleIcon({ name, size, color }: ToggleIconProps):
|
|
105
|
+
declare function ToggleIcon({ name, size, color }: ToggleIconProps): React.JSX.Element;
|
|
105
106
|
export { Toggle, ToggleIcon };
|
|
106
107
|
export type { ToggleProps };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IconName } from "./Icon";
|
|
2
2
|
import * as ToggleGroupPrimitive from "@rn-primitives/toggle-group";
|
|
3
|
+
import * as React from "react";
|
|
3
4
|
type ToggleGroupVariant = "default" | "outline";
|
|
4
5
|
type ToggleGroupSize = "sm" | "default" | "lg";
|
|
5
6
|
type ToggleGroupProps = ToggleGroupPrimitive.RootProps & {
|
|
@@ -41,7 +42,7 @@ type ToggleGroupProps = ToggleGroupPrimitive.RootProps & {
|
|
|
41
42
|
* </ToggleGroup>
|
|
42
43
|
* ```
|
|
43
44
|
*/
|
|
44
|
-
declare function ToggleGroup({ variant, size, children, ...props }: ToggleGroupProps):
|
|
45
|
+
declare function ToggleGroup({ variant, size, children, ...props }: ToggleGroupProps): React.JSX.Element;
|
|
45
46
|
type ToggleGroupItemProps = ToggleGroupPrimitive.ItemProps & {
|
|
46
47
|
/**
|
|
47
48
|
* Automatically set by ToggleGroup parent - don't set manually
|
|
@@ -57,7 +58,7 @@ type ToggleGroupItemProps = ToggleGroupPrimitive.ItemProps & {
|
|
|
57
58
|
* Individual toggle button within a ToggleGroup
|
|
58
59
|
* Position (first/last) is automatically detected for rounded corners
|
|
59
60
|
*/
|
|
60
|
-
declare function ToggleGroupItem({ isFirst, isLast, children, ...props }: ToggleGroupItemProps):
|
|
61
|
+
declare function ToggleGroupItem({ isFirst, isLast, children, ...props }: ToggleGroupItemProps): React.JSX.Element;
|
|
61
62
|
/**
|
|
62
63
|
* ToggleGroupIcon Component
|
|
63
64
|
* Icon wrapper for use inside ToggleGroup items
|
|
@@ -75,6 +76,6 @@ interface ToggleGroupIconProps {
|
|
|
75
76
|
size?: number;
|
|
76
77
|
color?: string;
|
|
77
78
|
}
|
|
78
|
-
declare function ToggleGroupIcon({ name, size, color }: ToggleGroupIconProps):
|
|
79
|
+
declare function ToggleGroupIcon({ name, size, color }: ToggleGroupIconProps): React.JSX.Element;
|
|
79
80
|
export { ToggleGroup, ToggleGroupIcon, ToggleGroupItem };
|
|
80
81
|
export type { ToggleGroupProps, ToggleGroupSize, ToggleGroupVariant };
|
|
@@ -64,7 +64,7 @@ function useToggleGroupContext() {
|
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
66
|
function ToggleGroup({ variant = "default", size = "default", children, ...props }) {
|
|
67
|
-
const {
|
|
67
|
+
const { getShadowStyle } = useTheme();
|
|
68
68
|
const contextValue = React.useMemo(() => ({ variant, size }), [variant, size]);
|
|
69
69
|
// Count valid children for first/last detection
|
|
70
70
|
const childrenArray = React.Children.toArray(children);
|
|
@@ -89,12 +89,7 @@ function ToggleGroup({ variant = "default", size = "default", children, ...props
|
|
|
89
89
|
alignItems: "center",
|
|
90
90
|
borderRadius: spacing.radiusMd,
|
|
91
91
|
// No shadow on Android - causes text background artifact
|
|
92
|
-
...(variant === "outline" && Platform.OS === "ios" &&
|
|
93
|
-
shadowColor: theme.colors.overlay,
|
|
94
|
-
shadowOffset: { width: 0, height: 1 },
|
|
95
|
-
shadowOpacity: 0.05,
|
|
96
|
-
shadowRadius: 2,
|
|
97
|
-
}),
|
|
92
|
+
...(variant === "outline" && Platform.OS === "ios" && getShadowStyle("subtle")),
|
|
98
93
|
...(Platform.OS === "web" && {
|
|
99
94
|
width: "fit-content",
|
|
100
95
|
}),
|
|
@@ -41,7 +41,7 @@ interface TooltipContentProps extends TooltipPrimitive.ContentProps {
|
|
|
41
41
|
* - Smooth animations
|
|
42
42
|
* - Portal-based rendering for proper z-index
|
|
43
43
|
*/
|
|
44
|
-
declare function TooltipContent({ side, align, sideOffset, portalHost, variant, ...props }: TooltipContentProps):
|
|
44
|
+
declare function TooltipContent({ side, align, sideOffset, portalHost, variant, ...props }: TooltipContentProps): React.JSX.Element;
|
|
45
45
|
/**
|
|
46
46
|
* Tooltip Body Component
|
|
47
47
|
* Simple wrapper for tooltip content with padding
|
|
@@ -49,7 +49,7 @@ declare function TooltipContent({ side, align, sideOffset, portalHost, variant,
|
|
|
49
49
|
interface TooltipBodyProps extends ViewProps {
|
|
50
50
|
children: React.ReactNode;
|
|
51
51
|
}
|
|
52
|
-
declare function TooltipBody({ children, style, ...props }: TooltipBodyProps):
|
|
52
|
+
declare function TooltipBody({ children, style, ...props }: TooltipBodyProps): React.JSX.Element;
|
|
53
53
|
interface TooltipProps extends TooltipPrimitive.RootProps {
|
|
54
54
|
/**
|
|
55
55
|
* Time to wait before showing tooltip (web only)
|
|
@@ -99,7 +99,7 @@ interface TooltipProps extends TooltipPrimitive.RootProps {
|
|
|
99
99
|
* </Tooltip>
|
|
100
100
|
* ```
|
|
101
101
|
*/
|
|
102
|
-
declare function Tooltip({ delayDuration, skipDelayDuration, ...props }: TooltipProps):
|
|
102
|
+
declare function Tooltip({ delayDuration, skipDelayDuration, ...props }: TooltipProps): React.JSX.Element;
|
|
103
103
|
/**
|
|
104
104
|
* Tooltip Component with Sub-components
|
|
105
105
|
* Properly typed interface for dot notation access (e.g., Tooltip.Trigger)
|
|
@@ -20,4 +20,4 @@ export interface UIProviderProps {
|
|
|
20
20
|
*/
|
|
21
21
|
statusBar?: boolean;
|
|
22
22
|
}
|
|
23
|
-
export declare function UIProvider({ children, notification, portalHost, statusBar, }: UIProviderProps):
|
|
23
|
+
export declare function UIProvider({ children, notification, portalHost, statusBar, }: UIProviderProps): React.JSX.Element;
|
package/dist/hooks/useTheme.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ interface ExtendedColorScheme {
|
|
|
32
32
|
* - getTextColorForBackground("#000") → "light"
|
|
33
33
|
* - getContrastingColor("#f4f4f4", "#222", "#fff") → "#222"
|
|
34
34
|
* - withAlpha("#336699", 0.6) → "rgba(51,102,153,0.6)"
|
|
35
|
-
* - getShadowStyle('base') → {
|
|
35
|
+
* - getShadowStyle('base') → { boxShadow: "0px 1px 3px rgba(0, 0, 0, 0.1)" }
|
|
36
36
|
*/
|
|
37
37
|
export declare function useTheme(): ExtendedColorScheme & {
|
|
38
38
|
toggleTheme: () => void;
|