@lotics/ui 1.5.0 → 1.6.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 +2 -1
- package/src/card.tsx +2 -4
- package/src/fonts.css +15 -13
- package/src/select_item.tsx +57 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Pressable, StyleProp, StyleSheet, View, ViewStyle } from "react-native";
|
|
2
|
+
import { colors } from "./colors";
|
|
3
|
+
|
|
4
|
+
interface SelectItemProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
testID?: string;
|
|
7
|
+
onPress?: () => void;
|
|
8
|
+
style?: StyleProp<ViewStyle>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A bordered, optionally-pressable container — the selectable-row look used on
|
|
13
|
+
* auth screens (organization picker, login choices). Frozen at the original
|
|
14
|
+
* Card styling (white, 1px border, radius 8, padding 16) so those screens stay
|
|
15
|
+
* visually stable while Card itself evolves toward a flatter dashboard look.
|
|
16
|
+
*/
|
|
17
|
+
export function SelectItem(props: SelectItemProps) {
|
|
18
|
+
const { children, testID, onPress, style } = props;
|
|
19
|
+
|
|
20
|
+
if (onPress) {
|
|
21
|
+
return (
|
|
22
|
+
<Pressable
|
|
23
|
+
testID={testID}
|
|
24
|
+
onPress={() => {
|
|
25
|
+
onPress();
|
|
26
|
+
}}
|
|
27
|
+
style={(state) => {
|
|
28
|
+
const hovered = (state as { hovered?: boolean }).hovered;
|
|
29
|
+
return [styles.container, hovered && styles.hovered, style];
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
{children}
|
|
33
|
+
</Pressable>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<View testID={testID} style={[styles.container, style]}>
|
|
39
|
+
{children}
|
|
40
|
+
</View>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const styles = StyleSheet.create({
|
|
45
|
+
container: {
|
|
46
|
+
padding: 16,
|
|
47
|
+
borderRadius: 8,
|
|
48
|
+
backgroundColor: colors.background,
|
|
49
|
+
borderColor: colors.border,
|
|
50
|
+
borderWidth: 1,
|
|
51
|
+
},
|
|
52
|
+
hovered: {
|
|
53
|
+
outlineColor: colors.zinc["900"],
|
|
54
|
+
outlineWidth: 2,
|
|
55
|
+
outlineStyle: "solid",
|
|
56
|
+
},
|
|
57
|
+
});
|