@otfdashkit/ui-native 0.1.1 → 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.mjs CHANGED
@@ -186,13 +186,13 @@ function getOtfDesignTheme(themeId) {
186
186
 
187
187
  // src/index.ts
188
188
  import {
189
- View as View12,
189
+ View as View14,
190
190
  Stack,
191
191
  SizableStack,
192
192
  ThemeableStack,
193
193
  Frame,
194
- XStack as XStack50,
195
- YStack as YStack56,
194
+ XStack as XStack52,
195
+ YStack as YStack58,
196
196
  ZStack,
197
197
  ScrollView as ScrollView7,
198
198
  Circle as Circle13,
@@ -210,13 +210,13 @@ import {
210
210
  Aside,
211
211
  H1 as H12,
212
212
  H2 as H22,
213
- H3 as H32,
214
- H4 as H42,
213
+ H3 as H34,
214
+ H4 as H43,
215
215
  H5 as H52,
216
216
  H6 as H62,
217
217
  Heading,
218
218
  Paragraph,
219
- SizableText as SizableText55,
219
+ SizableText as SizableText57,
220
220
  Text as Text2,
221
221
  Label,
222
222
  Button as Button13,
@@ -232,7 +232,7 @@ import {
232
232
  Card as Card2,
233
233
  Avatar as Avatar2,
234
234
  Separator as Separator7,
235
- Image as Image9,
235
+ Image as Image11,
236
236
  Progress,
237
237
  Spinner as Spinner2,
238
238
  ListItem as ListItem2,
@@ -5881,6 +5881,221 @@ function useCollapsibleHeader(opts = {}) {
5881
5881
  });
5882
5882
  return { scrollHandler, headerStyle, titleStyle, scrollY };
5883
5883
  }
5884
+
5885
+ // src/patterns/StayCard/StayBrowseScreen.tsx
5886
+ import { Image as Image9, View as View12 } from "react-native";
5887
+ import {
5888
+ YStack as YStack56,
5889
+ XStack as XStack50,
5890
+ H3 as H32,
5891
+ H4 as H42,
5892
+ SizableText as SizableText55
5893
+ } from "tamagui";
5894
+ import { Bed, Bath, Heart, MapPin, Star } from "@tamagui/lucide-icons";
5895
+ import { jsx as jsx69, jsxs as jsxs58 } from "react/jsx-runtime";
5896
+ var DEFAULT_CATEGORIES = [
5897
+ { label: "Villa" },
5898
+ { label: "Hotel", active: true },
5899
+ { label: "Apartment" },
5900
+ { label: "Campsite" }
5901
+ ];
5902
+ function StayBrowseScreen({
5903
+ greeting = "Good morning",
5904
+ headline = "Unlock Your\nPerfect Stay Today!",
5905
+ categories = DEFAULT_CATEGORIES,
5906
+ listing,
5907
+ onFavorite,
5908
+ backgroundColor = "#fafaf9"
5909
+ }) {
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 })
5914
+ ] }),
5915
+ /* @__PURE__ */ jsx69(XStack50, { gap: 8, flexWrap: "wrap", children: categories.map((c) => /* @__PURE__ */ jsx69(
5916
+ View12,
5917
+ {
5918
+ onTouchEnd: c.onPress,
5919
+ style: {
5920
+ paddingHorizontal: 12,
5921
+ paddingVertical: 6,
5922
+ borderRadius: 999,
5923
+ backgroundColor: c.active ? "#d9f99d" : "#f4f4f5"
5924
+ },
5925
+ children: /* @__PURE__ */ jsx69(
5926
+ SizableText55,
5927
+ {
5928
+ size: "$2",
5929
+ color: c.active ? "#365314" : "#52525b",
5930
+ fontWeight: "600",
5931
+ children: c.label
5932
+ }
5933
+ )
5934
+ },
5935
+ c.label
5936
+ )) }),
5937
+ /* @__PURE__ */ jsxs58(
5938
+ YStack56,
5939
+ {
5940
+ flex: 1,
5941
+ borderRadius: 20,
5942
+ overflow: "hidden",
5943
+ backgroundColor: "#e7e5e4",
5944
+ marginTop: 4,
5945
+ children: [
5946
+ /* @__PURE__ */ jsx69(
5947
+ Image9,
5948
+ {
5949
+ source: { uri: listing.image },
5950
+ style: { width: "100%", height: "60%" },
5951
+ resizeMode: "cover"
5952
+ }
5953
+ ),
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" }) })
5958
+ ] }),
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 })
5962
+ ] }),
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: [
5967
+ "Bed: ",
5968
+ listing.bed
5969
+ ] })
5970
+ ] }) : null,
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: [
5974
+ "Bath: ",
5975
+ listing.bath
5976
+ ] })
5977
+ ] }) : null,
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) })
5981
+ ] }) : null
5982
+ ] })
5983
+ ] })
5984
+ ]
5985
+ }
5986
+ )
5987
+ ] });
5988
+ }
5989
+
5990
+ // src/patterns/StayCard/StayDetailScreen.tsx
5991
+ import { Image as Image10, View as View13 } from "react-native";
5992
+ import { YStack as YStack57, XStack as XStack51, H3 as H33, SizableText as SizableText56 } from "tamagui";
5993
+ import { Bed as Bed2, Bath as Bath2, Star as Star2, Wifi } from "@tamagui/lucide-icons";
5994
+ import { jsx as jsx70, jsxs as jsxs59 } from "react/jsx-runtime";
5995
+ var formatPrice = (n) => "$" + n.toLocaleString("en-US", { maximumFractionDigits: 0 });
5996
+ var buildDefaultMetrics = (props) => {
5997
+ const out = [];
5998
+ if (typeof props.listing.sqft === "number") {
5999
+ out.push({
6000
+ label: "Living",
6001
+ value: `${props.listing.sqft} sqft`
6002
+ });
6003
+ } else if (typeof props.listing.bed === "number") {
6004
+ out.push({
6005
+ label: "Beds",
6006
+ icon: /* @__PURE__ */ jsx70(Bed2, { size: 14, color: "#fafaf9" }),
6007
+ value: props.listing.bed
6008
+ });
6009
+ }
6010
+ if (typeof props.listing.bath === "number") {
6011
+ out.push({
6012
+ label: "Baths",
6013
+ icon: /* @__PURE__ */ jsx70(Bath2, { size: 14, color: "#fafaf9" }),
6014
+ value: props.listing.bath
6015
+ });
6016
+ }
6017
+ out.push({
6018
+ label: "Wifi",
6019
+ icon: /* @__PURE__ */ jsx70(Wifi, { size: 14, color: "#fafaf9" }),
6020
+ value: "Fast"
6021
+ });
6022
+ return out;
6023
+ };
6024
+ function StayDetailScreen(props) {
6025
+ const {
6026
+ listing,
6027
+ metrics,
6028
+ eyebrow = "BOOKING DETAILS",
6029
+ ctaLabel = "Reserve now",
6030
+ onReserve,
6031
+ backgroundColor = "#0a0a0a",
6032
+ ctaColor = "#f97316"
6033
+ } = props;
6034
+ const resolvedMetrics = metrics ?? buildDefaultMetrics(props);
6035
+ return /* @__PURE__ */ jsxs59(YStack57, { flex: 1, backgroundColor, children: [
6036
+ /* @__PURE__ */ jsxs59(View13, { style: { position: "relative", height: "50%" }, children: [
6037
+ /* @__PURE__ */ jsx70(
6038
+ Image10,
6039
+ {
6040
+ source: { uri: listing.image },
6041
+ style: { width: "100%", height: "100%" },
6042
+ resizeMode: "cover"
6043
+ }
6044
+ ),
6045
+ typeof listing.rating === "number" ? /* @__PURE__ */ jsxs59(
6046
+ View13,
6047
+ {
6048
+ style: {
6049
+ position: "absolute",
6050
+ top: 36,
6051
+ right: 18,
6052
+ backgroundColor: "rgba(255,255,255,0.92)",
6053
+ paddingHorizontal: 10,
6054
+ paddingVertical: 6,
6055
+ borderRadius: 999,
6056
+ flexDirection: "row",
6057
+ alignItems: "center",
6058
+ gap: 4
6059
+ },
6060
+ children: [
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) })
6063
+ ]
6064
+ }
6065
+ ) : null
6066
+ ] }),
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: [
6070
+ formatPrice(listing.pricePerNight),
6071
+ "/night"
6072
+ ] }) : /* @__PURE__ */ jsx70(H33, { color: "#fafaf9", size: "$7", children: listing.title }),
6073
+ /* @__PURE__ */ jsxs59(SizableText56, { size: "$2", color: "#a3a3a3", children: [
6074
+ listing.ownerName ? listing.ownerName + " \xB7 " : "",
6075
+ listing.address
6076
+ ] }),
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: [
6080
+ m.icon,
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 })
6083
+ ] }, i)) }),
6084
+ /* @__PURE__ */ jsx70(
6085
+ YStack57,
6086
+ {
6087
+ marginTop: "auto",
6088
+ padding: 14,
6089
+ borderRadius: 14,
6090
+ backgroundColor: ctaColor,
6091
+ alignItems: "center",
6092
+ onPress: onReserve,
6093
+ children: /* @__PURE__ */ jsx70(SizableText56, { size: "$3", color: "#fff", fontWeight: "700", children: ctaLabel })
6094
+ }
6095
+ )
6096
+ ] })
6097
+ ] });
6098
+ }
5884
6099
  export {
5885
6100
  Accordion,
5886
6101
  ActionSheet,
@@ -5933,8 +6148,8 @@ export {
5933
6148
  Group,
5934
6149
  H12 as H1,
5935
6150
  H22 as H2,
5936
- H32 as H3,
5937
- H42 as H4,
6151
+ H34 as H3,
6152
+ H43 as H4,
5938
6153
  H52 as H5,
5939
6154
  H62 as H6,
5940
6155
  Header,
@@ -6004,7 +6219,7 @@ export {
6004
6219
  SettingsScreen,
6005
6220
  Sheet5 as Sheet,
6006
6221
  SizableStack,
6007
- SizableText55 as SizableText,
6222
+ SizableText57 as SizableText,
6008
6223
  Skeleton,
6009
6224
  Slider2 as Slider,
6010
6225
  Spacer,
@@ -6012,6 +6227,8 @@ export {
6012
6227
  Square,
6013
6228
  Stack,
6014
6229
  StatusBadge,
6230
+ StayBrowseScreen,
6231
+ StayDetailScreen,
6015
6232
  Step,
6016
6233
  StepPageLayout,
6017
6234
  SubHeading,
@@ -6020,7 +6237,7 @@ export {
6020
6237
  Switch4 as Switch,
6021
6238
  TabBar,
6022
6239
  Tabs,
6023
- Image9 as TamaguiImage,
6240
+ Image11 as TamaguiImage,
6024
6241
  ListItem2 as TamaguiListItem,
6025
6242
  TamaguiProvider,
6026
6243
  TestimonialCard2 as TestimonialCard,
@@ -6033,13 +6250,13 @@ export {
6033
6250
  TooltipSimple,
6034
6251
  Unspaced,
6035
6252
  UserPreferences,
6036
- View12 as View,
6253
+ View14 as View,
6037
6254
  VisuallyHidden,
6038
6255
  WheelPicker,
6039
6256
  XGroup,
6040
- XStack50 as XStack,
6257
+ XStack52 as XStack,
6041
6258
  YGroup,
6042
- YStack56 as YStack,
6259
+ YStack58 as YStack,
6043
6260
  ZStack,
6044
6261
  addTheme,
6045
6262
  composeEventHandlers,