@otfdashkit/ui-native 0.1.2 → 0.1.3
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/index.d.ts +3 -7
- package/dist/index.js +58 -347
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -362
- package/dist/index.mjs.map +1 -1
- package/dist/skia.d.ts +14 -0
- package/dist/skia.js +317 -0
- package/dist/skia.js.map +1 -0
- package/dist/skia.mjs +310 -0
- package/dist/skia.mjs.map +1 -0
- package/package.json +7 -2
package/dist/index.mjs
CHANGED
|
@@ -186,7 +186,7 @@ function getOtfDesignTheme(themeId) {
|
|
|
186
186
|
|
|
187
187
|
// src/index.ts
|
|
188
188
|
import {
|
|
189
|
-
View as
|
|
189
|
+
View as View14,
|
|
190
190
|
Stack,
|
|
191
191
|
SizableStack,
|
|
192
192
|
ThemeableStack,
|
|
@@ -5882,315 +5882,8 @@ function useCollapsibleHeader(opts = {}) {
|
|
|
5882
5882
|
return { scrollHandler, headerStyle, titleStyle, scrollY };
|
|
5883
5883
|
}
|
|
5884
5884
|
|
|
5885
|
-
// src/patterns/Shockwave/Shockwave.tsx
|
|
5886
|
-
import {
|
|
5887
|
-
createContext as createContext3,
|
|
5888
|
-
memo as memo2,
|
|
5889
|
-
useCallback as useCallback15,
|
|
5890
|
-
useContext as useContext3,
|
|
5891
|
-
useEffect as useEffect11,
|
|
5892
|
-
useMemo as useMemo7,
|
|
5893
|
-
useRef as useRef10,
|
|
5894
|
-
useState as useState23
|
|
5895
|
-
} from "react";
|
|
5896
|
-
import { StyleSheet, View as View12 } from "react-native";
|
|
5897
|
-
import {
|
|
5898
|
-
Canvas,
|
|
5899
|
-
Fill,
|
|
5900
|
-
ImageShader,
|
|
5901
|
-
Shader,
|
|
5902
|
-
Skia
|
|
5903
|
-
} from "@shopify/react-native-skia";
|
|
5904
|
-
import {
|
|
5905
|
-
Easing as Easing4,
|
|
5906
|
-
useDerivedValue,
|
|
5907
|
-
useSharedValue as useSharedValue7,
|
|
5908
|
-
withTiming as withTiming5
|
|
5909
|
-
} from "react-native-reanimated";
|
|
5910
|
-
import { scheduleOnRN } from "react-native-worklets";
|
|
5911
|
-
|
|
5912
|
-
// src/patterns/Shockwave/conf.ts
|
|
5913
|
-
var SHOCKWAVE_DEFAULTS = {
|
|
5914
|
-
WIDTH: 320,
|
|
5915
|
-
HEIGHT: 320,
|
|
5916
|
-
DURATION: 900,
|
|
5917
|
-
SHOCK_STRENGTH: 0.12,
|
|
5918
|
-
LENSING_SPREAD: 0.2
|
|
5919
|
-
};
|
|
5920
|
-
|
|
5921
|
-
// src/patterns/Shockwave/shader.ts
|
|
5922
|
-
var SHOCKWAVE_SHADER_SOURCE = `
|
|
5923
|
-
uniform float2 iResolution;
|
|
5924
|
-
uniform float iTime;
|
|
5925
|
-
uniform float2 iMouse;
|
|
5926
|
-
uniform float uShockStrength;
|
|
5927
|
-
uniform float uLensingSpread;
|
|
5928
|
-
uniform shader iChannel0;
|
|
5929
|
-
uniform shader iChannel1;
|
|
5930
|
-
|
|
5931
|
-
half4 main(float2 fragCoord) {
|
|
5932
|
-
float2 uv = fragCoord / iResolution;
|
|
5933
|
-
float2 origin = iMouse / iResolution;
|
|
5934
|
-
|
|
5935
|
-
float t = clamp(iTime, 0.0, 1.0);
|
|
5936
|
-
float radius = sqrt(2.0) * t;
|
|
5937
|
-
float circle = radius - distance(origin, uv);
|
|
5938
|
-
float factor = uShockStrength
|
|
5939
|
-
* sin(t * 3.14159265)
|
|
5940
|
-
* pow(clamp(1.0 - abs(circle), 0.0, 1.0), 20.0);
|
|
5941
|
-
|
|
5942
|
-
float2 delta = origin - uv;
|
|
5943
|
-
float2 dir = delta / (length(delta) + 1e-6);
|
|
5944
|
-
|
|
5945
|
-
float2 d0 = (uLensingSpread) * factor * dir * iResolution;
|
|
5946
|
-
float2 d1 = (uLensingSpread * 1.2) * factor * dir * iResolution;
|
|
5947
|
-
float2 d2 = (uLensingSpread * 1.5) * factor * dir * iResolution;
|
|
5948
|
-
|
|
5949
|
-
half4 a = half4(
|
|
5950
|
-
iChannel0.eval(fragCoord + d0).r,
|
|
5951
|
-
iChannel0.eval(fragCoord + d1).g,
|
|
5952
|
-
iChannel0.eval(fragCoord + d2).b,
|
|
5953
|
-
1.0
|
|
5954
|
-
);
|
|
5955
|
-
half4 b = half4(
|
|
5956
|
-
iChannel1.eval(fragCoord + d0).r,
|
|
5957
|
-
iChannel1.eval(fragCoord + d1).g,
|
|
5958
|
-
iChannel1.eval(fragCoord + d2).b,
|
|
5959
|
-
1.0
|
|
5960
|
-
);
|
|
5961
|
-
|
|
5962
|
-
half mixT = half(clamp(t + circle * 5.0, 0.0, 1.0));
|
|
5963
|
-
return mix(a, b, mixT);
|
|
5964
|
-
}
|
|
5965
|
-
`;
|
|
5966
|
-
|
|
5967
|
-
// src/patterns/Shockwave/utils.ts
|
|
5968
|
-
import { Platform as Platform5 } from "react-native";
|
|
5969
|
-
import { makeImageFromView } from "@shopify/react-native-skia";
|
|
5970
|
-
var webNoopCallback = () => Promise.resolve(null);
|
|
5971
|
-
async function snapshotPair(fromRef, toRef, prev, next) {
|
|
5972
|
-
const callback = Platform5.OS === "web" ? webNoopCallback : null;
|
|
5973
|
-
const fromImg = await makeImageFromView(
|
|
5974
|
-
fromRef,
|
|
5975
|
-
callback
|
|
5976
|
-
);
|
|
5977
|
-
const toImg = await makeImageFromView(
|
|
5978
|
-
toRef,
|
|
5979
|
-
callback
|
|
5980
|
-
);
|
|
5981
|
-
if (!fromImg || !toImg) return null;
|
|
5982
|
-
const fromSnapshot = prev === "from" ? fromImg : toImg;
|
|
5983
|
-
const toSnapshot = next === "from" ? fromImg : toImg;
|
|
5984
|
-
return { from: fromSnapshot, to: toSnapshot };
|
|
5985
|
-
}
|
|
5986
|
-
|
|
5987
|
-
// src/patterns/Shockwave/Shockwave.tsx
|
|
5988
|
-
import { jsx as jsx69, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
5989
|
-
var useShockwaveShader = () => {
|
|
5990
|
-
const [shader, setShader] = useState23(null);
|
|
5991
|
-
useEffect11(() => {
|
|
5992
|
-
let cancelled = false;
|
|
5993
|
-
let attempts = 0;
|
|
5994
|
-
let timer = null;
|
|
5995
|
-
const tryCompile = () => {
|
|
5996
|
-
if (cancelled) return;
|
|
5997
|
-
try {
|
|
5998
|
-
if (Skia?.RuntimeEffect?.Make) {
|
|
5999
|
-
const compiled = Skia.RuntimeEffect.Make(SHOCKWAVE_SHADER_SOURCE);
|
|
6000
|
-
if (compiled) {
|
|
6001
|
-
setShader(compiled);
|
|
6002
|
-
return;
|
|
6003
|
-
}
|
|
6004
|
-
}
|
|
6005
|
-
} catch {
|
|
6006
|
-
}
|
|
6007
|
-
attempts += 1;
|
|
6008
|
-
if (attempts < 30) {
|
|
6009
|
-
timer = setTimeout(tryCompile, 80);
|
|
6010
|
-
}
|
|
6011
|
-
};
|
|
6012
|
-
tryCompile();
|
|
6013
|
-
return () => {
|
|
6014
|
-
cancelled = true;
|
|
6015
|
-
if (timer !== null) clearTimeout(timer);
|
|
6016
|
-
};
|
|
6017
|
-
}, []);
|
|
6018
|
-
return shader;
|
|
6019
|
-
};
|
|
6020
|
-
var ShockwaveContext = createContext3(null);
|
|
6021
|
-
var useShockwaveContext = () => {
|
|
6022
|
-
const ctx = useContext3(ShockwaveContext);
|
|
6023
|
-
if (!ctx) {
|
|
6024
|
-
throw new Error(
|
|
6025
|
-
"<Shockwave.Transition.From> / <Shockwave.Transition.To> must be rendered inside <Shockwave>"
|
|
6026
|
-
);
|
|
6027
|
-
}
|
|
6028
|
-
return ctx;
|
|
6029
|
-
};
|
|
6030
|
-
var OFFSCREEN_OFFSET = 1e5;
|
|
6031
|
-
var From = memo2(function From2({ children, style }) {
|
|
6032
|
-
const { fromRef, activeValue, isTransitioning } = useShockwaveContext();
|
|
6033
|
-
const isActive = activeValue === "from";
|
|
6034
|
-
return /* @__PURE__ */ jsx69(
|
|
6035
|
-
View12,
|
|
6036
|
-
{
|
|
6037
|
-
ref: fromRef,
|
|
6038
|
-
collapsable: false,
|
|
6039
|
-
pointerEvents: isActive && !isTransitioning ? "auto" : "none",
|
|
6040
|
-
style: [
|
|
6041
|
-
StyleSheet.absoluteFill,
|
|
6042
|
-
{
|
|
6043
|
-
zIndex: isActive ? 2 : 1,
|
|
6044
|
-
transform: [{ translateX: isActive ? 0 : OFFSCREEN_OFFSET }]
|
|
6045
|
-
},
|
|
6046
|
-
style
|
|
6047
|
-
],
|
|
6048
|
-
children
|
|
6049
|
-
}
|
|
6050
|
-
);
|
|
6051
|
-
});
|
|
6052
|
-
var To = memo2(function To2({ children, style }) {
|
|
6053
|
-
const { toRef, activeValue, isTransitioning } = useShockwaveContext();
|
|
6054
|
-
const isActive = activeValue === "to";
|
|
6055
|
-
return /* @__PURE__ */ jsx69(
|
|
6056
|
-
View12,
|
|
6057
|
-
{
|
|
6058
|
-
ref: toRef,
|
|
6059
|
-
collapsable: false,
|
|
6060
|
-
pointerEvents: isActive && !isTransitioning ? "auto" : "none",
|
|
6061
|
-
style: [
|
|
6062
|
-
StyleSheet.absoluteFill,
|
|
6063
|
-
{
|
|
6064
|
-
zIndex: isActive ? 2 : 1,
|
|
6065
|
-
transform: [{ translateX: isActive ? 0 : OFFSCREEN_OFFSET }]
|
|
6066
|
-
},
|
|
6067
|
-
style
|
|
6068
|
-
],
|
|
6069
|
-
children
|
|
6070
|
-
}
|
|
6071
|
-
);
|
|
6072
|
-
});
|
|
6073
|
-
var Transition = { From, To };
|
|
6074
|
-
var ShockwaveRoot = memo2(function ShockwaveRoot2({
|
|
6075
|
-
value,
|
|
6076
|
-
width = SHOCKWAVE_DEFAULTS.WIDTH,
|
|
6077
|
-
height = SHOCKWAVE_DEFAULTS.HEIGHT,
|
|
6078
|
-
duration = SHOCKWAVE_DEFAULTS.DURATION,
|
|
6079
|
-
origin,
|
|
6080
|
-
shockStrength = SHOCKWAVE_DEFAULTS.SHOCK_STRENGTH,
|
|
6081
|
-
lensingSpread = SHOCKWAVE_DEFAULTS.LENSING_SPREAD,
|
|
6082
|
-
style,
|
|
6083
|
-
children,
|
|
6084
|
-
onTransitionEnd
|
|
6085
|
-
}) {
|
|
6086
|
-
const fromRef = useRef10(null);
|
|
6087
|
-
const toRef = useRef10(null);
|
|
6088
|
-
const prevValueRef = useRef10(value);
|
|
6089
|
-
const shader = useShockwaveShader();
|
|
6090
|
-
const [activeValue, setActiveValue] = useState23(value);
|
|
6091
|
-
const [snapshots, setSnapshots] = useState23(null);
|
|
6092
|
-
const progress = useSharedValue7(0);
|
|
6093
|
-
const finishTransition = useCallback15(
|
|
6094
|
-
(next) => {
|
|
6095
|
-
setActiveValue(next);
|
|
6096
|
-
setSnapshots(null);
|
|
6097
|
-
onTransitionEnd?.(next);
|
|
6098
|
-
},
|
|
6099
|
-
[onTransitionEnd]
|
|
6100
|
-
);
|
|
6101
|
-
useEffect11(() => {
|
|
6102
|
-
if (value === prevValueRef.current) return;
|
|
6103
|
-
const prev = prevValueRef.current;
|
|
6104
|
-
const next = value;
|
|
6105
|
-
prevValueRef.current = value;
|
|
6106
|
-
let cancelled = false;
|
|
6107
|
-
void (async () => {
|
|
6108
|
-
const pair = await snapshotPair(
|
|
6109
|
-
fromRef,
|
|
6110
|
-
toRef,
|
|
6111
|
-
prev,
|
|
6112
|
-
next
|
|
6113
|
-
);
|
|
6114
|
-
if (cancelled) return;
|
|
6115
|
-
if (!pair) {
|
|
6116
|
-
setActiveValue(next);
|
|
6117
|
-
return;
|
|
6118
|
-
}
|
|
6119
|
-
setSnapshots(pair);
|
|
6120
|
-
progress.value = 0;
|
|
6121
|
-
progress.value = withTiming5(
|
|
6122
|
-
1,
|
|
6123
|
-
{ duration, easing: Easing4.linear },
|
|
6124
|
-
(done) => {
|
|
6125
|
-
if (done) scheduleOnRN(finishTransition, next);
|
|
6126
|
-
}
|
|
6127
|
-
);
|
|
6128
|
-
})();
|
|
6129
|
-
return () => {
|
|
6130
|
-
cancelled = true;
|
|
6131
|
-
};
|
|
6132
|
-
}, [value, duration, finishTransition, progress]);
|
|
6133
|
-
const ox = origin?.x ?? width / 2;
|
|
6134
|
-
const oy = origin?.y ?? height / 2;
|
|
6135
|
-
const uniforms = useDerivedValue(() => ({
|
|
6136
|
-
iResolution: [width, height],
|
|
6137
|
-
iTime: progress.value,
|
|
6138
|
-
iMouse: [ox, oy],
|
|
6139
|
-
uShockStrength: shockStrength,
|
|
6140
|
-
uLensingSpread: lensingSpread
|
|
6141
|
-
}));
|
|
6142
|
-
const ctxValue = useMemo7(
|
|
6143
|
-
() => ({
|
|
6144
|
-
fromRef,
|
|
6145
|
-
toRef,
|
|
6146
|
-
activeValue,
|
|
6147
|
-
isTransitioning: snapshots !== null
|
|
6148
|
-
}),
|
|
6149
|
-
[activeValue, snapshots]
|
|
6150
|
-
);
|
|
6151
|
-
return /* @__PURE__ */ jsxs58(View12, { style: [styles.wrapper, { width, height }, style], children: [
|
|
6152
|
-
/* @__PURE__ */ jsx69(ShockwaveContext.Provider, { value: ctxValue, children }),
|
|
6153
|
-
snapshots && shader ? /* @__PURE__ */ jsx69(
|
|
6154
|
-
Canvas,
|
|
6155
|
-
{
|
|
6156
|
-
style: [StyleSheet.absoluteFill, styles.canvasOverlay],
|
|
6157
|
-
pointerEvents: "none",
|
|
6158
|
-
children: /* @__PURE__ */ jsx69(Fill, { children: /* @__PURE__ */ jsxs58(Shader, { source: shader, uniforms, children: [
|
|
6159
|
-
/* @__PURE__ */ jsx69(
|
|
6160
|
-
ImageShader,
|
|
6161
|
-
{
|
|
6162
|
-
image: snapshots.from,
|
|
6163
|
-
fit: "cover",
|
|
6164
|
-
rect: { x: 0, y: 0, width, height }
|
|
6165
|
-
}
|
|
6166
|
-
),
|
|
6167
|
-
/* @__PURE__ */ jsx69(
|
|
6168
|
-
ImageShader,
|
|
6169
|
-
{
|
|
6170
|
-
image: snapshots.to,
|
|
6171
|
-
fit: "cover",
|
|
6172
|
-
rect: { x: 0, y: 0, width, height }
|
|
6173
|
-
}
|
|
6174
|
-
)
|
|
6175
|
-
] }) })
|
|
6176
|
-
}
|
|
6177
|
-
) : null
|
|
6178
|
-
] });
|
|
6179
|
-
});
|
|
6180
|
-
var styles = StyleSheet.create({
|
|
6181
|
-
wrapper: {
|
|
6182
|
-
position: "relative",
|
|
6183
|
-
overflow: "hidden",
|
|
6184
|
-
backgroundColor: "transparent"
|
|
6185
|
-
},
|
|
6186
|
-
canvasOverlay: {
|
|
6187
|
-
zIndex: 3
|
|
6188
|
-
}
|
|
6189
|
-
});
|
|
6190
|
-
var Shockwave = Object.assign(ShockwaveRoot, { Transition });
|
|
6191
|
-
|
|
6192
5885
|
// src/patterns/StayCard/StayBrowseScreen.tsx
|
|
6193
|
-
import { Image as Image9, View as
|
|
5886
|
+
import { Image as Image9, View as View12 } from "react-native";
|
|
6194
5887
|
import {
|
|
6195
5888
|
YStack as YStack56,
|
|
6196
5889
|
XStack as XStack50,
|
|
@@ -6199,7 +5892,7 @@ import {
|
|
|
6199
5892
|
SizableText as SizableText55
|
|
6200
5893
|
} from "tamagui";
|
|
6201
5894
|
import { Bed, Bath, Heart, MapPin, Star } from "@tamagui/lucide-icons";
|
|
6202
|
-
import { jsx as
|
|
5895
|
+
import { jsx as jsx69, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
6203
5896
|
var DEFAULT_CATEGORIES = [
|
|
6204
5897
|
{ label: "Villa" },
|
|
6205
5898
|
{ label: "Hotel", active: true },
|
|
@@ -6214,13 +5907,13 @@ function StayBrowseScreen({
|
|
|
6214
5907
|
onFavorite,
|
|
6215
5908
|
backgroundColor = "#fafaf9"
|
|
6216
5909
|
}) {
|
|
6217
|
-
return /* @__PURE__ */
|
|
6218
|
-
/* @__PURE__ */
|
|
6219
|
-
/* @__PURE__ */
|
|
6220
|
-
/* @__PURE__ */
|
|
5910
|
+
return /* @__PURE__ */ jsxs58(YStack56, { flex: 1, backgroundColor, padding: 18, gap: 14, children: [
|
|
5911
|
+
/* @__PURE__ */ jsxs58(YStack56, { gap: 4, marginTop: 28, children: [
|
|
5912
|
+
/* @__PURE__ */ jsx69(SizableText55, { size: "$2", color: "#737373", children: greeting }),
|
|
5913
|
+
/* @__PURE__ */ jsx69(H32, { color: "#0a0a0a", size: "$7", lineHeight: 28, children: headline })
|
|
6221
5914
|
] }),
|
|
6222
|
-
/* @__PURE__ */
|
|
6223
|
-
|
|
5915
|
+
/* @__PURE__ */ jsx69(XStack50, { gap: 8, flexWrap: "wrap", children: categories.map((c) => /* @__PURE__ */ jsx69(
|
|
5916
|
+
View12,
|
|
6224
5917
|
{
|
|
6225
5918
|
onTouchEnd: c.onPress,
|
|
6226
5919
|
style: {
|
|
@@ -6229,7 +5922,7 @@ function StayBrowseScreen({
|
|
|
6229
5922
|
borderRadius: 999,
|
|
6230
5923
|
backgroundColor: c.active ? "#d9f99d" : "#f4f4f5"
|
|
6231
5924
|
},
|
|
6232
|
-
children: /* @__PURE__ */
|
|
5925
|
+
children: /* @__PURE__ */ jsx69(
|
|
6233
5926
|
SizableText55,
|
|
6234
5927
|
{
|
|
6235
5928
|
size: "$2",
|
|
@@ -6241,7 +5934,7 @@ function StayBrowseScreen({
|
|
|
6241
5934
|
},
|
|
6242
5935
|
c.label
|
|
6243
5936
|
)) }),
|
|
6244
|
-
/* @__PURE__ */
|
|
5937
|
+
/* @__PURE__ */ jsxs58(
|
|
6245
5938
|
YStack56,
|
|
6246
5939
|
{
|
|
6247
5940
|
flex: 1,
|
|
@@ -6250,7 +5943,7 @@ function StayBrowseScreen({
|
|
|
6250
5943
|
backgroundColor: "#e7e5e4",
|
|
6251
5944
|
marginTop: 4,
|
|
6252
5945
|
children: [
|
|
6253
|
-
/* @__PURE__ */
|
|
5946
|
+
/* @__PURE__ */ jsx69(
|
|
6254
5947
|
Image9,
|
|
6255
5948
|
{
|
|
6256
5949
|
source: { uri: listing.image },
|
|
@@ -6258,33 +5951,33 @@ function StayBrowseScreen({
|
|
|
6258
5951
|
resizeMode: "cover"
|
|
6259
5952
|
}
|
|
6260
5953
|
),
|
|
6261
|
-
/* @__PURE__ */
|
|
6262
|
-
/* @__PURE__ */
|
|
6263
|
-
/* @__PURE__ */
|
|
6264
|
-
/* @__PURE__ */
|
|
5954
|
+
/* @__PURE__ */ jsxs58(YStack56, { flex: 1, padding: 14, gap: 8, children: [
|
|
5955
|
+
/* @__PURE__ */ jsxs58(XStack50, { alignItems: "center", justifyContent: "space-between", children: [
|
|
5956
|
+
/* @__PURE__ */ jsx69(H42, { color: "#0a0a0a", size: "$5", children: listing.title }),
|
|
5957
|
+
/* @__PURE__ */ jsx69(View12, { onTouchEnd: onFavorite, children: /* @__PURE__ */ jsx69(Heart, { size: 18, color: "#ef4444" }) })
|
|
6265
5958
|
] }),
|
|
6266
|
-
/* @__PURE__ */
|
|
6267
|
-
/* @__PURE__ */
|
|
6268
|
-
/* @__PURE__ */
|
|
5959
|
+
/* @__PURE__ */ jsxs58(XStack50, { alignItems: "center", gap: 4, children: [
|
|
5960
|
+
/* @__PURE__ */ jsx69(MapPin, { size: 12, color: "#737373" }),
|
|
5961
|
+
/* @__PURE__ */ jsx69(SizableText55, { size: "$1", color: "#737373", children: listing.address })
|
|
6269
5962
|
] }),
|
|
6270
|
-
/* @__PURE__ */
|
|
6271
|
-
typeof listing.bed === "number" ? /* @__PURE__ */
|
|
6272
|
-
/* @__PURE__ */
|
|
6273
|
-
/* @__PURE__ */
|
|
5963
|
+
/* @__PURE__ */ jsxs58(XStack50, { gap: 14, marginTop: 6, children: [
|
|
5964
|
+
typeof listing.bed === "number" ? /* @__PURE__ */ jsxs58(XStack50, { alignItems: "center", gap: 4, children: [
|
|
5965
|
+
/* @__PURE__ */ jsx69(Bed, { size: 14, color: "#737373" }),
|
|
5966
|
+
/* @__PURE__ */ jsxs58(SizableText55, { size: "$1", color: "#525252", children: [
|
|
6274
5967
|
"Bed: ",
|
|
6275
5968
|
listing.bed
|
|
6276
5969
|
] })
|
|
6277
5970
|
] }) : null,
|
|
6278
|
-
typeof listing.bath === "number" ? /* @__PURE__ */
|
|
6279
|
-
/* @__PURE__ */
|
|
6280
|
-
/* @__PURE__ */
|
|
5971
|
+
typeof listing.bath === "number" ? /* @__PURE__ */ jsxs58(XStack50, { alignItems: "center", gap: 4, children: [
|
|
5972
|
+
/* @__PURE__ */ jsx69(Bath, { size: 14, color: "#737373" }),
|
|
5973
|
+
/* @__PURE__ */ jsxs58(SizableText55, { size: "$1", color: "#525252", children: [
|
|
6281
5974
|
"Bath: ",
|
|
6282
5975
|
listing.bath
|
|
6283
5976
|
] })
|
|
6284
5977
|
] }) : null,
|
|
6285
|
-
typeof listing.rating === "number" ? /* @__PURE__ */
|
|
6286
|
-
/* @__PURE__ */
|
|
6287
|
-
/* @__PURE__ */
|
|
5978
|
+
typeof listing.rating === "number" ? /* @__PURE__ */ jsxs58(XStack50, { alignItems: "center", gap: 4, children: [
|
|
5979
|
+
/* @__PURE__ */ jsx69(Star, { size: 14, color: "#f59e0b", fill: "#f59e0b" }),
|
|
5980
|
+
/* @__PURE__ */ jsx69(SizableText55, { size: "$1", color: "#525252", children: listing.rating.toFixed(1) })
|
|
6288
5981
|
] }) : null
|
|
6289
5982
|
] })
|
|
6290
5983
|
] })
|
|
@@ -6295,10 +5988,10 @@ function StayBrowseScreen({
|
|
|
6295
5988
|
}
|
|
6296
5989
|
|
|
6297
5990
|
// src/patterns/StayCard/StayDetailScreen.tsx
|
|
6298
|
-
import { Image as Image10, View as
|
|
5991
|
+
import { Image as Image10, View as View13 } from "react-native";
|
|
6299
5992
|
import { YStack as YStack57, XStack as XStack51, H3 as H33, SizableText as SizableText56 } from "tamagui";
|
|
6300
5993
|
import { Bed as Bed2, Bath as Bath2, Star as Star2, Wifi } from "@tamagui/lucide-icons";
|
|
6301
|
-
import { jsx as
|
|
5994
|
+
import { jsx as jsx70, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
6302
5995
|
var formatPrice = (n) => "$" + n.toLocaleString("en-US", { maximumFractionDigits: 0 });
|
|
6303
5996
|
var buildDefaultMetrics = (props) => {
|
|
6304
5997
|
const out = [];
|
|
@@ -6310,20 +6003,20 @@ var buildDefaultMetrics = (props) => {
|
|
|
6310
6003
|
} else if (typeof props.listing.bed === "number") {
|
|
6311
6004
|
out.push({
|
|
6312
6005
|
label: "Beds",
|
|
6313
|
-
icon: /* @__PURE__ */
|
|
6006
|
+
icon: /* @__PURE__ */ jsx70(Bed2, { size: 14, color: "#fafaf9" }),
|
|
6314
6007
|
value: props.listing.bed
|
|
6315
6008
|
});
|
|
6316
6009
|
}
|
|
6317
6010
|
if (typeof props.listing.bath === "number") {
|
|
6318
6011
|
out.push({
|
|
6319
6012
|
label: "Baths",
|
|
6320
|
-
icon: /* @__PURE__ */
|
|
6013
|
+
icon: /* @__PURE__ */ jsx70(Bath2, { size: 14, color: "#fafaf9" }),
|
|
6321
6014
|
value: props.listing.bath
|
|
6322
6015
|
});
|
|
6323
6016
|
}
|
|
6324
6017
|
out.push({
|
|
6325
6018
|
label: "Wifi",
|
|
6326
|
-
icon: /* @__PURE__ */
|
|
6019
|
+
icon: /* @__PURE__ */ jsx70(Wifi, { size: 14, color: "#fafaf9" }),
|
|
6327
6020
|
value: "Fast"
|
|
6328
6021
|
});
|
|
6329
6022
|
return out;
|
|
@@ -6339,9 +6032,9 @@ function StayDetailScreen(props) {
|
|
|
6339
6032
|
ctaColor = "#f97316"
|
|
6340
6033
|
} = props;
|
|
6341
6034
|
const resolvedMetrics = metrics ?? buildDefaultMetrics(props);
|
|
6342
|
-
return /* @__PURE__ */
|
|
6343
|
-
/* @__PURE__ */
|
|
6344
|
-
/* @__PURE__ */
|
|
6035
|
+
return /* @__PURE__ */ jsxs59(YStack57, { flex: 1, backgroundColor, children: [
|
|
6036
|
+
/* @__PURE__ */ jsxs59(View13, { style: { position: "relative", height: "50%" }, children: [
|
|
6037
|
+
/* @__PURE__ */ jsx70(
|
|
6345
6038
|
Image10,
|
|
6346
6039
|
{
|
|
6347
6040
|
source: { uri: listing.image },
|
|
@@ -6349,8 +6042,8 @@ function StayDetailScreen(props) {
|
|
|
6349
6042
|
resizeMode: "cover"
|
|
6350
6043
|
}
|
|
6351
6044
|
),
|
|
6352
|
-
typeof listing.rating === "number" ? /* @__PURE__ */
|
|
6353
|
-
|
|
6045
|
+
typeof listing.rating === "number" ? /* @__PURE__ */ jsxs59(
|
|
6046
|
+
View13,
|
|
6354
6047
|
{
|
|
6355
6048
|
style: {
|
|
6356
6049
|
position: "absolute",
|
|
@@ -6365,30 +6058,30 @@ function StayDetailScreen(props) {
|
|
|
6365
6058
|
gap: 4
|
|
6366
6059
|
},
|
|
6367
6060
|
children: [
|
|
6368
|
-
/* @__PURE__ */
|
|
6369
|
-
/* @__PURE__ */
|
|
6061
|
+
/* @__PURE__ */ jsx70(Star2, { size: 12, color: "#f59e0b", fill: "#f59e0b" }),
|
|
6062
|
+
/* @__PURE__ */ jsx70(SizableText56, { size: "$1", color: "#0a0a0a", fontWeight: "700", children: listing.rating.toFixed(1) })
|
|
6370
6063
|
]
|
|
6371
6064
|
}
|
|
6372
6065
|
) : null
|
|
6373
6066
|
] }),
|
|
6374
|
-
/* @__PURE__ */
|
|
6375
|
-
/* @__PURE__ */
|
|
6376
|
-
typeof listing.pricePerNight === "number" ? /* @__PURE__ */
|
|
6067
|
+
/* @__PURE__ */ jsxs59(YStack57, { flex: 1, padding: 18, gap: 10, children: [
|
|
6068
|
+
/* @__PURE__ */ jsx70(SizableText56, { size: "$2", color: "#a3a3a3", children: eyebrow }),
|
|
6069
|
+
typeof listing.pricePerNight === "number" ? /* @__PURE__ */ jsxs59(H33, { color: "#fafaf9", size: "$7", children: [
|
|
6377
6070
|
formatPrice(listing.pricePerNight),
|
|
6378
6071
|
"/night"
|
|
6379
|
-
] }) : /* @__PURE__ */
|
|
6380
|
-
/* @__PURE__ */
|
|
6072
|
+
] }) : /* @__PURE__ */ jsx70(H33, { color: "#fafaf9", size: "$7", children: listing.title }),
|
|
6073
|
+
/* @__PURE__ */ jsxs59(SizableText56, { size: "$2", color: "#a3a3a3", children: [
|
|
6381
6074
|
listing.ownerName ? listing.ownerName + " \xB7 " : "",
|
|
6382
6075
|
listing.address
|
|
6383
6076
|
] }),
|
|
6384
|
-
/* @__PURE__ */
|
|
6385
|
-
/* @__PURE__ */
|
|
6386
|
-
m.icon ? /* @__PURE__ */
|
|
6077
|
+
/* @__PURE__ */ jsx70(XStack51, { gap: 20, marginTop: 6, children: resolvedMetrics.map((m, i) => /* @__PURE__ */ jsxs59(YStack57, { gap: 2, children: [
|
|
6078
|
+
/* @__PURE__ */ jsx70(SizableText56, { size: "$1", color: "#737373", children: m.label }),
|
|
6079
|
+
m.icon ? /* @__PURE__ */ jsxs59(XStack51, { alignItems: "center", gap: 4, children: [
|
|
6387
6080
|
m.icon,
|
|
6388
|
-
/* @__PURE__ */
|
|
6389
|
-
] }) : /* @__PURE__ */
|
|
6081
|
+
/* @__PURE__ */ jsx70(SizableText56, { size: "$3", color: "#fafaf9", fontWeight: "600", children: m.value })
|
|
6082
|
+
] }) : /* @__PURE__ */ jsx70(SizableText56, { size: "$3", color: "#fafaf9", fontWeight: "600", children: m.value })
|
|
6390
6083
|
] }, i)) }),
|
|
6391
|
-
/* @__PURE__ */
|
|
6084
|
+
/* @__PURE__ */ jsx70(
|
|
6392
6085
|
YStack57,
|
|
6393
6086
|
{
|
|
6394
6087
|
marginTop: "auto",
|
|
@@ -6397,7 +6090,7 @@ function StayDetailScreen(props) {
|
|
|
6397
6090
|
backgroundColor: ctaColor,
|
|
6398
6091
|
alignItems: "center",
|
|
6399
6092
|
onPress: onReserve,
|
|
6400
|
-
children: /* @__PURE__ */
|
|
6093
|
+
children: /* @__PURE__ */ jsx70(SizableText56, { size: "$3", color: "#fff", fontWeight: "700", children: ctaLabel })
|
|
6401
6094
|
}
|
|
6402
6095
|
)
|
|
6403
6096
|
] })
|
|
@@ -6525,7 +6218,6 @@ export {
|
|
|
6525
6218
|
Separator7 as Separator,
|
|
6526
6219
|
SettingsScreen,
|
|
6527
6220
|
Sheet5 as Sheet,
|
|
6528
|
-
Shockwave,
|
|
6529
6221
|
SizableStack,
|
|
6530
6222
|
SizableText57 as SizableText,
|
|
6531
6223
|
Skeleton,
|
|
@@ -6558,7 +6250,7 @@ export {
|
|
|
6558
6250
|
TooltipSimple,
|
|
6559
6251
|
Unspaced,
|
|
6560
6252
|
UserPreferences,
|
|
6561
|
-
|
|
6253
|
+
View14 as View,
|
|
6562
6254
|
VisuallyHidden,
|
|
6563
6255
|
WheelPicker,
|
|
6564
6256
|
XGroup,
|