@korso/shepherd-ui 0.10.0 → 0.11.1

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,23 +1,23 @@
1
1
  import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
- import { useState as s, useMemo as h } from "react";
3
- import { c as d, a as m, D as u } from "./Dashboard-BSGZuM-A.js";
4
- const i = "shepherd.token";
5
- function p() {
2
+ import { useState as s, useCallback as h, useMemo as d } from "react";
3
+ import { c as m, a as u, D as p } from "./Dashboard-DNr0hdbW.js";
4
+ const n = "shepherd.token";
5
+ function f() {
6
6
  try {
7
- return localStorage.getItem(i) ?? "";
7
+ return localStorage.getItem(n) ?? "";
8
8
  } catch {
9
9
  return "";
10
10
  }
11
11
  }
12
- function f({ onSubmit: t }) {
13
- const [r, a] = s("");
12
+ function g({ onSubmit: r }) {
13
+ const [o, a] = s("");
14
14
  return /* @__PURE__ */ l("section", { id: "gate", className: "gate", children: [
15
15
  /* @__PURE__ */ e("h1", { children: "Shepherd" }),
16
16
  /* @__PURE__ */ e("p", { children: "Enter the team token to view the workspace." }),
17
- /* @__PURE__ */ l("form", { id: "gate-form", onSubmit: (n) => {
18
- n.preventDefault();
19
- const c = r.trim();
20
- c !== "" && t(c);
17
+ /* @__PURE__ */ l("form", { id: "gate-form", onSubmit: (t) => {
18
+ t.preventDefault();
19
+ const i = o.trim();
20
+ i !== "" && r(i);
21
21
  }, children: [
22
22
  /* @__PURE__ */ e(
23
23
  "input",
@@ -27,42 +27,42 @@ function f({ onSubmit: t }) {
27
27
  placeholder: "Team token",
28
28
  "aria-label": "Team token",
29
29
  autoComplete: "off",
30
- value: r,
31
- onChange: (n) => a(n.target.value)
30
+ value: o,
31
+ onChange: (t) => a(t.target.value)
32
32
  }
33
33
  ),
34
34
  /* @__PURE__ */ e("button", { type: "submit", children: "View" })
35
35
  ] })
36
36
  ] });
37
37
  }
38
- function b() {
39
- const [t, r] = s(p), a = h(
40
- () => d({
38
+ function v() {
39
+ const [r, o] = s(f), a = h(() => {
40
+ try {
41
+ localStorage.removeItem(n);
42
+ } catch {
43
+ }
44
+ o("");
45
+ }, []), c = d(
46
+ () => m({
41
47
  baseUrl: "",
42
- getAuthHeader: () => `Bearer ${t}`,
43
- onUnauthorized: () => {
44
- try {
45
- localStorage.removeItem(i);
46
- } catch {
47
- }
48
- r("");
49
- }
48
+ getAuthHeader: () => `Bearer ${r}`,
49
+ onUnauthorized: a
50
50
  }),
51
- [t]
51
+ [a, r]
52
52
  );
53
- return t === "" ? /* @__PURE__ */ e(
54
- f,
53
+ return r === "" ? /* @__PURE__ */ e(
54
+ g,
55
55
  {
56
- onSubmit: (o) => {
56
+ onSubmit: (t) => {
57
57
  try {
58
- localStorage.setItem(i, o);
58
+ localStorage.setItem(n, t);
59
59
  } catch {
60
60
  }
61
- r(o);
61
+ o(t);
62
62
  }
63
63
  }
64
- ) : /* @__PURE__ */ e("div", { className: "wrap", children: /* @__PURE__ */ e(m, { client: a, children: /* @__PURE__ */ e(u, {}) }) });
64
+ ) : /* @__PURE__ */ e("div", { className: "wrap", children: /* @__PURE__ */ e(u, { client: c, children: /* @__PURE__ */ e(p, { onLogout: a }) }) });
65
65
  }
66
66
  export {
67
- b as SelfHostApp
67
+ v as SelfHostApp
68
68
  };
@@ -21,6 +21,12 @@
21
21
  .status--warn { color:var(--terr); }
22
22
  .status--error { color:var(--drop); }
23
23
  .freshness { font-size:12px; color:var(--ink3); }
24
+ .header-signout { font:inherit; font-size:13px; color:var(--ink2); cursor:pointer;
25
+ border:1px solid var(--line); border-radius:8px; padding:5px 11px;
26
+ background:transparent; transition:color .12s ease, border-color .12s ease, background .12s ease; }
27
+ .header-signout:hover { color:var(--ink); border-color:var(--ink3); background:rgba(255,250,238,.35); }
28
+ .header-signout:focus-visible { outline:none; border-color:var(--terr);
29
+ box-shadow:0 0 0 3px rgba(122,106,72,.14); }
24
30
 
25
31
  /* Repo selector (hidden when <2 repos; populated by app.js) */
26
32
  .repo { position:relative; }
@@ -263,6 +269,12 @@
263
269
 
264
270
  /* No-workspace Config prompt (create/join now live in the switcher). */
265
271
  .config-none { color:var(--ink2); font-size:13.5px; max-width:520px; }
272
+ .config-signout { margin-top:28px; padding-top:24px; border-top:1px solid var(--line2); }
273
+ .config-signout .card-body { align-items:flex-start; }
274
+ .shepherd-config .config-signout button { background:transparent; color:var(--ink2);
275
+ border-color:var(--line); padding:7px 14px; }
276
+ .shepherd-config .config-signout button:hover:not(:disabled) { color:var(--ink);
277
+ border-color:var(--ink3); background:rgba(50,44,32,.06); }
266
278
 
267
279
  /* Read-only workspace facts (name / role) in General. Deliberately plain
268
280
  text — no border/background — so they don't read as editable inputs. */