@proximus/lavender-cells-native 0.1.0-alpha.1 → 0.1.0-alpha.11

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/PxCell.d.ts CHANGED
@@ -4,7 +4,7 @@ export interface IPxCell extends AccessibilityProps {
4
4
  label: string;
5
5
  description?: string;
6
6
  containerStyle?: StyleProp<ViewStyle>;
7
- backgroundColor?: 'ActionNeutral' | 'ActionNeutralBare';
7
+ backgroundColor?: 'Default' | 'Light';
8
8
  onPress?: () => void;
9
9
  prefix?: ReactNode;
10
10
  suffix?: ReactElement;
@@ -1 +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"}
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,SAAS,GAAG,OAAO,CAAC;IACtC,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"}
package/dist/PxCell.js ADDED
@@ -0,0 +1,104 @@
1
+ import { StyleSheet, TouchableOpacity, View, } from 'react-native';
2
+ import { a11y, e2eID } from '@proximus/lavender-common-native';
3
+ import { Body, Header } from '@proximus/lavender-texts-native';
4
+ import { PxSeparator } from '@proximus/lavender-separator-native';
5
+ import { useTheme } from '@proximus/lavender-styling-native';
6
+ import React from 'react';
7
+ const BORDER_RADIUS = 8;
8
+ export function PxCell({ label, description, onPress, backgroundColor, containerStyle, prefix, suffix, suffixLabel, suffixDescription, testID, type = 'naked', accessible = true, accessibilityRole, accessibilityLabel, accessibilityHint, disabled, labelsAccessibilityProps, borderRadius = 'none', separator = false, }) {
9
+ const { theme } = useTheme();
10
+ return (React.createElement(TouchableOpacity, { ...a11y({
11
+ accessibilityRole,
12
+ accessible,
13
+ importantForAccessibility: accessible ? 'yes' : 'no',
14
+ accessibilityLabel: accessibilityLabel || label,
15
+ accessibilityHint: accessibilityHint || description,
16
+ }), disabled: disabled || !onPress, onPress: onPress, ...e2eID(testID) },
17
+ React.createElement(View, { style: [
18
+ styles.container,
19
+ containerStyle,
20
+ {
21
+ backgroundColor: type === 'naked'
22
+ ? 'transparent'
23
+ : backgroundColor
24
+ ? theme.t(`ColorBackgroundContainer${backgroundColor}Default`)
25
+ : theme.t('ColorBackgroundContainerDefaultDefault'),
26
+ borderTopLeftRadius: ['top', 'all'].includes(borderRadius)
27
+ ? BORDER_RADIUS
28
+ : 0,
29
+ borderTopEndRadius: ['top', 'all'].includes(borderRadius)
30
+ ? BORDER_RADIUS
31
+ : 0,
32
+ borderBottomLeftRadius: ['bottom', 'all'].includes(borderRadius)
33
+ ? BORDER_RADIUS
34
+ : 0,
35
+ borderBottomRightRadius: ['bottom', 'all'].includes(borderRadius)
36
+ ? BORDER_RADIUS
37
+ : 0,
38
+ borderRadius: 20,
39
+ },
40
+ disabled && {
41
+ backgroundColor: theme.t('ColorBackgroundStateDisabledDefault'),
42
+ },
43
+ ] },
44
+ !!prefix && React.createElement(View, { style: styles.leftComponent }, prefix),
45
+ React.createElement(View, { style: styles.content },
46
+ React.createElement(Header, { ...a11y({
47
+ ...labelsAccessibilityProps,
48
+ accessible,
49
+ importantForAccessibility: accessible ? 'yes' : 'no',
50
+ }), style: [
51
+ {
52
+ fontSize: theme.t('TextSizeLabelLMobile').number,
53
+ color: theme.t('ColorTextNeutralDefault'),
54
+ },
55
+ ], disabled: disabled }, label),
56
+ description && (React.createElement(Body, { ...a11y({
57
+ ...labelsAccessibilityProps,
58
+ accessible,
59
+ importantForAccessibility: accessible ? 'yes' : 'no',
60
+ }), ...e2eID(`${testID}_subTitle`), style: [
61
+ {
62
+ fontSize: theme.t('TextSizeLabelMMobile').number,
63
+ color: theme.t('ColorTextNeutralDefault'),
64
+ },
65
+ ], disabled: disabled }, description))),
66
+ suffixLabel && suffixDescription && (React.createElement(View, { style: styles.suffixLabelDescription },
67
+ React.createElement(Header, { ...a11y({
68
+ ...labelsAccessibilityProps,
69
+ accessible,
70
+ importantForAccessibility: accessible ? 'yes' : 'no',
71
+ }), style: {
72
+ textAlign: 'right',
73
+ fontSize: theme.t('TextSizeLabelLMobile').number,
74
+ color: theme.t('ColorTextNeutralDefault'),
75
+ }, disabled: disabled }, suffixLabel),
76
+ description && (React.createElement(Body, { ...a11y({
77
+ ...labelsAccessibilityProps,
78
+ accessible,
79
+ importantForAccessibility: accessible ? 'yes' : 'no',
80
+ }), style: {
81
+ color: theme.t('ColorTextNeutralDefault'),
82
+ fontSize: theme.t('TextSizeLabelMMobile').number,
83
+ }, ...e2eID(`${testID}_subTitle`), disabled: disabled }, suffixDescription)))),
84
+ suffix),
85
+ separator && React.createElement(PxSeparator, null)));
86
+ }
87
+ const styles = StyleSheet.create({
88
+ container: {
89
+ flexDirection: 'row',
90
+ padding: 16,
91
+ alignItems: 'center',
92
+ gap: 16,
93
+ },
94
+ content: {
95
+ flex: 1,
96
+ },
97
+ leftComponent: {
98
+ justifyContent: 'center',
99
+ alignItems: 'center',
100
+ },
101
+ suffixLabelDescription: {
102
+ alignSelf: 'flex-end',
103
+ },
104
+ });
@@ -1 +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"}
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,qBAqD/D"}
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { PxCell } from './PxCell';
3
+ import { PxCheckBox } from '@proximus/lavender-checkbox-native';
4
+ import { StyleSheet, View } from 'react-native';
5
+ export function PxCellCheckbox(props) {
6
+ const { side = 'right' } = props;
7
+ const checkbox = (React.createElement(PxCheckBox, { disabled: props.disabled, accessibilityLabel: props.label, accessibilityHint: props.description, wrapperStyle: {
8
+ height: 32,
9
+ justifyContent: 'center',
10
+ },
11
+ // checkboxStyle={{
12
+ // // Not applied on Android because of a weird visual bug
13
+ // ...(Platform.OS === 'ios' && {
14
+ // width: 16,
15
+ // height: 16,
16
+ // }),
17
+ // backgroundColor: 'transparent',
18
+ // }}
19
+ checked: props.checked, onChange: props.onPress, testID: props.testID }));
20
+ return (React.createElement(PxCell, { ...props, onPress: undefined, accessible: false, prefix: side === 'left' ? (React.createElement(View, { style: styles.prefix },
21
+ checkbox,
22
+ props.prefix)) : (props.prefix), suffix: side === 'right' ? (React.createElement(View, { style: styles.prefix },
23
+ props.suffix,
24
+ checkbox)) : (props.suffix) }));
25
+ }
26
+ const styles = StyleSheet.create({
27
+ prefix: {
28
+ flexDirection: 'row',
29
+ gap: 16,
30
+ alignItems: 'center',
31
+ },
32
+ });
@@ -0,0 +1,22 @@
1
+ import { PxRadioButton } from '@proximus/lavender-radio-native';
2
+ import { PxCell } from './PxCell';
3
+ import React from 'react';
4
+ import { StyleSheet, View } from 'react-native';
5
+ export function PxCellRadio(props) {
6
+ const { side = 'right' } = props;
7
+ const radioButton = (React.createElement(PxRadioButton, { size: 20, accessibilityLabel: props.label, accessibilityHint: props.description, labelA11y: {
8
+ accessible: false,
9
+ }, checked: props.checked, onPress: props.onPress, testID: props.testID }));
10
+ return (React.createElement(PxCell, { ...props, accessible: false, prefix: side === 'left' ? (React.createElement(View, { style: styles.prefix },
11
+ radioButton,
12
+ props.prefix)) : (props.prefix), suffix: side === 'right' ? (React.createElement(View, { style: styles.prefix },
13
+ props.suffix,
14
+ radioButton)) : (props.suffix) }));
15
+ }
16
+ const styles = StyleSheet.create({
17
+ prefix: {
18
+ flexDirection: 'row',
19
+ gap: 16,
20
+ alignItems: 'center',
21
+ },
22
+ });
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { PxCell } from './PxCell';
3
+ import { PxIcon } from '@proximus/lavender-icon-native';
4
+ export function PxEntrypoint(props) {
5
+ return (React.createElement(PxCell, { ...props, accessibilityRole: 'button', suffix: React.createElement(PxIcon, { name: 'chevron_right' }) }));
6
+ }
package/package.json CHANGED
@@ -1,46 +1,23 @@
1
1
  {
2
2
  "name": "@proximus/lavender-cells-native",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.11",
4
4
  "description": "Lavender cell list component",
5
5
  "license": "MIT",
6
- "main": "src/index.ts",
6
+ "main": "dist/index.js",
7
+ "files": [
8
+ "dist"
9
+ ],
7
10
  "type": "module",
8
- "scripts": {
9
- "clean": "rm -rf dist",
10
- "prepublish": "yarn clean && yarn build",
11
- "build": "npx tsc -p tsconfig.json"
12
- },
13
11
  "peerDependencies": {
14
- "@proximus/lavender-checkbox-native": "workspace:*",
15
- "@proximus/lavender-common-native": "workspace:*",
16
- "@proximus/lavender-icon-native": "workspace:*",
17
- "@proximus/lavender-radio-native": "workspace:*",
18
- "@proximus/lavender-separator-native": "workspace:*",
19
- "@proximus/lavender-styling-native": "workspace:*",
20
- "@proximus/lavender-texts-native": "workspace:*"
21
- },
22
- "devDependencies": {
23
- "@proximus/lavender-checkbox-native": "0.1.0-alpha.1",
24
- "@proximus/lavender-common-native": "0.1.0-alpha.1",
25
- "@proximus/lavender-icon-native": "0.1.0-alpha.1",
26
- "@proximus/lavender-radio-native": "0.1.0-alpha.1",
27
- "@proximus/lavender-separator-native": "0.1.0-alpha.1",
28
- "@proximus/lavender-styling-native": "0.1.0-alpha.1",
29
- "@proximus/lavender-texts-native": "0.1.0-alpha.1"
12
+ "@proximus/lavender-checkbox-native": "*",
13
+ "@proximus/lavender-common-native": "*",
14
+ "@proximus/lavender-icon-native": "*",
15
+ "@proximus/lavender-radio-native": "*",
16
+ "@proximus/lavender-separator-native": "*",
17
+ "@proximus/lavender-styling-native": "*",
18
+ "@proximus/lavender-texts-native": "*"
30
19
  },
31
20
  "publishConfig": {
32
21
  "access": "public"
33
- },
34
- "lerna": {
35
- "command": {
36
- "publish": {
37
- "assets": [
38
- "dist",
39
- "src",
40
- "package.json"
41
- ]
42
- }
43
- }
44
- },
45
- "gitHead": "d422a1d369000e1e249afb26de2cef08930c2407"
22
+ }
46
23
  }
package/CHANGELOG.md DELETED
@@ -1,39 +0,0 @@
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.1](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-cells-native@0.1.0-alpha.0...@proximus/lavender-cells-native@0.1.0-alpha.1) (2025-08-13)
7
-
8
- ### Bug Fixes
9
-
10
- - **BCRI-4210372:** fix types field in modules ([68ac126](https://github.com/Pxs-Corporate/react-native-lavender/commit/68ac12657112473ae9e0e683076b1d9172be9ce6))
11
-
12
- # 0.1.0-alpha.0 (2025-08-13)
13
-
14
- ### Bug Fixes
15
-
16
- - **BCRI-3807748:** fix checkbox android native crash ([f358872](https://github.com/Pxs-Corporate/react-native-lavender/commit/f3588725a8a7440722b6fc13a5586da2da758ea0))
17
-
18
- ### Features
19
-
20
- - **BCRI-000000:** adding testids on cells ([1e5f002](https://github.com/Pxs-Corporate/react-native-lavender/commit/1e5f00201a84516c1a6fe3fe5c04032204c32ae8))
21
- - **BCRI-3660857:** cell components ([af9e45c](https://github.com/Pxs-Corporate/react-native-lavender/commit/af9e45cefc20d08d2338380ff4cd8cd6851abe24))
22
- - **BCRI-4002610:** update icon handling and remove deprecated font references ([4399fe4](https://github.com/Pxs-Corporate/react-native-lavender/commit/4399fe4bff06aa70f5c29705fcc89d5243b0e3e7))
23
- - **BCRI-4149480:** cell background color ([acf6722](https://github.com/Pxs-Corporate/react-native-lavender/commit/acf67226cf17589647163886f64f77cd18a87959))
24
- - **BCRI-4210372:** automatic versionning ([9c1f0a0](https://github.com/Pxs-Corporate/react-native-lavender/commit/9c1f0a00e19a9d1a277044ea627632032a674102))
25
- - **BCRI-4210372:** fix bad version numbers ([bc6a8ba](https://github.com/Pxs-Corporate/react-native-lavender/commit/bc6a8ba48c15347442f2ac38dacae7ffba3d95eb))
26
-
27
- # (2025-08-13)
28
-
29
- ### Bug Fixes
30
-
31
- - **BCRI-3807748:** fix checkbox android native crash ([f358872](https://github.com/Pxs-Corporate/react-native-lavender/commit/f3588725a8a7440722b6fc13a5586da2da758ea0))
32
-
33
- ### Features
34
-
35
- - **BCRI-000000:** adding testids on cells ([1e5f002](https://github.com/Pxs-Corporate/react-native-lavender/commit/1e5f00201a84516c1a6fe3fe5c04032204c32ae8))
36
- - **BCRI-3660857:** cell components ([af9e45c](https://github.com/Pxs-Corporate/react-native-lavender/commit/af9e45cefc20d08d2338380ff4cd8cd6851abe24))
37
- - **BCRI-4002610:** update icon handling and remove deprecated font references ([4399fe4](https://github.com/Pxs-Corporate/react-native-lavender/commit/4399fe4bff06aa70f5c29705fcc89d5243b0e3e7))
38
- - **BCRI-4149480:** cell background color ([acf6722](https://github.com/Pxs-Corporate/react-native-lavender/commit/acf67226cf17589647163886f64f77cd18a87959))
39
- - **BCRI-4210372:** automatic versionning ([9c1f0a0](https://github.com/Pxs-Corporate/react-native-lavender/commit/9c1f0a00e19a9d1a277044ea627632032a674102))
package/src/PxCell.tsx DELETED
@@ -1,199 +0,0 @@
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
- });
@@ -1,69 +0,0 @@
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
- });
@@ -1,59 +0,0 @@
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
- });
@@ -1,13 +0,0 @@
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/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.npm.json",
3
- "compilerOptions": {
4
- "outDir": "dist",
5
- },
6
- "include": ["src","../../../lib.d.ts"],
7
- "exclude": ["dist", "node_modules", "src/**/*.test.ts", "src/**/*.spec.ts"]
8
- }
File without changes