@adminide-stack/yantra-mobile 12.0.197-alpha.0 → 12.0.197

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 (97) hide show
  1. package/lib/components/NavigationHeader/NavigationHeader.js +10 -2
  2. package/lib/components/NavigationHeader/NavigationHeader.js.map +1 -1
  3. package/lib/compute.js +5 -3
  4. package/lib/compute.js.map +1 -1
  5. package/lib/config/env-config.js +1 -1
  6. package/lib/config/env-config.js.map +1 -1
  7. package/lib/features/shopping/DealRails.js +1 -1
  8. package/lib/features/shopping/DealRails.js.map +1 -1
  9. package/lib/features/shopping/TrendingSections.js +6 -3
  10. package/lib/features/shopping/TrendingSections.js.map +1 -1
  11. package/lib/features/shopping/deals/registry.js +14 -1
  12. package/lib/features/shopping/deals/registry.js.map +1 -1
  13. package/lib/features/shopping/services/blackFridayBrowserSites.js +6 -3
  14. package/lib/features/shopping/services/blackFridayBrowserSites.js.map +1 -1
  15. package/lib/features/shopping/services/dealProviders.js +11 -2
  16. package/lib/features/shopping/services/dealProviders.js.map +1 -1
  17. package/lib/features/shopping/services/holidayDeals.js +7 -5
  18. package/lib/features/shopping/services/holidayDeals.js.map +1 -1
  19. package/lib/features/shopping/services/liveDealLanes.js +66 -24
  20. package/lib/features/shopping/services/liveDealLanes.js.map +1 -1
  21. package/lib/features/shopping/shoppingExec.js +60 -11
  22. package/lib/features/shopping/shoppingExec.js.map +1 -1
  23. package/lib/features/team-chat/TeamChatExperience.js +30 -15
  24. package/lib/features/team-chat/TeamChatExperience.js.map +1 -1
  25. package/lib/features/team-chat/api/client.js +19 -6
  26. package/lib/features/team-chat/api/client.js.map +1 -1
  27. package/lib/features/team-chat/app.js.map +1 -1
  28. package/lib/features/team-chat/components/Avatar.js +3 -2
  29. package/lib/features/team-chat/components/Avatar.js.map +1 -1
  30. package/lib/features/team-chat/components/Composer.js +8 -8
  31. package/lib/features/team-chat/components/Composer.js.map +1 -1
  32. package/lib/features/team-chat/components/Dialogs.js +7 -61
  33. package/lib/features/team-chat/components/Dialogs.js.map +1 -1
  34. package/lib/features/team-chat/components/EmojiPicker.js +2 -2
  35. package/lib/features/team-chat/components/EmojiPicker.js.map +1 -1
  36. package/lib/features/team-chat/components/MessageItem.js +23 -16
  37. package/lib/features/team-chat/components/MessageItem.js.map +1 -1
  38. package/lib/features/team-chat/components/MessageList.js +2 -2
  39. package/lib/features/team-chat/components/MessageList.js.map +1 -1
  40. package/lib/features/team-chat/components/QuickSwitcher.js +2 -2
  41. package/lib/features/team-chat/components/QuickSwitcher.js.map +1 -1
  42. package/lib/features/team-chat/components/TabBar.js +138 -0
  43. package/lib/features/team-chat/components/TabBar.js.map +1 -0
  44. package/lib/features/team-chat/components/YouButton.js +69 -0
  45. package/lib/features/team-chat/components/YouButton.js.map +1 -0
  46. package/lib/features/team-chat/components/ui.js +40 -12
  47. package/lib/features/team-chat/components/ui.js.map +1 -1
  48. package/lib/features/team-chat/theme.js +81 -29
  49. package/lib/features/team-chat/theme.js.map +1 -1
  50. package/lib/features/team-chat/views/ActivityView.js +8 -6
  51. package/lib/features/team-chat/views/ActivityView.js.map +1 -1
  52. package/lib/features/team-chat/views/BrowseView.js +2 -2
  53. package/lib/features/team-chat/views/BrowseView.js.map +1 -1
  54. package/lib/features/team-chat/views/ChannelView.js +2 -2
  55. package/lib/features/team-chat/views/ChannelView.js.map +1 -1
  56. package/lib/features/team-chat/views/DetailsPane.js +5 -5
  57. package/lib/features/team-chat/views/DetailsPane.js.map +1 -1
  58. package/lib/features/team-chat/views/DmsTab.js +154 -0
  59. package/lib/features/team-chat/views/DmsTab.js.map +1 -0
  60. package/lib/features/team-chat/views/DraftsView.js +2 -2
  61. package/lib/features/team-chat/views/DraftsView.js.map +1 -1
  62. package/lib/features/team-chat/views/FilesView.js +2 -2
  63. package/lib/features/team-chat/views/FilesView.js.map +1 -1
  64. package/lib/features/team-chat/views/NewMessageView.js +4 -4
  65. package/lib/features/team-chat/views/NewMessageView.js.map +1 -1
  66. package/lib/features/team-chat/views/PeopleView.js +2 -2
  67. package/lib/features/team-chat/views/PeopleView.js.map +1 -1
  68. package/lib/features/team-chat/views/ProfilePane.js +2 -2
  69. package/lib/features/team-chat/views/ProfilePane.js.map +1 -1
  70. package/lib/features/team-chat/views/SearchView.js +2 -2
  71. package/lib/features/team-chat/views/SearchView.js.map +1 -1
  72. package/lib/features/team-chat/views/Sidebar.js +247 -176
  73. package/lib/features/team-chat/views/Sidebar.js.map +1 -1
  74. package/lib/features/team-chat/views/ThreadPane.js +3 -3
  75. package/lib/features/team-chat/views/ThreadPane.js.map +1 -1
  76. package/lib/features/team-chat/views/ThreadsView.js +2 -2
  77. package/lib/features/team-chat/views/ThreadsView.js.map +1 -1
  78. package/lib/features/team-chat/views/YouTab.js +133 -0
  79. package/lib/features/team-chat/views/YouTab.js.map +1 -0
  80. package/lib/features/webbuilder/components/AppPhoneSheet.js +2 -2
  81. package/lib/features/webbuilder/components/AppPhoneSheet.js.map +1 -1
  82. package/lib/features/webbuilder/components/Credits.js +2 -2
  83. package/lib/features/webbuilder/components/Credits.js.map +1 -1
  84. package/lib/features/webbuilder/components/GithubConnectSheet.js +3 -3
  85. package/lib/features/webbuilder/components/GithubConnectSheet.js.map +1 -1
  86. package/lib/features/webbuilder/components/NotesSheet.js +2 -2
  87. package/lib/features/webbuilder/components/NotesSheet.js.map +1 -1
  88. package/lib/features/webbuilder/components/SiteScoreSheet.js +2 -2
  89. package/lib/features/webbuilder/components/SiteScoreSheet.js.map +1 -1
  90. package/lib/features/webbuilder/components/TemplatePreviewSheet.js +2 -2
  91. package/lib/features/webbuilder/components/TemplatePreviewSheet.js.map +1 -1
  92. package/lib/features/webbuilder/components/ui.js +12 -2
  93. package/lib/features/webbuilder/components/ui.js.map +1 -1
  94. package/lib/routes.json +2 -1
  95. package/lib/screens/TeamChat/index.js +9 -8
  96. package/lib/screens/TeamChat/index.js.map +1 -1
  97. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- import {jsxs,jsx}from'react/jsx-runtime';import {useState,useEffect,useMemo}from'react';import {View,StyleSheet,Pressable,Text,ScrollView,RefreshControl}from'react-native';import {useSafeAreaInsets}from'react-native-safe-area-context';import AsyncStorage from'@react-native-async-storage/async-storage';import {Ionicons}from'@expo/vector-icons';import {useApp,usePalette,useChat}from'../app.js';import {Avatar}from'../components/Avatar.js';import {YouSheet}from'../components/Dialogs.js';import {Header,IconButton,ChannelGlyph,Badge}from'../components/ui.js';import {othersIn,channelTitle,nameOf}from'../utils/format.js';var __defProp = Object.defineProperty;
1
+ import {jsxs,jsx}from'react/jsx-runtime';import {useState,useEffect,useMemo}from'react';import {View,StyleSheet,Text,ScrollView,RefreshControl}from'react-native';import {useSafeAreaInsets}from'react-native-safe-area-context';import AsyncStorage from'@react-native-async-storage/async-storage';import {Ionicons}from'@expo/vector-icons';import {fetchDrafts,fetchSaved}from'../api/ops.js';import {useApp,usePalette,useChat}from'../app.js';import {Avatar}from'../components/Avatar.js';import {brandBarStops,BrandBarBackground}from'../../../components/BrandBar/BrandBarBackground.js';import {useTabBarSpace}from'../components/TabBar.js';import {IconButton,Tap,ChannelGlyph,Badge}from'../components/ui.js';import {YouButton}from'../components/YouButton.js';import {useList,qk}from'../state/lists.js';import {othersIn,channelTitle}from'../utils/format.js';var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -18,17 +18,21 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  const COLLAPSE_KEY = "yantra-team-chat-collapsed-sections";
21
+ const count = (n, one, many = `${one}s`) => `${n} ${n === 1 ? one : many}`;
21
22
  function Sidebar() {
22
- var _a;
23
+ var _a, _b, _c, _d, _e, _f;
23
24
  const app = useApp();
24
25
  const p = usePalette();
25
26
  const insets = useSafeAreaInsets();
27
+ const space = useTabBarSpace();
26
28
  const me = useChat((s) => s.me);
27
29
  const channels = useChat((s) => s.channels);
28
30
  const people = useChat((s) => s.people);
29
31
  const live = useChat((s) => s.live);
30
32
  const [collapsed, setCollapsed] = useState({});
31
33
  const [refreshing, setRefreshing] = useState(false);
34
+ const drafts = useList(qk.drafts(), fetchDrafts);
35
+ const saved = useList(qk.saved("progress"), () => fetchSaved(false));
32
36
  useEffect(() => {
33
37
  void AsyncStorage.getItem(COLLAPSE_KEY).then((v) => setCollapsed(JSON.parse(v || "{}"))).catch(() => void 0);
34
38
  }, []);
@@ -47,12 +51,12 @@ function Sidebar() {
47
51
  const mine = Object.values(channels).filter((c) => c.membership && !c.membership.hidden);
48
52
  const isConv = (c) => c.kind === "dm" || c.kind === "group";
49
53
  const byName = (a, b) => {
50
- var _a2, _b;
51
- return ((_a2 = a.name) != null ? _a2 : "").localeCompare((_b = b.name) != null ? _b : "");
54
+ var _a2, _b2;
55
+ return ((_a2 = a.name) != null ? _a2 : "").localeCompare((_b2 = b.name) != null ? _b2 : "");
52
56
  };
53
57
  const byRecent = (a, b) => {
54
- var _a2, _b;
55
- return ((_a2 = b.lastMessageAt) != null ? _a2 : b.createdAt).localeCompare((_b = a.lastMessageAt) != null ? _b : a.createdAt);
58
+ var _a2, _b2;
59
+ return ((_a2 = b.lastMessageAt) != null ? _a2 : b.createdAt).localeCompare((_b2 = a.lastMessageAt) != null ? _b2 : a.createdAt);
56
60
  };
57
61
  const visible = (c) => !c.archivedAt;
58
62
  return {
@@ -62,7 +66,8 @@ function Sidebar() {
62
66
  };
63
67
  }, [channels]);
64
68
  const workspace = (_a = me == null ? void 0 : me.workspace.orgName) != null ? _a : "";
65
- const shortcut = (route, label, icon, badge, bold) => /* @__PURE__ */ jsx(SidebarRow, { onPress: () => app.navigate(route), icon: /* @__PURE__ */ jsx(Ionicons, { name: icon, size: 18, color: p.sidebarForeground }), unread: bold, badge, children: label }, label);
69
+ const activePeople = Object.values(people).filter((u) => u.active).length;
70
+ const draftCount = (_c = (_b = drafts.data) == null ? void 0 : _b.filter((d) => d.body.trim()).length) != null ? _c : 0;
66
71
  const refresh = async () => {
67
72
  setRefreshing(true);
68
73
  try {
@@ -71,97 +76,145 @@ function Sidebar() {
71
76
  setRefreshing(false);
72
77
  }
73
78
  };
79
+ const tiles = [{
80
+ route: {
81
+ view: "threads"
82
+ },
83
+ label: "Threads",
84
+ sub: `${(_d = me == null ? void 0 : me.threadsUnread) != null ? _d : 0} new`,
85
+ icon: "chatbubble-ellipses-outline",
86
+ dot: Boolean(me == null ? void 0 : me.threadsUnread)
87
+ }, {
88
+ route: {
89
+ view: "drafts"
90
+ },
91
+ label: "Drafts & sent",
92
+ sub: count(draftCount, "draft"),
93
+ icon: "paper-plane-outline"
94
+ }, {
95
+ route: {
96
+ view: "saved"
97
+ },
98
+ label: "Saved",
99
+ sub: count((_f = (_e = saved.data) == null ? void 0 : _e.length) != null ? _f : 0, "item"),
100
+ icon: "bookmark-outline"
101
+ }, {
102
+ route: {
103
+ view: "files"
104
+ },
105
+ label: "Files",
106
+ sub: "Shared",
107
+ icon: "documents-outline"
108
+ }, {
109
+ route: {
110
+ view: "people"
111
+ },
112
+ label: "People",
113
+ sub: count(activePeople, "member"),
114
+ icon: "people-outline"
115
+ }];
74
116
  return /* @__PURE__ */ jsxs(View, { style: [styles.fill, {
75
- backgroundColor: p.sidebar
117
+ backgroundColor: p.background
76
118
  }], children: [
77
- /* @__PURE__ */ jsx(Header, { tone: "sidebar", onBack: app.openMenu, backIcon: "menu", icon: /* @__PURE__ */ jsx(View, { style: [styles.mark, {
78
- backgroundColor: p.sidebarPrimary
79
- }], children: /* @__PURE__ */ jsx(Text, { style: styles.markText, children: (workspace.slice(0, 1) || "T").toUpperCase() }) }), title: workspace || "Teams", subtitle: "Teams", right: /* @__PURE__ */ jsx(IconButton, { icon: "create-outline", label: "New message", size: 22, color: p.sidebarForeground, onPress: () => app.navigate({
80
- view: "new-message"
81
- }) }), children: /* @__PURE__ */ jsxs(Pressable, { onPress: app.openSwitcher, style: [styles.search, {
82
- backgroundColor: p.sidebarField
83
- }], accessibilityRole: "search", accessibilityLabel: `Search ${workspace || "workspace"}`, children: [
84
- /* @__PURE__ */ jsx(Ionicons, { name: "search", size: 16, color: p.sidebarMuted }),
85
- /* @__PURE__ */ jsxs(Text, { style: [styles.searchText, {
86
- color: p.sidebarMuted
87
- }], numberOfLines: 1, children: [
88
- "Jump to or search ",
89
- workspace || "workspace"
90
- ] })
91
- ] }) }),
119
+ /* @__PURE__ */ jsx(View, { style: [styles.band, {
120
+ paddingTop: app.hostHeader ? 0 : insets.top + 8,
121
+ backgroundColor: p.background
122
+ }], children: /* @__PURE__ */ jsx(View, { style: [styles.orgShade, {
123
+ shadowColor: p.dark ? "#000000" : "#9a3412",
124
+ backgroundColor: brandBarStops(p.dark)[2]
125
+ }], children: /* @__PURE__ */ jsxs(View, { style: [styles.bandRow, styles.orgCard, {
126
+ borderColor: p.dark ? "rgba(148,163,184,0.18)" : "rgba(234,88,12,0.14)"
127
+ }], children: [
128
+ /* @__PURE__ */ jsx(BrandBarBackground, { isDark: p.dark }),
129
+ app.openMenu && !app.hostHeader ? /* @__PURE__ */ jsx(IconButton, { icon: "menu", label: "Open menu", size: 24, color: p.sidebarForeground, onPress: app.openMenu }) : null,
130
+ /* @__PURE__ */ jsx(View, { style: [styles.mark, {
131
+ backgroundColor: p.sidebarPrimary
132
+ }], children: /* @__PURE__ */ jsx(Text, { style: [styles.markText, {
133
+ color: "#ffffff"
134
+ }], children: (workspace.slice(0, 1) || "T").toUpperCase() }) }),
135
+ /* @__PURE__ */ jsx(Text, { style: [styles.workspace, {
136
+ color: p.dark ? "#e2e8f0" : "#1e293b"
137
+ }], numberOfLines: 1, accessibilityRole: "header", children: workspace || "Teams" }),
138
+ /* @__PURE__ */ jsx(YouButton, { ring: p.sidebar, onBand: true })
139
+ ] }) }) }),
92
140
  live === "offline" ? /* @__PURE__ */ jsxs(View, { style: [styles.offline, {
93
- backgroundColor: p.sidebarAccent
141
+ backgroundColor: p.muted
94
142
  }], accessibilityLiveRegion: "polite", children: [
95
- /* @__PURE__ */ jsx(Ionicons, { name: "cloud-offline-outline", size: 14, color: p.sidebarForeground }),
143
+ /* @__PURE__ */ jsx(Ionicons, { name: "cloud-offline-outline", size: 14, color: p.mutedForeground }),
96
144
  /* @__PURE__ */ jsx(Text, { style: [styles.offlineText, {
97
- color: p.sidebarForeground
145
+ color: p.mutedForeground
98
146
  }], children: "Reconnecting\u2026" })
99
147
  ] }) : null,
100
- /* @__PURE__ */ jsxs(ScrollView, { contentContainerStyle: styles.list, refreshControl: /* @__PURE__ */ jsx(RefreshControl, { refreshing, onRefresh: () => void refresh(), tintColor: p.sidebarForeground }), children: [
101
- shortcut({
102
- view: "threads"
103
- }, "Threads", "chatbubbles-outline", void 0, Boolean(me == null ? void 0 : me.threadsUnread)),
104
- shortcut({
105
- view: "activity"
106
- }, "Activity", "at", (me == null ? void 0 : me.activityUnread) || void 0),
107
- shortcut({
108
- view: "drafts"
109
- }, "Drafts & sent", "paper-plane-outline"),
110
- shortcut({
111
- view: "saved"
112
- }, "Saved items", "bookmark-outline"),
113
- shortcut({
114
- view: "files"
115
- }, "Files", "documents-outline"),
116
- shortcut({
117
- view: "people"
118
- }, "People", "people-outline"),
119
- starred.length ? /* @__PURE__ */ jsx(Section, { title: "Starred", collapsed: collapsed.starred, onToggle: () => toggle("starred"), children: starred.map((c) => /* @__PURE__ */ jsx(ChannelRow, { channel: c, people, meId: me == null ? void 0 : me.user.id }, c.id)) }) : null,
120
- /* @__PURE__ */ jsxs(Section, { title: "Channels", collapsed: collapsed.channels, onToggle: () => toggle("channels"), action: /* @__PURE__ */ jsx(IconButton, { icon: "add", label: "Add channels", size: 20, color: p.sidebarForeground, onPress: app.openCreateChannel }), children: [
148
+ /* @__PURE__ */ jsxs(ScrollView, { contentContainerStyle: {
149
+ paddingBottom: space + 24
150
+ }, refreshControl: /* @__PURE__ */ jsx(RefreshControl, { refreshing, onRefresh: () => void refresh(), tintColor: p.mutedForeground }), children: [
151
+ /* @__PURE__ */ jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, contentContainerStyle: styles.tiles, children: tiles.map((t) => /* @__PURE__ */ jsxs(Tap, { onPress: () => app.navigate(t.route), accessibilityRole: "button", accessibilityLabel: `${t.label}, ${t.sub}`, style: ({
152
+ pressed
153
+ }) => [styles.tile, {
154
+ backgroundColor: pressed ? p.muted : p.background,
155
+ borderColor: p.border
156
+ }], children: [
157
+ /* @__PURE__ */ jsx(Ionicons, { name: t.icon, size: 24, color: p.foreground }),
158
+ /* @__PURE__ */ jsxs(View, { children: [
159
+ /* @__PURE__ */ jsx(Text, { style: [styles.tileText, {
160
+ color: p.foreground
161
+ }], numberOfLines: 1, children: t.label }),
162
+ /* @__PURE__ */ jsx(Text, { style: [styles.tileSub, {
163
+ color: p.mutedForeground
164
+ }], numberOfLines: 1, children: t.sub })
165
+ ] }),
166
+ t.dot ? /* @__PURE__ */ jsx(View, { style: [styles.tileDot, {
167
+ backgroundColor: p.badge
168
+ }] }) : null
169
+ ] }, t.label)) }),
170
+ starred.length ? /* @__PURE__ */ jsx(Section, { icon: "star-outline", title: "Starred", collapsed: collapsed.starred, onToggle: () => toggle("starred"), children: starred.map((c) => /* @__PURE__ */ jsx(ChannelRow, { channel: c, people, meId: me == null ? void 0 : me.user.id }, c.id)) }) : null,
171
+ /* @__PURE__ */ jsxs(Section, { icon: "channels", title: "Channels", collapsed: collapsed.channels, onToggle: () => toggle("channels"), onOpen: () => app.navigate({
172
+ view: "browse"
173
+ }), children: [
121
174
  chans.map((c) => /* @__PURE__ */ jsx(ChannelRow, { channel: c, people, meId: me == null ? void 0 : me.user.id }, c.id)),
122
- /* @__PURE__ */ jsx(SidebarRow, { onPress: () => app.navigate({
123
- view: "browse"
124
- }), icon: /* @__PURE__ */ jsx(Ionicons, { name: "compass-outline", size: 18, color: p.sidebarForeground }), children: "Browse channels" }),
125
- /* @__PURE__ */ jsx(SidebarRow, { onPress: app.openCreateChannel, icon: /* @__PURE__ */ jsx(Ionicons, { name: "add", size: 18, color: p.sidebarForeground }), children: "Create a channel" })
175
+ /* @__PURE__ */ jsx(AddRow, { label: "Add channels", icon: "add", onPress: app.openCreateChannel })
126
176
  ] }),
127
- /* @__PURE__ */ jsxs(Section, { title: "Direct messages", collapsed: collapsed.dms, onToggle: () => toggle("dms"), action: /* @__PURE__ */ jsx(IconButton, { icon: "add", label: "New message", size: 20, color: p.sidebarForeground, onPress: () => app.navigate({
177
+ /* @__PURE__ */ jsxs(Section, { icon: "chatbubbles-outline", title: "Direct Messages", collapsed: collapsed.dms, onToggle: () => toggle("dms"), onOpen: () => app.navigate({
128
178
  view: "new-message"
129
- }) }), children: [
179
+ }), children: [
130
180
  dms.map((c) => /* @__PURE__ */ jsx(ChannelRow, { channel: c, people, meId: me == null ? void 0 : me.user.id }, c.id)),
131
- /* @__PURE__ */ jsx(SidebarRow, { onPress: () => app.navigate({
181
+ /* @__PURE__ */ jsx(AddRow, { label: "Add coworkers", icon: "add", onPress: () => app.navigate({
132
182
  view: "new-message"
133
- }), icon: /* @__PURE__ */ jsx(Ionicons, { name: "add", size: 18, color: p.sidebarForeground }), children: "Add coworkers" })
183
+ }) })
134
184
  ] })
135
- ] }),
136
- /* @__PURE__ */ jsx(YouFooter, { bottom: insets.bottom })
185
+ ] })
137
186
  ] });
138
187
  }
139
188
  function Section({
189
+ icon,
140
190
  title,
141
191
  collapsed,
142
192
  onToggle,
143
- action,
193
+ onOpen,
144
194
  children
145
195
  }) {
146
196
  const p = usePalette();
147
- return /* @__PURE__ */ jsxs(View, { style: styles.section, children: [
197
+ return /* @__PURE__ */ jsxs(View, { style: [styles.section, {
198
+ borderTopColor: p.border
199
+ }], children: [
148
200
  /* @__PURE__ */ jsxs(View, { style: styles.sectionHead, children: [
149
- /* @__PURE__ */ jsxs(Pressable, { onPress: onToggle, style: styles.sectionToggle, accessibilityRole: "button", accessibilityState: {
150
- expanded: !collapsed
151
- }, children: [
152
- /* @__PURE__ */ jsx(Ionicons, { name: collapsed ? "chevron-forward" : "chevron-down", size: 14, color: p.sidebarMuted }),
201
+ /* @__PURE__ */ jsxs(Tap, { onPress: onOpen != null ? onOpen : onToggle, style: styles.sectionTitleWrap, accessibilityRole: "button", accessibilityLabel: title, children: [
202
+ /* @__PURE__ */ jsx(View, { style: styles.rowIcon, children: icon === "channels" ? /* @__PURE__ */ jsx(ChannelGlyph, { kind: "public", size: 20, color: p.foreground }) : /* @__PURE__ */ jsx(Ionicons, { name: icon, size: 21, color: p.foreground }) }),
153
203
  /* @__PURE__ */ jsx(Text, { style: [styles.sectionTitle, {
154
- color: p.sidebarMuted
155
- }], children: title })
204
+ color: p.foreground
205
+ }], children: title }),
206
+ onOpen ? /* @__PURE__ */ jsx(Ionicons, { name: "chevron-forward", size: 17, color: p.foreground }) : null
156
207
  ] }),
157
- action
208
+ /* @__PURE__ */ jsx(Tap, { onPress: onToggle, hitSlop: 10, accessibilityRole: "button", accessibilityLabel: collapsed ? `Show ${title}` : `Hide ${title}`, accessibilityState: {
209
+ expanded: !collapsed
210
+ }, style: styles.caret, children: /* @__PURE__ */ jsx(Ionicons, { name: collapsed ? "chevron-down" : "chevron-up", size: 22, color: p.mutedForeground }) })
158
211
  ] }),
159
- collapsed ? null : children
212
+ collapsed ? null : /* @__PURE__ */ jsx(View, { style: styles.sectionBody, children })
160
213
  ] });
161
214
  }
162
- function SidebarRow({
215
+ function Row({
163
216
  icon,
164
- children,
217
+ label,
165
218
  onPress,
166
219
  unread,
167
220
  badge,
@@ -170,20 +223,30 @@ function SidebarRow({
170
223
  }) {
171
224
  const p = usePalette();
172
225
  const bold = Boolean(unread && !muted);
173
- return /* @__PURE__ */ jsxs(Pressable, { onPress, accessibilityRole: "button", style: ({
226
+ return /* @__PURE__ */ jsxs(Tap, { onPress, accessibilityRole: "button", accessibilityLabel: `${label}${badge ? `, ${badge} unread` : bold ? ", unread" : ""}${muted ? ", muted" : ""}`, style: ({
174
227
  pressed
175
228
  }) => [styles.row, pressed && {
176
- backgroundColor: p.sidebarAccent
177
- }, muted && styles.muted], children: [
229
+ backgroundColor: p.muted
230
+ }, muted && styles.dim], children: [
178
231
  /* @__PURE__ */ jsx(View, { style: styles.rowIcon, children: icon }),
179
232
  /* @__PURE__ */ jsx(Text, { style: [styles.rowText, {
180
- color: bold ? "#ffffff" : p.sidebarForeground,
181
- fontWeight: bold ? "800" : "500"
182
- }], numberOfLines: 1, children }),
233
+ color: p.foreground,
234
+ fontWeight: bold ? "700" : "400"
235
+ }], numberOfLines: 1, children: label }),
183
236
  trailing,
184
237
  badge ? /* @__PURE__ */ jsx(Badge, { count: badge }) : null
185
238
  ] });
186
239
  }
240
+ function AddRow({
241
+ label,
242
+ icon,
243
+ onPress
244
+ }) {
245
+ const p = usePalette();
246
+ return /* @__PURE__ */ jsx(Row, { onPress, label, icon: /* @__PURE__ */ jsx(View, { style: [styles.square, {
247
+ backgroundColor: p.muted
248
+ }], children: /* @__PURE__ */ jsx(Ionicons, { name: icon, size: 18, color: p.mutedForeground }) }) });
249
+ }
187
250
  function ChannelRow({
188
251
  channel: c,
189
252
  people,
@@ -197,84 +260,85 @@ function ChannelRow({
197
260
  const unread = m.unreadCount > 0;
198
261
  const badge = isConv ? m.unreadCount : m.mentionCount;
199
262
  const dmUser = c.kind === "dm" ? people[others[0]] : void 0;
200
- const icon = c.kind === "dm" ? /* @__PURE__ */ jsx(Avatar, { user: dmUser, size: "xs", presence: true, ring: p.sidebar }) : c.kind === "group" ? /* @__PURE__ */ jsx(View, { style: [styles.group, {
201
- backgroundColor: p.sidebarField
263
+ const glyph = unread && !m.muted ? p.foreground : p.mutedForeground;
264
+ const icon = c.kind === "dm" ? /* @__PURE__ */ jsx(Avatar, { user: dmUser, size: "sm", presence: true, ring: p.background }) : c.kind === "group" ? /* @__PURE__ */ jsx(View, { style: [styles.square, {
265
+ backgroundColor: p.muted
202
266
  }], children: /* @__PURE__ */ jsx(Text, { style: [styles.groupText, {
203
- color: p.sidebarForeground
204
- }], children: others.length }) }) : /* @__PURE__ */ jsx(ChannelGlyph, { kind: c.kind, color: p.sidebarForeground });
205
- return /* @__PURE__ */ jsx(SidebarRow, { onPress: () => app.openChannel(c.id), icon, unread, badge: m.muted ? void 0 : badge || void 0, muted: m.muted, trailing: (dmUser == null ? void 0 : dmUser.statusEmoji) ? /* @__PURE__ */ jsx(Text, { style: styles.statusEmoji, children: dmUser.statusEmoji }) : m.muted ? /* @__PURE__ */ jsx(Ionicons, { name: "notifications-off", size: 13, color: p.sidebarMuted, accessibilityLabel: "Muted" }) : null, children: channelTitle(c, people, meId) });
206
- }
207
- function YouFooter({
208
- bottom
209
- }) {
210
- const p = usePalette();
211
- const user = useChat((s) => {
212
- var _a;
213
- return s.me ? (_a = s.people[s.me.user.id]) != null ? _a : s.me.user : null;
214
- });
215
- const [open, setOpen] = useState(false);
216
- if (!user) return null;
217
- const dnd = Boolean(user.dndUntil && new Date(user.dndUntil).getTime() > Date.now());
218
- return /* @__PURE__ */ jsxs(View, { style: [styles.you, {
219
- borderTopColor: p.sidebarBorder,
220
- paddingBottom: Math.max(bottom, 8)
221
- }], children: [
222
- /* @__PURE__ */ jsxs(Pressable, { onPress: () => setOpen(true), style: ({
223
- pressed
224
- }) => [styles.youButton, pressed && {
225
- backgroundColor: p.sidebarAccent
226
- }], accessibilityRole: "button", accessibilityLabel: "You", children: [
227
- /* @__PURE__ */ jsx(Avatar, { user, size: "md", presence: true, ring: p.sidebar }),
228
- /* @__PURE__ */ jsxs(View, { style: styles.youText, children: [
229
- /* @__PURE__ */ jsx(Text, { style: [styles.youName, {
230
- color: p.sidebarForeground
231
- }], numberOfLines: 1, children: nameOf(user) }),
232
- /* @__PURE__ */ jsx(Text, { style: [styles.youStatus, {
233
- color: p.sidebarMuted
234
- }], numberOfLines: 1, children: dnd ? "Notifications paused" : user.statusText || user.statusEmoji ? [user.statusEmoji, user.statusText].filter(Boolean).join(" ") : user.presence === "active" ? "Active" : "Away" })
235
- ] }),
236
- dnd ? /* @__PURE__ */ jsx(Ionicons, { name: "notifications-off", size: 16, color: p.sidebarMuted, accessibilityLabel: "Notifications paused" }) : null,
237
- /* @__PURE__ */ jsx(Ionicons, { name: "chevron-up", size: 16, color: p.sidebarMuted })
238
- ] }),
239
- /* @__PURE__ */ jsx(YouSheet, { open, onClose: () => setOpen(false) })
240
- ] });
267
+ color: p.foreground
268
+ }], children: others.length }) }) : /* @__PURE__ */ jsx(ChannelGlyph, { kind: c.kind, size: 19, color: glyph });
269
+ return /* @__PURE__ */ jsx(Row, { onPress: () => app.openChannel(c.id), icon, label: channelTitle(c, people, meId), unread, badge: m.muted ? void 0 : badge || void 0, muted: m.muted, trailing: (dmUser == null ? void 0 : dmUser.statusEmoji) ? /* @__PURE__ */ jsx(Text, { style: styles.statusEmoji, children: dmUser.statusEmoji }) : m.muted ? /* @__PURE__ */ jsx(Ionicons, { name: "notifications-off-outline", size: 14, color: p.mutedForeground }) : null });
241
270
  }
242
271
  const styles = StyleSheet.create({
243
272
  fill: {
244
273
  flex: 1
245
274
  },
275
+ band: {
276
+ paddingBottom: 10
277
+ },
278
+ bandRow: {
279
+ flexDirection: "row",
280
+ alignItems: "center",
281
+ gap: 10,
282
+ minHeight: 44
283
+ },
284
+ // Full width under the app header (which joins it flat): its gradient, and the header's own
285
+ // rounded bottom and warm edge, so both read as one header.
286
+ orgCard: {
287
+ overflow: "hidden",
288
+ paddingHorizontal: 16,
289
+ paddingVertical: 12,
290
+ borderRadius: 0,
291
+ borderBottomWidth: 1
292
+ },
293
+ orgShade: {
294
+ borderRadius: 0,
295
+ shadowOpacity: 0.1,
296
+ shadowRadius: 14,
297
+ shadowOffset: {
298
+ width: 0,
299
+ height: 6
300
+ },
301
+ elevation: 4
302
+ },
246
303
  mark: {
247
- width: 30,
248
- height: 30,
249
- borderRadius: 8,
304
+ width: 32,
305
+ height: 32,
306
+ borderRadius: 16,
250
307
  alignItems: "center",
251
- justifyContent: "center"
308
+ justifyContent: "center",
309
+ borderWidth: 2,
310
+ borderColor: "rgba(255,255,255,0.55)"
252
311
  },
253
312
  markText: {
254
313
  color: "#ffffff",
255
- fontSize: 14,
314
+ fontSize: 15,
256
315
  fontWeight: "800"
257
316
  },
317
+ workspace: {
318
+ flex: 1,
319
+ fontSize: 19,
320
+ fontWeight: "500",
321
+ letterSpacing: -0.2
322
+ },
258
323
  search: {
259
324
  flexDirection: "row",
260
325
  alignItems: "center",
261
326
  gap: 8,
262
- height: 38,
327
+ height: 40,
263
328
  borderRadius: 10,
264
329
  paddingHorizontal: 12,
265
- marginHorizontal: 6,
266
- marginTop: 4
330
+ marginTop: 10
267
331
  },
268
332
  searchText: {
269
333
  flex: 1,
270
- fontSize: 15
334
+ fontSize: 16
271
335
  },
272
336
  offline: {
273
337
  flexDirection: "row",
274
338
  alignItems: "center",
275
339
  gap: 6,
276
- marginHorizontal: 12,
277
- marginTop: 8,
340
+ marginHorizontal: 16,
341
+ marginTop: 10,
278
342
  paddingHorizontal: 10,
279
343
  paddingVertical: 6,
280
344
  borderRadius: 8
@@ -283,86 +347,93 @@ const styles = StyleSheet.create({
283
347
  fontSize: 12,
284
348
  fontWeight: "600"
285
349
  },
286
- list: {
287
- paddingHorizontal: 8,
288
- paddingTop: 8,
289
- paddingBottom: 16
350
+ tiles: {
351
+ gap: 10,
352
+ paddingHorizontal: 16,
353
+ paddingVertical: 16
354
+ },
355
+ tile: {
356
+ flexDirection: "row",
357
+ alignItems: "center",
358
+ gap: 12,
359
+ height: 64,
360
+ borderRadius: 16,
361
+ borderWidth: 1,
362
+ paddingHorizontal: 14,
363
+ paddingRight: 18
364
+ },
365
+ tileText: {
366
+ fontSize: 16,
367
+ fontWeight: "400"
368
+ },
369
+ tileSub: {
370
+ fontSize: 13,
371
+ marginTop: 1
372
+ },
373
+ tileDot: {
374
+ position: "absolute",
375
+ top: 8,
376
+ right: 8,
377
+ width: 8,
378
+ height: 8,
379
+ borderRadius: 4
290
380
  },
291
381
  section: {
292
- marginTop: 14
382
+ borderTopWidth: StyleSheet.hairlineWidth
293
383
  },
294
384
  sectionHead: {
295
385
  flexDirection: "row",
296
386
  alignItems: "center",
297
- paddingRight: 2
387
+ paddingLeft: 16,
388
+ paddingRight: 12,
389
+ height: 60
298
390
  },
299
- sectionToggle: {
391
+ sectionTitleWrap: {
300
392
  flex: 1,
301
393
  flexDirection: "row",
302
394
  alignItems: "center",
303
- gap: 4,
304
- height: 32,
305
- paddingHorizontal: 6
395
+ gap: 14
306
396
  },
307
397
  sectionTitle: {
308
- fontSize: 14,
309
- fontWeight: "700"
398
+ fontSize: 17,
399
+ fontWeight: "600"
400
+ },
401
+ caret: {
402
+ padding: 4
403
+ },
404
+ sectionBody: {
405
+ paddingBottom: 8
310
406
  },
311
407
  row: {
312
408
  flexDirection: "row",
313
409
  alignItems: "center",
314
- gap: 10,
315
- height: 40,
316
- paddingHorizontal: 10,
317
- borderRadius: 8
410
+ gap: 14,
411
+ minHeight: 46,
412
+ paddingHorizontal: 16
318
413
  },
319
- muted: {
320
- opacity: 0.6
414
+ dim: {
415
+ opacity: 0.55
321
416
  },
322
417
  rowIcon: {
323
- width: 22,
418
+ width: 26,
324
419
  alignItems: "center"
325
420
  },
326
421
  rowText: {
327
422
  flex: 1,
328
- fontSize: 16
423
+ fontSize: 17
329
424
  },
330
425
  statusEmoji: {
331
- fontSize: 13
426
+ fontSize: 14
332
427
  },
333
- group: {
334
- width: 20,
335
- height: 20,
336
- borderRadius: 5,
428
+ square: {
429
+ width: 26,
430
+ height: 26,
431
+ borderRadius: 7,
337
432
  alignItems: "center",
338
433
  justifyContent: "center"
339
434
  },
340
435
  groupText: {
341
- fontSize: 10,
342
- fontWeight: "800"
343
- },
344
- you: {
345
- borderTopWidth: StyleSheet.hairlineWidth,
346
- paddingHorizontal: 8,
347
- paddingTop: 6
348
- },
349
- youButton: {
350
- flexDirection: "row",
351
- alignItems: "center",
352
- gap: 10,
353
- padding: 6,
354
- borderRadius: 10
355
- },
356
- youText: {
357
- flex: 1,
358
- minWidth: 0
359
- },
360
- youName: {
361
- fontSize: 15,
436
+ fontSize: 13,
362
437
  fontWeight: "700"
363
- },
364
- youStatus: {
365
- fontSize: 12,
366
- marginTop: 1
367
438
  }
368
439
  });export{Sidebar};//# sourceMappingURL=Sidebar.js.map