@clerk/ui 0.1.9 → 0.1.10
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/{chunk-GJNJVJGS.mjs → chunk-LLOUIL3Z.mjs} +1074 -2170
- package/dist/chunk-LLOUIL3Z.mjs.map +1 -0
- package/dist/chunk-TVTJKSVH.mjs +1811 -0
- package/dist/chunk-TVTJKSVH.mjs.map +1 -0
- package/dist/components/sign-in.d.mts +1 -1
- package/dist/components/sign-in.d.ts +1 -1
- package/dist/components/sign-in.js +2663 -2296
- package/dist/components/sign-in.js.map +1 -1
- package/dist/components/sign-in.mjs +68 -30
- package/dist/components/sign-in.mjs.map +1 -1
- package/dist/components/sign-up.js +4674 -4326
- package/dist/components/sign-up.js.map +1 -1
- package/dist/components/sign-up.mjs +27 -8
- package/dist/components/sign-up.mjs.map +1 -1
- package/dist/contexts.d.mts +5 -4
- package/dist/contexts.d.ts +5 -4
- package/dist/contexts.js +993 -40
- package/dist/contexts.js.map +1 -1
- package/dist/contexts.mjs +1 -1
- package/dist/styles.css +1 -1
- package/package.json +15 -14
- package/dist/chunk-GJNJVJGS.mjs.map +0 -1
- package/dist/chunk-RVVUA25B.mjs +0 -383
- package/dist/chunk-RVVUA25B.mjs.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AppearanceProvider, Separator, useAppearance, Icon } from '../chunk-
|
|
1
|
+
import { Root, Label, Input, Animated, Message, useDevModeWarning, useCard, LOCALIZATION_NEEDED, GlobalError, LinkButton, CaretRightLegacySm, PasswordField, useEnvironment, useAttributes, useDisplayConfig, EmailField, UsernameField, PhoneNumberField, EmailOrPhoneNumberField, RouterLink, PenSm, OTPField, Checkbox, useFocusInput, link, stringToFormattedPhoneString } from '../chunk-TVTJKSVH.mjs';
|
|
2
|
+
import { useLocalizations, AppearanceProvider, Root as Root$2, Content, Header, Title, Description, Body, Footer, FooterAction, Logo, Button as Button$1, FooterActionText, FooterActionButton, Separator, Connections, Actions, useEnabledConnections, useAppearance, useOptions, FooterActionLink, Icon } from '../chunk-LLOUIL3Z.mjs';
|
|
3
3
|
import * as SignIn6 from '@clerk/elements/sign-in';
|
|
4
|
-
import { Root } from '@clerk/elements/sign-in';
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
4
|
+
import { Root as Root$1 } from '@clerk/elements/sign-in';
|
|
5
|
+
import * as React6 from 'react';
|
|
6
|
+
import React6__default from 'react';
|
|
7
7
|
import { useClerk } from '@clerk/shared/react';
|
|
8
|
-
import { cva } from 'cva';
|
|
8
|
+
import { cva, cx } from 'cva';
|
|
9
9
|
import { Button, ToggleButton } from 'react-aria-components';
|
|
10
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
import * as Common8 from '@clerk/elements/common';
|
|
12
12
|
|
|
13
|
-
var GetHelpContext =
|
|
13
|
+
var GetHelpContext = React6.createContext(null);
|
|
14
14
|
var useGetHelp = () => {
|
|
15
|
-
const context =
|
|
15
|
+
const context = React6.useContext(GetHelpContext);
|
|
16
16
|
if (!context) {
|
|
17
17
|
throw new Error("useGetHelp must be used within GetHelpContext.Provider");
|
|
18
18
|
}
|
|
@@ -72,7 +72,7 @@ function SignInChooseSession() {
|
|
|
72
72
|
{
|
|
73
73
|
asChild: true,
|
|
74
74
|
name: "choose-session",
|
|
75
|
-
children: /* @__PURE__ */ jsxs(Root$
|
|
75
|
+
children: /* @__PURE__ */ jsxs(Root$2, { banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null, children: [
|
|
76
76
|
/* @__PURE__ */ jsxs(Content, { children: [
|
|
77
77
|
/* @__PURE__ */ jsxs(Header, { children: [
|
|
78
78
|
/* @__PURE__ */ jsx(Title, { children: t("signIn.accountSwitcher.title") }),
|
|
@@ -280,7 +280,7 @@ function SignInChooseStrategy() {
|
|
|
280
280
|
{
|
|
281
281
|
asChild: true,
|
|
282
282
|
name: "choose-strategy",
|
|
283
|
-
children: /* @__PURE__ */ jsxs(Root$
|
|
283
|
+
children: /* @__PURE__ */ jsxs(Root$2, { banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null, children: [
|
|
284
284
|
/* @__PURE__ */ jsxs(Content, { children: [
|
|
285
285
|
/* @__PURE__ */ jsxs(Header, { children: [
|
|
286
286
|
/* @__PURE__ */ jsx(Logo, { ...logoProps }),
|
|
@@ -439,7 +439,7 @@ function SignInForgotPassword() {
|
|
|
439
439
|
asChild: true,
|
|
440
440
|
name: "forgot-password",
|
|
441
441
|
children: /* @__PURE__ */ jsxs(
|
|
442
|
-
Root$
|
|
442
|
+
Root$2,
|
|
443
443
|
{
|
|
444
444
|
as: "form",
|
|
445
445
|
banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null,
|
|
@@ -596,7 +596,7 @@ function useSupportEmail() {
|
|
|
596
596
|
const { supportEmail: supportEmailFromOptions } = useOptions();
|
|
597
597
|
const { displayConfig } = useEnvironment();
|
|
598
598
|
const { supportEmail: supportEmailFromEnvironment } = displayConfig;
|
|
599
|
-
const supportEmail =
|
|
599
|
+
const supportEmail = React6__default.useMemo(
|
|
600
600
|
() => supportEmailFromOptions || supportEmailFromEnvironment || ["support", "@", Clerk.frontendApi ? Clerk.frontendApi.replace("clerk.", "") : "clerk.com"].join(""),
|
|
601
601
|
[Clerk.frontendApi, supportEmailFromOptions, supportEmailFromEnvironment]
|
|
602
602
|
);
|
|
@@ -608,7 +608,7 @@ function SignInGetHelp() {
|
|
|
608
608
|
const supportEmail = useSupportEmail();
|
|
609
609
|
const { setShowHelp } = useGetHelp();
|
|
610
610
|
const { logoProps, footerProps } = useCard();
|
|
611
|
-
return /* @__PURE__ */ jsxs(Root$
|
|
611
|
+
return /* @__PURE__ */ jsxs(Root$2, { banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null, children: [
|
|
612
612
|
/* @__PURE__ */ jsxs(Content, { children: [
|
|
613
613
|
/* @__PURE__ */ jsxs(Header, { children: [
|
|
614
614
|
/* @__PURE__ */ jsx(Logo, { ...logoProps }),
|
|
@@ -642,7 +642,7 @@ function CheckboxField({
|
|
|
642
642
|
{
|
|
643
643
|
name,
|
|
644
644
|
asChild: true,
|
|
645
|
-
children: /* @__PURE__ */ jsxs(
|
|
645
|
+
children: /* @__PURE__ */ jsxs(Root, { children: [
|
|
646
646
|
/* @__PURE__ */ jsxs("div", { className: "cl-c354e22d", children: [
|
|
647
647
|
/* @__PURE__ */ jsx(
|
|
648
648
|
Common8.Input,
|
|
@@ -673,7 +673,7 @@ function SignInResetPassword() {
|
|
|
673
673
|
asChild: true,
|
|
674
674
|
name: "reset-password",
|
|
675
675
|
children: /* @__PURE__ */ jsxs(
|
|
676
|
-
Root$
|
|
676
|
+
Root$2,
|
|
677
677
|
{
|
|
678
678
|
as: "form",
|
|
679
679
|
banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null,
|
|
@@ -745,7 +745,7 @@ function SignInResetPassword() {
|
|
|
745
745
|
);
|
|
746
746
|
} });
|
|
747
747
|
}
|
|
748
|
-
var EmailOrUsernameField =
|
|
748
|
+
var EmailOrUsernameField = React6__default.forwardRef(function EmailOrUsernameField2({
|
|
749
749
|
alternativeFieldTrigger,
|
|
750
750
|
...props
|
|
751
751
|
}, forwardedRef) {
|
|
@@ -755,7 +755,7 @@ var EmailOrUsernameField = React__default.forwardRef(function EmailOrUsernameFie
|
|
|
755
755
|
{
|
|
756
756
|
name: "identifier",
|
|
757
757
|
asChild: true,
|
|
758
|
-
children: /* @__PURE__ */ jsxs(
|
|
758
|
+
children: /* @__PURE__ */ jsxs(Root, { children: [
|
|
759
759
|
/* @__PURE__ */ jsx(Common8.Label, { asChild: true, children: /* @__PURE__ */ jsxs(Label, { children: [
|
|
760
760
|
t("formFieldLabel__emailAddress_username"),
|
|
761
761
|
" ",
|
|
@@ -787,7 +787,7 @@ function EmailOrUsernameOrPhoneNumberField({
|
|
|
787
787
|
toggleLabelPhoneNumber,
|
|
788
788
|
...props
|
|
789
789
|
}) {
|
|
790
|
-
const [showPhoneNumberField, setShowPhoneNumberField] =
|
|
790
|
+
const [showPhoneNumberField, setShowPhoneNumberField] = React6.useState(false);
|
|
791
791
|
const [inputRef, setInputFocus] = useFocusInput();
|
|
792
792
|
const toggle = /* @__PURE__ */ jsxs(
|
|
793
793
|
ToggleButton,
|
|
@@ -829,7 +829,7 @@ function PhoneNumberOrUsernameField({
|
|
|
829
829
|
toggleLabelUsername,
|
|
830
830
|
...props
|
|
831
831
|
}) {
|
|
832
|
-
const [showUsernameField, setShowUsernameField] =
|
|
832
|
+
const [showUsernameField, setShowUsernameField] = React6.useState(false);
|
|
833
833
|
const toggle = /* @__PURE__ */ jsxs(
|
|
834
834
|
ToggleButton,
|
|
835
835
|
{
|
|
@@ -878,6 +878,8 @@ function SignInStart() {
|
|
|
878
878
|
const isDev = useDevModeWarning();
|
|
879
879
|
const { options } = useAppearance().parsedAppearance;
|
|
880
880
|
const { logoProps, footerProps } = useCard();
|
|
881
|
+
const clerk = useClerk();
|
|
882
|
+
const { signUpUrl } = useOptions();
|
|
881
883
|
return /* @__PURE__ */ jsx(Common8.Loading, { scope: "global", children: (isGlobalLoading) => {
|
|
882
884
|
const connectionsWithSeperator = [
|
|
883
885
|
/* @__PURE__ */ jsx(
|
|
@@ -895,7 +897,7 @@ function SignInStart() {
|
|
|
895
897
|
asChild: true,
|
|
896
898
|
name: "start",
|
|
897
899
|
children: /* @__PURE__ */ jsxs(
|
|
898
|
-
Root$
|
|
900
|
+
Root$2,
|
|
899
901
|
{
|
|
900
902
|
as: "form",
|
|
901
903
|
banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null,
|
|
@@ -971,7 +973,8 @@ function SignInStart() {
|
|
|
971
973
|
disabled: isGlobalLoading,
|
|
972
974
|
required: true
|
|
973
975
|
}
|
|
974
|
-
) : null
|
|
976
|
+
) : null,
|
|
977
|
+
/* @__PURE__ */ jsx(AutoFillPasswordField, {})
|
|
975
978
|
] }) : null,
|
|
976
979
|
options.socialButtonsPlacement === "bottom" ? connectionsWithSeperator.reverse() : null
|
|
977
980
|
] }),
|
|
@@ -1014,10 +1017,14 @@ function SignInStart() {
|
|
|
1014
1017
|
/* @__PURE__ */ jsx(Footer, { ...footerProps, children: userSettings.signUp.mode === SIGN_UP_MODES.PUBLIC ? /* @__PURE__ */ jsx(FooterAction, { children: /* @__PURE__ */ jsxs(FooterActionText, { children: [
|
|
1015
1018
|
t("signIn.start.actionText"),
|
|
1016
1019
|
" ",
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1020
|
+
/* @__PURE__ */ jsx(
|
|
1021
|
+
RouterLink,
|
|
1022
|
+
{
|
|
1023
|
+
asChild: true,
|
|
1024
|
+
href: clerk.buildUrlWithAuth(signUpUrl || "/sign-up"),
|
|
1025
|
+
children: /* @__PURE__ */ jsx(FooterActionLink, { children: t("signIn.start.actionLink") })
|
|
1026
|
+
}
|
|
1027
|
+
)
|
|
1021
1028
|
] }) }) : null })
|
|
1022
1029
|
]
|
|
1023
1030
|
}
|
|
@@ -1026,6 +1033,35 @@ function SignInStart() {
|
|
|
1026
1033
|
);
|
|
1027
1034
|
} });
|
|
1028
1035
|
}
|
|
1036
|
+
function AutoFillPasswordField() {
|
|
1037
|
+
const { t } = useLocalizations();
|
|
1038
|
+
const [isAutoFilled, setIsAutoFilled] = React6.useState(false);
|
|
1039
|
+
const fieldRef = React6.useRef(null);
|
|
1040
|
+
const handleAutofill = (event) => {
|
|
1041
|
+
if (event.target.value && !isAutoFilled) {
|
|
1042
|
+
setIsAutoFilled(true);
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
React6.useEffect(() => {
|
|
1046
|
+
if (fieldRef.current) {
|
|
1047
|
+
fieldRef.current.setAttribute("inert", "");
|
|
1048
|
+
}
|
|
1049
|
+
}, []);
|
|
1050
|
+
React6.useEffect(() => {
|
|
1051
|
+
if (fieldRef.current && isAutoFilled) {
|
|
1052
|
+
fieldRef.current.removeAttribute("inert");
|
|
1053
|
+
}
|
|
1054
|
+
}, [isAutoFilled]);
|
|
1055
|
+
return /* @__PURE__ */ jsx(
|
|
1056
|
+
PasswordField,
|
|
1057
|
+
{
|
|
1058
|
+
label: t("formFieldLabel__password"),
|
|
1059
|
+
fieldRef,
|
|
1060
|
+
fieldClassName: cx(!isAutoFilled && "cl-73c00d56"),
|
|
1061
|
+
onChange: handleAutofill
|
|
1062
|
+
}
|
|
1063
|
+
);
|
|
1064
|
+
}
|
|
1029
1065
|
function BackupCodeField(props) {
|
|
1030
1066
|
const { t } = useLocalizations();
|
|
1031
1067
|
return /* @__PURE__ */ jsx(
|
|
@@ -1033,7 +1069,7 @@ function BackupCodeField(props) {
|
|
|
1033
1069
|
{
|
|
1034
1070
|
name: "backup_code",
|
|
1035
1071
|
asChild: true,
|
|
1036
|
-
children: /* @__PURE__ */ jsxs(
|
|
1072
|
+
children: /* @__PURE__ */ jsxs(Root, { children: [
|
|
1037
1073
|
/* @__PURE__ */ jsx(Common8.Label, { asChild: true, children: /* @__PURE__ */ jsx(Label, { children: t("formFieldLabel__backupCode") }) }),
|
|
1038
1074
|
/* @__PURE__ */ jsx(Common8.FieldState, { children: ({ state }) => {
|
|
1039
1075
|
return /* @__PURE__ */ jsx(
|
|
@@ -1082,7 +1118,7 @@ function SignInVerifications() {
|
|
|
1082
1118
|
asChild: true,
|
|
1083
1119
|
name: "verifications",
|
|
1084
1120
|
children: /* @__PURE__ */ jsxs(
|
|
1085
|
-
Root$
|
|
1121
|
+
Root$2,
|
|
1086
1122
|
{
|
|
1087
1123
|
as: "form",
|
|
1088
1124
|
banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null,
|
|
@@ -1593,9 +1629,11 @@ function SignInVerifications() {
|
|
|
1593
1629
|
);
|
|
1594
1630
|
} });
|
|
1595
1631
|
}
|
|
1596
|
-
function SignIn7({ appearance, ...
|
|
1597
|
-
|
|
1598
|
-
|
|
1632
|
+
function SignIn7({ appearance, ...props }) {
|
|
1633
|
+
var _a;
|
|
1634
|
+
const [showHelp, setShowHelp] = React6.useState(false);
|
|
1635
|
+
const componentAppearance = ((_a = props.__experimental) == null ? void 0 : _a.newComponents) ? props.__experimental.appearance : appearance;
|
|
1636
|
+
return /* @__PURE__ */ jsx(AppearanceProvider, { appearance: componentAppearance, children: /* @__PURE__ */ jsx(GetHelpContext.Provider, { value: { showHelp, setShowHelp }, children: /* @__PURE__ */ jsx(Root$1, { ...props, children: showHelp ? /* @__PURE__ */ jsx(SignInGetHelp, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1599
1637
|
/* @__PURE__ */ jsx(SignInStart, {}),
|
|
1600
1638
|
/* @__PURE__ */ jsx(SignInVerifications, {}),
|
|
1601
1639
|
/* @__PURE__ */ jsx(SignInChooseStrategy, {}),
|