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