@ds-autonomie/react-native 0.2.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/chunks/chunk.3QXPJAHY.js +22 -0
  3. package/dist/chunks/chunk.4MPJJ7EN.js +65 -0
  4. package/dist/chunks/chunk.4SSEOHVB.js +41 -0
  5. package/dist/chunks/chunk.4ZX27FCY.js +21 -0
  6. package/dist/chunks/chunk.6DY4BFMZ.js +22 -0
  7. package/dist/chunks/{chunk.2HOUMFYI.js → chunk.73S52VD6.js} +2 -2
  8. package/dist/chunks/{chunk.MCKLJGG3.js → chunk.7H4YRP4X.js} +2 -2
  9. package/dist/chunks/{chunk.QOZS5EA3.js → chunk.CIHQLL6Y.js} +7 -25
  10. package/dist/chunks/chunk.DMHRBYRF.js +69 -0
  11. package/dist/chunks/chunk.INEDXDER.js +51 -0
  12. package/dist/{components/search/SearchField.js → chunks/chunk.KVGKM2JI.js} +3 -2
  13. package/dist/chunks/chunk.KVXJ2L2C.js +22 -0
  14. package/dist/chunks/chunk.LN5IVTGU.js +60 -0
  15. package/dist/chunks/chunk.SZJKAIPC.js +20 -0
  16. package/dist/chunks/chunk.XCMNSIIN.js +72 -0
  17. package/dist/components/button/Button.js +4 -64
  18. package/dist/components/checkbox/Checkbox.js +4 -67
  19. package/dist/components/divider/Divider.d.ts +7 -0
  20. package/dist/components/divider/Divider.js +24 -0
  21. package/dist/components/divider/Divider.styles.d.ts +13 -0
  22. package/dist/components/divider/Divider.styles.js +6 -0
  23. package/dist/components/listCaption/ListCaption.d.ts +7 -0
  24. package/dist/components/listCaption/ListCaption.js +8 -0
  25. package/dist/components/listCaption/ListCaption.styles.d.ts +14 -0
  26. package/dist/components/listCaption/ListCaption.styles.js +7 -0
  27. package/dist/components/listItem/ListItem.d.ts +34 -0
  28. package/dist/components/listItem/ListItem.js +9 -0
  29. package/dist/components/listItem/ListItem.styles.d.ts +48 -0
  30. package/dist/components/listItem/ListItem.styles.js +7 -0
  31. package/dist/components/listTitle/ListTitle.d.ts +7 -0
  32. package/dist/components/listTitle/ListTitle.js +8 -0
  33. package/dist/components/listTitle/ListTitle.styles.d.ts +15 -0
  34. package/dist/components/listTitle/ListTitle.styles.js +7 -0
  35. package/dist/components/radio/Radio.js +3 -55
  36. package/dist/components/searchField/SearchField.js +7 -0
  37. package/dist/components/{search → searchField}/SearchField.styles.js +1 -1
  38. package/dist/components/textInput/TextInput.js +9 -0
  39. package/dist/components/{text-input → textInput}/TextInput.styles.d.ts +8 -0
  40. package/dist/components/{text-input → textInput}/TextInput.styles.js +2 -1
  41. package/dist/index.d.ts +9 -1
  42. package/dist/index.js +42 -3
  43. package/dist/styles/fonts.d.ts +18 -0
  44. package/package.json +1 -1
  45. package/dist/components/text-input/TextInput.js +0 -8
  46. /package/dist/components/{search → searchField}/SearchField.d.ts +0 -0
  47. /package/dist/components/{search → searchField}/SearchField.styles.d.ts +0 -0
  48. /package/dist/components/{text-input → textInput}/TextInput.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
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
+
3
16
  ## 0.2.0
4
17
 
5
18
  ### 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
+ };
@@ -2,12 +2,12 @@ import {
2
2
  getCursorColors,
3
3
  inputWrapperStyles,
4
4
  styles
5
- } from "./chunk.QOZS5EA3.js";
5
+ } from "./chunk.CIHQLL6Y.js";
6
6
  import {
7
7
  Icon
8
8
  } from "./chunk.OQSCGAEY.js";
9
9
 
10
- // src/components/text-input/TextInput.tsx
10
+ // src/components/textInput/TextInput.tsx
11
11
  import React, { useState } from "react";
12
12
  import {
13
13
  TextInput as NativeTextInput,
@@ -1,4 +1,4 @@
1
- // src/components/search/SearchField.styles.tsx
1
+ // src/components/searchField/SearchField.styles.tsx
2
2
  import theme from "@ds-autonomie/assets/js/dsa-theme";
3
3
  import { StyleSheet } from "react-native";
4
4
 
@@ -7,7 +7,7 @@ import { Platform } from "react-native";
7
7
  var isIOS = Platform.OS === "ios";
8
8
  var isAndroid = Platform.OS === "android";
9
9
 
10
- // src/components/search/SearchField.styles.tsx
10
+ // src/components/searchField/SearchField.styles.tsx
11
11
  var placeholderTextColor = "#3C3C4399";
12
12
  var styles = StyleSheet.create({
13
13
  container: {
@@ -1,29 +1,11 @@
1
- // src/components/text-input/TextInput.styles.ts
2
- import theme from "@ds-autonomie/assets/js/dsa-theme";
3
- import { StyleSheet as StyleSheet2 } from "react-native";
1
+ import {
2
+ fonts
3
+ } from "./chunk.4SSEOHVB.js";
4
4
 
5
- // src/styles/fonts.ts
5
+ // src/components/textInput/TextInput.styles.ts
6
+ import theme from "@ds-autonomie/assets/js/dsa-theme";
6
7
  import { StyleSheet } from "react-native";
7
- var fonts = StyleSheet.create({
8
- bodyLarge: {
9
- fontSize: 16,
10
- fontFamily: "Cabin-Regular",
11
- letterSpacing: 0.5
12
- },
13
- bodyMedium: {
14
- fontSize: 14,
15
- fontFamily: "Cabin-Regular",
16
- letterSpacing: 0.25
17
- },
18
- bodySmall: {
19
- fontSize: 12,
20
- fontFamily: "Cabin-Regular",
21
- letterSpacing: 0.36
22
- }
23
- });
24
-
25
- // src/components/text-input/TextInput.styles.ts
26
- var styles = StyleSheet2.create({
8
+ var styles = StyleSheet.create({
27
9
  container: {
28
10
  display: "flex",
29
11
  flex: 1
@@ -71,7 +53,7 @@ var styles = StyleSheet2.create({
71
53
  color: theme.collection.input.hint
72
54
  }
73
55
  });
74
- var inputWrapperStyles = StyleSheet2.create({
56
+ var inputWrapperStyles = StyleSheet.create({
75
57
  default: {
76
58
  backgroundColor: theme.collection.input.background.default,
77
59
  borderColor: theme.collection.input.border.default,
@@ -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,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
+ };
@@ -3,9 +3,9 @@ import {
3
3
  placeholderTextColor,
4
4
  plateformStyles,
5
5
  styles
6
- } from "../../chunks/chunk.MCKLJGG3.js";
6
+ } from "./chunk.7H4YRP4X.js";
7
7
 
8
- // src/components/search/SearchField.tsx
8
+ // src/components/searchField/SearchField.tsx
9
9
  import React, { useEffect, useState } from "react";
10
10
  import {
11
11
  View,
@@ -67,6 +67,7 @@ var SearchField = React.forwardRef(
67
67
  </View>;
68
68
  }
69
69
  );
70
+
70
71
  export {
71
72
  SearchField
72
73
  };
@@ -0,0 +1,22 @@
1
+ import {
2
+ listCaptionStyles
3
+ } from "./chunk.4ZX27FCY.js";
4
+
5
+ // src/components/listCaption/ListCaption.tsx
6
+ import React from "react";
7
+ import { View, Text } from "react-native";
8
+ var ListCaption = React.forwardRef(
9
+ function ListCaption2({ style, children, ...restProps }, ref) {
10
+ return <View
11
+ ref={ref}
12
+ {...restProps}
13
+ accessibilityRole="text"
14
+ accessible
15
+ style={[style, listCaptionStyles.container]}
16
+ ><Text style={[listCaptionStyles.text]}>{children}</Text></View>;
17
+ }
18
+ );
19
+
20
+ export {
21
+ ListCaption
22
+ };
@@ -0,0 +1,60 @@
1
+ import {
2
+ radioContainerStyles,
3
+ radioDotStyles
4
+ } from "./chunk.YWEWQ2LT.js";
5
+
6
+ // src/components/radio/Radio.tsx
7
+ import React, { useEffect, useState } from "react";
8
+ import { Pressable, View } from "react-native";
9
+ var Radio = React.forwardRef(function Checkbox({
10
+ value = false,
11
+ disabled = false,
12
+ onValueChange,
13
+ style: styleProps,
14
+ ...restProps
15
+ }, ref) {
16
+ const [checked, setChecked] = useState(value);
17
+ useEffect(
18
+ function onValueUpdate() {
19
+ setChecked(value);
20
+ },
21
+ [value]
22
+ );
23
+ function handlePress() {
24
+ if (disabled || checked) {
25
+ return;
26
+ }
27
+ onValueChange?.(true);
28
+ setChecked(true);
29
+ }
30
+ return <Pressable
31
+ ref={ref}
32
+ {...restProps}
33
+ accessibilityLabel="radio"
34
+ accessibilityRole="radio"
35
+ accessibilityState={{ checked, disabled }}
36
+ accessible
37
+ aria-checked={checked}
38
+ aria-disabled={disabled}
39
+ aria-pressed={checked}
40
+ onPress={handlePress}
41
+ hitSlop={14}
42
+ role="radio"
43
+ style={[
44
+ styleProps,
45
+ radioContainerStyles.default,
46
+ checked && radioContainerStyles.active,
47
+ disabled && radioContainerStyles.disabled
48
+ ]}
49
+ >{checked && <View
50
+ style={[
51
+ radioDotStyles.default,
52
+ checked && radioDotStyles.active,
53
+ disabled && radioDotStyles.disabled
54
+ ]}
55
+ />}</Pressable>;
56
+ });
57
+
58
+ export {
59
+ Radio
60
+ };
@@ -0,0 +1,20 @@
1
+ // src/components/divider/Divider.styles.ts
2
+ import theme from "@ds-autonomie/assets/js/dsa-theme";
3
+ import { StyleSheet } from "react-native";
4
+ var dividerStyles = StyleSheet.create({
5
+ container: {
6
+ backgroundColor: theme.collection.background.divider
7
+ },
8
+ horizontal: {
9
+ height: 1,
10
+ width: "100%"
11
+ },
12
+ vertical: {
13
+ width: 1,
14
+ height: "100%"
15
+ }
16
+ });
17
+
18
+ export {
19
+ dividerStyles
20
+ };
@@ -0,0 +1,72 @@
1
+ import {
2
+ checkboxCheckStyles,
3
+ checkboxContainerStyles
4
+ } from "./chunk.H2AL2E3A.js";
5
+ import {
6
+ Icon
7
+ } from "./chunk.OQSCGAEY.js";
8
+
9
+ // src/components/checkbox/Checkbox.tsx
10
+ import theme from "@ds-autonomie/assets/js/dsa-theme";
11
+ import React, { useEffect, useState } from "react";
12
+ import { Pressable, View } from "react-native";
13
+ var Checkbox = React.forwardRef(function Checkbox2({
14
+ value = false,
15
+ disabled = false,
16
+ error = false,
17
+ onValueChange,
18
+ style: styleProps,
19
+ ...restProps
20
+ }, ref) {
21
+ const [checked, setChecked] = useState(value);
22
+ useEffect(
23
+ function onValueUpdate() {
24
+ setChecked(value);
25
+ },
26
+ [value]
27
+ );
28
+ function handlePress() {
29
+ if (disabled) {
30
+ return;
31
+ }
32
+ onValueChange?.(!checked);
33
+ setChecked(!checked);
34
+ }
35
+ return <Pressable
36
+ ref={ref}
37
+ {...restProps}
38
+ accessibilityLabel="checkbox"
39
+ accessibilityRole="checkbox"
40
+ accessibilityState={{ checked, disabled }}
41
+ accessible
42
+ aria-checked={checked}
43
+ aria-disabled={disabled}
44
+ aria-invalid={error}
45
+ aria-pressed={checked}
46
+ onPress={handlePress}
47
+ role="checkbox"
48
+ hitSlop={15}
49
+ style={[
50
+ styleProps,
51
+ checkboxContainerStyles.default,
52
+ checked && checkboxContainerStyles.active,
53
+ error && checkboxContainerStyles.error,
54
+ disabled && checkboxContainerStyles.disabled
55
+ ]}
56
+ >{checked && <View
57
+ style={[
58
+ checkboxCheckStyles.default,
59
+ checked && checkboxCheckStyles.active,
60
+ error && checkboxCheckStyles.error,
61
+ disabled && checkboxCheckStyles.disabled
62
+ ]}
63
+ ><Icon
64
+ name="check"
65
+ color={theme.primitives.color.neutral[100]}
66
+ size={18}
67
+ /></View>}</Pressable>;
68
+ });
69
+
70
+ export {
71
+ Checkbox
72
+ };
@@ -1,68 +1,8 @@
1
1
  import {
2
- getContainerStyle,
3
- getIconColor,
4
- getTextStyle
5
- } from "../../chunks/chunk.RNOZ5AW4.js";
6
- import {
7
- Icon
8
- } from "../../chunks/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
- });
2
+ Button
3
+ } from "../../chunks/chunk.DMHRBYRF.js";
4
+ import "../../chunks/chunk.RNOZ5AW4.js";
5
+ import "../../chunks/chunk.OQSCGAEY.js";
66
6
  export {
67
7
  Button
68
8
  };
@@ -1,71 +1,8 @@
1
1
  import {
2
- checkboxCheckStyles,
3
- checkboxContainerStyles
4
- } from "../../chunks/chunk.H2AL2E3A.js";
5
- import {
6
- Icon
7
- } from "../../chunks/chunk.OQSCGAEY.js";
8
-
9
- // src/components/checkbox/Checkbox.tsx
10
- import theme from "@ds-autonomie/assets/js/dsa-theme";
11
- import React, { useEffect, useState } from "react";
12
- import { Pressable, View } from "react-native";
13
- var Checkbox = React.forwardRef(function Checkbox2({
14
- value = false,
15
- disabled = false,
16
- error = false,
17
- onValueChange,
18
- style: styleProps,
19
- ...restProps
20
- }, ref) {
21
- const [checked, setChecked] = useState(value);
22
- useEffect(
23
- function onValueUpdate() {
24
- setChecked(value);
25
- },
26
- [value]
27
- );
28
- function handlePress() {
29
- if (disabled) {
30
- return;
31
- }
32
- onValueChange?.(!checked);
33
- setChecked(!checked);
34
- }
35
- return <Pressable
36
- ref={ref}
37
- {...restProps}
38
- accessibilityLabel="checkbox"
39
- accessibilityRole="checkbox"
40
- accessibilityState={{ checked, disabled }}
41
- accessible
42
- aria-checked={checked}
43
- aria-disabled={disabled}
44
- aria-invalid={error}
45
- aria-pressed={checked}
46
- onPress={handlePress}
47
- role="checkbox"
48
- hitSlop={15}
49
- style={[
50
- styleProps,
51
- checkboxContainerStyles.default,
52
- checked && checkboxContainerStyles.active,
53
- error && checkboxContainerStyles.error,
54
- disabled && checkboxContainerStyles.disabled
55
- ]}
56
- >{checked && <View
57
- style={[
58
- checkboxCheckStyles.default,
59
- checked && checkboxCheckStyles.active,
60
- error && checkboxCheckStyles.error,
61
- disabled && checkboxCheckStyles.disabled
62
- ]}
63
- ><Icon
64
- name="check"
65
- color={theme.primitives.color.neutral[100]}
66
- size={18}
67
- /></View>}</Pressable>;
68
- });
2
+ Checkbox
3
+ } from "../../chunks/chunk.XCMNSIIN.js";
4
+ import "../../chunks/chunk.H2AL2E3A.js";
5
+ import "../../chunks/chunk.OQSCGAEY.js";
69
6
  export {
70
7
  Checkbox
71
8
  };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ViewProps } from 'react-native';
3
+ type DividerProps = {
4
+ orientation?: 'horizontal' | 'vertical';
5
+ } & ViewProps;
6
+ export declare const Divider: ({ orientation, style, ...rest }: DividerProps) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,24 @@
1
+ import {
2
+ dividerStyles
3
+ } from "../../chunks/chunk.SZJKAIPC.js";
4
+
5
+ // src/components/divider/Divider.tsx
6
+ import { View } from "react-native";
7
+ var Divider = ({
8
+ orientation = "horizontal",
9
+ style,
10
+ ...rest
11
+ }) => {
12
+ return <View
13
+ {...rest}
14
+ style={[
15
+ style,
16
+ dividerStyles.container,
17
+ orientation === "vertical" && dividerStyles.vertical,
18
+ orientation === "horizontal" && dividerStyles.horizontal
19
+ ]}
20
+ />;
21
+ };
22
+ export {
23
+ Divider
24
+ };
@@ -0,0 +1,13 @@
1
+ export declare const dividerStyles: {
2
+ container: {
3
+ backgroundColor: "#e7e7e7ff";
4
+ };
5
+ horizontal: {
6
+ height: number;
7
+ width: "100%";
8
+ };
9
+ vertical: {
10
+ width: number;
11
+ height: "100%";
12
+ };
13
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ dividerStyles
3
+ } from "../../chunks/chunk.SZJKAIPC.js";
4
+ export {
5
+ dividerStyles
6
+ };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { View, ViewProps } from 'react-native';
3
+ type OmittedProps = 'accessible' | 'accessibleRole';
4
+ export declare const ListCaption: React.ForwardRefExoticComponent<{
5
+ children: React.ReactNode;
6
+ } & Omit<ViewProps, OmittedProps> & React.RefAttributes<View>>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import {
2
+ ListCaption
3
+ } from "../../chunks/chunk.KVXJ2L2C.js";
4
+ import "../../chunks/chunk.4ZX27FCY.js";
5
+ import "../../chunks/chunk.4SSEOHVB.js";
6
+ export {
7
+ ListCaption
8
+ };
@@ -0,0 +1,14 @@
1
+ export declare const listCaptionStyles: {
2
+ container: {
3
+ paddingHorizontal: 16;
4
+ paddingTop: 12;
5
+ };
6
+ text: {
7
+ paddingHorizontal: 16;
8
+ fontSize: number;
9
+ fontWeight: "500";
10
+ lineHeight: number;
11
+ fontFamily: string;
12
+ letterSpacing: number;
13
+ };
14
+ };
@@ -0,0 +1,7 @@
1
+ import {
2
+ listCaptionStyles
3
+ } from "../../chunks/chunk.4ZX27FCY.js";
4
+ import "../../chunks/chunk.4SSEOHVB.js";
5
+ export {
6
+ listCaptionStyles
7
+ };
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { PressableProps, ViewStyle, StyleProp } from 'react-native';
3
+ type OmittedProps = 'accessibilityLabel' | 'accessible' | 'children' | 'style';
4
+ type InsetListItemProps = {
5
+ inset: true;
6
+ isLast: boolean;
7
+ isFirst: boolean;
8
+ };
9
+ type RegularListItemProps = {
10
+ inset: false;
11
+ isLast: boolean;
12
+ isFirst?: undefined;
13
+ };
14
+ type CommonListItemProps = {
15
+ label: string;
16
+ subtitle?: string;
17
+ prefix?: React.ReactNode;
18
+ suffix?: React.ReactNode;
19
+ /**
20
+ * If `style` is defined, it will extend the container style.
21
+ * If a similar property is defined, the new property will overwrite the old one.
22
+ * */
23
+ style?: StyleProp<ViewStyle>;
24
+ };
25
+ type ListItemProps = (InsetListItemProps | RegularListItemProps) & CommonListItemProps & Omit<PressableProps, OmittedProps>;
26
+ interface ListItemSubComponents {
27
+ ChevronSuffix?: typeof ChevronSuffix;
28
+ }
29
+ export declare const ListItem: React.ForwardRefExoticComponent<ListItemProps> & ListItemSubComponents;
30
+ type ChevronSuffixProps = {
31
+ title: string;
32
+ };
33
+ declare const ChevronSuffix: ({ title }: ChevronSuffixProps) => React.JSX.Element;
34
+ export {};
@@ -0,0 +1,9 @@
1
+ import {
2
+ ListItem
3
+ } from "../../chunks/chunk.4MPJJ7EN.js";
4
+ import "../../chunks/chunk.INEDXDER.js";
5
+ import "../../chunks/chunk.4SSEOHVB.js";
6
+ import "../../chunks/chunk.OQSCGAEY.js";
7
+ export {
8
+ ListItem
9
+ };
@@ -0,0 +1,48 @@
1
+ export declare const styles: {
2
+ container: {
3
+ borderBottomWidth: number;
4
+ borderBottomColor: "#e7e7e7ff";
5
+ backgroundColor: "#ffffffff";
6
+ paddingHorizontal: 16;
7
+ paddingVertical: 8;
8
+ display: "flex";
9
+ height: "auto";
10
+ flexDirection: "row";
11
+ alignItems: "center";
12
+ gap: 16;
13
+ };
14
+ large: {
15
+ minHeight: number;
16
+ };
17
+ lastItem: {
18
+ borderBottomWidth: number;
19
+ paddingBottom: number;
20
+ };
21
+ title: {
22
+ color: "#252625ff";
23
+ fontSize: number;
24
+ fontFamily: string;
25
+ fontWeight: "400";
26
+ lineHeight: number;
27
+ letterSpacing: number;
28
+ };
29
+ subtitle: {
30
+ color: "#666666ff";
31
+ fontSize: number;
32
+ fontWeight: "400";
33
+ lineHeight: number;
34
+ fontFamily: string;
35
+ letterSpacing: number;
36
+ };
37
+ inset: {
38
+ marginHorizontal: 16;
39
+ };
40
+ insetFirst: {
41
+ borderTopRightRadius: 8;
42
+ borderTopLeftRadius: 8;
43
+ };
44
+ insetLast: {
45
+ borderBottomRightRadius: 8;
46
+ borderBottomLeftRadius: 8;
47
+ };
48
+ };
@@ -0,0 +1,7 @@
1
+ import {
2
+ styles
3
+ } from "../../chunks/chunk.INEDXDER.js";
4
+ import "../../chunks/chunk.4SSEOHVB.js";
5
+ export {
6
+ styles
7
+ };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { View, ViewProps } from 'react-native';
3
+ type OmittedProps = 'accessible' | 'accessibleRole';
4
+ export declare const ListTitle: React.ForwardRefExoticComponent<{
5
+ children: React.ReactNode;
6
+ } & Omit<ViewProps, OmittedProps> & React.RefAttributes<View>>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import {
2
+ ListTitle
3
+ } from "../../chunks/chunk.6DY4BFMZ.js";
4
+ import "../../chunks/chunk.3QXPJAHY.js";
5
+ import "../../chunks/chunk.4SSEOHVB.js";
6
+ export {
7
+ ListTitle
8
+ };
@@ -0,0 +1,15 @@
1
+ export declare const listTitleStyles: {
2
+ container: {
3
+ paddingHorizontal: 16;
4
+ paddingTop: 8;
5
+ paddingBottom: 12;
6
+ };
7
+ text: {
8
+ paddingHorizontal: 16;
9
+ fontSize: number;
10
+ fontWeight: "500";
11
+ lineHeight: number;
12
+ fontFamily: string;
13
+ letterSpacing: number;
14
+ };
15
+ };
@@ -0,0 +1,7 @@
1
+ import {
2
+ listTitleStyles
3
+ } from "../../chunks/chunk.3QXPJAHY.js";
4
+ import "../../chunks/chunk.4SSEOHVB.js";
5
+ export {
6
+ listTitleStyles
7
+ };
@@ -1,59 +1,7 @@
1
1
  import {
2
- radioContainerStyles,
3
- radioDotStyles
4
- } from "../../chunks/chunk.YWEWQ2LT.js";
5
-
6
- // src/components/radio/Radio.tsx
7
- import React, { useEffect, useState } from "react";
8
- import { Pressable, View } from "react-native";
9
- var Radio = React.forwardRef(function Checkbox({
10
- value = false,
11
- disabled = false,
12
- onValueChange,
13
- style: styleProps,
14
- ...restProps
15
- }, ref) {
16
- const [checked, setChecked] = useState(value);
17
- useEffect(
18
- function onValueUpdate() {
19
- setChecked(value);
20
- },
21
- [value]
22
- );
23
- function handlePress() {
24
- if (disabled || checked) {
25
- return;
26
- }
27
- onValueChange?.(true);
28
- setChecked(true);
29
- }
30
- return <Pressable
31
- ref={ref}
32
- {...restProps}
33
- accessibilityLabel="radio"
34
- accessibilityRole="radio"
35
- accessibilityState={{ checked, disabled }}
36
- accessible
37
- aria-checked={checked}
38
- aria-disabled={disabled}
39
- aria-pressed={checked}
40
- onPress={handlePress}
41
- hitSlop={14}
42
- role="radio"
43
- style={[
44
- styleProps,
45
- radioContainerStyles.default,
46
- checked && radioContainerStyles.active,
47
- disabled && radioContainerStyles.disabled
48
- ]}
49
- >{checked && <View
50
- style={[
51
- radioDotStyles.default,
52
- checked && radioDotStyles.active,
53
- disabled && radioDotStyles.disabled
54
- ]}
55
- />}</Pressable>;
56
- });
2
+ Radio
3
+ } from "../../chunks/chunk.LN5IVTGU.js";
4
+ import "../../chunks/chunk.YWEWQ2LT.js";
57
5
  export {
58
6
  Radio
59
7
  };
@@ -0,0 +1,7 @@
1
+ import {
2
+ SearchField
3
+ } from "../../chunks/chunk.KVGKM2JI.js";
4
+ import "../../chunks/chunk.7H4YRP4X.js";
5
+ export {
6
+ SearchField
7
+ };
@@ -2,7 +2,7 @@ import {
2
2
  placeholderTextColor,
3
3
  plateformStyles,
4
4
  styles
5
- } from "../../chunks/chunk.MCKLJGG3.js";
5
+ } from "../../chunks/chunk.7H4YRP4X.js";
6
6
  export {
7
7
  placeholderTextColor,
8
8
  plateformStyles,
@@ -0,0 +1,9 @@
1
+ import {
2
+ TextInput
3
+ } from "../../chunks/chunk.73S52VD6.js";
4
+ import "../../chunks/chunk.CIHQLL6Y.js";
5
+ import "../../chunks/chunk.4SSEOHVB.js";
6
+ import "../../chunks/chunk.OQSCGAEY.js";
7
+ export {
8
+ TextInput
9
+ };
@@ -12,12 +12,16 @@ export declare const styles: {
12
12
  color: "#666666ff";
13
13
  fontSize: number;
14
14
  fontFamily: string;
15
+ fontWeight: "400";
16
+ lineHeight: number;
15
17
  letterSpacing: number;
16
18
  };
17
19
  counter: {
18
20
  color: "#666666ff";
19
21
  fontSize: number;
20
22
  fontFamily: string;
23
+ fontWeight: "400";
24
+ lineHeight: number;
21
25
  letterSpacing: number;
22
26
  marginLeft: "auto";
23
27
  };
@@ -27,6 +31,8 @@ export declare const styles: {
27
31
  input: {
28
32
  fontSize: number;
29
33
  fontFamily: string;
34
+ fontWeight: "400";
35
+ lineHeight: number;
30
36
  letterSpacing: number;
31
37
  paddingTop: 16;
32
38
  paddingBottom: 16;
@@ -47,6 +53,8 @@ export declare const styles: {
47
53
  marginTop: number;
48
54
  marginRight: 4;
49
55
  fontSize: number;
56
+ fontWeight: "400";
57
+ lineHeight: number;
50
58
  fontFamily: string;
51
59
  letterSpacing: number;
52
60
  };
@@ -2,7 +2,8 @@ import {
2
2
  getCursorColors,
3
3
  inputWrapperStyles,
4
4
  styles
5
- } from "../../chunks/chunk.QOZS5EA3.js";
5
+ } from "../../chunks/chunk.CIHQLL6Y.js";
6
+ import "../../chunks/chunk.4SSEOHVB.js";
6
7
  export {
7
8
  getCursorColors,
8
9
  inputWrapperStyles,
package/dist/index.d.ts CHANGED
@@ -1,3 +1,11 @@
1
+ export * from './components/button/Button';
2
+ export * from './components/checkbox/Checkbox';
3
+ export * from './components/icon/Icon';
4
+ export * from './components/listCaption/ListCaption';
5
+ export * from './components/listItem/ListItem';
6
+ export * from './components/listTitle/ListTitle';
7
+ export * from './components/radio/Radio';
8
+ export * from './components/searchField/SearchField';
1
9
  export * from './components/toggle/Toggle';
2
- export * from './components/text-input/TextInput';
10
+ export * from './components/textInput/TextInput';
3
11
  export * from './utils';
package/dist/index.js CHANGED
@@ -1,12 +1,43 @@
1
+ import {
2
+ SearchField
3
+ } from "./chunks/chunk.KVGKM2JI.js";
4
+ import "./chunks/chunk.7H4YRP4X.js";
1
5
  import {
2
6
  TextInput
3
- } from "./chunks/chunk.2HOUMFYI.js";
4
- import "./chunks/chunk.QOZS5EA3.js";
7
+ } from "./chunks/chunk.73S52VD6.js";
8
+ import "./chunks/chunk.CIHQLL6Y.js";
5
9
  import {
6
10
  Toggle
7
11
  } from "./chunks/chunk.B2JV2E47.js";
8
12
  import "./chunks/chunk.CZ5Y2AVH.js";
9
- import "./chunks/chunk.OQSCGAEY.js";
13
+ import {
14
+ ListCaption
15
+ } from "./chunks/chunk.KVXJ2L2C.js";
16
+ import "./chunks/chunk.4ZX27FCY.js";
17
+ import {
18
+ ListItem
19
+ } from "./chunks/chunk.4MPJJ7EN.js";
20
+ import "./chunks/chunk.INEDXDER.js";
21
+ import {
22
+ ListTitle
23
+ } from "./chunks/chunk.6DY4BFMZ.js";
24
+ import "./chunks/chunk.3QXPJAHY.js";
25
+ import "./chunks/chunk.4SSEOHVB.js";
26
+ import {
27
+ Radio
28
+ } from "./chunks/chunk.LN5IVTGU.js";
29
+ import "./chunks/chunk.YWEWQ2LT.js";
30
+ import {
31
+ Button
32
+ } from "./chunks/chunk.DMHRBYRF.js";
33
+ import "./chunks/chunk.RNOZ5AW4.js";
34
+ import {
35
+ Checkbox
36
+ } from "./chunks/chunk.XCMNSIIN.js";
37
+ import "./chunks/chunk.H2AL2E3A.js";
38
+ import {
39
+ Icon
40
+ } from "./chunks/chunk.OQSCGAEY.js";
10
41
 
11
42
  // src/utils/useFonts.ts
12
43
  import { useFonts as useExpoFonts } from "expo-font";
@@ -14,6 +45,14 @@ function useFonts(map) {
14
45
  return useExpoFonts(map);
15
46
  }
16
47
  export {
48
+ Button,
49
+ Checkbox,
50
+ Icon,
51
+ ListCaption,
52
+ ListItem,
53
+ ListTitle,
54
+ Radio,
55
+ SearchField,
17
56
  TextInput,
18
57
  Toggle,
19
58
  useFonts
@@ -2,10 +2,14 @@ export declare const fonts: {
2
2
  bodyLarge: {
3
3
  fontSize: number;
4
4
  fontFamily: string;
5
+ fontWeight: "400";
6
+ lineHeight: number;
5
7
  letterSpacing: number;
6
8
  };
7
9
  bodyMedium: {
8
10
  fontSize: number;
11
+ fontWeight: "400";
12
+ lineHeight: number;
9
13
  fontFamily: string;
10
14
  letterSpacing: number;
11
15
  };
@@ -14,4 +18,18 @@ export declare const fonts: {
14
18
  fontFamily: string;
15
19
  letterSpacing: number;
16
20
  };
21
+ titleSmall: {
22
+ fontSize: number;
23
+ fontWeight: "500";
24
+ lineHeight: number;
25
+ fontFamily: string;
26
+ letterSpacing: number;
27
+ };
28
+ labelMedium: {
29
+ fontSize: number;
30
+ fontWeight: "500";
31
+ lineHeight: number;
32
+ fontFamily: string;
33
+ letterSpacing: number;
34
+ };
17
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ds-autonomie/react-native",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "author": "CNSA",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,8 +0,0 @@
1
- import {
2
- TextInput
3
- } from "../../chunks/chunk.2HOUMFYI.js";
4
- import "../../chunks/chunk.QOZS5EA3.js";
5
- import "../../chunks/chunk.OQSCGAEY.js";
6
- export {
7
- TextInput
8
- };