@neetru/sdk 3.4.5 → 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/dist/react.mjs CHANGED
@@ -721,6 +721,16 @@ var NEETRU_LOGIN_BUTTON_THEME = {
721
721
  dark: { bg: "#0a0a0a", bgHover: "#1a1a1a", fg: "#ffffff", border: "#0a0a0a" },
722
722
  light: { bg: "#ffffff", bgHover: "#f5f5f5", fg: "#0a0a0a", border: "#0a0a0a" }
723
723
  };
724
+ var NEETRU_LOGIN_FOCUS_STYLE_ID = "neetru-login-button-focus-style";
725
+ var NEETRU_LOGIN_FOCUS_CSS = "button[data-neetru-login-button]:focus-visible{outline:2px solid var(--neetru-login-focus-ring,#ffffff);outline-offset:2px;}";
726
+ function ensureLoginFocusStyleInjected() {
727
+ if (typeof document === "undefined" || !document.head) return;
728
+ if (document.getElementById(NEETRU_LOGIN_FOCUS_STYLE_ID)) return;
729
+ const styleEl = document.createElement("style");
730
+ styleEl.id = NEETRU_LOGIN_FOCUS_STYLE_ID;
731
+ styleEl.textContent = NEETRU_LOGIN_FOCUS_CSS;
732
+ document.head.appendChild(styleEl);
733
+ }
724
734
  function NeetruLoginButton({
725
735
  client,
726
736
  redirectUri,
@@ -737,6 +747,9 @@ function NeetruLoginButton({
737
747
  const [isHover, setIsHover] = React2.useState(false);
738
748
  const colors = NEETRU_LOGIN_BUTTON_THEME[theme];
739
749
  const isDisabled = Boolean(disabled) || isLoading;
750
+ React2.useEffect(() => {
751
+ ensureLoginFocusStyleInjected();
752
+ }, []);
740
753
  const handleClick = React2.useCallback(async () => {
741
754
  if (isDisabled) return;
742
755
  setIsLoading(true);
@@ -783,6 +796,9 @@ function NeetruLoginButton({
783
796
  opacity: isDisabled && !isLoading ? 0.6 : 1,
784
797
  transition: "background-color 150ms ease",
785
798
  boxSizing: "border-box",
799
+ // Cor do ring de foco de teclado (:focus-visible) — ver
800
+ // NEETRU_LOGIN_FOCUS_CSS. Usa a cor do texto (contraste AA garantido).
801
+ "--neetru-login-focus-ring": colors.fg,
786
802
  ...style
787
803
  }
788
804
  },
@@ -829,8 +845,12 @@ function EntitlementGate({
829
845
  behavior: res.behavior
830
846
  };
831
847
  } else {
832
- const allowed2 = await client.entitlements.check(resolvedSlug, feature);
833
- result2 = { allowed: allowed2 };
848
+ if (typeof console !== "undefined") {
849
+ console.warn(
850
+ "[EntitlementGate] tenantId ausente em client.config \u2014 n\xE3o \xE9 poss\xEDvel verificar entitlement (client.entitlements.check() est\xE1 deprecado, ver src/entitlements.ts). Configure tenantId no createNeetruClient() ou passe via props. Bloqueando por padr\xE3o (fail-closed)."
851
+ );
852
+ }
853
+ result2 = { allowed: false, reason: "tenant_id_required" };
834
854
  }
835
855
  if (!cancelled) setState({ status: "ready", result: result2 });
836
856
  } catch (err) {