@proximus/lavender-cells-native 0.1.0-alpha.0
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 +33 -0
- package/dist/PxCell.d.ts +21 -0
- package/dist/PxCell.d.ts.map +1 -0
- package/dist/PxCellCheckbox.d.ts +7 -0
- package/dist/PxCellCheckbox.d.ts.map +1 -0
- package/dist/PxCellRadio.d.ts +7 -0
- package/dist/PxCellRadio.d.ts.map +1 -0
- package/dist/PxEntrypoint.d.ts +4 -0
- package/dist/PxEntrypoint.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/package.json +47 -0
- package/src/PxCell.tsx +199 -0
- package/src/PxCellCheckbox.tsx +69 -0
- package/src/PxCellRadio.tsx +59 -0
- package/src/PxEntrypoint.tsx +13 -0
- package/src/index.ts +4 -0
- package/tsconfig.json +8 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# 0.1.0-alpha.0 (2025-08-13)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **BCRI-3807748:** fix checkbox android native crash ([f358872](https://github.com/Pxs-Corporate/react-native-lavender/commit/f3588725a8a7440722b6fc13a5586da2da758ea0))
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **BCRI-000000:** adding testids on cells ([1e5f002](https://github.com/Pxs-Corporate/react-native-lavender/commit/1e5f00201a84516c1a6fe3fe5c04032204c32ae8))
|
|
15
|
+
- **BCRI-3660857:** cell components ([af9e45c](https://github.com/Pxs-Corporate/react-native-lavender/commit/af9e45cefc20d08d2338380ff4cd8cd6851abe24))
|
|
16
|
+
- **BCRI-4002610:** update icon handling and remove deprecated font references ([4399fe4](https://github.com/Pxs-Corporate/react-native-lavender/commit/4399fe4bff06aa70f5c29705fcc89d5243b0e3e7))
|
|
17
|
+
- **BCRI-4149480:** cell background color ([acf6722](https://github.com/Pxs-Corporate/react-native-lavender/commit/acf67226cf17589647163886f64f77cd18a87959))
|
|
18
|
+
- **BCRI-4210372:** automatic versionning ([9c1f0a0](https://github.com/Pxs-Corporate/react-native-lavender/commit/9c1f0a00e19a9d1a277044ea627632032a674102))
|
|
19
|
+
- **BCRI-4210372:** fix bad version numbers ([bc6a8ba](https://github.com/Pxs-Corporate/react-native-lavender/commit/bc6a8ba48c15347442f2ac38dacae7ffba3d95eb))
|
|
20
|
+
|
|
21
|
+
# (2025-08-13)
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
- **BCRI-3807748:** fix checkbox android native crash ([f358872](https://github.com/Pxs-Corporate/react-native-lavender/commit/f3588725a8a7440722b6fc13a5586da2da758ea0))
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
- **BCRI-000000:** adding testids on cells ([1e5f002](https://github.com/Pxs-Corporate/react-native-lavender/commit/1e5f00201a84516c1a6fe3fe5c04032204c32ae8))
|
|
30
|
+
- **BCRI-3660857:** cell components ([af9e45c](https://github.com/Pxs-Corporate/react-native-lavender/commit/af9e45cefc20d08d2338380ff4cd8cd6851abe24))
|
|
31
|
+
- **BCRI-4002610:** update icon handling and remove deprecated font references ([4399fe4](https://github.com/Pxs-Corporate/react-native-lavender/commit/4399fe4bff06aa70f5c29705fcc89d5243b0e3e7))
|
|
32
|
+
- **BCRI-4149480:** cell background color ([acf6722](https://github.com/Pxs-Corporate/react-native-lavender/commit/acf67226cf17589647163886f64f77cd18a87959))
|
|
33
|
+
- **BCRI-4210372:** automatic versionning ([9c1f0a0](https://github.com/Pxs-Corporate/react-native-lavender/commit/9c1f0a00e19a9d1a277044ea627632032a674102))
|
package/dist/PxCell.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AccessibilityProps, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import React, { ReactElement, ReactNode } from 'react';
|
|
3
|
+
export interface IPxCell extends AccessibilityProps {
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
7
|
+
backgroundColor?: 'ActionNeutral' | 'ActionNeutralBare';
|
|
8
|
+
onPress?: () => void;
|
|
9
|
+
prefix?: ReactNode;
|
|
10
|
+
suffix?: ReactElement;
|
|
11
|
+
suffixLabel?: string;
|
|
12
|
+
suffixDescription?: string;
|
|
13
|
+
type?: 'naked' | 'contained';
|
|
14
|
+
testID?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
separator?: boolean;
|
|
17
|
+
labelsAccessibilityProps?: AccessibilityProps;
|
|
18
|
+
borderRadius?: 'top' | 'bottom' | 'all' | 'none';
|
|
19
|
+
}
|
|
20
|
+
export declare function PxCell({ label, description, onPress, backgroundColor, containerStyle, prefix, suffix, suffixLabel, suffixDescription, testID, type, accessible, accessibilityRole, accessibilityLabel, accessibilityHint, disabled, labelsAccessibilityProps, borderRadius, separator, }: IPxCell): React.JSX.Element;
|
|
21
|
+
//# sourceMappingURL=PxCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PxCell.d.ts","sourceRoot":"","sources":["../src/PxCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,SAAS,EAIT,SAAS,EACV,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,WAAW,OAAQ,SAAQ,kBAAkB;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,eAAe,GAAG,mBAAmB,CAAC;IACxD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wBAAwB,CAAC,EAAE,kBAAkB,CAAC;IAC9C,YAAY,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;CAClD;AAID,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,WAAW,EACX,OAAO,EACP,eAAe,EACf,cAAc,EACd,MAAM,EACN,MAAM,EACN,WAAW,EACX,iBAAiB,EACjB,MAAM,EACN,IAAc,EACd,UAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,wBAAwB,EACxB,YAAqB,EACrB,SAAiB,GAClB,EAAE,OAAO,qBA6HT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PxCellCheckbox.d.ts","sourceRoot":"","sources":["../src/PxCellCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAU,MAAM,UAAU,CAAC;AAI3C,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,qBAsD/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PxCellRadio.d.ts","sourceRoot":"","sources":["../src/PxCellRadio.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAU,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,qBA4C/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PxEntrypoint.d.ts","sourceRoot":"","sources":["../src/PxEntrypoint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAU,MAAM,UAAU,CAAC;AAG3C,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,qBAQ1C"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@proximus/lavender-cells-native",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"description": "Lavender cell list component",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"clean": "rm -rf dist",
|
|
11
|
+
"prepublish": "yarn clean && yarn build",
|
|
12
|
+
"build": "npx tsc -p tsconfig.json"
|
|
13
|
+
},
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"@proximus/lavender-checkbox-native": "workspace:*",
|
|
16
|
+
"@proximus/lavender-common-native": "workspace:*",
|
|
17
|
+
"@proximus/lavender-icon-native": "workspace:*",
|
|
18
|
+
"@proximus/lavender-radio-native": "workspace:*",
|
|
19
|
+
"@proximus/lavender-separator-native": "workspace:*",
|
|
20
|
+
"@proximus/lavender-styling-native": "workspace:*",
|
|
21
|
+
"@proximus/lavender-texts-native": "workspace:*"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@proximus/lavender-checkbox-native": "0.1.0-alpha.0",
|
|
25
|
+
"@proximus/lavender-common-native": "0.1.0-alpha.0",
|
|
26
|
+
"@proximus/lavender-icon-native": "0.1.0-alpha.0",
|
|
27
|
+
"@proximus/lavender-radio-native": "0.1.0-alpha.0",
|
|
28
|
+
"@proximus/lavender-separator-native": "0.1.0-alpha.0",
|
|
29
|
+
"@proximus/lavender-styling-native": "0.1.0-alpha.0",
|
|
30
|
+
"@proximus/lavender-texts-native": "0.1.0-alpha.0"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"lerna": {
|
|
36
|
+
"command": {
|
|
37
|
+
"publish": {
|
|
38
|
+
"assets": [
|
|
39
|
+
"dist",
|
|
40
|
+
"src",
|
|
41
|
+
"package.json"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"gitHead": "27525289a448a6e4f3c2d36a88b9dc54d0f15fbf"
|
|
47
|
+
}
|
package/src/PxCell.tsx
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AccessibilityProps,
|
|
3
|
+
StyleProp,
|
|
4
|
+
StyleSheet,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
View,
|
|
7
|
+
ViewStyle,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import { a11y, e2eID } from '@proximus/lavender-common-native';
|
|
10
|
+
import { Body, Header } from '@proximus/lavender-texts-native';
|
|
11
|
+
import { PxSeparator } from '@proximus/lavender-separator-native';
|
|
12
|
+
import { useTheme } from '@proximus/lavender-styling-native';
|
|
13
|
+
import React, { ReactElement, ReactNode } from 'react';
|
|
14
|
+
|
|
15
|
+
export interface IPxCell extends AccessibilityProps {
|
|
16
|
+
label: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
19
|
+
backgroundColor?: 'ActionNeutral' | 'ActionNeutralBare';
|
|
20
|
+
onPress?: () => void;
|
|
21
|
+
prefix?: ReactNode;
|
|
22
|
+
suffix?: ReactElement;
|
|
23
|
+
suffixLabel?: string;
|
|
24
|
+
suffixDescription?: string;
|
|
25
|
+
type?: 'naked' | 'contained';
|
|
26
|
+
testID?: string;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
separator?: boolean;
|
|
29
|
+
labelsAccessibilityProps?: AccessibilityProps;
|
|
30
|
+
borderRadius?: 'top' | 'bottom' | 'all' | 'none';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const BORDER_RADIUS = 8;
|
|
34
|
+
|
|
35
|
+
export function PxCell({
|
|
36
|
+
label,
|
|
37
|
+
description,
|
|
38
|
+
onPress,
|
|
39
|
+
backgroundColor,
|
|
40
|
+
containerStyle,
|
|
41
|
+
prefix,
|
|
42
|
+
suffix,
|
|
43
|
+
suffixLabel,
|
|
44
|
+
suffixDescription,
|
|
45
|
+
testID,
|
|
46
|
+
type = 'naked',
|
|
47
|
+
accessible = true,
|
|
48
|
+
accessibilityRole,
|
|
49
|
+
accessibilityLabel,
|
|
50
|
+
accessibilityHint,
|
|
51
|
+
disabled,
|
|
52
|
+
labelsAccessibilityProps,
|
|
53
|
+
borderRadius = 'none',
|
|
54
|
+
separator = false,
|
|
55
|
+
}: IPxCell) {
|
|
56
|
+
const { theme } = useTheme();
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<TouchableOpacity
|
|
60
|
+
{...a11y({
|
|
61
|
+
accessibilityRole,
|
|
62
|
+
accessible,
|
|
63
|
+
importantForAccessibility: accessible ? 'yes' : 'no',
|
|
64
|
+
accessibilityLabel: accessibilityLabel || label,
|
|
65
|
+
accessibilityHint: accessibilityHint || description,
|
|
66
|
+
})}
|
|
67
|
+
disabled={disabled || !onPress}
|
|
68
|
+
onPress={onPress}
|
|
69
|
+
{...e2eID(testID)}
|
|
70
|
+
>
|
|
71
|
+
<View
|
|
72
|
+
style={[
|
|
73
|
+
styles.container,
|
|
74
|
+
containerStyle,
|
|
75
|
+
{
|
|
76
|
+
backgroundColor:
|
|
77
|
+
type === 'naked'
|
|
78
|
+
? 'transparent'
|
|
79
|
+
: backgroundColor
|
|
80
|
+
? theme.t(`BackgroundColor${backgroundColor}Default`)
|
|
81
|
+
: theme.t('BackgroundColorActionNeutralDefault'),
|
|
82
|
+
borderTopLeftRadius: ['top', 'all'].includes(borderRadius)
|
|
83
|
+
? BORDER_RADIUS
|
|
84
|
+
: 0,
|
|
85
|
+
borderTopEndRadius: ['top', 'all'].includes(borderRadius)
|
|
86
|
+
? BORDER_RADIUS
|
|
87
|
+
: 0,
|
|
88
|
+
borderBottomLeftRadius: ['bottom', 'all'].includes(borderRadius)
|
|
89
|
+
? BORDER_RADIUS
|
|
90
|
+
: 0,
|
|
91
|
+
borderBottomRightRadius: ['bottom', 'all'].includes(borderRadius)
|
|
92
|
+
? BORDER_RADIUS
|
|
93
|
+
: 0,
|
|
94
|
+
borderRadius: 20,
|
|
95
|
+
},
|
|
96
|
+
disabled && {
|
|
97
|
+
backgroundColor: theme.t('BackgroundColorActionDisabledDefault'),
|
|
98
|
+
},
|
|
99
|
+
]}
|
|
100
|
+
>
|
|
101
|
+
{!!prefix && <View style={styles.leftComponent}>{prefix}</View>}
|
|
102
|
+
<View style={styles.content}>
|
|
103
|
+
<Header
|
|
104
|
+
{...a11y({
|
|
105
|
+
...labelsAccessibilityProps,
|
|
106
|
+
accessible,
|
|
107
|
+
importantForAccessibility: accessible ? 'yes' : 'no',
|
|
108
|
+
})}
|
|
109
|
+
style={[
|
|
110
|
+
{
|
|
111
|
+
fontSize: theme.t('TextSizeLabelLMobile').number,
|
|
112
|
+
color: theme.t('TextColorHeadingNeutralDefault'),
|
|
113
|
+
},
|
|
114
|
+
]}
|
|
115
|
+
disabled={disabled}
|
|
116
|
+
>
|
|
117
|
+
{label}
|
|
118
|
+
</Header>
|
|
119
|
+
{description && (
|
|
120
|
+
<Body
|
|
121
|
+
{...a11y({
|
|
122
|
+
...labelsAccessibilityProps,
|
|
123
|
+
accessible,
|
|
124
|
+
importantForAccessibility: accessible ? 'yes' : 'no',
|
|
125
|
+
})}
|
|
126
|
+
{...e2eID(`${testID}_subTitle`)}
|
|
127
|
+
style={[
|
|
128
|
+
{
|
|
129
|
+
fontSize: theme.t('TextSizeLabelMMobile').number,
|
|
130
|
+
color: theme.t('TextColorHeadingNeutralDefault'),
|
|
131
|
+
},
|
|
132
|
+
]}
|
|
133
|
+
disabled={disabled}
|
|
134
|
+
>
|
|
135
|
+
{description}
|
|
136
|
+
</Body>
|
|
137
|
+
)}
|
|
138
|
+
</View>
|
|
139
|
+
{suffixLabel && suffixDescription && (
|
|
140
|
+
<View style={styles.suffixLabelDescription}>
|
|
141
|
+
<Header
|
|
142
|
+
{...a11y({
|
|
143
|
+
...labelsAccessibilityProps,
|
|
144
|
+
accessible,
|
|
145
|
+
importantForAccessibility: accessible ? 'yes' : 'no',
|
|
146
|
+
})}
|
|
147
|
+
style={{
|
|
148
|
+
textAlign: 'right',
|
|
149
|
+
fontSize: theme.t('TextSizeLabelLMobile').number,
|
|
150
|
+
color: theme.t('TextColorHeadingNeutralDefault'),
|
|
151
|
+
}}
|
|
152
|
+
disabled={disabled}
|
|
153
|
+
>
|
|
154
|
+
{suffixLabel}
|
|
155
|
+
</Header>
|
|
156
|
+
{description && (
|
|
157
|
+
<Body
|
|
158
|
+
{...a11y({
|
|
159
|
+
...labelsAccessibilityProps,
|
|
160
|
+
accessible,
|
|
161
|
+
importantForAccessibility: accessible ? 'yes' : 'no',
|
|
162
|
+
})}
|
|
163
|
+
style={{
|
|
164
|
+
color: theme.t('TextColorHeadingNeutralDefault'),
|
|
165
|
+
fontSize: theme.t('TextSizeLabelMMobile').number,
|
|
166
|
+
}}
|
|
167
|
+
{...e2eID(`${testID}_subTitle`)}
|
|
168
|
+
disabled={disabled}
|
|
169
|
+
>
|
|
170
|
+
{suffixDescription}
|
|
171
|
+
</Body>
|
|
172
|
+
)}
|
|
173
|
+
</View>
|
|
174
|
+
)}
|
|
175
|
+
{suffix}
|
|
176
|
+
</View>
|
|
177
|
+
{separator && <PxSeparator />}
|
|
178
|
+
</TouchableOpacity>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const styles = StyleSheet.create({
|
|
183
|
+
container: {
|
|
184
|
+
flexDirection: 'row',
|
|
185
|
+
padding: 16,
|
|
186
|
+
alignItems: 'center',
|
|
187
|
+
gap: 16,
|
|
188
|
+
},
|
|
189
|
+
content: {
|
|
190
|
+
flex: 1,
|
|
191
|
+
},
|
|
192
|
+
leftComponent: {
|
|
193
|
+
justifyContent: 'center',
|
|
194
|
+
alignItems: 'center',
|
|
195
|
+
},
|
|
196
|
+
suffixLabelDescription: {
|
|
197
|
+
alignSelf: 'flex-end',
|
|
198
|
+
},
|
|
199
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IPxCell, PxCell } from './PxCell';
|
|
3
|
+
import { PxCheckBox } from '@proximus/lavender-checkbox-native';
|
|
4
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
5
|
+
|
|
6
|
+
export function PxCellCheckbox(
|
|
7
|
+
props: IPxCell & { checked: boolean; side?: 'left' | 'right' }
|
|
8
|
+
) {
|
|
9
|
+
const { side = 'right' } = props;
|
|
10
|
+
const checkbox = (
|
|
11
|
+
<PxCheckBox
|
|
12
|
+
disabled={props.disabled}
|
|
13
|
+
accessibilityLabel={props.label}
|
|
14
|
+
accessibilityHint={props.description}
|
|
15
|
+
boxType={'square'}
|
|
16
|
+
wrapperStyle={{
|
|
17
|
+
height: 32,
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
}}
|
|
20
|
+
checkboxStyle={{
|
|
21
|
+
// Not applied on Android because of a weird visual bug
|
|
22
|
+
...(Platform.OS === 'ios' && {
|
|
23
|
+
width: 16,
|
|
24
|
+
height: 16,
|
|
25
|
+
}),
|
|
26
|
+
backgroundColor: 'transparent',
|
|
27
|
+
}}
|
|
28
|
+
checked={props.checked}
|
|
29
|
+
onChange={props.onPress}
|
|
30
|
+
testID={props.testID}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<PxCell
|
|
36
|
+
{...props}
|
|
37
|
+
onPress={undefined} // override onPress to prevent double tap
|
|
38
|
+
accessible={false}
|
|
39
|
+
prefix={
|
|
40
|
+
side === 'left' ? (
|
|
41
|
+
<View style={styles.prefix}>
|
|
42
|
+
{checkbox}
|
|
43
|
+
{props.prefix}
|
|
44
|
+
</View>
|
|
45
|
+
) : (
|
|
46
|
+
props.prefix
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
suffix={
|
|
50
|
+
side === 'right' ? (
|
|
51
|
+
<View style={styles.prefix}>
|
|
52
|
+
{props.suffix}
|
|
53
|
+
{checkbox}
|
|
54
|
+
</View>
|
|
55
|
+
) : (
|
|
56
|
+
props.suffix
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
/>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const styles = StyleSheet.create({
|
|
64
|
+
prefix: {
|
|
65
|
+
flexDirection: 'row',
|
|
66
|
+
gap: 16,
|
|
67
|
+
alignItems: 'center',
|
|
68
|
+
},
|
|
69
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { PxRadioButton } from '@proximus/lavender-radio-native';
|
|
2
|
+
import { IPxCell, PxCell } from './PxCell';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { StyleSheet, View } from 'react-native';
|
|
5
|
+
|
|
6
|
+
export function PxCellRadio(
|
|
7
|
+
props: IPxCell & { checked: boolean; side?: 'left' | 'right' }
|
|
8
|
+
) {
|
|
9
|
+
const { side = 'right' } = props;
|
|
10
|
+
|
|
11
|
+
const radioButton = (
|
|
12
|
+
<PxRadioButton
|
|
13
|
+
size={20}
|
|
14
|
+
accessibilityLabel={props.label}
|
|
15
|
+
accessibilityHint={props.description}
|
|
16
|
+
labelA11y={{
|
|
17
|
+
accessible: false,
|
|
18
|
+
}}
|
|
19
|
+
checked={props.checked}
|
|
20
|
+
onPress={props.onPress}
|
|
21
|
+
testID={props.testID}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<PxCell
|
|
27
|
+
{...props}
|
|
28
|
+
accessible={false}
|
|
29
|
+
prefix={
|
|
30
|
+
side === 'left' ? (
|
|
31
|
+
<View style={styles.prefix}>
|
|
32
|
+
{radioButton}
|
|
33
|
+
{props.prefix}
|
|
34
|
+
</View>
|
|
35
|
+
) : (
|
|
36
|
+
props.prefix
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
suffix={
|
|
40
|
+
side === 'right' ? (
|
|
41
|
+
<View style={styles.prefix}>
|
|
42
|
+
{props.suffix}
|
|
43
|
+
{radioButton}
|
|
44
|
+
</View>
|
|
45
|
+
) : (
|
|
46
|
+
props.suffix
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const styles = StyleSheet.create({
|
|
54
|
+
prefix: {
|
|
55
|
+
flexDirection: 'row',
|
|
56
|
+
gap: 16,
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
},
|
|
59
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IPxCell, PxCell } from './PxCell';
|
|
3
|
+
import { PxIcon } from '@proximus/lavender-icon-native';
|
|
4
|
+
|
|
5
|
+
export function PxEntrypoint(props: IPxCell) {
|
|
6
|
+
return (
|
|
7
|
+
<PxCell
|
|
8
|
+
{...props}
|
|
9
|
+
accessibilityRole={'button'}
|
|
10
|
+
suffix={<PxIcon name={'chevron_right'} />}
|
|
11
|
+
/>
|
|
12
|
+
);
|
|
13
|
+
}
|
package/src/index.ts
ADDED