react-native-platform-components 0.8.2 → 0.8.3
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/lib/commonjs/index.web.js +62 -0
- package/lib/commonjs/index.web.js.map +1 -0
- package/lib/module/index.web.js +56 -0
- package/lib/module/index.web.js.map +1 -0
- package/lib/typescript/commonjs/src/index.web.d.ts +92 -0
- package/lib/typescript/commonjs/src/index.web.d.ts.map +1 -0
- package/lib/typescript/module/src/index.web.d.ts +92 -0
- package/lib/typescript/module/src/index.web.d.ts.map +1 -0
- package/package.json +11 -1
- package/src/index.web.tsx +151 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isLiquidGlassSupported = exports.SelectionMenu = exports.SegmentedControl = exports.LiquidGlass = exports.DatePicker = exports.ContextMenu = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
// index.web.tsx
|
|
11
|
+
// Web stubs for react-native-platform-components
|
|
12
|
+
// These components are native-only and render nothing/children on web.
|
|
13
|
+
// This file is fully standalone to avoid importing native component specs.
|
|
14
|
+
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// Shared Types (duplicated to avoid importing from files with native deps)
|
|
17
|
+
// ============================================================================
|
|
18
|
+
|
|
19
|
+
// ============================================================================
|
|
20
|
+
// DatePicker
|
|
21
|
+
// ============================================================================
|
|
22
|
+
|
|
23
|
+
const DatePicker = _props => null;
|
|
24
|
+
|
|
25
|
+
// ============================================================================
|
|
26
|
+
// SelectionMenu
|
|
27
|
+
// ============================================================================
|
|
28
|
+
exports.DatePicker = DatePicker;
|
|
29
|
+
const SelectionMenu = _props => null;
|
|
30
|
+
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// ContextMenu
|
|
33
|
+
// ============================================================================
|
|
34
|
+
exports.SelectionMenu = SelectionMenu;
|
|
35
|
+
const ContextMenu = ({
|
|
36
|
+
children
|
|
37
|
+
}) => {
|
|
38
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
39
|
+
children: children
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// ============================================================================
|
|
44
|
+
// SegmentedControl
|
|
45
|
+
// ============================================================================
|
|
46
|
+
exports.ContextMenu = ContextMenu;
|
|
47
|
+
const SegmentedControl = _props => null;
|
|
48
|
+
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// LiquidGlass
|
|
51
|
+
// ============================================================================
|
|
52
|
+
exports.SegmentedControl = SegmentedControl;
|
|
53
|
+
const LiquidGlass = ({
|
|
54
|
+
children
|
|
55
|
+
}) => {
|
|
56
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
57
|
+
children: children
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
exports.LiquidGlass = LiquidGlass;
|
|
61
|
+
const isLiquidGlassSupported = exports.isLiquidGlassSupported = false;
|
|
62
|
+
//# sourceMappingURL=index.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_jsxRuntime","e","__esModule","default","DatePicker","_props","exports","SelectionMenu","ContextMenu","children","jsx","Fragment","SegmentedControl","LiquidGlass","isLiquidGlassSupported"],"sourceRoot":"../../src","sources":["index.web.tsx"],"mappings":";;;;;;AAKA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAL1B;AACA;AACA;AACA;;AAMA;AACA;AACA;;AAMA;AACA;AACA;;AAoBO,MAAMG,UAAU,GACrBC,MAAuB,IACO,IAAI;;AAEpC;AACA;AACA;AAAAC,OAAA,CAAAF,UAAA,GAAAA,UAAA;AAoBO,MAAMG,aAAa,GACxBF,MAA0B,IACI,IAAI;;AAEpC;AACA;AACA;AAAAC,OAAA,CAAAC,aAAA,GAAAA,aAAA;AAgCO,MAAMC,WAAW,GAAGA,CAAC;EAC1BC;AACgB,CAAC,KAAgC;EACjD,oBAAO,IAAAT,WAAA,CAAAU,GAAA,EAAAV,WAAA,CAAAW,QAAA;IAAAF,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;;AAED;AACA;AACA;AAAAH,OAAA,CAAAE,WAAA,GAAAA,WAAA;AAkBO,MAAMI,gBAAgB,GAC3BP,MAA6B,IACC,IAAI;;AAEpC;AACA;AACA;AAAAC,OAAA,CAAAM,gBAAA,GAAAA,gBAAA;AASO,MAAMC,WAAW,GAAGA,CAAC;EAC1BJ;AACgB,CAAC,KAAgC;EACjD,oBAAO,IAAAT,WAAA,CAAAU,GAAA,EAAAV,WAAA,CAAAW,QAAA;IAAAF,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;AAACH,OAAA,CAAAO,WAAA,GAAAA,WAAA;AAEK,MAAMC,sBAAsB,GAAAR,OAAA,CAAAQ,sBAAA,GAAG,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// index.web.tsx
|
|
4
|
+
// Web stubs for react-native-platform-components
|
|
5
|
+
// These components are native-only and render nothing/children on web.
|
|
6
|
+
// This file is fully standalone to avoid importing native component specs.
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Shared Types (duplicated to avoid importing from files with native deps)
|
|
12
|
+
// ============================================================================
|
|
13
|
+
|
|
14
|
+
// ============================================================================
|
|
15
|
+
// DatePicker
|
|
16
|
+
// ============================================================================
|
|
17
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
export const DatePicker = _props => null;
|
|
19
|
+
|
|
20
|
+
// ============================================================================
|
|
21
|
+
// SelectionMenu
|
|
22
|
+
// ============================================================================
|
|
23
|
+
|
|
24
|
+
export const SelectionMenu = _props => null;
|
|
25
|
+
|
|
26
|
+
// ============================================================================
|
|
27
|
+
// ContextMenu
|
|
28
|
+
// ============================================================================
|
|
29
|
+
|
|
30
|
+
export const ContextMenu = ({
|
|
31
|
+
children
|
|
32
|
+
}) => {
|
|
33
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
34
|
+
children: children
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// ============================================================================
|
|
39
|
+
// SegmentedControl
|
|
40
|
+
// ============================================================================
|
|
41
|
+
|
|
42
|
+
export const SegmentedControl = _props => null;
|
|
43
|
+
|
|
44
|
+
// ============================================================================
|
|
45
|
+
// LiquidGlass
|
|
46
|
+
// ============================================================================
|
|
47
|
+
|
|
48
|
+
export const LiquidGlass = ({
|
|
49
|
+
children
|
|
50
|
+
}) => {
|
|
51
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
52
|
+
children: children
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
export const isLiquidGlassSupported = false;
|
|
56
|
+
//# sourceMappingURL=index.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Fragment","_Fragment","jsx","_jsx","DatePicker","_props","SelectionMenu","ContextMenu","children","SegmentedControl","LiquidGlass","isLiquidGlassSupported"],"sourceRoot":"../../src","sources":["index.web.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;;AAIzB;AACA;AACA;;AAMA;AACA;AACA;AAAA,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AAoBA,OAAO,MAAMC,UAAU,GACrBC,MAAuB,IACO,IAAI;;AAEpC;AACA;AACA;;AAoBA,OAAO,MAAMC,aAAa,GACxBD,MAA0B,IACI,IAAI;;AAEpC;AACA;AACA;;AAgCA,OAAO,MAAME,WAAW,GAAGA,CAAC;EAC1BC;AACgB,CAAC,KAAgC;EACjD,oBAAOL,IAAA,CAAAF,SAAA;IAAAO,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;;AAED;AACA;AACA;;AAkBA,OAAO,MAAMC,gBAAgB,GAC3BJ,MAA6B,IACC,IAAI;;AAEpC;AACA;AACA;;AASA,OAAO,MAAMK,WAAW,GAAGA,CAAC;EAC1BF;AACgB,CAAC,KAAgC;EACjD,oBAAOL,IAAA,CAAAF,SAAA;IAAAO,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;AAED,OAAO,MAAMG,sBAAsB,GAAG,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
4
|
+
export type Visible = 'open' | 'closed';
|
|
5
|
+
export type Presentation = 'modal' | 'embedded';
|
|
6
|
+
export type AndroidMaterialMode = 'system' | 'm3';
|
|
7
|
+
export type DatePickerProps = {
|
|
8
|
+
style?: StyleProp<ViewStyle>;
|
|
9
|
+
date: Date | null;
|
|
10
|
+
minDate?: Date | null;
|
|
11
|
+
maxDate?: Date | null;
|
|
12
|
+
locale?: string;
|
|
13
|
+
timeZoneName?: string;
|
|
14
|
+
mode?: 'date' | 'time' | 'dateAndTime' | 'countDownTimer';
|
|
15
|
+
presentation?: 'modal' | 'embedded';
|
|
16
|
+
visible?: boolean;
|
|
17
|
+
onConfirm?: (dateTime: Date) => void;
|
|
18
|
+
onClosed?: () => void;
|
|
19
|
+
testID?: string;
|
|
20
|
+
ios?: Record<string, unknown>;
|
|
21
|
+
android?: Record<string, unknown>;
|
|
22
|
+
};
|
|
23
|
+
export declare const DatePicker: (_props: DatePickerProps) => React.ReactElement | null;
|
|
24
|
+
export type SelectionMenuOption = {
|
|
25
|
+
label: string;
|
|
26
|
+
data: string;
|
|
27
|
+
};
|
|
28
|
+
export interface SelectionMenuProps extends ViewProps {
|
|
29
|
+
options: readonly SelectionMenuOption[];
|
|
30
|
+
selected: string | null;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
presentation?: Presentation;
|
|
34
|
+
visible?: boolean;
|
|
35
|
+
onSelect?: (data: string, label: string, index: number) => void;
|
|
36
|
+
onRequestClose?: () => void;
|
|
37
|
+
ios?: Record<string, unknown>;
|
|
38
|
+
android?: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
export declare const SelectionMenu: (_props: SelectionMenuProps) => React.ReactElement | null;
|
|
41
|
+
export interface ContextMenuActionAttributes {
|
|
42
|
+
destructive?: boolean;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
hidden?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface ContextMenuAction {
|
|
47
|
+
id: string;
|
|
48
|
+
title: string;
|
|
49
|
+
subtitle?: string;
|
|
50
|
+
image?: string;
|
|
51
|
+
imageColor?: string;
|
|
52
|
+
attributes?: ContextMenuActionAttributes;
|
|
53
|
+
state?: 'off' | 'on' | 'mixed';
|
|
54
|
+
subactions?: ContextMenuAction[];
|
|
55
|
+
}
|
|
56
|
+
export interface ContextMenuProps extends ViewProps {
|
|
57
|
+
title?: string;
|
|
58
|
+
actions: readonly ContextMenuAction[];
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
trigger?: 'longPress' | 'tap';
|
|
61
|
+
onPressAction?: (actionId: string, actionTitle: string) => void;
|
|
62
|
+
onMenuOpen?: () => void;
|
|
63
|
+
onMenuClose?: () => void;
|
|
64
|
+
ios?: Record<string, unknown>;
|
|
65
|
+
android?: Record<string, unknown>;
|
|
66
|
+
children?: ReactNode;
|
|
67
|
+
}
|
|
68
|
+
export declare const ContextMenu: ({ children, }: ContextMenuProps) => React.ReactElement | null;
|
|
69
|
+
export interface SegmentedControlSegmentProps {
|
|
70
|
+
label: string;
|
|
71
|
+
value: string;
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
icon?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface SegmentedControlProps extends ViewProps {
|
|
76
|
+
segments: readonly SegmentedControlSegmentProps[];
|
|
77
|
+
selectedValue: string | null;
|
|
78
|
+
disabled?: boolean;
|
|
79
|
+
onSelect?: (value: string, index: number) => void;
|
|
80
|
+
ios?: Record<string, unknown>;
|
|
81
|
+
android?: Record<string, unknown>;
|
|
82
|
+
}
|
|
83
|
+
export declare const SegmentedControl: (_props: SegmentedControlProps) => React.ReactElement | null;
|
|
84
|
+
export interface LiquidGlassProps extends ViewProps {
|
|
85
|
+
cornerRadius?: number;
|
|
86
|
+
ios?: Record<string, unknown>;
|
|
87
|
+
android?: Record<string, unknown>;
|
|
88
|
+
children?: ReactNode;
|
|
89
|
+
}
|
|
90
|
+
export declare const LiquidGlass: ({ children, }: LiquidGlassProps) => React.ReactElement | null;
|
|
91
|
+
export declare const isLiquidGlassSupported = false;
|
|
92
|
+
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/index.web.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpE,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AACxC,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AAChD,MAAM,MAAM,mBAAmB,GAAG,QAAQ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AgB,KAAG,KAAK,CAAC,YAAY,GAAG,IAE1C,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAQ,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
4
|
+
export type Visible = 'open' | 'closed';
|
|
5
|
+
export type Presentation = 'modal' | 'embedded';
|
|
6
|
+
export type AndroidMaterialMode = 'system' | 'm3';
|
|
7
|
+
export type DatePickerProps = {
|
|
8
|
+
style?: StyleProp<ViewStyle>;
|
|
9
|
+
date: Date | null;
|
|
10
|
+
minDate?: Date | null;
|
|
11
|
+
maxDate?: Date | null;
|
|
12
|
+
locale?: string;
|
|
13
|
+
timeZoneName?: string;
|
|
14
|
+
mode?: 'date' | 'time' | 'dateAndTime' | 'countDownTimer';
|
|
15
|
+
presentation?: 'modal' | 'embedded';
|
|
16
|
+
visible?: boolean;
|
|
17
|
+
onConfirm?: (dateTime: Date) => void;
|
|
18
|
+
onClosed?: () => void;
|
|
19
|
+
testID?: string;
|
|
20
|
+
ios?: Record<string, unknown>;
|
|
21
|
+
android?: Record<string, unknown>;
|
|
22
|
+
};
|
|
23
|
+
export declare const DatePicker: (_props: DatePickerProps) => React.ReactElement | null;
|
|
24
|
+
export type SelectionMenuOption = {
|
|
25
|
+
label: string;
|
|
26
|
+
data: string;
|
|
27
|
+
};
|
|
28
|
+
export interface SelectionMenuProps extends ViewProps {
|
|
29
|
+
options: readonly SelectionMenuOption[];
|
|
30
|
+
selected: string | null;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
presentation?: Presentation;
|
|
34
|
+
visible?: boolean;
|
|
35
|
+
onSelect?: (data: string, label: string, index: number) => void;
|
|
36
|
+
onRequestClose?: () => void;
|
|
37
|
+
ios?: Record<string, unknown>;
|
|
38
|
+
android?: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
export declare const SelectionMenu: (_props: SelectionMenuProps) => React.ReactElement | null;
|
|
41
|
+
export interface ContextMenuActionAttributes {
|
|
42
|
+
destructive?: boolean;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
hidden?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface ContextMenuAction {
|
|
47
|
+
id: string;
|
|
48
|
+
title: string;
|
|
49
|
+
subtitle?: string;
|
|
50
|
+
image?: string;
|
|
51
|
+
imageColor?: string;
|
|
52
|
+
attributes?: ContextMenuActionAttributes;
|
|
53
|
+
state?: 'off' | 'on' | 'mixed';
|
|
54
|
+
subactions?: ContextMenuAction[];
|
|
55
|
+
}
|
|
56
|
+
export interface ContextMenuProps extends ViewProps {
|
|
57
|
+
title?: string;
|
|
58
|
+
actions: readonly ContextMenuAction[];
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
trigger?: 'longPress' | 'tap';
|
|
61
|
+
onPressAction?: (actionId: string, actionTitle: string) => void;
|
|
62
|
+
onMenuOpen?: () => void;
|
|
63
|
+
onMenuClose?: () => void;
|
|
64
|
+
ios?: Record<string, unknown>;
|
|
65
|
+
android?: Record<string, unknown>;
|
|
66
|
+
children?: ReactNode;
|
|
67
|
+
}
|
|
68
|
+
export declare const ContextMenu: ({ children, }: ContextMenuProps) => React.ReactElement | null;
|
|
69
|
+
export interface SegmentedControlSegmentProps {
|
|
70
|
+
label: string;
|
|
71
|
+
value: string;
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
icon?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface SegmentedControlProps extends ViewProps {
|
|
76
|
+
segments: readonly SegmentedControlSegmentProps[];
|
|
77
|
+
selectedValue: string | null;
|
|
78
|
+
disabled?: boolean;
|
|
79
|
+
onSelect?: (value: string, index: number) => void;
|
|
80
|
+
ios?: Record<string, unknown>;
|
|
81
|
+
android?: Record<string, unknown>;
|
|
82
|
+
}
|
|
83
|
+
export declare const SegmentedControl: (_props: SegmentedControlProps) => React.ReactElement | null;
|
|
84
|
+
export interface LiquidGlassProps extends ViewProps {
|
|
85
|
+
cornerRadius?: number;
|
|
86
|
+
ios?: Record<string, unknown>;
|
|
87
|
+
android?: Record<string, unknown>;
|
|
88
|
+
children?: ReactNode;
|
|
89
|
+
}
|
|
90
|
+
export declare const LiquidGlass: ({ children, }: LiquidGlassProps) => React.ReactElement | null;
|
|
91
|
+
export declare const isLiquidGlassSupported = false;
|
|
92
|
+
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/index.web.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpE,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AACxC,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AAChD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,IAAI,CAAC;AAMlD,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,GAAG,gBAAgB,CAAC;IAC1D,YAAY,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,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AAE,SAAS,4BAA4B,EAAE,CAAC;IAClD,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,qBAAqB,KAC5B,KAAK,CAAC,YAAY,GAAG,IAAY,CAAC;AAMrC,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,GAAI,eAEzB,gBAAgB,KAAG,KAAK,CAAC,YAAY,GAAG,IAE1C,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-platform-components",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
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
|
+
"browser": "./lib/module/index.web.js",
|
|
8
|
+
"react-native": "./lib/module/index.js",
|
|
7
9
|
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
8
10
|
"exports": {
|
|
9
11
|
".": {
|
|
10
12
|
"source": "./src/index.tsx",
|
|
13
|
+
"browser": {
|
|
14
|
+
"types": "./lib/typescript/module/src/index.web.d.ts",
|
|
15
|
+
"default": "./lib/module/index.web.js"
|
|
16
|
+
},
|
|
17
|
+
"react-native": {
|
|
18
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
19
|
+
"default": "./lib/module/index.js"
|
|
20
|
+
},
|
|
11
21
|
"import": {
|
|
12
22
|
"types": "./lib/typescript/module/src/index.d.ts",
|
|
13
23
|
"default": "./lib/module/index.js"
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// index.web.tsx
|
|
2
|
+
// Web stubs for react-native-platform-components
|
|
3
|
+
// These components are native-only and render nothing/children on web.
|
|
4
|
+
// This file is fully standalone to avoid importing native component specs.
|
|
5
|
+
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
9
|
+
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Shared Types (duplicated to avoid importing from files with native deps)
|
|
12
|
+
// ============================================================================
|
|
13
|
+
|
|
14
|
+
export type Visible = 'open' | 'closed';
|
|
15
|
+
export type Presentation = 'modal' | 'embedded';
|
|
16
|
+
export type AndroidMaterialMode = 'system' | 'm3';
|
|
17
|
+
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// DatePicker
|
|
20
|
+
// ============================================================================
|
|
21
|
+
|
|
22
|
+
export type DatePickerProps = {
|
|
23
|
+
style?: StyleProp<ViewStyle>;
|
|
24
|
+
date: Date | null;
|
|
25
|
+
minDate?: Date | null;
|
|
26
|
+
maxDate?: Date | null;
|
|
27
|
+
locale?: string;
|
|
28
|
+
|
|
29
|
+
timeZoneName?: string;
|
|
30
|
+
mode?: 'date' | 'time' | 'dateAndTime' | 'countDownTimer';
|
|
31
|
+
presentation?: 'modal' | 'embedded';
|
|
32
|
+
visible?: boolean;
|
|
33
|
+
onConfirm?: (dateTime: Date) => void;
|
|
34
|
+
onClosed?: () => void;
|
|
35
|
+
testID?: string;
|
|
36
|
+
ios?: Record<string, unknown>;
|
|
37
|
+
android?: Record<string, unknown>;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const DatePicker = (
|
|
41
|
+
_props: DatePickerProps
|
|
42
|
+
): React.ReactElement | null => null;
|
|
43
|
+
|
|
44
|
+
// ============================================================================
|
|
45
|
+
// SelectionMenu
|
|
46
|
+
// ============================================================================
|
|
47
|
+
|
|
48
|
+
export type SelectionMenuOption = {
|
|
49
|
+
label: string;
|
|
50
|
+
data: string;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export interface SelectionMenuProps extends ViewProps {
|
|
54
|
+
options: readonly SelectionMenuOption[];
|
|
55
|
+
selected: string | null;
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
placeholder?: string;
|
|
58
|
+
presentation?: Presentation;
|
|
59
|
+
visible?: boolean;
|
|
60
|
+
onSelect?: (data: string, label: string, index: number) => void;
|
|
61
|
+
onRequestClose?: () => void;
|
|
62
|
+
ios?: Record<string, unknown>;
|
|
63
|
+
android?: Record<string, unknown>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const SelectionMenu = (
|
|
67
|
+
_props: SelectionMenuProps
|
|
68
|
+
): React.ReactElement | null => null;
|
|
69
|
+
|
|
70
|
+
// ============================================================================
|
|
71
|
+
// ContextMenu
|
|
72
|
+
// ============================================================================
|
|
73
|
+
|
|
74
|
+
export interface ContextMenuActionAttributes {
|
|
75
|
+
destructive?: boolean;
|
|
76
|
+
disabled?: boolean;
|
|
77
|
+
hidden?: boolean;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ContextMenuAction {
|
|
81
|
+
id: string;
|
|
82
|
+
title: string;
|
|
83
|
+
subtitle?: string;
|
|
84
|
+
image?: string;
|
|
85
|
+
imageColor?: string;
|
|
86
|
+
attributes?: ContextMenuActionAttributes;
|
|
87
|
+
state?: 'off' | 'on' | 'mixed';
|
|
88
|
+
subactions?: ContextMenuAction[];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface ContextMenuProps extends ViewProps {
|
|
92
|
+
title?: string;
|
|
93
|
+
actions: readonly ContextMenuAction[];
|
|
94
|
+
disabled?: boolean;
|
|
95
|
+
trigger?: 'longPress' | 'tap';
|
|
96
|
+
onPressAction?: (actionId: string, actionTitle: string) => void;
|
|
97
|
+
onMenuOpen?: () => void;
|
|
98
|
+
onMenuClose?: () => void;
|
|
99
|
+
ios?: Record<string, unknown>;
|
|
100
|
+
android?: Record<string, unknown>;
|
|
101
|
+
children?: ReactNode;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export const ContextMenu = ({
|
|
105
|
+
children,
|
|
106
|
+
}: ContextMenuProps): React.ReactElement | null => {
|
|
107
|
+
return <>{children}</>;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// ============================================================================
|
|
111
|
+
// SegmentedControl
|
|
112
|
+
// ============================================================================
|
|
113
|
+
|
|
114
|
+
export interface SegmentedControlSegmentProps {
|
|
115
|
+
label: string;
|
|
116
|
+
value: string;
|
|
117
|
+
disabled?: boolean;
|
|
118
|
+
icon?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface SegmentedControlProps extends ViewProps {
|
|
122
|
+
segments: readonly SegmentedControlSegmentProps[];
|
|
123
|
+
selectedValue: string | null;
|
|
124
|
+
disabled?: boolean;
|
|
125
|
+
onSelect?: (value: string, index: number) => void;
|
|
126
|
+
ios?: Record<string, unknown>;
|
|
127
|
+
android?: Record<string, unknown>;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const SegmentedControl = (
|
|
131
|
+
_props: SegmentedControlProps
|
|
132
|
+
): React.ReactElement | null => null;
|
|
133
|
+
|
|
134
|
+
// ============================================================================
|
|
135
|
+
// LiquidGlass
|
|
136
|
+
// ============================================================================
|
|
137
|
+
|
|
138
|
+
export interface LiquidGlassProps extends ViewProps {
|
|
139
|
+
cornerRadius?: number;
|
|
140
|
+
ios?: Record<string, unknown>;
|
|
141
|
+
android?: Record<string, unknown>;
|
|
142
|
+
children?: ReactNode;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export const LiquidGlass = ({
|
|
146
|
+
children,
|
|
147
|
+
}: LiquidGlassProps): React.ReactElement | null => {
|
|
148
|
+
return <>{children}</>;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export const isLiquidGlassSupported = false;
|