@neetru/sdk 3.4.6 → 3.4.7

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ All notable changes to `@neetru/sdk` will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.4.7] - 2026-09-19 — **fix(a11y): NeetruLoginButton — foco de teclado visível (bug_62edcfb0)**
9
+
10
+ Release **patch** (correção de bug de acessibilidade — publica o fix já mesclado no PR #28).
11
+
12
+ ### Contexto
13
+
14
+ `bug_62edcfb0`: o `NeetruLoginButton` renderiza estilo inline BMW (fundo `#0a0a0a` no tema dark) e não definia outline próprio no `:focus-visible`. Estilo inline não cobre pseudo-classe, então o foco caía no outline default do Chromium (~`rgb(16,16,16)`) — invisível sobre o fundo preto. Navegação por teclado sem foco perceptível é falha de acessibilidade.
15
+
16
+ ### Corrigido
17
+
18
+ - **Ring de foco explícito** via `<style>` scoped injetado no `<head>` (uma vez, idempotente, no-op em SSR): `button[data-neetru-login-button]:focus-visible { outline:2px solid var(--neetru-login-focus-ring); outline-offset:2px }`. A cor do ring vem de `--neetru-login-focus-ring`, setada inline com `colors.fg` (cor do texto), que já contrasta com o fundo por construção (branco no dark, quase-preto no light) — garante contraste AA nos dois temas. Outline retangular sólido, sem blur/glow (design BMW).
19
+
20
+ Nenhuma remoção de API, nenhuma mudança de wire.
21
+
8
22
  ## [3.4.6] - 2026-09-15 — **fix(auth): getServerNeetruClient() — singleton server-side via globalThis (bug_d0d4e5bf)**
9
23
 
10
24
  Release **patch** (correção de bug que bloqueava onboarding — publica o fix já mesclado no PR #23, que ficou atrás na fila do publish porque o PR #24/telemetria mesclou depois e subiu como 3.4.5).
package/dist/react.cjs CHANGED
@@ -743,6 +743,16 @@ var NEETRU_LOGIN_BUTTON_THEME = {
743
743
  dark: { bg: "#0a0a0a", bgHover: "#1a1a1a", fg: "#ffffff", border: "#0a0a0a" },
744
744
  light: { bg: "#ffffff", bgHover: "#f5f5f5", fg: "#0a0a0a", border: "#0a0a0a" }
745
745
  };
746
+ var NEETRU_LOGIN_FOCUS_STYLE_ID = "neetru-login-button-focus-style";
747
+ var NEETRU_LOGIN_FOCUS_CSS = "button[data-neetru-login-button]:focus-visible{outline:2px solid var(--neetru-login-focus-ring,#ffffff);outline-offset:2px;}";
748
+ function ensureLoginFocusStyleInjected() {
749
+ if (typeof document === "undefined" || !document.head) return;
750
+ if (document.getElementById(NEETRU_LOGIN_FOCUS_STYLE_ID)) return;
751
+ const styleEl = document.createElement("style");
752
+ styleEl.id = NEETRU_LOGIN_FOCUS_STYLE_ID;
753
+ styleEl.textContent = NEETRU_LOGIN_FOCUS_CSS;
754
+ document.head.appendChild(styleEl);
755
+ }
746
756
  function NeetruLoginButton({
747
757
  client,
748
758
  redirectUri,
@@ -759,6 +769,9 @@ function NeetruLoginButton({
759
769
  const [isHover, setIsHover] = React2__namespace.useState(false);
760
770
  const colors = NEETRU_LOGIN_BUTTON_THEME[theme];
761
771
  const isDisabled = Boolean(disabled) || isLoading;
772
+ React2__namespace.useEffect(() => {
773
+ ensureLoginFocusStyleInjected();
774
+ }, []);
762
775
  const handleClick = React2__namespace.useCallback(async () => {
763
776
  if (isDisabled) return;
764
777
  setIsLoading(true);
@@ -805,6 +818,9 @@ function NeetruLoginButton({
805
818
  opacity: isDisabled && !isLoading ? 0.6 : 1,
806
819
  transition: "background-color 150ms ease",
807
820
  boxSizing: "border-box",
821
+ // Cor do ring de foco de teclado (:focus-visible) — ver
822
+ // NEETRU_LOGIN_FOCUS_CSS. Usa a cor do texto (contraste AA garantido).
823
+ "--neetru-login-focus-ring": colors.fg,
808
824
  ...style
809
825
  }
810
826
  },