react-native-platform-components 0.6.1 → 0.8.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 +259 -44
- package/android/src/main/java/com/platformcomponents/PCLiquidGlassView.kt +84 -0
- package/android/src/main/java/com/platformcomponents/PCLiquidGlassViewManager.kt +52 -0
- package/android/src/main/java/com/platformcomponents/PCSegmentedControlView.kt +241 -0
- package/android/src/main/java/com/platformcomponents/PCSegmentedControlViewManager.kt +105 -0
- package/android/src/main/java/com/platformcomponents/PlatformComponentsPackage.kt +2 -0
- package/ios/PCDatePickerView.swift +16 -13
- package/ios/PCLiquidGlass.h +10 -0
- package/ios/PCLiquidGlass.mm +140 -0
- package/ios/PCLiquidGlass.swift +354 -0
- package/ios/PCSegmentedControl.h +10 -0
- package/ios/PCSegmentedControl.mm +194 -0
- package/ios/PCSegmentedControl.swift +200 -0
- package/ios/PCSelectionMenu.swift +1 -1
- package/lib/commonjs/LiquidGlass.js +72 -0
- package/lib/commonjs/LiquidGlass.js.map +1 -0
- package/lib/commonjs/LiquidGlassNativeComponent.ts +110 -0
- package/lib/commonjs/SegmentedControl.js +93 -0
- package/lib/commonjs/SegmentedControl.js.map +1 -0
- package/lib/commonjs/SegmentedControlNativeComponent.ts +79 -0
- package/lib/commonjs/index.js +22 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/LiquidGlass.js +64 -0
- package/lib/module/LiquidGlass.js.map +1 -0
- package/lib/module/LiquidGlassNativeComponent.ts +110 -0
- package/lib/module/SegmentedControl.js +87 -0
- package/lib/module/SegmentedControl.js.map +1 -0
- package/lib/module/SegmentedControlNativeComponent.ts +79 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/LiquidGlass.d.ts +96 -0
- package/lib/typescript/commonjs/src/LiquidGlass.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts +93 -0
- package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/SegmentedControl.d.ts +62 -0
- package/lib/typescript/commonjs/src/SegmentedControl.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts +63 -0
- package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/LiquidGlass.d.ts +96 -0
- package/lib/typescript/module/src/LiquidGlass.d.ts.map +1 -0
- package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts +93 -0
- package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/SegmentedControl.d.ts +62 -0
- package/lib/typescript/module/src/SegmentedControl.d.ts.map +1 -0
- package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts +63 -0
- package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +2 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +13 -4
- package/react-native.config.js +1 -0
- package/shared/PCSegmentedControlComponentDescriptors-custom.h +22 -0
- package/shared/PCSegmentedControlShadowNode-custom.cpp +54 -0
- package/shared/PCSegmentedControlShadowNode-custom.h +56 -0
- package/shared/PCSegmentedControlState-custom.h +62 -0
- package/shared/react/renderer/components/PlatformComponentsViewSpec/ComponentDescriptors.h +1 -0
- package/src/LiquidGlass.tsx +169 -0
- package/src/LiquidGlassNativeComponent.ts +110 -0
- package/src/SegmentedControl.tsx +178 -0
- package/src/SegmentedControlNativeComponent.ts +79 -0
- package/src/index.tsx +2 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { CodegenTypes, ViewProps } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* A single segment in the control.
|
|
4
|
+
*/
|
|
5
|
+
export type SegmentedControlSegment = Readonly<{
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
disabled: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Event emitted when the user selects a segment.
|
|
13
|
+
*/
|
|
14
|
+
export type SegmentedControlSelectEvent = Readonly<{
|
|
15
|
+
/** Selected segment index */
|
|
16
|
+
index: CodegenTypes.Int32;
|
|
17
|
+
/** Selected segment value */
|
|
18
|
+
value: string;
|
|
19
|
+
}>;
|
|
20
|
+
/** Interactivity state (no booleans). */
|
|
21
|
+
export type SegmentedControlInteractivity = 'enabled' | 'disabled';
|
|
22
|
+
/**
|
|
23
|
+
* iOS-specific configuration.
|
|
24
|
+
*/
|
|
25
|
+
export type IOSProps = Readonly<{
|
|
26
|
+
/** Momentary mode: segment springs back after touch */
|
|
27
|
+
momentary?: string;
|
|
28
|
+
/** Whether segment widths are proportional to content */
|
|
29
|
+
apportionsSegmentWidthsByContent?: string;
|
|
30
|
+
/** Selected segment tint color (hex string) */
|
|
31
|
+
selectedSegmentTintColor?: string;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Android-specific configuration.
|
|
35
|
+
*/
|
|
36
|
+
export type AndroidProps = Readonly<{
|
|
37
|
+
/** Whether one segment must always be selected */
|
|
38
|
+
selectionRequired?: string;
|
|
39
|
+
}>;
|
|
40
|
+
export interface SegmentedControlProps extends ViewProps {
|
|
41
|
+
/**
|
|
42
|
+
* Segments to display.
|
|
43
|
+
*/
|
|
44
|
+
segments: ReadonlyArray<SegmentedControlSegment>;
|
|
45
|
+
/**
|
|
46
|
+
* Controlled selection by `value`.
|
|
47
|
+
* Empty string means "no selection".
|
|
48
|
+
*/
|
|
49
|
+
selectedValue?: CodegenTypes.WithDefault<string, ''>;
|
|
50
|
+
/**
|
|
51
|
+
* Enabled / disabled state.
|
|
52
|
+
*/
|
|
53
|
+
interactivity?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Fired when the user selects a segment.
|
|
56
|
+
*/
|
|
57
|
+
onSelect?: CodegenTypes.BubblingEventHandler<SegmentedControlSelectEvent>;
|
|
58
|
+
ios?: IOSProps;
|
|
59
|
+
android?: AndroidProps;
|
|
60
|
+
}
|
|
61
|
+
declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<SegmentedControlProps>;
|
|
62
|
+
export default _default;
|
|
63
|
+
//# sourceMappingURL=SegmentedControlNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControlNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/SegmentedControlNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG5D;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IACjD,6BAA6B;IAC7B,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC;IAE1B,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,yCAAyC;AACzC,MAAM,MAAM,6BAA6B,GAAG,SAAS,GAAG,UAAU,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC9B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,yDAAyD;IACzD,gCAAgC,CAAC,EAAE,MAAM,CAAC;IAE1C,+CAA+C;IAC/C,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,WAAW,qBAAsB,SAAQ,SAAS;IACtD;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAC;IAEjD;;;OAGG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAErD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,2BAA2B,CAAC,CAAC;IAE1E,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;;AAED,wBAEE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ViewProps } from 'react-native';
|
|
3
|
+
import { type LiquidGlassColorScheme, type LiquidGlassEffect, type LiquidGlassPressEvent } from './LiquidGlassNativeComponent';
|
|
4
|
+
export type { LiquidGlassEffect, LiquidGlassColorScheme, LiquidGlassPressEvent, };
|
|
5
|
+
/**
|
|
6
|
+
* Whether the LiquidGlass effect is supported on the current device.
|
|
7
|
+
* Returns true on iOS 26+ (with Liquid Glass support), false otherwise.
|
|
8
|
+
*
|
|
9
|
+
* Use this to conditionally render fallback UI on unsupported devices.
|
|
10
|
+
*/
|
|
11
|
+
export declare const isLiquidGlassSupported: boolean;
|
|
12
|
+
export interface LiquidGlassProps extends ViewProps {
|
|
13
|
+
/**
|
|
14
|
+
* Corner radius for the glass effect.
|
|
15
|
+
* Applied uniformly to all corners.
|
|
16
|
+
* @default 0
|
|
17
|
+
*/
|
|
18
|
+
cornerRadius?: number;
|
|
19
|
+
/**
|
|
20
|
+
* iOS-specific props for the glass effect.
|
|
21
|
+
*/
|
|
22
|
+
ios?: {
|
|
23
|
+
/**
|
|
24
|
+
* Glass effect style.
|
|
25
|
+
* - 'clear': More transparent, subtle glass effect
|
|
26
|
+
* - 'regular': Standard blur intensity (default)
|
|
27
|
+
* - 'none': No glass effect (useful for animating materialization)
|
|
28
|
+
* @default 'regular'
|
|
29
|
+
*/
|
|
30
|
+
effect?: LiquidGlassEffect;
|
|
31
|
+
/**
|
|
32
|
+
* Enables native touch interaction effects when pressing the view.
|
|
33
|
+
* When enabled, the glass effect responds to touch location with
|
|
34
|
+
* position-aware visual feedback (iOS 26+ UIGlassEffect.isInteractive).
|
|
35
|
+
*
|
|
36
|
+
* Note: Only applies on component mount; cannot be changed dynamically.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
interactive?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Overlay tint color applied to the glass effect.
|
|
42
|
+
* Accepts any valid color value (hex, rgba, named colors).
|
|
43
|
+
*
|
|
44
|
+
* Example: '#FF0000', 'rgba(255, 0, 0, 0.5)', 'red'
|
|
45
|
+
*/
|
|
46
|
+
tintColor?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Appearance adaptation mode.
|
|
49
|
+
* - 'light': Force light appearance
|
|
50
|
+
* - 'dark': Force dark appearance
|
|
51
|
+
* - 'system': Follow system appearance (default)
|
|
52
|
+
* @default 'system'
|
|
53
|
+
*/
|
|
54
|
+
colorScheme?: LiquidGlassColorScheme;
|
|
55
|
+
/**
|
|
56
|
+
* Shadow radius for the glass effect glow.
|
|
57
|
+
* Higher values create a more diffuse shadow.
|
|
58
|
+
* @default 20
|
|
59
|
+
*/
|
|
60
|
+
shadowRadius?: number;
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated Use `interactive` instead for native touch-based highlighting.
|
|
63
|
+
* This prop is a no-op on iOS 26+ where UIGlassEffect handles touch feedback.
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
isHighlighted?: boolean;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Android-specific props.
|
|
70
|
+
* Note: LiquidGlass is an iOS-only effect. On Android, the component
|
|
71
|
+
* renders as a regular View with optional fallback styling.
|
|
72
|
+
*/
|
|
73
|
+
android?: {
|
|
74
|
+
/**
|
|
75
|
+
* Fallback background color for Android since glass effect is not supported.
|
|
76
|
+
* If not provided, the view renders transparently.
|
|
77
|
+
*/
|
|
78
|
+
fallbackBackgroundColor?: string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Content to render inside the glass effect container.
|
|
82
|
+
*/
|
|
83
|
+
children?: React.ReactNode;
|
|
84
|
+
/**
|
|
85
|
+
* Called when the glass view is pressed.
|
|
86
|
+
* Includes touch coordinates relative to the view bounds.
|
|
87
|
+
*/
|
|
88
|
+
onPress?: (event: {
|
|
89
|
+
x: number;
|
|
90
|
+
y: number;
|
|
91
|
+
}) => void;
|
|
92
|
+
/** Test identifier */
|
|
93
|
+
testID?: string;
|
|
94
|
+
}
|
|
95
|
+
export declare function LiquidGlass(props: LiquidGlassProps): React.ReactElement;
|
|
96
|
+
//# sourceMappingURL=LiquidGlass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiquidGlass.d.ts","sourceRoot":"","sources":["../../../../src/LiquidGlass.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC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{ CodegenTypes, HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Glass effect intensity/style.
|
|
4
|
+
* - 'clear': More transparent, subtle glass effect
|
|
5
|
+
* - 'regular': Standard blur intensity (default)
|
|
6
|
+
* - 'none': No glass effect (useful for animating materialization)
|
|
7
|
+
*/
|
|
8
|
+
export type LiquidGlassEffect = 'clear' | 'regular' | 'none';
|
|
9
|
+
/**
|
|
10
|
+
* Color scheme for the glass effect.
|
|
11
|
+
* - 'light': Force light appearance
|
|
12
|
+
* - 'dark': Force dark appearance
|
|
13
|
+
* - 'system': Follow system appearance (default)
|
|
14
|
+
*/
|
|
15
|
+
export type LiquidGlassColorScheme = 'light' | 'dark' | 'system';
|
|
16
|
+
/**
|
|
17
|
+
* iOS-specific configuration.
|
|
18
|
+
*/
|
|
19
|
+
export type LiquidGlassIOSProps = Readonly<{
|
|
20
|
+
/**
|
|
21
|
+
* Glass effect style.
|
|
22
|
+
* @default 'regular'
|
|
23
|
+
*/
|
|
24
|
+
effect?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Enables touch interaction effects when pressing the view.
|
|
27
|
+
* Note: Only applies on component mount; cannot be changed dynamically.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
interactive?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Overlay tint color applied to the glass effect.
|
|
33
|
+
* Accepts hex color strings (e.g., '#FF0000', '#FF000080').
|
|
34
|
+
*/
|
|
35
|
+
tintColor?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Appearance adaptation mode.
|
|
38
|
+
* @default 'system'
|
|
39
|
+
*/
|
|
40
|
+
colorScheme?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Shadow radius for the glass effect.
|
|
43
|
+
* @default 20
|
|
44
|
+
*/
|
|
45
|
+
shadowRadius?: CodegenTypes.Float;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the view is highlighted (pressed state).
|
|
48
|
+
*/
|
|
49
|
+
isHighlighted?: string;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Android-specific configuration (stub - LiquidGlass is iOS only).
|
|
53
|
+
*/
|
|
54
|
+
export type LiquidGlassAndroidProps = Readonly<{
|
|
55
|
+
/**
|
|
56
|
+
* Fallback background color for Android (since glass effect is not supported).
|
|
57
|
+
* If not provided, renders as transparent.
|
|
58
|
+
*/
|
|
59
|
+
fallbackBackgroundColor?: string;
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Event emitted when the glass view is pressed.
|
|
63
|
+
*/
|
|
64
|
+
export type LiquidGlassPressEvent = Readonly<{
|
|
65
|
+
/** X coordinate of touch relative to view bounds */
|
|
66
|
+
x: CodegenTypes.Float;
|
|
67
|
+
/** Y coordinate of touch relative to view bounds */
|
|
68
|
+
y: CodegenTypes.Float;
|
|
69
|
+
}>;
|
|
70
|
+
export interface LiquidGlassNativeProps extends ViewProps {
|
|
71
|
+
/**
|
|
72
|
+
* Corner radius for the glass effect.
|
|
73
|
+
* Applied uniformly to all corners.
|
|
74
|
+
* @default 0
|
|
75
|
+
*/
|
|
76
|
+
cornerRadius?: CodegenTypes.WithDefault<CodegenTypes.Float, 0>;
|
|
77
|
+
/**
|
|
78
|
+
* iOS-specific props.
|
|
79
|
+
*/
|
|
80
|
+
ios?: LiquidGlassIOSProps;
|
|
81
|
+
/**
|
|
82
|
+
* Android-specific props.
|
|
83
|
+
*/
|
|
84
|
+
android?: LiquidGlassAndroidProps;
|
|
85
|
+
/**
|
|
86
|
+
* Fired when the glass view is pressed.
|
|
87
|
+
* Includes touch coordinates relative to view bounds.
|
|
88
|
+
*/
|
|
89
|
+
onGlassPress?: CodegenTypes.DirectEventHandler<LiquidGlassPressEvent>;
|
|
90
|
+
}
|
|
91
|
+
declare const _default: HostComponent<LiquidGlassNativeProps>;
|
|
92
|
+
export default _default;
|
|
93
|
+
//# sourceMappingURL=LiquidGlassNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|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EAAE,mBAAmB,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAElC;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;CACvE;wBAII,aAAa,CAAC,sBAAsB,CAAC;AAF1C,wBAE2C"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ViewProps } from 'react-native';
|
|
3
|
+
export interface SegmentedControlSegmentProps {
|
|
4
|
+
/** Display label for the segment */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Unique value identifier for the segment */
|
|
7
|
+
value: string;
|
|
8
|
+
/** Whether this specific segment is disabled */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Optional SF Symbol name (iOS) or drawable resource name (Android) */
|
|
11
|
+
icon?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SegmentedControlProps extends ViewProps {
|
|
14
|
+
/** Array of segments to display */
|
|
15
|
+
segments: readonly SegmentedControlSegmentProps[];
|
|
16
|
+
/**
|
|
17
|
+
* Currently selected segment value.
|
|
18
|
+
* Use `null` for no selection.
|
|
19
|
+
*/
|
|
20
|
+
selectedValue: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Called when the user selects a segment.
|
|
23
|
+
* @param value - The selected segment's value
|
|
24
|
+
* @param index - The selected segment's index
|
|
25
|
+
*/
|
|
26
|
+
onSelect?: (value: string, index: number) => void;
|
|
27
|
+
/** Whether the entire control is disabled */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* iOS-specific configuration
|
|
31
|
+
*/
|
|
32
|
+
ios?: {
|
|
33
|
+
/**
|
|
34
|
+
* Momentary mode: segment springs back after touch (no persistent selection)
|
|
35
|
+
* Default: false
|
|
36
|
+
*/
|
|
37
|
+
momentary?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether segment widths are proportional to content
|
|
40
|
+
* Default: false (equal widths)
|
|
41
|
+
*/
|
|
42
|
+
apportionsSegmentWidthsByContent?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Selected segment tint color (hex string, e.g., "#007AFF")
|
|
45
|
+
*/
|
|
46
|
+
selectedSegmentTintColor?: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Android-specific configuration
|
|
50
|
+
*/
|
|
51
|
+
android?: {
|
|
52
|
+
/**
|
|
53
|
+
* Whether one segment must always be selected.
|
|
54
|
+
* Default: false
|
|
55
|
+
*/
|
|
56
|
+
selectionRequired?: boolean;
|
|
57
|
+
};
|
|
58
|
+
/** Test identifier */
|
|
59
|
+
testID?: string;
|
|
60
|
+
}
|
|
61
|
+
export declare function SegmentedControl(props: SegmentedControlProps): React.ReactElement;
|
|
62
|
+
//# sourceMappingURL=SegmentedControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../../src/SegmentedControl.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAIL,KAAK,SAAS,EAEf,MAAM,cAAc,CAAC;AAWtB,MAAM,WAAW,4BAA4B;IAC3C,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IAEd,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAsB,SAAQ,SAAS;IACtD,mCAAmC;IACnC,QAAQ,EAAE,SAAS,4BAA4B,EAAE,CAAC;IAElD;;;OAGG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAElD,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,GAAG,CAAC,EAAE;QACJ;;;WAGG;QACH,SAAS,CAAC,EAAE,OAAO,CAAC;QAEpB;;;WAGG;QACH,gCAAgC,CAAC,EAAE,OAAO,CAAC;QAE3C;;WAEG;QACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;KACnC,CAAC;IAEF;;OAEG;IACH,OAAO,CAAC,EAAE;QACR;;;WAGG;QACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,CAAC;IAEF,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,qBAAqB,GAC3B,KAAK,CAAC,YAAY,CA2EpB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { CodegenTypes, ViewProps } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* A single segment in the control.
|
|
4
|
+
*/
|
|
5
|
+
export type SegmentedControlSegment = Readonly<{
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
disabled: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Event emitted when the user selects a segment.
|
|
13
|
+
*/
|
|
14
|
+
export type SegmentedControlSelectEvent = Readonly<{
|
|
15
|
+
/** Selected segment index */
|
|
16
|
+
index: CodegenTypes.Int32;
|
|
17
|
+
/** Selected segment value */
|
|
18
|
+
value: string;
|
|
19
|
+
}>;
|
|
20
|
+
/** Interactivity state (no booleans). */
|
|
21
|
+
export type SegmentedControlInteractivity = 'enabled' | 'disabled';
|
|
22
|
+
/**
|
|
23
|
+
* iOS-specific configuration.
|
|
24
|
+
*/
|
|
25
|
+
export type IOSProps = Readonly<{
|
|
26
|
+
/** Momentary mode: segment springs back after touch */
|
|
27
|
+
momentary?: string;
|
|
28
|
+
/** Whether segment widths are proportional to content */
|
|
29
|
+
apportionsSegmentWidthsByContent?: string;
|
|
30
|
+
/** Selected segment tint color (hex string) */
|
|
31
|
+
selectedSegmentTintColor?: string;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Android-specific configuration.
|
|
35
|
+
*/
|
|
36
|
+
export type AndroidProps = Readonly<{
|
|
37
|
+
/** Whether one segment must always be selected */
|
|
38
|
+
selectionRequired?: string;
|
|
39
|
+
}>;
|
|
40
|
+
export interface SegmentedControlProps extends ViewProps {
|
|
41
|
+
/**
|
|
42
|
+
* Segments to display.
|
|
43
|
+
*/
|
|
44
|
+
segments: ReadonlyArray<SegmentedControlSegment>;
|
|
45
|
+
/**
|
|
46
|
+
* Controlled selection by `value`.
|
|
47
|
+
* Empty string means "no selection".
|
|
48
|
+
*/
|
|
49
|
+
selectedValue?: CodegenTypes.WithDefault<string, ''>;
|
|
50
|
+
/**
|
|
51
|
+
* Enabled / disabled state.
|
|
52
|
+
*/
|
|
53
|
+
interactivity?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Fired when the user selects a segment.
|
|
56
|
+
*/
|
|
57
|
+
onSelect?: CodegenTypes.BubblingEventHandler<SegmentedControlSelectEvent>;
|
|
58
|
+
ios?: IOSProps;
|
|
59
|
+
android?: AndroidProps;
|
|
60
|
+
}
|
|
61
|
+
declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<SegmentedControlProps>;
|
|
62
|
+
export default _default;
|
|
63
|
+
//# sourceMappingURL=SegmentedControlNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControlNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/SegmentedControlNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG5D;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAA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AA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-platform-components",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Native UI components for React Native: DatePicker, ContextMenu, SelectionMenu, SegmentedControl, LiquidGlass.",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
7
7
|
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
@@ -73,7 +73,14 @@
|
|
|
73
73
|
"dropdown",
|
|
74
74
|
"native",
|
|
75
75
|
"material-design",
|
|
76
|
-
"expo"
|
|
76
|
+
"expo",
|
|
77
|
+
"segmented-control",
|
|
78
|
+
"segmentedcontrol",
|
|
79
|
+
"tabs",
|
|
80
|
+
"segmented-buttons",
|
|
81
|
+
"segmentedbuttons",
|
|
82
|
+
"liquid-glass",
|
|
83
|
+
"liquidglass"
|
|
77
84
|
],
|
|
78
85
|
"repository": {
|
|
79
86
|
"type": "git",
|
|
@@ -157,7 +164,9 @@
|
|
|
157
164
|
"componentProvider": {
|
|
158
165
|
"PCSelectionMenu": "PCSelectionMenu",
|
|
159
166
|
"PCDatePicker": "PCDatePicker",
|
|
160
|
-
"PCContextMenu": "PCContextMenu"
|
|
167
|
+
"PCContextMenu": "PCContextMenu",
|
|
168
|
+
"PCSegmentedControl": "PCSegmentedControl",
|
|
169
|
+
"PCLiquidGlass": "PCLiquidGlass"
|
|
161
170
|
}
|
|
162
171
|
}
|
|
163
172
|
},
|
package/react-native.config.js
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
4
|
+
|
|
5
|
+
// Forward declaration to avoid circular includes
|
|
6
|
+
namespace facebook::react {
|
|
7
|
+
class MeasuringPCSegmentedControlShadowNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Include the actual shadow node definition
|
|
11
|
+
#include "PCSegmentedControlShadowNode-custom.h"
|
|
12
|
+
|
|
13
|
+
namespace facebook::react {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Custom component descriptor that uses our measuring shadow node
|
|
17
|
+
* instead of the generated one.
|
|
18
|
+
*/
|
|
19
|
+
using MeasuringPCSegmentedControlComponentDescriptor =
|
|
20
|
+
ConcreteComponentDescriptor<MeasuringPCSegmentedControlShadowNode>;
|
|
21
|
+
|
|
22
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#include "PCSegmentedControlShadowNode-custom.h"
|
|
2
|
+
|
|
3
|
+
#include <react/renderer/core/LayoutConstraints.h>
|
|
4
|
+
#include <algorithm>
|
|
5
|
+
|
|
6
|
+
namespace facebook::react {
|
|
7
|
+
|
|
8
|
+
Size MeasuringPCSegmentedControlShadowNode::measureContent(
|
|
9
|
+
const LayoutContext& /*layoutContext*/,
|
|
10
|
+
const LayoutConstraints& layoutConstraints) const {
|
|
11
|
+
|
|
12
|
+
// Get frame size from native state - native measures the actual control
|
|
13
|
+
const auto& stateData = this->getStateData();
|
|
14
|
+
Float measuredW = stateData.frameSize.width;
|
|
15
|
+
Float measuredH = stateData.frameSize.height;
|
|
16
|
+
|
|
17
|
+
// Platform-specific fallback heights
|
|
18
|
+
const Float fallbackHeight =
|
|
19
|
+
#ifdef __ANDROID__
|
|
20
|
+
static_cast<Float>(kFallbackHeightAndroid);
|
|
21
|
+
#else
|
|
22
|
+
static_cast<Float>(kFallbackHeightIOS);
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
// If height is 0, use fallback (state not yet set by native)
|
|
26
|
+
const bool usingFallback = (measuredH <= 0);
|
|
27
|
+
if (usingFallback) {
|
|
28
|
+
measuredH = fallbackHeight;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// If width is 0, use available width from constraints
|
|
32
|
+
const Float kHuge = static_cast<Float>(1.0e9);
|
|
33
|
+
if (measuredW <= 0) {
|
|
34
|
+
const Float maxW = layoutConstraints.maximumSize.width;
|
|
35
|
+
measuredW = (maxW > 0 && maxW < kHuge) ? maxW : 300;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Respect layout constraints, but if using fallback height,
|
|
39
|
+
// don't let maximum constraint override our fallback
|
|
40
|
+
measuredW = std::max<Float>(measuredW, layoutConstraints.minimumSize.width);
|
|
41
|
+
if (layoutConstraints.maximumSize.width > 0 && layoutConstraints.maximumSize.width < kHuge) {
|
|
42
|
+
measuredW = std::min<Float>(measuredW, layoutConstraints.maximumSize.width);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
measuredH = std::max<Float>(measuredH, layoutConstraints.minimumSize.height);
|
|
46
|
+
// Only clamp to max height if we have real measured data (not fallback)
|
|
47
|
+
if (!usingFallback && layoutConstraints.maximumSize.height > 0 && layoutConstraints.maximumSize.height < kHuge) {
|
|
48
|
+
measuredH = std::min<Float>(measuredH, layoutConstraints.maximumSize.height);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return Size{measuredW, measuredH};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
4
|
+
|
|
5
|
+
// Only include what we need for the shadow node definition
|
|
6
|
+
// Do NOT include ComponentDescriptors.h here to avoid circular dependency
|
|
7
|
+
#include <react/renderer/components/PlatformComponentsViewSpec/EventEmitters.h>
|
|
8
|
+
#include <react/renderer/components/PlatformComponentsViewSpec/Props.h>
|
|
9
|
+
|
|
10
|
+
#include "PCSegmentedControlState-custom.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
extern const char PCSegmentedControlComponentName[];
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Custom ShadowNode for SegmentedControl that supports Yoga measurement.
|
|
18
|
+
*
|
|
19
|
+
* Key behavior:
|
|
20
|
+
* - Native side measures the actual segmented control and updates state with frameSize
|
|
21
|
+
* - measureContent() returns the size from state for proper Yoga layout
|
|
22
|
+
* - Falls back to platform-specific defaults if state hasn't been set yet
|
|
23
|
+
*/
|
|
24
|
+
class MeasuringPCSegmentedControlShadowNode final : public ConcreteViewShadowNode<
|
|
25
|
+
PCSegmentedControlComponentName,
|
|
26
|
+
PCSegmentedControlProps,
|
|
27
|
+
PCSegmentedControlEventEmitter,
|
|
28
|
+
PCSegmentedControlStateFrameSize> {
|
|
29
|
+
public:
|
|
30
|
+
using ConcreteViewShadowNode::ConcreteViewShadowNode;
|
|
31
|
+
|
|
32
|
+
// Fallback heights used when native hasn't reported measurements yet
|
|
33
|
+
// iOS UISegmentedControl default height
|
|
34
|
+
static constexpr float kFallbackHeightIOS = 32.0f;
|
|
35
|
+
|
|
36
|
+
// Android MaterialButtonToggleGroup height
|
|
37
|
+
static constexpr float kFallbackHeightAndroid = 48.0f;
|
|
38
|
+
|
|
39
|
+
static ShadowNodeTraits BaseTraits() {
|
|
40
|
+
auto traits = ConcreteViewShadowNode::BaseTraits();
|
|
41
|
+
traits.set(ShadowNodeTraits::Trait::LeafYogaNode);
|
|
42
|
+
traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode);
|
|
43
|
+
return traits;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Called by Yoga when it needs the intrinsic size of the component.
|
|
48
|
+
* Returns the size provided by native through state, with fallback to
|
|
49
|
+
* platform-specific defaults if state hasn't been set.
|
|
50
|
+
*/
|
|
51
|
+
Size measureContent(
|
|
52
|
+
const LayoutContext& layoutContext,
|
|
53
|
+
const LayoutConstraints& layoutConstraints) const override;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
} // namespace facebook::react
|