@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.d.ts
CHANGED
|
@@ -308,13 +308,9 @@ export const useCollapsibleHeader: any
|
|
|
308
308
|
export type UseCollapsibleHeaderOptions = any
|
|
309
309
|
export type UseCollapsibleHeaderReturn = any
|
|
310
310
|
|
|
311
|
-
// ─── Shockwave
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
export type ShockwaveSlotProps = any
|
|
315
|
-
export type ShockwaveContextValue = any
|
|
316
|
-
export type ShockwaveOrigin = any
|
|
317
|
-
export type ShockwaveValue = 'from' | 'to'
|
|
311
|
+
// ─── Shockwave moved to `@otfdashkit/ui-native/skia` subpath ──────────────
|
|
312
|
+
// See `packages/ui-native/types/skia.d.ts` for the type stubs and the
|
|
313
|
+
// "Why subpath exports?" section in `docs/sdk-design.md`.
|
|
318
314
|
|
|
319
315
|
// ─── Stay (real-estate / booking marketing screens) ───────────────────────
|
|
320
316
|
export const StayBrowseScreen: any
|
package/dist/index.js
CHANGED
|
@@ -29,8 +29,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
30
|
|
|
31
31
|
// src/index.ts
|
|
32
|
-
var
|
|
33
|
-
__export(
|
|
32
|
+
var src_exports = {};
|
|
33
|
+
__export(src_exports, {
|
|
34
34
|
Accordion: () => import_tamagui78.Accordion,
|
|
35
35
|
ActionSheet: () => ActionSheet,
|
|
36
36
|
Adapt: () => import_tamagui78.Adapt,
|
|
@@ -152,7 +152,6 @@ __export(index_exports, {
|
|
|
152
152
|
Separator: () => import_tamagui78.Separator,
|
|
153
153
|
SettingsScreen: () => SettingsScreen,
|
|
154
154
|
Sheet: () => import_tamagui78.Sheet,
|
|
155
|
-
Shockwave: () => Shockwave,
|
|
156
155
|
SizableStack: () => import_tamagui78.SizableStack,
|
|
157
156
|
SizableText: () => import_tamagui78.SizableText,
|
|
158
157
|
Skeleton: () => Skeleton,
|
|
@@ -238,7 +237,7 @@ __export(index_exports, {
|
|
|
238
237
|
useWindowDimensions: () => import_tamagui78.useWindowDimensions,
|
|
239
238
|
withStaticProperties: () => import_tamagui78.withStaticProperties
|
|
240
239
|
});
|
|
241
|
-
module.exports = __toCommonJS(
|
|
240
|
+
module.exports = __toCommonJS(src_exports);
|
|
242
241
|
|
|
243
242
|
// src/config/tamagui.config.ts
|
|
244
243
|
var import_v5 = require("@tamagui/config/v5");
|
|
@@ -4233,7 +4232,7 @@ function OtfPopover({
|
|
|
4233
4232
|
}
|
|
4234
4233
|
|
|
4235
4234
|
// src/index.ts
|
|
4236
|
-
__reExport(
|
|
4235
|
+
__reExport(src_exports, require("@tamagui/lucide-icons"), module.exports);
|
|
4237
4236
|
|
|
4238
4237
|
// src/patterns/ImmersiveMediaScreen.tsx
|
|
4239
4238
|
var import_tamagui67 = require("tamagui");
|
|
@@ -5911,298 +5910,11 @@ function useCollapsibleHeader(opts = {}) {
|
|
|
5911
5910
|
return { scrollHandler, headerStyle, titleStyle, scrollY };
|
|
5912
5911
|
}
|
|
5913
5912
|
|
|
5914
|
-
// src/patterns/Shockwave/Shockwave.tsx
|
|
5915
|
-
var import_react27 = require("react");
|
|
5916
|
-
var import_react_native14 = require("react-native");
|
|
5917
|
-
var import_react_native_skia2 = require("@shopify/react-native-skia");
|
|
5918
|
-
var import_react_native_reanimated11 = require("react-native-reanimated");
|
|
5919
|
-
var import_react_native_worklets = require("react-native-worklets");
|
|
5920
|
-
|
|
5921
|
-
// src/patterns/Shockwave/conf.ts
|
|
5922
|
-
var SHOCKWAVE_DEFAULTS = {
|
|
5923
|
-
WIDTH: 320,
|
|
5924
|
-
HEIGHT: 320,
|
|
5925
|
-
DURATION: 900,
|
|
5926
|
-
SHOCK_STRENGTH: 0.12,
|
|
5927
|
-
LENSING_SPREAD: 0.2
|
|
5928
|
-
};
|
|
5929
|
-
|
|
5930
|
-
// src/patterns/Shockwave/shader.ts
|
|
5931
|
-
var SHOCKWAVE_SHADER_SOURCE = `
|
|
5932
|
-
uniform float2 iResolution;
|
|
5933
|
-
uniform float iTime;
|
|
5934
|
-
uniform float2 iMouse;
|
|
5935
|
-
uniform float uShockStrength;
|
|
5936
|
-
uniform float uLensingSpread;
|
|
5937
|
-
uniform shader iChannel0;
|
|
5938
|
-
uniform shader iChannel1;
|
|
5939
|
-
|
|
5940
|
-
half4 main(float2 fragCoord) {
|
|
5941
|
-
float2 uv = fragCoord / iResolution;
|
|
5942
|
-
float2 origin = iMouse / iResolution;
|
|
5943
|
-
|
|
5944
|
-
float t = clamp(iTime, 0.0, 1.0);
|
|
5945
|
-
float radius = sqrt(2.0) * t;
|
|
5946
|
-
float circle = radius - distance(origin, uv);
|
|
5947
|
-
float factor = uShockStrength
|
|
5948
|
-
* sin(t * 3.14159265)
|
|
5949
|
-
* pow(clamp(1.0 - abs(circle), 0.0, 1.0), 20.0);
|
|
5950
|
-
|
|
5951
|
-
float2 delta = origin - uv;
|
|
5952
|
-
float2 dir = delta / (length(delta) + 1e-6);
|
|
5953
|
-
|
|
5954
|
-
float2 d0 = (uLensingSpread) * factor * dir * iResolution;
|
|
5955
|
-
float2 d1 = (uLensingSpread * 1.2) * factor * dir * iResolution;
|
|
5956
|
-
float2 d2 = (uLensingSpread * 1.5) * factor * dir * iResolution;
|
|
5957
|
-
|
|
5958
|
-
half4 a = half4(
|
|
5959
|
-
iChannel0.eval(fragCoord + d0).r,
|
|
5960
|
-
iChannel0.eval(fragCoord + d1).g,
|
|
5961
|
-
iChannel0.eval(fragCoord + d2).b,
|
|
5962
|
-
1.0
|
|
5963
|
-
);
|
|
5964
|
-
half4 b = half4(
|
|
5965
|
-
iChannel1.eval(fragCoord + d0).r,
|
|
5966
|
-
iChannel1.eval(fragCoord + d1).g,
|
|
5967
|
-
iChannel1.eval(fragCoord + d2).b,
|
|
5968
|
-
1.0
|
|
5969
|
-
);
|
|
5970
|
-
|
|
5971
|
-
half mixT = half(clamp(t + circle * 5.0, 0.0, 1.0));
|
|
5972
|
-
return mix(a, b, mixT);
|
|
5973
|
-
}
|
|
5974
|
-
`;
|
|
5975
|
-
|
|
5976
|
-
// src/patterns/Shockwave/utils.ts
|
|
5977
|
-
var import_react_native13 = require("react-native");
|
|
5978
|
-
var import_react_native_skia = require("@shopify/react-native-skia");
|
|
5979
|
-
var webNoopCallback = () => Promise.resolve(null);
|
|
5980
|
-
async function snapshotPair(fromRef, toRef, prev, next) {
|
|
5981
|
-
const callback = import_react_native13.Platform.OS === "web" ? webNoopCallback : null;
|
|
5982
|
-
const fromImg = await (0, import_react_native_skia.makeImageFromView)(
|
|
5983
|
-
fromRef,
|
|
5984
|
-
callback
|
|
5985
|
-
);
|
|
5986
|
-
const toImg = await (0, import_react_native_skia.makeImageFromView)(
|
|
5987
|
-
toRef,
|
|
5988
|
-
callback
|
|
5989
|
-
);
|
|
5990
|
-
if (!fromImg || !toImg) return null;
|
|
5991
|
-
const fromSnapshot = prev === "from" ? fromImg : toImg;
|
|
5992
|
-
const toSnapshot = next === "from" ? fromImg : toImg;
|
|
5993
|
-
return { from: fromSnapshot, to: toSnapshot };
|
|
5994
|
-
}
|
|
5995
|
-
|
|
5996
|
-
// src/patterns/Shockwave/Shockwave.tsx
|
|
5997
|
-
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5998
|
-
var useShockwaveShader = () => {
|
|
5999
|
-
const [shader, setShader] = (0, import_react27.useState)(null);
|
|
6000
|
-
(0, import_react27.useEffect)(() => {
|
|
6001
|
-
let cancelled = false;
|
|
6002
|
-
let attempts = 0;
|
|
6003
|
-
let timer = null;
|
|
6004
|
-
const tryCompile = () => {
|
|
6005
|
-
if (cancelled) return;
|
|
6006
|
-
try {
|
|
6007
|
-
if (import_react_native_skia2.Skia?.RuntimeEffect?.Make) {
|
|
6008
|
-
const compiled = import_react_native_skia2.Skia.RuntimeEffect.Make(SHOCKWAVE_SHADER_SOURCE);
|
|
6009
|
-
if (compiled) {
|
|
6010
|
-
setShader(compiled);
|
|
6011
|
-
return;
|
|
6012
|
-
}
|
|
6013
|
-
}
|
|
6014
|
-
} catch {
|
|
6015
|
-
}
|
|
6016
|
-
attempts += 1;
|
|
6017
|
-
if (attempts < 30) {
|
|
6018
|
-
timer = setTimeout(tryCompile, 80);
|
|
6019
|
-
}
|
|
6020
|
-
};
|
|
6021
|
-
tryCompile();
|
|
6022
|
-
return () => {
|
|
6023
|
-
cancelled = true;
|
|
6024
|
-
if (timer !== null) clearTimeout(timer);
|
|
6025
|
-
};
|
|
6026
|
-
}, []);
|
|
6027
|
-
return shader;
|
|
6028
|
-
};
|
|
6029
|
-
var ShockwaveContext = (0, import_react27.createContext)(null);
|
|
6030
|
-
var useShockwaveContext = () => {
|
|
6031
|
-
const ctx = (0, import_react27.useContext)(ShockwaveContext);
|
|
6032
|
-
if (!ctx) {
|
|
6033
|
-
throw new Error(
|
|
6034
|
-
"<Shockwave.Transition.From> / <Shockwave.Transition.To> must be rendered inside <Shockwave>"
|
|
6035
|
-
);
|
|
6036
|
-
}
|
|
6037
|
-
return ctx;
|
|
6038
|
-
};
|
|
6039
|
-
var OFFSCREEN_OFFSET = 1e5;
|
|
6040
|
-
var From = (0, import_react27.memo)(function From2({ children, style }) {
|
|
6041
|
-
const { fromRef, activeValue, isTransitioning } = useShockwaveContext();
|
|
6042
|
-
const isActive = activeValue === "from";
|
|
6043
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6044
|
-
import_react_native14.View,
|
|
6045
|
-
{
|
|
6046
|
-
ref: fromRef,
|
|
6047
|
-
collapsable: false,
|
|
6048
|
-
pointerEvents: isActive && !isTransitioning ? "auto" : "none",
|
|
6049
|
-
style: [
|
|
6050
|
-
import_react_native14.StyleSheet.absoluteFill,
|
|
6051
|
-
{
|
|
6052
|
-
zIndex: isActive ? 2 : 1,
|
|
6053
|
-
transform: [{ translateX: isActive ? 0 : OFFSCREEN_OFFSET }]
|
|
6054
|
-
},
|
|
6055
|
-
style
|
|
6056
|
-
],
|
|
6057
|
-
children
|
|
6058
|
-
}
|
|
6059
|
-
);
|
|
6060
|
-
});
|
|
6061
|
-
var To = (0, import_react27.memo)(function To2({ children, style }) {
|
|
6062
|
-
const { toRef, activeValue, isTransitioning } = useShockwaveContext();
|
|
6063
|
-
const isActive = activeValue === "to";
|
|
6064
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6065
|
-
import_react_native14.View,
|
|
6066
|
-
{
|
|
6067
|
-
ref: toRef,
|
|
6068
|
-
collapsable: false,
|
|
6069
|
-
pointerEvents: isActive && !isTransitioning ? "auto" : "none",
|
|
6070
|
-
style: [
|
|
6071
|
-
import_react_native14.StyleSheet.absoluteFill,
|
|
6072
|
-
{
|
|
6073
|
-
zIndex: isActive ? 2 : 1,
|
|
6074
|
-
transform: [{ translateX: isActive ? 0 : OFFSCREEN_OFFSET }]
|
|
6075
|
-
},
|
|
6076
|
-
style
|
|
6077
|
-
],
|
|
6078
|
-
children
|
|
6079
|
-
}
|
|
6080
|
-
);
|
|
6081
|
-
});
|
|
6082
|
-
var Transition = { From, To };
|
|
6083
|
-
var ShockwaveRoot = (0, import_react27.memo)(function ShockwaveRoot2({
|
|
6084
|
-
value,
|
|
6085
|
-
width = SHOCKWAVE_DEFAULTS.WIDTH,
|
|
6086
|
-
height = SHOCKWAVE_DEFAULTS.HEIGHT,
|
|
6087
|
-
duration = SHOCKWAVE_DEFAULTS.DURATION,
|
|
6088
|
-
origin,
|
|
6089
|
-
shockStrength = SHOCKWAVE_DEFAULTS.SHOCK_STRENGTH,
|
|
6090
|
-
lensingSpread = SHOCKWAVE_DEFAULTS.LENSING_SPREAD,
|
|
6091
|
-
style,
|
|
6092
|
-
children,
|
|
6093
|
-
onTransitionEnd
|
|
6094
|
-
}) {
|
|
6095
|
-
const fromRef = (0, import_react27.useRef)(null);
|
|
6096
|
-
const toRef = (0, import_react27.useRef)(null);
|
|
6097
|
-
const prevValueRef = (0, import_react27.useRef)(value);
|
|
6098
|
-
const shader = useShockwaveShader();
|
|
6099
|
-
const [activeValue, setActiveValue] = (0, import_react27.useState)(value);
|
|
6100
|
-
const [snapshots, setSnapshots] = (0, import_react27.useState)(null);
|
|
6101
|
-
const progress = (0, import_react_native_reanimated11.useSharedValue)(0);
|
|
6102
|
-
const finishTransition = (0, import_react27.useCallback)(
|
|
6103
|
-
(next) => {
|
|
6104
|
-
setActiveValue(next);
|
|
6105
|
-
setSnapshots(null);
|
|
6106
|
-
onTransitionEnd?.(next);
|
|
6107
|
-
},
|
|
6108
|
-
[onTransitionEnd]
|
|
6109
|
-
);
|
|
6110
|
-
(0, import_react27.useEffect)(() => {
|
|
6111
|
-
if (value === prevValueRef.current) return;
|
|
6112
|
-
const prev = prevValueRef.current;
|
|
6113
|
-
const next = value;
|
|
6114
|
-
prevValueRef.current = value;
|
|
6115
|
-
let cancelled = false;
|
|
6116
|
-
void (async () => {
|
|
6117
|
-
const pair = await snapshotPair(
|
|
6118
|
-
fromRef,
|
|
6119
|
-
toRef,
|
|
6120
|
-
prev,
|
|
6121
|
-
next
|
|
6122
|
-
);
|
|
6123
|
-
if (cancelled) return;
|
|
6124
|
-
if (!pair) {
|
|
6125
|
-
setActiveValue(next);
|
|
6126
|
-
return;
|
|
6127
|
-
}
|
|
6128
|
-
setSnapshots(pair);
|
|
6129
|
-
progress.value = 0;
|
|
6130
|
-
progress.value = (0, import_react_native_reanimated11.withTiming)(
|
|
6131
|
-
1,
|
|
6132
|
-
{ duration, easing: import_react_native_reanimated11.Easing.linear },
|
|
6133
|
-
(done) => {
|
|
6134
|
-
if (done) (0, import_react_native_worklets.scheduleOnRN)(finishTransition, next);
|
|
6135
|
-
}
|
|
6136
|
-
);
|
|
6137
|
-
})();
|
|
6138
|
-
return () => {
|
|
6139
|
-
cancelled = true;
|
|
6140
|
-
};
|
|
6141
|
-
}, [value, duration, finishTransition, progress]);
|
|
6142
|
-
const ox = origin?.x ?? width / 2;
|
|
6143
|
-
const oy = origin?.y ?? height / 2;
|
|
6144
|
-
const uniforms = (0, import_react_native_reanimated11.useDerivedValue)(() => ({
|
|
6145
|
-
iResolution: [width, height],
|
|
6146
|
-
iTime: progress.value,
|
|
6147
|
-
iMouse: [ox, oy],
|
|
6148
|
-
uShockStrength: shockStrength,
|
|
6149
|
-
uLensingSpread: lensingSpread
|
|
6150
|
-
}));
|
|
6151
|
-
const ctxValue = (0, import_react27.useMemo)(
|
|
6152
|
-
() => ({
|
|
6153
|
-
fromRef,
|
|
6154
|
-
toRef,
|
|
6155
|
-
activeValue,
|
|
6156
|
-
isTransitioning: snapshots !== null
|
|
6157
|
-
}),
|
|
6158
|
-
[activeValue, snapshots]
|
|
6159
|
-
);
|
|
6160
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react_native14.View, { style: [styles.wrapper, { width, height }, style], children: [
|
|
6161
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ShockwaveContext.Provider, { value: ctxValue, children }),
|
|
6162
|
-
snapshots && shader ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6163
|
-
import_react_native_skia2.Canvas,
|
|
6164
|
-
{
|
|
6165
|
-
style: [import_react_native14.StyleSheet.absoluteFill, styles.canvasOverlay],
|
|
6166
|
-
pointerEvents: "none",
|
|
6167
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react_native_skia2.Fill, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react_native_skia2.Shader, { source: shader, uniforms, children: [
|
|
6168
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6169
|
-
import_react_native_skia2.ImageShader,
|
|
6170
|
-
{
|
|
6171
|
-
image: snapshots.from,
|
|
6172
|
-
fit: "cover",
|
|
6173
|
-
rect: { x: 0, y: 0, width, height }
|
|
6174
|
-
}
|
|
6175
|
-
),
|
|
6176
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6177
|
-
import_react_native_skia2.ImageShader,
|
|
6178
|
-
{
|
|
6179
|
-
image: snapshots.to,
|
|
6180
|
-
fit: "cover",
|
|
6181
|
-
rect: { x: 0, y: 0, width, height }
|
|
6182
|
-
}
|
|
6183
|
-
)
|
|
6184
|
-
] }) })
|
|
6185
|
-
}
|
|
6186
|
-
) : null
|
|
6187
|
-
] });
|
|
6188
|
-
});
|
|
6189
|
-
var styles = import_react_native14.StyleSheet.create({
|
|
6190
|
-
wrapper: {
|
|
6191
|
-
position: "relative",
|
|
6192
|
-
overflow: "hidden",
|
|
6193
|
-
backgroundColor: "transparent"
|
|
6194
|
-
},
|
|
6195
|
-
canvasOverlay: {
|
|
6196
|
-
zIndex: 3
|
|
6197
|
-
}
|
|
6198
|
-
});
|
|
6199
|
-
var Shockwave = Object.assign(ShockwaveRoot, { Transition });
|
|
6200
|
-
|
|
6201
5913
|
// src/patterns/StayCard/StayBrowseScreen.tsx
|
|
6202
|
-
var
|
|
5914
|
+
var import_react_native13 = require("react-native");
|
|
6203
5915
|
var import_tamagui75 = require("tamagui");
|
|
6204
5916
|
var import_lucide_icons4 = require("@tamagui/lucide-icons");
|
|
6205
|
-
var
|
|
5917
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
6206
5918
|
var DEFAULT_CATEGORIES = [
|
|
6207
5919
|
{ label: "Villa" },
|
|
6208
5920
|
{ label: "Hotel", active: true },
|
|
@@ -6217,13 +5929,13 @@ function StayBrowseScreen({
|
|
|
6217
5929
|
onFavorite,
|
|
6218
5930
|
backgroundColor = "#fafaf9"
|
|
6219
5931
|
}) {
|
|
6220
|
-
return /* @__PURE__ */ (0,
|
|
6221
|
-
/* @__PURE__ */ (0,
|
|
6222
|
-
/* @__PURE__ */ (0,
|
|
6223
|
-
/* @__PURE__ */ (0,
|
|
5932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_tamagui75.YStack, { flex: 1, backgroundColor, padding: 18, gap: 14, children: [
|
|
5933
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_tamagui75.YStack, { gap: 4, marginTop: 28, children: [
|
|
5934
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_tamagui75.SizableText, { size: "$2", color: "#737373", children: greeting }),
|
|
5935
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_tamagui75.H3, { color: "#0a0a0a", size: "$7", lineHeight: 28, children: headline })
|
|
6224
5936
|
] }),
|
|
6225
|
-
/* @__PURE__ */ (0,
|
|
6226
|
-
|
|
5937
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_tamagui75.XStack, { gap: 8, flexWrap: "wrap", children: categories.map((c) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5938
|
+
import_react_native13.View,
|
|
6227
5939
|
{
|
|
6228
5940
|
onTouchEnd: c.onPress,
|
|
6229
5941
|
style: {
|
|
@@ -6232,7 +5944,7 @@ function StayBrowseScreen({
|
|
|
6232
5944
|
borderRadius: 999,
|
|
6233
5945
|
backgroundColor: c.active ? "#d9f99d" : "#f4f4f5"
|
|
6234
5946
|
},
|
|
6235
|
-
children: /* @__PURE__ */ (0,
|
|
5947
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6236
5948
|
import_tamagui75.SizableText,
|
|
6237
5949
|
{
|
|
6238
5950
|
size: "$2",
|
|
@@ -6244,7 +5956,7 @@ function StayBrowseScreen({
|
|
|
6244
5956
|
},
|
|
6245
5957
|
c.label
|
|
6246
5958
|
)) }),
|
|
6247
|
-
/* @__PURE__ */ (0,
|
|
5959
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
6248
5960
|
import_tamagui75.YStack,
|
|
6249
5961
|
{
|
|
6250
5962
|
flex: 1,
|
|
@@ -6253,41 +5965,41 @@ function StayBrowseScreen({
|
|
|
6253
5965
|
backgroundColor: "#e7e5e4",
|
|
6254
5966
|
marginTop: 4,
|
|
6255
5967
|
children: [
|
|
6256
|
-
/* @__PURE__ */ (0,
|
|
6257
|
-
|
|
5968
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5969
|
+
import_react_native13.Image,
|
|
6258
5970
|
{
|
|
6259
5971
|
source: { uri: listing.image },
|
|
6260
5972
|
style: { width: "100%", height: "60%" },
|
|
6261
5973
|
resizeMode: "cover"
|
|
6262
5974
|
}
|
|
6263
5975
|
),
|
|
6264
|
-
/* @__PURE__ */ (0,
|
|
6265
|
-
/* @__PURE__ */ (0,
|
|
6266
|
-
/* @__PURE__ */ (0,
|
|
6267
|
-
/* @__PURE__ */ (0,
|
|
5976
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_tamagui75.YStack, { flex: 1, padding: 14, gap: 8, children: [
|
|
5977
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_tamagui75.XStack, { alignItems: "center", justifyContent: "space-between", children: [
|
|
5978
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_tamagui75.H4, { color: "#0a0a0a", size: "$5", children: listing.title }),
|
|
5979
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react_native13.View, { onTouchEnd: onFavorite, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_icons4.Heart, { size: 18, color: "#ef4444" }) })
|
|
6268
5980
|
] }),
|
|
6269
|
-
/* @__PURE__ */ (0,
|
|
6270
|
-
/* @__PURE__ */ (0,
|
|
6271
|
-
/* @__PURE__ */ (0,
|
|
5981
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_tamagui75.XStack, { alignItems: "center", gap: 4, children: [
|
|
5982
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_icons4.MapPin, { size: 12, color: "#737373" }),
|
|
5983
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_tamagui75.SizableText, { size: "$1", color: "#737373", children: listing.address })
|
|
6272
5984
|
] }),
|
|
6273
|
-
/* @__PURE__ */ (0,
|
|
6274
|
-
typeof listing.bed === "number" ? /* @__PURE__ */ (0,
|
|
6275
|
-
/* @__PURE__ */ (0,
|
|
6276
|
-
/* @__PURE__ */ (0,
|
|
5985
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_tamagui75.XStack, { gap: 14, marginTop: 6, children: [
|
|
5986
|
+
typeof listing.bed === "number" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_tamagui75.XStack, { alignItems: "center", gap: 4, children: [
|
|
5987
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_icons4.Bed, { size: 14, color: "#737373" }),
|
|
5988
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_tamagui75.SizableText, { size: "$1", color: "#525252", children: [
|
|
6277
5989
|
"Bed: ",
|
|
6278
5990
|
listing.bed
|
|
6279
5991
|
] })
|
|
6280
5992
|
] }) : null,
|
|
6281
|
-
typeof listing.bath === "number" ? /* @__PURE__ */ (0,
|
|
6282
|
-
/* @__PURE__ */ (0,
|
|
6283
|
-
/* @__PURE__ */ (0,
|
|
5993
|
+
typeof listing.bath === "number" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_tamagui75.XStack, { alignItems: "center", gap: 4, children: [
|
|
5994
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_icons4.Bath, { size: 14, color: "#737373" }),
|
|
5995
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_tamagui75.SizableText, { size: "$1", color: "#525252", children: [
|
|
6284
5996
|
"Bath: ",
|
|
6285
5997
|
listing.bath
|
|
6286
5998
|
] })
|
|
6287
5999
|
] }) : null,
|
|
6288
|
-
typeof listing.rating === "number" ? /* @__PURE__ */ (0,
|
|
6289
|
-
/* @__PURE__ */ (0,
|
|
6290
|
-
/* @__PURE__ */ (0,
|
|
6000
|
+
typeof listing.rating === "number" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_tamagui75.XStack, { alignItems: "center", gap: 4, children: [
|
|
6001
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_icons4.Star, { size: 14, color: "#f59e0b", fill: "#f59e0b" }),
|
|
6002
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_tamagui75.SizableText, { size: "$1", color: "#525252", children: listing.rating.toFixed(1) })
|
|
6291
6003
|
] }) : null
|
|
6292
6004
|
] })
|
|
6293
6005
|
] })
|
|
@@ -6298,10 +6010,10 @@ function StayBrowseScreen({
|
|
|
6298
6010
|
}
|
|
6299
6011
|
|
|
6300
6012
|
// src/patterns/StayCard/StayDetailScreen.tsx
|
|
6301
|
-
var
|
|
6013
|
+
var import_react_native14 = require("react-native");
|
|
6302
6014
|
var import_tamagui76 = require("tamagui");
|
|
6303
6015
|
var import_lucide_icons5 = require("@tamagui/lucide-icons");
|
|
6304
|
-
var
|
|
6016
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
6305
6017
|
var formatPrice = (n) => "$" + n.toLocaleString("en-US", { maximumFractionDigits: 0 });
|
|
6306
6018
|
var buildDefaultMetrics = (props) => {
|
|
6307
6019
|
const out = [];
|
|
@@ -6313,20 +6025,20 @@ var buildDefaultMetrics = (props) => {
|
|
|
6313
6025
|
} else if (typeof props.listing.bed === "number") {
|
|
6314
6026
|
out.push({
|
|
6315
6027
|
label: "Beds",
|
|
6316
|
-
icon: /* @__PURE__ */ (0,
|
|
6028
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_lucide_icons5.Bed, { size: 14, color: "#fafaf9" }),
|
|
6317
6029
|
value: props.listing.bed
|
|
6318
6030
|
});
|
|
6319
6031
|
}
|
|
6320
6032
|
if (typeof props.listing.bath === "number") {
|
|
6321
6033
|
out.push({
|
|
6322
6034
|
label: "Baths",
|
|
6323
|
-
icon: /* @__PURE__ */ (0,
|
|
6035
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_lucide_icons5.Bath, { size: 14, color: "#fafaf9" }),
|
|
6324
6036
|
value: props.listing.bath
|
|
6325
6037
|
});
|
|
6326
6038
|
}
|
|
6327
6039
|
out.push({
|
|
6328
6040
|
label: "Wifi",
|
|
6329
|
-
icon: /* @__PURE__ */ (0,
|
|
6041
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_lucide_icons5.Wifi, { size: 14, color: "#fafaf9" }),
|
|
6330
6042
|
value: "Fast"
|
|
6331
6043
|
});
|
|
6332
6044
|
return out;
|
|
@@ -6342,18 +6054,18 @@ function StayDetailScreen(props) {
|
|
|
6342
6054
|
ctaColor = "#f97316"
|
|
6343
6055
|
} = props;
|
|
6344
6056
|
const resolvedMetrics = metrics ?? buildDefaultMetrics(props);
|
|
6345
|
-
return /* @__PURE__ */ (0,
|
|
6346
|
-
/* @__PURE__ */ (0,
|
|
6347
|
-
/* @__PURE__ */ (0,
|
|
6348
|
-
|
|
6057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_tamagui76.YStack, { flex: 1, backgroundColor, children: [
|
|
6058
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_react_native14.View, { style: { position: "relative", height: "50%" }, children: [
|
|
6059
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6060
|
+
import_react_native14.Image,
|
|
6349
6061
|
{
|
|
6350
6062
|
source: { uri: listing.image },
|
|
6351
6063
|
style: { width: "100%", height: "100%" },
|
|
6352
6064
|
resizeMode: "cover"
|
|
6353
6065
|
}
|
|
6354
6066
|
),
|
|
6355
|
-
typeof listing.rating === "number" ? /* @__PURE__ */ (0,
|
|
6356
|
-
|
|
6067
|
+
typeof listing.rating === "number" ? /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
6068
|
+
import_react_native14.View,
|
|
6357
6069
|
{
|
|
6358
6070
|
style: {
|
|
6359
6071
|
position: "absolute",
|
|
@@ -6368,30 +6080,30 @@ function StayDetailScreen(props) {
|
|
|
6368
6080
|
gap: 4
|
|
6369
6081
|
},
|
|
6370
6082
|
children: [
|
|
6371
|
-
/* @__PURE__ */ (0,
|
|
6372
|
-
/* @__PURE__ */ (0,
|
|
6083
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_lucide_icons5.Star, { size: 12, color: "#f59e0b", fill: "#f59e0b" }),
|
|
6084
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_tamagui76.SizableText, { size: "$1", color: "#0a0a0a", fontWeight: "700", children: listing.rating.toFixed(1) })
|
|
6373
6085
|
]
|
|
6374
6086
|
}
|
|
6375
6087
|
) : null
|
|
6376
6088
|
] }),
|
|
6377
|
-
/* @__PURE__ */ (0,
|
|
6378
|
-
/* @__PURE__ */ (0,
|
|
6379
|
-
typeof listing.pricePerNight === "number" ? /* @__PURE__ */ (0,
|
|
6089
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_tamagui76.YStack, { flex: 1, padding: 18, gap: 10, children: [
|
|
6090
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_tamagui76.SizableText, { size: "$2", color: "#a3a3a3", children: eyebrow }),
|
|
6091
|
+
typeof listing.pricePerNight === "number" ? /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_tamagui76.H3, { color: "#fafaf9", size: "$7", children: [
|
|
6380
6092
|
formatPrice(listing.pricePerNight),
|
|
6381
6093
|
"/night"
|
|
6382
|
-
] }) : /* @__PURE__ */ (0,
|
|
6383
|
-
/* @__PURE__ */ (0,
|
|
6094
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_tamagui76.H3, { color: "#fafaf9", size: "$7", children: listing.title }),
|
|
6095
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_tamagui76.SizableText, { size: "$2", color: "#a3a3a3", children: [
|
|
6384
6096
|
listing.ownerName ? listing.ownerName + " \xB7 " : "",
|
|
6385
6097
|
listing.address
|
|
6386
6098
|
] }),
|
|
6387
|
-
/* @__PURE__ */ (0,
|
|
6388
|
-
/* @__PURE__ */ (0,
|
|
6389
|
-
m.icon ? /* @__PURE__ */ (0,
|
|
6099
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_tamagui76.XStack, { gap: 20, marginTop: 6, children: resolvedMetrics.map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_tamagui76.YStack, { gap: 2, children: [
|
|
6100
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_tamagui76.SizableText, { size: "$1", color: "#737373", children: m.label }),
|
|
6101
|
+
m.icon ? /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_tamagui76.XStack, { alignItems: "center", gap: 4, children: [
|
|
6390
6102
|
m.icon,
|
|
6391
|
-
/* @__PURE__ */ (0,
|
|
6392
|
-
] }) : /* @__PURE__ */ (0,
|
|
6103
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_tamagui76.SizableText, { size: "$3", color: "#fafaf9", fontWeight: "600", children: m.value })
|
|
6104
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_tamagui76.SizableText, { size: "$3", color: "#fafaf9", fontWeight: "600", children: m.value })
|
|
6393
6105
|
] }, i)) }),
|
|
6394
|
-
/* @__PURE__ */ (0,
|
|
6106
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6395
6107
|
import_tamagui76.YStack,
|
|
6396
6108
|
{
|
|
6397
6109
|
marginTop: "auto",
|
|
@@ -6400,7 +6112,7 @@ function StayDetailScreen(props) {
|
|
|
6400
6112
|
backgroundColor: ctaColor,
|
|
6401
6113
|
alignItems: "center",
|
|
6402
6114
|
onPress: onReserve,
|
|
6403
|
-
children: /* @__PURE__ */ (0,
|
|
6115
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_tamagui76.SizableText, { size: "$3", color: "#fff", fontWeight: "700", children: ctaLabel })
|
|
6404
6116
|
}
|
|
6405
6117
|
)
|
|
6406
6118
|
] })
|
|
@@ -6529,7 +6241,6 @@ function StayDetailScreen(props) {
|
|
|
6529
6241
|
Separator,
|
|
6530
6242
|
SettingsScreen,
|
|
6531
6243
|
Sheet,
|
|
6532
|
-
Shockwave,
|
|
6533
6244
|
SizableStack,
|
|
6534
6245
|
SizableText,
|
|
6535
6246
|
Skeleton,
|