@stackframe/stack 2.3.5 → 2.3.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.
Files changed (261) hide show
  1. package/dist/components/card-frame.d.mts +9 -0
  2. package/dist/components/card-frame.d.ts +8 -5
  3. package/dist/components/card-frame.js +58 -23
  4. package/dist/components/credential-sign-in.d.mts +5 -0
  5. package/dist/components/credential-sign-in.d.ts +5 -1
  6. package/dist/components/credential-sign-in.js +109 -41
  7. package/dist/components/credential-sign-up.d.mts +5 -0
  8. package/dist/components/credential-sign-up.d.ts +5 -1
  9. package/dist/components/credential-sign-up.js +140 -62
  10. package/dist/components/forgot-password.d.mts +7 -0
  11. package/dist/components/forgot-password.d.ts +6 -2
  12. package/dist/components/forgot-password.js +83 -26
  13. package/dist/components/form-warning.d.mts +7 -0
  14. package/dist/components/form-warning.d.ts +6 -2
  15. package/dist/components/form-warning.js +34 -8
  16. package/dist/components/magic-link-sign-in.d.mts +5 -0
  17. package/dist/components/magic-link-sign-in.d.ts +5 -1
  18. package/dist/components/magic-link-sign-in.js +89 -31
  19. package/dist/components/message-card.d.mts +10 -0
  20. package/dist/components/message-card.d.ts +8 -4
  21. package/dist/components/message-card.js +45 -6
  22. package/dist/components/oauth-button.d.mts +8 -0
  23. package/dist/components/oauth-button.d.ts +6 -2
  24. package/dist/components/oauth-button.js +142 -63
  25. package/dist/components/oauth-group.d.mts +7 -0
  26. package/dist/components/oauth-group.d.ts +6 -2
  27. package/dist/components/oauth-group.js +46 -8
  28. package/dist/components/password-field.d.mts +5 -0
  29. package/dist/components/password-field.d.ts +5 -3
  30. package/dist/components/password-field.js +111 -41
  31. package/dist/components/password-reset-inner.d.mts +8 -0
  32. package/dist/components/password-reset-inner.d.ts +6 -2
  33. package/dist/components/password-reset-inner.js +120 -58
  34. package/dist/components/redirect-message-card.d.mts +8 -0
  35. package/dist/components/redirect-message-card.d.ts +6 -2
  36. package/dist/components/redirect-message-card.js +110 -58
  37. package/dist/components/separator-with-text.d.mts +7 -0
  38. package/dist/components/separator-with-text.d.ts +6 -2
  39. package/dist/components/separator-with-text.js +35 -5
  40. package/dist/components/user-avatar.d.mts +13 -0
  41. package/dist/components/user-avatar.d.ts +11 -3
  42. package/dist/components/user-avatar.js +34 -6
  43. package/dist/components/user-button.d.mts +15 -0
  44. package/dist/components/user-button.d.ts +12 -3
  45. package/dist/components/user-button.js +156 -26
  46. package/dist/components-core/avatar.d.mts +8 -0
  47. package/dist/components-core/avatar.d.ts +7 -5
  48. package/dist/components-core/avatar.js +73 -18
  49. package/dist/components-core/button.d.mts +12 -0
  50. package/dist/components-core/button.d.ts +8 -6
  51. package/dist/components-core/button.js +177 -113
  52. package/dist/components-core/card.d.mts +8 -0
  53. package/dist/components-core/card.d.ts +4 -2
  54. package/dist/components-core/card.js +73 -22
  55. package/dist/components-core/collapsible.d.mts +8 -0
  56. package/dist/components-core/collapsible.d.ts +8 -6
  57. package/dist/components-core/collapsible.js +48 -5
  58. package/dist/components-core/container.d.mts +8 -0
  59. package/dist/components-core/container.d.ts +5 -3
  60. package/dist/components-core/container.js +61 -11
  61. package/dist/components-core/dropdown.d.mts +15 -0
  62. package/dist/components-core/dropdown.d.ts +10 -8
  63. package/dist/components-core/dropdown.js +108 -36
  64. package/dist/components-core/index.d.mts +59 -0
  65. package/dist/components-core/index.d.ts +51 -40
  66. package/dist/components-core/index.js +144 -46
  67. package/dist/components-core/input.d.mts +6 -0
  68. package/dist/components-core/input.d.ts +5 -3
  69. package/dist/components-core/input.js +97 -28
  70. package/dist/components-core/label.d.mts +6 -0
  71. package/dist/components-core/label.d.ts +5 -3
  72. package/dist/components-core/label.js +65 -15
  73. package/dist/components-core/link.d.mts +10 -0
  74. package/dist/components-core/link.d.ts +7 -6
  75. package/dist/components-core/link.js +72 -18
  76. package/dist/components-core/loading-indicator.d.mts +13 -0
  77. package/dist/components-core/loading-indicator.d.ts +11 -4
  78. package/dist/components-core/loading-indicator.js +46 -6
  79. package/dist/components-core/popover.d.mts +8 -0
  80. package/dist/components-core/popover.d.ts +8 -6
  81. package/dist/components-core/popover.js +72 -16
  82. package/dist/components-core/separator.d.mts +6 -0
  83. package/dist/components-core/separator.d.ts +5 -3
  84. package/dist/components-core/separator.js +66 -16
  85. package/dist/components-core/skeleton.d.mts +7 -0
  86. package/dist/components-core/skeleton.d.ts +5 -3
  87. package/dist/components-core/skeleton.js +75 -21
  88. package/dist/components-core/tabs.d.mts +9 -0
  89. package/dist/components-core/tabs.d.ts +8 -6
  90. package/dist/components-core/tabs.js +87 -20
  91. package/dist/components-core/text.d.mts +10 -0
  92. package/dist/components-core/text.d.ts +5 -3
  93. package/dist/components-core/text.js +95 -40
  94. package/dist/components-core-joy/button.d.mts +6 -0
  95. package/dist/components-core-joy/button.d.ts +6 -2
  96. package/dist/components-core-joy/button.js +86 -28
  97. package/dist/components-core-joy/input.d.mts +5 -0
  98. package/dist/components-core-joy/input.d.ts +5 -2
  99. package/dist/components-core-joy/input.js +51 -6
  100. package/dist/components-core-joy/separator.d.mts +6 -0
  101. package/dist/components-core-joy/separator.d.ts +6 -2
  102. package/dist/components-core-joy/separator.js +50 -6
  103. package/dist/components-core-joy/tabs.d.mts +9 -0
  104. package/dist/components-core-joy/tabs.d.ts +9 -5
  105. package/dist/components-core-joy/tabs.js +62 -16
  106. package/dist/components-core-joy/text.d.mts +9 -0
  107. package/dist/components-core-joy/text.d.ts +6 -3
  108. package/dist/components-core-joy/text.js +68 -28
  109. package/dist/components-page/account-settings.d.mts +7 -0
  110. package/dist/components-page/account-settings.d.ts +6 -2
  111. package/dist/components-page/account-settings.js +213 -81
  112. package/dist/components-page/auth-page.d.mts +8 -0
  113. package/dist/components-page/auth-page.d.ts +6 -2
  114. package/dist/components-page/auth-page.js +79 -19
  115. package/dist/components-page/email-verification.d.mts +8 -0
  116. package/dist/components-page/email-verification.d.ts +6 -2
  117. package/dist/components-page/email-verification.js +65 -28
  118. package/dist/components-page/forgot-password.d.mts +7 -0
  119. package/dist/components-page/forgot-password.d.ts +6 -2
  120. package/dist/components-page/forgot-password.js +64 -20
  121. package/dist/components-page/magic-link-callback.d.mts +8 -0
  122. package/dist/components-page/magic-link-callback.d.ts +6 -2
  123. package/dist/components-page/magic-link-callback.js +72 -34
  124. package/dist/components-page/oauth-callback.d.mts +5 -0
  125. package/dist/components-page/oauth-callback.d.ts +5 -1
  126. package/dist/components-page/oauth-callback.js +52 -16
  127. package/dist/components-page/password-reset.d.mts +8 -0
  128. package/dist/components-page/password-reset.d.ts +6 -2
  129. package/dist/components-page/password-reset.js +70 -34
  130. package/dist/components-page/sign-in.d.mts +7 -0
  131. package/dist/components-page/sign-in.d.ts +6 -2
  132. package/dist/components-page/sign-in.js +41 -5
  133. package/dist/components-page/sign-out.d.mts +5 -0
  134. package/dist/components-page/sign-out.d.ts +5 -1
  135. package/dist/components-page/sign-out.js +47 -11
  136. package/dist/components-page/sign-up.d.mts +7 -0
  137. package/dist/components-page/sign-up.d.ts +6 -2
  138. package/dist/components-page/sign-up.js +41 -5
  139. package/dist/components-page/stack-handler.d.mts +16 -0
  140. package/dist/components-page/stack-handler.d.ts +11 -3
  141. package/dist/components-page/stack-handler.js +102 -64
  142. package/dist/esm/components/card-frame.js +39 -0
  143. package/dist/esm/components/credential-sign-in.js +82 -0
  144. package/dist/esm/components/credential-sign-up.js +114 -0
  145. package/dist/esm/components/forgot-password.js +55 -0
  146. package/dist/esm/components/form-warning.js +15 -0
  147. package/dist/esm/components/magic-link-sign-in.js +61 -0
  148. package/dist/esm/components/message-card.js +16 -0
  149. package/dist/esm/components/oauth-button.js +124 -0
  150. package/dist/esm/components/oauth-group.js +17 -0
  151. package/dist/esm/components/password-field.js +82 -0
  152. package/dist/esm/components/password-reset-inner.js +93 -0
  153. package/dist/esm/components/redirect-message-card.js +83 -0
  154. package/dist/esm/components/separator-with-text.js +16 -0
  155. package/dist/esm/components/user-avatar.js +14 -0
  156. package/dist/esm/components/user-button.js +133 -0
  157. package/dist/esm/components-core/avatar.js +56 -0
  158. package/dist/esm/components-core/button.js +165 -0
  159. package/dist/esm/components-core/card.js +51 -0
  160. package/dist/esm/components-core/collapsible.js +13 -0
  161. package/dist/esm/components-core/container.js +35 -0
  162. package/dist/esm/components-core/dropdown.js +106 -0
  163. package/dist/esm/components-core/index.js +93 -0
  164. package/dist/esm/components-core/input.js +80 -0
  165. package/dist/esm/components-core/label.js +38 -0
  166. package/dist/esm/components-core/link.js +38 -0
  167. package/dist/esm/components-core/loading-indicator.js +27 -0
  168. package/dist/esm/components-core/popover.js +43 -0
  169. package/dist/esm/components-core/separator.js +36 -0
  170. package/dist/esm/components-core/skeleton.js +52 -0
  171. package/dist/esm/components-core/tabs.js +79 -0
  172. package/dist/esm/components-core/text.js +63 -0
  173. package/dist/esm/components-core-joy/button.js +53 -0
  174. package/dist/esm/components-core-joy/input.js +18 -0
  175. package/dist/esm/components-core-joy/separator.js +17 -0
  176. package/dist/esm/components-core-joy/tabs.js +29 -0
  177. package/dist/esm/components-core-joy/text.js +35 -0
  178. package/dist/esm/components-page/account-settings.js +197 -0
  179. package/dist/esm/components-page/auth-page.js +50 -0
  180. package/dist/esm/components-page/email-verification.js +36 -0
  181. package/dist/esm/components-page/forgot-password.js +35 -0
  182. package/dist/esm/components-page/magic-link-callback.js +43 -0
  183. package/dist/esm/components-page/oauth-callback.js +23 -0
  184. package/dist/esm/components-page/password-reset.js +42 -0
  185. package/dist/esm/components-page/sign-in.js +12 -0
  186. package/dist/esm/components-page/sign-out.js +18 -0
  187. package/dist/esm/components-page/sign-up.js +12 -0
  188. package/dist/esm/components-page/stack-handler.js +75 -0
  189. package/dist/esm/index.js +47 -0
  190. package/dist/esm/joy.js +5 -0
  191. package/dist/esm/lib/auth.js +62 -0
  192. package/dist/esm/lib/cookie.js +185 -0
  193. package/dist/esm/lib/hooks.js +29 -0
  194. package/dist/esm/lib/stack-app.js +940 -0
  195. package/dist/esm/providers/component-provider.js +76 -0
  196. package/dist/esm/providers/design-provider.js +36 -0
  197. package/dist/esm/providers/joy-provider.js +35 -0
  198. package/dist/esm/providers/stack-provider-client.js +31 -0
  199. package/dist/esm/providers/stack-provider.js +21 -0
  200. package/dist/esm/providers/styled-components-registry.js +24 -0
  201. package/dist/esm/providers/theme-provider.js +22 -0
  202. package/dist/esm/utils/browser-script.js +25 -0
  203. package/dist/esm/utils/constants.js +34 -0
  204. package/dist/esm/utils/email.js +10 -0
  205. package/dist/esm/utils/next.js +7 -0
  206. package/dist/esm/utils/url.js +21 -0
  207. package/dist/index.d.mts +37 -0
  208. package/dist/index.d.ts +37 -22
  209. package/dist/index.js +106 -21
  210. package/dist/joy.d.mts +16 -0
  211. package/dist/joy.d.ts +16 -1
  212. package/dist/joy.js +30 -1
  213. package/dist/lib/auth.d.mts +11 -0
  214. package/dist/lib/auth.d.ts +8 -4
  215. package/dist/lib/auth.js +83 -57
  216. package/dist/lib/cookie.d.mts +14 -0
  217. package/dist/lib/cookie.d.ts +8 -6
  218. package/dist/lib/cookie.js +217 -45
  219. package/dist/lib/hooks.d.mts +35 -0
  220. package/dist/lib/hooks.d.ts +14 -8
  221. package/dist/lib/hooks.js +53 -28
  222. package/dist/lib/stack-app.d.mts +227 -0
  223. package/dist/lib/stack-app.d.ts +43 -41
  224. package/dist/lib/stack-app.js +937 -849
  225. package/dist/providers/component-provider.d.mts +113 -0
  226. package/dist/providers/component-provider.d.ts +95 -77
  227. package/dist/providers/component-provider.js +92 -58
  228. package/dist/providers/design-provider.d.mts +34 -0
  229. package/dist/providers/design-provider.d.ts +16 -21
  230. package/dist/providers/design-provider.js +57 -58
  231. package/dist/providers/joy-provider.d.mts +36 -0
  232. package/dist/providers/joy-provider.d.ts +30 -14
  233. package/dist/providers/joy-provider.js +58 -30
  234. package/dist/providers/stack-provider-client.d.mts +20 -0
  235. package/dist/providers/stack-provider-client.d.ts +15 -8
  236. package/dist/providers/stack-provider-client.js +64 -20
  237. package/dist/providers/stack-provider.d.mts +14 -0
  238. package/dist/providers/stack-provider.d.ts +13 -5
  239. package/dist/providers/stack-provider.js +39 -8
  240. package/dist/providers/styled-components-registry.d.mts +8 -0
  241. package/dist/providers/styled-components-registry.d.ts +8 -4
  242. package/dist/providers/styled-components-registry.js +43 -17
  243. package/dist/providers/theme-provider.d.mts +22 -0
  244. package/dist/providers/theme-provider.d.ts +21 -9
  245. package/dist/providers/theme-provider.js +55 -19
  246. package/dist/utils/browser-script.d.mts +5 -0
  247. package/dist/utils/browser-script.d.ts +5 -0
  248. package/dist/utils/browser-script.js +50 -0
  249. package/dist/utils/constants.d.mts +48 -0
  250. package/dist/utils/constants.d.ts +11 -9
  251. package/dist/utils/constants.js +66 -21
  252. package/dist/utils/email.d.mts +3 -0
  253. package/dist/utils/email.d.ts +3 -1
  254. package/dist/utils/email.js +44 -6
  255. package/dist/utils/next.d.mts +3 -0
  256. package/dist/utils/next.d.ts +3 -1
  257. package/dist/utils/next.js +31 -3
  258. package/dist/utils/url.d.mts +4 -0
  259. package/dist/utils/url.d.ts +4 -2
  260. package/dist/utils/url.js +44 -13
  261. package/package.json +19 -10
@@ -1,3 +1,7 @@
1
- export default function FormWarningText({ text }: {
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function FormWarningText({ text }: {
2
4
  text?: string;
3
- }): import("react/jsx-runtime").JSX.Element | null;
5
+ }): react_jsx_runtime.JSX.Element | null;
6
+
7
+ export { FormWarningText as default };
@@ -1,9 +1,35 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Text } from "../components-core";
4
- export default function FormWarningText({ text }) {
5
- if (!text) {
6
- return null;
7
- }
8
- return (_jsx(Text, { size: "sm", variant: "warning", children: text }));
1
+ "use client";
2
+ "use strict";
3
+ "use client";
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/components/form-warning.tsx
23
+ var form_warning_exports = {};
24
+ __export(form_warning_exports, {
25
+ default: () => FormWarningText
26
+ });
27
+ module.exports = __toCommonJS(form_warning_exports);
28
+ var import_components_core = require("../components-core");
29
+ var import_jsx_runtime = require("react/jsx-runtime");
30
+ function FormWarningText({ text }) {
31
+ if (!text) {
32
+ return null;
33
+ }
34
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components_core.Text, { size: "sm", variant: "warning", children: text });
9
35
  }
@@ -0,0 +1,5 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function MagicLinkSignIn(): react_jsx_runtime.JSX.Element;
4
+
5
+ export { MagicLinkSignIn as default };
@@ -1 +1,5 @@
1
- export default function MagicLinkSignIn(): import("react/jsx-runtime").JSX.Element;
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function MagicLinkSignIn(): react_jsx_runtime.JSX.Element;
4
+
5
+ export { MagicLinkSignIn as default };
@@ -1,33 +1,91 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useState } from "react";
4
- import FormWarningText from "./form-warning";
5
- import { validateEmail } from "../utils/email";
6
- import { useStackApp } from "..";
7
- import { Button, Input, Label } from "../components-core";
8
- export default function MagicLinkSignIn() {
9
- const [email, setEmail] = useState('');
10
- const [sent, setSent] = useState(false);
11
- const [error, setError] = useState('');
12
- const app = useStackApp();
13
- const onSubmit = async () => {
14
- if (!email) {
15
- setError('Please enter your email');
16
- return;
1
+ "use client";
2
+ "use strict";
3
+ "use client";
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
+
32
+ // src/components/magic-link-sign-in.tsx
33
+ var magic_link_sign_in_exports = {};
34
+ __export(magic_link_sign_in_exports, {
35
+ default: () => MagicLinkSignIn
36
+ });
37
+ module.exports = __toCommonJS(magic_link_sign_in_exports);
38
+ var import_react = require("react");
39
+ var import_form_warning = __toESM(require("./form-warning"));
40
+ var import_email = require("../utils/email");
41
+ var import__ = require("..");
42
+ var import_components_core = require("../components-core");
43
+ var import_jsx_runtime = require("react/jsx-runtime");
44
+ function MagicLinkSignIn() {
45
+ const [email, setEmail] = (0, import_react.useState)("");
46
+ const [sent, setSent] = (0, import_react.useState)(false);
47
+ const [error, setError] = (0, import_react.useState)("");
48
+ const app = (0, import__.useStackApp)();
49
+ const onSubmit = async () => {
50
+ if (!email) {
51
+ setError("Please enter your email");
52
+ return;
53
+ }
54
+ if (!(0, import_email.validateEmail)(email)) {
55
+ setError("Please enter a valid email");
56
+ return;
57
+ }
58
+ const error2 = await app.sendMagicLinkEmail(email);
59
+ if (error2) {
60
+ setError(error2.message);
61
+ return;
62
+ }
63
+ setSent(true);
64
+ };
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex", flexDirection: "column", alignItems: "stretch" }, children: [
66
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components_core.Label, { htmlFor: "email", children: "Email" }),
67
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
68
+ import_components_core.Input,
69
+ {
70
+ id: "email",
71
+ type: "email",
72
+ name: "email",
73
+ value: email,
74
+ onChange: (e) => {
75
+ setEmail(e.target.value);
76
+ setError("");
17
77
  }
18
- if (!validateEmail(email)) {
19
- setError('Please enter a valid email');
20
- return;
21
- }
22
- const error = await app.sendMagicLinkEmail(email);
23
- if (error) {
24
- setError(error.message);
25
- return;
26
- }
27
- setSent(true);
28
- };
29
- return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'stretch' }, children: [_jsx(Label, { htmlFor: "email", children: "Email" }), _jsx(Input, { id: "email", type: "email", name: "email", value: email, onChange: (e) => {
30
- setEmail(e.target.value);
31
- setError('');
32
- } }), _jsx(FormWarningText, { text: error }), _jsx(Button, { disabled: sent, style: { marginTop: '1.5rem' }, onClick: onSubmit, children: sent ? 'Email sent' : 'Send magic link' })] }));
78
+ }
79
+ ),
80
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form_warning.default, { text: error }),
81
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
82
+ import_components_core.Button,
83
+ {
84
+ disabled: sent,
85
+ style: { marginTop: "1.5rem" },
86
+ onClick: onSubmit,
87
+ children: sent ? "Email sent" : "Send magic link"
88
+ }
89
+ )
90
+ ] });
33
91
  }
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+
4
+ declare function MessageCard({ children, title, fullPage }: {
5
+ children?: React__default.ReactNode;
6
+ title: string;
7
+ fullPage?: boolean;
8
+ }): react_jsx_runtime.JSX.Element;
9
+
10
+ export { MessageCard as default };
@@ -1,6 +1,10 @@
1
- import React from "react";
2
- export default function MessageCard({ children, title, fullPage }: {
3
- children?: React.ReactNode;
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+
4
+ declare function MessageCard({ children, title, fullPage }: {
5
+ children?: React__default.ReactNode;
4
6
  title: string;
5
7
  fullPage?: boolean;
6
- }): import("react/jsx-runtime").JSX.Element;
8
+ }): react_jsx_runtime.JSX.Element;
9
+
10
+ export { MessageCard as default };
@@ -1,7 +1,46 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import CardFrame from "./card-frame";
4
- import { Text } from "../components-core";
5
- export default function MessageCard({ children, title, fullPage = false }) {
6
- return (_jsx(CardFrame, { fullPage: fullPage, children: _jsxs("div", { style: { textAlign: 'center' }, children: [_jsx(Text, { size: "xl", as: 'h2', style: { marginBottom: '24px' }, children: title }), children] }) }));
1
+ "use client";
2
+ "use strict";
3
+ "use client";
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
+
32
+ // src/components/message-card.tsx
33
+ var message_card_exports = {};
34
+ __export(message_card_exports, {
35
+ default: () => MessageCard
36
+ });
37
+ module.exports = __toCommonJS(message_card_exports);
38
+ var import_card_frame = __toESM(require("./card-frame"));
39
+ var import_components_core = require("../components-core");
40
+ var import_jsx_runtime = require("react/jsx-runtime");
41
+ function MessageCard({ children, title, fullPage = false }) {
42
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_card_frame.default, { fullPage, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { textAlign: "center" }, children: [
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components_core.Text, { size: "xl", as: "h2", style: { marginBottom: "24px" }, children: title }),
44
+ children
45
+ ] }) });
7
46
  }
@@ -0,0 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function OAuthButton({ provider, type, }: {
4
+ provider: string;
5
+ type: 'signin' | 'signup';
6
+ }): react_jsx_runtime.JSX.Element;
7
+
8
+ export { OAuthButton as default };
@@ -1,4 +1,8 @@
1
- export default function OAuthButton({ provider, type, }: {
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function OAuthButton({ provider, type, }: {
2
4
  provider: string;
3
5
  type: 'signin' | 'signup';
4
- }): import("react/jsx-runtime").JSX.Element;
6
+ }): react_jsx_runtime.JSX.Element;
7
+
8
+ export { OAuthButton as default };
@@ -1,65 +1,144 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { FaGithub, FaFacebook, FaApple } from 'react-icons/fa';
4
- import { useStackApp } from '..';
5
- import { Button } from "../components-core";
6
- import { useDesign } from "../providers/design-provider";
7
- import Color from 'color';
8
- const iconSize = 22;
9
- export default function OAuthButton({ provider, type, }) {
10
- const { colors } = useDesign();
11
- const stackApp = useStackApp();
12
- let style;
13
- switch (provider) {
14
- case 'google': {
15
- style = {
16
- backgroundColor: '#fff',
17
- name: 'Google',
18
- border: Color(colors.backgroundColor).isDark() ? undefined : '1px solid #ccc',
19
- icon: (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: iconSize, height: iconSize, viewBox: "0 0 24 24", children: [_jsx("path", { fill: "#4285F4", d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z" }), _jsx("path", { fill: "#34A853", d: "M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" }), _jsx("path", { fill: "#FBBC05", d: "M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" }), _jsx("path", { fill: "#EA4335", d: "M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" }), _jsx("path", { fill: "none", d: "M1 1h22v22H1z" })] })),
20
- };
21
- break;
22
- }
23
- case 'github': {
24
- style = {
25
- backgroundColor: '#111',
26
- border: Color(colors.backgroundColor).isDark() ? '1px solid #444' : undefined,
27
- name: 'GitHub',
28
- icon: (_jsx(FaGithub, { color: "#fff", size: iconSize })),
29
- };
30
- break;
31
- }
32
- case 'facebook': {
33
- style = {
34
- backgroundColor: '#1877F2',
35
- name: 'Facebook',
36
- icon: (_jsx(FaFacebook, { color: "#fff", size: iconSize })),
37
- };
38
- break;
39
- }
40
- case 'apple': {
41
- style = {
42
- backgroundColor: '#000',
43
- name: 'Apple',
44
- icon: (_jsx(FaApple, { color: "#fff", size: iconSize })),
45
- };
46
- break;
47
- }
48
- case 'microsoft': {
49
- style = {
50
- backgroundColor: '#2f2f2f',
51
- name: 'Microsoft',
52
- icon: (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: iconSize, height: iconSize, viewBox: "0 0 21 21", children: [_jsx("title", { children: "MS-SymbolLockup" }), _jsx("path", { fill: "#f25022", d: "M1 1h9v9H1z" }), _jsx("path", { fill: "#00a4ef", d: "M1 11h9v9H1z" }), _jsx("path", { fill: "#7fba00", d: "M11 1h9v9h-9z" }), _jsx("path", { fill: "#ffb900", d: "M11 11h9v9h-9z" })] })),
53
- };
54
- break;
55
- }
56
- default: {
57
- style = {
58
- backgroundColor: '#000',
59
- name: provider,
60
- icon: null
61
- };
62
- }
1
+ "use client";
2
+ "use strict";
3
+ "use client";
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/components/oauth-button.tsx
23
+ var oauth_button_exports = {};
24
+ __export(oauth_button_exports, {
25
+ default: () => OAuthButton
26
+ });
27
+ module.exports = __toCommonJS(oauth_button_exports);
28
+ var import_fa = require("react-icons/fa");
29
+ var import__ = require("..");
30
+ var import_components_core = require("../components-core");
31
+ var import_design_provider = require("../providers/design-provider");
32
+ var import_jsx_runtime = require("react/jsx-runtime");
33
+ var iconSize = 22;
34
+ function OAuthButton({
35
+ provider,
36
+ type
37
+ }) {
38
+ const { colors } = (0, import_design_provider.useDesign)();
39
+ const stackApp = (0, import__.useStackApp)();
40
+ let style;
41
+ switch (provider) {
42
+ case "google": {
43
+ style = {
44
+ backgroundColor: "#fff",
45
+ name: "Google",
46
+ border: "1px solid #ccc",
47
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: iconSize, height: iconSize, viewBox: "0 0 24 24", children: [
48
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
+ "path",
50
+ {
51
+ fill: "#4285F4",
52
+ d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
53
+ }
54
+ ),
55
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
56
+ "path",
57
+ {
58
+ fill: "#34A853",
59
+ d: "M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
60
+ }
61
+ ),
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
+ "path",
64
+ {
65
+ fill: "#FBBC05",
66
+ d: "M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
67
+ }
68
+ ),
69
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
70
+ "path",
71
+ {
72
+ fill: "#EA4335",
73
+ d: "M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
74
+ }
75
+ ),
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "none", d: "M1 1h22v22H1z" })
77
+ ] })
78
+ };
79
+ break;
63
80
  }
64
- return (_jsx(Button, { color: style.backgroundColor, style: { border: style.border }, onClick: () => stackApp.signInWithOAuth(provider), children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%' }, children: [style.icon, _jsxs("span", { style: { flexGrow: 1 }, children: [type === 'signup' ? 'Sign up with ' : 'Sign in with ', style.name] }), _jsx("div", { style: { visibility: 'hidden' }, children: style.icon })] }) }));
81
+ case "github": {
82
+ style = {
83
+ backgroundColor: "#111",
84
+ border: "1px solid #444",
85
+ name: "GitHub",
86
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaGithub, { color: "#fff", size: iconSize })
87
+ };
88
+ break;
89
+ }
90
+ case "facebook": {
91
+ style = {
92
+ backgroundColor: "#1877F2",
93
+ name: "Facebook",
94
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaFacebook, { color: "#fff", size: iconSize })
95
+ };
96
+ break;
97
+ }
98
+ case "apple": {
99
+ style = {
100
+ backgroundColor: "#000",
101
+ name: "Apple",
102
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa.FaApple, { color: "#fff", size: iconSize })
103
+ };
104
+ break;
105
+ }
106
+ case "microsoft": {
107
+ style = {
108
+ backgroundColor: "#2f2f2f",
109
+ name: "Microsoft",
110
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: iconSize, height: iconSize, viewBox: "0 0 21 21", children: [
111
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("title", { children: "MS-SymbolLockup" }),
112
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "#f25022", d: "M1 1h9v9H1z" }),
113
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "#00a4ef", d: "M1 11h9v9H1z" }),
114
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "#7fba00", d: "M11 1h9v9h-9z" }),
115
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "#ffb900", d: "M11 11h9v9h-9z" })
116
+ ] })
117
+ };
118
+ break;
119
+ }
120
+ default: {
121
+ style = {
122
+ backgroundColor: "#000",
123
+ name: provider,
124
+ icon: null
125
+ };
126
+ }
127
+ }
128
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
129
+ import_components_core.Button,
130
+ {
131
+ color: style.backgroundColor,
132
+ style: { border: style.border },
133
+ onClick: () => stackApp.signInWithOAuth(provider),
134
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex", alignItems: "center", width: "100%" }, children: [
135
+ style.icon,
136
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { style: { flexGrow: 1 }, children: [
137
+ type === "signup" ? "Sign up with " : "Sign in with ",
138
+ style.name
139
+ ] }),
140
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { visibility: "hidden" }, children: style.icon })
141
+ ] })
142
+ }
143
+ );
65
144
  }
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function OAuthGroup({ type, }: {
4
+ type: 'signin' | 'signup';
5
+ }): react_jsx_runtime.JSX.Element;
6
+
7
+ export { OAuthGroup as default };
@@ -1,3 +1,7 @@
1
- export default function OAuthGroup({ type, }: {
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function OAuthGroup({ type, }: {
2
4
  type: 'signin' | 'signup';
3
- }): import("react/jsx-runtime").JSX.Element;
5
+ }): react_jsx_runtime.JSX.Element;
6
+
7
+ export { OAuthGroup as default };
@@ -1,9 +1,47 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useStackApp } from "../lib/hooks";
4
- import OAuthButton from "./oauth-button";
5
- export default function OAuthGroup({ type, }) {
6
- const stackApp = useStackApp();
7
- const project = stackApp.useProject();
8
- return (_jsx("div", { style: { gap: '16px', display: 'flex', flexDirection: 'column', alignItems: 'stretch' }, children: project.oauthProviders.filter(p => p.enabled).map(p => (_jsx(OAuthButton, { provider: p.id, type: type }, p.id))) }));
1
+ "use client";
2
+ "use strict";
3
+ "use client";
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
+
32
+ // src/components/oauth-group.tsx
33
+ var oauth_group_exports = {};
34
+ __export(oauth_group_exports, {
35
+ default: () => OAuthGroup
36
+ });
37
+ module.exports = __toCommonJS(oauth_group_exports);
38
+ var import_hooks = require("../lib/hooks");
39
+ var import_oauth_button = __toESM(require("./oauth-button"));
40
+ var import_jsx_runtime = require("react/jsx-runtime");
41
+ function OAuthGroup({
42
+ type
43
+ }) {
44
+ const stackApp = (0, import_hooks.useStackApp)();
45
+ const project = stackApp.useProject();
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { gap: "16px", display: "flex", flexDirection: "column", alignItems: "stretch" }, children: project.oauthProviders.filter((p) => p.enabled).map((p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_oauth_button.default, { provider: p.id, type }, p.id)) });
9
47
  }
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+
3
+ declare const PasswordField: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
4
+
5
+ export { PasswordField as default };
@@ -1,3 +1,5 @@
1
- /// <reference types="react" />
2
- declare const PasswordField: import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
3
- export default PasswordField;
1
+ import * as React from 'react';
2
+
3
+ declare const PasswordField: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
4
+
5
+ export { PasswordField as default };