@vvedantb/native-ui 0.24.0 → 0.24.2
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/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/DropdownMenu.jsx +245 -116
- 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/ai/card-button.jsx +116 -147
- package/dist/ai/file-chip.jsx +46 -22
- package/dist/ai/message-action-sheet.jsx +182 -202
- package/dist/motion.js +31 -0
- package/dist/pressScale.js +131 -0
- package/dist/primitives/overlay.jsx +162 -101
- package/dist/primitives/select.jsx +5 -1
- package/package.json +1 -1
- 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/DropdownMenu.tsx +71 -16
- 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/ai/card-button.tsx +17 -11
- package/src/ai/file-chip.tsx +13 -4
- package/src/ai/message-action-sheet.tsx +90 -97
- package/src/motion.ts +15 -0
- package/src/pressScale.ts +72 -0
- package/src/primitives/overlay.tsx +48 -8
- package/src/primitives/select.tsx +7 -2
package/dist/CaptureButton.jsx
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { Pressable
|
|
2
|
+
import { Pressable } from "react-native";
|
|
3
|
+
import Animated from "react-native-reanimated";
|
|
3
4
|
import { cn } from "./cn";
|
|
5
|
+
import { usePressScale } from "./pressScale";
|
|
4
6
|
import { withAlpha } from "./palette";
|
|
5
7
|
import { tokens } from "./tokens";
|
|
6
8
|
/** Shutter metrics: outer diameter, ring width and the gap inside the ring. */
|
|
@@ -12,12 +14,13 @@ export const CAPTURE_BUTTON = {
|
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* A camera shutter: a 76 white ring around a white disc, for a live preview in
|
|
15
|
-
* light and dark alike. The disc
|
|
17
|
+
* light and dark alike. The disc eases down to 90% in 100 ms while pressed
|
|
18
|
+
* and back in 160 ms; with Reduce Motion it dims instead. Larger than the
|
|
16
19
|
* 44 target, so it needs no hit slop. A labelled button, dimmed and ignoring
|
|
17
20
|
* presses when `disabled`.
|
|
18
21
|
*/
|
|
19
22
|
export function CaptureButton(t0) {
|
|
20
|
-
const $ = _c(
|
|
23
|
+
const $ = _c(20);
|
|
21
24
|
const {
|
|
22
25
|
onPress,
|
|
23
26
|
disabled: t1,
|
|
@@ -35,6 +38,10 @@ export function CaptureButton(t0) {
|
|
|
35
38
|
let t3;
|
|
36
39
|
if ($[0] !== disabled) {
|
|
37
40
|
t3 = {
|
|
41
|
+
scale: 0.9,
|
|
42
|
+
dim: 1,
|
|
43
|
+
reducedDim: 0.7,
|
|
44
|
+
pressInMs: 100,
|
|
38
45
|
disabled
|
|
39
46
|
};
|
|
40
47
|
$[0] = disabled;
|
|
@@ -42,18 +49,31 @@ export function CaptureButton(t0) {
|
|
|
42
49
|
} else {
|
|
43
50
|
t3 = $[1];
|
|
44
51
|
}
|
|
45
|
-
const
|
|
46
|
-
let
|
|
47
|
-
if ($[2] !==
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
const press = usePressScale(t3);
|
|
53
|
+
let t4;
|
|
54
|
+
if ($[2] !== disabled) {
|
|
55
|
+
t4 = {
|
|
56
|
+
disabled
|
|
57
|
+
};
|
|
58
|
+
$[2] = disabled;
|
|
59
|
+
$[3] = t4;
|
|
60
|
+
} else {
|
|
61
|
+
t4 = $[3];
|
|
62
|
+
}
|
|
63
|
+
const t5 = press.onPressIn;
|
|
64
|
+
const t6 = press.onPressOut;
|
|
65
|
+
const t7 = disabled && "opacity-50";
|
|
66
|
+
let t8;
|
|
67
|
+
if ($[4] !== t7) {
|
|
68
|
+
t8 = cn("items-center justify-center", t7);
|
|
69
|
+
$[4] = t7;
|
|
70
|
+
$[5] = t8;
|
|
51
71
|
} else {
|
|
52
|
-
|
|
72
|
+
t8 = $[5];
|
|
53
73
|
}
|
|
54
|
-
let
|
|
55
|
-
if ($[
|
|
56
|
-
|
|
74
|
+
let t9;
|
|
75
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
76
|
+
t9 = {
|
|
57
77
|
width: size,
|
|
58
78
|
height: size,
|
|
59
79
|
borderRadius: size / 2,
|
|
@@ -61,44 +81,45 @@ export function CaptureButton(t0) {
|
|
|
61
81
|
borderColor: tokens.color.white,
|
|
62
82
|
backgroundColor: withAlpha(tokens.color.black, 0.15)
|
|
63
83
|
};
|
|
64
|
-
$[
|
|
84
|
+
$[6] = t9;
|
|
65
85
|
} else {
|
|
66
|
-
|
|
86
|
+
t9 = $[6];
|
|
67
87
|
}
|
|
68
|
-
let
|
|
69
|
-
if ($[
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
width: inner,
|
|
76
|
-
height: inner,
|
|
77
|
-
borderRadius: inner / 2,
|
|
78
|
-
backgroundColor: tokens.color.white,
|
|
79
|
-
transform: [{
|
|
80
|
-
scale: pressed && !disabled ? 0.9 : 1
|
|
81
|
-
}]
|
|
82
|
-
}} />;
|
|
88
|
+
let t10;
|
|
89
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
90
|
+
t10 = {
|
|
91
|
+
width: inner,
|
|
92
|
+
height: inner,
|
|
93
|
+
borderRadius: inner / 2,
|
|
94
|
+
backgroundColor: tokens.color.white
|
|
83
95
|
};
|
|
84
|
-
$[
|
|
85
|
-
$[6] = t7;
|
|
96
|
+
$[7] = t10;
|
|
86
97
|
} else {
|
|
87
|
-
|
|
98
|
+
t10 = $[7];
|
|
88
99
|
}
|
|
89
|
-
let
|
|
90
|
-
if ($[
|
|
91
|
-
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
|
|
95
|
-
$[
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
let t11;
|
|
101
|
+
if ($[8] !== press.style) {
|
|
102
|
+
t11 = <Animated.View style={[t10, press.style]} />;
|
|
103
|
+
$[8] = press.style;
|
|
104
|
+
$[9] = t11;
|
|
105
|
+
} else {
|
|
106
|
+
t11 = $[9];
|
|
107
|
+
}
|
|
108
|
+
let t12;
|
|
109
|
+
if ($[10] !== accessibilityLabel || $[11] !== disabled || $[12] !== onPress || $[13] !== press.onPressIn || $[14] !== press.onPressOut || $[15] !== t11 || $[16] !== t4 || $[17] !== t8 || $[18] !== testID) {
|
|
110
|
+
t12 = <Pressable testID={testID} accessibilityRole="button" accessibilityLabel={accessibilityLabel} accessibilityState={t4} disabled={disabled} onPress={onPress} onPressIn={t5} onPressOut={t6} className={t8} style={t9}>{t11}</Pressable>;
|
|
111
|
+
$[10] = accessibilityLabel;
|
|
112
|
+
$[11] = disabled;
|
|
113
|
+
$[12] = onPress;
|
|
114
|
+
$[13] = press.onPressIn;
|
|
115
|
+
$[14] = press.onPressOut;
|
|
116
|
+
$[15] = t11;
|
|
117
|
+
$[16] = t4;
|
|
118
|
+
$[17] = t8;
|
|
119
|
+
$[18] = testID;
|
|
120
|
+
$[19] = t12;
|
|
100
121
|
} else {
|
|
101
|
-
|
|
122
|
+
t12 = $[19];
|
|
102
123
|
}
|
|
103
|
-
return
|
|
124
|
+
return t12;
|
|
104
125
|
}
|
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);
|