react-native-boxes 1.4.67 → 1.4.69
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 +1 -1
- package/src/Bar.tsx +1 -2
- package/src/Button.tsx +2 -4
- package/src/List.tsx +172 -4
- package/src/Modal.tsx +1 -1
package/package.json
CHANGED
package/src/Bar.tsx
CHANGED
|
@@ -171,7 +171,6 @@ export function BottomNavBar(props: ViewProps &
|
|
|
171
171
|
justifyContent: 'center',
|
|
172
172
|
alignItems: 'center',
|
|
173
173
|
margin: 0,
|
|
174
|
-
padding: theme.dimens.space.md,
|
|
175
174
|
paddingTop: !hasText ? theme.dimens.space.lg : theme.dimens.space.md,
|
|
176
175
|
paddingBottom: !hasText ? theme.dimens.space.lg : theme.dimens.space.md,
|
|
177
176
|
}}
|
|
@@ -293,4 +292,4 @@ export function ProgressBarView(props: ProgressBarViewProps) {
|
|
|
293
292
|
}} />
|
|
294
293
|
</View>
|
|
295
294
|
);
|
|
296
|
-
}
|
|
295
|
+
}
|
package/src/Button.tsx
CHANGED
|
@@ -323,7 +323,7 @@ export function PressableView(props: PressableProps) {
|
|
|
323
323
|
return (<Pressable {...props} style={({ pressed }) => [{ opacity: pressed ? 0.7 : 1.0 }, props.style]} />)
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
-
export function SwitchView(props: SwitchProps & { text?: string, orientation?: "row" | "column" | "row-reverse" | "column-reverse" | undefined }) {
|
|
326
|
+
export function SwitchView(props: SwitchProps & { text?: string, orientation?: "row" | "column" | "row-reverse" | "column-reverse" | undefined, textStyle?: TextStyle }) {
|
|
327
327
|
const theme = useContext(ThemeContext)
|
|
328
328
|
return (
|
|
329
329
|
<HBox style={[{
|
|
@@ -346,9 +346,7 @@ export function SwitchView(props: SwitchProps & { text?: string, orientation?: "
|
|
|
346
346
|
/>
|
|
347
347
|
{
|
|
348
348
|
props.text && (
|
|
349
|
-
<TextView style={{
|
|
350
|
-
paddingStart: theme.dimens.space.md
|
|
351
|
-
}}>{props.text}</TextView>
|
|
349
|
+
<TextView style={props.textStyle}>{props.text}</TextView>
|
|
352
350
|
)
|
|
353
351
|
}
|
|
354
352
|
</HBox>
|
package/src/List.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ActivityIndicator, Text, View, ViewProps } from "react-native"
|
|
1
|
+
import { ActivityIndicator, Text, TextStyle, View, ViewProps, ViewStyle } from "react-native"
|
|
2
2
|
import { Box, CardView, Center, HBox, VBox } from "./Box"
|
|
3
|
-
import { getIcon } from "./Image"
|
|
4
|
-
import { Icon } from "@expo/vector-icons/build/createIconSet"
|
|
3
|
+
import { getIcon, Icon } from "./Image"
|
|
5
4
|
import { Caption, Subtitle, TextView, TitleText } from "./Text"
|
|
6
5
|
import { useContext } from "react"
|
|
7
6
|
import { ThemeContext } from "./ThemeContext"
|
|
@@ -121,4 +120,173 @@ export function SimpleDatatlistViewItem(props: SimpleDatatableViewItemProps & Vi
|
|
|
121
120
|
</CardView>
|
|
122
121
|
</PressableView>
|
|
123
122
|
)
|
|
124
|
-
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
export function InfoRow(props: {
|
|
129
|
+
title: string,
|
|
130
|
+
text: string,
|
|
131
|
+
icon?: string | React.ReactNode,
|
|
132
|
+
color?: string,
|
|
133
|
+
style?: ViewStyle,
|
|
134
|
+
textStyle?: TextStyle,
|
|
135
|
+
onPress?: () => void
|
|
136
|
+
}) {
|
|
137
|
+
const theme = useContext(ThemeContext)
|
|
138
|
+
const InfoIcon = getIcon(props.icon)
|
|
139
|
+
return (
|
|
140
|
+
<PressableView onPress={props.onPress} style={{
|
|
141
|
+
opacity: props.onPress ? undefined : 1
|
|
142
|
+
}}>
|
|
143
|
+
<HBox style={{
|
|
144
|
+
paddingStart: theme.dimens.space.sm,
|
|
145
|
+
paddingBottom: theme.dimens.space.sm,
|
|
146
|
+
alignItems: 'center',
|
|
147
|
+
}}>
|
|
148
|
+
{InfoIcon && (<InfoIcon
|
|
149
|
+
size={theme.dimens.icon.md * 1.25}
|
|
150
|
+
color={props.color}
|
|
151
|
+
style={{
|
|
152
|
+
paddingEnd: theme.dimens.space.sm,
|
|
153
|
+
paddingStart: theme.dimens.space.sm,
|
|
154
|
+
}} />)}
|
|
155
|
+
<VBox style={[{
|
|
156
|
+
flex: 1,
|
|
157
|
+
paddingStart: theme.dimens.space.sm,
|
|
158
|
+
}, props.style]}>
|
|
159
|
+
<HBox style={{
|
|
160
|
+
alignItems: 'center',
|
|
161
|
+
}}>
|
|
162
|
+
|
|
163
|
+
<TitleText style={{
|
|
164
|
+
color: props.color,
|
|
165
|
+
marginBottom: 0,
|
|
166
|
+
paddingBottom: 0,
|
|
167
|
+
flexWrap: 'wrap'
|
|
168
|
+
}}>
|
|
169
|
+
{props.title || ' '}
|
|
170
|
+
</TitleText>
|
|
171
|
+
</HBox>
|
|
172
|
+
<TextView style={[{
|
|
173
|
+
marginTop: 0,
|
|
174
|
+
paddingTop: 0,
|
|
175
|
+
}, props.textStyle]}>
|
|
176
|
+
{props.text || ' '}
|
|
177
|
+
</TextView>
|
|
178
|
+
</VBox>
|
|
179
|
+
</HBox>
|
|
180
|
+
|
|
181
|
+
</PressableView>
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
export function IconRow(props: {
|
|
185
|
+
text: string,
|
|
186
|
+
icon?: string | React.ReactNode,
|
|
187
|
+
onPress?: () => void,
|
|
188
|
+
color?: string
|
|
189
|
+
}) {
|
|
190
|
+
const theme = useContext(ThemeContext)
|
|
191
|
+
const LeftIcon = getIcon(props.icon)
|
|
192
|
+
return (
|
|
193
|
+
<PressableView onPress={props.onPress}>
|
|
194
|
+
<HBox style={{
|
|
195
|
+
marginBottom: theme.dimens.space.md,
|
|
196
|
+
alignItems: 'center'
|
|
197
|
+
}}>
|
|
198
|
+
<LeftIcon style={{
|
|
199
|
+
width: theme.dimens.icon.md,
|
|
200
|
+
marginRight: theme.dimens.space.md
|
|
201
|
+
}} color={props.color || theme.colors.text} />
|
|
202
|
+
<TitleText style={{
|
|
203
|
+
color: props.color || theme.colors.text
|
|
204
|
+
}}>{props.text}</TitleText>
|
|
205
|
+
</HBox>
|
|
206
|
+
</PressableView>
|
|
207
|
+
)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
export function SettingRow({
|
|
213
|
+
text,
|
|
214
|
+
icon,
|
|
215
|
+
style,
|
|
216
|
+
color,
|
|
217
|
+
colorDesc,
|
|
218
|
+
description,
|
|
219
|
+
rightIcon,
|
|
220
|
+
onPress,
|
|
221
|
+
}: {
|
|
222
|
+
text: string;
|
|
223
|
+
icon?: string | any;
|
|
224
|
+
color?: string;
|
|
225
|
+
colorDesc?: string;
|
|
226
|
+
description?: string;
|
|
227
|
+
rightIcon?: string | any;
|
|
228
|
+
style?: ViewStyle;
|
|
229
|
+
onPress: () => void;
|
|
230
|
+
}) {
|
|
231
|
+
const theme = useContext(ThemeContext);
|
|
232
|
+
const RightIcon = getIcon(rightIcon);
|
|
233
|
+
const LeftIcon = getIcon(icon);
|
|
234
|
+
return (
|
|
235
|
+
|
|
236
|
+
<PressableView onPress={onPress} style={{
|
|
237
|
+
width: '100%',
|
|
238
|
+
|
|
239
|
+
}}>
|
|
240
|
+
<HBox
|
|
241
|
+
style={[
|
|
242
|
+
{
|
|
243
|
+
width: '100%',
|
|
244
|
+
alignItems: 'center',
|
|
245
|
+
justifyContent: 'space-between',
|
|
246
|
+
paddingTop: theme.dimens.space.lg,
|
|
247
|
+
paddingLeft: theme.dimens.space.lg,
|
|
248
|
+
paddingBottom: theme.dimens.space.md,
|
|
249
|
+
},
|
|
250
|
+
style,
|
|
251
|
+
]}
|
|
252
|
+
>
|
|
253
|
+
<HBox style={{
|
|
254
|
+
flex: 1,
|
|
255
|
+
alignItems: "center",
|
|
256
|
+
}}>
|
|
257
|
+
{icon && (
|
|
258
|
+
typeof icon == 'string' ? <Icon name={icon}
|
|
259
|
+
size={theme.dimens.icon.md}
|
|
260
|
+
color={color || theme.colors.text}
|
|
261
|
+
style={{
|
|
262
|
+
paddingBottom: description ? theme.dimens.space.md : 0,
|
|
263
|
+
}} /> : (LeftIcon && <LeftIcon />)
|
|
264
|
+
)}
|
|
265
|
+
|
|
266
|
+
<VBox style={{
|
|
267
|
+
paddingStart: theme.dimens.space.lg,
|
|
268
|
+
flex: 1
|
|
269
|
+
}}>
|
|
270
|
+
<TitleText
|
|
271
|
+
style={{
|
|
272
|
+
color: color || theme.colors.text,
|
|
273
|
+
fontFamily: theme.fonts.Styled,
|
|
274
|
+
paddingTop: 0,
|
|
275
|
+
paddingBottom: 0,
|
|
276
|
+
}}
|
|
277
|
+
>
|
|
278
|
+
{text}
|
|
279
|
+
</TitleText>
|
|
280
|
+
|
|
281
|
+
{description && <Caption style={{
|
|
282
|
+
color: colorDesc || theme.colors.caption,
|
|
283
|
+
}}>{description}</Caption>}
|
|
284
|
+
</VBox>
|
|
285
|
+
</HBox>
|
|
286
|
+
|
|
287
|
+
{rightIcon && <RightIcon />}
|
|
288
|
+
</HBox>
|
|
289
|
+
|
|
290
|
+
</PressableView>
|
|
291
|
+
);
|
|
292
|
+
}
|
package/src/Modal.tsx
CHANGED