native-pytech 1.0.102 → 1.0.103
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type Props from './types';
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ children,
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ children, onPress, icon, label, systemImage, listRowInsets, textTrailing, textTrailingProps }: Props) => React.JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
import { Button, HStack, Label } from '@expo/ui/swift-ui';
|
|
2
|
-
import {
|
|
3
|
-
import { Color } from 'expo-router';
|
|
2
|
+
import { listRowInsets as listRowInsetsModifier } from '@expo/ui/swift-ui/modifiers';
|
|
4
3
|
import React, { memo, useMemo } from 'react';
|
|
5
4
|
import Trailing from './Trailing';
|
|
6
|
-
export default memo(({ children,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
...(modifiers ?? []),
|
|
12
|
-
...(!maintainButtonStyle && !renderLabel ? [foregroundStyle(Color.ios.label)] : []),
|
|
13
|
-
], [modifiers, maintainButtonStyle, renderLabel]);
|
|
14
|
-
const buttonSystemImage = !renderLabel ? systemImage : undefined;
|
|
15
|
-
const buttonLabel = !renderLabel ? label : undefined;
|
|
16
|
-
return (<HStack {...hStackProps}>
|
|
17
|
-
<Button modifiers={_modifiers} systemImage={buttonSystemImage} label={buttonLabel} {...buttonProps}>
|
|
18
|
-
{children}
|
|
5
|
+
export default memo(({ children, onPress, icon, label, systemImage, listRowInsets = false, textTrailing, textTrailingProps }) => {
|
|
6
|
+
const modifiers = useMemo(() => listRowInsets ? [listRowInsetsModifier({ top: 20, bottom: 20, leading: 25, trailing: 20 })] : [], [listRowInsets]);
|
|
7
|
+
return (<HStack modifiers={modifiers}>
|
|
8
|
+
<Button onPress={onPress}>
|
|
9
|
+
{children ?? <Label title={label} systemImage={systemImage} icon={icon}/>}
|
|
19
10
|
</Button>
|
|
20
|
-
{!children && renderLabel && (<Label title={label} systemImage={systemImage}/>)}
|
|
21
11
|
<Trailing text={textTrailing} textProps={textTrailingProps}/>
|
|
22
12
|
</HStack>);
|
|
23
13
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonProps,
|
|
1
|
+
import { ButtonProps, LabelProps, TextProps } from "@expo/ui/swift-ui";
|
|
2
2
|
export type TrailingProps = {
|
|
3
3
|
/**
|
|
4
4
|
Text to display on the Trailing Stack.
|
|
@@ -9,23 +9,23 @@ export type TrailingProps = {
|
|
|
9
9
|
*/
|
|
10
10
|
textProps?: TextProps;
|
|
11
11
|
};
|
|
12
|
-
type Props = ButtonProps & {
|
|
12
|
+
type Props = Pick<ButtonProps, 'children' | 'onPress' | 'systemImage' | 'label'> & {
|
|
13
13
|
/**
|
|
14
|
-
|
|
14
|
+
Whether to apply the listRowInsets modifier to the HStack.
|
|
15
|
+
@default false
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
listRowInsets?: boolean;
|
|
17
18
|
/**
|
|
18
|
-
|
|
19
|
+
Icon to display on the Label.
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
+
icon?: LabelProps['icon'];
|
|
21
22
|
/**
|
|
22
|
-
|
|
23
|
-
@default false
|
|
23
|
+
Text to display on the Trailing Stack.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
textTrailing?: TrailingProps['text'];
|
|
26
26
|
/**
|
|
27
|
-
|
|
27
|
+
TextProps to apply to the Trailing Stack text.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
textTrailingProps?: TrailingProps['textProps'];
|
|
30
30
|
};
|
|
31
31
|
export default Props;
|