@gemboss/ui 0.50.0 → 0.52.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.
@@ -29,6 +29,7 @@ import React, { useCallback, useEffect, useId, useLayoutEffect, useRef, useState
29
29
  import { createPortal } from "react-dom";
30
30
  import { canFloatMenus, placeFloating } from "../menu-layer";
31
31
  import { EngineMark, isEngineMarkId } from "./engine-mark";
32
+ import { requestEngineSettingsFocus, usePublishEngineSettings } from "./engine-settings-store";
32
33
 
33
34
  const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
34
35
  const useBeforePaint = typeof window === "undefined" ? useEffect : useLayoutEffect;
@@ -102,6 +103,9 @@ export interface EnginePickerLabels {
102
103
  yes: string; no: string; unknown: string;
103
104
  running: string; outdated: string; offline: string; unpaired: string; checking: string;
104
105
  updateDue: string; close: string;
106
+ /** In Settings (`EngineSettings`, 0.52.0): the bridge's first row, under a card already titled `bridge`, and the heading
107
+ * of its install / update part. Optional so a surface's own label set from before 0.52.0 still type-checks. */
108
+ state?: string; setupTitle?: string;
105
109
  }
106
110
  export const ENGINE_PICKER_EN: EnginePickerLabels = {
107
111
  chip: "Engine", dialog: "Assistant engine", tabs: "Engine, setup and status",
@@ -113,6 +117,7 @@ export const ENGINE_PICKER_EN: EnginePickerLabels = {
113
117
  yes: "Yes", no: "No", unknown: "Not known",
114
118
  running: "Running", outdated: "Outdated", offline: "Not connected", unpaired: "Not set up", checking: "Checking",
115
119
  updateDue: "Update available", close: "Close",
120
+ state: "State", setupTitle: "Install or update",
116
121
  };
117
122
 
118
123
  /** The dot's tone per state: one word each, so the CSS has one rule per tone and a test can read it. */
@@ -173,6 +178,11 @@ export interface EnginePickerProps {
173
178
  end?: boolean;
174
179
  /** The chip button, for the surface (`useEnginePicker` passes its own: `close()` puts focus back on it). 0.32.0. */
175
180
  chipRef?: React.Ref<HTMLButtonElement>;
181
+ /** 0.52.0: the chip opens the surface's SETTINGS on its "AI & engines" section, which draws everything the panel held
182
+ * (`EngineSettingsSection`), and there is no panel of its own. Called with "engine" from the chip, with "setup" from
183
+ * `useEnginePicker().openTab("setup")` (a failed turn's Open setup). While that section is on screen, `onOpenChange(true)`:
184
+ * a surface that polls the bridge while the picker is open keeps doing so. See engine-settings.tsx. */
185
+ onOpenSettings?: (tab: EnginePickerTab) => void;
176
186
  labels?: Partial<EnginePickerLabels>;
177
187
  className?: string;
178
188
  }
@@ -184,17 +194,38 @@ export interface EnginePickerProps {
184
194
  * from this machine, before a confirm opens). The button that had focus goes away with the panel, so focus would fall to
185
195
  * <body> and the confirm would record <body> as where to return; `close()` puts it on the chip first. Every surface
186
196
  * wrote that by hand (`querySelector(".gb-engine-chip").focus()`: partner-radar, search-radar, gemwatcher #922). An
187
- * outside click still closes without moving focus (`props.onOpenChange(false)`). */
188
- export function useEnginePicker(initial: EnginePickerTab = "engine") {
197
+ * outside click still closes without moving focus (`props.onOpenChange(false)`).
198
+ *
199
+ * 0.52.0, `{ onOpenSettings }`: the engine lives in the surface's Settings (see `EnginePickerProps.onOpenSettings`).
200
+ * `openTab("setup")` then opens Settings on that section and brings its install / update part into view; `open` is true
201
+ * while the section is on screen; `close()` does nothing (there is no panel, and the chip sits behind the Settings popup:
202
+ * focus stays on the button in Settings, where a confirm it opens comes back to). */
203
+ export function useEnginePicker(options: EnginePickerTab | { initial?: EnginePickerTab; onOpenSettings?: (tab: EnginePickerTab) => void } = "engine") {
204
+ const initial = typeof options === "string" ? options : options.initial ?? "engine";
205
+ const toSettings = typeof options === "string" ? undefined : options.onOpenSettings;
206
+ // The latest opener (a surface passes a new arrow each render), behind one stable function.
207
+ const toSettingsRef = useRef(toSettings);
208
+ toSettingsRef.current = toSettings;
209
+ const inSettings = Boolean(toSettings);
189
210
  const [open, setOpen] = useState(false);
190
211
  const [tab, setTab] = useState<EnginePickerTab>(initial);
191
212
  const chipRef = useRef<HTMLButtonElement | null>(null);
192
- const openTab = useCallback((t: EnginePickerTab) => { setTab(t); setOpen(true); }, []);
213
+ const openSettings = useCallback((t: EnginePickerTab) => {
214
+ requestEngineSettingsFocus(t);
215
+ toSettingsRef.current?.(t);
216
+ }, []);
217
+ const openTab = useCallback((t: EnginePickerTab) => {
218
+ if (toSettingsRef.current) { openSettings(t); return; }
219
+ setTab(t); setOpen(true);
220
+ }, [openSettings]);
193
221
  // Closing goes back to Engine: after "Open setup" the next click on the chip is about the engine again (review #3885).
194
222
  const onOpenChange = useCallback((v: boolean) => { setOpen(v); if (!v) setTab(initial); }, [initial]);
195
223
  const focusChip = useCallback(() => { chipRef.current?.focus(); }, []);
196
- const close = useCallback(() => { onOpenChange(false); focusChip(); }, [onOpenChange, focusChip]);
197
- return { open, tab, setOpen, setTab, openTab, close, focusChip, chipRef, props: { open, onOpenChange, tab, onTabChange: setTab, chipRef } };
224
+ const close = useCallback(() => { if (toSettingsRef.current) return; onOpenChange(false); focusChip(); }, [onOpenChange, focusChip]);
225
+ return {
226
+ open, tab, setOpen, setTab, openTab, close, focusChip, chipRef,
227
+ props: { open, onOpenChange, tab, onTabChange: setTab, chipRef, onOpenSettings: inSettings ? openSettings : undefined },
228
+ };
198
229
  }
199
230
 
200
231
  function availableTabs(p: Pick<EnginePickerProps, "bridge" | "setup">): EnginePickerTab[] {
@@ -227,8 +258,12 @@ export function engineChipName(p: Pick<EnginePickerProps, "engines" | "engine" |
227
258
  export function EnginePicker(props: EnginePickerProps) {
228
259
  const { engines, engine, models, model, bridge, end = false, className } = props;
229
260
  const L = { ...ENGINE_PICKER_EN, ...props.labels };
261
+ const toSettings = props.onOpenSettings;
262
+ // In Settings (0.52.0) the chip hands its props to the "AI & engines" section and hears when that section is on screen.
263
+ usePublishEngineSettings(toSettings ? props : null);
230
264
  const [ownOpen, setOwnOpen] = useState(false);
231
- const open = props.open ?? ownOpen;
265
+ // No panel in Settings: `open` there means "the section is on screen" (useEnginePicker), not a popup to draw.
266
+ const open = toSettings ? false : props.open ?? ownOpen;
232
267
  const { tabs, tab, setTab, resetOwn } = useTabs(props);
233
268
  // Without the popover API (Safari < 17) a fixed layer inside the assistant's frame is cut by it (overflow, and in the
234
269
  // popup and mini modes the frame's backdrop-filter makes it the containing block; full and side have none since
@@ -354,6 +389,30 @@ export function EnginePicker(props: EnginePickerProps) {
354
389
  const mark = current?.mark && isEngineMarkId(current.mark) ? current.mark : null;
355
390
  const tone = bridge && props.showBridgeDot !== false ? BRIDGE_TONE[bridge.state] : null;
356
391
  const name = engineChipName(props.showBridgeDot === false ? { ...props, bridge: undefined } : props, L);
392
+ const chipFace = (
393
+ <>
394
+ {tone ? <span className={DOT_CLASS[tone]} aria-hidden /> : null}
395
+ <span className="gb-engine-chiplabel">
396
+ {current?.label ?? engine}
397
+ {modelLabel ? <span className="gb-engine-chipsub"> · {modelLabel}</span> : null}
398
+ </span>
399
+ {/* Shown instead of the name when the composer is too narrow for it (assistant-engine.css, ChatComposer density). */}
400
+ {mark ? <span className="gb-engine-chipmark"><EngineMark engine={mark} decorative /></span> : null}
401
+ </>
402
+ );
403
+
404
+ if (toSettings) {
405
+ // The same chip, a door to Settings: it opens a dialog (the surface's), so no expanded state or panel id of its own.
406
+ return (
407
+ <span className={cx("gb-engine", className)}>
408
+ <button ref={setChip} type="button" className={mark ? "gb-engine-chip has-mark" : "gb-engine-chip"}
409
+ disabled={props.disabled || undefined} aria-haspopup="dialog" aria-label={name} title={name}
410
+ onClick={() => { requestEngineSettingsFocus("engine"); toSettings("engine"); }}>
411
+ {chipFace}
412
+ </button>
413
+ </span>
414
+ );
415
+ }
357
416
 
358
417
  return (
359
418
  <span className={cx("gb-engine", className)}>
@@ -369,13 +428,7 @@ export function EnginePicker(props: EnginePickerProps) {
369
428
  title={name}
370
429
  onClick={() => setOpen(!open)}
371
430
  >
372
- {tone ? <span className={DOT_CLASS[tone]} aria-hidden /> : null}
373
- <span className="gb-engine-chiplabel">
374
- {current?.label ?? engine}
375
- {modelLabel ? <span className="gb-engine-chipsub"> · {modelLabel}</span> : null}
376
- </span>
377
- {/* Shown instead of the name when the composer is too narrow for it (assistant-engine.css, ChatComposer density). */}
378
- {mark ? <span className="gb-engine-chipmark"><EngineMark engine={mark} decorative /></span> : null}
431
+ {chipFace}
379
432
  </button>
380
433
  {(() => { const panelEl = (<div
381
434
  ref={panelRef}
@@ -510,8 +563,9 @@ function Options({ label, items, value, onChange, locked, onPicked, disabledReas
510
563
  }
511
564
 
512
565
  /** Every engine with its own models, all at once; one click picks both (the admin's popup, 0.29.0). */
513
- function EngineGroups({ engines, engine, model, onPick, onEngineChange, onModelChange, locked, L, onPicked }: EnginePickerProps & { L: EnginePickerLabels; onPicked?: () => void }) {
514
- const id = useId();
566
+ function EngineGroups({ engines, engine, model, onPick, onEngineChange, onModelChange, locked, L, onPicked, labelledBy }: EnginePickerProps & { L: EnginePickerLabels; onPicked?: () => void; labelledBy?: string }) {
567
+ const ownId = useId();
568
+ const id = labelledBy ?? ownId;
515
569
  const choose = (e: EngineChoice, m: Choice) => {
516
570
  // The pick already in force: close, change nothing (a surface that starts a new conversation on a switch must not).
517
571
  if (e.id === engine && (model ?? "") === m.id) { onPicked?.(); return; }
@@ -522,7 +576,7 @@ function EngineGroups({ engines, engine, model, onPick, onEngineChange, onModelC
522
576
  const canChoose = Boolean(onPick || onEngineChange || onModelChange);
523
577
  return (
524
578
  <div className="gb-engine-field">
525
- <span className="gb-engine-label" id={id}>{L.engine}</span>
579
+ {labelledBy ? null : <span className="gb-engine-label" id={id}>{L.engine}</span>}
526
580
  <div className="gb-engine-groups" role="group" aria-labelledby={id}>
527
581
  {engines.map((e) => {
528
582
  const chosen = e.id === engine;
@@ -552,9 +606,12 @@ function EngineGroups({ engines, engine, model, onPick, onEngineChange, onModelC
552
606
  );
553
607
  }
554
608
 
555
- function EngineTab(props: EnginePickerProps & { L: EnginePickerLabels; onPicked?: () => void }) {
556
- const { engines, engine, onEngineChange, models, model, onModelChange, modelControl, efforts, effort, onEffortChange, effortDisabled, notes, locked, L, onPicked } = props;
557
- const id = useId();
609
+ /** The Engine tab's content. `labelledBy` (0.52.0, Settings): a heading outside names the engine list, so its own "Engine"
610
+ * label is not drawn a second time under it. */
611
+ export function EngineTab(props: EnginePickerProps & { L: EnginePickerLabels; onPicked?: () => void; labelledBy?: string }) {
612
+ const { engines, engine, onEngineChange, models, model, onModelChange, modelControl, efforts, effort, onEffortChange, effortDisabled, notes, locked, L, onPicked, labelledBy } = props;
613
+ const ownId = useId();
614
+ const id = labelledBy ?? ownId;
558
615
  if (engines.some((e) => e.models && e.models.length)) {
559
616
  return (
560
617
  <>
@@ -582,7 +639,7 @@ function EngineTab(props: EnginePickerProps & { L: EnginePickerLabels; onPicked?
582
639
  return (
583
640
  <>
584
641
  <div className="gb-engine-field">
585
- <span className="gb-engine-label" id={id}>{L.engine}</span>
642
+ {labelledBy ? null : <span className="gb-engine-label" id={id}>{L.engine}</span>}
586
643
  <div className="gb-engine-list" role="radiogroup" aria-labelledby={id} onKeyDown={onKey}>
587
644
  {engines.map((e) => (
588
645
  <button
@@ -635,7 +692,19 @@ export async function copyText(text: string): Promise<boolean> {
635
692
  } catch { return false; }
636
693
  }
637
694
 
638
- function SetupTab({ setup, bridge, L }: { setup: BridgeSetup; bridge?: BridgeStatus; L: EnginePickerLabels }) {
695
+ /** What is wrong with the bridge, in one callout: on Setup, and at the top of the bridge card in Settings. */
696
+ export function BridgeCallout({ bridge, L }: { bridge?: BridgeStatus; L: EnginePickerLabels }) {
697
+ if (!(bridge?.state === "outdated" || bridge?.state === "offline" || bridge?.state === "unpaired")) return null;
698
+ return (
699
+ <p className={cx("gb-engine-callout", bridge.state === "outdated" ? "gb-engine-callout--warn" : "gb-engine-callout--down")}>
700
+ <strong>{L.bridge}: {L[STATE_LABEL[bridge.state]]!.toLowerCase()}.</strong>
701
+ {bridge.detail ? <> {bridge.detail}</> : null}
702
+ </p>
703
+ );
704
+ }
705
+
706
+ /** The Setup tab's content. `noCallout` (Settings): the bridge card already says what is wrong above it. */
707
+ export function SetupTab({ setup, bridge, L, noCallout = false }: { setup: BridgeSetup; bridge?: BridgeStatus; L: EnginePickerLabels; noCallout?: boolean }) {
639
708
  const [said, setSaid] = useState<"" | "copied" | "failed">("");
640
709
  const timer = useRef<number | undefined>(undefined);
641
710
  useEffect(() => () => window.clearTimeout(timer.current), []);
@@ -648,13 +717,8 @@ function SetupTab({ setup, bridge, L }: { setup: BridgeSetup; bridge?: BridgeSta
648
717
  };
649
718
  return (
650
719
  <>
651
- {bridge?.state === "outdated" || bridge?.state === "offline" || bridge?.state === "unpaired" ? (
652
- <p className={cx("gb-engine-callout", bridge.state === "outdated" ? "gb-engine-callout--warn" : "gb-engine-callout--down")}>
653
- <strong>{L.bridge}: {L[STATE_LABEL[bridge.state]].toLowerCase()}.</strong>
654
- {bridge.detail ? <> {bridge.detail}</> : null}
655
- </p>
656
- ) : null}
657
- {setup.steps || setup.command ? <div className="gb-engine-steps">{setup.steps ?? <p>{L.steps}</p>}</div> : null}
720
+ {noCallout ? null : <BridgeCallout bridge={bridge} L={L} />}
721
+ {setup.steps || setup.command ?<div className="gb-engine-steps">{setup.steps ?? <p>{L.steps}</p>}</div> : null}
658
722
  {setup.command ? (
659
723
  <>
660
724
  <pre className="gb-engine-cmd"><code>{setup.command}</code></pre>
@@ -674,20 +738,23 @@ function SetupTab({ setup, bridge, L }: { setup: BridgeSetup; bridge?: BridgeSta
674
738
  );
675
739
  }
676
740
 
677
- function StatusTab({ bridge, actions, L }: { bridge: BridgeStatus; actions?: ReactNode; L: EnginePickerLabels }) {
741
+ /** The Status tab's content. `inSettings`: the card is titled with the bridge, so the first row says "State", and the
742
+ * callout above it already carries `detail`. */
743
+ export function StatusTab({ bridge, actions, L, inSettings = false }: { bridge: BridgeStatus; actions?: ReactNode; L: EnginePickerLabels; inSettings?: boolean }) {
678
744
  const tone = BRIDGE_TONE[bridge.state];
679
745
  const yesNo = (v: boolean | undefined) => (v === undefined ? L.unknown : v ? L.yes : L.no);
746
+ const calledOut = inSettings && (bridge.state === "outdated" || bridge.state === "offline" || bridge.state === "unpaired");
680
747
  return (
681
748
  <>
682
749
  <dl className="gb-engine-rows">
683
- <dt>{L.bridge}</dt>
750
+ <dt>{inSettings ? L.state ?? ENGINE_PICKER_EN.state : L.bridge}</dt>
684
751
  <dd><span className={DOT_CLASS[tone]} aria-hidden /> {L[STATE_LABEL[bridge.state]]}</dd>
685
752
  {bridge.version ? <><dt>{L.version}</dt><dd>{bridge.version}{bridge.latest && bridge.latest !== bridge.version ? ` · ${L.latest} ${bridge.latest}` : ""}</dd></> : null}
686
753
  <dt>{L.startsAtSignIn}</dt><dd>{yesNo(bridge.autostart)}</dd>
687
754
  {bridge.machine ? <><dt>{L.machine}</dt><dd>{bridge.machine}</dd></> : null}
688
755
  {bridge.lastSeen ? <><dt>{L.lastSeen}</dt><dd>{bridge.lastSeen}</dd></> : null}
689
756
  </dl>
690
- {bridge.detail && bridge.state !== "running" ? <p className="gb-engine-note">{bridge.detail}</p> : null}
757
+ {bridge.detail && bridge.state !== "running" && !calledOut ? <p className="gb-engine-note">{bridge.detail}</p> : null}
691
758
  {actions ? <div className="gb-engine-actions">{actions}</div> : null}
692
759
  </>
693
760
  );
@@ -5,6 +5,8 @@ export { AssistantProvider, SIDE_WIDTH_VAR, useAssistant, useAssistantPageFacts,
5
5
  export * from "./dock";
6
6
  export { AssistantWorkspaceLayout, OpenChatTabs, SessionRail, SESSION_RAIL_EN, groupSessions, normalizeForSearch, relativeTime, type AssistantSession, type SessionGroup, type SessionRailIcons, type SessionRailLabels } from "./sessions";
7
7
  export { BRIDGE_TONE, BridgeNotice, ENGINE_PICKER_EN, EnginePanel, EnginePicker, engineChipName, useEnginePicker, type BridgeSetup, type BridgeState, type BridgeStatus, type Choice, type EngineChoice, type EnginePickerLabels, type EnginePickerProps, type EnginePickerTab } from "./engine";
8
+ // 0.52.0: the engine in the surface's Settings ("AI & engines"): the chip opens it (`onOpenSettings`), the section draws it.
9
+ export { EngineSettings, EngineSettingsSection, type EngineSettingsProps } from "./engine-settings";
8
10
  // 0.29.0: the chat BODY as components (the surface hands in messages and actions), its markdown, and each engine's mark.
9
11
  export { AssistantChat, ChatAttach, ChatBubble, ChatComposer, ChatError, ChatLabelsProvider, ChatMarkdown, ChatMessage, ChatMeta, ChatNote, ChatPending, ChatStarters, ChatSteps, ChatThread, CHAT_EN, PaperclipIcon, firstBlank, selectBlank, useComposerDensity, useFullChromeRoom, type AssistantChatProps, type ChatComposerProps, type ChatFix, type ChatLabels, type ChatMarkdownProps, type ChatMessageData, type ChatStarter, type ChatStep, type ComposerDensity } from "./chat";
10
12
  export { bareUrl, CODE_FOLD_LINES, FLEET_IMAGE_HOSTS, imageSource, linkTarget, parseBlocks, parseInline, type Block, type ImageHost, type Inline, type InlineOptions } from "./chat-markdown";
@@ -1 +1 @@
1
- .gb-engine{display:inline-flex;min-width:0;max-width:100%}.gb-engine-chip{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;box-sizing:border-box;height:var(--ui-btn-h, 28px);padding:0 24px 0 8px;font:inherit;font-size:var(--ui-fs-caption, 12px);font-weight:500;line-height:20px;white-space:nowrap;color:var(--ui-text-muted);background-color:transparent;border:1px solid transparent;border-radius:var(--ui-radius-md, 8px);cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23686b71' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center}@media (hover: hover){.gb-engine-chip:hover{color:var(--ui-text);background-color:var(--gemboss-hover, rgba(0,0,0,.05))}}@media (hover: none){.gb-engine-chip{color:var(--ui-text)}}.gb-engine-chip[aria-expanded=true]{color:var(--ui-text);background-color:var(--gemboss-hover, rgba(0,0,0,.05))}.gb-engine-chip:focus-visible{color:var(--ui-text);outline:2px solid var(--ui-focus);outline-offset:2px}.gb-engine-chiplabel{min-width:0;overflow:hidden;text-overflow:ellipsis}.gb-engine-chipsub{font-weight:450}.gb-engine-chip:disabled{cursor:default;opacity:.55}.gemboss-engine-mark{display:block;width:14px;height:14px;flex:0 0 auto}.gb-engine-chipmark{display:none}.gb-engine-chipmark .gemboss-engine-mark{width:16px;height:16px}.gemboss-ec-input:not([data-density=full]) .gb-engine-chipsub{display:none}.gemboss-ec-input:is([data-density=icon],[data-density=tight]) .gb-engine-chip.has-mark .gb-engine-chiplabel{display:none}.gemboss-ec-input:is([data-density=icon],[data-density=tight]) .gb-engine-chip.has-mark .gb-engine-chipmark{display:block}.gemboss-ec-input:is([data-density=icon],[data-density=tight]) .gb-engine:has(.has-mark){flex-shrink:0}.gb-engine-dot{flex:none;display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--ui-text-muted);vertical-align:middle}.gb-engine-dot--ok{background:var(--gemboss-success, #007f5f)}.gb-engine-dot--warn{background:#e8a10a;box-shadow:0 0 0 1px var(--gemboss-warning, #9a6700) inset}.gb-engine-dot--down{background:var(--gemboss-danger, #d72c0d)}.gb-engine-dot--idle{background:transparent;box-shadow:0 0 0 1.5px var(--ui-text-muted) inset}.gb-engine-panel{position:fixed;z-index:1000;inset:auto;margin:0;width:min(360px,calc(100vw - 16px));box-sizing:border-box;overflow:auto;overscroll-behavior:contain;padding:0 0 var(--ui-space-3, 12px);color:var(--ui-text);font-size:var(--ui-fs-caption, 12px);line-height:16px}.gb-engine-panel[hidden],.gb-engine-panel[popover]:not(:popover-open):not([data-open]){display:none}:where(.gb-engine-panel[popover]){border:0;background:none;color:inherit}.gb-engine-panel--inline{position:static;z-index:auto;overflow:visible}.gb-engine-tabs{padding:0 var(--ui-space-2, 8px)}.gb-engine-tabs>button{gap:6px}.gb-engine-pane{display:grid;gap:var(--ui-space-3, 12px);padding:var(--ui-space-3, 12px) var(--ui-space-3, 12px) 0}.gb-engine-pane p{margin:0}.gb-engine-field{display:grid;gap:6px}.gb-engine-label{font-weight:550;color:var(--ui-text-strong, var(--ui-text))}.gb-engine-note{color:var(--ui-text-muted)}.gb-engine-list{display:grid;border:1px solid var(--ui-border);border-radius:var(--ui-radius-md, 8px);overflow:hidden}.gb-engine-row{display:grid;gap:2px;min-height:44px;padding:6px 10px 6px 32px;box-sizing:border-box;position:relative;font:inherit;text-align:left;color:inherit;background:transparent;border:0;cursor:pointer}.gb-engine-row+.gb-engine-row{border-top:1px solid var(--ui-border)}.gb-engine-row:before{content:"";position:absolute;left:10px;top:50%;width:14px;height:14px;margin-top:-7px;box-sizing:border-box;border:1.5px solid var(--ui-text-muted);border-radius:50%}.gb-engine-row[aria-checked=true]{background:var(--gemboss-active-bg, #f0f1f4)}.gb-engine-row[aria-checked=true]:before{border:4.5px solid var(--ui-accent)}.gb-engine-row[aria-checked=true] .gb-engine-rowname{font-weight:600}@media (hover: hover){.gb-engine-row:hover:not(:disabled){background:var(--ui-surface-2)}}.gb-engine-row:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}.gb-engine-row:disabled{cursor:not-allowed}.gb-engine-row:disabled .gb-engine-rowname{color:var(--ui-text-muted)}.gb-engine-rowhead{display:flex;align-items:center;gap:var(--ui-space-2, 8px);min-width:0}.gb-engine-rowname{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:450}.gb-engine-opts{display:flex;flex-wrap:wrap;gap:var(--ui-space-2, 8px)}.gb-engine-opt{height:var(--ui-btn-h, 28px);padding:0 10px;box-sizing:border-box;font:inherit;font-weight:500;color:var(--ui-text);background:transparent;border:1px solid var(--ui-border);border-radius:var(--ui-radius-md, 8px);cursor:pointer}@media (hover: hover){.gb-engine-opt:hover:not(:disabled){background:var(--ui-surface-2)}}.gb-engine-opt[aria-pressed=true]{background:var(--gemboss-active-bg, #f0f1f4);border-color:var(--ui-text);font-weight:600}.gb-engine-opt:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.gb-engine-opt:disabled{opacity:.5;cursor:not-allowed}.gb-engine-select{width:100%}.gb-engine-groups{display:grid;gap:var(--ui-space-3, 12px)}.gb-engine-group{display:grid;gap:6px}.gb-engine-group+.gb-engine-group{padding-top:var(--ui-space-3, 12px);border-top:1px solid var(--ui-border)}.gb-engine-group[data-current] .gb-engine-rowname{font-weight:600}.gb-engine-problem{color:var(--gemboss-danger-strong, #b42318)}.gb-engine-notes{display:grid;gap:4px;color:var(--ui-text-muted)}.gb-engine-notes p{margin:0}.gb-engine-callout{padding:8px 10px;border-radius:var(--ui-radius-md, 8px);border:1px solid}.gb-engine-callout--warn{background:var(--gemboss-warning-soft, #fff8e0);border-color:var(--gemboss-warning-border, #f5d569);color:var(--gemboss-warning, #9a6700)}.gb-engine-callout--down{background:var(--gemboss-danger-soft, #fff0e9);border-color:var(--gemboss-danger-border, #f5c9bc);color:var(--gemboss-danger-strong, #b42318)}.gb-engine-steps ol,.gb-engine-steps ul{margin:0;padding-left:18px;display:grid;gap:4px}.gb-engine-cmd{margin:0;padding:8px 10px;border-radius:var(--ui-radius-md, 8px);background:var(--ui-surface-2);border:1px solid var(--ui-border);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;line-height:16px;white-space:pre-wrap;word-break:break-all;user-select:all;max-height:96px;overflow:auto}.gb-engine-cmd code{padding:0;border:0;background:none;font:inherit;color:inherit}.gb-engine-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-space-2, 8px)}.gb-engine-said{color:var(--ui-text-muted)}.gb-engine-said:empty{display:none}.gb-engine-code code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:600;letter-spacing:.04em;user-select:all}.gb-engine-rows{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;margin:0}.gb-engine-rows dt{color:var(--ui-text-muted)}.gb-engine-rows dd{margin:0;display:flex;align-items:center;gap:6px;min-width:0;overflow-wrap:anywhere}.gb-engine-notice{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:4px 6px;margin:0;padding:4px 0;font-size:var(--ui-fs-caption, 12px);line-height:16px;color:var(--ui-text-muted)}.gb-engine-notice>.gb-engine-dot{margin-top:4px}.gb-engine-notice>.gb-engine-notice-link{grid-column:2;justify-self:start}.gb-engine-notice--down .gb-engine-notice-text,.gb-engine-notice--warn .gb-engine-notice-text{color:var(--ui-text)}.gb-engine-notice-text{min-width:0;overflow-wrap:anywhere}.gb-engine-notice-link{flex:none;display:inline-flex;align-items:center;min-height:24px;margin:-4px 0 -4px -4px;padding:0 4px;border:0;border-radius:4px;background:none;font:inherit;font-weight:550;color:var(--ui-accent);text-decoration:underline;text-underline-offset:2px;cursor:pointer}.gb-engine-notice-link:focus-visible{outline:2px solid var(--ui-focus);outline-offset:0}@media (pointer: coarse),(max-width: 47.9975em){.gb-engine-chip{min-height:44px}.gb-engine-opt{min-height:44px;min-width:44px}.gb-engine-notice-link{min-height:44px;margin:-14px 0 -14px -8px;padding:0 8px}}@media (prefers-reduced-motion: no-preference){.gb-engine-chip,.gb-engine-opt,.gb-engine-row{transition:background-color .12s ease,color .12s ease}}
1
+ .gb-engine{display:inline-flex;min-width:0;max-width:100%}.gb-engine-chip{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;box-sizing:border-box;height:var(--ui-btn-h, 28px);padding:0 24px 0 8px;font:inherit;font-size:var(--ui-fs-caption, 12px);font-weight:500;line-height:20px;white-space:nowrap;color:var(--ui-text-muted);background-color:transparent;border:1px solid transparent;border-radius:var(--ui-radius-md, 8px);cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23686b71' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center}@media (hover: hover){.gb-engine-chip:hover{color:var(--ui-text);background-color:var(--gemboss-hover, rgba(0,0,0,.05))}}@media (hover: none){.gb-engine-chip{color:var(--ui-text)}}.gb-engine-chip[aria-expanded=true]{color:var(--ui-text);background-color:var(--gemboss-hover, rgba(0,0,0,.05))}.gb-engine-chip:focus-visible{color:var(--ui-text);outline:2px solid var(--ui-focus);outline-offset:2px}.gb-engine-chiplabel{min-width:0;overflow:hidden;text-overflow:ellipsis}.gb-engine-chipsub{font-weight:450}.gb-engine-chip:disabled{cursor:default;opacity:.55}.gemboss-engine-mark{display:block;width:14px;height:14px;flex:0 0 auto}.gb-engine-chipmark{display:none}.gb-engine-chipmark .gemboss-engine-mark{width:16px;height:16px}.gemboss-ec-input:not([data-density=full]) .gb-engine-chipsub{display:none}.gemboss-ec-input:is([data-density=icon],[data-density=tight]) .gb-engine-chip.has-mark .gb-engine-chiplabel{display:none}.gemboss-ec-input:is([data-density=icon],[data-density=tight]) .gb-engine-chip.has-mark .gb-engine-chipmark{display:block}.gemboss-ec-input:is([data-density=icon],[data-density=tight]) .gb-engine:has(.has-mark){flex-shrink:0}.gb-engine-dot{flex:none;display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--ui-text-muted);vertical-align:middle}.gb-engine-dot--ok{background:var(--gemboss-success, #007f5f)}.gb-engine-dot--warn{background:#e8a10a;box-shadow:0 0 0 1px var(--gemboss-warning, #9a6700) inset}.gb-engine-dot--down{background:var(--gemboss-danger, #d72c0d)}.gb-engine-dot--idle{background:transparent;box-shadow:0 0 0 1.5px var(--ui-text-muted) inset}.gb-engine-panel{position:fixed;z-index:1000;inset:auto;margin:0;width:min(360px,calc(100vw - 16px));box-sizing:border-box;overflow:auto;overscroll-behavior:contain;padding:0 0 var(--ui-space-3, 12px);color:var(--ui-text);font-size:var(--ui-fs-caption, 12px);line-height:16px}.gb-engine-panel[hidden],.gb-engine-panel[popover]:not(:popover-open):not([data-open]){display:none}:where(.gb-engine-panel[popover]){border:0;background:none;color:inherit}.gb-engine-panel--inline{position:static;z-index:auto;overflow:visible}.gb-engine-tabs{padding:0 var(--ui-space-2, 8px)}.gb-engine-tabs>button{gap:6px}.gb-engine-pane{display:grid;gap:var(--ui-space-3, 12px);padding:var(--ui-space-3, 12px) var(--ui-space-3, 12px) 0}.gb-engine-pane p{margin:0}.gb-engine-field{display:grid;gap:6px}.gb-engine-label{font-weight:550;color:var(--ui-text-strong, var(--ui-text))}.gb-engine-note{color:var(--ui-text-muted)}.gb-engine-list{display:grid;border:1px solid var(--ui-border);border-radius:var(--ui-radius-md, 8px);overflow:hidden}.gb-engine-row{display:grid;gap:2px;min-height:44px;padding:6px 10px 6px 32px;box-sizing:border-box;position:relative;font:inherit;text-align:left;color:inherit;background:transparent;border:0;cursor:pointer}.gb-engine-row+.gb-engine-row{border-top:1px solid var(--ui-border)}.gb-engine-row:before{content:"";position:absolute;left:10px;top:50%;width:14px;height:14px;margin-top:-7px;box-sizing:border-box;border:1.5px solid var(--ui-text-muted);border-radius:50%}.gb-engine-row[aria-checked=true]{background:var(--gemboss-active-bg, #f0f1f4)}.gb-engine-row[aria-checked=true]:before{border:4.5px solid var(--ui-accent)}.gb-engine-row[aria-checked=true] .gb-engine-rowname{font-weight:600}@media (hover: hover){.gb-engine-row:hover:not(:disabled){background:var(--ui-surface-2)}}.gb-engine-row:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}.gb-engine-row:disabled{cursor:not-allowed}.gb-engine-row:disabled .gb-engine-rowname{color:var(--ui-text-muted)}.gb-engine-rowhead{display:flex;align-items:center;gap:var(--ui-space-2, 8px);min-width:0}.gb-engine-rowname{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:450}.gb-engine-opts{display:flex;flex-wrap:wrap;gap:var(--ui-space-2, 8px)}.gb-engine-opt{height:var(--ui-btn-h, 28px);padding:0 10px;box-sizing:border-box;font:inherit;font-weight:500;color:var(--ui-text);background:transparent;border:1px solid var(--ui-border);border-radius:var(--ui-radius-md, 8px);cursor:pointer}@media (hover: hover){.gb-engine-opt:hover:not(:disabled){background:var(--ui-surface-2)}}.gb-engine-opt[aria-pressed=true]{background:var(--gemboss-active-bg, #f0f1f4);border-color:var(--ui-text);font-weight:600}.gb-engine-opt:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.gb-engine-opt:disabled{opacity:.5;cursor:not-allowed}.gb-engine-select{width:100%}.gb-engine-groups{display:grid;gap:var(--ui-space-3, 12px)}.gb-engine-group{display:grid;gap:6px}.gb-engine-group+.gb-engine-group{padding-top:var(--ui-space-3, 12px);border-top:1px solid var(--ui-border)}.gb-engine-group[data-current] .gb-engine-rowname{font-weight:600}.gb-engine-problem{color:var(--gemboss-danger-strong, #b42318)}.gb-engine-notes{display:grid;gap:4px;color:var(--ui-text-muted)}.gb-engine-notes p{margin:0}.gb-engine-callout{padding:8px 10px;border-radius:var(--ui-radius-md, 8px);border:1px solid}.gb-engine-callout--warn{background:var(--gemboss-warning-soft, #fff8e0);border-color:var(--gemboss-warning-border, #f5d569);color:var(--gemboss-warning, #9a6700)}.gb-engine-callout--down{background:var(--gemboss-danger-soft, #fff0e9);border-color:var(--gemboss-danger-border, #f5c9bc);color:var(--gemboss-danger-strong, #b42318)}.gb-engine-steps ol,.gb-engine-steps ul{margin:0;padding-left:18px;display:grid;gap:4px}.gb-engine-cmd{margin:0;padding:8px 10px;border-radius:var(--ui-radius-md, 8px);background:var(--ui-surface-2);border:1px solid var(--ui-border);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;line-height:16px;white-space:pre-wrap;word-break:break-all;user-select:all;max-height:96px;overflow:auto}.gb-engine-cmd code{padding:0;border:0;background:none;font:inherit;color:inherit}.gb-engine-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ui-space-2, 8px)}.gb-engine-said{color:var(--ui-text-muted)}.gb-engine-said:empty{display:none}.gb-engine-code code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:600;letter-spacing:.04em;user-select:all}.gb-engine-rows{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;margin:0}.gb-engine-rows dt{color:var(--ui-text-muted)}.gb-engine-rows dd{margin:0;display:flex;align-items:center;gap:6px;min-width:0;overflow-wrap:anywhere}.gb-engine-settings{display:grid;gap:var(--ui-space-4, 16px);max-width:662px;font-size:var(--ui-fs-body, 13px);line-height:20px}.gb-engine-sect{display:grid;gap:var(--ui-space-3, 12px)}.gb-engine-sect>.ui-card__title{margin:0}.gb-engine-sect p{margin:0}.gb-engine-sect:focus,.gb-engine-sub:focus{outline:none}.gb-engine-sub{display:grid;gap:var(--ui-space-3, 12px);padding-top:var(--ui-space-3, 12px);border-top:1px solid var(--ui-border);scroll-margin-top:var(--ui-space-4, 16px)}.gb-engine-subtitle{margin:0;font-size:inherit;line-height:inherit;font-weight:650}.gb-engine-settings .gb-engine-cmd{max-height:none}.gb-engine-notice{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:4px 6px;margin:0;padding:4px 0;font-size:var(--ui-fs-caption, 12px);line-height:16px;color:var(--ui-text-muted)}.gb-engine-notice>.gb-engine-dot{margin-top:4px}.gb-engine-notice>.gb-engine-notice-link{grid-column:2;justify-self:start}.gb-engine-notice--down .gb-engine-notice-text,.gb-engine-notice--warn .gb-engine-notice-text{color:var(--ui-text)}.gb-engine-notice-text{min-width:0;overflow-wrap:anywhere}.gb-engine-notice-link{flex:none;display:inline-flex;align-items:center;min-height:24px;margin:-4px 0 -4px -4px;padding:0 4px;border:0;border-radius:4px;background:none;font:inherit;font-weight:550;color:var(--ui-accent);text-decoration:underline;text-underline-offset:2px;cursor:pointer}.gb-engine-notice-link:focus-visible{outline:2px solid var(--ui-focus);outline-offset:0}@media (pointer: coarse),(max-width: 47.9975em){.gb-engine-chip{min-height:44px}.gb-engine-opt{min-height:44px;min-width:44px}.gb-engine-notice-link{min-height:44px;margin:-14px 0 -14px -8px;padding:0 8px}}@media (prefers-reduced-motion: no-preference){.gb-engine-chip,.gb-engine-opt,.gb-engine-row{transition:background-color .12s ease,color .12s ease}}
@@ -0,0 +1 @@
1
+ .gb-auth-stage--foot{flex-direction:column}.gb-auth-bottom{box-sizing:border-box;width:100%;max-width:380px;margin:clamp(12px,3cqh,24px) auto 0}@container gb-auth (min-width: 900px) and (min-height: 520px){.gb-auth-bottom{max-width:400px}}@container gb-auth (max-height: 399.98px){.gb-auth-bottom{display:none}}.gb-auth-field.gb-auth-field--forgot{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:12px}.gb-auth-field--forgot>.gb-auth-pw{grid-column:1 / -1;grid-row:2}.gb-auth-forgot{grid-column:2;grid-row:1;min-height:24px;margin:-4px 0;line-height:24px;color:var(--gb-accent);font-size:12px;font-weight:600;text-decoration:none;white-space:nowrap}.gb-auth-forgot:hover,.gb-auth-forgot:focus-visible{text-decoration:underline}.gb-auth-shot{margin:32px 0 0}.gb-auth-shot-win{position:relative;overflow:hidden;padding-top:28px;border-radius:12px;background:var(--gb-shot-bg, #ffffff);box-shadow:var(--gb-shot-shadow, 0 0 0 1px rgba(255, 255, 255, .08), 0 24px 56px -12px rgba(0, 0, 0, .6))}.gb-auth-shot-win:before{content:"";position:absolute;inset:0 0 auto;box-sizing:border-box;height:28px;border-bottom:1px solid var(--gb-shot-line, #e7e8eb);background:var(--gb-shot-bar, #f6f6f7)}.gb-auth-shot-win:after{content:"";position:absolute;top:10px;left:12px;width:8px;height:8px;border-radius:50%;background:var(--gb-shot-dot, #d2d4d9);box-shadow:14px 0 var(--gb-shot-dot, #d2d4d9),28px 0 var(--gb-shot-dot, #d2d4d9)}.gb-auth-shot-win>img{display:block;width:100%;height:auto;max-height:calc(100cqh - 400px);object-fit:cover;object-position:left top}.gb-auth-shot figcaption{margin-top:12px;font-size:13px;line-height:1.5;color:var(--gb-panel-muted)}@container gb-auth (max-height: 599.98px){.gb-auth-shot{display:none}}
@@ -0,0 +1 @@
1
+ .gb-auth-footer{--gemboss-surface: var(--gb-surface);--gemboss-text: var(--gb-ink);--gemboss-text-strong: var(--gb-ink);--gemboss-text-muted: var(--gb-muted);--gemboss-hover: var(--gb-hover);--gemboss-divider: var(--gb-line);--gemboss-chip-line: var(--gb-field-line);--gemboss-chip-line-hover: var(--gb-hover-line);--gemboss-accent: var(--gb-accent);--gemboss-accent-strong: var(--gb-accent);--gemboss-primary: var(--gb-ink);display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:0 8px;font-size:12px;color:var(--gb-muted)}.gb-auth-footer-tools{display:flex;align-items:center;gap:4px}.gb-auth-footer .gb-theme-toggle{width:44px;height:44px}.gb-auth-footer :is(.gb-lang--topbar,.gb-lang--inline)>.gb-lang__btn{height:44px;min-width:44px}.gb-auth-footer-links{display:flex;flex-wrap:wrap;align-items:center;margin-left:auto}.gb-auth-footer-links a{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:44px;min-height:44px;padding:0 8px;border-radius:8px;color:var(--gb-muted);font-weight:500;text-decoration:none}.gb-auth-footer-links a+a:before{content:"";position:absolute;top:50%;left:-1.5px;width:3px;height:3px;margin-top:-1.5px;border-radius:50%;background:var(--gb-field-line)}.gb-auth-footer-links a:hover{color:var(--gb-ink);text-decoration:underline}.gb-auth-footer-links a:focus-visible{outline:2px solid var(--gb-ink);outline-offset:-2px;color:var(--gb-ink)}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * AuthFooter — @gemboss/ui, unreleased (24/10/2026). The row at the bottom of the sign-in screen's form column.
3
+ *
4
+ * Chris's design canvas (24/10/2026) for one sign-in and sign-up across GemBoss, GemCommunity and GemBoss Affiliates ends
5
+ * the left column with one row: the dark / light toggle, the EN / VI / 中 language button, then Help · Terms · Privacy.
6
+ * Each product drew its own corner for these (GemCommunity a "🌐 EN ⌄" on its sign-in pages, the admin nothing), so it
7
+ * lives here, and it is made of the kit's own controls rather than new ones:
8
+ * - the theme button is `ThemeToggle` (theme.tsx): the same `data-theme` on <html>, the same stored key that `themeScript`
9
+ * reads, so a choice made on the sign-in is the choice on every kit page after it. It is told to follow the OS while no
10
+ * choice has been made (`followsSystem`), because the sign-in screen does (auth.css);
11
+ * - the language button is `LanguageSwitcher` (language-switcher.tsx), the ghost `topbar` variant, its menu opening from
12
+ * its left edge. The bordered `inline` pill was tried first: at the row's 44px it stood out as the one boxed thing in a
13
+ * row of quiet links (screenshots 24/10/2026, 1280 and 390). A surface that wants it passes `language.variant`;
14
+ * - the links are plain links, each a 44px target.
15
+ *
16
+ * Render it through AuthLayout's `footer`, which places it under the card, not in it. Presentational: no state of its own,
17
+ * so a server component can render it (a language list of `href`s switches with no script). Its stylesheet travels with
18
+ * it (auth-footer.css, its own entry). The surface keeps the storage of the language (`language.onChange`), as with
19
+ * LanguageSwitcher anywhere, and should put `themeScript` in <head> so a stored theme is on before the first paint.
20
+ */
21
+ import "./auth-footer.css";
22
+ import React from "react";
23
+ import { LanguageSwitcher, type LanguageSwitcherProps } from "./language-switcher";
24
+ import { ThemeToggle } from "./theme";
25
+
26
+ const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
27
+
28
+ /** The words it writes: the three links, and the name a screen reader hears for the group of links. */
29
+ export interface AuthFooterLabels {
30
+ help: string;
31
+ terms: string;
32
+ privacy: string;
33
+ links: string;
34
+ }
35
+ export const AUTH_FOOTER_LABELS: Readonly<AuthFooterLabels> = Object.freeze({ help: "Help", terms: "Terms", privacy: "Privacy", links: "Help and policies" });
36
+
37
+ export interface AuthFooterProps {
38
+ /** The dark / light button. Default on; `false` on a product with no dark theme behind its sign-in. */
39
+ theme?: boolean;
40
+ /** ThemeToggle's names for the button ("Switch to dark mode" / "Switch to light mode"). */
41
+ themeLabels?: { toDark: string; toLight: string };
42
+ /** The language button: LanguageSwitcher's props (`value`, and `onChange` or `href`s on the languages). Left out: none.
43
+ * `variant` defaults to `topbar` (the ghost button) and `end` to false (the menu opens from the button's left edge). */
44
+ language?: LanguageSwitcherProps;
45
+ /** Where Help, Terms and Privacy go. A link left out is not drawn. */
46
+ help?: string;
47
+ terms?: string;
48
+ privacy?: string;
49
+ labels?: Partial<AuthFooterLabels>;
50
+ className?: string;
51
+ }
52
+
53
+ export function AuthFooter({ theme = true, themeLabels, language, help, terms, privacy, labels, className }: AuthFooterProps) {
54
+ const L = { ...AUTH_FOOTER_LABELS, ...labels };
55
+ const links = ([[help, L.help], [terms, L.terms], [privacy, L.privacy]] as const).filter(([href]) => href);
56
+ return (
57
+ <footer className={cx("gb-auth-footer", className)}>
58
+ {theme || language ? (
59
+ <div className="gb-auth-footer-tools">
60
+ {theme ? <ThemeToggle labels={themeLabels} followsSystem /> : null}
61
+ {language ? <LanguageSwitcher variant="topbar" end={false} {...language} /> : null}
62
+ </div>
63
+ ) : null}
64
+ {links.length ? (
65
+ <nav className="gb-auth-footer-links" aria-label={L.links}>
66
+ {links.map(([href, label]) => <a key={label} href={href}>{label}</a>)}
67
+ </nav>
68
+ ) : null}
69
+ </footer>
70
+ );
71
+ }
@@ -1 +1 @@
1
- (function(o){"use strict";var p=o.gembossUI||(o.gembossUI={}),S='<svg width="18" height="18" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M1.5 10S4.6 4.5 10 4.5 18.5 10 18.5 10 15.4 15.5 10 15.5 1.5 10 1.5 10Z"/><circle cx="10" cy="10" r="2.6"/></svg>',E="Couldn't reach the server. Check your connection and try again.",h=0;function q(){var f=0,w=!1;return document.querySelectorAll("form[data-gb-signin]").forEach(function(t){if(t.getAttribute("data-gb-ready"))return;t.setAttribute("data-gb-ready","1");var n="gb-signin"+(h?"-"+h:""),y=t.getAttribute("data-sso");if(h++,f++,t.getAttribute("method")||(t.method="post"),y&&!(t.previousElementSibling&&t.previousElementSibling.classList.contains("gb-auth-sso")))if(!p.initContinueWithGemBoss)o.console&&o.console.error("auth-signin-plain.js: data-sso needs auth-sso-plain.js loaded first");else{var m=document.createElement("div"),u=document.createElement("a");m.className="gb-auth-sso",u.className="gb-auth-sso-btn",u.setAttribute("data-gb-sso",y),u.setAttribute("data-next",t.getAttribute("data-next")||"/"),t.getAttribute("data-issuer")&&u.setAttribute("data-issuer",t.getAttribute("data-issuer")),m.append(u),t.before(m),w=!0}t.classList.add("gb-auth-form"),t.innerHTML='<div class="gb-auth-field"><label for="'+n+'-email">Email</label><input class="gb-auth-input" id="'+n+'-email" type="email" name="email" autocomplete="username" required></div><div class="gb-auth-field"><label for="'+n+'-password">Password</label><div class="gb-auth-pw"><input class="gb-auth-input" id="'+n+'-password" type="password" name="password" autocomplete="current-password" required><button type="button" aria-controls="'+n+'-password" aria-label="Show password" title="Show password" data-label-show="Show password" data-label-hide="Hide password" class="gb-auth-pw-toggle">'+S+'</button></div></div><div id="'+n+'-error"></div><button type="submit" class="gb-auth-submit">Sign in</button>';var l=t.querySelector('input[name="email"]'),d=t.querySelector('input[name="password"]'),c=t.querySelector(".gb-auth-pw-toggle"),A=t.querySelector("#"+n+"-error"),v=t.querySelector(".gb-auth-submit");function g(a,e){if(A.textContent="",[l,d].forEach(function(r){r.removeAttribute("aria-invalid"),r.removeAttribute("aria-describedby")}),!!a){var i=document.createElement("div");i.className="gb-auth-error",i.setAttribute("role","alert"),i.textContent=a,A.append(i),[l,d].forEach(function(r){e&&r.setAttribute("aria-invalid","true"),r.setAttribute("aria-describedby",n+"-error")})}}function b(a){v.disabled=a,v.textContent=a?"Signing in\u2026":"Sign in"}c.addEventListener("click",function(a){a.stopPropagation();var e=d.type==="password",i=c.getAttribute(e?"data-label-hide":"data-label-show");d.type=e?"text":"password",c.setAttribute("aria-label",i),c.setAttribute("title",i);var r=c.querySelector("svg"),s=r.querySelector('path[d="M3 17 17 3"]');e&&!s?(s=document.createElementNS("http://www.w3.org/2000/svg","path"),s.setAttribute("d","M3 17 17 3"),r.append(s)):!e&&s&&s.remove()}),g(t.getAttribute("data-error"),!0),o.addEventListener("pageshow",function(a){a.persisted&&b(!1)}),t.addEventListener("submit",function(a){if(l.value=l.value.trim(),t.getAttribute("data-submit")!=="json"){b(!0);return}a.preventDefault(),!v.disabled&&(b(!0),g(""),fetch(t.action,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({email:l.value,password:d.value})}).then(function(e){if(e.redirected){location.assign(e.url);return}if(e.ok){location.assign(t.getAttribute("data-next")||"/");return}return e.json().catch(function(){return{}}).then(function(i){var r=[i.error,i.detail,i.message].filter(function(s){return typeof s=="string"&&s})[0];g(r||"Couldn't sign in (HTTP "+e.status+"). Try again.",e.status<500),b(!1)})}).catch(function(){g(E,!1),b(!1)}))})}),w&&p.initContinueWithGemBoss(),f}p.initSignIn=q})(typeof globalThis<"u"?globalThis:this);
1
+ (function(b){"use strict";var u=b.gembossUI||(b.gembossUI={}),j='<svg width="18" height="18" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M1.5 10S4.6 4.5 10 4.5 18.5 10 18.5 10 15.4 15.5 10 15.5 1.5 10 1.5 10Z"/><circle cx="10" cy="10" r="2.6"/></svg>',x="Couldn't reach the server. Check your connection and try again.",A=0,q=[];function G(r){return r&&r[0]==="/"&&r[1]!=="/"&&r[1]!=="\\"?r:"/"}function M(r){var g=0,I=!1,w=r&&r.onSignIn;return document.querySelectorAll("form[data-gb-signin]").forEach(function(t){if(t.getAttribute("data-gb-ready"))return;t.setAttribute("data-gb-ready","1");var s="gb-signin"+(A?"-"+A:""),L=t.getAttribute("data-sso");if(A++,g++,t.getAttribute("method")||(t.method="post"),L&&!(t.previousElementSibling&&t.previousElementSibling.classList.contains("gb-auth-sso")))if(!u.initContinueWithGemBoss)b.console&&b.console.error("auth-signin-plain.js: data-sso needs auth-sso-plain.js loaded first");else{var S=document.createElement("div"),m=document.createElement("a");S.className="gb-auth-sso",m.className="gb-auth-sso-btn",m.setAttribute("data-gb-sso",L),m.setAttribute("data-next",t.getAttribute("data-next")||"/"),t.getAttribute("data-issuer")&&m.setAttribute("data-issuer",t.getAttribute("data-issuer")),S.append(m),t.before(S),I=!0}var n=null;if(t.getAttribute("data-notice")){n=document.createElement("p"),n.id=s+"-notice",n.className="gb-auth-notice",n.setAttribute("role","status"),n.textContent=t.getAttribute("data-notice");var W=t.previousElementSibling&&t.previousElementSibling.classList.contains("gb-auth-sso")?t.previousElementSibling:t;W.before(n)}if(t.classList.add("gb-auth-form"),t.innerHTML='<div class="gb-auth-field"><label for="'+s+'-email">Email</label><input class="gb-auth-input" id="'+s+'-email" type="email" name="email" autocomplete="username" required></div><div class="gb-auth-field"><label for="'+s+'-password">Password</label><div class="gb-auth-pw"><input class="gb-auth-input" id="'+s+'-password" type="password" name="password" autocomplete="current-password" required><button type="button" aria-controls="'+s+'-password" aria-label="Show password" title="Show password" data-label-show="Show password" data-label-hide="Hide password" class="gb-auth-pw-toggle">'+j+'</button></div></div><div id="'+s+'-error"></div><button type="submit" class="gb-auth-submit">Sign in</button>',t.getAttribute("data-next")){var h=document.createElement("input");h.type="hidden",h.name="next",h.value=t.getAttribute("data-next"),t.prepend(h)}var l=t.querySelector('input[name="email"]'),d=t.querySelector('input[name="password"]'),p=t.querySelector(".gb-auth-pw-toggle"),E=t.querySelector("#"+s+"-error"),C=t.querySelector(".gb-auth-submit"),B=t.getAttribute("data-forgot");if(B){var N=d.closest(".gb-auth-field"),f=document.createElement("a");N.classList.add("gb-auth-field--forgot"),f.className="gb-auth-forgot",f.setAttribute("href",B),f.textContent=t.getAttribute("data-forgot-label")||"Forgot password?",N.append(f)}function v(e,o){if(E.textContent="",e){var i=document.createElement("div");i.className="gb-auth-error",i.setAttribute("role","alert"),i.textContent=e,E.append(i)}[l,d].forEach(function(a){var y=[a===l&&n&&n.id,e&&s+"-error"].filter(Boolean).join(" ");e&&o?a.setAttribute("aria-invalid","true"):a.removeAttribute("aria-invalid"),y?a.setAttribute("aria-describedby",y):a.removeAttribute("aria-describedby")})}function c(e){C.disabled=e,C.textContent=e?"Signing in\u2026":"Sign in"}function T(e){var o=p.getAttribute(e?"data-label-hide":"data-label-show");d.type=e?"text":"password",p.setAttribute("aria-label",o),p.setAttribute("title",o);var i=p.querySelector("svg"),a=i.querySelector('path[d="M3 17 17 3"]');e&&!a?(a=document.createElementNS("http://www.w3.org/2000/svg","path"),a.setAttribute("d","M3 17 17 3"),i.append(a)):!e&&a&&a.remove()}p.addEventListener("click",function(e){e.stopPropagation(),T(d.type==="password")});function F(e){var o=typeof e=="string"?e:e?e.message||"Couldn't sign in. Try again.":"";o&&(v(o,!(e&&typeof e=="object"&&e.fields===!1)),c(!1))}q.push({f:t,reset:function(){v(""),c(!1),d.value="",T(!1),u.resetContinueWithGemBoss&&u.resetContinueWithGemBoss()}}),v(t.getAttribute("data-error"),t.getAttribute("data-error-fields")!=="false");var k=document.activeElement,H=document.querySelector("a[data-gb-sso]")&&u.continuesByItself&&u.continuesByItself();t.hasAttribute("data-autofocus")&&(!k||k===document.body)&&!H&&l.focus(),b.addEventListener("pageshow",function(e){e.persisted&&c(!1)}),t.addEventListener("submit",function(e){if(l.value=l.value.trim(),n&&(n.remove(),n=null,E.firstChild?l.setAttribute("aria-describedby",s+"-error"):l.removeAttribute("aria-describedby")),!w&&t.getAttribute("data-submit")!=="json"){c(!0);return}if(e.preventDefault(),!C.disabled){c(!0),v("");var o={email:l.value,password:d.value};(w?Promise.resolve().then(function(){return w(o,t)}):fetch(t.action,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(o)}).then(function(i){if(i.redirected){location.assign(i.url);return}if(i.ok){location.assign(G(t.getAttribute("data-next")));return}return i.json().catch(function(){return null}).then(function(a){a=a||{};var y=[a.error,a.detail,a.message].filter(function(P){return typeof P=="string"&&P})[0];return{message:y||"Couldn't sign in (HTTP "+i.status+"). Try again.",fields:[400,401,422].indexOf(i.status)>=0}})})).then(F,function(){v(x,!1),c(!1)})}})}),I&&u.initContinueWithGemBoss(),g}function O(r){q.forEach(function(g){(!r||g.f===r)&&g.reset()})}u.initSignIn=M,u.resetSignIn=O})(typeof globalThis<"u"?globalThis:this);
@@ -1 +1 @@
1
- (function(i){"use strict";var d=i.gembossUI||(i.gembossUI={}),g="https://admin.gemboss.ai",l={not_member:"Your GemBoss account is not a member here. Ask an admin to add your email.",invalid:"That sign-in did not go through. Try again, or use the password.",off:"Signing in with GemBoss is not available here yet. Use the password."},f='<svg viewBox="0 0 32 32" width="18" height="18" aria-hidden="true" focusable="false"><rect width="32" height="32" rx="7"/><g transform="translate(16,16) scale(0.24) translate(-50,-62)"><polygon points="26,14 74,14 66,50 34,50" fill="#8a93ff"/><path d="M26,14 74,14 96,50 50,110 4,50Z" fill="none" stroke="#f4f4f2" stroke-width="5" stroke-linejoin="round"/><path d="M4,50H96M26,14 34,50M74,14 66,50M34,50 50,110M66,50 50,110" fill="none" stroke="#f4f4f2" stroke-opacity="0.72" stroke-width="3" stroke-linejoin="round"/></g></svg>';function b(){var o=document.querySelectorAll("a[data-gb-sso]");if(!o.length)return!1;var t=new URLSearchParams(location.search),h=t.get("sso"),c=!t.has("sso")&&t.get("password")!=="1"&&/(?:^|;\s*)gb_sso=1(?:;|$)/.test(document.cookie),s=null;return o.forEach(function(e){if(!e.getAttribute("data-gb-sso-ready")){e.setAttribute("data-gb-sso-ready","1");var m=(e.getAttribute("data-issuer")||g)+"/api/auth/sso/authorize?service="+encodeURIComponent(e.getAttribute("data-gb-sso"))+"&next="+encodeURIComponent(e.getAttribute("data-next")||"/")+"&host="+encodeURIComponent(location.host);e.href=m,s=s||e,e.querySelector("svg")||(e.innerHTML=f+'<span class="gb-auth-sso-label">Continue with GemBoss</span>',e.querySelector("rect").style.fill="var(--gb-mark-bg, #0b0b0c)");var r=e.closest(".gb-auth-sso")||e.parentNode;if(h&&!r.querySelector(".gb-auth-sso-why")){var n=document.createElement("p");n.className="gb-auth-sso-why",n.setAttribute("role","status"),n.textContent=l[h]||l.invalid,e.after(n)}if(!r.querySelector(".gb-auth-or")){var a=document.createElement("p");a.className="gb-auth-or",a.textContent="or use the password",r.append(a)}e.addEventListener("click",function(){u(e)})}}),c&&s&&(u(s),location.replace(s.href)),c&&!!s}function u(o){var t=o.querySelector(".gb-auth-sso-label");t&&(t.textContent="Continuing with GemBoss\u2026")}d.initContinueWithGemBoss=b})(typeof globalThis<"u"?globalThis:this);
1
+ (function(n){"use strict";var a=n.gembossUI||(n.gembossUI={}),g="https://admin.gemboss.ai",u={not_member:"Your GemBoss account is not a member here. Ask an admin to add your email.",invalid:"That sign-in did not go through. Try again, or use the password.",off:"Signing in with GemBoss is not available here yet. Use the password."},b='<svg viewBox="0 0 32 32" width="18" height="18" aria-hidden="true" focusable="false"><rect width="32" height="32" rx="7"/><g transform="translate(16,16) scale(0.24) translate(-50,-62)"><polygon points="26,14 74,14 66,50 34,50" fill="#8a93ff"/><path d="M26,14 74,14 96,50 50,110 4,50Z" fill="none" stroke="#f4f4f2" stroke-width="5" stroke-linejoin="round"/><path d="M4,50H96M26,14 34,50M74,14 66,50M34,50 50,110M66,50 50,110" fill="none" stroke="#f4f4f2" stroke-opacity="0.72" stroke-width="3" stroke-linejoin="round"/></g></svg>';function c(){var t=new URLSearchParams(location.search);return!t.has("sso")&&t.get("password")!=="1"&&/(?:^|;\s*)gb_sso=1(?:;|$)/.test(document.cookie)}function m(){var t=document.querySelectorAll("a[data-gb-sso]");if(!t.length)return!1;var s=new URLSearchParams(location.search).get("sso"),f=c(),o=null;return t.forEach(function(e){if(!e.getAttribute("data-gb-sso-ready")){e.setAttribute("data-gb-sso-ready","1");var v=(e.getAttribute("data-issuer")||g)+"/api/auth/sso/authorize?service="+encodeURIComponent(e.getAttribute("data-gb-sso"))+"&next="+encodeURIComponent(e.getAttribute("data-next")||"/")+"&host="+encodeURIComponent(location.host);e.href=v,o=o||e,e.querySelector("svg")||(e.innerHTML=b+'<span class="gb-auth-sso-label">Continue with GemBoss</span>',e.querySelector("rect").style.fill="var(--gb-mark-bg, #0b0b0c)");var i=e.closest(".gb-auth-sso")||e.parentNode;if(s&&!i.querySelector(".gb-auth-sso-why")){var r=document.createElement("p");r.className="gb-auth-sso-why",r.setAttribute("role","status"),r.textContent=u[s]||u.invalid,e.after(r)}if(!i.querySelector(".gb-auth-or")){var l=document.createElement("p");l.className="gb-auth-or",l.textContent="or use the password",i.append(l)}e.addEventListener("click",function(){h(e)})}}),f&&o&&(h(o),location.replace(o.href)),f&&!!o}function h(t){var s=t.querySelector(".gb-auth-sso-label");s&&(s.textContent="Continuing with GemBoss\u2026")}function d(){document.querySelectorAll(".gb-auth-sso-label").forEach(function(t){t.textContent="Continue with GemBoss"}),new URLSearchParams(location.search).has("sso")||document.querySelectorAll(".gb-auth-sso-why").forEach(function(t){t.remove()})}n.addEventListener&&n.addEventListener("pageshow",function(t){t.persisted&&d()}),a.initContinueWithGemBoss=m,a.continuesByItself=c,a.resetContinueWithGemBoss=d})(typeof globalThis<"u"?globalThis:this);
@@ -0,0 +1 @@
1
+ .gb-auth-steps{margin:0 0 clamp(12px,3cqh,20px)}.gb-auth-steps-head{display:flex;justify-content:space-between;gap:12px;margin:0 0 8px;font-size:12px;line-height:16px;color:var(--gb-muted)}.gb-auth-steps-name{color:var(--gb-ink);font-weight:600;text-align:right}.gb-auth-steps-bar{display:flex;gap:6px;margin:0;padding:0;list-style:none}.gb-auth-seg{flex:1;height:4px;border-radius:2px;background:var(--gb-line)}.gb-auth-seg--done,.gb-auth-seg[aria-current=step]{background:var(--gb-accent)}.gb-auth-seg>span{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.gb-auth-choices,.gb-auth-chips{min-width:0;margin:0;padding:0;border:0}.gb-auth-choices{display:grid;gap:8px}.gb-auth-chips{display:flex;flex-wrap:wrap;gap:8px}.gb-auth-q{margin:0 0 4px;padding:0;font-size:15px;font-weight:650;line-height:1.35;color:var(--gb-ink)}.gb-auth-choices>.gb-auth-choice,.gb-auth-chips>.gb-auth-chip{position:relative;flex-direction:row;box-sizing:border-box;border:1px solid var(--gb-field-line);background:var(--gb-surface);color:var(--gb-ink);cursor:pointer;transition:border-color .12s,background-color .12s}.gb-auth-choices>.gb-auth-choice{display:flex;align-items:flex-start;gap:12px;padding:14px 16px;border-radius:12px;font-size:14px;font-weight:400}.gb-auth-chips>.gb-auth-chip{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px 0 14px;border-radius:999px;font-size:13px;font-weight:500}.gb-auth-choices>.gb-auth-choice:hover,.gb-auth-chips>.gb-auth-chip:hover{border-color:var(--gb-hover-line)}.gb-auth-choices>.gb-auth-choice:has(>:checked),.gb-auth-chips>.gb-auth-chip:has(>:checked){border-color:var(--gb-ink);box-shadow:inset 0 0 0 1px var(--gb-ink);background:var(--gb-field-hover)}.gb-auth-choices>.gb-auth-choice:has(>:disabled),.gb-auth-chips>.gb-auth-chip:has(>:disabled){cursor:default;opacity:.55}.gb-auth-choice>.gb-auth-choice-input,.gb-auth-chip>.gb-auth-chip-input{flex:none;width:18px;height:18px;margin:1px 0 0;accent-color:var(--gb-ink);cursor:inherit}.gb-auth-chip>.gb-auth-chip-input{width:16px;height:16px;margin:0}.gb-auth-choice-text{display:grid;gap:2px;min-width:0}.gb-auth-choice-title{font-weight:600}.gb-auth-choice-line{color:var(--gb-muted);font-size:13px;line-height:1.45}.gb-auth-choice-note{color:var(--gb-accent);font-size:12px;font-weight:600}.gb-auth-actions{display:flex;gap:8px;margin-top:clamp(2px,.75cqh,6px)}.gb-auth-actions>.gb-auth-submit,.gb-auth-actions>.gb-auth-back{min-height:44px;padding:0 16px;border-radius:8px;font-family:inherit;font-size:14px;font-weight:600;cursor:pointer}.gb-auth-actions>.gb-auth-submit{flex:1;border:none;background:var(--gb-btn);color:var(--gb-btn-ink);transition:opacity .15s ease,transform .15s ease}.gb-auth-actions>.gb-auth-submit:hover:not(:disabled){transform:translateY(-1px)}.gb-auth-actions>.gb-auth-back{flex:none;min-width:96px;border:1px solid var(--gb-field-line);background:var(--gb-surface);color:var(--gb-ink)}.gb-auth-actions>.gb-auth-back:hover:not(:disabled){background:var(--gb-hover);border-color:var(--gb-hover-line)}.gb-auth-actions>.gb-auth-back:focus-visible{outline:2px solid var(--gb-ink);outline-offset:1px}.gb-auth-actions>:disabled{opacity:.6;cursor:not-allowed}