native-pytech 1.0.87 → 1.0.89
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/dist/libs/colorPage/index.d.ts +1 -2
- package/dist/libs/colorPage/src/Content/index.android.d.ts +2 -2
- package/dist/libs/colorPage/src/Content/index.android.js +43 -5
- package/dist/libs/colorPage/src/Content/types.d.ts +2 -1
- package/dist/libs/colorPage/src/Page/types.d.ts +11 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ colorRows,
|
|
2
|
+
import Props from './types';
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ colorRows, renderGradient, ...pageProps }: Props) => React.JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -1,11 +1,49 @@
|
|
|
1
|
-
import { Host, Column, Row } from '@expo/ui/jetpack-compose';
|
|
2
1
|
import React, { memo } from 'react';
|
|
3
|
-
|
|
2
|
+
import { Shape, Surface, Box, Host, Column, Row } from '@expo/ui/jetpack-compose';
|
|
3
|
+
import { background, clip, Shapes, clickable, paddingAll, alpha, size as sizeModifier, fillMaxWidth } from '@expo/ui/jetpack-compose/modifiers';
|
|
4
|
+
import { colors } from '../../../../libs/components/Gradient';
|
|
5
|
+
export default memo(({ colorRows, renderGradient, ...pageProps }) => {
|
|
4
6
|
return (<Host style={{ flex: 1 }}>
|
|
5
|
-
<Column verticalArrangement={{ spacedBy:
|
|
6
|
-
{colorRows.map((row, index) => (<Row key={index}
|
|
7
|
-
{row.map((color, indexColor) => (
|
|
7
|
+
<Column verticalArrangement={{ spacedBy: 2 }}>
|
|
8
|
+
{colorRows.map((row, index) => (<Row key={index} horizontalArrangement="spaceEvenly" verticalArrangement="center" modifiers={[fillMaxWidth()]}>
|
|
9
|
+
{row.map((color, indexColor) => renderGradient == null ? null : (<ItemRenderer key={color} color={color} size={55} renderGradient={renderGradient} {...pageProps}/>))}
|
|
8
10
|
</Row>))}
|
|
9
11
|
</Column>
|
|
10
12
|
</Host>);
|
|
11
13
|
});
|
|
14
|
+
const ItemRenderer = memo(({ color, size, selectedColor, onSelectColor, renderGradient, }) => {
|
|
15
|
+
if (!renderGradient)
|
|
16
|
+
return null;
|
|
17
|
+
const isSelected = color === selectedColor;
|
|
18
|
+
const innerBorderWidth = 2;
|
|
19
|
+
const outerBorderWidth = 3;
|
|
20
|
+
return (<Surface color='#00000000' shape={Shape.RoundedCorner({
|
|
21
|
+
cornerRadii: {
|
|
22
|
+
topStart: size,
|
|
23
|
+
topEnd: size,
|
|
24
|
+
bottomStart: size,
|
|
25
|
+
bottomEnd: size,
|
|
26
|
+
},
|
|
27
|
+
})} border={{ width: outerBorderWidth, color: isSelected ? colors[color].middle : '#00000000' }} modifiers={[clip(Shapes.Circle)]}>
|
|
28
|
+
<Box contentAlignment="center" modifiers={[
|
|
29
|
+
background('#00000000'),
|
|
30
|
+
paddingAll(outerBorderWidth * 2),
|
|
31
|
+
clip(Shapes.Circle),
|
|
32
|
+
clickable(() => onSelectColor?.(color))
|
|
33
|
+
]}>
|
|
34
|
+
|
|
35
|
+
<Box contentAlignment="center" modifiers={[sizeModifier(size, size)]}>
|
|
36
|
+
|
|
37
|
+
{!isSelected &&
|
|
38
|
+
<Box contentAlignment="center" modifiers={[sizeModifier(size, size)]}>
|
|
39
|
+
{React.createElement(renderGradient, { color, size })}
|
|
40
|
+
<Box modifiers={[sizeModifier(size, size), alpha(0.25), background('#FFFFFF')]}/>
|
|
41
|
+
</Box>}
|
|
42
|
+
|
|
43
|
+
{React.createElement(renderGradient, { color, size: size - (!isSelected ? innerBorderWidth * 2 : 0) })}
|
|
44
|
+
|
|
45
|
+
</Box>
|
|
46
|
+
|
|
47
|
+
</Box>
|
|
48
|
+
</Surface>);
|
|
49
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ColorsType } from '../../../../libs/components/Gradient';
|
|
2
|
-
import PropsPage from '../Page/types';
|
|
2
|
+
import PropsPage, { renderGradientProps } from '../Page/types';
|
|
3
3
|
type Props = PropsPage & {
|
|
4
4
|
/**
|
|
5
5
|
List of rows of colors to display.
|
|
@@ -7,4 +7,5 @@ type Props = PropsPage & {
|
|
|
7
7
|
*/
|
|
8
8
|
colorRows: ColorsType[][];
|
|
9
9
|
};
|
|
10
|
+
export type DecoratorProps = renderGradientProps & PropsPage;
|
|
10
11
|
export default Props;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ColorsType } from '../../../../libs/components/Gradient';
|
|
2
|
-
import type itemProps from '../Item/types';
|
|
3
2
|
export type BaseProps = {
|
|
4
3
|
/**
|
|
5
4
|
Title of the date picker.
|
|
@@ -11,10 +10,20 @@ export type BaseProps = {
|
|
|
11
10
|
*/
|
|
12
11
|
onSelectColor?: (color: ColorsType) => void;
|
|
13
12
|
};
|
|
13
|
+
export type renderGradientProps = {
|
|
14
|
+
/**
|
|
15
|
+
Color to display.
|
|
16
|
+
*/
|
|
17
|
+
color: ColorsType;
|
|
18
|
+
/**
|
|
19
|
+
Size of the item.
|
|
20
|
+
*/
|
|
21
|
+
size: number;
|
|
22
|
+
};
|
|
14
23
|
type Props = BaseProps & {
|
|
15
24
|
/**
|
|
16
25
|
Function to render the item.
|
|
17
26
|
*/
|
|
18
|
-
|
|
27
|
+
renderGradient?: (props: renderGradientProps) => React.ReactNode;
|
|
19
28
|
};
|
|
20
29
|
export default Props;
|