@ds-autonomie/react-native 0.7.2 → 0.7.4

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 +14 -0
  2. package/dist/chunks/chunk.3HDQMMF2.js +81 -0
  3. package/dist/chunks/{chunk.B2JV2E47.js → chunk.3SUS24CI.js} +29 -21
  4. package/dist/chunks/chunk.7T73XPWE.js +83 -0
  5. package/dist/chunks/chunk.CZOIMFLH.js +20 -0
  6. package/dist/chunks/chunk.DBGHHBSM.js +52 -0
  7. package/dist/chunks/chunk.EWMRU3E4.js +67 -0
  8. package/dist/chunks/chunk.ILCOTEXS.js +64 -0
  9. package/dist/chunks/chunk.L65V2F7C.js +26 -0
  10. package/dist/chunks/chunk.MU3OHOLM.js +26 -0
  11. package/dist/chunks/{chunk.RNOZ5AW4.js → chunk.MWOLFH57.js} +2 -4
  12. package/dist/chunks/chunk.NQYY7B5O.js +73 -0
  13. package/dist/chunks/{chunk.I5NPEO25.js → chunk.PCMSFNR4.js} +38 -34
  14. package/dist/chunks/chunk.UO2CEN64.js +95 -0
  15. package/dist/components/button/Button.d.ts +5 -5
  16. package/dist/components/button/Button.js +3 -3
  17. package/dist/components/button/Button.styles.js +1 -1
  18. package/dist/components/checkbox/Checkbox.d.ts +4 -4
  19. package/dist/components/checkbox/Checkbox.js +2 -2
  20. package/dist/components/divider/Divider.js +13 -9
  21. package/dist/components/icon/Icon.d.ts +2 -2
  22. package/dist/components/icon/Icon.js +1 -1
  23. package/dist/components/listCaption/ListCaption.js +1 -1
  24. package/dist/components/listItem/ListItem.js +2 -2
  25. package/dist/components/listTitle/ListTitle.js +1 -1
  26. package/dist/components/radio/Radio.d.ts +4 -4
  27. package/dist/components/radio/Radio.js +1 -1
  28. package/dist/components/searchField/SearchField.d.ts +1 -1
  29. package/dist/components/searchField/SearchField.js +1 -1
  30. package/dist/components/tabs/Tabs.js +1 -1
  31. package/dist/components/tabs/tabItem/TabItem.d.ts +2 -2
  32. package/dist/components/tabs/tabItem/TabItem.js +2 -2
  33. package/dist/components/textInput/TextInput.d.ts +5 -5
  34. package/dist/components/textInput/TextInput.js +2 -2
  35. package/dist/components/toggle/Toggle.d.ts +2 -2
  36. package/dist/components/toggle/Toggle.js +2 -2
  37. package/dist/index.js +13 -13
  38. package/package.json +8 -7
  39. package/dist/chunks/chunk.DGZYY7CA.js +0 -47
  40. package/dist/chunks/chunk.DMHRBYRF.js +0 -69
  41. package/dist/chunks/chunk.DMWLLPBB.js +0 -94
  42. package/dist/chunks/chunk.JQRCUHR6.js +0 -65
  43. package/dist/chunks/chunk.KVGKM2JI.js +0 -73
  44. package/dist/chunks/chunk.LN5IVTGU.js +0 -60
  45. package/dist/chunks/chunk.LR5V6SDZ.js +0 -22
  46. package/dist/chunks/chunk.OQSCGAEY.js +0 -17
  47. package/dist/chunks/chunk.WVKTSG5X.js +0 -22
  48. package/dist/chunks/chunk.XCMNSIIN.js +0 -72
@@ -1,94 +0,0 @@
1
- import {
2
- getCursorColors,
3
- inputWrapperStyles,
4
- styles
5
- } from "./chunk.65RCE3RB.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
- };
@@ -1,65 +0,0 @@
1
- import {
2
- styles
3
- } from "./chunk.DE3QWY2X.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
- };
@@ -1,73 +0,0 @@
1
- import {
2
- isIOS,
3
- placeholderTextColor,
4
- plateformStyles,
5
- styles
6
- } from "./chunk.7H4YRP4X.js";
7
-
8
- // src/components/searchField/SearchField.tsx
9
- import React, { useEffect, useState } from "react";
10
- import {
11
- View,
12
- TextInput
13
- } from "react-native";
14
- import Icon from "react-native-vector-icons/MaterialIcons";
15
- var INIT_PLACEHOLDER = isIOS ? "Recherche" : "Rechercher un...";
16
- var SearchField = React.forwardRef(
17
- function SearchField2({
18
- onChangeText,
19
- placeholder = INIT_PLACEHOLDER,
20
- style,
21
- value = "",
22
- disabled = false,
23
- ...props
24
- }, ref) {
25
- const [text, setText] = useState(value);
26
- useEffect(
27
- function onValueUpdate() {
28
- setText(value);
29
- },
30
- [value]
31
- );
32
- function handleKeypress(text2) {
33
- if (disabled) {
34
- return;
35
- }
36
- onChangeText?.(text2);
37
- setText(text2);
38
- }
39
- return <View
40
- style={[
41
- style,
42
- styles.container,
43
- isIOS && styles.iOScontainer,
44
- disabled && styles.disabledContainer
45
- ]}
46
- >
47
- <Icon
48
- name="search"
49
- {...plateformStyles}
50
- accessibilityRole="button"
51
- accessibilityLabel="search"
52
- />
53
- <TextInput
54
- ref={ref}
55
- {...props}
56
- editable={!disabled}
57
- accessibilityLabel="search"
58
- accessibilityRole="search"
59
- accessibilityState={{ disabled }}
60
- onChangeText={handleKeypress}
61
- placeholder={placeholder}
62
- placeholderTextColor={placeholderTextColor}
63
- returnKeyType="search"
64
- style={[styles.input, isIOS ? styles.iOSInput : styles.androidInput]}
65
- value={text}
66
- />
67
- </View>;
68
- }
69
- );
70
-
71
- export {
72
- SearchField
73
- };
@@ -1,60 +0,0 @@
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
- };
@@ -1,22 +0,0 @@
1
- import {
2
- listCaptionStyles
3
- } from "./chunk.TWXAL56H.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
- };
@@ -1,17 +0,0 @@
1
- // src/components/icon/Icon.tsx
2
- import { forwardRef } from "react";
3
- import MaterialIcons from "react-native-vector-icons/MaterialIcons";
4
- var Icon = forwardRef(function Icon2({ size = 16, ...restProps }, ref) {
5
- return <MaterialIcons
6
- {...restProps}
7
- ref={ref}
8
- size={size}
9
- selectable={false}
10
- importantForAccessibility="no-hide-descendants"
11
- accessibilityElementsHidden
12
- />;
13
- });
14
-
15
- export {
16
- Icon
17
- };
@@ -1,22 +0,0 @@
1
- import {
2
- listTitleStyles
3
- } from "./chunk.523CLSSB.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
- };
@@ -1,72 +0,0 @@
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
- };