@proximus/lavender-selectablebox-native 0.1.0-alpha.6 → 0.1.0-beta.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/package.json +12 -41
- package/CHANGELOG.md +0 -14
- package/dist/far/away/package.json +0 -37
- package/src/PxSelectableBox.tsx +0 -185
- package/src/index.ts +0 -1
- package/tsconfig.json +0 -8
package/package.json
CHANGED
|
@@ -1,51 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proximus/lavender-selectablebox-native",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-beta.0",
|
|
4
4
|
"description": "Lavender selectable box component",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"main": "
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
7
10
|
"type": "module",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"clean": "rm -rf dist",
|
|
10
|
-
"transform-package-json": "node ../../../scripts/tranformPackageJson.js package.json dist/far/away",
|
|
11
|
-
"prepublish": "yarn clean && yarn transform-package-json && yarn build",
|
|
12
|
-
"build": "npx tsc -p tsconfig.json"
|
|
13
|
-
},
|
|
14
11
|
"peerDependencies": {
|
|
15
|
-
"@proximus/lavender-checkbox-native": "
|
|
16
|
-
"@proximus/lavender-common-native": "
|
|
17
|
-
"@proximus/lavender-icon-native": "
|
|
18
|
-
"@proximus/lavender-radio-native": "
|
|
19
|
-
"@proximus/lavender-styling-native": "
|
|
20
|
-
"@proximus/lavender-texts-native": "
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@proximus/lavender-checkbox-native": "0.1.0-alpha.6",
|
|
24
|
-
"@proximus/lavender-common-native": "0.1.0-alpha.6",
|
|
25
|
-
"@proximus/lavender-icon-native": "0.1.0-alpha.6",
|
|
26
|
-
"@proximus/lavender-radio-native": "0.1.0-alpha.6",
|
|
27
|
-
"@proximus/lavender-styling-native": "0.1.0-alpha.5",
|
|
28
|
-
"@proximus/lavender-texts-native": "0.1.0-alpha.6"
|
|
12
|
+
"@proximus/lavender-checkbox-native": "*",
|
|
13
|
+
"@proximus/lavender-common-native": "*",
|
|
14
|
+
"@proximus/lavender-icon-native": "*",
|
|
15
|
+
"@proximus/lavender-radio-native": "*",
|
|
16
|
+
"@proximus/lavender-styling-native": "*",
|
|
17
|
+
"@proximus/lavender-texts-native": "*"
|
|
29
18
|
},
|
|
30
19
|
"publishConfig": {
|
|
31
20
|
"access": "public"
|
|
32
|
-
}
|
|
33
|
-
"lerna": {
|
|
34
|
-
"command": {
|
|
35
|
-
"publish": {
|
|
36
|
-
"assets": [
|
|
37
|
-
{
|
|
38
|
-
"from": "dist/far/away/package.json",
|
|
39
|
-
"to": "."
|
|
40
|
-
},
|
|
41
|
-
"dist/*.js",
|
|
42
|
-
"dist/*.d.ts",
|
|
43
|
-
"dist/*.d.ts.map",
|
|
44
|
-
"src",
|
|
45
|
-
"package.json"
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
|
|
21
|
+
}
|
|
51
22
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,14 +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.6](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-selectablebox-native@0.1.0-alpha.5...@proximus/lavender-selectablebox-native@0.1.0-alpha.6) (2025-09-26)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @proximus/lavender-selectablebox-native
|
|
9
|
-
|
|
10
|
-
# [0.1.0-alpha.5](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-selectablebox-native@0.1.0-alpha.4...@proximus/lavender-selectablebox-native@0.1.0-alpha.5) (2025-09-25)
|
|
11
|
-
|
|
12
|
-
### Bug Fixes
|
|
13
|
-
|
|
14
|
-
- **BCRI-000000:** no free space on gh runner during build ([#27](https://github.com/Pxs-Corporate/react-native-lavender/issues/27)) ([a7c8604](https://github.com/Pxs-Corporate/react-native-lavender/commit/a7c86043b5cefcb10fd768d449c5718fbabe87ec))
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@proximus/lavender-selectablebox-native",
|
|
3
|
-
"version": "0.1.0-alpha.6",
|
|
4
|
-
"description": "Lavender selectable box component",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"peerDependencies": {
|
|
9
|
-
"@proximus/lavender-checkbox-native": "*",
|
|
10
|
-
"@proximus/lavender-common-native": "*",
|
|
11
|
-
"@proximus/lavender-icon-native": "*",
|
|
12
|
-
"@proximus/lavender-radio-native": "*",
|
|
13
|
-
"@proximus/lavender-styling-native": "*",
|
|
14
|
-
"@proximus/lavender-texts-native": "*"
|
|
15
|
-
},
|
|
16
|
-
"publishConfig": {
|
|
17
|
-
"access": "public"
|
|
18
|
-
},
|
|
19
|
-
"lerna": {
|
|
20
|
-
"command": {
|
|
21
|
-
"publish": {
|
|
22
|
-
"assets": [
|
|
23
|
-
{
|
|
24
|
-
"from": "dist/far/away/package.json",
|
|
25
|
-
"to": "."
|
|
26
|
-
},
|
|
27
|
-
"dist/*.js",
|
|
28
|
-
"dist/*.d.ts",
|
|
29
|
-
"dist/*.d.ts.map",
|
|
30
|
-
"src",
|
|
31
|
-
"package.json"
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
|
|
37
|
-
}
|
package/src/PxSelectableBox.tsx
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
AccessibilityProps,
|
|
4
|
-
StyleProp,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
View,
|
|
8
|
-
ViewStyle,
|
|
9
|
-
} from 'react-native';
|
|
10
|
-
import { a11y, e2eID } from '@proximus/lavender-common-native';
|
|
11
|
-
import { PxRadioButton } from '@proximus/lavender-radio-native';
|
|
12
|
-
import { PxCheckBox } from '@proximus/lavender-checkbox-native';
|
|
13
|
-
import { useTheme } from '@proximus/lavender-styling-native';
|
|
14
|
-
import { Body, Header } from '@proximus/lavender-texts-native';
|
|
15
|
-
|
|
16
|
-
export interface ISelectableBoxProps {
|
|
17
|
-
selected: boolean;
|
|
18
|
-
label: string;
|
|
19
|
-
onPress: (val: boolean) => void;
|
|
20
|
-
withCheckbox?: boolean;
|
|
21
|
-
containerStyle?: StyleProp<ViewStyle>;
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
locked?: boolean;
|
|
24
|
-
priceComponent?: ReactNode;
|
|
25
|
-
contentComponent?: ReactNode;
|
|
26
|
-
description?: string;
|
|
27
|
-
testID?: string;
|
|
28
|
-
wrapperStyle?: StyleProp<ViewStyle>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function PxSelectableBox({
|
|
32
|
-
selected,
|
|
33
|
-
label,
|
|
34
|
-
onPress,
|
|
35
|
-
containerStyle,
|
|
36
|
-
withCheckbox,
|
|
37
|
-
disabled = false,
|
|
38
|
-
locked,
|
|
39
|
-
priceComponent,
|
|
40
|
-
contentComponent,
|
|
41
|
-
description,
|
|
42
|
-
testID = 'selectableBox',
|
|
43
|
-
...accessibilityProps
|
|
44
|
-
}: ISelectableBoxProps & AccessibilityProps) {
|
|
45
|
-
const { theme } = useTheme();
|
|
46
|
-
|
|
47
|
-
const accessibilityRole = locked
|
|
48
|
-
? 'text'
|
|
49
|
-
: withCheckbox
|
|
50
|
-
? 'checkbox'
|
|
51
|
-
: 'radio';
|
|
52
|
-
const accessibilityHint = `Selectable Item ${label}, checked: ${selected}`;
|
|
53
|
-
|
|
54
|
-
const colors = {
|
|
55
|
-
uncheckedBorderColor: theme.t('ColorBorderMainDefault'),
|
|
56
|
-
backgroundColor: theme.t('ColorBackgroundContainerLightDefault'),
|
|
57
|
-
focusBorderColor: theme.t('ColorBorderBrandDefault'),
|
|
58
|
-
disabledBackgroundColor: theme.t('ColorBackgroundStateDisabledDefault'),
|
|
59
|
-
defaultLabel: theme.t('ColorTextNeutralDefault'),
|
|
60
|
-
uncheckedLabel: theme.t('ColorTextNeutralDefault'),
|
|
61
|
-
borderColor: theme.t('ColorBorderBrandDefault'),
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<TouchableOpacity
|
|
66
|
-
onPress={() => {
|
|
67
|
-
onPress?.(!selected);
|
|
68
|
-
}}
|
|
69
|
-
style={[{ width: '100%' }, containerStyle]}
|
|
70
|
-
disabled={disabled || locked}
|
|
71
|
-
{...e2eID(testID)}
|
|
72
|
-
{...a11y({
|
|
73
|
-
accessible: true,
|
|
74
|
-
accessibilityRole,
|
|
75
|
-
accessibilityHint,
|
|
76
|
-
accessibilityLabel: label,
|
|
77
|
-
accessibilityState: {
|
|
78
|
-
checked: selected,
|
|
79
|
-
disabled: disabled || locked,
|
|
80
|
-
},
|
|
81
|
-
...accessibilityProps,
|
|
82
|
-
})}
|
|
83
|
-
>
|
|
84
|
-
<View
|
|
85
|
-
style={[
|
|
86
|
-
styles.container,
|
|
87
|
-
{
|
|
88
|
-
borderColor: selected
|
|
89
|
-
? colors.borderColor
|
|
90
|
-
: colors.uncheckedBorderColor,
|
|
91
|
-
backgroundColor: colors.backgroundColor,
|
|
92
|
-
},
|
|
93
|
-
disabled && {
|
|
94
|
-
borderWidth: 0,
|
|
95
|
-
backgroundColor: colors.disabledBackgroundColor,
|
|
96
|
-
},
|
|
97
|
-
locked && {
|
|
98
|
-
borderColor: colors.borderColor,
|
|
99
|
-
},
|
|
100
|
-
]}
|
|
101
|
-
{...a11y({
|
|
102
|
-
accessible: true,
|
|
103
|
-
accessibilityRole,
|
|
104
|
-
accessibilityHint,
|
|
105
|
-
})}
|
|
106
|
-
>
|
|
107
|
-
<View style={styles.topContentContainer}>
|
|
108
|
-
<View style={styles.topContainer}>
|
|
109
|
-
{withCheckbox ? (
|
|
110
|
-
<PxCheckBox
|
|
111
|
-
onChange={onPress}
|
|
112
|
-
checked={selected}
|
|
113
|
-
disabled={disabled}
|
|
114
|
-
/>
|
|
115
|
-
) : (
|
|
116
|
-
<PxRadioButton
|
|
117
|
-
onPress={() => onPress?.(!selected)}
|
|
118
|
-
checked={selected}
|
|
119
|
-
disabled={disabled}
|
|
120
|
-
/>
|
|
121
|
-
)}
|
|
122
|
-
<View style={styles.textContainer}>
|
|
123
|
-
<Header
|
|
124
|
-
textBreakStrategy={'balanced'}
|
|
125
|
-
accessible={true}
|
|
126
|
-
style={[
|
|
127
|
-
styles.title,
|
|
128
|
-
{
|
|
129
|
-
color: !selected
|
|
130
|
-
? colors.uncheckedLabel
|
|
131
|
-
: colors.defaultLabel,
|
|
132
|
-
},
|
|
133
|
-
]}
|
|
134
|
-
>
|
|
135
|
-
{label}
|
|
136
|
-
</Header>
|
|
137
|
-
<Body style={styles.description}>{description}</Body>
|
|
138
|
-
</View>
|
|
139
|
-
</View>
|
|
140
|
-
{contentComponent && (
|
|
141
|
-
<View style={{ marginTop: 16 }}>{contentComponent}</View>
|
|
142
|
-
)}
|
|
143
|
-
</View>
|
|
144
|
-
|
|
145
|
-
{priceComponent && (
|
|
146
|
-
<View style={styles.priceComponent}>{priceComponent}</View>
|
|
147
|
-
)}
|
|
148
|
-
</View>
|
|
149
|
-
</TouchableOpacity>
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const styles = StyleSheet.create({
|
|
154
|
-
container: {
|
|
155
|
-
flexDirection: 'row',
|
|
156
|
-
borderWidth: 2,
|
|
157
|
-
borderRadius: 12,
|
|
158
|
-
},
|
|
159
|
-
title: {
|
|
160
|
-
fontSize: 14,
|
|
161
|
-
},
|
|
162
|
-
priceComponent: {
|
|
163
|
-
padding: 8,
|
|
164
|
-
alignItems: 'center',
|
|
165
|
-
justifyContent: 'center',
|
|
166
|
-
},
|
|
167
|
-
description: {
|
|
168
|
-
fontSize: 12,
|
|
169
|
-
},
|
|
170
|
-
topContentContainer: {
|
|
171
|
-
padding: 16,
|
|
172
|
-
flex: 1,
|
|
173
|
-
},
|
|
174
|
-
topContainer: {
|
|
175
|
-
flexDirection: 'row',
|
|
176
|
-
alignItems: 'center',
|
|
177
|
-
justifyContent: 'flex-start',
|
|
178
|
-
},
|
|
179
|
-
textContainer: {
|
|
180
|
-
flexDirection: 'column',
|
|
181
|
-
marginHorizontal: 16,
|
|
182
|
-
justifyContent: 'center',
|
|
183
|
-
flex: 1,
|
|
184
|
-
},
|
|
185
|
-
});
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './PxSelectableBox';
|