@elvix.is/sdk 0.5.2 → 0.5.3
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.d.ts +26 -13
- package/dist/react.js +10 -4
- package/package.json +1 -1
package/dist/react.d.ts
CHANGED
|
@@ -84,6 +84,12 @@ type ElvixBrand = {
|
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
86
|
type ElvixSignInMethod = "google" | "email_otp" | "passkey" | "username";
|
|
87
|
+
/**
|
|
88
|
+
* The public render envelope `GET /api/v1/bootstrap/<clientId>` returns. Flat
|
|
89
|
+
* to match the wire shape exactly (the provider builds the {light,dark} brand
|
|
90
|
+
* chord from the colour fields). Any field here is already public — it's what
|
|
91
|
+
* the sign-in surface shows.
|
|
92
|
+
*/
|
|
87
93
|
type ElvixBootstrapEnvelope = {
|
|
88
94
|
applicationId: string;
|
|
89
95
|
clientId: string;
|
|
@@ -93,21 +99,28 @@ type ElvixBootstrapEnvelope = {
|
|
|
93
99
|
logoUrlDark: string | null;
|
|
94
100
|
iconUrl: string | null;
|
|
95
101
|
iconUrlDark: string | null;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
websiteUrl: string | null;
|
|
103
|
+
privacyPolicyUrl: string;
|
|
104
|
+
termsOfServiceUrl: string;
|
|
105
|
+
supportUrl: string | null;
|
|
106
|
+
brandColor: string;
|
|
107
|
+
brandColorDark: string | null;
|
|
108
|
+
onBrandColor: string;
|
|
109
|
+
onBrandColorDark: string | null;
|
|
110
|
+
brandPreset: string;
|
|
111
|
+
methodGoogle: boolean;
|
|
112
|
+
methodEmailOtp: boolean;
|
|
113
|
+
methodPasskey: boolean;
|
|
114
|
+
methodUsername: boolean;
|
|
115
|
+
layout: string;
|
|
116
|
+
socialLayout: string;
|
|
117
|
+
presentation: string;
|
|
118
|
+
theme: "light" | "dark" | "system";
|
|
119
|
+
showHeader: boolean;
|
|
120
|
+
transparentBg: boolean;
|
|
109
121
|
signInVerb: "signin" | "login";
|
|
110
122
|
signinGate: "public" | "private_beta" | "closed";
|
|
123
|
+
archivedAt: string | null;
|
|
111
124
|
/**
|
|
112
125
|
* Console-configured sign-in copy overrides. Any subset of the strings the
|
|
113
126
|
* sign-in surface renders; missing keys fall back to the built-in English
|
package/dist/react.js
CHANGED
|
@@ -151,8 +151,14 @@ function ElvixProvider({
|
|
|
151
151
|
));
|
|
152
152
|
}
|
|
153
153
|
function appBrand(app) {
|
|
154
|
-
if (!app?.
|
|
155
|
-
return
|
|
154
|
+
if (!app?.brandColor) return null;
|
|
155
|
+
return {
|
|
156
|
+
light: { primary: app.brandColor, on: app.onBrandColor },
|
|
157
|
+
dark: {
|
|
158
|
+
primary: app.brandColorDark ?? app.brandColor,
|
|
159
|
+
on: app.onBrandColorDark ?? app.onBrandColor
|
|
160
|
+
}
|
|
161
|
+
};
|
|
156
162
|
}
|
|
157
163
|
function withAlpha(hex, a) {
|
|
158
164
|
const m = /^#?([0-9a-f]{6})$/i.exec(hex.trim());
|
|
@@ -332,7 +338,7 @@ function ElvixSignIn({
|
|
|
332
338
|
if (step === "done") {
|
|
333
339
|
return /* @__PURE__ */ React.createElement("div", { className: card, "data-elvix-pane": "done" }, /* @__PURE__ */ React.createElement("p", null, copy.signedInText));
|
|
334
340
|
}
|
|
335
|
-
return /* @__PURE__ */ React.createElement("div", { className: card, "data-elvix-pane": step }, /* @__PURE__ */ React.createElement("h2", { className: "elvix-h" }, title), copy.subtitle && /* @__PURE__ */ React.createElement("p", { className: "elvix-muted elvix-subtitle" }, copy.subtitle), step === "identify" && /* @__PURE__ */ React.createElement(React.Fragment, null, app?.
|
|
341
|
+
return /* @__PURE__ */ React.createElement("div", { className: card, "data-elvix-pane": step }, /* @__PURE__ */ React.createElement("h2", { className: "elvix-h" }, title), copy.subtitle && /* @__PURE__ */ React.createElement("p", { className: "elvix-muted elvix-subtitle" }, copy.subtitle), step === "identify" && /* @__PURE__ */ React.createElement(React.Fragment, null, app?.methodGoogle && /* @__PURE__ */ React.createElement(
|
|
336
342
|
"button",
|
|
337
343
|
{
|
|
338
344
|
type: "button",
|
|
@@ -342,7 +348,7 @@ function ElvixSignIn({
|
|
|
342
348
|
"data-elvix-method": "google"
|
|
343
349
|
},
|
|
344
350
|
copy.googleButton
|
|
345
|
-
), app?.
|
|
351
|
+
), app?.methodEmailOtp && /* @__PURE__ */ React.createElement("form", { onSubmit: startOtp, "data-elvix-method": "email_otp", className: "elvix-otp-form" }, /* @__PURE__ */ React.createElement(
|
|
346
352
|
"input",
|
|
347
353
|
{
|
|
348
354
|
type: "email",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elvix.is/sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Official elvix SDK. Drop-in React components, server helpers, and an MCP server so AI coding agents integrate elvix on the first try.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://elvix.is",
|