@adminide-stack/yantra-mobile 12.0.54-alpha.8 → 12.0.55-alpha.0

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.
Files changed (64) hide show
  1. package/lib/components/CustomDrawer.js +230 -168
  2. package/lib/components/CustomDrawer.js.map +1 -1
  3. package/lib/components/NavigationHeader/HeaderMoreMenu.js +15 -5
  4. package/lib/components/NavigationHeader/HeaderMoreMenu.js.map +1 -1
  5. package/lib/components/NavigationHeader/HeaderSettingsMenu.js +2 -2
  6. package/lib/components/NavigationHeader/HeaderSettingsMenu.js.map +1 -1
  7. package/lib/components/NavigationHeader/HeaderSkillsButton.js +5 -2
  8. package/lib/components/NavigationHeader/HeaderSkillsButton.js.map +1 -1
  9. package/lib/components/NavigationHeader/HeaderTasksButton.js +4 -1
  10. package/lib/components/NavigationHeader/HeaderTasksButton.js.map +1 -1
  11. package/lib/components/NavigationHeader/HeaderToolbarButton.js +4 -1
  12. package/lib/components/NavigationHeader/HeaderToolbarButton.js.map +1 -1
  13. package/lib/components/NavigationHeader/NavigationHeader.js +5 -5
  14. package/lib/components/NavigationHeader/NavigationHeader.js.map +1 -1
  15. package/lib/components/ProfileAvatar.js +44 -0
  16. package/lib/components/ProfileAvatar.js.map +1 -0
  17. package/lib/compute.js +109 -7
  18. package/lib/compute.js.map +1 -1
  19. package/lib/features/agent-chat/NativeAgentChat.js +46 -7
  20. package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
  21. package/lib/features/apps/AppsCatalog.js +10 -0
  22. package/lib/features/apps/AppsCatalog.js.map +1 -1
  23. package/lib/features/apps/mobileAppCatalog.js +7 -0
  24. package/lib/features/apps/mobileAppCatalog.js.map +1 -1
  25. package/lib/features/travel/nativeTravelRegistry.js +15 -0
  26. package/lib/features/travel/nativeTravelRegistry.js.map +1 -0
  27. package/lib/graphql/typePolicies.js +35 -1
  28. package/lib/graphql/typePolicies.js.map +1 -1
  29. package/lib/hooks/useAccountDefaultSettings.js +2 -0
  30. package/lib/hooks/useAccountDefaultSettings.js.map +1 -1
  31. package/lib/hooks/usePrerequisiteIds.js +4 -1
  32. package/lib/hooks/usePrerequisiteIds.js.map +1 -1
  33. package/lib/index.js +1 -1
  34. package/lib/index.js.map +1 -1
  35. package/lib/routes.json +113 -3
  36. package/lib/screens/Account/index.js +393 -0
  37. package/lib/screens/Account/index.js.map +1 -0
  38. package/lib/screens/Account/splitDisplayName.js +15 -0
  39. package/lib/screens/Account/splitDisplayName.js.map +1 -0
  40. package/lib/screens/CanvasBoard/index.js +6 -1
  41. package/lib/screens/CanvasBoard/index.js.map +1 -1
  42. package/lib/screens/Chat/index.js +4 -3
  43. package/lib/screens/Chat/index.js.map +1 -1
  44. package/lib/screens/Home/HomeScreen.js +39 -21
  45. package/lib/screens/Home/HomeScreen.js.map +1 -1
  46. package/lib/screens/Home/components/HomeSuggestions.js +1 -1
  47. package/lib/screens/Home/components/HomeSuggestions.js.map +1 -1
  48. package/lib/screens/ShoppingNative/index.js +3 -1
  49. package/lib/screens/ShoppingNative/index.js.map +1 -1
  50. package/lib/screens/TravelNative/index.js +70 -0
  51. package/lib/screens/TravelNative/index.js.map +1 -0
  52. package/lib/screens/TravelNative/useTravelHostChat.js +66 -0
  53. package/lib/screens/TravelNative/useTravelHostChat.js.map +1 -0
  54. package/lib/theme/AppThemeProvider.js +74 -0
  55. package/lib/theme/AppThemeProvider.js.map +1 -0
  56. package/lib/theme/appTheme.js +9 -0
  57. package/lib/theme/appTheme.js.map +1 -0
  58. package/lib/theme/mobileTokens.js +52 -13
  59. package/lib/theme/mobileTokens.js.map +1 -1
  60. package/lib/utils/authUserDisplay.js +27 -9
  61. package/lib/utils/authUserDisplay.js.map +1 -1
  62. package/lib/utils/drawerNavigation.js +42 -0
  63. package/lib/utils/drawerNavigation.js.map +1 -0
  64. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useState,useMemo,useCallback,useEffect}from'react';import {StyleSheet,View,Image,Pressable,ActivityIndicator}from'react-native';import {DrawerContentScrollView}from'@react-navigation/drawer';import {Ionicons}from'@expo/vector-icons';import {Text}from'@admin-layout/gluestack-ui-mobile';import {useRoute,CommonActions}from'@react-navigation/native';import {useSafeAreaInsets,SafeAreaView}from'react-native-safe-area-context';import {useDispatch,useSelector}from'react-redux';import {userSelector,logoutAndRedirect}from'@adminide-stack/user-auth0-client';import {useAccountProfileQuery}from'common/graphql';import {mobileTokens}from'../theme/mobileTokens.js';import {pickAuthEmail,pickPrimaryDisplayName,pickAuthPicture,getInitials}from'../utils/authUserDisplay.js';var __defProp = Object.defineProperty;
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useState,useMemo,useCallback,useEffect}from'react';import {StyleSheet,View,Image,Pressable,ActivityIndicator}from'react-native';import {DrawerContentScrollView}from'@react-navigation/drawer';import {Ionicons}from'@expo/vector-icons';import {Text}from'@admin-layout/gluestack-ui-mobile';import {useRoute,CommonActions}from'@react-navigation/native';import {afterNativeModalClose}from'../utils/drawerNavigation.js';import {useSafeAreaInsets,SafeAreaView}from'react-native-safe-area-context';import {useDispatch,useSelector}from'react-redux';import {userSelector,logoutAndRedirect}from'@adminide-stack/user-auth0-client';import {useAccountProfileQuery}from'common/graphql';import {mobileTokens,mobileColors}from'../theme/mobileTokens.js';import {useAppTheme}from'../theme/AppThemeProvider.js';import {pickAuthEmail,pickPrimaryDisplayName,pickProfilePhotoUrl}from'../utils/authUserDisplay.js';import {ProfileAvatar}from'./ProfileAvatar.js';var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -18,15 +18,22 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  const APP_ICON = require("../assets/icon.png");
21
- const PALETTE = {
22
- bg: mobileTokens.color.bg,
23
- surface: mobileTokens.color.surface,
24
- border: mobileTokens.color.border,
25
- text: mobileTokens.color.text,
26
- textSecondary: mobileTokens.color.textMuted,
27
- icon: "#334155",
28
- rowHighlight: mobileTokens.color.primarySoft
29
- };
21
+ function drawerPalette(isDark) {
22
+ const color = mobileColors(isDark);
23
+ return {
24
+ bg: color.bg,
25
+ surface: color.surface,
26
+ border: color.border,
27
+ text: color.text,
28
+ textSecondary: color.textMuted,
29
+ icon: isDark ? "#cbd5e1" : "#334155",
30
+ rowHighlight: isDark ? "rgba(148,163,184,0.12)" : color.primarySoft,
31
+ focusedText: isDark ? "#f8fafc" : color.primary,
32
+ chevron: isDark ? "#64748b" : "#c4c4c4",
33
+ surfaceMuted: color.surfaceMuted,
34
+ primaryBorder: color.primaryBorder
35
+ };
36
+ }
30
37
  function routeLabel(descriptor, route) {
31
38
  var _a, _b, _c;
32
39
  const optLabel = (_a = descriptor == null ? void 0 : descriptor.options) == null ? void 0 : _a.drawerLabel;
@@ -42,7 +49,7 @@ function isVisibleDrawerRoute(route, descriptor) {
42
49
  if (routeName.includes("WebBuilder") || routeName.toLowerCase().includes("webbuilder")) {
43
50
  return false;
44
51
  }
45
- if (/ChatHistory/i.test(routeName) || /CanvasNative/i.test(routeName) || /(^|\.)Apps$/i.test(routeName)) {
52
+ if (/ChatHistory/i.test(routeName) || /CanvasNative/i.test(routeName) || /(^|\.)Apps$/i.test(routeName) || /(^|\.)Account$/i.test(routeName)) {
46
53
  return false;
47
54
  }
48
55
  const itemStyle = (_b = descriptor == null ? void 0 : descriptor.options) == null ? void 0 : _b.drawerItemStyle;
@@ -70,23 +77,64 @@ function DrawerListRow({
70
77
  focused,
71
78
  onPress,
72
79
  showDivider,
73
- iconNode
80
+ iconNode,
81
+ palette
74
82
  }) {
75
83
  return /* @__PURE__ */ jsxs(Fragment, { children: [
76
84
  /* @__PURE__ */ jsxs(Pressable, { accessibilityRole: "button", accessibilityState: {
77
85
  selected: Boolean(focused)
78
86
  }, onPress, style: ({
79
87
  pressed
80
- }) => [styles.listRow, focused ? styles.listRowFocused : null, pressed && styles.listRowPressed], children: [
81
- iconNode != null ? iconNode : /* @__PURE__ */ jsx(Ionicons, { name: icon != null ? icon : "ellipse-outline", size: 22, color: focused ? PALETTE.text : PALETTE.icon }),
82
- /* @__PURE__ */ jsx(Text, { style: [styles.listLabel, focused && styles.listLabelFocused], children: label }),
83
- /* @__PURE__ */ jsx(Ionicons, { name: "chevron-forward", size: 16, color: "#c4c4c4", style: styles.navChevron })
88
+ }) => [styles.listRow, {
89
+ backgroundColor: focused || pressed ? palette.rowHighlight : palette.surface
90
+ }], children: [
91
+ iconNode != null ? iconNode : /* @__PURE__ */ jsx(Ionicons, { name: icon != null ? icon : "ellipse-outline", size: 22, color: focused ? palette.focusedText : palette.icon }),
92
+ /* @__PURE__ */ jsx(Text, { style: [styles.listLabel, {
93
+ color: focused ? palette.focusedText : palette.text
94
+ }, focused && styles.listLabelFocused], children: label }),
95
+ /* @__PURE__ */ jsx(Ionicons, { name: "chevron-forward", size: 16, color: palette.chevron, style: styles.navChevron })
84
96
  ] }),
85
- showDivider ? /* @__PURE__ */ jsx(View, { style: styles.rowDivider }) : null
97
+ showDivider ? /* @__PURE__ */ jsx(View, { style: [styles.rowDivider, {
98
+ backgroundColor: palette.border
99
+ }] }) : null
100
+ ] });
101
+ }
102
+ function DrawerAppearanceRow({
103
+ isDark,
104
+ onChange,
105
+ palette
106
+ }) {
107
+ return /* @__PURE__ */ jsxs(View, { accessibilityRole: "adjustable", accessibilityLabel: "Appearance", style: [styles.listRow, styles.appearanceRow, {
108
+ backgroundColor: palette.surface,
109
+ borderColor: palette.border
110
+ }], children: [
111
+ /* @__PURE__ */ jsx(Ionicons, { name: "contrast-outline", size: 20, color: palette.icon }),
112
+ /* @__PURE__ */ jsx(Text, { style: [styles.listLabel, {
113
+ color: palette.text
114
+ }], children: "Appearance" }),
115
+ /* @__PURE__ */ jsxs(View, { style: [styles.appearanceToggle, {
116
+ backgroundColor: palette.surfaceMuted,
117
+ borderColor: palette.border
118
+ }], children: [
119
+ /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: "Light", accessibilityState: {
120
+ selected: !isDark
121
+ }, onPress: () => onChange(false), style: [styles.appearanceToggleBtn, !isDark && {
122
+ backgroundColor: palette.rowHighlight,
123
+ borderColor: palette.primaryBorder
124
+ }], hitSlop: 4, children: /* @__PURE__ */ jsx(Ionicons, { name: !isDark ? "sunny" : "sunny-outline", size: 16, color: !isDark ? palette.focusedText : palette.icon }) }),
125
+ /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: "Dark", accessibilityState: {
126
+ selected: isDark
127
+ }, onPress: () => onChange(true), style: [styles.appearanceToggleBtn, isDark && {
128
+ backgroundColor: palette.rowHighlight,
129
+ borderColor: palette.primaryBorder
130
+ }], hitSlop: 4, children: /* @__PURE__ */ jsx(Ionicons, { name: isDark ? "moon" : "moon-outline", size: 16, color: isDark ? palette.focusedText : palette.icon }) })
131
+ ] })
86
132
  ] });
87
133
  }
88
134
  function DrawerProfileHeader({
89
- isAuthenticated
135
+ isAuthenticated,
136
+ onPress,
137
+ palette
90
138
  }) {
91
139
  var _a;
92
140
  const authUser = useSelector(userSelector);
@@ -98,30 +146,30 @@ function DrawerProfileHeader({
98
146
  skip: !isAuthenticated
99
147
  });
100
148
  const photoUrl = useMemo(() => {
101
- var _a2, _b, _c;
102
- const fromProfile = (_c = (_b = (_a2 = profileData == null ? void 0 : profileData.accountProfile) == null ? void 0 : _a2.photos) == null ? void 0 : _b.find((p) => p == null ? void 0 : p.url)) == null ? void 0 : _c.url;
103
- if (fromProfile) return fromProfile;
104
- return pickAuthPicture(authUser);
149
+ var _a2;
150
+ return pickProfilePhotoUrl((_a2 = profileData == null ? void 0 : profileData.accountProfile) == null ? void 0 : _a2.photos, authUser);
105
151
  }, [(_a = profileData == null ? void 0 : profileData.accountProfile) == null ? void 0 : _a.photos, authUser]);
106
152
  const displayName = useMemo(() => pickPrimaryDisplayName(authUser), [authUser]);
107
153
  const email = useMemo(() => pickAuthEmail(authUser), [authUser]);
108
- const subtitle = useMemo(() => {
109
- var _a2, _b, _c;
110
- const u = authUser;
111
- const nick = ((_c = (_b = (_a2 = u == null ? void 0 : u.profile) == null ? void 0 : _a2.nickname) != null ? _b : u == null ? void 0 : u.nickname) != null ? _c : "").trim();
112
- if (!nick || nick === displayName.trim()) return null;
113
- return `@${nick.replace(/^@/, "")}`;
114
- }, [authUser, displayName]);
115
154
  if (!isAuthenticated) return null;
116
- return /* @__PURE__ */ jsx(View, { style: styles.profileCard, children: /* @__PURE__ */ jsxs(View, { style: styles.profileCardInner, children: [
117
- /* @__PURE__ */ jsx(View, { style: styles.avatarOuter, children: photoUrl ? /* @__PURE__ */ jsx(Image, { source: {
118
- uri: photoUrl
119
- }, style: styles.avatarImage, resizeMode: "cover" }) : /* @__PURE__ */ jsx(View, { style: styles.avatarPlaceholder, children: /* @__PURE__ */ jsx(Text, { style: styles.avatarInitials, children: getInitials(displayName) }) }) }),
155
+ return /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: "Account", onPress, style: ({
156
+ pressed
157
+ }) => [styles.profileCard, {
158
+ backgroundColor: palette.surface,
159
+ borderColor: palette.border
160
+ }, pressed && {
161
+ backgroundColor: palette.rowHighlight
162
+ }], children: /* @__PURE__ */ jsxs(View, { style: styles.profileCardInner, children: [
163
+ /* @__PURE__ */ jsx(ProfileAvatar, { uri: photoUrl, name: displayName, size: 44 }),
120
164
  /* @__PURE__ */ jsxs(View, { style: styles.profileMeta, children: [
121
- /* @__PURE__ */ jsx(Text, { style: styles.profileName, numberOfLines: 2, children: displayName }),
122
- subtitle ? /* @__PURE__ */ jsx(Text, { style: styles.profileUsername, numberOfLines: 1, children: subtitle }) : null,
123
- email ? /* @__PURE__ */ jsx(Text, { style: styles.profileEmail, numberOfLines: 1, children: email }) : null
124
- ] })
165
+ /* @__PURE__ */ jsx(Text, { style: [styles.profileName, {
166
+ color: palette.text
167
+ }], numberOfLines: 1, children: displayName }),
168
+ email ? /* @__PURE__ */ jsx(Text, { style: [styles.profileEmail, {
169
+ color: palette.textSecondary
170
+ }], numberOfLines: 1, children: email }) : null
171
+ ] }),
172
+ /* @__PURE__ */ jsx(Ionicons, { name: "chevron-forward", size: 18, color: palette.chevron })
125
173
  ] }) });
126
174
  }
127
175
  function CustomDrawer(props) {
@@ -137,6 +185,11 @@ function CustomDrawer(props) {
137
185
  const route = useRoute();
138
186
  const insets = useSafeAreaInsets();
139
187
  const [isLoggingOut, setIsLoggingOut] = useState(false);
188
+ const {
189
+ isDark,
190
+ setDarkMode
191
+ } = useAppTheme();
192
+ const palette = useMemo(() => drawerPalette(isDark), [isDark]);
140
193
  const orgName = useMemo(() => pickFocusedOrgName(state, route), [state, route]);
141
194
  const focusedRouteName = String((_c = (_b = (_a = state == null ? void 0 : state.routes) == null ? void 0 : _a[state == null ? void 0 : state.index]) == null ? void 0 : _b.name) != null ? _c : "");
142
195
  const historyFocused = /ChatHistory/i.test(focusedRouteName);
@@ -178,48 +231,79 @@ function CustomDrawer(props) {
178
231
  }
179
232
  }, [navigation]);
180
233
  const handleOpenApps = useCallback(() => {
181
- var _a2, _b2;
234
+ var _a2;
182
235
  if (isLoggingOut) return;
183
236
  (_a2 = navigation == null ? void 0 : navigation.closeDrawer) == null ? void 0 : _a2.call(navigation);
184
- (_b2 = navigation == null ? void 0 : navigation.dispatch) == null ? void 0 : _b2.call(navigation, CommonActions.navigate({
185
- name: "MainStack.Apps",
186
- params: orgName ? {
187
- orgName
188
- } : void 0
189
- }));
237
+ afterNativeModalClose(() => {
238
+ var _a3;
239
+ (_a3 = navigation == null ? void 0 : navigation.dispatch) == null ? void 0 : _a3.call(navigation, CommonActions.navigate({
240
+ name: "MainStack.Apps",
241
+ params: orgName ? {
242
+ orgName
243
+ } : void 0
244
+ }));
245
+ });
190
246
  }, [isLoggingOut, navigation, orgName]);
191
247
  const handleOpenHistory = useCallback(() => {
192
- var _a2, _b2;
248
+ var _a2;
193
249
  if (isLoggingOut) return;
194
250
  (_a2 = navigation == null ? void 0 : navigation.closeDrawer) == null ? void 0 : _a2.call(navigation);
195
- (_b2 = navigation == null ? void 0 : navigation.dispatch) == null ? void 0 : _b2.call(navigation, CommonActions.navigate({
196
- name: "MainStack.ChatHistory",
197
- params: orgName ? {
198
- orgName
199
- } : void 0
200
- }));
251
+ afterNativeModalClose(() => {
252
+ var _a3;
253
+ (_a3 = navigation == null ? void 0 : navigation.dispatch) == null ? void 0 : _a3.call(navigation, CommonActions.navigate({
254
+ name: "MainStack.ChatHistory",
255
+ params: orgName ? {
256
+ orgName
257
+ } : void 0
258
+ }));
259
+ });
201
260
  }, [isLoggingOut, navigation, orgName]);
202
261
  const handleOpenBilling = useCallback(() => {
203
- var _a2, _b2;
262
+ var _a2;
263
+ if (isLoggingOut) return;
264
+ (_a2 = navigation == null ? void 0 : navigation.closeDrawer) == null ? void 0 : _a2.call(navigation);
265
+ afterNativeModalClose(() => {
266
+ var _a3;
267
+ (_a3 = navigation == null ? void 0 : navigation.navigate) == null ? void 0 : _a3.call(navigation, "MainStack.Billing", orgName ? {
268
+ orgName
269
+ } : void 0);
270
+ });
271
+ }, [isLoggingOut, navigation, orgName]);
272
+ const handleOpenAccount = useCallback(() => {
273
+ var _a2;
204
274
  if (isLoggingOut) return;
205
275
  (_a2 = navigation == null ? void 0 : navigation.closeDrawer) == null ? void 0 : _a2.call(navigation);
206
- (_b2 = navigation == null ? void 0 : navigation.navigate) == null ? void 0 : _b2.call(navigation, "MainStack.Billing", orgName ? {
207
- orgName
208
- } : void 0);
276
+ afterNativeModalClose(() => {
277
+ var _a3;
278
+ (_a3 = navigation == null ? void 0 : navigation.navigate) == null ? void 0 : _a3.call(navigation, "MainStack.Account", orgName ? {
279
+ orgName
280
+ } : void 0);
281
+ });
209
282
  }, [isLoggingOut, navigation, orgName]);
210
283
  useEffect(() => {
211
284
  if (authUser) {
212
285
  setIsLoggingOut(false);
213
286
  }
214
287
  }, [authUser]);
215
- return /* @__PURE__ */ jsx(SafeAreaView, { style: styles.safeArea, edges: ["left", "bottom"], children: /* @__PURE__ */ jsxs(View, { style: styles.drawerColumn, children: [
216
- /* @__PURE__ */ jsxs(DrawerContentScrollView, __spreadProps(__spreadValues({}, props), { style: styles.scroll, contentContainerStyle: scrollContentStyle, children: [
217
- /* @__PURE__ */ jsx(View, { style: styles.brandBlock, children: /* @__PURE__ */ jsxs(View, { style: styles.brandStrip, children: [
288
+ return /* @__PURE__ */ jsx(SafeAreaView, { style: [styles.safeArea, {
289
+ backgroundColor: palette.bg
290
+ }], edges: ["left", "bottom"], children: /* @__PURE__ */ jsxs(View, { style: styles.drawerColumn, children: [
291
+ /* @__PURE__ */ jsxs(DrawerContentScrollView, __spreadProps(__spreadValues({}, props), { style: [styles.scroll, {
292
+ backgroundColor: palette.bg
293
+ }], contentContainerStyle: scrollContentStyle, children: [
294
+ /* @__PURE__ */ jsx(View, { style: [styles.brandBlock, {
295
+ borderBottomColor: palette.border
296
+ }], children: /* @__PURE__ */ jsxs(View, { style: styles.brandStrip, children: [
218
297
  /* @__PURE__ */ jsx(Image, { source: APP_ICON, style: styles.brandIconSmall, resizeMode: "contain" }),
219
- /* @__PURE__ */ jsx(Text, { style: styles.brandStripTitle, children: "Yantra" })
298
+ /* @__PURE__ */ jsx(Text, { style: [styles.brandStripTitle, {
299
+ color: palette.text
300
+ }], children: "Yantra" })
220
301
  ] }) }),
221
- /* @__PURE__ */ jsx(DrawerProfileHeader, { isAuthenticated }),
222
- isAuthenticated ? /* @__PURE__ */ jsxs(View, { style: styles.menuCard, children: [
302
+ /* @__PURE__ */ jsx(DrawerProfileHeader, { isAuthenticated, onPress: handleOpenAccount, palette }),
303
+ isAuthenticated ? /* @__PURE__ */ jsxs(View, { style: [styles.menuCard, {
304
+ backgroundColor: palette.surface,
305
+ borderColor: palette.border
306
+ }], children: [
223
307
  visibleRoutes.map((r) => {
224
308
  var _a2, _b2;
225
309
  const descriptor = descriptors == null ? void 0 : descriptors[r.key];
@@ -227,8 +311,8 @@ function CustomDrawer(props) {
227
311
  const label = routeLabel(descriptor, r);
228
312
  const iconFn = (_b2 = descriptor == null ? void 0 : descriptor.options) == null ? void 0 : _b2.drawerIcon;
229
313
  const fallbackIcon = label.trim().toLowerCase() === "chat" ? "chatbubbles-outline" : "home-outline";
230
- return /* @__PURE__ */ jsx(DrawerListRow, { label, focused, showDivider: true, icon: fallbackIcon, iconNode: typeof iconFn === "function" ? iconFn({
231
- color: focused ? PALETTE.text : PALETTE.icon,
314
+ return /* @__PURE__ */ jsx(DrawerListRow, { label, focused, showDivider: true, icon: fallbackIcon, palette, iconNode: typeof iconFn === "function" ? iconFn({
315
+ color: focused ? palette.focusedText : palette.icon,
232
316
  size: 22,
233
317
  focused
234
318
  }) : void 0, onPress: () => {
@@ -238,14 +322,21 @@ function CustomDrawer(props) {
238
322
  } : void 0);
239
323
  } }, r.key);
240
324
  }),
241
- /* @__PURE__ */ jsx(DrawerListRow, { icon: "apps-outline", label: "Apps", focused: appsFocused, onPress: handleOpenApps, showDivider: true }),
242
- /* @__PURE__ */ jsx(DrawerListRow, { icon: "time-outline", label: "History", focused: historyFocused, onPress: handleOpenHistory, showDivider: true }),
243
- /* @__PURE__ */ jsx(DrawerListRow, { icon: "card-outline", label: "Billing", focused: billingFocused, onPress: handleOpenBilling })
325
+ /* @__PURE__ */ jsx(DrawerListRow, { icon: "apps-outline", label: "Apps", focused: appsFocused, onPress: handleOpenApps, showDivider: true, palette }),
326
+ /* @__PURE__ */ jsx(DrawerListRow, { icon: "time-outline", label: "History", focused: historyFocused, onPress: handleOpenHistory, showDivider: true, palette }),
327
+ /* @__PURE__ */ jsx(DrawerListRow, { icon: "card-outline", label: "Billing", focused: billingFocused, onPress: handleOpenBilling, palette })
244
328
  ] }) : null,
245
- !isAuthenticated ? /* @__PURE__ */ jsxs(View, { style: styles.loggedOutStateCard, children: [
329
+ !isAuthenticated ? /* @__PURE__ */ jsxs(View, { style: [styles.loggedOutStateCard, {
330
+ backgroundColor: palette.surface,
331
+ borderColor: palette.border
332
+ }], children: [
246
333
  /* @__PURE__ */ jsx(View, { style: styles.loggedOutStateIconWrap, children: /* @__PURE__ */ jsx(Ionicons, { name: "shield-checkmark-outline", size: 22, color: mobileTokens.color.primary }) }),
247
- /* @__PURE__ */ jsx(Text, { style: styles.loggedOutStateTitle, children: "Sign in to continue" }),
248
- /* @__PURE__ */ jsx(Text, { style: styles.loggedOutStateSubtitle, children: "Access your chat history, profile, and personalized workspace after login." }),
334
+ /* @__PURE__ */ jsx(Text, { style: [styles.loggedOutStateTitle, {
335
+ color: palette.text
336
+ }], children: "Sign in to continue" }),
337
+ /* @__PURE__ */ jsx(Text, { style: [styles.loggedOutStateSubtitle, {
338
+ color: palette.textSecondary
339
+ }], children: "Access your chat history, profile, and personalized workspace after login." }),
249
340
  /* @__PURE__ */ jsxs(Pressable, { onPress: handleLogin, accessibilityRole: "button", accessibilityLabel: "Log in", style: ({
250
341
  pressed
251
342
  }) => [styles.loggedOutStateButton, pressed && styles.loggedOutStateButtonPressed], children: [
@@ -254,18 +345,29 @@ function CustomDrawer(props) {
254
345
  ] })
255
346
  ] }) : null
256
347
  ] })),
257
- showLogout && isAuthenticated ? /* @__PURE__ */ jsx(View, { style: styles.logoutFooter, children: /* @__PURE__ */ jsxs(Pressable, { onPress: handleLogout, disabled: isLoggingOut, accessibilityRole: "button", accessibilityLabel: "Log out", style: ({
258
- pressed
259
- }) => [styles.logoutButton, pressed && !isLoggingOut && styles.logoutButtonPressed], children: [
260
- /* @__PURE__ */ jsx(View, { style: styles.logoutIconCircle, children: isLoggingOut ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: "#b91c1c" }) : /* @__PURE__ */ jsx(Ionicons, { name: "log-out-outline", size: 20, color: "#b91c1c" }) }),
261
- /* @__PURE__ */ jsx(Text, { style: styles.logoutLabel, children: isLoggingOut ? "Logging out..." : "Log out" })
262
- ] }) }) : showLogout ? /* @__PURE__ */ jsx(View, { style: styles.logoutFooter, children: /* @__PURE__ */ jsx(Text, { style: styles.loggedOutFooterHint, children: "You are currently signed out" }) }) : null
348
+ /* @__PURE__ */ jsxs(View, { style: [styles.footerStack, {
349
+ backgroundColor: palette.bg
350
+ }], children: [
351
+ /* @__PURE__ */ jsx(DrawerAppearanceRow, { isDark, onChange: setDarkMode, palette }),
352
+ showLogout && isAuthenticated ? /* @__PURE__ */ jsxs(Pressable, { onPress: handleLogout, disabled: isLoggingOut, accessibilityRole: "button", accessibilityLabel: "Log out", style: ({
353
+ pressed
354
+ }) => [styles.logoutButton, {
355
+ backgroundColor: pressed && !isLoggingOut ? palette.rowHighlight : palette.surface,
356
+ borderColor: palette.border
357
+ }], children: [
358
+ isLoggingOut ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: palette.icon }) : /* @__PURE__ */ jsx(Ionicons, { name: "log-out-outline", size: 22, color: palette.icon }),
359
+ /* @__PURE__ */ jsx(Text, { style: [styles.logoutLabel, {
360
+ color: palette.text
361
+ }], children: isLoggingOut ? "Logging out..." : "Log out" })
362
+ ] }) : showLogout ? /* @__PURE__ */ jsx(Text, { style: [styles.loggedOutFooterHint, {
363
+ color: palette.textSecondary
364
+ }], children: "You are currently signed out" }) : null
365
+ ] })
263
366
  ] }) });
264
367
  }
265
368
  const styles = StyleSheet.create({
266
369
  safeArea: {
267
- flex: 1,
268
- backgroundColor: PALETTE.bg
370
+ flex: 1
269
371
  },
270
372
  drawerColumn: {
271
373
  flex: 1
@@ -281,8 +383,7 @@ const styles = StyleSheet.create({
281
383
  brandBlock: {
282
384
  marginBottom: 16,
283
385
  paddingBottom: 14,
284
- borderBottomWidth: StyleSheet.hairlineWidth,
285
- borderBottomColor: PALETTE.border
386
+ borderBottomWidth: StyleSheet.hairlineWidth
286
387
  },
287
388
  brandStrip: {
288
389
  flexDirection: "row",
@@ -295,108 +396,63 @@ const styles = StyleSheet.create({
295
396
  borderRadius: 10
296
397
  },
297
398
  brandStripTitle: {
298
- color: PALETTE.text,
299
399
  fontSize: 22,
300
400
  fontWeight: "800",
301
401
  letterSpacing: -0.6
302
402
  },
303
403
  profileCard: {
304
- borderRadius: 12,
404
+ borderRadius: 20,
305
405
  overflow: "hidden",
306
406
  marginBottom: 20,
307
- backgroundColor: PALETTE.surface,
308
- borderWidth: StyleSheet.hairlineWidth,
309
- borderColor: PALETTE.border
407
+ borderWidth: StyleSheet.hairlineWidth
310
408
  },
311
409
  profileCardInner: {
312
410
  flexDirection: "row",
313
- padding: 16,
314
- gap: 14
315
- },
316
- avatarOuter: {
317
- width: 56,
318
- height: 56,
319
- borderRadius: 28,
320
- overflow: "hidden",
321
- borderWidth: StyleSheet.hairlineWidth,
322
- borderColor: PALETTE.border,
323
- backgroundColor: PALETTE.rowHighlight
324
- },
325
- avatarImage: {
326
- width: "100%",
327
- height: "100%"
328
- },
329
- avatarPlaceholder: {
330
- flex: 1,
331
411
  alignItems: "center",
332
- justifyContent: "center",
333
- backgroundColor: PALETTE.rowHighlight
334
- },
335
- avatarInitials: {
336
- fontSize: 20,
337
- fontWeight: "700",
338
- color: mobileTokens.color.primary,
339
- letterSpacing: 0.3
412
+ paddingVertical: 14,
413
+ paddingLeft: 14,
414
+ paddingRight: 12,
415
+ gap: 12
340
416
  },
341
417
  profileMeta: {
342
418
  flex: 1,
343
419
  minWidth: 0,
344
- justifyContent: "center"
420
+ justifyContent: "center",
421
+ gap: 2
345
422
  },
346
423
  profileName: {
347
- fontSize: 19,
424
+ fontSize: 16,
348
425
  fontWeight: "600",
349
- color: PALETTE.text,
350
- letterSpacing: -0.3,
351
- lineHeight: 24
352
- },
353
- profileUsername: {
354
- marginTop: 4,
355
- fontSize: 14,
356
- fontWeight: "500",
357
- color: PALETTE.textSecondary,
358
- letterSpacing: -0.1
426
+ letterSpacing: -0.2,
427
+ lineHeight: 20
359
428
  },
360
429
  profileEmail: {
361
- marginTop: 6,
362
430
  fontSize: 13,
363
431
  fontWeight: "400",
364
- color: PALETTE.textSecondary
432
+ lineHeight: 17
365
433
  },
366
434
  menuCard: {
367
435
  borderRadius: 16,
368
436
  overflow: "hidden",
369
- backgroundColor: PALETTE.surface,
370
- borderWidth: StyleSheet.hairlineWidth,
371
- borderColor: PALETTE.border
437
+ borderWidth: StyleSheet.hairlineWidth
372
438
  },
373
439
  listRow: {
374
440
  flexDirection: "row",
375
441
  alignItems: "center",
376
442
  paddingVertical: 15,
377
443
  paddingHorizontal: 16,
378
- gap: 14,
379
- backgroundColor: PALETTE.surface
380
- },
381
- listRowFocused: {
382
- backgroundColor: PALETTE.rowHighlight
383
- },
384
- listRowPressed: {
385
- backgroundColor: PALETTE.rowHighlight
444
+ gap: 14
386
445
  },
387
446
  listLabel: {
388
447
  flex: 1,
389
448
  fontSize: 16,
390
- fontWeight: "400",
391
- color: PALETTE.text
449
+ fontWeight: "400"
392
450
  },
393
451
  listLabelFocused: {
394
- fontWeight: "600",
395
- color: mobileTokens.color.primary
452
+ fontWeight: "600"
396
453
  },
397
454
  rowDivider: {
398
455
  height: StyleSheet.hairlineWidth,
399
- backgroundColor: PALETTE.border,
400
456
  marginLeft: 52
401
457
  },
402
458
  loggedOutStateCard: {
@@ -404,9 +460,7 @@ const styles = StyleSheet.create({
404
460
  borderRadius: 14,
405
461
  paddingHorizontal: 16,
406
462
  paddingVertical: 18,
407
- backgroundColor: PALETTE.surface,
408
463
  borderWidth: StyleSheet.hairlineWidth,
409
- borderColor: PALETTE.border,
410
464
  alignItems: "center",
411
465
  gap: 10
412
466
  },
@@ -423,13 +477,11 @@ const styles = StyleSheet.create({
423
477
  loggedOutStateTitle: {
424
478
  fontSize: 17,
425
479
  fontWeight: "700",
426
- color: PALETTE.text,
427
480
  letterSpacing: -0.2
428
481
  },
429
482
  loggedOutStateSubtitle: {
430
483
  fontSize: 13,
431
484
  lineHeight: 19,
432
- color: PALETTE.textSecondary,
433
485
  textAlign: "center",
434
486
  paddingHorizontal: 4
435
487
  },
@@ -454,43 +506,53 @@ const styles = StyleSheet.create({
454
506
  navChevron: {
455
507
  marginLeft: "auto"
456
508
  },
457
- logoutFooter: {
458
- borderTopWidth: StyleSheet.hairlineWidth,
459
- borderTopColor: PALETTE.border,
460
- paddingHorizontal: 18,
461
- paddingTop: 10,
462
- paddingBottom: 8,
463
- backgroundColor: PALETTE.surface
509
+ appearanceRow: {
510
+ borderRadius: 16,
511
+ borderWidth: StyleSheet.hairlineWidth,
512
+ marginBottom: 10,
513
+ paddingVertical: 8,
514
+ paddingHorizontal: 12,
515
+ gap: 10
464
516
  },
465
- logoutButton: {
517
+ appearanceToggle: {
466
518
  flexDirection: "row",
467
519
  alignItems: "center",
468
- gap: 12,
469
- paddingVertical: 12,
470
- paddingHorizontal: 12,
471
- borderRadius: 14
520
+ marginLeft: "auto",
521
+ borderRadius: 8,
522
+ borderWidth: StyleSheet.hairlineWidth,
523
+ padding: 2,
524
+ gap: 1
472
525
  },
473
- logoutIconCircle: {
474
- width: 40,
475
- height: 40,
476
- borderRadius: 12,
477
- backgroundColor: "#fef2f2",
526
+ appearanceToggleBtn: {
527
+ width: 28,
528
+ height: 28,
529
+ borderRadius: 6,
478
530
  alignItems: "center",
479
- justifyContent: "center"
531
+ justifyContent: "center",
532
+ borderWidth: StyleSheet.hairlineWidth,
533
+ borderColor: "transparent"
534
+ },
535
+ footerStack: {
536
+ paddingHorizontal: 18,
537
+ paddingTop: 8,
538
+ paddingBottom: 12
480
539
  },
481
- logoutButtonPressed: {
482
- opacity: 0.75,
483
- backgroundColor: "#fef2f2"
540
+ logoutButton: {
541
+ flexDirection: "row",
542
+ alignItems: "center",
543
+ gap: 14,
544
+ paddingVertical: 15,
545
+ paddingHorizontal: 16,
546
+ borderRadius: 16,
547
+ borderWidth: StyleSheet.hairlineWidth
484
548
  },
485
549
  logoutLabel: {
486
550
  fontSize: 16,
487
- fontWeight: "600",
488
- color: "#b91c1c"
551
+ fontWeight: "400"
489
552
  },
490
553
  loggedOutFooterHint: {
491
554
  fontSize: 12,
492
555
  textAlign: "center",
493
- color: PALETTE.textSecondary,
494
556
  paddingVertical: 8
495
557
  }
496
558
  });export{CustomDrawer as default};//# sourceMappingURL=CustomDrawer.js.map