@ds-autonomie/react-native 0.1.0 → 0.3.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 +23 -0
- package/dist/chunks/chunk.3QXPJAHY.js +22 -0
- package/dist/chunks/chunk.4MPJJ7EN.js +65 -0
- package/dist/chunks/chunk.4SSEOHVB.js +41 -0
- package/dist/chunks/chunk.4ZX27FCY.js +21 -0
- package/dist/chunks/chunk.6DY4BFMZ.js +22 -0
- package/dist/chunks/chunk.73S52VD6.js +94 -0
- package/dist/chunks/chunk.7H4YRP4X.js +70 -0
- package/dist/chunks/{chunk.NNC6C337.js → chunk.B2JV2E47.js} +3 -3
- package/dist/chunks/chunk.CIHQLL6Y.js +93 -0
- package/dist/chunks/chunk.DMHRBYRF.js +69 -0
- package/dist/chunks/chunk.H2AL2E3A.js +47 -0
- package/dist/chunks/chunk.INEDXDER.js +51 -0
- package/dist/chunks/chunk.KVGKM2JI.js +73 -0
- package/dist/chunks/chunk.KVXJ2L2C.js +22 -0
- package/dist/chunks/chunk.LN5IVTGU.js +60 -0
- package/dist/chunks/{chunk.4EJ4MEUR.js → chunk.OQSCGAEY.js} +4 -2
- package/dist/chunks/chunk.RNOZ5AW4.js +71 -0
- package/dist/chunks/chunk.SZJKAIPC.js +20 -0
- package/dist/chunks/chunk.XCMNSIIN.js +72 -0
- package/dist/chunks/chunk.YWEWQ2LT.js +39 -0
- package/dist/components/button/Button.d.ts +65 -0
- package/dist/components/button/Button.js +8 -0
- package/dist/components/button/Button.styles.d.ts +38 -0
- package/dist/components/button/Button.styles.js +14 -0
- package/dist/components/checkbox/Checkbox.d.ts +55 -0
- package/dist/components/checkbox/Checkbox.js +8 -0
- package/dist/components/checkbox/Checkbox.styles.d.ts +38 -0
- package/dist/components/checkbox/Checkbox.styles.js +8 -0
- package/dist/components/divider/Divider.d.ts +7 -0
- package/dist/components/divider/Divider.js +24 -0
- package/dist/components/divider/Divider.styles.d.ts +13 -0
- package/dist/components/divider/Divider.styles.js +6 -0
- package/dist/components/icon/Icon.d.ts +10 -4
- package/dist/components/icon/Icon.js +1 -1
- package/dist/components/listCaption/ListCaption.d.ts +7 -0
- package/dist/components/listCaption/ListCaption.js +8 -0
- package/dist/components/listCaption/ListCaption.styles.d.ts +14 -0
- package/dist/components/listCaption/ListCaption.styles.js +7 -0
- package/dist/components/listItem/ListItem.d.ts +34 -0
- package/dist/components/listItem/ListItem.js +9 -0
- package/dist/components/listItem/ListItem.styles.d.ts +48 -0
- package/dist/components/listItem/ListItem.styles.js +7 -0
- package/dist/components/listTitle/ListTitle.d.ts +7 -0
- package/dist/components/listTitle/ListTitle.js +8 -0
- package/dist/components/listTitle/ListTitle.styles.d.ts +15 -0
- package/dist/components/listTitle/ListTitle.styles.js +7 -0
- package/dist/components/radio/Radio.d.ts +55 -0
- package/dist/components/radio/Radio.js +7 -0
- package/dist/components/radio/Radio.styles.d.ts +30 -0
- package/dist/components/radio/Radio.styles.js +8 -0
- package/dist/components/searchField/SearchField.d.ts +14 -0
- package/dist/components/searchField/SearchField.js +7 -0
- package/dist/components/searchField/SearchField.styles.d.ts +42 -0
- package/dist/components/searchField/SearchField.styles.js +10 -0
- package/dist/components/textInput/TextInput.d.ts +54 -0
- package/dist/components/textInput/TextInput.js +9 -0
- package/dist/components/textInput/TextInput.styles.d.ts +94 -0
- package/dist/components/textInput/TextInput.styles.js +11 -0
- package/dist/components/toggle/Toggle.js +2 -2
- package/dist/index.d.ts +10 -1
- package/dist/index.js +46 -2
- package/dist/styles/fonts.d.ts +35 -0
- package/dist/utils/device.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @ds-autonomie/react-native
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 76ac0b5: `ListItem`: implémentation du composant ListItem
|
|
8
|
+
- 2e76d7e: `divider`: Implémentation du composant divider
|
|
9
|
+
- 8273161: `listTitle`: Implémentation du ListTitle
|
|
10
|
+
`listCaption`: Implémentation du ListCaption
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- f98a445: docs: repasse documentaire
|
|
15
|
+
|
|
16
|
+
## 0.2.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- 711b710: `checkbox`: implémentation du composant
|
|
21
|
+
- 74a9815: `button`: implementation du composant Button
|
|
22
|
+
- a6fe29e: `TextInput`: implémentation du composant
|
|
23
|
+
- e09d454: `Radio`: implémentation du composant
|
|
24
|
+
- 544c8c7: `searchField`: implementation du composant SearchField
|
|
25
|
+
|
|
3
26
|
## 0.1.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fonts
|
|
3
|
+
} from "./chunk.4SSEOHVB.js";
|
|
4
|
+
|
|
5
|
+
// src/components/listTitle/ListTitle.styles.ts
|
|
6
|
+
import theme from "@ds-autonomie/assets/js/dsa-theme";
|
|
7
|
+
import { StyleSheet } from "react-native";
|
|
8
|
+
var listTitleStyles = StyleSheet.create({
|
|
9
|
+
container: {
|
|
10
|
+
paddingHorizontal: theme.primitives.spacing[16],
|
|
11
|
+
paddingTop: theme.primitives.spacing[8],
|
|
12
|
+
paddingBottom: theme.primitives.spacing[12]
|
|
13
|
+
},
|
|
14
|
+
text: {
|
|
15
|
+
...fonts.titleSmall,
|
|
16
|
+
paddingHorizontal: theme.primitives.spacing[16]
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
listTitleStyles
|
|
22
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
styles
|
|
3
|
+
} from "./chunk.INEDXDER.js";
|
|
4
|
+
import {
|
|
5
|
+
Icon
|
|
6
|
+
} from "./chunk.OQSCGAEY.js";
|
|
7
|
+
|
|
8
|
+
// src/components/listItem/ListItem.tsx
|
|
9
|
+
import theme from "@ds-autonomie/assets/js/dsa-theme";
|
|
10
|
+
import React from "react";
|
|
11
|
+
import {
|
|
12
|
+
View,
|
|
13
|
+
Text,
|
|
14
|
+
Pressable
|
|
15
|
+
} from "react-native";
|
|
16
|
+
var ListItem = React.forwardRef(
|
|
17
|
+
function ListItem2({
|
|
18
|
+
label,
|
|
19
|
+
subtitle,
|
|
20
|
+
prefix,
|
|
21
|
+
isLast = false,
|
|
22
|
+
isFirst = false,
|
|
23
|
+
suffix,
|
|
24
|
+
style,
|
|
25
|
+
inset = false,
|
|
26
|
+
...restProps
|
|
27
|
+
}, ref) {
|
|
28
|
+
const isLarge = subtitle !== void 0 && subtitle !== "" || suffix !== void 0 || prefix !== void 0 || inset;
|
|
29
|
+
return <Pressable
|
|
30
|
+
ref={ref}
|
|
31
|
+
{...restProps}
|
|
32
|
+
accessibilityLabel={label}
|
|
33
|
+
accessible
|
|
34
|
+
style={[
|
|
35
|
+
style,
|
|
36
|
+
styles.container,
|
|
37
|
+
isLarge && styles.large,
|
|
38
|
+
isLast && styles.lastItem,
|
|
39
|
+
inset && styles.inset,
|
|
40
|
+
inset && isLast && styles.insetLast,
|
|
41
|
+
inset && isFirst && styles.insetFirst
|
|
42
|
+
]}
|
|
43
|
+
>
|
|
44
|
+
{prefix}
|
|
45
|
+
<View style={{ flex: 1 }}>
|
|
46
|
+
<Text numberOfLines={1} style={styles.title}>{label}</Text>
|
|
47
|
+
{subtitle && <Text style={styles.subtitle}>{subtitle}</Text>}
|
|
48
|
+
</View>
|
|
49
|
+
{suffix}
|
|
50
|
+
</Pressable>;
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
var ChevronSuffix = ({ title }) => <View style={{ flexDirection: "row", alignItems: "center" }}>
|
|
54
|
+
<Text style={{ color: theme.collection["list item"]["end slot"].detail }}>{title}</Text>
|
|
55
|
+
<Icon
|
|
56
|
+
color={theme.collection["list item"]["end slot"].chevron}
|
|
57
|
+
name="chevron-right"
|
|
58
|
+
size={20}
|
|
59
|
+
/>
|
|
60
|
+
</View>;
|
|
61
|
+
ListItem.ChevronSuffix = ChevronSuffix;
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
ListItem
|
|
65
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/styles/fonts.ts
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
|
+
var fonts = StyleSheet.create({
|
|
4
|
+
bodyLarge: {
|
|
5
|
+
fontSize: 16,
|
|
6
|
+
fontFamily: "Cabin-Regular",
|
|
7
|
+
fontWeight: "400",
|
|
8
|
+
lineHeight: 24,
|
|
9
|
+
letterSpacing: 0.5
|
|
10
|
+
},
|
|
11
|
+
bodyMedium: {
|
|
12
|
+
fontSize: 14,
|
|
13
|
+
fontWeight: "400",
|
|
14
|
+
lineHeight: 20,
|
|
15
|
+
fontFamily: "Cabin-Regular",
|
|
16
|
+
letterSpacing: 0.25
|
|
17
|
+
},
|
|
18
|
+
bodySmall: {
|
|
19
|
+
fontSize: 12,
|
|
20
|
+
fontFamily: "Cabin-Regular",
|
|
21
|
+
letterSpacing: 0.36
|
|
22
|
+
},
|
|
23
|
+
titleSmall: {
|
|
24
|
+
fontSize: 14,
|
|
25
|
+
fontWeight: "500",
|
|
26
|
+
lineHeight: 20,
|
|
27
|
+
fontFamily: "Cabin-Regular",
|
|
28
|
+
letterSpacing: 0.5
|
|
29
|
+
},
|
|
30
|
+
labelMedium: {
|
|
31
|
+
fontSize: 12,
|
|
32
|
+
fontWeight: "500",
|
|
33
|
+
lineHeight: 16,
|
|
34
|
+
fontFamily: "Cabin-Regular",
|
|
35
|
+
letterSpacing: 0.5
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
fonts
|
|
41
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fonts
|
|
3
|
+
} from "./chunk.4SSEOHVB.js";
|
|
4
|
+
|
|
5
|
+
// src/components/listCaption/ListCaption.styles.ts
|
|
6
|
+
import theme from "@ds-autonomie/assets/js/dsa-theme";
|
|
7
|
+
import { StyleSheet } from "react-native";
|
|
8
|
+
var listCaptionStyles = StyleSheet.create({
|
|
9
|
+
container: {
|
|
10
|
+
paddingHorizontal: theme.primitives.spacing[16],
|
|
11
|
+
paddingTop: theme.primitives.spacing[12]
|
|
12
|
+
},
|
|
13
|
+
text: {
|
|
14
|
+
...fonts.labelMedium,
|
|
15
|
+
paddingHorizontal: theme.primitives.spacing[16]
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
listCaptionStyles
|
|
21
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listTitleStyles
|
|
3
|
+
} from "./chunk.3QXPJAHY.js";
|
|
4
|
+
|
|
5
|
+
// src/components/listTitle/ListTitle.tsx
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { View, Text } from "react-native";
|
|
8
|
+
var ListTitle = React.forwardRef(
|
|
9
|
+
function ListTitle2({ style, children, ...restProps }, ref) {
|
|
10
|
+
return <View
|
|
11
|
+
ref={ref}
|
|
12
|
+
{...restProps}
|
|
13
|
+
accessibilityRole="text"
|
|
14
|
+
accessible
|
|
15
|
+
style={[style, listTitleStyles.container]}
|
|
16
|
+
><Text style={[listTitleStyles.text]}>{children}</Text></View>;
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
ListTitle
|
|
22
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getCursorColors,
|
|
3
|
+
inputWrapperStyles,
|
|
4
|
+
styles
|
|
5
|
+
} from "./chunk.CIHQLL6Y.js";
|
|
6
|
+
import {
|
|
7
|
+
Icon
|
|
8
|
+
} from "./chunk.OQSCGAEY.js";
|
|
9
|
+
|
|
10
|
+
// src/components/textInput/TextInput.tsx
|
|
11
|
+
import React, { useState } from "react";
|
|
12
|
+
import {
|
|
13
|
+
TextInput as NativeTextInput,
|
|
14
|
+
View,
|
|
15
|
+
Text
|
|
16
|
+
} from "react-native";
|
|
17
|
+
var TextInput = React.forwardRef(function TextInput2({
|
|
18
|
+
label,
|
|
19
|
+
required = false,
|
|
20
|
+
error = false,
|
|
21
|
+
errorText,
|
|
22
|
+
disabled = false,
|
|
23
|
+
readOnly = false,
|
|
24
|
+
helpText,
|
|
25
|
+
style,
|
|
26
|
+
onFocus,
|
|
27
|
+
onBlur,
|
|
28
|
+
multiline,
|
|
29
|
+
maxLength,
|
|
30
|
+
value,
|
|
31
|
+
testID,
|
|
32
|
+
...props
|
|
33
|
+
}, ref) {
|
|
34
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
35
|
+
return <View
|
|
36
|
+
style={[style, styles.container]}
|
|
37
|
+
accessibilityState={{ disabled }}
|
|
38
|
+
testID={`${testID}/container`}
|
|
39
|
+
>
|
|
40
|
+
<View style={styles.header}>
|
|
41
|
+
{label !== void 0 && label.length > 0 && <Text
|
|
42
|
+
nativeID="label"
|
|
43
|
+
testID={`${testID}/label`}
|
|
44
|
+
style={styles.label}
|
|
45
|
+
>
|
|
46
|
+
{required && <Text style={styles.labelRequired}>* </Text>}
|
|
47
|
+
{label}
|
|
48
|
+
</Text>}
|
|
49
|
+
{maxLength !== void 0 && <Text style={styles.counter} testID={`${testID}/counter`}>
|
|
50
|
+
{value.length}
|
|
51
|
+
{"/"}
|
|
52
|
+
{maxLength}
|
|
53
|
+
</Text>}
|
|
54
|
+
</View>
|
|
55
|
+
<View
|
|
56
|
+
style={[
|
|
57
|
+
inputWrapperStyles.default,
|
|
58
|
+
isFocused && inputWrapperStyles.focused,
|
|
59
|
+
error && inputWrapperStyles.error,
|
|
60
|
+
readOnly && inputWrapperStyles.readonly,
|
|
61
|
+
disabled && inputWrapperStyles.disabled
|
|
62
|
+
]}
|
|
63
|
+
><NativeTextInput
|
|
64
|
+
aria-label={label}
|
|
65
|
+
aria-labelby="label"
|
|
66
|
+
testID={`${testID}/input`}
|
|
67
|
+
{...props}
|
|
68
|
+
ref={ref}
|
|
69
|
+
value={value}
|
|
70
|
+
multiline={multiline}
|
|
71
|
+
maxLength={maxLength}
|
|
72
|
+
style={styles.input}
|
|
73
|
+
{...getCursorColors(error)}
|
|
74
|
+
onFocus={(e) => {
|
|
75
|
+
setIsFocused(true);
|
|
76
|
+
onFocus?.(e);
|
|
77
|
+
}}
|
|
78
|
+
onBlur={(e) => {
|
|
79
|
+
setIsFocused(false);
|
|
80
|
+
onBlur?.(e);
|
|
81
|
+
}}
|
|
82
|
+
editable={!(readOnly || disabled)}
|
|
83
|
+
/></View>
|
|
84
|
+
{error && errorText !== void 0 && <View style={[styles.bottomMessage]} testID={`${testID}/errorText`}>
|
|
85
|
+
<Icon name="error" style={styles.errorIcon} />
|
|
86
|
+
<Text style={styles.errorText}>{errorText}</Text>
|
|
87
|
+
</View>}
|
|
88
|
+
{helpText !== void 0 && <View style={[styles.bottomMessage]} testID={`${testID}/helpText`}><Text style={styles.helpText}>{helpText}</Text></View>}
|
|
89
|
+
</View>;
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export {
|
|
93
|
+
TextInput
|
|
94
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/components/searchField/SearchField.styles.tsx
|
|
2
|
+
import theme from "@ds-autonomie/assets/js/dsa-theme";
|
|
3
|
+
import { StyleSheet } from "react-native";
|
|
4
|
+
|
|
5
|
+
// src/utils/device.ts
|
|
6
|
+
import { Platform } from "react-native";
|
|
7
|
+
var isIOS = Platform.OS === "ios";
|
|
8
|
+
var isAndroid = Platform.OS === "android";
|
|
9
|
+
|
|
10
|
+
// src/components/searchField/SearchField.styles.tsx
|
|
11
|
+
var placeholderTextColor = "#3C3C4399";
|
|
12
|
+
var styles = StyleSheet.create({
|
|
13
|
+
container: {
|
|
14
|
+
flexDirection: "row",
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
borderRadius: 10,
|
|
17
|
+
backgroundColor: "#7676801F",
|
|
18
|
+
padding: theme.primitives.spacing[8],
|
|
19
|
+
paddingLeft: 0
|
|
20
|
+
},
|
|
21
|
+
iOScontainer: {
|
|
22
|
+
padding: 7,
|
|
23
|
+
paddingLeft: 0
|
|
24
|
+
},
|
|
25
|
+
disabledContainer: {
|
|
26
|
+
backgroundColor: theme.collection.input.background.disabled
|
|
27
|
+
},
|
|
28
|
+
input: {
|
|
29
|
+
flex: 1
|
|
30
|
+
},
|
|
31
|
+
icon: {
|
|
32
|
+
position: "absolute",
|
|
33
|
+
left: theme.primitives.spacing[8]
|
|
34
|
+
},
|
|
35
|
+
iOSInput: {
|
|
36
|
+
paddingLeft: 38
|
|
37
|
+
},
|
|
38
|
+
androidInput: {
|
|
39
|
+
paddingLeft: 56
|
|
40
|
+
},
|
|
41
|
+
iosIcon: {
|
|
42
|
+
top: 5,
|
|
43
|
+
width: 18,
|
|
44
|
+
height: 18,
|
|
45
|
+
marginLeft: theme.primitives.spacing[8]
|
|
46
|
+
},
|
|
47
|
+
androidIcon: {
|
|
48
|
+
marginLeft: theme.primitives.spacing[12]
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
var iconStyleByPlateform = {
|
|
52
|
+
ios: {
|
|
53
|
+
color: "rgba(60, 60, 67, 0.60)",
|
|
54
|
+
size: 22,
|
|
55
|
+
style: [styles.icon, styles.iosIcon]
|
|
56
|
+
},
|
|
57
|
+
android: {
|
|
58
|
+
color: "#000000",
|
|
59
|
+
style: [styles.icon, styles.androidIcon],
|
|
60
|
+
size: 24
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var plateformStyles = isIOS ? iconStyleByPlateform.ios : iconStyleByPlateform.android;
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
isIOS,
|
|
67
|
+
placeholderTextColor,
|
|
68
|
+
styles,
|
|
69
|
+
plateformStyles
|
|
70
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Icon
|
|
3
|
-
} from "./chunk.4EJ4MEUR.js";
|
|
4
1
|
import {
|
|
5
2
|
getToggleStyle,
|
|
6
3
|
styles
|
|
7
4
|
} from "./chunk.CZ5Y2AVH.js";
|
|
5
|
+
import {
|
|
6
|
+
Icon
|
|
7
|
+
} from "./chunk.OQSCGAEY.js";
|
|
8
8
|
|
|
9
9
|
// src/components/toggle/Toggle.tsx
|
|
10
10
|
import React, { useEffect, useState } from "react";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fonts
|
|
3
|
+
} from "./chunk.4SSEOHVB.js";
|
|
4
|
+
|
|
5
|
+
// src/components/textInput/TextInput.styles.ts
|
|
6
|
+
import theme from "@ds-autonomie/assets/js/dsa-theme";
|
|
7
|
+
import { StyleSheet } from "react-native";
|
|
8
|
+
var styles = StyleSheet.create({
|
|
9
|
+
container: {
|
|
10
|
+
display: "flex",
|
|
11
|
+
flex: 1
|
|
12
|
+
},
|
|
13
|
+
header: {
|
|
14
|
+
marginBottom: theme.primitives.spacing["8"],
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexDirection: "row"
|
|
17
|
+
},
|
|
18
|
+
label: {
|
|
19
|
+
...fonts.bodyLarge,
|
|
20
|
+
color: theme.collection.input.title
|
|
21
|
+
},
|
|
22
|
+
counter: {
|
|
23
|
+
marginLeft: "auto",
|
|
24
|
+
...fonts.bodyLarge,
|
|
25
|
+
color: theme.collection.input.title
|
|
26
|
+
},
|
|
27
|
+
labelRequired: {
|
|
28
|
+
color: theme.collection.input["text error"]
|
|
29
|
+
},
|
|
30
|
+
input: {
|
|
31
|
+
paddingTop: theme.primitives.spacing["16"],
|
|
32
|
+
paddingBottom: theme.primitives.spacing["16"],
|
|
33
|
+
paddingRight: theme.primitives.spacing["16"],
|
|
34
|
+
paddingLeft: theme.primitives.spacing["16"],
|
|
35
|
+
borderRadius: theme.primitives.radius["8"],
|
|
36
|
+
...fonts.bodyLarge
|
|
37
|
+
},
|
|
38
|
+
bottomMessage: {
|
|
39
|
+
marginTop: theme.primitives.spacing["8"],
|
|
40
|
+
display: "flex",
|
|
41
|
+
flexDirection: "row"
|
|
42
|
+
},
|
|
43
|
+
errorText: {
|
|
44
|
+
color: theme.collection.input["text error"]
|
|
45
|
+
},
|
|
46
|
+
errorIcon: {
|
|
47
|
+
...fonts.bodyMedium,
|
|
48
|
+
color: theme.collection.input["text error"],
|
|
49
|
+
marginTop: 3,
|
|
50
|
+
marginRight: theme.primitives.spacing["4"]
|
|
51
|
+
},
|
|
52
|
+
helpText: {
|
|
53
|
+
color: theme.collection.input.hint
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
var inputWrapperStyles = StyleSheet.create({
|
|
57
|
+
default: {
|
|
58
|
+
backgroundColor: theme.collection.input.background.default,
|
|
59
|
+
borderColor: theme.collection.input.border.default,
|
|
60
|
+
borderWidth: 1,
|
|
61
|
+
borderRadius: theme.primitives.radius["8"]
|
|
62
|
+
},
|
|
63
|
+
focused: {
|
|
64
|
+
borderColor: theme.collection.input.border.active
|
|
65
|
+
},
|
|
66
|
+
error: {
|
|
67
|
+
borderColor: theme.collection.input.border.error,
|
|
68
|
+
backgroundColor: theme.collection.input.background.error,
|
|
69
|
+
color: theme.collection.input.content.error
|
|
70
|
+
},
|
|
71
|
+
readonly: {
|
|
72
|
+
borderColor: theme.collection.input.border["read only"],
|
|
73
|
+
backgroundColor: theme.collection.input.background["read only"],
|
|
74
|
+
color: theme.collection.input.content["read only"]
|
|
75
|
+
},
|
|
76
|
+
disabled: {
|
|
77
|
+
borderColor: theme.collection.input.border.disabled,
|
|
78
|
+
backgroundColor: theme.collection.input.background.disabled,
|
|
79
|
+
color: theme.collection.input.content.disabled
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
function getCursorColors(error) {
|
|
83
|
+
return {
|
|
84
|
+
cursorColor: error ? theme.collection.input.cursor.error : theme.collection.input.cursor.default,
|
|
85
|
+
selectionColor: error ? theme.collection.input.cursor.error : theme.collection.input.cursor.default
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
styles,
|
|
91
|
+
inputWrapperStyles,
|
|
92
|
+
getCursorColors
|
|
93
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getContainerStyle,
|
|
3
|
+
getIconColor,
|
|
4
|
+
getTextStyle
|
|
5
|
+
} from "./chunk.RNOZ5AW4.js";
|
|
6
|
+
import {
|
|
7
|
+
Icon
|
|
8
|
+
} from "./chunk.OQSCGAEY.js";
|
|
9
|
+
|
|
10
|
+
// src/components/button/Button.tsx
|
|
11
|
+
import React from "react";
|
|
12
|
+
import {
|
|
13
|
+
Pressable,
|
|
14
|
+
Text
|
|
15
|
+
} from "react-native";
|
|
16
|
+
var Button = React.forwardRef(function Toggle({
|
|
17
|
+
variant = "primary",
|
|
18
|
+
style,
|
|
19
|
+
disabled = false,
|
|
20
|
+
endIcon,
|
|
21
|
+
size = "medium",
|
|
22
|
+
startIcon,
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}, ref) {
|
|
26
|
+
const hasOnlyOneIcon = [!!startIcon, !!endIcon].filter(Boolean).length === 1 && !children;
|
|
27
|
+
return <Pressable
|
|
28
|
+
ref={ref}
|
|
29
|
+
{...props}
|
|
30
|
+
accessibilityLabel="button"
|
|
31
|
+
accessibilityRole="button"
|
|
32
|
+
accessible
|
|
33
|
+
aria-disabled={disabled}
|
|
34
|
+
accessibilityState={{
|
|
35
|
+
disabled
|
|
36
|
+
}}
|
|
37
|
+
disabled={disabled}
|
|
38
|
+
role="button"
|
|
39
|
+
style={({ pressed }) => [
|
|
40
|
+
style,
|
|
41
|
+
getContainerStyle({ variant, size, hasOnlyOneIcon, disabled, pressed })
|
|
42
|
+
]}
|
|
43
|
+
>{({ pressed }) => {
|
|
44
|
+
const iconColor = getIconColor({
|
|
45
|
+
pressed,
|
|
46
|
+
disabled,
|
|
47
|
+
variant
|
|
48
|
+
});
|
|
49
|
+
return <>
|
|
50
|
+
{startIcon && <Icon name={startIcon} color={iconColor} size={24} />}
|
|
51
|
+
{children !== void 0 && <Text
|
|
52
|
+
style={[
|
|
53
|
+
getTextStyle({
|
|
54
|
+
variant,
|
|
55
|
+
size,
|
|
56
|
+
hasOnlyOneIcon,
|
|
57
|
+
disabled,
|
|
58
|
+
pressed
|
|
59
|
+
})
|
|
60
|
+
]}
|
|
61
|
+
>{children}</Text>}
|
|
62
|
+
{endIcon && <Icon name={endIcon} color={iconColor} size={24} />}
|
|
63
|
+
</>;
|
|
64
|
+
}}</Pressable>;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
Button
|
|
69
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// src/components/checkbox/Checkbox.styles.ts
|
|
2
|
+
import theme from "@ds-autonomie/assets/js/dsa-theme";
|
|
3
|
+
import { StyleSheet } from "react-native";
|
|
4
|
+
var checkboxTheme = theme.collection["toggle item"]["toggle item"].checkbox;
|
|
5
|
+
var checkboxContainerStyles = StyleSheet.create({
|
|
6
|
+
default: {
|
|
7
|
+
width: 20,
|
|
8
|
+
height: 20,
|
|
9
|
+
borderWidth: 2,
|
|
10
|
+
borderRadius: 2,
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
justifyContent: "center",
|
|
13
|
+
borderColor: checkboxTheme.default
|
|
14
|
+
},
|
|
15
|
+
error: {
|
|
16
|
+
borderColor: checkboxTheme.error
|
|
17
|
+
},
|
|
18
|
+
disabled: {
|
|
19
|
+
borderColor: checkboxTheme.disabled
|
|
20
|
+
},
|
|
21
|
+
active: {
|
|
22
|
+
borderColor: checkboxTheme.active
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var checkboxCheckStyles = StyleSheet.create({
|
|
26
|
+
default: {
|
|
27
|
+
width: 20,
|
|
28
|
+
height: 20,
|
|
29
|
+
borderRadius: 2,
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
justifyContent: "center"
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
backgroundColor: checkboxTheme.disabled
|
|
35
|
+
},
|
|
36
|
+
error: {
|
|
37
|
+
backgroundColor: checkboxTheme.error
|
|
38
|
+
},
|
|
39
|
+
active: {
|
|
40
|
+
backgroundColor: checkboxTheme.active
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
checkboxContainerStyles,
|
|
46
|
+
checkboxCheckStyles
|
|
47
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fonts
|
|
3
|
+
} from "./chunk.4SSEOHVB.js";
|
|
4
|
+
|
|
5
|
+
// src/components/listItem/ListItem.styles.ts
|
|
6
|
+
import theme from "@ds-autonomie/assets/js/dsa-theme";
|
|
7
|
+
import { StyleSheet } from "react-native";
|
|
8
|
+
var styles = StyleSheet.create({
|
|
9
|
+
container: {
|
|
10
|
+
borderBottomWidth: 1,
|
|
11
|
+
borderBottomColor: theme.collection.background.divider,
|
|
12
|
+
backgroundColor: theme.collection["list item"].background,
|
|
13
|
+
paddingHorizontal: theme.primitives.spacing[16],
|
|
14
|
+
paddingVertical: theme.primitives.spacing[8],
|
|
15
|
+
display: "flex",
|
|
16
|
+
height: "auto",
|
|
17
|
+
flexDirection: "row",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
gap: theme.primitives.spacing[16]
|
|
20
|
+
},
|
|
21
|
+
large: {
|
|
22
|
+
minHeight: 60
|
|
23
|
+
},
|
|
24
|
+
lastItem: {
|
|
25
|
+
borderBottomWidth: 0,
|
|
26
|
+
paddingBottom: theme.primitives.spacing[8] + 1
|
|
27
|
+
},
|
|
28
|
+
title: {
|
|
29
|
+
...fonts.bodyLarge,
|
|
30
|
+
color: theme.collection["list item"].label
|
|
31
|
+
},
|
|
32
|
+
subtitle: {
|
|
33
|
+
...fonts.bodyMedium,
|
|
34
|
+
color: theme.collection["list item"].subtitle
|
|
35
|
+
},
|
|
36
|
+
inset: {
|
|
37
|
+
marginHorizontal: theme.primitives.spacing[16]
|
|
38
|
+
},
|
|
39
|
+
insetFirst: {
|
|
40
|
+
borderTopRightRadius: theme.primitives.radius[8],
|
|
41
|
+
borderTopLeftRadius: theme.primitives.radius[8]
|
|
42
|
+
},
|
|
43
|
+
insetLast: {
|
|
44
|
+
borderBottomRightRadius: theme.primitives.radius[8],
|
|
45
|
+
borderBottomLeftRadius: theme.primitives.radius[8]
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
styles
|
|
51
|
+
};
|