@stackframe/stack 2.0.0 → 2.1.1
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 -0
- package/dist/components/card-header.d.ts.map +1 -0
- package/dist/components/card-header.js +5 -0
- package/dist/{elements/CredentialSignIn.d.ts → components/credential-sign-in.d.ts} +1 -0
- package/dist/components/credential-sign-in.d.ts.map +1 -0
- package/dist/components/credential-sign-in.js +56 -0
- package/dist/{elements/CredentialSignUp.d.ts → components/credential-sign-up.d.ts} +1 -0
- package/dist/components/credential-sign-up.d.ts.map +1 -0
- package/dist/{elements/CredentialSignUp.js → components/credential-sign-up.js} +15 -15
- package/dist/{elements/DividerWithText.d.ts → components/divider-with-text.d.ts} +1 -0
- 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 -0
- 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 -0
- package/dist/components/message-card.d.ts.map +1 -0
- package/dist/components/message-card.js +7 -0
- package/dist/{elements/OAuthButton.d.ts → components/oauth-button.d.ts} +1 -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/{OAuthCallback.js → oauth-callback.js} +1 -1
- package/dist/{elements/OAuthGroup.d.ts → components/oauth-group.d.ts} +1 -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 -0
- 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 -0
- package/dist/components/redirect-message-card.d.ts.map +1 -0
- package/dist/{elements/RedirectMessageCard.js → components/redirect-message-card.js} +3 -4
- 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} +1 -1
- 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/{StackHandler.js → stack-handler.js} +7 -7
- 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 -0
- 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 -0
- 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 -0
- package/dist/components-page/oauth-callback.d.ts.map +1 -0
- package/dist/components-page/oauth-callback.js +17 -0
- package/dist/{components/PasswordReset.d.ts → components-page/password-reset.d.ts} +1 -0
- package/dist/components-page/password-reset.d.ts.map +1 -0
- package/dist/components-page/password-reset.js +37 -0
- package/dist/{components/SignIn.d.ts → components-page/sign-in.d.ts} +1 -0
- package/dist/components-page/sign-in.d.ts.map +1 -0
- package/dist/components-page/sign-in.js +20 -0
- package/dist/{components/SignOut.d.ts → components-page/sign-out.d.ts} +1 -0
- package/dist/components-page/sign-out.d.ts.map +1 -0
- package/dist/components-page/sign-out.js +13 -0
- package/dist/{components/SignUp.d.ts → components-page/sign-up.d.ts} +1 -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 -0
- package/dist/components-page/stack-handler.d.ts.map +1 -0
- package/dist/components-page/stack-handler.js +58 -0
- 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/{CredentialSignIn.js → credential-sign-in.js} +10 -11
- 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 -0
- 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} +7 -9
- 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 -0
- 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 +18 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -9
- package/dist/lib/auth.d.ts +1 -0
- package/dist/lib/cookie.d.ts +1 -0
- package/dist/lib/hooks.d.ts +1 -0
- package/dist/lib/hooks.js +1 -1
- package/dist/lib/stack-app.d.ts +1 -0
- 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 +68 -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 -0
- package/dist/providers/stack-provider-client.d.ts.map +1 -0
- package/dist/providers/{StackProvider.d.ts → stack-provider.d.ts} +3 -2
- 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 +1 -0
- package/dist/utils/email.d.ts.map +1 -1
- package/dist/utils/next.d.ts +1 -0
- package/dist/utils/next.d.ts.map +1 -1
- package/dist/utils/react.d.ts +1 -0
- package/dist/utils/react.d.ts.map +1 -1
- package/dist/utils/results.d.ts +1 -0
- package/dist/utils/results.d.ts.map +1 -1
- package/dist/utils/url.d.ts +1 -0
- package/dist/utils/url.d.ts.map +1 -1
- package/package.json +19 -24
- 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.map +0 -1
- package/dist/components/SignIn.js +0 -20
- package/dist/components/SignOut.d.ts.map +0 -1
- 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 -10
- package/dist/elements/Button.d.ts.map +0 -1
- package/dist/elements/Button.js +0 -18
- package/dist/elements/CardFrame.d.ts +0 -5
- 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.map +0 -1
- package/dist/elements/CredentialSignUp.d.ts.map +0 -1
- 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.map +0 -1
- 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 -1299
- 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
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useRouter } from "next/navigation";
|
|
4
4
|
import { useStackApp } from "..";
|
|
5
|
-
import MessageCard from "./
|
|
6
|
-
import Button from "
|
|
5
|
+
import MessageCard from "./message-card";
|
|
6
|
+
import { Text, Button } from "../components-core";
|
|
7
7
|
export default function RedirectMessageCard({ type, fullPage = false, }) {
|
|
8
8
|
const stackApp = useStackApp();
|
|
9
9
|
const router = useRouter();
|
|
@@ -16,7 +16,6 @@ export default function RedirectMessageCard({ type, fullPage = false, }) {
|
|
|
16
16
|
switch (type) {
|
|
17
17
|
case 'signedIn': {
|
|
18
18
|
title = "You are already signed in";
|
|
19
|
-
message = 'You are already signed in.';
|
|
20
19
|
primaryUrl = stackApp.urls.home;
|
|
21
20
|
secondaryUrl = stackApp.urls.signOut;
|
|
22
21
|
primaryButton = "Go to Home";
|
|
@@ -51,5 +50,5 @@ export default function RedirectMessageCard({ type, fullPage = false, }) {
|
|
|
51
50
|
break;
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
|
-
return (_jsxs(MessageCard, { title: title, fullPage: fullPage, children: [message && _jsx(
|
|
53
|
+
return (_jsxs(MessageCard, { title: title, fullPage: fullPage, children: [message && _jsx(Text, { children: message }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: '16px', marginTop: 20 }, children: [secondaryButton && (_jsx(Button, { variant: "secondary", onClick: () => router.push(stackApp.urls.signOut.toString()), children: secondaryButton })), _jsx(Button, { onClick: () => router.push(primaryUrl.toString()), children: primaryButton })] })] }));
|
|
55
54
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign-in.d.ts","sourceRoot":"","sources":["../../src/components/sign-in.tsx"],"names":[],"mappings":"AAWA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAc,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,2CA0BxE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import CredentialSignIn from '../elements/credential-sign-in';
|
|
4
|
+
import DividerWithText from '../elements/divider-with-text';
|
|
5
|
+
import OAuthGroup from '../elements/oauth-group';
|
|
6
|
+
import CardFrame from '../elements/card-frame';
|
|
7
|
+
import CardHeader from '../elements/card-header';
|
|
8
|
+
import { useUser, useStackApp } from '..';
|
|
9
|
+
import RedirectMessageCard from '../elements/redirect-message-card';
|
|
10
|
+
import { Link, Text } from '@stackframe/stack-ui';
|
|
11
|
+
export default function SignIn({ 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
|
+
const enableDivider = project.credentialEnabled && project.oauthProviders.filter(p => p.enabled).length > 0;
|
|
19
|
+
return (_jsxs(CardFrame, { fullPage: fullPage, children: [_jsx(CardHeader, { title: "Sign In to Your Account", children: _jsxs(Text, { children: ["Don't have an account? ", _jsx(Link, { href: stackApp.urls['signUp'], children: "Sign up" })] }) }), _jsx(OAuthGroup, { type: 'signin' }), enableDivider && _jsx(DividerWithText, { text: 'OR' }), project.credentialEnabled && _jsx(CredentialSignIn, {})] }));
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign-out.d.ts","sourceRoot":"","sources":["../../src/components/sign-out.tsx"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,OAAO,4CAS9B"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { use } from "react";
|
|
4
4
|
import { useStackApp, useUser } from "..";
|
|
5
|
-
import GoHomeMessageCard from "../elements/
|
|
5
|
+
import GoHomeMessageCard from "../elements/redirect-message-card";
|
|
6
6
|
export default function Signout() {
|
|
7
7
|
const user = useUser();
|
|
8
8
|
const app = useStackApp();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign-up.d.ts","sourceRoot":"","sources":["../../src/components/sign-up.tsx"],"names":[],"mappings":"AAWA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAc,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,2CA0BxE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import DividerWithText from '../elements/divider-with-text';
|
|
4
|
+
import OAuthGroup from '../elements/oauth-group';
|
|
5
|
+
import CardFrame from '../elements/card-frame';
|
|
6
|
+
import CredentialSignUp from '../elements/credential-sign-up';
|
|
7
|
+
import CardHeader from '../elements/card-header';
|
|
8
|
+
import { useUser, useStackApp } from '..';
|
|
9
|
+
import RedirectMessageCard from '../elements/redirect-message-card';
|
|
10
|
+
import { Link, Text } from '@stackframe/stack-ui';
|
|
11
|
+
export default function SignUp({ 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
|
+
const enableDivider = project.credentialEnabled && project.oauthProviders.filter(p => p.enabled).length > 0;
|
|
19
|
+
return (_jsxs(CardFrame, { fullPage: fullPage, children: [_jsx(CardHeader, { title: "Create a New Account", children: _jsxs(Text, { children: ["Already have an account? ", _jsx(Link, { href: stackApp.urls['signIn'], children: "Sign in" })] }) }), _jsx(OAuthGroup, { type: 'signup' }), enableDivider && _jsx(DividerWithText, { text: 'OR' }), project.credentialEnabled && _jsx(CredentialSignUp, {})] }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StackServerApp } from "..";
|
|
2
|
+
export default function StackHandler<HasTokenStore extends boolean>({ app, params: { stack }, searchParams, }: {
|
|
3
|
+
app: StackServerApp<HasTokenStore>;
|
|
4
|
+
params?: {
|
|
5
|
+
stack?: string[];
|
|
6
|
+
};
|
|
7
|
+
searchParams?: Record<string, string>;
|
|
8
|
+
}): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
9
|
+
//# sourceMappingURL=stack-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack-handler.d.ts","sourceRoot":"","sources":["../../src/components/stack-handler.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,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import SignUp from "./
|
|
3
|
-
import SignIn from "./
|
|
2
|
+
import SignUp from "./sign-up";
|
|
3
|
+
import SignIn from "./sign-in";
|
|
4
4
|
import { RedirectType, notFound, redirect } from 'next/navigation';
|
|
5
|
-
import EmailVerification from "./
|
|
5
|
+
import EmailVerification from "./email-verification";
|
|
6
6
|
import { PasswordReset } from "..";
|
|
7
|
-
import MessageCard from "../elements/
|
|
8
|
-
import Signout from "./
|
|
9
|
-
import ForgotPassword from "./
|
|
10
|
-
import OAuthCallback from "./
|
|
7
|
+
import MessageCard from "../elements/message-card";
|
|
8
|
+
import Signout from "./sign-out";
|
|
9
|
+
import ForgotPassword from "./forgot-password";
|
|
10
|
+
import OAuthCallback from "./oauth-callback";
|
|
11
11
|
export default async function StackHandler({ app, params: { stack } = {}, searchParams = {}, }) {
|
|
12
12
|
if (!stack) {
|
|
13
13
|
return (_jsx(MessageCard, { title: "Invalid Stack Handler Setup", fullPage: true, children: _jsx("p", { children: "Can't use Stack handler at this location. Make sure that the file is in a folder called [...stack]." }) }));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type ButtonProps = {
|
|
3
|
+
variant?: 'primary' | 'secondary' | 'warning';
|
|
4
|
+
color?: string;
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
} & Omit<React.HTMLProps<HTMLButtonElement>, 'size' | 'type'>;
|
|
8
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export default Button;
|
|
10
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components-core/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAiD1B,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;AA8C7D,QAAA,MAAM,MAAM,oGA4CX,CAAC;AAIF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { useDesign } from "../providers/design-provider";
|
|
5
|
+
import Color from 'color';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
import { BORDER_RADIUS, FONT_FAMILY, FONT_SIZES } from "../utils/constants";
|
|
8
|
+
function getColors(color, primaryBgColor) {
|
|
9
|
+
const c = Color(color);
|
|
10
|
+
const pc = Color(primaryBgColor);
|
|
11
|
+
const changeColor = (value) => {
|
|
12
|
+
return c.hsl(c.hue(), c.saturationl(), c.lightness() + value).toString();
|
|
13
|
+
};
|
|
14
|
+
const getAlpha = (alpha) => {
|
|
15
|
+
return Color(pc.isDark() ? 'white' : 'black').alpha(alpha).toString();
|
|
16
|
+
};
|
|
17
|
+
if (c.alpha() === 0) {
|
|
18
|
+
return {
|
|
19
|
+
bgColor: 'transparent',
|
|
20
|
+
hoverBgColor: getAlpha(0.1),
|
|
21
|
+
activeBgColor: getAlpha(0.2),
|
|
22
|
+
textColor: pc.isLight() ? 'black' : 'white',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
else if (c.isLight()) {
|
|
26
|
+
return {
|
|
27
|
+
bgColor: color,
|
|
28
|
+
hoverBgColor: changeColor(-10),
|
|
29
|
+
activeBgColor: changeColor(-20),
|
|
30
|
+
textColor: 'black',
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return {
|
|
35
|
+
bgColor: color,
|
|
36
|
+
hoverBgColor: changeColor(10),
|
|
37
|
+
activeBgColor: changeColor(20),
|
|
38
|
+
textColor: 'white',
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const StyledButton = styled.button `
|
|
43
|
+
border: 0;
|
|
44
|
+
border-radius: ${BORDER_RADIUS};
|
|
45
|
+
padding: ${props => {
|
|
46
|
+
switch (props.$size) {
|
|
47
|
+
case 'sm': {
|
|
48
|
+
return '0rem 0.75rem';
|
|
49
|
+
}
|
|
50
|
+
case 'md': {
|
|
51
|
+
return '0rem 1rem';
|
|
52
|
+
}
|
|
53
|
+
case 'lg': {
|
|
54
|
+
return '0rem 2rem';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}};
|
|
58
|
+
height: ${props => {
|
|
59
|
+
switch (props.$size) {
|
|
60
|
+
case 'sm': {
|
|
61
|
+
return '2rem';
|
|
62
|
+
}
|
|
63
|
+
case 'md': {
|
|
64
|
+
return '2.5rem';
|
|
65
|
+
}
|
|
66
|
+
case 'lg': {
|
|
67
|
+
return '3rem';
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}};
|
|
71
|
+
font-size: ${FONT_SIZES.md};
|
|
72
|
+
background-color: ${props => props.$bgColor};
|
|
73
|
+
color: ${props => props.$textColor};
|
|
74
|
+
opacity: ${props => props.disabled ? 0.5 : 1};
|
|
75
|
+
transition: background-color 0.2s;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
&:not([disabled]) {
|
|
78
|
+
&:active,&:hover:active {
|
|
79
|
+
background-color: ${props => props.$activeBgColor};
|
|
80
|
+
}
|
|
81
|
+
&:hover {
|
|
82
|
+
background-color: ${props => props.$hoverBgColor};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
&:disabled {
|
|
86
|
+
cursor: auto;
|
|
87
|
+
opacity: 0.5;
|
|
88
|
+
}
|
|
89
|
+
font-family: ${FONT_FAMILY};
|
|
90
|
+
`;
|
|
91
|
+
const Button = React.forwardRef(({ variant = 'primary', size = 'md', loading = false, disabled = false, ...props }, ref) => {
|
|
92
|
+
const { colors } = useDesign();
|
|
93
|
+
let bgColor;
|
|
94
|
+
switch (variant) {
|
|
95
|
+
case 'primary': {
|
|
96
|
+
bgColor = colors.primaryColor;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
case 'secondary': {
|
|
100
|
+
bgColor = colors.secondaryColor;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
case 'warning': {
|
|
104
|
+
bgColor = '#ff4500';
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (props.color) {
|
|
109
|
+
bgColor = props.color;
|
|
110
|
+
}
|
|
111
|
+
const buttonColors = getColors(bgColor, colors.primaryBgColor);
|
|
112
|
+
return (_jsx(StyledButton, { ref: ref, "$size": size, "$bgColor": buttonColors.bgColor, "$hoverBgColor": buttonColors.hoverBgColor, "$activeBgColor": buttonColors.activeBgColor, "$textColor": buttonColors.textColor, disabled: disabled || loading, ...props, children: props.children }));
|
|
113
|
+
});
|
|
114
|
+
Button.displayName = 'Button';
|
|
115
|
+
export default Button;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type ContainerProps = {
|
|
3
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
4
|
+
} & Omit<React.HTMLProps<HTMLDivElement>, 'size'>;
|
|
5
|
+
export default function Container({ size, ...props }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/components-core/container.tsx"],"names":[],"mappings":";AAKA,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;CAClD,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,CAAA;AAejD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,IAAS,EACT,GAAG,KAAK,EACT,EAAG,cAAc,2CAYjB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useDesign } from "../providers/design-provider";
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
const OuterContainer = styled.div `
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
width: 100%;
|
|
9
|
+
`;
|
|
10
|
+
const InnerContainer = styled.div `
|
|
11
|
+
width: 100%;
|
|
12
|
+
@media (min-width: ${props => props.$breakpoint}px) {
|
|
13
|
+
width: ${props => props.$breakpoint}px;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
export default function Container({ size = 'md', ...props }) {
|
|
17
|
+
const { breakpoints } = useDesign();
|
|
18
|
+
return (_jsx(OuterContainer, { children: _jsx(InnerContainer, { "$breakpoint": typeof size === 'number' ? size : breakpoints[size], ...props, children: props.children }) }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type DividerProps = {
|
|
3
|
+
direction?: 'horizontal' | 'vertical';
|
|
4
|
+
} & React.HTMLProps<HTMLHRElement>;
|
|
5
|
+
declare const Divider: React.ForwardRefExoticComponent<Omit<DividerProps, "ref"> & React.RefAttributes<HTMLHRElement>>;
|
|
6
|
+
export default Divider;
|
|
7
|
+
//# sourceMappingURL=divider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../src/components-core/divider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,YAAY,GAAG;IAAE,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;AAErG,QAAA,MAAM,OAAO,iGAcZ,CAAC;AAGF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { useDesign } from "../providers/design-provider";
|
|
5
|
+
const Divider = React.forwardRef(({ direction = 'horizontal' }, ref) => {
|
|
6
|
+
const { colors } = useDesign();
|
|
7
|
+
return _jsx("hr", { ref: ref, style: {
|
|
8
|
+
width: direction === 'horizontal' ? undefined : '1px',
|
|
9
|
+
height: direction === 'horizontal' ? '1px' : undefined,
|
|
10
|
+
border: 'none',
|
|
11
|
+
backgroundColor: colors.neutralColor,
|
|
12
|
+
margin: 0,
|
|
13
|
+
padding: 0,
|
|
14
|
+
} });
|
|
15
|
+
});
|
|
16
|
+
Divider.displayName = 'Divider';
|
|
17
|
+
export default Divider;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonProps } from './button';
|
|
3
|
+
import { ContainerProps } from './container';
|
|
4
|
+
import { DividerProps } from './divider';
|
|
5
|
+
import { InputProps } from './input';
|
|
6
|
+
import { LabelProps } from './label';
|
|
7
|
+
import { LinkProps } from './link';
|
|
8
|
+
import { TextProps } from './text';
|
|
9
|
+
export { ButtonProps, ContainerProps, DividerProps, InputProps, LabelProps, LinkProps, TextProps, };
|
|
10
|
+
export declare const Button: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export declare const Container: import("react").ForwardRefExoticComponent<Omit<ContainerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export declare const Divider: import("react").ForwardRefExoticComponent<Omit<DividerProps, "ref"> & import("react").RefAttributes<HTMLHRElement>>;
|
|
13
|
+
export declare const Input: import("react").ForwardRefExoticComponent<Omit<InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
14
|
+
export declare const Label: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-label").LabelProps & import("react").RefAttributes<HTMLLabelElement>, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
|
|
15
|
+
export declare function Link(props: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const Text: import("react").ForwardRefExoticComponent<Omit<TextProps, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components-core/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,EACL,WAAW,EACX,cAAc,EACd,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,GACV,CAAC;AAEF,eAAO,MAAM,MAAM,wHAGjB,CAAC;AAEH,eAAO,MAAM,SAAS,wHAGpB,CAAC;AAEH,eAAO,MAAM,OAAO,qHAGlB,CAAC;AAEH,eAAO,MAAM,KAAK,sHAGhB,CAAC;AAEH,eAAO,MAAM,KAAK,wMAGhB,CAAC;AAEH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,2CAGpC;AAED,eAAO,MAAM,IAAI,yHAGf,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { useComponents } from '../providers/component-provider';
|
|
5
|
+
export const Button = forwardRef((props, ref) => {
|
|
6
|
+
const { Button } = useComponents();
|
|
7
|
+
return _jsx(Button, { ...props, ref: ref });
|
|
8
|
+
});
|
|
9
|
+
export const Container = forwardRef((props, ref) => {
|
|
10
|
+
const { Container } = useComponents();
|
|
11
|
+
return _jsx(Container, { ...props, ref: ref });
|
|
12
|
+
});
|
|
13
|
+
export const Divider = forwardRef((props, ref) => {
|
|
14
|
+
const { Divider } = useComponents();
|
|
15
|
+
return _jsx(Divider, { ...props, ref: ref });
|
|
16
|
+
});
|
|
17
|
+
export const Input = forwardRef((props, ref) => {
|
|
18
|
+
const { Input } = useComponents();
|
|
19
|
+
return _jsx(Input, { ...props, ref: ref });
|
|
20
|
+
});
|
|
21
|
+
export const Label = forwardRef((props, ref) => {
|
|
22
|
+
const { Label } = useComponents();
|
|
23
|
+
return _jsx(Label, { ...props, ref: ref });
|
|
24
|
+
});
|
|
25
|
+
export function Link(props) {
|
|
26
|
+
const { Link } = useComponents();
|
|
27
|
+
return _jsx(Link, { ...props });
|
|
28
|
+
}
|
|
29
|
+
export const Text = forwardRef((props, ref) => {
|
|
30
|
+
const { Text } = useComponents();
|
|
31
|
+
return _jsx(Text, { ...props, ref: ref });
|
|
32
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & Pick<React.HTMLProps<HTMLInputElement>, 'ref'>;
|
|
3
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
4
|
+
export default Input;
|
|
5
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components-core/input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,CAAA;AA2CrH,QAAA,MAAM,KAAK,kGAgBV,CAAC;AAGF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { useDesign } from "../providers/design-provider";
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
import { BORDER_RADIUS, FONT_FAMILY, FONT_SIZES, PRIMARY_FONT_COLORS, SECONDARY_FONT_COLORS } from "../utils/constants";
|
|
7
|
+
const StyledInput = styled.input `
|
|
8
|
+
font-family: ${FONT_FAMILY};
|
|
9
|
+
font-size: ${FONT_SIZES.md};
|
|
10
|
+
height: 2.5rem;
|
|
11
|
+
border-radius: ${BORDER_RADIUS};
|
|
12
|
+
background-color: transparent;
|
|
13
|
+
border: 1px solid;
|
|
14
|
+
border-color: ${props => props.$borderColor};
|
|
15
|
+
padding: 0rem 1rem;
|
|
16
|
+
color: ${props => props.$textColor};
|
|
17
|
+
&::placeholder {
|
|
18
|
+
color: ${props => props.$placeholderColor};
|
|
19
|
+
}
|
|
20
|
+
&:focus-visible {
|
|
21
|
+
outline: none;
|
|
22
|
+
box-shadow: 0 0 0 2px ${props => props.$focusShadowColor};
|
|
23
|
+
}
|
|
24
|
+
&:disabled {
|
|
25
|
+
cursor: auto;
|
|
26
|
+
opacity: 0.5;
|
|
27
|
+
}
|
|
28
|
+
&[type=file] {
|
|
29
|
+
color: ${props => props.$fileSelectorColor};
|
|
30
|
+
}
|
|
31
|
+
&[type=file]::file-selector-button{
|
|
32
|
+
border: none;
|
|
33
|
+
color: ${props => props.$fileSelectorButtonColor};
|
|
34
|
+
background-color: transparent;
|
|
35
|
+
height: 2.5rem;
|
|
36
|
+
margin-right: 0.5rem;
|
|
37
|
+
padding: 0;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
const Input = React.forwardRef((props, ref) => {
|
|
41
|
+
const { colors, colorMode } = useDesign();
|
|
42
|
+
return (_jsx(StyledInput, { ref: ref, "$borderColor": colors.neutralColor, "$placeholderColor": SECONDARY_FONT_COLORS[colorMode], "$textColor": PRIMARY_FONT_COLORS[colorMode], "$fileSelectorColor": SECONDARY_FONT_COLORS[colorMode], "$fileSelectorButtonColor": PRIMARY_FONT_COLORS[colorMode], "$focusShadowColor": colors.primaryColor, ...props }));
|
|
43
|
+
});
|
|
44
|
+
Input.displayName = 'Input';
|
|
45
|
+
export default Input;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
export type LabelProps = React.ComponentProps<typeof LabelPrimitive.Root>;
|
|
4
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
|
+
export default Label;
|
|
6
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/components-core/label.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AAexD,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;AAE1E,QAAA,MAAM,KAAK,yJAYV,CAAC;AAGF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
import { FONT_FAMILY, FONT_SIZES, SECONDARY_FONT_COLORS } from "../utils/constants";
|
|
7
|
+
import { useDesign } from "../providers/design-provider";
|
|
8
|
+
const Primitive = styled(LabelPrimitive.Root) `
|
|
9
|
+
font-size: ${FONT_SIZES.sm};
|
|
10
|
+
line-height: 1;
|
|
11
|
+
color: ${props => props.color};
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
font-family: ${FONT_FAMILY};
|
|
14
|
+
display: block;
|
|
15
|
+
margin-bottom: 0.5rem;
|
|
16
|
+
`;
|
|
17
|
+
const Label = React.forwardRef((props, ref) => {
|
|
18
|
+
const { colorMode } = useDesign();
|
|
19
|
+
return _jsx(Primitive, { color: colorMode === 'dark' ? SECONDARY_FONT_COLORS.dark : SECONDARY_FONT_COLORS.light, ref: ref, ...props });
|
|
20
|
+
});
|
|
21
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
22
|
+
export default Label;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Url } from "url";
|
|
3
|
+
import React from "react";
|
|
4
|
+
export type LinkProps = {
|
|
5
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
href: Url | string;
|
|
7
|
+
} & Omit<React.HTMLProps<HTMLLinkElement>, 'size' | 'href'>;
|
|
8
|
+
export default function Link({ size, href, style, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components-core/link.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,IAAI,EAAE,GAAG,GAAG,MAAM,CAAC;CACpB,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;AAE3D,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC3B,IAAS,EACT,IAAI,EACJ,KAAK,EACL,GAAG,KAAK,EACT,EAAG,SAAS,2CAmBZ"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import NextLink from "next/link";
|
|
4
|
+
import { FONT_FAMILY, FONT_SIZES, LINE_HEIGHTS } from "../utils/constants";
|
|
5
|
+
import { useDesign } from "..";
|
|
6
|
+
export default function Link({ size = 'md', href, style, ...props }) {
|
|
7
|
+
const { colorMode } = useDesign();
|
|
8
|
+
return (_jsx(NextLink, { href: href, style: {
|
|
9
|
+
fontSize: FONT_SIZES[size],
|
|
10
|
+
lineHeight: LINE_HEIGHTS[size],
|
|
11
|
+
fontFamily: FONT_FAMILY,
|
|
12
|
+
color: colorMode === 'dark' ? '#3B82F6' : '#2563EB',
|
|
13
|
+
textDecoration: 'underline',
|
|
14
|
+
margin: 0,
|
|
15
|
+
padding: 0,
|
|
16
|
+
...style
|
|
17
|
+
}, children: props.children }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type TextProps = {
|
|
3
|
+
variant?: 'primary' | 'secondary' | 'warning' | 'success';
|
|
4
|
+
as?: 'p' | 'h6' | 'h5' | 'h4' | 'h3' | 'h2' | 'h1';
|
|
5
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
} & Omit<React.HTMLProps<HTMLParagraphElement>, 'size'>;
|
|
7
|
+
declare const Text: React.ForwardRefExoticComponent<Omit<TextProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
8
|
+
export default Text;
|
|
9
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/components-core/text.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;IAC1D,EAAE,CAAC,EAAE,GAAG,GAAG,IAAI,GAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAClD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CACzC,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC,CAAA;AAEvD,QAAA,MAAM,IAAI,qGA8CR,CAAC;AAGH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { createElement } from "react";
|
|
4
|
+
import { FONT_FAMILY, FONT_SIZES, LINE_HEIGHTS, PRIMARY_FONT_COLORS, SECONDARY_FONT_COLORS } from "../utils/constants";
|
|
5
|
+
import { useDesign } from "../providers/design-provider";
|
|
6
|
+
const Text = React.forwardRef(({ variant = 'primary', size = 'md', as = 'p', style, ...props }, ref) => {
|
|
7
|
+
const { colorMode } = useDesign();
|
|
8
|
+
let textColor;
|
|
9
|
+
switch (variant) {
|
|
10
|
+
case 'primary': {
|
|
11
|
+
textColor = PRIMARY_FONT_COLORS[colorMode];
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
case 'secondary': {
|
|
15
|
+
textColor = SECONDARY_FONT_COLORS[colorMode];
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
case 'warning': {
|
|
19
|
+
textColor = '#ff4500';
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
case 'success': {
|
|
23
|
+
textColor = '#32cd32';
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return createElement(as, {
|
|
28
|
+
style: {
|
|
29
|
+
fontSize: FONT_SIZES[size],
|
|
30
|
+
lineHeight: LINE_HEIGHTS[size],
|
|
31
|
+
fontFamily: FONT_FAMILY,
|
|
32
|
+
color: textColor,
|
|
33
|
+
padding: 0,
|
|
34
|
+
margin: 0,
|
|
35
|
+
...style
|
|
36
|
+
},
|
|
37
|
+
ref,
|
|
38
|
+
...props
|
|
39
|
+
}, props.children);
|
|
40
|
+
});
|
|
41
|
+
Text.displayName = 'Typography';
|
|
42
|
+
export default Text;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components-core-joy/button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIjD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,OAAmB,EACnB,KAAK,EACL,IAAW,EACX,OAAe,EACf,GAAG,KAAK,EACT,EAAG,WAAW,2CAmCd"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Button as JoyButton } from '@mui/joy';
|
|
4
|
+
import Color from "color";
|
|
5
|
+
export default function Button({ variant = "primary", color, size = "md", loading = false, ...props }) {
|
|
6
|
+
const muiVariant = {
|
|
7
|
+
primary: "primary",
|
|
8
|
+
secondary: "neutral",
|
|
9
|
+
warning: "danger",
|
|
10
|
+
}[variant] || "primary";
|
|
11
|
+
const { children, action, ref, ...validProps } = props;
|
|
12
|
+
const c = Color(color);
|
|
13
|
+
const changeColor = (value) => {
|
|
14
|
+
return c.hsl(c.hue(), c.saturationl(), c.lightness() + (c.isDark() ? value : -value)).toString();
|
|
15
|
+
};
|
|
16
|
+
return _jsx(JoyButton, { color: muiVariant, sx: color ? {
|
|
17
|
+
backgroundColor: color,
|
|
18
|
+
color: c.isDark() ? 'white' : 'black',
|
|
19
|
+
'&:hover': {
|
|
20
|
+
backgroundColor: changeColor(10)
|
|
21
|
+
},
|
|
22
|
+
'&:active': {
|
|
23
|
+
backgroundColor: changeColor(20)
|
|
24
|
+
},
|
|
25
|
+
} : {}, size: size, loading: loading, ...validProps, children: children });
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../src/components-core-joy/divider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAG,YAAY,2CAGnD"}
|