@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
@@ -0,0 +1,95 @@
1
+ import {
2
+ getCursorColors,
3
+ inputWrapperStyles,
4
+ styles
5
+ } from "./chunk.65RCE3RB.js";
6
+ import {
7
+ Icon
8
+ } from "./chunk.CZOIMFLH.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 /* @__PURE__ */ React.createElement(
36
+ View,
37
+ {
38
+ style: [style, styles.container],
39
+ accessibilityState: { disabled },
40
+ testID: `${testID}/container`
41
+ },
42
+ /* @__PURE__ */ React.createElement(View, { style: styles.header }, label !== void 0 && label.length > 0 && /* @__PURE__ */ React.createElement(
43
+ Text,
44
+ {
45
+ nativeID: "label",
46
+ testID: `${testID}/label`,
47
+ style: styles.label
48
+ },
49
+ required && /* @__PURE__ */ React.createElement(Text, { style: styles.labelRequired }, "* "),
50
+ label
51
+ ), maxLength !== void 0 && /* @__PURE__ */ React.createElement(Text, { style: styles.counter, testID: `${testID}/counter` }, value.length, "/", maxLength)),
52
+ /* @__PURE__ */ React.createElement(
53
+ View,
54
+ {
55
+ style: [
56
+ inputWrapperStyles.default,
57
+ isFocused && inputWrapperStyles.focused,
58
+ error && inputWrapperStyles.error,
59
+ readOnly && inputWrapperStyles.readonly,
60
+ disabled && inputWrapperStyles.disabled
61
+ ]
62
+ },
63
+ /* @__PURE__ */ React.createElement(
64
+ NativeTextInput,
65
+ {
66
+ "aria-label": label,
67
+ "aria-labelby": "label",
68
+ testID: `${testID}/input`,
69
+ ...props,
70
+ ref,
71
+ value,
72
+ multiline,
73
+ maxLength,
74
+ style: styles.input,
75
+ ...getCursorColors(error),
76
+ onFocus: (e) => {
77
+ setIsFocused(true);
78
+ onFocus?.(e);
79
+ },
80
+ onBlur: (e) => {
81
+ setIsFocused(false);
82
+ onBlur?.(e);
83
+ },
84
+ editable: !(readOnly || disabled)
85
+ }
86
+ )
87
+ ),
88
+ error && errorText !== void 0 && /* @__PURE__ */ React.createElement(View, { style: [styles.bottomMessage], testID: `${testID}/errorText` }, /* @__PURE__ */ React.createElement(Icon, { name: "error", style: styles.errorIcon }), /* @__PURE__ */ React.createElement(Text, { style: styles.errorText }, errorText)),
89
+ helpText !== void 0 && /* @__PURE__ */ React.createElement(View, { style: [styles.bottomMessage], testID: `${testID}/helpText` }, /* @__PURE__ */ React.createElement(Text, { style: styles.helpText }, helpText))
90
+ );
91
+ });
92
+
93
+ export {
94
+ TextInput
95
+ };
@@ -36,7 +36,7 @@ export declare const Button: React.ForwardRefExoticComponent<{
36
36
  /**
37
37
  * Variant of button.
38
38
  */
39
- variant?: "link" | "primary" | "secondary" | "tertiary" | "destructive" | undefined;
39
+ variant?: Variant;
40
40
  /**
41
41
  * If `style` is defined, it will extend the container style.
42
42
  */
@@ -48,18 +48,18 @@ export declare const Button: React.ForwardRefExoticComponent<{
48
48
  /**
49
49
  * Name of element placed before the title.
50
50
  */
51
- startIcon?: string | undefined;
51
+ startIcon?: string;
52
52
  /**
53
53
  * Name of element placed after the title.
54
54
  */
55
- endIcon?: string | undefined;
55
+ endIcon?: string;
56
56
  /**
57
57
  * The size of the component.
58
58
  */
59
- size?: Size | undefined;
59
+ size?: Size;
60
60
  /**
61
61
  * Disabled the button.
62
62
  */
63
- disabled?: boolean | undefined;
63
+ disabled?: boolean;
64
64
  } & Omit<PressableProps, OmittedPressableProps> & React.RefAttributes<View>>;
65
65
  export {};
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Button
3
- } from "../../chunks/chunk.DMHRBYRF.js";
4
- import "../../chunks/chunk.RNOZ5AW4.js";
5
- import "../../chunks/chunk.OQSCGAEY.js";
3
+ } from "../../chunks/chunk.NQYY7B5O.js";
4
+ import "../../chunks/chunk.MWOLFH57.js";
5
+ import "../../chunks/chunk.CZOIMFLH.js";
6
6
  export {
7
7
  Button
8
8
  };
@@ -4,7 +4,7 @@ import {
4
4
  getTextStyle,
5
5
  sizes,
6
6
  variants
7
- } from "../../chunks/chunk.RNOZ5AW4.js";
7
+ } from "../../chunks/chunk.MWOLFH57.js";
8
8
  export {
9
9
  getContainerStyle,
10
10
  getIconColor,
@@ -31,21 +31,21 @@ export declare const Checkbox: React.ForwardRefExoticComponent<{
31
31
  /**
32
32
  * When set to `true`, component is checked.
33
33
  */
34
- value?: boolean | undefined;
34
+ value?: boolean;
35
35
  /**
36
36
  * When set to `true`, component is in error.
37
37
  */
38
- error?: boolean | undefined;
38
+ error?: boolean;
39
39
  /**
40
40
  * When set to `true`, component is disabled.
41
41
  */
42
- disabled?: boolean | undefined;
42
+ disabled?: boolean;
43
43
  /**
44
44
  * Callback when component is checked.
45
45
  *
46
46
  * @param {boolean} value
47
47
  */
48
- onValueChange?: ((value: boolean) => void) | undefined;
48
+ onValueChange?: (value: boolean) => void;
49
49
  /**
50
50
  * If `style` is defined, it will extend the container style.
51
51
  * If a similar property is defined, the new property will be ignored.
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Checkbox
3
- } from "../../chunks/chunk.XCMNSIIN.js";
3
+ } from "../../chunks/chunk.7T73XPWE.js";
4
4
  import "../../chunks/chunk.H2AL2E3A.js";
5
- import "../../chunks/chunk.OQSCGAEY.js";
5
+ import "../../chunks/chunk.CZOIMFLH.js";
6
6
  export {
7
7
  Checkbox
8
8
  };
@@ -3,21 +3,25 @@ import {
3
3
  } from "../../chunks/chunk.SZJKAIPC.js";
4
4
 
5
5
  // src/components/divider/Divider.tsx
6
+ import React from "react";
6
7
  import { View } from "react-native";
7
8
  var Divider = ({
8
9
  orientation = "horizontal",
9
10
  style,
10
11
  ...rest
11
12
  }) => {
12
- return <View
13
- {...rest}
14
- style={[
15
- style,
16
- dividerStyles.container,
17
- orientation === "vertical" && dividerStyles.vertical,
18
- orientation === "horizontal" && dividerStyles.horizontal
19
- ]}
20
- />;
13
+ return /* @__PURE__ */ React.createElement(
14
+ View,
15
+ {
16
+ ...rest,
17
+ style: [
18
+ style,
19
+ dividerStyles.container,
20
+ orientation === "vertical" && dividerStyles.vertical,
21
+ orientation === "horizontal" && dividerStyles.horizontal
22
+ ]
23
+ }
24
+ );
21
25
  };
22
26
  export {
23
27
  Divider
@@ -8,6 +8,6 @@ export type IconProps = {
8
8
  } & MaterialIconProps;
9
9
  export declare const Icon: React.ForwardRefExoticComponent<{
10
10
  name: string;
11
- size?: number | undefined;
12
- color?: string | undefined;
11
+ size?: number;
12
+ color?: string;
13
13
  } & MaterialIconProps & React.RefAttributes<MaterialIcons>>;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Icon
3
- } from "../../chunks/chunk.OQSCGAEY.js";
3
+ } from "../../chunks/chunk.CZOIMFLH.js";
4
4
  export {
5
5
  Icon
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ListCaption
3
- } from "../../chunks/chunk.LR5V6SDZ.js";
3
+ } from "../../chunks/chunk.MU3OHOLM.js";
4
4
  import "../../chunks/chunk.TWXAL56H.js";
5
5
  import "../../chunks/chunk.4GJSNQET.js";
6
6
  export {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ListItem
3
- } from "../../chunks/chunk.JQRCUHR6.js";
3
+ } from "../../chunks/chunk.ILCOTEXS.js";
4
4
  import "../../chunks/chunk.DE3QWY2X.js";
5
5
  import "../../chunks/chunk.4GJSNQET.js";
6
- import "../../chunks/chunk.OQSCGAEY.js";
6
+ import "../../chunks/chunk.CZOIMFLH.js";
7
7
  export {
8
8
  ListItem
9
9
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ListTitle
3
- } from "../../chunks/chunk.WVKTSG5X.js";
3
+ } from "../../chunks/chunk.L65V2F7C.js";
4
4
  import "../../chunks/chunk.523CLSSB.js";
5
5
  import "../../chunks/chunk.4GJSNQET.js";
6
6
  export {
@@ -31,21 +31,21 @@ export declare const Radio: React.ForwardRefExoticComponent<{
31
31
  /**
32
32
  * When set to `true`, component is checked.
33
33
  */
34
- value?: boolean | undefined;
34
+ value?: boolean;
35
35
  /**
36
36
  * When set to `true`, component is in error.
37
37
  */
38
- error?: boolean | undefined;
38
+ error?: boolean;
39
39
  /**
40
40
  * When set to `true`, component is disabled.
41
41
  */
42
- disabled?: boolean | undefined;
42
+ disabled?: boolean;
43
43
  /**
44
44
  * Callback when component is checked.
45
45
  *
46
46
  * @param {boolean} value
47
47
  */
48
- onValueChange?: ((value: boolean) => void) | undefined;
48
+ onValueChange?: (value: boolean) => void;
49
49
  /**
50
50
  * If `style` is defined, it will extend the container style.
51
51
  * If a similar property is defined, the new property will overwrite the old one.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Radio
3
- } from "../../chunks/chunk.LN5IVTGU.js";
3
+ } from "../../chunks/chunk.EWMRU3E4.js";
4
4
  import "../../chunks/chunk.YWEWQ2LT.js";
5
5
  export {
6
6
  Radio
@@ -5,7 +5,7 @@ export declare const SearchField: React.ForwardRefExoticComponent<{
5
5
  /**
6
6
  * If `disabled` is `true`, the component is not editable.
7
7
  */
8
- disabled?: boolean | undefined;
8
+ disabled?: boolean;
9
9
  /**
10
10
  * If `style` is defined, it will extend the container style.
11
11
  */
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SearchField
3
- } from "../../chunks/chunk.KVGKM2JI.js";
3
+ } from "../../chunks/chunk.3HDQMMF2.js";
4
4
  import "../../chunks/chunk.7H4YRP4X.js";
5
5
  export {
6
6
  SearchField
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Tabs
3
- } from "../../chunks/chunk.I5NPEO25.js";
3
+ } from "../../chunks/chunk.PCMSFNR4.js";
4
4
  import "../../chunks/chunk.2XHLIGU3.js";
5
5
  export {
6
6
  Tabs
@@ -23,7 +23,7 @@ export declare const TabItem: React.ForwardRefExoticComponent<{
23
23
  /**
24
24
  * Name of the icon.
25
25
  */
26
- icon?: string | undefined;
26
+ icon?: string;
27
27
  /**
28
28
  * Text displayed in tab.
29
29
  */
@@ -35,6 +35,6 @@ export declare const TabItem: React.ForwardRefExoticComponent<{
35
35
  /**
36
36
  * If `active` is true, the tab is selected
37
37
  * */
38
- active?: boolean | undefined;
38
+ active?: boolean;
39
39
  } & Omit<PressableProps, OmittedPressableProps> & React.RefAttributes<View>>;
40
40
  export {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  TabItem
3
- } from "../../../chunks/chunk.DGZYY7CA.js";
3
+ } from "../../../chunks/chunk.DBGHHBSM.js";
4
4
  import "../../../chunks/chunk.VPRSFOFO.js";
5
5
  import "../../../chunks/chunk.4GJSNQET.js";
6
- import "../../../chunks/chunk.OQSCGAEY.js";
6
+ import "../../../chunks/chunk.CZOIMFLH.js";
7
7
  export {
8
8
  TabItem
9
9
  };
@@ -28,17 +28,17 @@ export type TextInputProps = {
28
28
  } & Omit<NativeTextInputProps, 'style' | 'editable' | 'value'>;
29
29
  export declare const TextInput: React.ForwardRefExoticComponent<{
30
30
  /** The input's label. */
31
- label?: string | undefined;
31
+ label?: string;
32
32
  /** Makes the input a required field. */
33
- required?: boolean | undefined;
33
+ required?: boolean;
34
34
  /** Indicates whether the input should be in error state. */
35
- error?: boolean | undefined;
35
+ error?: boolean;
36
36
  /** The input's error text. A string or Text component. */
37
37
  errorText?: ReactNode;
38
38
  /** Disables the input. */
39
- disabled?: boolean | undefined;
39
+ disabled?: boolean;
40
40
  /** Makes the input readonly. */
41
- readOnly?: boolean | undefined;
41
+ readOnly?: boolean;
42
42
  /** The input's help text. A string or Text component. */
43
43
  helpText?: ReactNode;
44
44
  /** Stylise the outer view of the input. */
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  TextInput
3
- } from "../../chunks/chunk.DMWLLPBB.js";
3
+ } from "../../chunks/chunk.UO2CEN64.js";
4
4
  import "../../chunks/chunk.65RCE3RB.js";
5
5
  import "../../chunks/chunk.4GJSNQET.js";
6
- import "../../chunks/chunk.OQSCGAEY.js";
6
+ import "../../chunks/chunk.CZOIMFLH.js";
7
7
  export {
8
8
  TextInput
9
9
  };
@@ -28,12 +28,12 @@ export declare const Toggle: React.ForwardRefExoticComponent<{
28
28
  * When set to `true`, component is checked.
29
29
  * @default false
30
30
  */
31
- value?: boolean | undefined;
31
+ value?: boolean;
32
32
  /**
33
33
  * When set to `true`, component is disabled.
34
34
  * @default false
35
35
  */
36
- disabled?: boolean | undefined;
36
+ disabled?: boolean;
37
37
  /**
38
38
  * If `style` is defined, it will extend the container style.
39
39
  * If a similar property is defined, the new property will overwrite the old one.
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Toggle
3
- } from "../../chunks/chunk.B2JV2E47.js";
3
+ } from "../../chunks/chunk.3SUS24CI.js";
4
4
  import "../../chunks/chunk.CZ5Y2AVH.js";
5
- import "../../chunks/chunk.OQSCGAEY.js";
5
+ import "../../chunks/chunk.CZOIMFLH.js";
6
6
  export {
7
7
  Toggle
8
8
  };
package/dist/index.js CHANGED
@@ -1,51 +1,51 @@
1
1
  import {
2
2
  TabItem
3
- } from "./chunks/chunk.DGZYY7CA.js";
3
+ } from "./chunks/chunk.DBGHHBSM.js";
4
4
  import "./chunks/chunk.VPRSFOFO.js";
5
5
  import {
6
6
  SearchField
7
- } from "./chunks/chunk.KVGKM2JI.js";
7
+ } from "./chunks/chunk.3HDQMMF2.js";
8
8
  import "./chunks/chunk.7H4YRP4X.js";
9
9
  import {
10
10
  Tabs
11
- } from "./chunks/chunk.I5NPEO25.js";
11
+ } from "./chunks/chunk.PCMSFNR4.js";
12
12
  import "./chunks/chunk.2XHLIGU3.js";
13
13
  import {
14
14
  TextInput
15
- } from "./chunks/chunk.DMWLLPBB.js";
15
+ } from "./chunks/chunk.UO2CEN64.js";
16
16
  import "./chunks/chunk.65RCE3RB.js";
17
17
  import {
18
18
  Toggle
19
- } from "./chunks/chunk.B2JV2E47.js";
19
+ } from "./chunks/chunk.3SUS24CI.js";
20
20
  import "./chunks/chunk.CZ5Y2AVH.js";
21
21
  import {
22
22
  ListCaption
23
- } from "./chunks/chunk.LR5V6SDZ.js";
23
+ } from "./chunks/chunk.MU3OHOLM.js";
24
24
  import "./chunks/chunk.TWXAL56H.js";
25
25
  import {
26
26
  ListItem
27
- } from "./chunks/chunk.JQRCUHR6.js";
27
+ } from "./chunks/chunk.ILCOTEXS.js";
28
28
  import "./chunks/chunk.DE3QWY2X.js";
29
29
  import {
30
30
  ListTitle
31
- } from "./chunks/chunk.WVKTSG5X.js";
31
+ } from "./chunks/chunk.L65V2F7C.js";
32
32
  import "./chunks/chunk.523CLSSB.js";
33
33
  import "./chunks/chunk.4GJSNQET.js";
34
34
  import {
35
35
  Radio
36
- } from "./chunks/chunk.LN5IVTGU.js";
36
+ } from "./chunks/chunk.EWMRU3E4.js";
37
37
  import "./chunks/chunk.YWEWQ2LT.js";
38
38
  import {
39
39
  Button
40
- } from "./chunks/chunk.DMHRBYRF.js";
41
- import "./chunks/chunk.RNOZ5AW4.js";
40
+ } from "./chunks/chunk.NQYY7B5O.js";
41
+ import "./chunks/chunk.MWOLFH57.js";
42
42
  import {
43
43
  Checkbox
44
- } from "./chunks/chunk.XCMNSIIN.js";
44
+ } from "./chunks/chunk.7T73XPWE.js";
45
45
  import "./chunks/chunk.H2AL2E3A.js";
46
46
  import {
47
47
  Icon
48
- } from "./chunks/chunk.OQSCGAEY.js";
48
+ } from "./chunks/chunk.CZOIMFLH.js";
49
49
 
50
50
  // src/utils/useFonts.ts
51
51
  import { useFonts as useExpoFonts } from "expo-font";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ds-autonomie/react-native",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "author": "CNSA",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,12 +27,13 @@
27
27
  "access": "public"
28
28
  },
29
29
  "peerDependencies": {
30
- "react": "^18.2.0",
31
- "react-native": "^0.72.6",
32
- "react-native-vector-icons": "^10.0.1",
33
- "react-native-reanimated": "^3.3.0",
34
- "expo-font": "^11.4.0",
35
- "@ds-autonomie/assets": "1.4.2"
30
+ "react": "18.2.0",
31
+ "react-native": "0.72.6",
32
+ "react-native-vector-icons": "10.0.1",
33
+ "react-native-reanimated": "3.3.0",
34
+ "expo-font": "11.4.0",
35
+ "@babel/core": "7.22.20",
36
+ "@ds-autonomie/assets": "1.4.3"
36
37
  },
37
38
  "devDependencies": {
38
39
  "@storybook/react-native": "6.5.7",
@@ -1,47 +0,0 @@
1
- import {
2
- tabItemStyles
3
- } from "./chunk.VPRSFOFO.js";
4
- import {
5
- Icon
6
- } from "./chunk.OQSCGAEY.js";
7
-
8
- // src/components/tabs/tabItem/TabItem.tsx
9
- import theme from "@ds-autonomie/assets/js/dsa-theme";
10
- import React, { useState } from "react";
11
- import {
12
- Text,
13
- Pressable
14
- } from "react-native";
15
- var TabItem = React.forwardRef(function TabItem2({ icon, title, active = false, style, ...restProps }, ref) {
16
- const [isFocus, setIsFocus] = useState(false);
17
- return <Pressable
18
- ref={ref}
19
- {...restProps}
20
- accessibilityLabel="tab"
21
- accessibilityRole="tab"
22
- accessible
23
- accessibilityState={{
24
- selected: active
25
- }}
26
- role="tab"
27
- onFocus={() => setIsFocus(true)}
28
- style={[
29
- style,
30
- tabItemStyles.container,
31
- active && tabItemStyles.selected,
32
- isFocus && tabItemStyles.focus,
33
- active && isFocus && tabItemStyles.focusSelected
34
- ]}
35
- >
36
- {icon && <Icon
37
- name={icon}
38
- size={18}
39
- color={active ? theme.collection.tab.selected["on-enabled"] : theme.collection.tab.unselected["on-enabled"]}
40
- />}
41
- <Text style={[tabItemStyles.text, active && tabItemStyles.selected]}>{title}</Text>
42
- </Pressable>;
43
- });
44
-
45
- export {
46
- TabItem
47
- };
@@ -1,69 +0,0 @@
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
- };