@platform-blocks/ui 0.6.1 → 0.7.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/README.md +0 -24
- package/lib/cjs/index.js +54 -18
- package/lib/cjs/index.js.map +1 -1
- package/lib/components/Accordion/types.d.ts +5 -5
- package/lib/components/AutoComplete/types.d.ts +3 -3
- package/lib/components/Avatar/types.d.ts +3 -3
- package/lib/components/Badge/types.d.ts +3 -3
- package/lib/components/Block/types.d.ts +2 -2
- package/lib/components/Blockquote/types.d.ts +2 -2
- package/lib/components/Breadcrumbs/types.d.ts +4 -4
- package/lib/components/Calendar/types.d.ts +2 -2
- package/lib/components/Carousel/types.d.ts +3 -3
- package/lib/components/Chip/types.d.ts +3 -3
- package/lib/components/CodeBlock/types.d.ts +4 -4
- package/lib/components/ColorPicker/types.d.ts +4 -4
- package/lib/components/CopyButton/types.d.ts +2 -2
- package/lib/components/DatePicker/types.d.ts +2 -2
- package/lib/components/Divider/types.d.ts +2 -2
- package/lib/components/Grid/types.d.ts +3 -3
- package/lib/components/HoverCard/types.d.ts +2 -2
- package/lib/components/Image/types.d.ts +3 -3
- package/lib/components/Indicator/types.d.ts +2 -2
- package/lib/components/Knob/components/SurfaceLayers.d.ts +2 -2
- package/lib/components/Knob/components/ThumbLayer.d.ts +1 -1
- package/lib/components/Knob/components/TickLayers.d.ts +2 -2
- package/lib/components/Knob/types.d.ts +11 -11
- package/lib/components/ListGroup/types.d.ts +4 -4
- package/lib/components/Loader/types.d.ts +2 -2
- package/lib/components/Masonry/types.d.ts +4 -4
- package/lib/components/Navigation/types.d.ts +2 -2
- package/lib/components/Notice/types.d.ts +2 -2
- package/lib/components/Pagination/types.d.ts +6 -6
- package/lib/components/Progress/types.d.ts +3 -3
- package/lib/components/QRCode/types.d.ts +2 -2
- package/lib/components/Rating/types.d.ts +2 -2
- package/lib/components/Ring/types.d.ts +7 -7
- package/lib/components/SegmentedControl/types.d.ts +4 -4
- package/lib/components/Skeleton/types.d.ts +2 -2
- package/lib/components/Slider/types.d.ts +7 -7
- package/lib/components/Spotlight/types.d.ts +6 -6
- package/lib/components/Tabs/types.d.ts +5 -5
- package/lib/components/Toast/types.d.ts +2 -2
- package/lib/components/Tooltip/types.d.ts +2 -2
- package/lib/components/Video/NativeVideoPlayer.d.ts +2 -2
- package/lib/components/Video/VideoControls.d.ts +2 -2
- package/lib/components/Video/YouTubePlayer.d.ts +2 -2
- package/lib/components/Video/types.d.ts +4 -4
- package/lib/esm/index.js +54 -18
- package/lib/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ViewStyle } from 'react-native';
|
|
1
|
+
import { ViewStyle, StyleProp } from 'react-native';
|
|
2
2
|
import { SpacingProps, LayoutProps } from '../../core/utils';
|
|
3
3
|
export interface QRCodeProps extends SpacingProps, LayoutProps {
|
|
4
4
|
/** The data/text to encode in the QR code */
|
|
@@ -46,7 +46,7 @@ export interface QRCodeProps extends SpacingProps, LayoutProps {
|
|
|
46
46
|
borderRadius?: number;
|
|
47
47
|
};
|
|
48
48
|
/** Custom container style */
|
|
49
|
-
style?: ViewStyle
|
|
49
|
+
style?: StyleProp<ViewStyle>;
|
|
50
50
|
/** Test ID for testing */
|
|
51
51
|
testID?: string;
|
|
52
52
|
/** Accessibility label */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { View, ViewStyle } from 'react-native';
|
|
1
|
+
import { View, ViewStyle, StyleProp } from 'react-native';
|
|
2
2
|
import { SpacingProps } from '../../core/utils';
|
|
3
3
|
import { SizeValue } from '../../core/theme/sizes';
|
|
4
4
|
import type { DisclaimerSupport } from '../_internal/Disclaimer';
|
|
@@ -22,7 +22,7 @@ export interface RatingProps extends SpacingProps, DisclaimerSupport {
|
|
|
22
22
|
character?: string | React.ReactNode;
|
|
23
23
|
emptyCharacter?: string | React.ReactNode;
|
|
24
24
|
gap?: SizeValue | number;
|
|
25
|
-
style?: ViewStyle
|
|
25
|
+
style?: StyleProp<ViewStyle>;
|
|
26
26
|
testID?: string;
|
|
27
27
|
accessibilityLabel?: string;
|
|
28
28
|
accessibilityHint?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ViewStyle, TextStyle } from 'react-native';
|
|
2
|
+
import { ViewStyle, TextStyle, StyleProp } from 'react-native';
|
|
3
3
|
import { SpacingProps } from '../../core/utils';
|
|
4
4
|
export interface RingColorStop {
|
|
5
5
|
/** Threshold (0-100) that determines when the color becomes active */
|
|
@@ -49,17 +49,17 @@ export interface RingProps extends SpacingProps {
|
|
|
49
49
|
/** Controls whether the progress stroke has rounded caps. Defaults to true. */
|
|
50
50
|
roundedCaps?: boolean;
|
|
51
51
|
/** Container style for the outer wrapper */
|
|
52
|
-
style?: ViewStyle
|
|
52
|
+
style?: StyleProp<ViewStyle>;
|
|
53
53
|
/** Style applied to the ring wrapper */
|
|
54
|
-
ringStyle?: ViewStyle
|
|
54
|
+
ringStyle?: StyleProp<ViewStyle>;
|
|
55
55
|
/** Style applied to the center content container */
|
|
56
|
-
contentStyle?: ViewStyle
|
|
56
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
57
57
|
/** Style overrides for the main label */
|
|
58
|
-
labelStyle?: TextStyle
|
|
58
|
+
labelStyle?: StyleProp<TextStyle>;
|
|
59
59
|
/** Style overrides for the secondary label */
|
|
60
|
-
subLabelStyle?: TextStyle
|
|
60
|
+
subLabelStyle?: StyleProp<TextStyle>;
|
|
61
61
|
/** Style overrides for the caption */
|
|
62
|
-
captionStyle?: TextStyle
|
|
62
|
+
captionStyle?: StyleProp<TextStyle>;
|
|
63
63
|
/** Color override for the main label */
|
|
64
64
|
labelColor?: string;
|
|
65
65
|
/** Color override for the secondary label */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { ViewStyle } from 'react-native';
|
|
2
|
+
import type { ViewStyle, StyleProp } from 'react-native';
|
|
3
3
|
import type { SpacingProps, LayoutProps } from '../../core/utils';
|
|
4
4
|
import type { BorderRadiusProps } from '../../core/theme/radius';
|
|
5
5
|
import type { SizeValue } from '../../core/theme/sizes';
|
|
@@ -50,11 +50,11 @@ export interface SegmentedControlProps extends SpacingProps, LayoutProps, Border
|
|
|
50
50
|
/** Visual style variant */
|
|
51
51
|
variant?: 'default' | 'filled' | 'outline' | 'ghost';
|
|
52
52
|
/** Custom style for indicator */
|
|
53
|
-
indicatorStyle?: ViewStyle
|
|
53
|
+
indicatorStyle?: StyleProp<ViewStyle>;
|
|
54
54
|
/** Custom style applied to every item */
|
|
55
|
-
itemStyle?: ViewStyle
|
|
55
|
+
itemStyle?: StyleProp<ViewStyle>;
|
|
56
56
|
/** Style applied to the container */
|
|
57
|
-
style?: ViewStyle
|
|
57
|
+
style?: StyleProp<ViewStyle>;
|
|
58
58
|
/** Test identifier applied to container */
|
|
59
59
|
testID?: string;
|
|
60
60
|
/** Accessibility label for the entire control */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DimensionValue, ViewStyle, View } from 'react-native';
|
|
1
|
+
import { DimensionValue, ViewStyle, View, StyleProp } from 'react-native';
|
|
2
2
|
import { SpacingProps } from '../../core/utils';
|
|
3
3
|
import { SizeValue } from '../../core/theme/sizes';
|
|
4
4
|
export type SkeletonShape = 'text' | 'chip' | 'avatar' | 'button' | 'card' | 'circle' | 'rectangle' | 'rounded';
|
|
@@ -20,7 +20,7 @@ export interface SkeletonProps extends SpacingProps {
|
|
|
20
20
|
/** Gradient colors for the shimmer effect */
|
|
21
21
|
colors?: [string, string];
|
|
22
22
|
/** Style overrides for the skeleton container */
|
|
23
|
-
style?: ViewStyle
|
|
23
|
+
style?: StyleProp<ViewStyle>;
|
|
24
24
|
/** Optional test identifier */
|
|
25
25
|
testID?: string;
|
|
26
26
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ViewStyle } from 'react-native';
|
|
2
|
+
import { ViewStyle, StyleProp } from 'react-native';
|
|
3
3
|
import { BaseInputProps } from '../Input/types';
|
|
4
4
|
import { ColorValue, SizeValue, PlatformBlocksTheme } from '../../core/theme/types';
|
|
5
5
|
export type SliderColorScheme = keyof PlatformBlocksTheme['colors'] | (string & {});
|
|
@@ -39,11 +39,11 @@ export interface SliderProps extends Omit<BaseInputProps, 'value' | 'onChangeTex
|
|
|
39
39
|
/** Theme color palette or custom color to drive active elements */
|
|
40
40
|
colorScheme?: SliderColorScheme;
|
|
41
41
|
/** Additional styling for the inactive track */
|
|
42
|
-
trackStyle?: ViewStyle
|
|
42
|
+
trackStyle?: StyleProp<ViewStyle>;
|
|
43
43
|
/** Additional styling for the active track */
|
|
44
|
-
activeTrackStyle?: ViewStyle
|
|
44
|
+
activeTrackStyle?: StyleProp<ViewStyle>;
|
|
45
45
|
/** Additional styling for the thumb */
|
|
46
|
-
thumbStyle?: ViewStyle
|
|
46
|
+
thumbStyle?: StyleProp<ViewStyle>;
|
|
47
47
|
/** Override inactive tick color */
|
|
48
48
|
tickColor?: ColorValue;
|
|
49
49
|
/** Override active tick color */
|
|
@@ -113,8 +113,8 @@ export interface SliderTrackProps {
|
|
|
113
113
|
isRange?: boolean;
|
|
114
114
|
trackColor?: ColorValue;
|
|
115
115
|
activeTrackColor?: ColorValue;
|
|
116
|
-
trackStyle?: ViewStyle
|
|
117
|
-
activeTrackStyle?: ViewStyle
|
|
116
|
+
trackStyle?: StyleProp<ViewStyle>;
|
|
117
|
+
activeTrackStyle?: StyleProp<ViewStyle>;
|
|
118
118
|
trackHeight?: number;
|
|
119
119
|
thumbSize?: number;
|
|
120
120
|
}
|
|
@@ -145,7 +145,7 @@ export interface SliderThumbProps {
|
|
|
145
145
|
zIndex?: number;
|
|
146
146
|
panHandlers?: any;
|
|
147
147
|
thumbColor?: ColorValue;
|
|
148
|
-
thumbStyle?: ViewStyle
|
|
148
|
+
thumbStyle?: StyleProp<ViewStyle>;
|
|
149
149
|
thumbSize?: number;
|
|
150
150
|
}
|
|
151
151
|
export interface SliderLabelProps {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ViewStyle, TextInput } from 'react-native';
|
|
1
|
+
import type { ViewStyle, TextInput, StyleProp } from 'react-native';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { SpotlightItem } from './SpotlightTypes';
|
|
4
4
|
import type { HighlightProps as HighlightComponentProps } from '../Highlight';
|
|
@@ -23,7 +23,7 @@ export interface SpotlightRootProps {
|
|
|
23
23
|
opened?: boolean;
|
|
24
24
|
onClose?: () => void;
|
|
25
25
|
shortcut?: string | string[] | null;
|
|
26
|
-
style?: ViewStyle
|
|
26
|
+
style?: StyleProp<ViewStyle>;
|
|
27
27
|
}
|
|
28
28
|
export interface SpotlightSearchProps {
|
|
29
29
|
value?: string;
|
|
@@ -41,7 +41,7 @@ export interface SpotlightActionsListProps {
|
|
|
41
41
|
children: React.ReactNode;
|
|
42
42
|
scrollable?: boolean;
|
|
43
43
|
maxHeight?: number;
|
|
44
|
-
style?: ViewStyle
|
|
44
|
+
style?: StyleProp<ViewStyle>;
|
|
45
45
|
scrollRef?: any;
|
|
46
46
|
onScrollChange?: (y: number) => void;
|
|
47
47
|
}
|
|
@@ -54,7 +54,7 @@ export interface SpotlightActionProps {
|
|
|
54
54
|
disabled?: boolean;
|
|
55
55
|
selected?: boolean;
|
|
56
56
|
children?: React.ReactNode;
|
|
57
|
-
style?: ViewStyle
|
|
57
|
+
style?: StyleProp<ViewStyle>;
|
|
58
58
|
innerRef?: any;
|
|
59
59
|
onLayout?: (e: any) => void;
|
|
60
60
|
highlightQuery?: HighlightComponentProps['highlight'];
|
|
@@ -62,9 +62,9 @@ export interface SpotlightActionProps {
|
|
|
62
62
|
export interface SpotlightActionsGroupProps {
|
|
63
63
|
label: string;
|
|
64
64
|
children: React.ReactNode;
|
|
65
|
-
style?: ViewStyle
|
|
65
|
+
style?: StyleProp<ViewStyle>;
|
|
66
66
|
}
|
|
67
67
|
export interface SpotlightEmptyProps {
|
|
68
68
|
children: React.ReactNode;
|
|
69
|
-
style?: ViewStyle
|
|
69
|
+
style?: StyleProp<ViewStyle>;
|
|
70
70
|
}
|
|
@@ -4,7 +4,7 @@ interface RadiusProp {
|
|
|
4
4
|
radius?: number | string;
|
|
5
5
|
}
|
|
6
6
|
import type { SizeValue } from '../../core/theme/sizes';
|
|
7
|
-
import type { ViewStyle, TextStyle } from 'react-native';
|
|
7
|
+
import type { ViewStyle, TextStyle, StyleProp } from 'react-native';
|
|
8
8
|
/**
|
|
9
9
|
* Describes a single tab rendered by the {@link Tabs} component.
|
|
10
10
|
*/
|
|
@@ -115,19 +115,19 @@ export interface TabsProps extends SpacingProps, RadiusProp {
|
|
|
115
115
|
/**
|
|
116
116
|
* Style overrides for the outer container.
|
|
117
117
|
*/
|
|
118
|
-
style?: ViewStyle
|
|
118
|
+
style?: StyleProp<ViewStyle>;
|
|
119
119
|
/**
|
|
120
120
|
* Style overrides applied to each tab pressable.
|
|
121
121
|
*/
|
|
122
|
-
tabStyle?: ViewStyle
|
|
122
|
+
tabStyle?: StyleProp<ViewStyle>;
|
|
123
123
|
/**
|
|
124
124
|
* Style for the active tab content wrapper.
|
|
125
125
|
*/
|
|
126
|
-
contentStyle?: ViewStyle
|
|
126
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
127
127
|
/**
|
|
128
128
|
* Additional text style applied to tab labels.
|
|
129
129
|
*/
|
|
130
|
-
textStyle?: TextStyle
|
|
130
|
+
textStyle?: StyleProp<TextStyle>;
|
|
131
131
|
/**
|
|
132
132
|
* Array of tab keys that should be rendered disabled.
|
|
133
133
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ViewStyle } from 'react-native';
|
|
2
|
+
import { ViewStyle, StyleProp } from 'react-native';
|
|
3
3
|
import { SpacingProps } from '../../core/utils';
|
|
4
4
|
import { BorderRadiusProps } from '../../core/theme/radius';
|
|
5
5
|
export type ToastVariant = 'light' | 'filled' | 'outline';
|
|
@@ -58,7 +58,7 @@ export interface ToastProps extends SpacingProps, BorderRadiusProps {
|
|
|
58
58
|
/** Position of the toast for animation direction */
|
|
59
59
|
position?: ToastPosition;
|
|
60
60
|
/** Container style */
|
|
61
|
-
style?: ViewStyle
|
|
61
|
+
style?: StyleProp<ViewStyle>;
|
|
62
62
|
/** Test ID for testing */
|
|
63
63
|
testID?: string;
|
|
64
64
|
/** Action buttons */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ViewStyle, View } from 'react-native';
|
|
2
|
+
import { ViewStyle, View, StyleProp } from 'react-native';
|
|
3
3
|
import { SizeValue } from '../../core/theme/sizes';
|
|
4
4
|
export type TooltipPositionType = 'top' | 'bottom' | 'left' | 'right';
|
|
5
5
|
export interface TooltipProps {
|
|
@@ -34,7 +34,7 @@ export interface TooltipProps {
|
|
|
34
34
|
/** Children element to attach tooltip to */
|
|
35
35
|
children: React.ReactElement;
|
|
36
36
|
/** Container style */
|
|
37
|
-
style?: ViewStyle
|
|
37
|
+
style?: StyleProp<ViewStyle>;
|
|
38
38
|
/** Test ID for testing */
|
|
39
39
|
testID?: string;
|
|
40
40
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ImageStyle } from 'react-native';
|
|
2
|
+
import { ImageStyle, StyleProp } from 'react-native';
|
|
3
3
|
import type { VideoSource, VideoPlaybackRate } from './types';
|
|
4
4
|
interface NativeVideoPlayerProps {
|
|
5
5
|
source: VideoSource;
|
|
@@ -17,7 +17,7 @@ interface NativeVideoPlayerProps {
|
|
|
17
17
|
onLoad?: () => void;
|
|
18
18
|
onLoadStart?: () => void;
|
|
19
19
|
onBuffer?: (buffering: boolean) => void;
|
|
20
|
-
style?: ImageStyle
|
|
20
|
+
style?: StyleProp<ImageStyle>;
|
|
21
21
|
accessibilityLabel?: string;
|
|
22
22
|
}
|
|
23
23
|
interface NativeVideoPlayerRef {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ViewStyle } from 'react-native';
|
|
2
|
+
import { ViewStyle, StyleProp } from 'react-native';
|
|
3
3
|
import type { VideoControls as VideoControlsConfig, VideoState, VideoPlaybackRate } from './types';
|
|
4
4
|
interface VideoControlsProps {
|
|
5
5
|
config: VideoControlsConfig;
|
|
@@ -11,7 +11,7 @@ interface VideoControlsProps {
|
|
|
11
11
|
onPlaybackRateChange: (rate: VideoPlaybackRate) => void;
|
|
12
12
|
onToggleFullscreen: () => void;
|
|
13
13
|
onScrubbingChange?: (isScrubbing: boolean) => void;
|
|
14
|
-
style?: ViewStyle
|
|
14
|
+
style?: StyleProp<ViewStyle>;
|
|
15
15
|
}
|
|
16
16
|
export declare function VideoControls({ config, state, onPlay, onPause, onSeek, onVolumeChange, onPlaybackRateChange, onToggleFullscreen, onScrubbingChange, style }: VideoControlsProps): React.JSX.Element;
|
|
17
17
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ImageStyle } from 'react-native';
|
|
2
|
+
import { ImageStyle, StyleProp } from 'react-native';
|
|
3
3
|
import type { VideoSource, VideoPlaybackRate, VideoQuality } from './types';
|
|
4
4
|
interface YouTubePlayerProps {
|
|
5
5
|
source: VideoSource;
|
|
@@ -28,7 +28,7 @@ interface YouTubePlayerProps {
|
|
|
28
28
|
onLoad?: () => void;
|
|
29
29
|
onLoadStart?: () => void;
|
|
30
30
|
onBuffer?: (buffering: boolean) => void;
|
|
31
|
-
style?: ImageStyle
|
|
31
|
+
style?: StyleProp<ImageStyle>;
|
|
32
32
|
accessibilityLabel?: string;
|
|
33
33
|
}
|
|
34
34
|
interface YouTubePlayerRef {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ViewStyle, ImageStyle } from 'react-native';
|
|
1
|
+
import { ViewStyle, ImageStyle, StyleProp } from 'react-native';
|
|
2
2
|
import type { SpacingProps } from '../../core/utils';
|
|
3
3
|
export type VideoSource = {
|
|
4
4
|
/** Video URL (mp4, webm, etc.) */
|
|
@@ -118,9 +118,9 @@ export interface VideoProps extends SpacingProps {
|
|
|
118
118
|
onBuffer?: (buffering: boolean) => void;
|
|
119
119
|
onTimelineEvent?: (event: VideoTimelineEvent, state: VideoState) => void;
|
|
120
120
|
/** Styling */
|
|
121
|
-
style?: ViewStyle
|
|
122
|
-
videoStyle?: ImageStyle
|
|
123
|
-
controlsStyle?: ViewStyle
|
|
121
|
+
style?: StyleProp<ViewStyle>;
|
|
122
|
+
videoStyle?: StyleProp<ImageStyle>;
|
|
123
|
+
controlsStyle?: StyleProp<ViewStyle>;
|
|
124
124
|
/** Accessibility */
|
|
125
125
|
accessibilityLabel?: string;
|
|
126
126
|
testID?: string;
|
package/lib/esm/index.js
CHANGED
|
@@ -3507,6 +3507,35 @@ const containsPlatformText = (node) => {
|
|
|
3507
3507
|
return false;
|
|
3508
3508
|
});
|
|
3509
3509
|
};
|
|
3510
|
+
/**
|
|
3511
|
+
* Check if children contain block-level elements (View, Pressable, etc.)
|
|
3512
|
+
* that would render as <div> on web, causing invalid nesting inside <p>.
|
|
3513
|
+
*/
|
|
3514
|
+
const containsBlockElement = (node) => {
|
|
3515
|
+
return React__default.Children.toArray(node).some(child => {
|
|
3516
|
+
if (React__default.isValidElement(child)) {
|
|
3517
|
+
const childType = child.type;
|
|
3518
|
+
// Check for native RN components that render as div on web
|
|
3519
|
+
const displayName = (childType === null || childType === void 0 ? void 0 : childType.displayName) || (childType === null || childType === void 0 ? void 0 : childType.name) || '';
|
|
3520
|
+
const blockNames = new Set([
|
|
3521
|
+
'View', 'Pressable', 'TouchableOpacity', 'TouchableHighlight',
|
|
3522
|
+
'TouchableWithoutFeedback', 'ScrollView', 'FlatList', 'SectionList',
|
|
3523
|
+
'SafeAreaView', 'KeyboardAvoidingView', 'Modal',
|
|
3524
|
+
]);
|
|
3525
|
+
if (blockNames.has(displayName))
|
|
3526
|
+
return true;
|
|
3527
|
+
// Also check if it's a native 'div' element
|
|
3528
|
+
if (childType === 'div')
|
|
3529
|
+
return true;
|
|
3530
|
+
// Recurse into children
|
|
3531
|
+
const childProps = child.props;
|
|
3532
|
+
if (childProps === null || childProps === void 0 ? void 0 : childProps.children) {
|
|
3533
|
+
return containsBlockElement(childProps.children);
|
|
3534
|
+
}
|
|
3535
|
+
}
|
|
3536
|
+
return false;
|
|
3537
|
+
});
|
|
3538
|
+
};
|
|
3510
3539
|
const Text = (allProps) => {
|
|
3511
3540
|
const { spacingProps, otherProps } = extractSpacingProps(allProps);
|
|
3512
3541
|
const { children, tx, txParams, variant = 'p', size, weight, align = 'left', color, colorVariant, lineHeight, tracking, uppercase, style, fontFamily, as, selectable = true, onPress, onLayout, value, numberOfLines, ellipsizeMode } = otherProps;
|
|
@@ -3551,6 +3580,10 @@ const Text = (allProps) => {
|
|
|
3551
3580
|
// Avoid nested paragraphs when Text components are nested
|
|
3552
3581
|
htmlTag = 'div';
|
|
3553
3582
|
}
|
|
3583
|
+
if (htmlTag === 'p' && containsBlockElement(children)) {
|
|
3584
|
+
// Avoid <div> inside <p> when children contain View, Pressable, etc.
|
|
3585
|
+
htmlTag = 'div';
|
|
3586
|
+
}
|
|
3554
3587
|
}
|
|
3555
3588
|
// Platform-specific rendering
|
|
3556
3589
|
if (Platform.OS === 'web' && isHTMLVariant(htmlTag)) {
|
|
@@ -6702,23 +6735,25 @@ function Dialog({ visible, variant = 'modal', title, children, closable = true,
|
|
|
6702
6735
|
}, visible && closable);
|
|
6703
6736
|
// Pan responder for bottomsheet swipe-to-dismiss
|
|
6704
6737
|
const panResponder = useRef(PanResponder.create({
|
|
6738
|
+
onStartShouldSetPanResponderCapture: () => {
|
|
6739
|
+
// Never capture on touch start — let events reach children (buttons) first
|
|
6740
|
+
return false;
|
|
6741
|
+
},
|
|
6705
6742
|
onStartShouldSetPanResponder: () => {
|
|
6706
|
-
//
|
|
6743
|
+
// Claim in bubble phase (after children had their chance to claim).
|
|
6744
|
+
// If a Button/Pressable already claimed the touch, this won't fire.
|
|
6745
|
+
// If nothing claimed (e.g. drag handle, empty space), we take over for swipe tracking.
|
|
6707
6746
|
return variant === 'bottomsheet' && bottomSheetSwipeZone !== 'none';
|
|
6708
6747
|
},
|
|
6709
|
-
|
|
6710
|
-
//
|
|
6711
|
-
return
|
|
6748
|
+
onMoveShouldSetPanResponderCapture: () => {
|
|
6749
|
+
// Never capture moves — let children handle their own gestures
|
|
6750
|
+
return false;
|
|
6712
6751
|
},
|
|
6713
6752
|
onMoveShouldSetPanResponder: (_, gestureState) => {
|
|
6714
|
-
//
|
|
6753
|
+
// Claim the gesture when there's a clear vertical swipe movement
|
|
6715
6754
|
return variant === 'bottomsheet' && bottomSheetSwipeZone !== 'none' && (Math.abs(gestureState.dy) > Math.abs(gestureState.dx) &&
|
|
6716
6755
|
Math.abs(gestureState.dy) > 2);
|
|
6717
6756
|
},
|
|
6718
|
-
onMoveShouldSetPanResponderCapture: () => {
|
|
6719
|
-
// Already captured on start; keep returning true for consistency
|
|
6720
|
-
return variant === 'bottomsheet' && bottomSheetSwipeZone !== 'none';
|
|
6721
|
-
},
|
|
6722
6757
|
onPanResponderGrant: (evt) => {
|
|
6723
6758
|
// Prevent default browser behavior (text selection, etc.) on web
|
|
6724
6759
|
if (Platform.OS === 'web') {
|
|
@@ -10822,7 +10857,7 @@ const Masonry = factory((props, ref) => {
|
|
|
10822
10857
|
};
|
|
10823
10858
|
const containerStyle = {
|
|
10824
10859
|
...spacingStyle,
|
|
10825
|
-
...style,
|
|
10860
|
+
...StyleSheet.flatten(style),
|
|
10826
10861
|
};
|
|
10827
10862
|
// Show loading state
|
|
10828
10863
|
if (loading) {
|
|
@@ -14483,7 +14518,8 @@ const CodeBlock = (props) => {
|
|
|
14483
14518
|
if (spoiler) {
|
|
14484
14519
|
wrappedCodeContent = (jsx(Spoiler, { maxHeight: spoilerMaxHeight, children: scrollableCodeContent }));
|
|
14485
14520
|
}
|
|
14486
|
-
const
|
|
14521
|
+
const flatStyle = StyleSheet.flatten(style);
|
|
14522
|
+
const userHasWidth = Boolean(flatStyle && (flatStyle.width !== undefined || flatStyle.flex !== undefined));
|
|
14487
14523
|
const containerStyle = userHasWidth ? [{ marginBottom: 20 }, style, spacingStyles] : [styles.container, spacingStyles, style];
|
|
14488
14524
|
const showHeaderBar = fileHeader && fileName && variant !== 'terminal';
|
|
14489
14525
|
const inlineTitleVisible = variant === 'code' && (title || fileName);
|
|
@@ -16093,12 +16129,12 @@ const BrandButton = (props) => {
|
|
|
16093
16129
|
return { backgroundColor: 'transparent', borderColor: 'transparent' };
|
|
16094
16130
|
case 'plain':
|
|
16095
16131
|
return {
|
|
16096
|
-
backgroundColor: 'white',
|
|
16132
|
+
backgroundColor: theme.colorScheme === 'dark' ? theme.backgrounds.elevated : 'white',
|
|
16097
16133
|
borderColor: 'transparent',
|
|
16098
16134
|
paddingHorizontal: 16,
|
|
16099
16135
|
minWidth: 0,
|
|
16100
16136
|
height: 'auto',
|
|
16101
|
-
color: 'black'
|
|
16137
|
+
color: theme.colorScheme === 'dark' ? theme.text.primary : 'black'
|
|
16102
16138
|
};
|
|
16103
16139
|
default: // primary/filled/secondary/gradient etc treat as filled brand color
|
|
16104
16140
|
return {
|
|
@@ -16109,7 +16145,7 @@ const BrandButton = (props) => {
|
|
|
16109
16145
|
}
|
|
16110
16146
|
})();
|
|
16111
16147
|
// Compute textColor override: outline/link use brand color, ghost uses default text color, filled-like use contrasting light text
|
|
16112
|
-
const textColor = effectiveVariant === 'plain' ? 'black' :
|
|
16148
|
+
const textColor = effectiveVariant === 'plain' ? (theme.colorScheme === 'dark' ? theme.text.primary : 'black') :
|
|
16113
16149
|
effectiveVariant === 'ghost'
|
|
16114
16150
|
? theme.text.primary
|
|
16115
16151
|
: (effectiveVariant === 'outline' || effectiveVariant === 'link')
|
|
@@ -30956,7 +30992,7 @@ function Avatar({ size = 'md', src, fallback, backgroundColor, textColor = 'whit
|
|
|
30956
30992
|
};
|
|
30957
30993
|
const containerStyle = {
|
|
30958
30994
|
position: 'relative',
|
|
30959
|
-
...style,
|
|
30995
|
+
...StyleSheet.flatten(style),
|
|
30960
30996
|
};
|
|
30961
30997
|
const content = (jsxs(View, { style: containerStyle, children: [jsx(View, { style: avatarStyle, children: src ? (jsx(Image$1, { source: { uri: src }, style: {
|
|
30962
30998
|
width: avatarSize,
|
|
@@ -30977,7 +31013,7 @@ function AvatarGroup({ children, limit, spacing = -8, style, size, bordered = tr
|
|
|
30977
31013
|
const containerStyle = {
|
|
30978
31014
|
flexDirection: 'row',
|
|
30979
31015
|
alignItems: 'center',
|
|
30980
|
-
...style,
|
|
31016
|
+
...StyleSheet.flatten(style),
|
|
30981
31017
|
};
|
|
30982
31018
|
const avatarWrapperStyle = (index) => ({
|
|
30983
31019
|
marginLeft: index > 0 ? spacing : 0,
|
|
@@ -37163,7 +37199,7 @@ function Image({ src, source, alt, accessibilityLabel, resizeMode = 'cover', siz
|
|
|
37163
37199
|
const spacingStyles = getSpacingStyles(spacingProps);
|
|
37164
37200
|
const containerStyles = {
|
|
37165
37201
|
...spacingStyles,
|
|
37166
|
-
...containerStyle,
|
|
37202
|
+
...StyleSheet.flatten(containerStyle),
|
|
37167
37203
|
};
|
|
37168
37204
|
const imageStyles = {
|
|
37169
37205
|
width: finalWidth,
|
|
@@ -37172,7 +37208,7 @@ function Image({ src, source, alt, accessibilityLabel, resizeMode = 'cover', siz
|
|
|
37172
37208
|
borderWidth,
|
|
37173
37209
|
borderColor: borderColor || theme.colors.gray[3],
|
|
37174
37210
|
borderRadius,
|
|
37175
|
-
...imageStyle,
|
|
37211
|
+
...StyleSheet.flatten(imageStyle),
|
|
37176
37212
|
};
|
|
37177
37213
|
if (finalWidth !== undefined) {
|
|
37178
37214
|
containerStyles.width = finalWidth;
|