@parallelworks/tandem-web 0.166.1 → 0.168.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.
@@ -1,145 +1,142 @@
1
- import { usePageTitle as e } from "../../../lib/pageTitle.js";
2
- import { Link as t } from "../../../lib/router.js";
3
- import { membersQuery as n, projectsQuery as r, teamMembersQuery as i, teamsQuery as a } from "../../../api/queries.js";
4
- import { MailIcon as o, UserIcon as s } from "../../../components/icons.js";
1
+ import { NotFound as e } from "../../../components/status.js";
2
+ import { usePageTitle as t } from "../../../lib/pageTitle.js";
3
+ import { Link as n } from "../../../lib/router.js";
4
+ import { membersQuery as r, projectsQuery as i, teamMembersQuery as a, teamsQuery as o } from "../../../api/queries.js";
5
+ import { MailIcon as s } from "../../../components/icons.js";
5
6
  import { projectRef as c } from "../../../lib/projects.js";
6
7
  import { EntityIcon as l } from "../../../components/EntityIcon.js";
7
8
  import { useRoleName as u } from "../../../lib/roles.js";
8
9
  import { Route as d } from "./_username.js";
9
10
  import { IssueList as f } from "../../../pages/issues.js";
10
11
  import { PersonActivity as p } from "../../../components/PersonActivity.js";
11
- import { Avatar as m, EmptyState as h, StatusBadge as g, Tabs as _ } from "@parallelworks/ui";
12
- import { useTranslations as v } from "use-intl";
13
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
14
- import { useQueries as x, useQuery as S, useSuspenseQuery as C } from "@tanstack/react-query";
12
+ import { Avatar as m, StatusBadge as h, Tabs as g } from "@parallelworks/ui";
13
+ import { useTranslations as _ } from "use-intl";
14
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
15
+ import { useQueries as b, useQuery as x, useSuspenseQuery as S } from "@tanstack/react-query";
15
16
  // src/routes/$workspace/people/$username.tsx?tsr-split=component
16
- function w() {
17
- let { workspace: t, username: r } = d.useParams(), { tab: i } = d.useSearch(), a = v("person"), c = u(t), { data: l } = C(n(t)), x = l.find((e) => e.user.username === r);
18
- if (e(x?.user.name ?? r), !x) return /* @__PURE__ */ y("div", {
19
- className: "flex h-full items-center justify-center p-6",
20
- children: /* @__PURE__ */ y(h, {
21
- icon: /* @__PURE__ */ y(s, {}),
22
- title: a("notFound"),
23
- description: a("notFoundDetail")
24
- })
17
+ function C() {
18
+ let { workspace: n, username: i } = d.useParams(), { tab: a } = d.useSearch(), o = _("person"), c = u(n), { data: l } = S(r(n)), b = l.find((e) => e.user.username === i);
19
+ if (t(b?.user.name ?? i), !b) return /* @__PURE__ */ v(e, {
20
+ title: o("notFound"),
21
+ description: o("notFoundDetail")
25
22
  });
26
- let { user: S } = x;
27
- return /* @__PURE__ */ b("div", {
23
+ let { user: x } = b;
24
+ return /* @__PURE__ */ y("div", {
28
25
  className: "flex h-full min-h-0 flex-col",
29
- children: [/* @__PURE__ */ b("section", {
30
- "aria-label": a("profile"),
26
+ children: [/* @__PURE__ */ y("section", {
27
+ "aria-label": o("profile"),
31
28
  className: "flex shrink-0 flex-wrap items-start gap-4 border-b border-border px-4 py-5 md:px-6",
32
- children: [/* @__PURE__ */ y(m, {
33
- name: S.name,
34
- src: S.avatarUrl,
29
+ children: [/* @__PURE__ */ v(m, {
30
+ name: x.name,
31
+ src: x.avatarUrl,
35
32
  size: "xl"
36
- }), /* @__PURE__ */ b("div", {
33
+ }), /* @__PURE__ */ y("div", {
37
34
  className: "min-w-0 flex-1 space-y-2",
38
35
  children: [
39
- /* @__PURE__ */ b("div", {
36
+ /* @__PURE__ */ y("div", {
40
37
  className: "flex flex-wrap items-center gap-2",
41
- children: [/* @__PURE__ */ y("h1", {
38
+ children: [/* @__PURE__ */ v("h1", {
42
39
  className: "truncate text-lg font-semibold tracking-tight",
43
- children: S.name
44
- }), /* @__PURE__ */ y(g, {
40
+ children: x.name
41
+ }), /* @__PURE__ */ v(h, {
45
42
  emphasis: "outline",
46
- children: c(x.role)
43
+ children: c(b.role)
47
44
  })]
48
45
  }),
49
- /* @__PURE__ */ b("p", {
46
+ /* @__PURE__ */ y("p", {
50
47
  className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-muted-foreground",
51
- children: [/* @__PURE__ */ y("span", { children: `@${S.username}` }), S.email && /* @__PURE__ */ b("a", {
52
- href: `mailto:${S.email}`,
48
+ children: [/* @__PURE__ */ v("span", { children: `@${x.username}` }), x.email && /* @__PURE__ */ y("a", {
49
+ href: `mailto:${x.email}`,
53
50
  className: "inline-flex items-center gap-1.5 hover:text-foreground",
54
- children: [/* @__PURE__ */ y(o, { className: "size-3.5" }), S.email]
51
+ children: [/* @__PURE__ */ v(s, { className: "size-3.5" }), x.email]
55
52
  })]
56
53
  }),
57
- /* @__PURE__ */ y(T, {
58
- workspace: t,
59
- username: r
54
+ /* @__PURE__ */ v(w, {
55
+ workspace: n,
56
+ username: i
60
57
  }),
61
- /* @__PURE__ */ y(_, {
58
+ /* @__PURE__ */ v(g, {
62
59
  variant: "segmented",
63
60
  size: "sm",
64
- label: a("sections"),
61
+ label: o("sections"),
65
62
  items: ["issues", "activity"].map((e) => ({
66
63
  value: e,
67
- label: a(`section.${e}`),
68
- href: `/${t}/people/${encodeURIComponent(r)}${e === "activity" ? "?tab=activity" : ""}`
64
+ label: o(`section.${e}`),
65
+ href: `/${n}/people/${encodeURIComponent(i)}${e === "activity" ? "?tab=activity" : ""}`
69
66
  })),
70
- value: i === "activity" ? "activity" : "issues"
67
+ value: a === "activity" ? "activity" : "issues"
71
68
  })
72
69
  ]
73
70
  })]
74
- }), /* @__PURE__ */ y("div", {
71
+ }), /* @__PURE__ */ v("div", {
75
72
  className: "min-h-0 flex-1 overflow-y-auto",
76
- children: i === "activity" ? /* @__PURE__ */ y(p, {
77
- workspace: t,
78
- username: r
79
- }) : /* @__PURE__ */ y(f, { person: r })
73
+ children: a === "activity" ? /* @__PURE__ */ v(p, {
74
+ workspace: n,
75
+ username: i
76
+ }) : /* @__PURE__ */ v(f, { person: i })
80
77
  })]
81
78
  });
82
79
  }
83
- function T({ workspace: e, username: n }) {
84
- let o = v("person"), { data: s = [] } = S(a(e)), { data: u = [] } = S(r(e)), d = s.filter((e) => !e.archivedAt), f = x({ queries: d.map((t) => i(e, t.key)) }), p = d.filter((e, t) => f[t]?.data?.includes(n)), m = (e) => e !== "completed" && e !== "canceled", h = u.filter((e) => m(e.status) && (e.lead === n || e.members.includes(n))), g = "inline-flex max-w-56 items-center gap-1.5 rounded-md border border-border px-2 py-0.5 text-xs hover:bg-muted";
85
- return /* @__PURE__ */ b("dl", {
80
+ function w({ workspace: e, username: t }) {
81
+ let r = _("person"), { data: s = [] } = x(o(e)), { data: u = [] } = x(i(e)), d = s.filter((e) => !e.archivedAt), f = b({ queries: d.map((t) => a(e, t.key)) }), p = d.filter((e, n) => f[n]?.data?.includes(t)), m = (e) => e !== "completed" && e !== "canceled", h = u.filter((e) => m(e.status) && (e.lead === t || e.members.includes(t))), g = "inline-flex max-w-56 items-center gap-1.5 rounded-md border border-border px-2 py-0.5 text-xs hover:bg-muted";
82
+ return /* @__PURE__ */ y("dl", {
86
83
  className: "space-y-1.5 text-xs",
87
- children: [p.length > 0 && /* @__PURE__ */ y(E, {
88
- label: o("teams"),
89
- children: p.map((n) => /* @__PURE__ */ b(t, {
84
+ children: [p.length > 0 && /* @__PURE__ */ v(T, {
85
+ label: r("teams"),
86
+ children: p.map((t) => /* @__PURE__ */ y(n, {
90
87
  to: "/$workspace/teams/$key/issues",
91
88
  params: {
92
89
  workspace: e,
93
- key: n.key
90
+ key: t.key
94
91
  },
95
92
  className: g,
96
- children: [/* @__PURE__ */ y(l, {
97
- icon: n.icon ?? "",
98
- name: n.name,
93
+ children: [/* @__PURE__ */ v(l, {
94
+ icon: t.icon ?? "",
95
+ name: t.name,
99
96
  className: "size-3.5"
100
- }), /* @__PURE__ */ y("span", {
97
+ }), /* @__PURE__ */ v("span", {
101
98
  className: "truncate",
102
- children: n.name
99
+ children: t.name
103
100
  })]
104
- }, n.id))
105
- }), h.length > 0 && /* @__PURE__ */ y(E, {
106
- label: o("projects"),
107
- children: h.map((r) => /* @__PURE__ */ b(t, {
101
+ }, t.id))
102
+ }), h.length > 0 && /* @__PURE__ */ v(T, {
103
+ label: r("projects"),
104
+ children: h.map((i) => /* @__PURE__ */ y(n, {
108
105
  to: "/$workspace/projects/$projectId",
109
106
  params: {
110
107
  workspace: e,
111
- projectId: c(r)
108
+ projectId: c(i)
112
109
  },
113
110
  className: g,
114
111
  children: [
115
- /* @__PURE__ */ y(l, {
116
- icon: r.icon ?? "",
117
- name: r.name,
112
+ /* @__PURE__ */ v(l, {
113
+ icon: i.icon ?? "",
114
+ name: i.name,
118
115
  className: "size-3.5"
119
116
  }),
120
- /* @__PURE__ */ y("span", {
117
+ /* @__PURE__ */ v("span", {
121
118
  className: "truncate",
122
- children: r.name
119
+ children: i.name
123
120
  }),
124
- r.lead === n && /* @__PURE__ */ y("span", {
121
+ i.lead === t && /* @__PURE__ */ v("span", {
125
122
  className: "text-muted-foreground",
126
- children: o("lead")
123
+ children: r("lead")
127
124
  })
128
125
  ]
129
- }, r.id))
126
+ }, i.id))
130
127
  })]
131
128
  });
132
129
  }
133
- function E({ label: e, children: t }) {
134
- return /* @__PURE__ */ b("div", {
130
+ function T({ label: e, children: t }) {
131
+ return /* @__PURE__ */ y("div", {
135
132
  className: "flex flex-wrap items-center gap-1.5",
136
- children: [/* @__PURE__ */ y("dt", {
133
+ children: [/* @__PURE__ */ v("dt", {
137
134
  className: "w-20 shrink-0 text-muted-foreground",
138
135
  children: e
139
- }), /* @__PURE__ */ y("dd", {
136
+ }), /* @__PURE__ */ v("dd", {
140
137
  className: "flex min-w-0 flex-1 flex-wrap gap-1.5",
141
138
  children: t
142
139
  })]
143
140
  });
144
141
  }
145
- export { w as component };
142
+ export { C as component };