@sincpro/mobile-ui 3.1.0 → 3.2.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.
@@ -1,139 +1,28 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { Typography } from "../Typography/index.js";
3
- import { TouchableOpacity, View } from "react-native";
4
- import { tv } from "tailwind-variants";
5
- import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
6
- const radioButton = tv({
7
- slots: {
8
- container: "flex-row items-center py-2.5 px-3 rounded-lg border-[1.5px] border-border-default bg-bg-card",
9
- radioCircle: "w-[18px] h-[18px] rounded-full border-2 border-border-default mr-2 justify-center items-center",
10
- radioInner: "w-[9px] h-[9px] rounded-full",
11
- label: "flex-1"
12
- },
13
- variants: {
14
- selected: {
15
- true: {
16
- container: "border-primary bg-primary/10",
17
- radioCircle: "border-primary",
18
- radioInner: "bg-primary",
19
- label: "text-text-primary font-semibold"
20
- },
21
- false: {
22
- label: "text-text-secondary"
23
- }
24
- }
25
- },
26
- defaultVariants: {
27
- selected: false
28
- }
29
- });
2
+ import { ChoiceRow } from "./choice-row.js";
3
+ import { jsx as _jsx } from "nativewind/jsx-runtime";
4
+ /** One option of a single-choice group: the same row Select and PickerField list. */
30
5
  function RadioButton(t0) {
31
- const $ = _c(29);
6
+ const $ = _c(4);
32
7
  const {
33
8
  label,
34
9
  selected,
35
10
  onPress
36
11
  } = t0;
37
- let T0;
38
- let T1;
39
12
  let t1;
40
- let t2;
41
- let t3;
42
- let t4;
43
- let t5;
44
- let t6;
45
- let t7;
46
- let t8;
47
13
  if ($[0] !== label || $[1] !== onPress || $[2] !== selected) {
48
- const styles = radioButton({
49
- selected
50
- });
51
- T1 = TouchableOpacity;
52
- t2 = label;
53
- t3 = "radio";
54
- if ($[13] !== selected) {
55
- t4 = {
56
- checked: selected
57
- };
58
- $[13] = selected;
59
- $[14] = t4;
60
- } else {
61
- t4 = $[14];
62
- }
63
- t5 = 0.7;
64
- t6 = styles.container();
65
- t7 = onPress;
66
- t8 = _jsx(View, {
67
- className: styles.radioCircle(),
68
- children: selected && _jsx(View, {
69
- className: styles.radioInner()
70
- })
14
+ t1 = _jsx(ChoiceRow, {
15
+ label: label,
16
+ onPress: onPress,
17
+ selected: selected
71
18
  });
72
- T0 = Typography.Text;
73
- t1 = styles.label();
74
19
  $[0] = label;
75
20
  $[1] = onPress;
76
21
  $[2] = selected;
77
- $[3] = T0;
78
- $[4] = T1;
79
- $[5] = t1;
80
- $[6] = t2;
81
- $[7] = t3;
82
- $[8] = t4;
83
- $[9] = t5;
84
- $[10] = t6;
85
- $[11] = t7;
86
- $[12] = t8;
87
- } else {
88
- T0 = $[3];
89
- T1 = $[4];
90
- t1 = $[5];
91
- t2 = $[6];
92
- t3 = $[7];
93
- t4 = $[8];
94
- t5 = $[9];
95
- t6 = $[10];
96
- t7 = $[11];
97
- t8 = $[12];
98
- }
99
- let t9;
100
- if ($[15] !== T0 || $[16] !== label || $[17] !== t1) {
101
- t9 = _jsx(T0, {
102
- className: t1,
103
- variant: "bodySmall",
104
- children: label
105
- });
106
- $[15] = T0;
107
- $[16] = label;
108
- $[17] = t1;
109
- $[18] = t9;
110
- } else {
111
- t9 = $[18];
112
- }
113
- let t10;
114
- if ($[19] !== T1 || $[20] !== t2 || $[21] !== t3 || $[22] !== t4 || $[23] !== t5 || $[24] !== t6 || $[25] !== t7 || $[26] !== t8 || $[27] !== t9) {
115
- t10 = _jsxs(T1, {
116
- accessibilityLabel: t2,
117
- accessibilityRole: t3,
118
- accessibilityState: t4,
119
- activeOpacity: t5,
120
- className: t6,
121
- onPress: t7,
122
- children: [t8, t9]
123
- });
124
- $[19] = T1;
125
- $[20] = t2;
126
- $[21] = t3;
127
- $[22] = t4;
128
- $[23] = t5;
129
- $[24] = t6;
130
- $[25] = t7;
131
- $[26] = t8;
132
- $[27] = t9;
133
- $[28] = t10;
22
+ $[3] = t1;
134
23
  } else {
135
- t10 = $[28];
24
+ t1 = $[3];
136
25
  }
137
- return t10;
26
+ return t1;
138
27
  }
139
28
  export default RadioButton;
@@ -10,6 +10,7 @@ export type SelectProps<T extends string | number> = {
10
10
  label?: string;
11
11
  placeholder?: string;
12
12
  title?: string;
13
+ /** Kept for compatibility: a row applies its option on tap, on Android and iOS alike. */
13
14
  confirmLabel?: string;
14
15
  disabled?: boolean;
15
16
  readOnly?: boolean;
@@ -18,5 +19,5 @@ export type SelectProps<T extends string | number> = {
18
19
  className?: string;
19
20
  testID?: string;
20
21
  };
21
- declare function Select<T extends string | number>({ options, value, onChange, onBlur, label, placeholder, title, confirmLabel, disabled, readOnly, loading, error, className, testID, }: SelectProps<T>): import("react").JSX.Element;
22
+ declare function Select<T extends string | number>({ options, value, onChange, onBlur, label, placeholder, title, disabled, readOnly, loading, error, className, testID, }: SelectProps<T>): import("react").JSX.Element;
22
23
  export default Select;