@stackframe/stack 1.2.1 → 2.1.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.
- package/dist/components/card-frame.d.ts +7 -0
- package/dist/components/card-frame.d.ts.map +1 -0
- package/dist/components/card-frame.js +24 -0
- package/dist/{elements/CardHeader.d.ts → components/card-header.d.ts} +1 -1
- package/dist/components/card-header.d.ts.map +1 -0
- package/dist/components/card-header.js +5 -0
- package/dist/components/credential-sign-in.d.ts +2 -0
- package/dist/components/credential-sign-in.d.ts.map +1 -0
- package/dist/components/credential-sign-in.js +56 -0
- package/dist/components/credential-sign-up.d.ts +2 -0
- package/dist/components/credential-sign-up.d.ts.map +1 -0
- package/dist/components/credential-sign-up.js +73 -0
- package/dist/{elements/DividerWithText.d.ts → components/divider-with-text.d.ts} +1 -1
- package/dist/components/divider-with-text.d.ts.map +1 -0
- package/dist/components/divider-with-text.js +6 -0
- package/dist/components/email-verification.d.ts +5 -0
- package/dist/components/email-verification.d.ts.map +1 -0
- package/dist/components/{EmailVerification.js → email-verification.js} +2 -2
- package/dist/{elements/ForgotPassword.d.ts → components/forgot-password.d.ts} +1 -1
- package/dist/components/forgot-password.d.ts.map +1 -0
- package/dist/components/forgot-password.js +32 -0
- package/dist/components/form-warning.d.ts +4 -0
- package/dist/components/form-warning.d.ts.map +1 -0
- package/dist/components/form-warning.js +9 -0
- package/dist/{elements/MessageCard.d.ts → components/message-card.d.ts} +1 -1
- package/dist/components/message-card.d.ts.map +1 -0
- package/dist/components/message-card.js +7 -0
- package/dist/components/oauth-button.d.ts +5 -0
- package/dist/components/oauth-button.d.ts.map +1 -0
- package/dist/components/oauth-button.js +66 -0
- package/dist/components/oauth-callback.d.ts +2 -0
- package/dist/components/oauth-callback.d.ts.map +1 -0
- package/dist/components/oauth-callback.js +17 -0
- package/dist/components/oauth-group.d.ts +4 -0
- package/dist/components/oauth-group.d.ts.map +1 -0
- package/dist/components/oauth-group.js +9 -0
- package/dist/components/password-field.d.ts +4 -0
- package/dist/components/password-field.d.ts.map +1 -0
- package/dist/components/password-field.js +41 -0
- package/dist/{elements/PasswordResetInner.d.ts → components/password-reset-inner.d.ts} +1 -1
- package/dist/components/password-reset-inner.d.ts.map +1 -0
- package/dist/{elements/PasswordResetInner.js → components/password-reset-inner.js} +18 -16
- package/dist/components/password-reset.d.ts +5 -0
- package/dist/components/password-reset.d.ts.map +1 -0
- package/dist/components/{PasswordReset.js → password-reset.js} +6 -5
- package/dist/{elements/RedirectMessageCard.d.ts → components/redirect-message-card.d.ts} +1 -1
- package/dist/components/redirect-message-card.d.ts.map +1 -0
- package/dist/{elements/RedirectMessageCard.js → components/redirect-message-card.js} +19 -15
- package/dist/components/sign-in.d.ts +4 -0
- package/dist/components/sign-in.d.ts.map +1 -0
- package/dist/components/sign-in.js +20 -0
- package/dist/components/sign-out.d.ts +2 -0
- package/dist/components/sign-out.d.ts.map +1 -0
- package/dist/components/{SignOut.js → sign-out.js} +5 -4
- package/dist/components/sign-up.d.ts +4 -0
- package/dist/components/sign-up.d.ts.map +1 -0
- package/dist/components/sign-up.js +20 -0
- package/dist/components/stack-handler.d.ts +9 -0
- package/dist/components/stack-handler.d.ts.map +1 -0
- package/dist/components/stack-handler.js +58 -0
- package/dist/components-core/button.d.ts +10 -0
- package/dist/components-core/button.d.ts.map +1 -0
- package/dist/components-core/button.js +115 -0
- package/dist/components-core/container.d.ts +6 -0
- package/dist/components-core/container.d.ts.map +1 -0
- package/dist/components-core/container.js +19 -0
- package/dist/components-core/divider.d.ts +7 -0
- package/dist/components-core/divider.d.ts.map +1 -0
- package/dist/components-core/divider.js +17 -0
- package/dist/components-core/index.d.ts +17 -0
- package/dist/components-core/index.d.ts.map +1 -0
- package/dist/components-core/index.js +32 -0
- package/dist/components-core/input.d.ts +5 -0
- package/dist/components-core/input.d.ts.map +1 -0
- package/dist/components-core/input.js +45 -0
- package/dist/components-core/label.d.ts +6 -0
- package/dist/components-core/label.d.ts.map +1 -0
- package/dist/components-core/label.js +22 -0
- package/dist/components-core/link.d.ts +9 -0
- package/dist/components-core/link.d.ts.map +1 -0
- package/dist/components-core/link.js +18 -0
- package/dist/components-core/text.d.ts +9 -0
- package/dist/components-core/text.d.ts.map +1 -0
- package/dist/components-core/text.js +42 -0
- package/dist/components-core-joy/button.d.ts +3 -0
- package/dist/components-core-joy/button.d.ts.map +1 -0
- package/dist/components-core-joy/button.js +26 -0
- package/dist/components-core-joy/divider.d.ts +3 -0
- package/dist/components-core-joy/divider.d.ts.map +1 -0
- package/dist/components-core-joy/divider.js +7 -0
- package/dist/components-core-joy/input.d.ts +3 -0
- package/dist/components-core-joy/input.d.ts.map +1 -0
- package/dist/components-core-joy/input.js +7 -0
- package/dist/components-core-joy/text.d.ts +3 -0
- package/dist/components-core-joy/text.d.ts.map +1 -0
- package/dist/components-core-joy/text.js +28 -0
- package/dist/{components/EmailVerification.d.ts → components-page/email-verification.d.ts} +1 -2
- package/dist/components-page/email-verification.d.ts.map +1 -0
- package/dist/components-page/email-verification.js +29 -0
- package/dist/{components/ForgotPassword.d.ts → components-page/forgot-password.d.ts} +1 -1
- package/dist/components-page/forgot-password.d.ts.map +1 -0
- package/dist/{components/ForgotPassword.js → components-page/forgot-password.js} +6 -6
- package/dist/{components/OAuthCallback.d.ts → components-page/oauth-callback.d.ts} +1 -1
- package/dist/components-page/oauth-callback.d.ts.map +1 -0
- package/dist/{components/OAuthCallback.js → components-page/oauth-callback.js} +1 -4
- package/dist/{components/PasswordReset.d.ts → components-page/password-reset.d.ts} +1 -1
- package/dist/components-page/password-reset.d.ts.map +1 -0
- package/dist/components-page/password-reset.js +37 -0
- package/dist/components-page/sign-in.d.ts +4 -0
- package/dist/components-page/sign-in.d.ts.map +1 -0
- package/dist/components-page/sign-in.js +20 -0
- package/dist/components-page/sign-out.d.ts +2 -0
- package/dist/components-page/sign-out.d.ts.map +1 -0
- package/dist/components-page/sign-out.js +13 -0
- package/dist/components-page/sign-up.d.ts +4 -0
- package/dist/components-page/sign-up.d.ts.map +1 -0
- package/dist/components-page/sign-up.js +20 -0
- package/dist/{components/StackHandler.d.ts → components-page/stack-handler.d.ts} +1 -1
- package/dist/components-page/stack-handler.d.ts.map +1 -0
- package/dist/{components/StackHandler.js → components-page/stack-handler.js} +11 -11
- package/dist/elements/card-frame.d.ts +7 -0
- package/dist/elements/card-frame.d.ts.map +1 -0
- package/dist/elements/card-frame.js +24 -0
- package/dist/elements/card-header.d.ts +6 -0
- package/dist/elements/card-header.d.ts.map +1 -0
- package/dist/elements/card-header.js +5 -0
- package/dist/elements/credential-sign-in.d.ts +2 -0
- package/dist/elements/credential-sign-in.d.ts.map +1 -0
- package/dist/elements/credential-sign-in.js +56 -0
- package/dist/elements/credential-sign-up.d.ts +2 -0
- package/dist/elements/credential-sign-up.d.ts.map +1 -0
- package/dist/elements/credential-sign-up.js +73 -0
- package/dist/elements/divider-with-text.d.ts +4 -0
- package/dist/elements/divider-with-text.d.ts.map +1 -0
- package/dist/elements/divider-with-text.js +6 -0
- package/dist/elements/forgot-password.d.ts +4 -0
- package/dist/elements/forgot-password.d.ts.map +1 -0
- package/dist/elements/forgot-password.js +32 -0
- package/dist/elements/{FormWarning.d.ts → form-warning.d.ts} +1 -1
- package/dist/elements/form-warning.d.ts.map +1 -0
- package/dist/elements/{FormWarning.js → form-warning.js} +2 -1
- package/dist/elements/message-card.d.ts +7 -0
- package/dist/elements/message-card.d.ts.map +1 -0
- package/dist/elements/message-card.js +7 -0
- package/dist/elements/oauth-button.d.ts +5 -0
- package/dist/elements/oauth-button.d.ts.map +1 -0
- package/dist/elements/{OAuthButton.js → oauth-button.js} +8 -10
- package/dist/elements/oauth-group.d.ts +4 -0
- package/dist/elements/oauth-group.d.ts.map +1 -0
- package/dist/elements/oauth-group.js +8 -0
- package/dist/elements/{PasswordField.d.ts → password-field.d.ts} +1 -1
- package/dist/elements/password-field.d.ts.map +1 -0
- package/dist/elements/password-field.js +38 -0
- package/dist/elements/password-reset-inner.d.ts +5 -0
- package/dist/elements/password-reset-inner.d.ts.map +1 -0
- package/dist/elements/password-reset-inner.js +63 -0
- package/dist/elements/redirect-message-card.d.ts +5 -0
- package/dist/elements/redirect-message-card.d.ts.map +1 -0
- package/dist/elements/redirect-message-card.js +54 -0
- package/dist/index.d.ts +17 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -9
- package/dist/lib/auth.d.ts +1 -13
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +6 -30
- package/dist/lib/hooks.js +1 -1
- package/dist/lib/stack-app.d.ts +6 -8
- package/dist/lib/stack-app.d.ts.map +1 -1
- package/dist/lib/stack-app.js +43 -35
- package/dist/providers/component-provider.d.ts +25 -0
- package/dist/providers/component-provider.d.ts.map +1 -0
- package/dist/providers/component-provider.js +29 -0
- package/dist/providers/design-provider.d.ts +41 -0
- package/dist/providers/design-provider.d.ts.map +1 -0
- package/dist/providers/design-provider.js +65 -0
- package/dist/providers/joy-provider.d.ts +17 -0
- package/dist/providers/joy-provider.d.ts.map +1 -0
- package/dist/providers/joy-provider.js +27 -0
- package/dist/providers/{StackProviderClient.d.ts → stack-provider-client.d.ts} +1 -1
- package/dist/providers/stack-provider-client.d.ts.map +1 -0
- package/dist/providers/{StackProvider.d.ts → stack-provider.d.ts} +3 -3
- package/dist/providers/stack-provider.d.ts.map +1 -0
- package/dist/providers/{StackProvider.js → stack-provider.js} +1 -1
- package/dist/providers/styled-components-registry.d.ts +5 -0
- package/dist/providers/styled-components-registry.d.ts.map +1 -0
- package/dist/providers/styled-components-registry.js +18 -0
- package/dist/providers/theme-provider.d.ts +11 -0
- package/dist/providers/theme-provider.d.ts.map +1 -0
- package/dist/providers/theme-provider.js +20 -0
- package/dist/providers/ui-provider.d.ts +10 -0
- package/dist/providers/ui-provider.js +20 -0
- package/dist/utils/constants.d.ts +41 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +22 -0
- package/dist/utils/email.d.ts.map +1 -1
- package/dist/utils/next.d.ts.map +1 -1
- package/dist/utils/react.d.ts.map +1 -1
- package/dist/utils/results.d.ts.map +1 -1
- package/dist/utils/url.d.ts.map +1 -1
- package/package.json +22 -27
- package/dist/components/EmailVerification.d.ts.map +0 -1
- package/dist/components/ForgotPassword.d.ts.map +0 -1
- package/dist/components/OAuthCallback.d.ts.map +0 -1
- package/dist/components/PasswordReset.d.ts.map +0 -1
- package/dist/components/SignIn.d.ts +0 -5
- package/dist/components/SignIn.d.ts.map +0 -1
- package/dist/components/SignIn.js +0 -20
- package/dist/components/SignOut.d.ts +0 -4
- package/dist/components/SignOut.d.ts.map +0 -1
- package/dist/components/SignUp.d.ts +0 -5
- package/dist/components/SignUp.d.ts.map +0 -1
- package/dist/components/SignUp.js +0 -19
- package/dist/components/StackHandler.d.ts.map +0 -1
- package/dist/elements/Button.d.ts +0 -11
- package/dist/elements/Button.d.ts.map +0 -1
- package/dist/elements/Button.js +0 -18
- package/dist/elements/CardFrame.d.ts +0 -6
- package/dist/elements/CardFrame.d.ts.map +0 -1
- package/dist/elements/CardFrame.js +0 -10
- package/dist/elements/CardHeader.d.ts.map +0 -1
- package/dist/elements/CardHeader.js +0 -4
- package/dist/elements/CredentialSignIn.d.ts +0 -4
- package/dist/elements/CredentialSignIn.d.ts.map +0 -1
- package/dist/elements/CredentialSignIn.js +0 -57
- package/dist/elements/CredentialSignUp.d.ts +0 -4
- package/dist/elements/CredentialSignUp.d.ts.map +0 -1
- package/dist/elements/CredentialSignUp.js +0 -73
- package/dist/elements/DividerWithText.d.ts.map +0 -1
- package/dist/elements/DividerWithText.js +0 -5
- package/dist/elements/ForgotPassword.d.ts.map +0 -1
- package/dist/elements/ForgotPassword.js +0 -32
- package/dist/elements/FormWarning.d.ts.map +0 -1
- package/dist/elements/MessageCard.d.ts.map +0 -1
- package/dist/elements/MessageCard.js +0 -5
- package/dist/elements/OAuthButton.d.ts +0 -6
- package/dist/elements/OAuthButton.d.ts.map +0 -1
- package/dist/elements/OAuthGroup.d.ts +0 -5
- package/dist/elements/OAuthGroup.d.ts.map +0 -1
- package/dist/elements/OAuthGroup.js +0 -8
- package/dist/elements/PasswordField.d.ts.map +0 -1
- package/dist/elements/PasswordField.js +0 -27
- package/dist/elements/PasswordResetInner.d.ts.map +0 -1
- package/dist/elements/RedirectMessageCard.d.ts.map +0 -1
- package/dist/providers/StackProvider.d.ts.map +0 -1
- package/dist/providers/StackProviderClient.d.ts.map +0 -1
- package/dist/tailwind.css +0 -1293
- package/dist/utils/types.d.ts +0 -4
- package/dist/utils/types.d.ts.map +0 -1
- package/dist/utils/types.js +0 -1
- /package/dist/providers/{StackProviderClient.js → stack-provider-client.js} +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { useServerInsertedHTML } from 'next/navigation';
|
|
5
|
+
import { ServerStyleSheet, StyleSheetManager } from 'styled-components';
|
|
6
|
+
export default function StyledComponentsRegistry({ children, }) {
|
|
7
|
+
// Only create stylesheet once with lazy initial state
|
|
8
|
+
// x-ref: https://reactjs.org/docs/hooks-reference.html#lazy-initial-state
|
|
9
|
+
const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet());
|
|
10
|
+
useServerInsertedHTML(() => {
|
|
11
|
+
const styles = styledComponentsStyleSheet.getStyleElement();
|
|
12
|
+
styledComponentsStyleSheet.instance.clearTag();
|
|
13
|
+
return _jsx(_Fragment, { children: styles });
|
|
14
|
+
});
|
|
15
|
+
if (typeof window !== 'undefined')
|
|
16
|
+
return _jsx(_Fragment, { children: children });
|
|
17
|
+
return (_jsx(StyleSheetManager, { sheet: styledComponentsStyleSheet.instance, children: children }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { ComponentProps } from "react";
|
|
2
|
+
import { DesignConfig } from "./design-provider";
|
|
3
|
+
import { ComponentConfig } from "./component-provider";
|
|
4
|
+
import { ThemeProvider as NextThemeProvider } from "next-themes";
|
|
5
|
+
export type ThemeConfig = DesignConfig & ComponentConfig;
|
|
6
|
+
export declare function StackTheme({ theme, children, colorModeConfig, }: {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
theme?: DesignConfig & ComponentConfig;
|
|
9
|
+
colorModeConfig?: Omit<ComponentProps<typeof NextThemeProvider>, "themes" | "children">;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=theme-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-provider.d.ts","sourceRoot":"","sources":["../../src/providers/theme-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAuB,YAAY,EAAsB,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAA0B,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAA4B,aAAa,IAAI,iBAAiB,EAAC,MAAM,aAAa,CAAC;AAE1F,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;AAEzD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,eAAe,GAChB,EAAG;IACF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,YAAY,GAAG,eAAe,CAAC;IACvC,eAAe,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC,CAAC;CACzF,2CAyBA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { StackDesignProvider, hasCustomColorMode } from "./design-provider";
|
|
5
|
+
import { StackComponentProvider } from "./component-provider";
|
|
6
|
+
import StyledComponentsRegistry from "./styled-components-registry";
|
|
7
|
+
import { useTheme as useNextTheme, ThemeProvider as NextThemeProvider } from "next-themes";
|
|
8
|
+
export function StackTheme({ theme, children, colorModeConfig, }) {
|
|
9
|
+
const { theme: nextTheme } = useNextTheme();
|
|
10
|
+
const componentProps = { components: theme?.components };
|
|
11
|
+
const ColorModeProvider = !nextTheme ? NextThemeProvider : React.Fragment;
|
|
12
|
+
const colorModeProps = !nextTheme ? colorModeConfig : {};
|
|
13
|
+
let designProps = {};
|
|
14
|
+
if (theme && hasCustomColorMode(theme)) {
|
|
15
|
+
let { colorMode, setColorMode } = theme;
|
|
16
|
+
designProps = { colorMode, setColorMode };
|
|
17
|
+
}
|
|
18
|
+
designProps = designProps || { breakpoints: theme?.breakpoints, colors: theme?.colors };
|
|
19
|
+
return (_jsx(ColorModeProvider, { ...colorModeProps, children: _jsx(StyledComponentsRegistry, { children: _jsx(StackDesignProvider, { ...designProps, children: _jsx(StackComponentProvider, { ...componentProps, children: children }) }) }) }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { ComponentProps } from "react";
|
|
2
|
+
import { DesignConfig } from "./design-provider";
|
|
3
|
+
import { ComponentConfig } from "./component-provider";
|
|
4
|
+
import { ThemeProvider as NextThemeProvider } from "next-themes";
|
|
5
|
+
export type ThemeConfig = DesignConfig & ComponentConfig;
|
|
6
|
+
export declare function StackTheme({ theme, children, colorModeConfig, }: {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
theme?: DesignConfig & ComponentConfig;
|
|
9
|
+
colorModeConfig?: Omit<ComponentProps<typeof NextThemeProvider>, "themes" | "children">;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { StackDesignProvider, hasCustomColorMode } from "./design-provider";
|
|
5
|
+
import { StackComponentProvider } from "./component-provider";
|
|
6
|
+
import StyledComponentsRegistry from "./styled-components-registry";
|
|
7
|
+
import { useTheme as useNextTheme, ThemeProvider as NextThemeProvider } from "next-themes";
|
|
8
|
+
export function StackTheme({ theme, children, colorModeConfig, }) {
|
|
9
|
+
const { theme: nextTheme } = useNextTheme();
|
|
10
|
+
const componentProps = { components: theme?.components };
|
|
11
|
+
const ColorModeProvider = !nextTheme ? NextThemeProvider : React.Fragment;
|
|
12
|
+
const colorModeProps = !nextTheme ? colorModeConfig : {};
|
|
13
|
+
let designProps = {};
|
|
14
|
+
if (theme && hasCustomColorMode(theme)) {
|
|
15
|
+
let { colorMode, setColorMode } = theme;
|
|
16
|
+
designProps = { colorMode, setColorMode };
|
|
17
|
+
}
|
|
18
|
+
designProps = designProps || { breakpoints: theme?.breakpoints, colors: theme?.colors };
|
|
19
|
+
return (_jsx(ColorModeProvider, { ...colorModeProps, children: _jsx(StyledComponentsRegistry, { children: _jsx(StackDesignProvider, { ...designProps, children: _jsx(StackComponentProvider, { ...componentProps, children: children }) }) }) }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const FONT_SIZES: {
|
|
2
|
+
xs: string;
|
|
3
|
+
sm: string;
|
|
4
|
+
md: string;
|
|
5
|
+
lg: string;
|
|
6
|
+
xl: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const LINE_HEIGHTS: {
|
|
9
|
+
xs: string;
|
|
10
|
+
sm: string;
|
|
11
|
+
md: string;
|
|
12
|
+
lg: string;
|
|
13
|
+
xl: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const FONT_FAMILY = "ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"";
|
|
16
|
+
export declare const PRIMARY_FONT_COLORS: {
|
|
17
|
+
dark: string;
|
|
18
|
+
light: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const SECONDARY_FONT_COLORS: {
|
|
21
|
+
dark: string;
|
|
22
|
+
light: string;
|
|
23
|
+
};
|
|
24
|
+
export declare const BORDER_RADIUS = "0.375rem";
|
|
25
|
+
export declare const DEFAULT_COLORS: {
|
|
26
|
+
readonly dark: {
|
|
27
|
+
readonly primaryColor: "#570df8";
|
|
28
|
+
readonly secondaryColor: "#404040";
|
|
29
|
+
readonly primaryBgColor: "black";
|
|
30
|
+
readonly secondaryBgColor: "#1f1f1f";
|
|
31
|
+
readonly neutralColor: "#27272a";
|
|
32
|
+
};
|
|
33
|
+
readonly light: {
|
|
34
|
+
readonly primaryColor: "#570df8";
|
|
35
|
+
readonly secondaryColor: "#e0e0e0";
|
|
36
|
+
readonly primaryBgColor: "white";
|
|
37
|
+
readonly secondaryBgColor: "#474747";
|
|
38
|
+
readonly neutralColor: "#e4e4e7";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;CAAqF,CAAC;AAC7G,eAAO,MAAM,YAAY;;;;;;CAAiF,CAAC;AAC3G,eAAO,MAAM,WAAW,+HAAuH,CAAC;AAChJ,eAAO,MAAM,mBAAmB;;;CAAwC,CAAC;AACzE,eAAO,MAAM,qBAAqB;;;CAA4C,CAAC;AAC/E,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;CAehB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const FONT_SIZES = { 'xs': '0.75rem', 'sm': '0.875rem', 'md': '1rem', 'lg': '1.25rem', 'xl': '1.5rem' };
|
|
2
|
+
export const LINE_HEIGHTS = { 'xs': '1rem', 'sm': '1.25rem', 'md': '1.5rem', 'lg': '1.75rem', 'xl': '2rem' };
|
|
3
|
+
export const FONT_FAMILY = 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"';
|
|
4
|
+
export const PRIMARY_FONT_COLORS = { 'dark': 'white', 'light': 'black' };
|
|
5
|
+
export const SECONDARY_FONT_COLORS = { 'dark': '#a8a8a8', 'light': '#737373' };
|
|
6
|
+
export const BORDER_RADIUS = '0.375rem';
|
|
7
|
+
export const DEFAULT_COLORS = {
|
|
8
|
+
dark: {
|
|
9
|
+
primaryColor: '#570df8',
|
|
10
|
+
secondaryColor: '#404040',
|
|
11
|
+
primaryBgColor: 'black',
|
|
12
|
+
secondaryBgColor: '#1f1f1f',
|
|
13
|
+
neutralColor: '#27272a',
|
|
14
|
+
},
|
|
15
|
+
light: {
|
|
16
|
+
primaryColor: '#570df8',
|
|
17
|
+
secondaryColor: '#e0e0e0',
|
|
18
|
+
primaryBgColor: 'white',
|
|
19
|
+
secondaryBgColor: '#474747',
|
|
20
|
+
neutralColor: '#e4e4e7',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/utils/email.
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/utils/email.tsx"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,2BAO1C"}
|
package/dist/utils/next.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/utils/next.
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/utils/next.tsx"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,YAGvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/utils/react.
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/utils/react.tsx"],"names":[],"mappings":"AAGA,wBAAgB,OAAO,IAAI,KAAK,CAG/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../src/utils/results.
|
|
1
|
+
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../src/utils/results.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,IAC7B;IACA,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;CACT,GACC;IACA,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEJ,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,IAAI,IAC5C,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACV;IACF,MAAM,EAAE,SAAS,CAAC;CACnB,GACC,CAAC,CAAC,SAAS,IAAI,GAAG,EAAE,GAAG;IAAE,QAAQ,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAE5C,eAAO,MAAM,MAAM;;;;;;;CAsBlB,CAAC;AAEF,iBAAS,eAAe,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAQnF;AAED,iBAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3G,iBAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
package/dist/utils/url.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/utils/url.
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/utils/url.tsx"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,SAW3B;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,UAGzE"}
|
package/package.json
CHANGED
|
@@ -1,50 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackframe/stack",
|
|
3
|
-
"version": "
|
|
4
|
-
"main": "./dist/index.js",
|
|
5
|
-
"types": "./dist/index.d.ts",
|
|
3
|
+
"version": "2.1.0",
|
|
6
4
|
"type": "module",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
+
"color": "^4.2.3",
|
|
11
12
|
"js-cookie": "^3.0.5",
|
|
12
13
|
"oauth4webapi": "^2.10.3",
|
|
13
14
|
"react-icons": "^5.0.1",
|
|
14
|
-
"tailwindcss-scoped-preflight": "^2.1.0",
|
|
15
15
|
"server-only": "^0.0.1",
|
|
16
|
-
"
|
|
17
|
-
"@
|
|
16
|
+
"tailwindcss-scoped-preflight": "^2.1.0",
|
|
17
|
+
"@radix-ui/react-label": "^2.0.2",
|
|
18
|
+
"next-themes": "^0.2.1",
|
|
19
|
+
"styled-components": "^6.1.8",
|
|
20
|
+
"@stackframe/stack-shared": "2.1.0",
|
|
21
|
+
"@stackframe/stack-sc": "1.3.0"
|
|
18
22
|
},
|
|
19
23
|
"peerDependencies": {
|
|
20
|
-
"next": "^14",
|
|
21
|
-
"react": "^18.2
|
|
24
|
+
"next": "^14.1",
|
|
25
|
+
"react": "^18.2",
|
|
26
|
+
"@mui/joy": "^5.0.0-beta.30"
|
|
27
|
+
},
|
|
28
|
+
"peerDependenciesMeta": {
|
|
29
|
+
"@mui/joy": {
|
|
30
|
+
"optional": true
|
|
31
|
+
}
|
|
22
32
|
},
|
|
23
33
|
"devDependencies": {
|
|
34
|
+
"@types/color": "^3.0.6",
|
|
24
35
|
"@types/js-cookie": "^3.0.6",
|
|
25
|
-
"@types/react": "^18.2.
|
|
26
|
-
"@typescript-eslint/eslint-plugin": "^6",
|
|
27
|
-
"@typescript-eslint/parser": "^6.x",
|
|
28
|
-
"autoprefixer": "^10.4.17",
|
|
29
|
-
"concurrently": "^8.2.2",
|
|
30
|
-
"daisyui": "^4.7.2",
|
|
31
|
-
"eslint": "^8",
|
|
32
|
-
"eslint-config-next": "^14",
|
|
33
|
-
"postcss": "^8.4.35",
|
|
34
|
-
"postcss-cli": "^11.0.0",
|
|
35
|
-
"postcss-nested": "^6.0.1",
|
|
36
|
-
"postcss-prefix-selector": "^1.16.0",
|
|
37
|
-
"react": "^18.2.0",
|
|
38
|
-
"rimraf": "^5.0.5",
|
|
39
|
-
"tailwindcss": "^3.4.1"
|
|
36
|
+
"@types/react": "^18.2.66"
|
|
40
37
|
},
|
|
41
38
|
"scripts": {
|
|
42
39
|
"typecheck": "tsc --noEmit",
|
|
43
|
-
"build": "tsc
|
|
40
|
+
"build": "tsc",
|
|
44
41
|
"clean": "rimraf dist && rimraf node_modules",
|
|
45
|
-
"dev": "
|
|
46
|
-
"watch:ts": "tsc -w --preserveWatchOutput --declarationMap",
|
|
47
|
-
"watch:postcss": "postcss ./src/tailwind.css -o ./dist/tailwind.css --config postcss.config.js --watch",
|
|
42
|
+
"dev": "tsc -w --preserveWatchOutput --declarationMap",
|
|
48
43
|
"lint": "eslint --ext .tsx,.ts ."
|
|
49
44
|
}
|
|
50
45
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EmailVerification.d.ts","sourceRoot":"","sources":["../../src/components/EmailVerification.tsx"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,YAAY,EAAE,EACZ,IAAS,GACL,EACN,QAAgB,GACjB,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,kDAkCA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ForgotPassword.d.ts","sourceRoot":"","sources":["../../src/components/ForgotPassword.tsx"],"names":[],"mappings":"AAWA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,QAAc,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,2CA0BhF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OAuthCallback.d.ts","sourceRoot":"","sources":["../../src/components/OAuthCallback.tsx"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,aAAa,4CAapC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordReset.d.ts","sourceRoot":"","sources":["../../src/components/PasswordReset.tsx"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,YAAY,EACZ,QAAgB,GACjB,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,2CA0CA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SignIn.d.ts","sourceRoot":"","sources":["../../src/components/SignIn.tsx"],"names":[],"mappings":"AAWA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,WAAW,EAAE,QAAc,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,2CA2B3G"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import NextLink from 'next/link';
|
|
4
|
-
import CredentialSignIn from '../elements/CredentialSignIn';
|
|
5
|
-
import DividerWithText from '../elements/DividerWithText';
|
|
6
|
-
import OAuthGroup from '../elements/OAuthGroup';
|
|
7
|
-
import CardFrame from '../elements/CardFrame';
|
|
8
|
-
import CardHeader from '../elements/CardHeader';
|
|
9
|
-
import { useUser, useStackApp } from '..';
|
|
10
|
-
import RedirectMessageCard from '../elements/RedirectMessageCard';
|
|
11
|
-
export default function SignIn({ redirectUrl, fullPage = false }) {
|
|
12
|
-
const stackApp = useStackApp();
|
|
13
|
-
const user = useUser();
|
|
14
|
-
const project = stackApp.useProject();
|
|
15
|
-
if (user) {
|
|
16
|
-
return _jsx(RedirectMessageCard, { type: 'signedIn', fullPage: fullPage });
|
|
17
|
-
}
|
|
18
|
-
return (_jsxs(CardFrame, { fullPage: fullPage, children: [_jsx(CardHeader, { title: "Sign In to Your Account", children: _jsxs("p", { children: ["Don't have an account? ", _jsx(NextLink, { href: stackApp.urls['signUp'], passHref: true, className: "wl_text-blue-500", children: "Sign up" })] }) }), _jsx(OAuthGroup, { type: 'signin', redirectUrl: redirectUrl }), project.credentialEnabled &&
|
|
19
|
-
_jsxs(_Fragment, { children: [_jsx(DividerWithText, { text: 'OR' }), _jsx(CredentialSignIn, { redirectUrl: redirectUrl })] })] }));
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SignOut.d.ts","sourceRoot":"","sources":["../../src/components/SignOut.tsx"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,2CAQxE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SignUp.d.ts","sourceRoot":"","sources":["../../src/components/SignUp.tsx"],"names":[],"mappings":"AAWA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,WAAW,EAAE,QAAc,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,2CA0B3G"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import NextLink from 'next/link';
|
|
4
|
-
import DividerWithText from '../elements/DividerWithText';
|
|
5
|
-
import OAuthGroup from '../elements/OAuthGroup';
|
|
6
|
-
import CardFrame from '../elements/CardFrame';
|
|
7
|
-
import CredentialSignUp from '../elements/CredentialSignUp';
|
|
8
|
-
import CardHeader from '../elements/CardHeader';
|
|
9
|
-
import { useUser, useStackApp } from '..';
|
|
10
|
-
import RedirectMessageCard from '../elements/RedirectMessageCard';
|
|
11
|
-
export default function SignUp({ redirectUrl, fullPage = false }) {
|
|
12
|
-
const stackApp = useStackApp();
|
|
13
|
-
const user = useUser();
|
|
14
|
-
const project = stackApp.useProject();
|
|
15
|
-
if (user) {
|
|
16
|
-
return _jsx(RedirectMessageCard, { type: 'signedIn', fullPage: fullPage });
|
|
17
|
-
}
|
|
18
|
-
return (_jsxs(CardFrame, { fullPage: fullPage, children: [_jsx(CardHeader, { title: "Create a New Account", children: _jsxs("p", { children: ["Already have an account? ", _jsx(NextLink, { href: stackApp.urls['signIn'], passHref: true, className: "wl_text-blue-500", children: "Sign in" })] }) }), _jsx(OAuthGroup, { type: 'signup', redirectUrl: redirectUrl }), project.credentialEnabled && _jsxs(_Fragment, { children: [_jsx(DividerWithText, { text: 'OR' }), _jsx(CredentialSignUp, { redirectUrl: redirectUrl })] })] }));
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StackHandler.d.ts","sourceRoot":"","sources":["../../src/components/StackHandler.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAiB,cAAc,EAAE,MAAM,IAAI,CAAC;AAOnD,wBAA8B,YAAY,CAAC,aAAa,SAAS,OAAO,EAAE,EACxE,GAAG,EACH,MAAM,EAAE,EAAE,KAAK,EAAO,EACtB,YAAiB,GAClB,EAAE;IACD,GAAG,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC,oDAuDA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export default function Button(props: {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
style?: any;
|
|
5
|
-
className?: string;
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
loading?: boolean;
|
|
8
|
-
leftIcon?: React.ReactNode;
|
|
9
|
-
rightIcon?: React.ReactNode;
|
|
10
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/elements/Button.tsx"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,2CAgCA"}
|
package/dist/elements/Button.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export default function Button(props) {
|
|
3
|
-
let leftIconJsx;
|
|
4
|
-
if (props.leftIcon) {
|
|
5
|
-
leftIconJsx = _jsx("div", { children: props.leftIcon });
|
|
6
|
-
}
|
|
7
|
-
else if (props.rightIcon) {
|
|
8
|
-
leftIconJsx = _jsx("div", { className: "wl_invisible", children: props.rightIcon });
|
|
9
|
-
}
|
|
10
|
-
let rightIconJsx;
|
|
11
|
-
if (props.rightIcon) {
|
|
12
|
-
rightIconJsx = _jsx("div", { children: props.rightIcon });
|
|
13
|
-
}
|
|
14
|
-
else if (props.leftIcon) {
|
|
15
|
-
rightIconJsx = _jsx("div", { className: "wl_invisible", children: props.leftIcon });
|
|
16
|
-
}
|
|
17
|
-
return (_jsxs("button", { className: "wl_btn wl_items-center " + (props.className || ""), style: props.style, onClick: props.onClick, disabled: props.loading, children: [leftIconJsx, _jsxs("div", { className: "wl_flex-grow wl_flex wl_items-center wl_justify-center", children: [_jsx("span", { className: `wl_loading wl_loading-spinner wl_mr-2 ${props.loading ? "" : "wl_invisible"}` }), props.children, _jsx("span", { className: "wl_loading wl_loading-spinner wl_ml-2 wl_invisible" })] }), rightIconJsx] }));
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CardFrame.d.ts","sourceRoot":"","sources":["../../src/elements/CardFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAa,EACd,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,2CAkBA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export default function CardFrame({ children, fullPage = true }) {
|
|
3
|
-
const inner = (_jsx("div", { className: "stack-scope wl_container wl_mx-auto wl_max-w-md wl_font-sans", children: _jsx("div", { className: `wl_py-8 wl_px-4 wl_bg-transparent wl_rounded-xl sm:wl_px-10 sm:wl_bg-base-200 sm:wl_shadow-xl`, children: children }) }));
|
|
4
|
-
if (fullPage) {
|
|
5
|
-
return (_jsx("div", { className: "wl_min-h-screen wl_flex wl_items-center wl_justify-center", children: inner }));
|
|
6
|
-
}
|
|
7
|
-
else {
|
|
8
|
-
return inner;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CardHeader.d.ts","sourceRoot":"","sources":["../../src/elements/CardHeader.tsx"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,EAAE,QAAQ,EAAE,KAAK,EAAE,EACnB;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,2CAQ9C"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export default function CardHeader({ children, title }) {
|
|
3
|
-
return (_jsxs("div", { className: "wl_text-center wl_mb-6 wl_space-y-2 md:wl_space-y-3", children: [_jsx("h2", { className: "wl_text-2xl", children: title }), children] }));
|
|
4
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialSignIn.d.ts","sourceRoot":"","sources":["../../src/elements/CredentialSignIn.tsx"],"names":[],"mappings":"AAWA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,2CAkGjF"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { FormWarningText } from "./FormWarning";
|
|
4
|
-
import { PasswordField } from "./PasswordField";
|
|
5
|
-
import { validateEmail } from "../utils/email";
|
|
6
|
-
import NextLink from "next/link";
|
|
7
|
-
import { useStackApp } from "..";
|
|
8
|
-
import Button from "./Button";
|
|
9
|
-
import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
|
|
10
|
-
import { EmailPasswordMissMatchErrorCode, UserNotExistErrorCode } from "@stackframe/stack-shared/dist/utils/types";
|
|
11
|
-
// Import or define the PasswordField, FormWarningText, and validateEmail utilities if they're custom components or functions.
|
|
12
|
-
export default function CredentialSignIn({ redirectUrl }) {
|
|
13
|
-
const [email, setEmail] = useState('');
|
|
14
|
-
const [emailError, setEmailError] = useState('');
|
|
15
|
-
const [password, setPassword] = useState('');
|
|
16
|
-
const [passwordError, setPasswordError] = useState('');
|
|
17
|
-
const [loading, setLoading] = useState(false);
|
|
18
|
-
const stackApp = useStackApp();
|
|
19
|
-
const onSubmit = async () => {
|
|
20
|
-
if (!email) {
|
|
21
|
-
setEmailError('Please enter your email');
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
if (!validateEmail(email)) {
|
|
25
|
-
setEmailError('Please enter a valid email');
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (!password) {
|
|
29
|
-
setPasswordError('Please enter your password');
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
setLoading(true);
|
|
33
|
-
const errorCode = await stackApp.signInWithCredential({ email, password, redirectUrl });
|
|
34
|
-
setLoading(false);
|
|
35
|
-
switch (errorCode) {
|
|
36
|
-
case UserNotExistErrorCode: {
|
|
37
|
-
setEmailError('User does not exist');
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
case EmailPasswordMissMatchErrorCode: {
|
|
41
|
-
setPasswordError('Wrong email or password');
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
case undefined: {
|
|
45
|
-
// success
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
return (_jsxs("div", { className: "wl_flex wl_flex-col wl_space-y-2 wl_items-stretch", children: [_jsxs("div", { className: "wl_form-control", children: [_jsx("label", { className: "wl_label", htmlFor: "email", children: _jsx("span", { className: "wl_label-text", children: "Email" }) }), _jsx("input", { id: "email", type: "email", name: "email", className: "wl_input wl_input-bordered", value: email, onChange: (e) => {
|
|
51
|
-
setEmail(e.target.value);
|
|
52
|
-
setEmailError('');
|
|
53
|
-
} }), _jsx(FormWarningText, { text: emailError })] }), _jsxs("div", { className: "wl_form-control", children: [_jsx("label", { className: "wl_label", htmlFor: "password", children: _jsx("span", { className: "wl_label-text", children: "Password" }) }), _jsx(PasswordField, { id: "password", name: "password", value: password, onChange: (e) => {
|
|
54
|
-
setPassword(e.target.value);
|
|
55
|
-
setPasswordError('');
|
|
56
|
-
} }), _jsx(FormWarningText, { text: passwordError })] }), _jsx("div", { className: "wl_flex wl_items-center wl_justify-between", children: _jsx(NextLink, { href: stackApp.urls.forgotPassword, className: "wl_text-sm wl_text-blue-500 wl_no-underline wl_hover:wl_underline", children: "Forgot password?" }) }), _jsx("div", { className: "wl_flex wl_flex-col wl_items-stretch", children: _jsx(Button, { className: "wl_btn-primary wl_mt-6", onClick: () => runAsynchronously(onSubmit), loading: loading, children: "Sign In" }) })] }));
|
|
57
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialSignUp.d.ts","sourceRoot":"","sources":["../../src/elements/CredentialSignUp.tsx"],"names":[],"mappings":"AAYA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,2CAuHjF"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { PasswordField } from "./PasswordField";
|
|
5
|
-
import { FormWarningText } from "./FormWarning";
|
|
6
|
-
import { validateEmail } from "../utils/email";
|
|
7
|
-
import { getPasswordError } from "@stackframe/stack-shared/dist/helpers/password";
|
|
8
|
-
import { useStackApp } from "..";
|
|
9
|
-
import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
|
|
10
|
-
import Button from "./Button";
|
|
11
|
-
import { UserAlreadyExistErrorCode } from "@stackframe/stack-shared/dist/utils/types";
|
|
12
|
-
export default function CredentialSignUp({ redirectUrl }) {
|
|
13
|
-
const [email, setEmail] = useState('');
|
|
14
|
-
const [emailError, setEmailError] = useState('');
|
|
15
|
-
const [password, setPassword] = useState('');
|
|
16
|
-
const [passwordError, setPasswordError] = useState('');
|
|
17
|
-
const [passwordRepeat, setPasswordRepeat] = useState('');
|
|
18
|
-
const [passwordRepeatError, setPasswordRepeatError] = useState('');
|
|
19
|
-
const [loading, setLoading] = useState(false);
|
|
20
|
-
const stackApp = useStackApp();
|
|
21
|
-
const onSubmit = async () => {
|
|
22
|
-
if (!email) {
|
|
23
|
-
setEmailError('Please enter your email');
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (!validateEmail(email)) {
|
|
27
|
-
setEmailError('Please enter a valid email');
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (!password) {
|
|
31
|
-
setPasswordError('Please enter your password');
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (!passwordRepeat) {
|
|
35
|
-
setPasswordRepeatError('Please repeat your password');
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (password !== passwordRepeat) {
|
|
39
|
-
setPasswordRepeatError('Passwords do not match');
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const errorMessage = getPasswordError(password);
|
|
43
|
-
if (errorMessage) {
|
|
44
|
-
setPasswordError(errorMessage);
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
setLoading(true);
|
|
48
|
-
const errorCode = await stackApp.signUpWithCredential({ email, password, redirectUrl });
|
|
49
|
-
setLoading(false);
|
|
50
|
-
switch (errorCode) {
|
|
51
|
-
case UserAlreadyExistErrorCode: {
|
|
52
|
-
setEmailError('User already exists');
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
case undefined: {
|
|
56
|
-
// success
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
return (_jsxs("div", { className: "wl_flex wl_flex-col wl_space-y-2 wl_items-stretch", children: [_jsxs("div", { className: "wl_form-control", children: [_jsx("label", { className: "wl_label", htmlFor: "email", children: "Email" }), _jsx("input", { className: "wl_input wl_input-bordered", id: "email", type: "email", name: "email", value: email, onChange: (e) => {
|
|
62
|
-
setEmail(e.target.value);
|
|
63
|
-
setEmailError('');
|
|
64
|
-
} }), _jsx(FormWarningText, { text: emailError })] }), _jsxs("div", { className: "wl_form-control", children: [_jsx("label", { className: "wl_label", htmlFor: "password", children: "Password" }), _jsx(PasswordField, { id: "password", name: "password", value: password, onChange: (e) => {
|
|
65
|
-
setPassword(e.target.value);
|
|
66
|
-
setPasswordError('');
|
|
67
|
-
setPasswordRepeatError('');
|
|
68
|
-
} }), _jsx(FormWarningText, { text: passwordError })] }), _jsxs("div", { className: "wl_form-control", children: [_jsx("label", { className: "wl_label", htmlFor: "repeat-password", children: "Repeat Password" }), _jsx(PasswordField, { id: "repeat-password", name: "repeat-password", value: passwordRepeat, onChange: (e) => {
|
|
69
|
-
setPasswordRepeat(e.target.value);
|
|
70
|
-
setPasswordError('');
|
|
71
|
-
setPasswordRepeatError('');
|
|
72
|
-
} }), _jsx(FormWarningText, { text: passwordRepeatError })] }), _jsx("div", { className: "wl_flex wl_flex-col wl_items-stretch", children: _jsx(Button, { className: "wl_btn-primary wl_mt-6", onClick: () => runAsynchronously(onSubmit), loading: loading, children: "Sign Up" }) })] }));
|
|
73
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DividerWithText.d.ts","sourceRoot":"","sources":["../../src/elements/DividerWithText.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,2CASjE"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export default function DividerWithText({ text }) {
|
|
3
|
-
const lineStyle = "wl_flex-grow wl_bg-neutral wl_h-px";
|
|
4
|
-
return (_jsxs("div", { className: "wl_flex wl_items-center wl_my-4", children: [_jsx("div", { className: lineStyle }), _jsx("span", { className: "wl_px-4 wl_text-sm wl_text-neutral", children: text }), _jsx("div", { className: lineStyle })] }));
|
|
5
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ForgotPassword.d.ts","sourceRoot":"","sources":["../../src/elements/ForgotPassword.tsx"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,2CAqDzE"}
|