@expo/ui 1.0.0-canary-20250304-f08e984 → 1.0.0-canary-20250306-d9d3e02
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/CHANGELOG.md +2 -0
- package/build/components/Button/index.d.ts +24 -7
- package/build/components/Button/index.d.ts.map +1 -1
- package/build/components/ContextMenu/index.d.ts +12 -3
- package/build/components/ContextMenu/index.d.ts.map +1 -1
- package/build/components/DatePicker/index.d.ts +2 -3
- package/build/components/DatePicker/index.d.ts.map +1 -1
- package/build/components/Picker/index.d.ts +22 -14
- package/build/components/Picker/index.d.ts.map +1 -1
- package/build/components/Section/index.d.ts +1 -5
- package/build/components/Section/index.d.ts.map +1 -1
- package/build/components/Section/index.ios.d.ts +1 -6
- package/build/components/Section/index.ios.d.ts.map +1 -1
- package/build/components/Slider/index.d.ts +13 -8
- package/build/components/Slider/index.d.ts.map +1 -1
- package/build/components/TextInput/index.d.ts +1 -1
- package/build/components/TextInput/index.d.ts.map +1 -1
- package/build/src/types.d.ts +13 -0
- package/build/src/types.d.ts.map +1 -0
- package/components/Button/index.tsx +25 -7
- package/components/ContextMenu/index.tsx +10 -1
- package/components/DatePicker/index.tsx +1 -2
- package/components/Picker/index.tsx +24 -14
- package/components/Section/index.ios.tsx +1 -6
- package/components/Section/index.tsx +3 -48
- package/components/Slider/index.tsx +14 -8
- package/components/TextInput/index.tsx +1 -1
- package/package.json +3 -5
- package/src/types.ts +16 -0
- package/tsconfig.json +1 -1
- package/build/src/index.d.ts +0 -13
- package/build/src/index.d.ts.map +0 -1
- package/src/index.ts +0 -22
package/CHANGELOG.md
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
### 💡 Others
|
|
24
24
|
|
|
25
|
+
- Drop section polyfill for Android ([#35305](https://github.com/expo/expo/pull/35305) by [@aleqsio](https://github.com/aleqsio))
|
|
25
26
|
- Standardize platform key ordering in `expo-module.config.json`. ([#35003](https://github.com/expo/expo/pull/35003) by [@reichhartd](https://github.com/reichhartd))
|
|
26
27
|
|
|
27
28
|
## 0.0.2 — 2025-02-11
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
|
|
45
46
|
### 💡 Others
|
|
46
47
|
|
|
48
|
+
- Add docs ([#34808](https://github.com/expo/expo/pull/34808) by [@aleqsio](https://github.com/aleqsio))
|
|
47
49
|
- [apple] Migrate remaining `expo-module.config.json` to unified platform syntax. ([#34445](https://github.com/expo/expo/pull/34445) by [@reichhartd](https://github.com/reichhartd))
|
|
48
50
|
- Rename the events for the `Switch` component. ([#34577](https://github.com/expo/expo/pull/34577) by [@behenate](https://github.com/behenate))
|
|
49
51
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
2
|
import { MaterialIcon } from './types';
|
|
3
|
-
import { ViewEvent } from '../../src';
|
|
3
|
+
import { ViewEvent } from '../../src/types';
|
|
4
4
|
/**
|
|
5
5
|
* The role of the button.
|
|
6
6
|
* - `default` - The default button role.
|
|
@@ -11,10 +11,12 @@ import { ViewEvent } from '../../src';
|
|
|
11
11
|
export type ButtonRole = 'default' | 'cancel' | 'destructive';
|
|
12
12
|
/**
|
|
13
13
|
* The built-in button styles available on iOS and Android.
|
|
14
|
+
*
|
|
14
15
|
* Common styles:
|
|
15
16
|
* - `default` - The default system button style.
|
|
16
17
|
* - `bordered` - A button with a light fill. On Android equivalent to `FilledTonalButton`.
|
|
17
18
|
* - `borderless` - A button with no background or border. On Android equivalent to `TextButton`.
|
|
19
|
+
*
|
|
18
20
|
* Apple-only styles:
|
|
19
21
|
* - `borderedProminent` - A bordered button with a prominent appearance.
|
|
20
22
|
* - `plain` - A button with no border or background and a less prominent text.
|
|
@@ -23,11 +25,22 @@ export type ButtonRole = 'default' | 'cancel' | 'destructive';
|
|
|
23
25
|
* - `accessoryBarAction` - A button style for accessory bar actions.
|
|
24
26
|
* - `card` - A button style for cards.
|
|
25
27
|
* - `link` - A button style for links.
|
|
28
|
+
*
|
|
26
29
|
* Android-only styles:
|
|
27
30
|
* - `outlined` - A button with an outline.
|
|
28
31
|
* - `elevated` - A filled button with a shadow.
|
|
29
32
|
*/
|
|
30
33
|
export type ButtonVariant = 'default' | 'bordered' | 'plain' | 'borderedProminent' | 'borderless' | 'accessoryBar' | 'accessoryBarAction' | 'card' | 'link' | 'outlined' | 'elevated';
|
|
34
|
+
/**
|
|
35
|
+
* Colors for button's core elements.
|
|
36
|
+
* @platform android
|
|
37
|
+
*/
|
|
38
|
+
export type ButtonElementColors = {
|
|
39
|
+
containerColor?: string;
|
|
40
|
+
contentColor?: string;
|
|
41
|
+
disabledContainerColor?: string;
|
|
42
|
+
disabledContentColor?: string;
|
|
43
|
+
};
|
|
31
44
|
export type ButtonProps = {
|
|
32
45
|
/**
|
|
33
46
|
* A callback that is called when the button is pressed.
|
|
@@ -62,12 +75,7 @@ export type ButtonProps = {
|
|
|
62
75
|
* Colors for button's core elements.
|
|
63
76
|
* @platform android
|
|
64
77
|
*/
|
|
65
|
-
elementColors?:
|
|
66
|
-
containerColor?: string;
|
|
67
|
-
contentColor?: string;
|
|
68
|
-
disabledContainerColor?: string;
|
|
69
|
-
disabledContentColor?: string;
|
|
70
|
-
};
|
|
78
|
+
elementColors?: ButtonElementColors;
|
|
71
79
|
/**
|
|
72
80
|
* Button color.
|
|
73
81
|
*/
|
|
@@ -77,11 +85,20 @@ export type ButtonProps = {
|
|
|
77
85
|
*/
|
|
78
86
|
disabled?: boolean;
|
|
79
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* @hidden
|
|
90
|
+
*/
|
|
80
91
|
export type NativeButtonProps = Omit<ButtonProps, 'role' | 'onPress' | 'children' | 'systemImage'> & {
|
|
81
92
|
buttonRole?: ButtonRole;
|
|
82
93
|
text: string;
|
|
83
94
|
systemImage?: string;
|
|
84
95
|
} & ViewEvent<'onButtonPressed', void>;
|
|
96
|
+
/**
|
|
97
|
+
* @hidden
|
|
98
|
+
*/
|
|
85
99
|
export declare function transformButtonProps(props: ButtonProps): NativeButtonProps;
|
|
100
|
+
/**
|
|
101
|
+
* Displays a native button component.
|
|
102
|
+
*/
|
|
86
103
|
export declare function Button(props: ButtonProps): import("react").JSX.Element;
|
|
87
104
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Button/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAc,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Button/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAc,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,aAAa,GAErB,SAAS,GACT,UAAU,GACV,OAAO,GAEP,mBAAmB,GACnB,YAAY,GAEZ,cAAc,GACd,oBAAoB,GACpB,MAAM,GACN,MAAM,GAEN,UAAU,GACV,UAAU,CAAC;AAEf;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE;QACZ,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,YAAY,CAAC;KACxB,CAAC;IACF;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,WAAW,EACX,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAChD,GAAG;IACF,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;AAQvC;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,iBAAiB,CAgB1E;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAWxC"}
|
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { ButtonProps } from '../Button';
|
|
4
4
|
import { PickerProps } from '../Picker';
|
|
5
5
|
import { SwitchProps } from '../Switch';
|
|
6
6
|
type SubmenuElement = ReactElement<ButtonProps> | ReactElement<SwitchProps> | ReactElement<PickerProps> | ReactElement<SubmenuProps>;
|
|
7
7
|
type ContentChildren = SubmenuElement | SubmenuElement[];
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
8
11
|
export type ContextMenuContentProps = {
|
|
9
12
|
children: ContentChildren;
|
|
10
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
11
17
|
export type EventHandlers = {
|
|
12
18
|
[key: string]: {
|
|
13
19
|
[key: string]: (event: NativeSyntheticEvent<any>) => void;
|
|
14
20
|
};
|
|
15
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
16
25
|
export type ContextMenuElementBase = {
|
|
17
26
|
contextMenuElementID: string;
|
|
18
27
|
};
|
|
@@ -71,7 +80,7 @@ export type SubmenuProps = {
|
|
|
71
80
|
* The `Submenu` component is used to create a nested context menu. Submenus can be infinitely nested.
|
|
72
81
|
* Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple titled sections.
|
|
73
82
|
*/
|
|
74
|
-
export declare function Submenu(props: SubmenuProps):
|
|
83
|
+
export declare function Submenu(props: SubmenuProps): import("react").JSX.Element;
|
|
75
84
|
/**
|
|
76
85
|
* `ContextMenu` allows you to create a context menu, which can be used to provide additional options to the user.
|
|
77
86
|
*
|
|
@@ -81,6 +90,6 @@ export declare function Submenu(props: SubmenuProps): React.JSX.Element;
|
|
|
81
90
|
* - Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple sections. The `title` prop of the `Button`, which opens the submenu on iOS will be used as a section title.
|
|
82
91
|
* - Android does not support showing a `Picker` element in the context menu.
|
|
83
92
|
*/
|
|
84
|
-
export declare function ContextMenu(props: ContextMenuProps):
|
|
93
|
+
export declare function ContextMenu(props: ContextMenuProps): import("react").JSX.Element;
|
|
85
94
|
export {};
|
|
86
95
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/ContextMenu/index.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/ContextMenu/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGxC,KAAK,cAAc,GACf,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,YAAY,CAAC,CAAC;AAE/B,KAAK,eAAe,GAAG,cAAc,GAAG,cAAc,EAAE,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,oBAAoB,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;KAC3D,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IAAE,oBAAoB,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,WAAW,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;IAEnD;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACxC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AA2BF;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAE1C;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAwBlD"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import { ViewEvent } from '../../src';
|
|
2
|
+
import { ViewEvent } from '../../src/types';
|
|
4
3
|
type AndroidVariant = 'picker' | 'input';
|
|
5
4
|
type IOSVariant = 'wheel' | 'automatic' | 'graphical' | 'compact';
|
|
6
5
|
type DisplayedComponents = 'date' | 'hourAndMinute' | 'dateAndTime';
|
|
@@ -68,6 +67,6 @@ type NativeDatePickerProps = Omit<DatePickerProps, 'iosVariant' | 'androidVarian
|
|
|
68
67
|
date: Date;
|
|
69
68
|
}>;
|
|
70
69
|
export declare function transformDatePickerProps(props: DatePickerProps): NativeDatePickerProps;
|
|
71
|
-
export declare function DateTimePicker(props: DatePickerProps):
|
|
70
|
+
export declare function DateTimePicker(props: DatePickerProps): import("react").JSX.Element;
|
|
72
71
|
export {};
|
|
73
72
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/DatePicker/index.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/DatePicker/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,KAAK,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzC,KAAK,UAAU,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC;AAElE,KAAK,mBAAmB,GAAG,MAAM,GAAG,eAAe,GAAG,aAAa,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,KAAK,qBAAqB,GAAG,IAAI,CAC/B,eAAe,EACf,YAAY,GAAG,gBAAgB,GAAG,gBAAgB,CACnD,GAAG;IACF,OAAO,CAAC,EAAE,UAAU,GAAG,cAAc,CAAC;CACvC,GAAG,SAAS,CAAC,gBAAgB,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC;AAEhD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,eAAe,GAAG,qBAAqB,CAStF;AAOD,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,+BAEpD"}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Colors for picker's core elements.
|
|
4
|
+
* @platform android
|
|
5
|
+
*/
|
|
6
|
+
export type PickerElementColors = {
|
|
7
|
+
activeBorderColor?: string;
|
|
8
|
+
activeContentColor?: string;
|
|
9
|
+
inactiveBorderColor?: string;
|
|
10
|
+
inactiveContentColor?: string;
|
|
11
|
+
disabledActiveBorderColor?: string;
|
|
12
|
+
disabledActiveContentColor?: string;
|
|
13
|
+
disabledInactiveBorderColor?: string;
|
|
14
|
+
disabledInactiveContentColor?: string;
|
|
15
|
+
activeContainerColor?: string;
|
|
16
|
+
inactiveContainerColor?: string;
|
|
17
|
+
disabledActiveContainerColor?: string;
|
|
18
|
+
disabledInactiveContainerColor?: string;
|
|
19
|
+
};
|
|
2
20
|
/**
|
|
3
21
|
* Props for the Picker component.
|
|
4
22
|
*/
|
|
@@ -39,20 +57,7 @@ export type PickerProps = {
|
|
|
39
57
|
* Colors for picker's core elements.
|
|
40
58
|
* @platform android
|
|
41
59
|
*/
|
|
42
|
-
elementColors?:
|
|
43
|
-
activeBorderColor?: string;
|
|
44
|
-
activeContentColor?: string;
|
|
45
|
-
inactiveBorderColor?: string;
|
|
46
|
-
inactiveContentColor?: string;
|
|
47
|
-
disabledActiveBorderColor?: string;
|
|
48
|
-
disabledActiveContentColor?: string;
|
|
49
|
-
disabledInactiveBorderColor?: string;
|
|
50
|
-
disabledInactiveContentColor?: string;
|
|
51
|
-
activeContainerColor?: string;
|
|
52
|
-
inactiveContainerColor?: string;
|
|
53
|
-
disabledActiveContainerColor?: string;
|
|
54
|
-
disabledInactiveContainerColor?: string;
|
|
55
|
-
};
|
|
60
|
+
elementColors?: PickerElementColors;
|
|
56
61
|
/**
|
|
57
62
|
* Picker color. On iOS it only applies to the `menu` variant.
|
|
58
63
|
*/
|
|
@@ -60,6 +65,9 @@ export type PickerProps = {
|
|
|
60
65
|
};
|
|
61
66
|
type NativePickerProps = PickerProps;
|
|
62
67
|
export declare function transformPickerProps(props: PickerProps): NativePickerProps;
|
|
68
|
+
/**
|
|
69
|
+
* Displays a native picker component. Depending on the variant it can be a segmented button, an inline picker, a list of choices or a radio button.
|
|
70
|
+
*/
|
|
63
71
|
export declare function Picker(props: PickerProps): import("react").JSX.Element;
|
|
64
72
|
export {};
|
|
65
73
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Picker/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Picker/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,8BAA8B,CAAC,EAAE,MAAM,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IACtF;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;IACnD;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;;OAGG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAOF,KAAK,iBAAiB,GAAG,WAAW,CAAC;AAErC,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,iBAAiB,CAa1E;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAExC"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
export type SectionProps = {
|
|
4
3
|
style?: StyleProp<ViewStyle>;
|
|
5
4
|
title: string;
|
|
6
5
|
children: any;
|
|
7
6
|
};
|
|
8
|
-
export declare function Section({
|
|
9
|
-
title: string;
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
}): React.JSX.Element;
|
|
7
|
+
export declare function Section({ children }: SectionProps): any;
|
|
12
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Section/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Section/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,YAAY,OAEjD"}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type SectionProps = {
|
|
3
|
-
title: string;
|
|
4
|
-
style?: StyleProp<ViewStyle>;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
};
|
|
1
|
+
import { SectionProps } from '.';
|
|
7
2
|
export declare function Section(props: SectionProps): import("react").JSX.Element;
|
|
8
3
|
//# sourceMappingURL=index.ios.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.ios.d.ts","sourceRoot":"","sources":["../../../components/Section/index.ios.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.ios.d.ts","sourceRoot":"","sources":["../../../components/Section/index.ios.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;AAOjC,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAE1C"}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
import { ViewEvent } from '../../src';
|
|
2
|
+
import { ViewEvent } from '../../src/types';
|
|
3
|
+
/**
|
|
4
|
+
* Colors for slider's core elements.
|
|
5
|
+
* @platform android
|
|
6
|
+
*/
|
|
7
|
+
export type SliderElementColors = {
|
|
8
|
+
thumbColor?: string;
|
|
9
|
+
activeTrackColor?: string;
|
|
10
|
+
inactiveTrackColor?: string;
|
|
11
|
+
activeTickColor?: string;
|
|
12
|
+
inactiveTickColor?: string;
|
|
13
|
+
};
|
|
3
14
|
export type SliderProps = {
|
|
4
15
|
/**
|
|
5
16
|
* Custom styles for the slider component.
|
|
@@ -29,13 +40,7 @@ export type SliderProps = {
|
|
|
29
40
|
* Colors for slider's core elements.
|
|
30
41
|
* @platform android
|
|
31
42
|
*/
|
|
32
|
-
elementColors?:
|
|
33
|
-
thumbColor?: string;
|
|
34
|
-
activeTrackColor?: string;
|
|
35
|
-
inactiveTrackColor?: string;
|
|
36
|
-
activeTickColor?: string;
|
|
37
|
-
inactiveTickColor?: string;
|
|
38
|
-
};
|
|
43
|
+
elementColors?: SliderElementColors;
|
|
39
44
|
/**
|
|
40
45
|
* Slider color.
|
|
41
46
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Slider/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Slider/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,KAAK,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,GACzD,SAAS,CAAC,gBAAgB,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAOjD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,iBAAiB,CAqB1E;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAExC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/TextInput/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/TextInput/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,YAAY,CAAC,EACT,SAAS,GACT,eAAe,GACf,SAAS,GACT,WAAW,GACX,eAAe,GACf,yBAAyB,GACzB,KAAK,GACL,gBAAgB,GAChB,aAAa,GACb,SAAS,GACT,YAAY,GACZ,0BAA0B,CAAC;IAC/B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,SAAS,CACpF,gBAAgB,EAChB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CACtC,CAAC;AAiBJ,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BAE9C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type * from '../components/Switch';
|
|
2
|
+
export type * from '../components/Picker';
|
|
3
|
+
export type * from '../components/Button';
|
|
4
|
+
export type * from '../components/ContextMenu';
|
|
5
|
+
export type * from '../components/Section';
|
|
6
|
+
export type * from '../components/Slider';
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export type ViewEvent<Name extends string, Data> = Record<Name, Data extends object ? ((event: {
|
|
11
|
+
nativeEvent: Data;
|
|
12
|
+
}) => void) | undefined : (() => void) | undefined>;
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,sBAAsB,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,IAAI,SAAS,MAAM,EAAE,IAAI,IAAI,MAAM,CACvD,IAAI,EACJ,IAAI,SAAS,MAAM,GACf,CAAC,CAAC,KAAK,EAAE;IAAE,WAAW,EAAE,IAAI,CAAA;CAAE,KAAK,IAAI,CAAC,GAAG,SAAS,GACpD,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAC7B,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { requireNativeView } from 'expo';
|
|
|
2
2
|
import { Platform, StyleProp, StyleSheet, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { MaterialIcon } from './types';
|
|
5
|
-
import { ViewEvent } from '../../src';
|
|
5
|
+
import { ViewEvent } from '../../src/types';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The role of the button.
|
|
@@ -15,10 +15,12 @@ export type ButtonRole = 'default' | 'cancel' | 'destructive';
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* The built-in button styles available on iOS and Android.
|
|
18
|
+
*
|
|
18
19
|
* Common styles:
|
|
19
20
|
* - `default` - The default system button style.
|
|
20
21
|
* - `bordered` - A button with a light fill. On Android equivalent to `FilledTonalButton`.
|
|
21
22
|
* - `borderless` - A button with no background or border. On Android equivalent to `TextButton`.
|
|
23
|
+
*
|
|
22
24
|
* Apple-only styles:
|
|
23
25
|
* - `borderedProminent` - A bordered button with a prominent appearance.
|
|
24
26
|
* - `plain` - A button with no border or background and a less prominent text.
|
|
@@ -27,6 +29,7 @@ export type ButtonRole = 'default' | 'cancel' | 'destructive';
|
|
|
27
29
|
* - `accessoryBarAction` - A button style for accessory bar actions.
|
|
28
30
|
* - `card` - A button style for cards.
|
|
29
31
|
* - `link` - A button style for links.
|
|
32
|
+
*
|
|
30
33
|
* Android-only styles:
|
|
31
34
|
* - `outlined` - A button with an outline.
|
|
32
35
|
* - `elevated` - A filled button with a shadow.
|
|
@@ -48,6 +51,17 @@ export type ButtonVariant =
|
|
|
48
51
|
| 'outlined'
|
|
49
52
|
| 'elevated';
|
|
50
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Colors for button's core elements.
|
|
56
|
+
* @platform android
|
|
57
|
+
*/
|
|
58
|
+
export type ButtonElementColors = {
|
|
59
|
+
containerColor?: string;
|
|
60
|
+
contentColor?: string;
|
|
61
|
+
disabledContainerColor?: string;
|
|
62
|
+
disabledContentColor?: string;
|
|
63
|
+
};
|
|
64
|
+
|
|
51
65
|
export type ButtonProps = {
|
|
52
66
|
/**
|
|
53
67
|
* A callback that is called when the button is pressed.
|
|
@@ -82,12 +96,7 @@ export type ButtonProps = {
|
|
|
82
96
|
* Colors for button's core elements.
|
|
83
97
|
* @platform android
|
|
84
98
|
*/
|
|
85
|
-
elementColors?:
|
|
86
|
-
containerColor?: string;
|
|
87
|
-
contentColor?: string;
|
|
88
|
-
disabledContainerColor?: string;
|
|
89
|
-
disabledContentColor?: string;
|
|
90
|
-
};
|
|
99
|
+
elementColors?: ButtonElementColors;
|
|
91
100
|
/**
|
|
92
101
|
* Button color.
|
|
93
102
|
*/
|
|
@@ -98,6 +107,9 @@ export type ButtonProps = {
|
|
|
98
107
|
disabled?: boolean;
|
|
99
108
|
};
|
|
100
109
|
|
|
110
|
+
/**
|
|
111
|
+
* @hidden
|
|
112
|
+
*/
|
|
101
113
|
export type NativeButtonProps = Omit<
|
|
102
114
|
ButtonProps,
|
|
103
115
|
'role' | 'onPress' | 'children' | 'systemImage'
|
|
@@ -113,6 +125,9 @@ const ButtonNativeView: React.ComponentType<NativeButtonProps> = requireNativeVi
|
|
|
113
125
|
'Button'
|
|
114
126
|
);
|
|
115
127
|
|
|
128
|
+
/**
|
|
129
|
+
* @hidden
|
|
130
|
+
*/
|
|
116
131
|
export function transformButtonProps(props: ButtonProps): NativeButtonProps {
|
|
117
132
|
const { role, children, onPress, systemImage, ...restProps } = props;
|
|
118
133
|
return {
|
|
@@ -131,6 +146,9 @@ export function transformButtonProps(props: ButtonProps): NativeButtonProps {
|
|
|
131
146
|
};
|
|
132
147
|
}
|
|
133
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Displays a native button component.
|
|
151
|
+
*/
|
|
134
152
|
export function Button(props: ButtonProps) {
|
|
135
153
|
// Min height from https://m3.material.io/components/buttons/specs, minWidth
|
|
136
154
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import
|
|
2
|
+
import { ReactElement, ReactNode, useMemo } from 'react';
|
|
3
3
|
import { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import { ButtonProps } from '../Button';
|
|
@@ -15,16 +15,25 @@ type SubmenuElement =
|
|
|
15
15
|
|
|
16
16
|
type ContentChildren = SubmenuElement | SubmenuElement[];
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
18
21
|
export type ContextMenuContentProps = {
|
|
19
22
|
children: ContentChildren;
|
|
20
23
|
};
|
|
21
24
|
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
22
28
|
export type EventHandlers = {
|
|
23
29
|
[key: string]: {
|
|
24
30
|
[key: string]: (event: NativeSyntheticEvent<any>) => void;
|
|
25
31
|
};
|
|
26
32
|
};
|
|
27
33
|
|
|
34
|
+
/**
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
28
37
|
export type ContextMenuElementBase = { contextMenuElementID: string };
|
|
29
38
|
|
|
30
39
|
/**
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { Platform } from 'expo-modules-core';
|
|
3
|
-
import React from 'react';
|
|
4
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
5
4
|
|
|
6
|
-
import { ViewEvent } from '../../src';
|
|
5
|
+
import { ViewEvent } from '../../src/types';
|
|
7
6
|
|
|
8
7
|
type AndroidVariant = 'picker' | 'input';
|
|
9
8
|
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Colors for picker's core elements.
|
|
6
|
+
* @platform android
|
|
7
|
+
*/
|
|
8
|
+
export type PickerElementColors = {
|
|
9
|
+
activeBorderColor?: string;
|
|
10
|
+
activeContentColor?: string;
|
|
11
|
+
inactiveBorderColor?: string;
|
|
12
|
+
inactiveContentColor?: string;
|
|
13
|
+
disabledActiveBorderColor?: string;
|
|
14
|
+
disabledActiveContentColor?: string;
|
|
15
|
+
disabledInactiveBorderColor?: string;
|
|
16
|
+
disabledInactiveContentColor?: string;
|
|
17
|
+
activeContainerColor?: string;
|
|
18
|
+
inactiveContainerColor?: string;
|
|
19
|
+
disabledActiveContainerColor?: string;
|
|
20
|
+
disabledInactiveContainerColor?: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
4
23
|
/**
|
|
5
24
|
* Props for the Picker component.
|
|
6
25
|
*/
|
|
@@ -32,24 +51,12 @@ export type PickerProps = {
|
|
|
32
51
|
* Optional style to apply to the picker component.
|
|
33
52
|
*/
|
|
34
53
|
style?: StyleProp<ViewStyle>;
|
|
54
|
+
|
|
35
55
|
/**
|
|
36
56
|
* Colors for picker's core elements.
|
|
37
57
|
* @platform android
|
|
38
58
|
*/
|
|
39
|
-
elementColors?:
|
|
40
|
-
activeBorderColor?: string;
|
|
41
|
-
activeContentColor?: string;
|
|
42
|
-
inactiveBorderColor?: string;
|
|
43
|
-
inactiveContentColor?: string;
|
|
44
|
-
disabledActiveBorderColor?: string;
|
|
45
|
-
disabledActiveContentColor?: string;
|
|
46
|
-
disabledInactiveBorderColor?: string;
|
|
47
|
-
disabledInactiveContentColor?: string;
|
|
48
|
-
activeContainerColor?: string;
|
|
49
|
-
inactiveContainerColor?: string;
|
|
50
|
-
disabledActiveContainerColor?: string;
|
|
51
|
-
disabledInactiveContainerColor?: string;
|
|
52
|
-
};
|
|
59
|
+
elementColors?: PickerElementColors;
|
|
53
60
|
/**
|
|
54
61
|
* Picker color. On iOS it only applies to the `menu` variant.
|
|
55
62
|
*/
|
|
@@ -78,6 +85,9 @@ export function transformPickerProps(props: PickerProps): NativePickerProps {
|
|
|
78
85
|
};
|
|
79
86
|
}
|
|
80
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Displays a native picker component. Depending on the variant it can be a segmented button, an inline picker, a list of choices or a radio button.
|
|
90
|
+
*/
|
|
81
91
|
export function Picker(props: PickerProps) {
|
|
82
92
|
return <PickerNativeView {...transformPickerProps(props)} />;
|
|
83
93
|
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
title: string;
|
|
6
|
-
style?: StyleProp<ViewStyle>;
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
};
|
|
3
|
+
import { SectionProps } from '.';
|
|
9
4
|
|
|
10
5
|
const SectionNativeView: React.ComponentType<SectionProps> = requireNativeView(
|
|
11
6
|
'ExpoUI',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-native';
|
|
1
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
|
|
4
3
|
export type SectionProps = {
|
|
5
4
|
style?: StyleProp<ViewStyle>;
|
|
@@ -7,50 +6,6 @@ export type SectionProps = {
|
|
|
7
6
|
children: any;
|
|
8
7
|
};
|
|
9
8
|
|
|
10
|
-
function
|
|
11
|
-
return
|
|
12
|
-
<View
|
|
13
|
-
style={{
|
|
14
|
-
borderRadius: 12,
|
|
15
|
-
margin: 12,
|
|
16
|
-
paddingVertical: 24,
|
|
17
|
-
borderColor: '#CAC4D0',
|
|
18
|
-
backgroundColor: '#F7F2FA',
|
|
19
|
-
borderWidth: 1,
|
|
20
|
-
}}>
|
|
21
|
-
{props.children}
|
|
22
|
-
</View>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function Section({ title, children }: { title: string; children: React.ReactNode }) {
|
|
27
|
-
return (
|
|
28
|
-
<OutlinedCard>
|
|
29
|
-
<Text style={{ fontSize: 30, fontWeight: 'bold', paddingHorizontal: 20 }}>{title}</Text>
|
|
30
|
-
|
|
31
|
-
{React.Children.map(children, (c, idx) => (
|
|
32
|
-
<>
|
|
33
|
-
<View
|
|
34
|
-
key={idx}
|
|
35
|
-
style={{
|
|
36
|
-
minHeight: 50,
|
|
37
|
-
paddingHorizontal: 20,
|
|
38
|
-
justifyContent: 'center',
|
|
39
|
-
}}>
|
|
40
|
-
{c}
|
|
41
|
-
</View>
|
|
42
|
-
{idx !== React.Children.count(children) - 1 && (
|
|
43
|
-
<View
|
|
44
|
-
key={'separator' + idx}
|
|
45
|
-
style={{
|
|
46
|
-
height: StyleSheet.hairlineWidth,
|
|
47
|
-
backgroundColor: 'lightgray',
|
|
48
|
-
marginHorizontal: 20,
|
|
49
|
-
}}
|
|
50
|
-
/>
|
|
51
|
-
)}
|
|
52
|
-
</>
|
|
53
|
-
))}
|
|
54
|
-
</OutlinedCard>
|
|
55
|
-
);
|
|
9
|
+
export function Section({ children }: SectionProps) {
|
|
10
|
+
return children;
|
|
56
11
|
}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { ViewEvent } from '../../src';
|
|
4
|
+
import { ViewEvent } from '../../src/types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Colors for slider's core elements.
|
|
8
|
+
* @platform android
|
|
9
|
+
*/
|
|
10
|
+
export type SliderElementColors = {
|
|
11
|
+
thumbColor?: string;
|
|
12
|
+
activeTrackColor?: string;
|
|
13
|
+
inactiveTrackColor?: string;
|
|
14
|
+
activeTickColor?: string;
|
|
15
|
+
inactiveTickColor?: string;
|
|
16
|
+
};
|
|
5
17
|
|
|
6
18
|
export type SliderProps = {
|
|
7
19
|
/**
|
|
@@ -32,13 +44,7 @@ export type SliderProps = {
|
|
|
32
44
|
* Colors for slider's core elements.
|
|
33
45
|
* @platform android
|
|
34
46
|
*/
|
|
35
|
-
elementColors?:
|
|
36
|
-
thumbColor?: string;
|
|
37
|
-
activeTrackColor?: string;
|
|
38
|
-
inactiveTrackColor?: string;
|
|
39
|
-
activeTickColor?: string;
|
|
40
|
-
inactiveTickColor?: string;
|
|
41
|
-
};
|
|
47
|
+
elementColors?: SliderElementColors;
|
|
42
48
|
/**
|
|
43
49
|
* Slider color.
|
|
44
50
|
*/
|
package/package.json
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/ui",
|
|
3
|
-
"version": "1.0.0-canary-
|
|
3
|
+
"version": "1.0.0-canary-20250306-d9d3e02",
|
|
4
4
|
"description": "A collection of UI components",
|
|
5
|
-
"main": "src/index.ts",
|
|
6
|
-
"types": "build/index.d.ts",
|
|
7
5
|
"scripts": {
|
|
8
6
|
"build": "expo-module build",
|
|
9
7
|
"clean": "expo-module clean",
|
|
@@ -29,12 +27,12 @@
|
|
|
29
27
|
"dependencies": {},
|
|
30
28
|
"devDependencies": {
|
|
31
29
|
"@types/react": "~19.0.10",
|
|
32
|
-
"expo-module-scripts": "4.0.5-canary-
|
|
30
|
+
"expo-module-scripts": "4.0.5-canary-20250306-d9d3e02"
|
|
33
31
|
},
|
|
34
32
|
"peerDependencies": {
|
|
35
33
|
"expo": "*",
|
|
36
34
|
"react": "*",
|
|
37
35
|
"react-native": "*"
|
|
38
36
|
},
|
|
39
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "d9d3e024d8742099c307754673f17117a20c1dea"
|
|
40
38
|
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type * from '../components/Switch';
|
|
2
|
+
export type * from '../components/Picker';
|
|
3
|
+
export type * from '../components/Button';
|
|
4
|
+
export type * from '../components/ContextMenu';
|
|
5
|
+
export type * from '../components/Section';
|
|
6
|
+
export type * from '../components/Slider';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export type ViewEvent<Name extends string, Data> = Record<
|
|
12
|
+
Name,
|
|
13
|
+
Data extends object
|
|
14
|
+
? ((event: { nativeEvent: Data }) => void) | undefined
|
|
15
|
+
: (() => void) | undefined
|
|
16
|
+
>;
|
package/tsconfig.json
CHANGED
package/build/src/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type { Switch, SwitchProps } from '../components/Switch';
|
|
2
|
-
export type { Picker, PickerProps } from '../components/Picker';
|
|
3
|
-
export type { Button, ButtonProps } from '../components/Button';
|
|
4
|
-
export type { ContextMenu, ContextMenuProps, Submenu, SubmenuProps, ActivationMethod, } from '../components/ContextMenu';
|
|
5
|
-
export type { Section, SectionProps } from '../components/Section';
|
|
6
|
-
export type { Slider, SliderProps } from '../components/Slider';
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
export type ViewEvent<Name extends string, Data> = Record<Name, Data extends object ? ((event: {
|
|
11
|
-
nativeEvent: Data;
|
|
12
|
-
}) => void) | undefined : (() => void) | undefined>;
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
package/build/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAChE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAChE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAChE,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,YAAY,EACZ,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACnE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,IAAI,SAAS,MAAM,EAAE,IAAI,IAAI,MAAM,CACvD,IAAI,EACJ,IAAI,SAAS,MAAM,GACf,CAAC,CAAC,KAAK,EAAE;IAAE,WAAW,EAAE,IAAI,CAAA;CAAE,KAAK,IAAI,CAAC,GAAG,SAAS,GACpD,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAC7B,CAAC"}
|
package/src/index.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type { Switch, SwitchProps } from '../components/Switch';
|
|
2
|
-
export type { Picker, PickerProps } from '../components/Picker';
|
|
3
|
-
export type { Button, ButtonProps } from '../components/Button';
|
|
4
|
-
export type {
|
|
5
|
-
ContextMenu,
|
|
6
|
-
ContextMenuProps,
|
|
7
|
-
Submenu,
|
|
8
|
-
SubmenuProps,
|
|
9
|
-
ActivationMethod,
|
|
10
|
-
} from '../components/ContextMenu';
|
|
11
|
-
export type { Section, SectionProps } from '../components/Section';
|
|
12
|
-
export type { Slider, SliderProps } from '../components/Slider';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @hidden
|
|
16
|
-
*/
|
|
17
|
-
export type ViewEvent<Name extends string, Data> = Record<
|
|
18
|
-
Name,
|
|
19
|
-
Data extends object
|
|
20
|
-
? ((event: { nativeEvent: Data }) => void) | undefined
|
|
21
|
-
: (() => void) | undefined
|
|
22
|
-
>;
|