@vvedantb/native-ui 0.23.0 → 0.24.1
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/README.md +5 -5
- package/dist/BottomSheetContainer.jsx +242 -149
- package/dist/CaptureButton.jsx +67 -46
- package/dist/Chip.jsx +42 -34
- package/dist/ColorSwatches.jsx +169 -45
- package/dist/Dialog.jsx +16 -3
- package/dist/FloatingFAB.jsx +71 -55
- package/dist/IconButton.jsx +62 -48
- package/dist/PinnedBotTile.jsx +87 -72
- package/dist/SearchInput.jsx +313 -50
- package/dist/Sheet.jsx +1 -1
- package/dist/ai/card-button.jsx +116 -147
- package/dist/ai/file-chip.jsx +46 -22
- package/dist/ai/message-action-sheet.jsx +1 -1
- package/dist/entries/bottom-sheet.js +2 -1
- package/dist/pressScale.js +131 -0
- package/dist/primitives/select.jsx +5 -1
- package/package.json +1 -10
- package/src/BottomSheetContainer.tsx +105 -93
- package/src/CaptureButton.tsx +15 -9
- package/src/Chip.tsx +9 -4
- package/src/ColorSwatches.tsx +74 -29
- package/src/Dialog.tsx +16 -7
- package/src/FloatingFAB.tsx +20 -13
- package/src/IconButton.tsx +8 -6
- package/src/PinnedBotTile.tsx +9 -5
- package/src/SearchInput.tsx +40 -12
- package/src/Sheet.tsx +1 -1
- package/src/ai/card-button.tsx +17 -11
- package/src/ai/file-chip.tsx +13 -4
- package/src/ai/message-action-sheet.tsx +1 -1
- package/src/entries/bottom-sheet.ts +2 -1
- package/src/pressScale.ts +72 -0
- package/src/primitives/select.tsx +7 -2
- package/dist/NativeBottomSheetContainer.jsx +0 -303
- package/dist/entries/native-bottom-sheet.js +0 -4
- package/src/NativeBottomSheetContainer.tsx +0 -157
- package/src/entries/native-bottom-sheet.ts +0 -4
package/dist/Chip.jsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Text } from "react-native";
|
|
3
|
+
import { AnimatedPressable, usePressScale } from "./pressScale";
|
|
3
4
|
import { textStyle, typeStyle } from "./controlStyles";
|
|
4
5
|
import { useLargerText } from "./theme";
|
|
5
6
|
import { useScheme } from "./useScheme";
|
|
6
7
|
export function Chip(t0) {
|
|
7
|
-
const $ = _c(
|
|
8
|
+
const $ = _c(22);
|
|
8
9
|
const {
|
|
9
10
|
label,
|
|
10
11
|
selected,
|
|
@@ -15,6 +16,7 @@ export function Chip(t0) {
|
|
|
15
16
|
const round = t1 === undefined ? false : t1;
|
|
16
17
|
const largerText = useLargerText();
|
|
17
18
|
const scheme = useScheme();
|
|
19
|
+
const press = usePressScale();
|
|
18
20
|
const size = round ? largerText ? "h-14 w-14" : "h-12 w-12" : largerText ? "min-h-14 px-5 py-3" : "min-h-12 px-4 py-2";
|
|
19
21
|
let t2;
|
|
20
22
|
if ($[0] !== selected) {
|
|
@@ -26,54 +28,60 @@ export function Chip(t0) {
|
|
|
26
28
|
} else {
|
|
27
29
|
t2 = $[1];
|
|
28
30
|
}
|
|
29
|
-
const t3 =
|
|
30
|
-
const t4 =
|
|
31
|
-
|
|
31
|
+
const t3 = press.onPressIn;
|
|
32
|
+
const t4 = press.onPressOut;
|
|
33
|
+
const t5 = press.style;
|
|
34
|
+
const t6 = `items-center justify-center rounded-full border border-white/40 dark:border-white/10 ${size} ${selected ? "bg-pink-100 dark:bg-pink-900/40" : "bg-secondary"}`;
|
|
35
|
+
const t7 = `font-instrument-sans-semibold ${largerText ? "text-xl" : "text-lg"} ${selected ? "text-pink-700 dark:text-pink-300" : ""}`;
|
|
36
|
+
let t8;
|
|
32
37
|
if ($[2] !== scheme || $[3] !== selected) {
|
|
33
|
-
|
|
38
|
+
t8 = selected ? null : textStyle("muted", scheme);
|
|
34
39
|
$[2] = scheme;
|
|
35
40
|
$[3] = selected;
|
|
36
|
-
$[4] =
|
|
41
|
+
$[4] = t8;
|
|
37
42
|
} else {
|
|
38
|
-
|
|
43
|
+
t8 = $[4];
|
|
39
44
|
}
|
|
40
|
-
let
|
|
45
|
+
let t9;
|
|
41
46
|
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
42
|
-
|
|
43
|
-
$[5] =
|
|
47
|
+
t9 = typeStyle("semibold");
|
|
48
|
+
$[5] = t9;
|
|
44
49
|
} else {
|
|
45
|
-
|
|
50
|
+
t9 = $[5];
|
|
46
51
|
}
|
|
47
|
-
let
|
|
48
|
-
if ($[6] !==
|
|
49
|
-
|
|
50
|
-
$[6] =
|
|
51
|
-
$[7] =
|
|
52
|
+
let t10;
|
|
53
|
+
if ($[6] !== t8) {
|
|
54
|
+
t10 = [t8, t9];
|
|
55
|
+
$[6] = t8;
|
|
56
|
+
$[7] = t10;
|
|
52
57
|
} else {
|
|
53
|
-
|
|
58
|
+
t10 = $[7];
|
|
54
59
|
}
|
|
55
|
-
let
|
|
56
|
-
if ($[8] !== label || $[9] !==
|
|
57
|
-
|
|
60
|
+
let t11;
|
|
61
|
+
if ($[8] !== label || $[9] !== t10 || $[10] !== t7) {
|
|
62
|
+
t11 = <Text className={t7} style={t10}>{label}</Text>;
|
|
58
63
|
$[8] = label;
|
|
59
|
-
$[9] =
|
|
64
|
+
$[9] = t10;
|
|
60
65
|
$[10] = t7;
|
|
61
|
-
$[11] =
|
|
66
|
+
$[11] = t11;
|
|
62
67
|
} else {
|
|
63
|
-
|
|
68
|
+
t11 = $[11];
|
|
64
69
|
}
|
|
65
|
-
let
|
|
66
|
-
if ($[12] !== label || $[13] !== onPress || $[14] !==
|
|
67
|
-
|
|
70
|
+
let t12;
|
|
71
|
+
if ($[12] !== label || $[13] !== onPress || $[14] !== press.onPressIn || $[15] !== press.onPressOut || $[16] !== press.style || $[17] !== t11 || $[18] !== t2 || $[19] !== t6 || $[20] !== testID) {
|
|
72
|
+
t12 = <AnimatedPressable testID={testID} accessibilityRole="button" accessibilityLabel={label} accessibilityState={t2} onPress={onPress} onPressIn={t3} onPressOut={t4} style={t5} className={t6}>{t11}</AnimatedPressable>;
|
|
68
73
|
$[12] = label;
|
|
69
74
|
$[13] = onPress;
|
|
70
|
-
$[14] =
|
|
71
|
-
$[15] =
|
|
72
|
-
$[16] =
|
|
73
|
-
$[17] =
|
|
74
|
-
$[18] =
|
|
75
|
+
$[14] = press.onPressIn;
|
|
76
|
+
$[15] = press.onPressOut;
|
|
77
|
+
$[16] = press.style;
|
|
78
|
+
$[17] = t11;
|
|
79
|
+
$[18] = t2;
|
|
80
|
+
$[19] = t6;
|
|
81
|
+
$[20] = testID;
|
|
82
|
+
$[21] = t12;
|
|
75
83
|
} else {
|
|
76
|
-
|
|
84
|
+
t12 = $[21];
|
|
77
85
|
}
|
|
78
|
-
return
|
|
86
|
+
return t12;
|
|
79
87
|
}
|
package/dist/ColorSwatches.jsx
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { View } from "react-native";
|
|
3
3
|
import { IconCheck } from "@tabler/icons-react-native";
|
|
4
4
|
import { cn } from "./cn";
|
|
5
5
|
import { touchSlop } from "./controlStyles";
|
|
6
6
|
import { selectionHaptic } from "./haptics";
|
|
7
|
+
import { AnimatedPressable, usePressScale } from "./pressScale";
|
|
7
8
|
import { withAlpha } from "./palette";
|
|
8
9
|
import { useLargerText } from "./theme";
|
|
9
10
|
import { tokens } from "./tokens";
|
|
@@ -55,7 +56,7 @@ export function swatchCheckColor(color) {
|
|
|
55
56
|
* of neighbouring swatches apart.
|
|
56
57
|
*/
|
|
57
58
|
export function ColorSwatches(t0) {
|
|
58
|
-
const $ = _c(
|
|
59
|
+
const $ = _c(26);
|
|
59
60
|
const {
|
|
60
61
|
value,
|
|
61
62
|
onChange,
|
|
@@ -68,7 +69,7 @@ export function ColorSwatches(t0) {
|
|
|
68
69
|
} = t0;
|
|
69
70
|
const size = t1 === undefined ? "md" : t1;
|
|
70
71
|
const disabled = t2 === undefined ? false : t2;
|
|
71
|
-
|
|
72
|
+
useScheme();
|
|
72
73
|
const largerText = useLargerText();
|
|
73
74
|
const diameter = DIAMETER[largerText ? "larger" : "regular"][size];
|
|
74
75
|
const outer = diameter + 2 * (RING + RING_GAP);
|
|
@@ -91,44 +92,27 @@ export function ColorSwatches(t0) {
|
|
|
91
92
|
t5 = $[3];
|
|
92
93
|
}
|
|
93
94
|
let t6;
|
|
94
|
-
if ($[4] !== colors || $[5] !== diameter || $[6] !== disabled || $[7] !== labels || $[8] !== onChange || $[9] !== outer || $[10] !==
|
|
95
|
+
if ($[4] !== colors || $[5] !== diameter || $[6] !== disabled || $[7] !== labels || $[8] !== onChange || $[9] !== outer || $[10] !== selected || $[11] !== testID) {
|
|
95
96
|
let t7;
|
|
96
|
-
if ($[
|
|
97
|
+
if ($[13] !== diameter || $[14] !== disabled || $[15] !== labels || $[16] !== onChange || $[17] !== outer || $[18] !== selected || $[19] !== testID) {
|
|
97
98
|
t7 = (color, index) => {
|
|
98
99
|
const isSelected = color.toLowerCase() === selected;
|
|
99
100
|
const check = isSelected ? swatchCheckColor(color) : null;
|
|
100
|
-
return <
|
|
101
|
-
checked: isSelected,
|
|
102
|
-
disabled
|
|
103
|
-
}} hitSlop={touchSlop(outer)} disabled={disabled} onPress={() => {
|
|
101
|
+
return <Swatch key={`${color}-${index}`} testID={testID ? `${testID}-${index}` : undefined} label={labels?.[index] ?? color} color={color} selected={isSelected} check={check} disabled={disabled} diameter={diameter} outer={outer} onPress={() => {
|
|
104
102
|
selectionHaptic();
|
|
105
103
|
onChange(color);
|
|
106
|
-
}}
|
|
107
|
-
width: outer,
|
|
108
|
-
height: outer,
|
|
109
|
-
borderRadius: outer / 2,
|
|
110
|
-
borderWidth: RING,
|
|
111
|
-
borderColor: isSelected ? tokens.color.foreground[scheme] : "transparent"
|
|
112
|
-
}}><View className="items-center justify-center" style={{
|
|
113
|
-
width: diameter,
|
|
114
|
-
height: diameter,
|
|
115
|
-
borderRadius: diameter / 2,
|
|
116
|
-
backgroundColor: color,
|
|
117
|
-
borderWidth: 1,
|
|
118
|
-
borderColor: withAlpha(tokens.color.foreground[scheme], 0.12)
|
|
119
|
-
}}>{check ? <IconCheck size={Math.round(diameter / 2)} color={check} strokeWidth={2} /> : null}</View></Pressable>;
|
|
104
|
+
}} />;
|
|
120
105
|
};
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[22] = t7;
|
|
106
|
+
$[13] = diameter;
|
|
107
|
+
$[14] = disabled;
|
|
108
|
+
$[15] = labels;
|
|
109
|
+
$[16] = onChange;
|
|
110
|
+
$[17] = outer;
|
|
111
|
+
$[18] = selected;
|
|
112
|
+
$[19] = testID;
|
|
113
|
+
$[20] = t7;
|
|
130
114
|
} else {
|
|
131
|
-
t7 = $[
|
|
115
|
+
t7 = $[20];
|
|
132
116
|
}
|
|
133
117
|
t6 = colors.map(t7);
|
|
134
118
|
$[4] = colors;
|
|
@@ -137,23 +121,163 @@ export function ColorSwatches(t0) {
|
|
|
137
121
|
$[7] = labels;
|
|
138
122
|
$[8] = onChange;
|
|
139
123
|
$[9] = outer;
|
|
140
|
-
$[10] =
|
|
141
|
-
$[11] =
|
|
142
|
-
$[12] =
|
|
143
|
-
$[13] = t6;
|
|
124
|
+
$[10] = selected;
|
|
125
|
+
$[11] = testID;
|
|
126
|
+
$[12] = t6;
|
|
144
127
|
} else {
|
|
145
|
-
t6 = $[
|
|
128
|
+
t6 = $[12];
|
|
146
129
|
}
|
|
147
130
|
let t7;
|
|
148
|
-
if ($[
|
|
131
|
+
if ($[21] !== accessibilityLabel || $[22] !== t5 || $[23] !== t6 || $[24] !== testID) {
|
|
149
132
|
t7 = <View testID={testID} accessibilityRole="radiogroup" accessibilityLabel={accessibilityLabel} className={t5}>{t6}</View>;
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
133
|
+
$[21] = accessibilityLabel;
|
|
134
|
+
$[22] = t5;
|
|
135
|
+
$[23] = t6;
|
|
136
|
+
$[24] = testID;
|
|
137
|
+
$[25] = t7;
|
|
155
138
|
} else {
|
|
156
|
-
t7 = $[
|
|
139
|
+
t7 = $[25];
|
|
157
140
|
}
|
|
158
141
|
return t7;
|
|
159
142
|
}
|
|
143
|
+
|
|
144
|
+
/** One swatch: a radio that scales a little on press. The slop does not scale. */
|
|
145
|
+
function Swatch(t0) {
|
|
146
|
+
const $ = _c(38);
|
|
147
|
+
const {
|
|
148
|
+
testID,
|
|
149
|
+
label,
|
|
150
|
+
color,
|
|
151
|
+
selected,
|
|
152
|
+
check,
|
|
153
|
+
disabled,
|
|
154
|
+
diameter,
|
|
155
|
+
outer,
|
|
156
|
+
onPress
|
|
157
|
+
} = t0;
|
|
158
|
+
const scheme = useScheme();
|
|
159
|
+
let t1;
|
|
160
|
+
if ($[0] !== disabled) {
|
|
161
|
+
t1 = {
|
|
162
|
+
disabled
|
|
163
|
+
};
|
|
164
|
+
$[0] = disabled;
|
|
165
|
+
$[1] = t1;
|
|
166
|
+
} else {
|
|
167
|
+
t1 = $[1];
|
|
168
|
+
}
|
|
169
|
+
const press = usePressScale(t1);
|
|
170
|
+
let t2;
|
|
171
|
+
if ($[2] !== disabled || $[3] !== selected) {
|
|
172
|
+
t2 = {
|
|
173
|
+
checked: selected,
|
|
174
|
+
disabled
|
|
175
|
+
};
|
|
176
|
+
$[2] = disabled;
|
|
177
|
+
$[3] = selected;
|
|
178
|
+
$[4] = t2;
|
|
179
|
+
} else {
|
|
180
|
+
t2 = $[4];
|
|
181
|
+
}
|
|
182
|
+
let t3;
|
|
183
|
+
if ($[5] !== outer) {
|
|
184
|
+
t3 = touchSlop(outer);
|
|
185
|
+
$[5] = outer;
|
|
186
|
+
$[6] = t3;
|
|
187
|
+
} else {
|
|
188
|
+
t3 = $[6];
|
|
189
|
+
}
|
|
190
|
+
const t4 = press.onPressIn;
|
|
191
|
+
const t5 = press.onPressOut;
|
|
192
|
+
const t6 = outer / 2;
|
|
193
|
+
const t7 = selected ? tokens.color.foreground[scheme] : "transparent";
|
|
194
|
+
let t8;
|
|
195
|
+
if ($[7] !== outer || $[8] !== t6 || $[9] !== t7) {
|
|
196
|
+
t8 = {
|
|
197
|
+
width: outer,
|
|
198
|
+
height: outer,
|
|
199
|
+
borderRadius: t6,
|
|
200
|
+
borderWidth: RING,
|
|
201
|
+
borderColor: t7
|
|
202
|
+
};
|
|
203
|
+
$[7] = outer;
|
|
204
|
+
$[8] = t6;
|
|
205
|
+
$[9] = t7;
|
|
206
|
+
$[10] = t8;
|
|
207
|
+
} else {
|
|
208
|
+
t8 = $[10];
|
|
209
|
+
}
|
|
210
|
+
let t9;
|
|
211
|
+
if ($[11] !== press.style || $[12] !== t8) {
|
|
212
|
+
t9 = [t8, press.style];
|
|
213
|
+
$[11] = press.style;
|
|
214
|
+
$[12] = t8;
|
|
215
|
+
$[13] = t9;
|
|
216
|
+
} else {
|
|
217
|
+
t9 = $[13];
|
|
218
|
+
}
|
|
219
|
+
const t10 = diameter / 2;
|
|
220
|
+
const t11 = tokens.color.foreground[scheme];
|
|
221
|
+
let t12;
|
|
222
|
+
if ($[14] !== t11) {
|
|
223
|
+
t12 = withAlpha(t11, 0.12);
|
|
224
|
+
$[14] = t11;
|
|
225
|
+
$[15] = t12;
|
|
226
|
+
} else {
|
|
227
|
+
t12 = $[15];
|
|
228
|
+
}
|
|
229
|
+
let t13;
|
|
230
|
+
if ($[16] !== color || $[17] !== diameter || $[18] !== t10 || $[19] !== t12) {
|
|
231
|
+
t13 = {
|
|
232
|
+
width: diameter,
|
|
233
|
+
height: diameter,
|
|
234
|
+
borderRadius: t10,
|
|
235
|
+
backgroundColor: color,
|
|
236
|
+
borderWidth: 1,
|
|
237
|
+
borderColor: t12
|
|
238
|
+
};
|
|
239
|
+
$[16] = color;
|
|
240
|
+
$[17] = diameter;
|
|
241
|
+
$[18] = t10;
|
|
242
|
+
$[19] = t12;
|
|
243
|
+
$[20] = t13;
|
|
244
|
+
} else {
|
|
245
|
+
t13 = $[20];
|
|
246
|
+
}
|
|
247
|
+
let t14;
|
|
248
|
+
if ($[21] !== check || $[22] !== diameter) {
|
|
249
|
+
t14 = check ? <IconCheck size={Math.round(diameter / 2)} color={check} strokeWidth={2} /> : null;
|
|
250
|
+
$[21] = check;
|
|
251
|
+
$[22] = diameter;
|
|
252
|
+
$[23] = t14;
|
|
253
|
+
} else {
|
|
254
|
+
t14 = $[23];
|
|
255
|
+
}
|
|
256
|
+
let t15;
|
|
257
|
+
if ($[24] !== t13 || $[25] !== t14) {
|
|
258
|
+
t15 = <View className="items-center justify-center" style={t13}>{t14}</View>;
|
|
259
|
+
$[24] = t13;
|
|
260
|
+
$[25] = t14;
|
|
261
|
+
$[26] = t15;
|
|
262
|
+
} else {
|
|
263
|
+
t15 = $[26];
|
|
264
|
+
}
|
|
265
|
+
let t16;
|
|
266
|
+
if ($[27] !== disabled || $[28] !== label || $[29] !== onPress || $[30] !== press.onPressIn || $[31] !== press.onPressOut || $[32] !== t15 || $[33] !== t2 || $[34] !== t3 || $[35] !== t9 || $[36] !== testID) {
|
|
267
|
+
t16 = <AnimatedPressable testID={testID} accessibilityRole="radio" accessibilityLabel={label} accessibilityState={t2} hitSlop={t3} disabled={disabled} onPress={onPress} onPressIn={t4} onPressOut={t5} className="items-center justify-center" style={t9}>{t15}</AnimatedPressable>;
|
|
268
|
+
$[27] = disabled;
|
|
269
|
+
$[28] = label;
|
|
270
|
+
$[29] = onPress;
|
|
271
|
+
$[30] = press.onPressIn;
|
|
272
|
+
$[31] = press.onPressOut;
|
|
273
|
+
$[32] = t15;
|
|
274
|
+
$[33] = t2;
|
|
275
|
+
$[34] = t3;
|
|
276
|
+
$[35] = t9;
|
|
277
|
+
$[36] = testID;
|
|
278
|
+
$[37] = t16;
|
|
279
|
+
} else {
|
|
280
|
+
t16 = $[37];
|
|
281
|
+
}
|
|
282
|
+
return t16;
|
|
283
|
+
}
|
package/dist/Dialog.jsx
CHANGED
|
@@ -4,6 +4,7 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
|
4
4
|
import { IconX } from "@tabler/icons-react-native";
|
|
5
5
|
import { FloatingSurface } from "./FloatingSurface";
|
|
6
6
|
import { cn } from "./cn";
|
|
7
|
+
import { AnimatedPressable, usePressScale } from "./pressScale";
|
|
7
8
|
import { isCompactOverlay, textStyle, typeStyle } from "./controlStyles";
|
|
8
9
|
import { DialogLayoutContext, useDialogLayout } from "./dialogLayout";
|
|
9
10
|
import { palette } from "./palette";
|
|
@@ -296,21 +297,33 @@ function DialogHandle() {
|
|
|
296
297
|
return t1;
|
|
297
298
|
}
|
|
298
299
|
function DialogCloseButton() {
|
|
299
|
-
const $ = _c(
|
|
300
|
+
const $ = _c(8);
|
|
300
301
|
const largerText = useLargerText();
|
|
301
302
|
const scheme = useScheme();
|
|
303
|
+
const press = usePressScale();
|
|
302
304
|
const t0 = largerText ? 26 : 16;
|
|
303
305
|
const t1 = tokens.color.muted[scheme];
|
|
304
306
|
let t2;
|
|
305
307
|
if ($[0] !== t0 || $[1] !== t1) {
|
|
306
|
-
t2 = <
|
|
308
|
+
t2 = <IconX size={t0} color={t1} />;
|
|
307
309
|
$[0] = t0;
|
|
308
310
|
$[1] = t1;
|
|
309
311
|
$[2] = t2;
|
|
310
312
|
} else {
|
|
311
313
|
t2 = $[2];
|
|
312
314
|
}
|
|
313
|
-
|
|
315
|
+
let t3;
|
|
316
|
+
if ($[3] !== press.onPressIn || $[4] !== press.onPressOut || $[5] !== press.style || $[6] !== t2) {
|
|
317
|
+
t3 = <DialogClose asChild={true}><AnimatedPressable testID="dialog-close" accessibilityLabel="Close" hitSlop={8} onPressIn={press.onPressIn} onPressOut={press.onPressOut} style={press.style} className="absolute right-2 top-2 h-11 w-11 items-center justify-center rounded-lg">{t2}</AnimatedPressable></DialogClose>;
|
|
318
|
+
$[3] = press.onPressIn;
|
|
319
|
+
$[4] = press.onPressOut;
|
|
320
|
+
$[5] = press.style;
|
|
321
|
+
$[6] = t2;
|
|
322
|
+
$[7] = t3;
|
|
323
|
+
} else {
|
|
324
|
+
t3 = $[7];
|
|
325
|
+
}
|
|
326
|
+
return t3;
|
|
314
327
|
}
|
|
315
328
|
export function DialogHeader(t0) {
|
|
316
329
|
const $ = _c(8);
|
package/dist/FloatingFAB.jsx
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { Platform,
|
|
2
|
+
import { Platform, View } from "react-native";
|
|
3
3
|
import { cn } from "./cn";
|
|
4
4
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
5
5
|
import { FloatingSurface } from "./FloatingSurface";
|
|
6
|
+
import { AnimatedPressable, usePressScale } from "./pressScale";
|
|
6
7
|
import { useAccentColor, useLargerText } from "./theme";
|
|
7
8
|
import { FLOATING_INSET, FLOATING_TAB_BAR_HEIGHT, FLOATING_TAB_BAR_HEIGHT_LARGE } from "./floating";
|
|
8
9
|
export function FloatingFAB(t0) {
|
|
9
|
-
const $ = _c(
|
|
10
|
+
const $ = _c(25);
|
|
10
11
|
const {
|
|
11
12
|
onPress,
|
|
12
13
|
label,
|
|
@@ -16,80 +17,95 @@ export function FloatingFAB(t0) {
|
|
|
16
17
|
const insets = useSafeAreaInsets();
|
|
17
18
|
const largerText = useLargerText();
|
|
18
19
|
const accentColor = useAccentColor();
|
|
19
|
-
const size = largerText ? 64 : 56;
|
|
20
|
-
const tabBar = largerText ? FLOATING_TAB_BAR_HEIGHT_LARGE : FLOATING_TAB_BAR_HEIGHT;
|
|
21
20
|
let t1;
|
|
22
21
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23
|
-
t1 =
|
|
22
|
+
t1 = {
|
|
23
|
+
scale: 0.95
|
|
24
|
+
};
|
|
24
25
|
$[0] = t1;
|
|
25
26
|
} else {
|
|
26
27
|
t1 = $[0];
|
|
27
28
|
}
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
bottom: t3
|
|
35
|
-
};
|
|
29
|
+
const press = usePressScale(t1);
|
|
30
|
+
const size = largerText ? 64 : 56;
|
|
31
|
+
const tabBar = largerText ? FLOATING_TAB_BAR_HEIGHT_LARGE : FLOATING_TAB_BAR_HEIGHT;
|
|
32
|
+
let t2;
|
|
33
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
34
|
+
t2 = cn("z-10", Platform.OS === "web" ? "fixed" : "absolute");
|
|
36
35
|
$[1] = t2;
|
|
37
|
-
$[2] = t3;
|
|
38
|
-
$[3] = t4;
|
|
39
36
|
} else {
|
|
40
|
-
|
|
37
|
+
t2 = $[1];
|
|
41
38
|
}
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
alignItems: "center",
|
|
51
|
-
justifyContent: "center",
|
|
52
|
-
width: size,
|
|
53
|
-
height: size,
|
|
54
|
-
backgroundColor: accentColor,
|
|
55
|
-
opacity: pressed ? 0.7 : 1
|
|
56
|
-
};
|
|
39
|
+
const t3 = insets.right + FLOATING_INSET;
|
|
40
|
+
const t4 = FLOATING_INSET + Math.max(insets.bottom, 8) + tabBar + 20;
|
|
41
|
+
let t5;
|
|
42
|
+
if ($[2] !== t3 || $[3] !== t4) {
|
|
43
|
+
t5 = {
|
|
44
|
+
right: t3,
|
|
45
|
+
bottom: t4
|
|
57
46
|
};
|
|
58
|
-
$[
|
|
59
|
-
$[
|
|
60
|
-
$[
|
|
47
|
+
$[2] = t3;
|
|
48
|
+
$[3] = t4;
|
|
49
|
+
$[4] = t5;
|
|
61
50
|
} else {
|
|
62
|
-
|
|
51
|
+
t5 = $[4];
|
|
63
52
|
}
|
|
53
|
+
const t6 = size / 2;
|
|
64
54
|
let t7;
|
|
65
|
-
if ($[
|
|
66
|
-
t7 =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
55
|
+
if ($[5] !== accentColor || $[6] !== size) {
|
|
56
|
+
t7 = {
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
justifyContent: "center",
|
|
59
|
+
width: size,
|
|
60
|
+
height: size,
|
|
61
|
+
backgroundColor: accentColor
|
|
62
|
+
};
|
|
63
|
+
$[5] = accentColor;
|
|
64
|
+
$[6] = size;
|
|
65
|
+
$[7] = t7;
|
|
73
66
|
} else {
|
|
74
|
-
t7 = $[
|
|
67
|
+
t7 = $[7];
|
|
75
68
|
}
|
|
76
69
|
let t8;
|
|
77
|
-
if ($[
|
|
78
|
-
t8 =
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
70
|
+
if ($[8] !== press.style || $[9] !== t7) {
|
|
71
|
+
t8 = [t7, press.style];
|
|
72
|
+
$[8] = press.style;
|
|
73
|
+
$[9] = t7;
|
|
74
|
+
$[10] = t8;
|
|
82
75
|
} else {
|
|
83
|
-
t8 = $[
|
|
76
|
+
t8 = $[10];
|
|
84
77
|
}
|
|
85
78
|
let t9;
|
|
86
|
-
if ($[16] !==
|
|
87
|
-
t9 = <
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
79
|
+
if ($[11] !== children || $[12] !== label || $[13] !== onPress || $[14] !== press.onPressIn || $[15] !== press.onPressOut || $[16] !== t8 || $[17] !== testID) {
|
|
80
|
+
t9 = <AnimatedPressable testID={testID} accessibilityRole="button" accessibilityLabel={label} onPress={onPress} onPressIn={press.onPressIn} onPressOut={press.onPressOut} style={t8}>{children}</AnimatedPressable>;
|
|
81
|
+
$[11] = children;
|
|
82
|
+
$[12] = label;
|
|
83
|
+
$[13] = onPress;
|
|
84
|
+
$[14] = press.onPressIn;
|
|
85
|
+
$[15] = press.onPressOut;
|
|
86
|
+
$[16] = t8;
|
|
87
|
+
$[17] = testID;
|
|
90
88
|
$[18] = t9;
|
|
91
89
|
} else {
|
|
92
90
|
t9 = $[18];
|
|
93
91
|
}
|
|
94
|
-
|
|
92
|
+
let t10;
|
|
93
|
+
if ($[19] !== t6 || $[20] !== t9) {
|
|
94
|
+
t10 = <FloatingSurface radius={t6} blur={false}>{t9}</FloatingSurface>;
|
|
95
|
+
$[19] = t6;
|
|
96
|
+
$[20] = t9;
|
|
97
|
+
$[21] = t10;
|
|
98
|
+
} else {
|
|
99
|
+
t10 = $[21];
|
|
100
|
+
}
|
|
101
|
+
let t11;
|
|
102
|
+
if ($[22] !== t10 || $[23] !== t5) {
|
|
103
|
+
t11 = <View pointerEvents="box-none" className={t2} style={t5}>{t10}</View>;
|
|
104
|
+
$[22] = t10;
|
|
105
|
+
$[23] = t5;
|
|
106
|
+
$[24] = t11;
|
|
107
|
+
} else {
|
|
108
|
+
t11 = $[24];
|
|
109
|
+
}
|
|
110
|
+
return t11;
|
|
95
111
|
}
|