@timmbr/ui 1.4.1 → 1.5.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/Accordion/Accordion.js +1 -1
- package/dist/components/Accordion/Accordion.styles.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.styles.js +3 -3
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/Alert/Alert.styles.js +4 -4
- package/dist/components/AlertDialog/AlertDialog.styles.js +4 -4
- package/dist/components/AuthModal/AuthModal.d.ts +4 -0
- package/dist/components/AuthModal/AuthModal.d.ts.map +1 -0
- package/dist/components/AuthModal/AuthModal.js +89 -0
- package/dist/components/AuthModal/AuthModal.labels.d.ts +6 -0
- package/dist/components/AuthModal/AuthModal.labels.d.ts.map +1 -0
- package/dist/components/AuthModal/AuthModal.labels.js +52 -0
- package/dist/components/AuthModal/AuthModal.styles.d.ts +12 -0
- package/dist/components/AuthModal/AuthModal.styles.d.ts.map +1 -0
- package/dist/components/AuthModal/AuthModal.styles.js +38 -0
- package/dist/components/AuthModal/AuthModal.types.d.ts +158 -0
- package/dist/components/AuthModal/AuthModal.types.d.ts.map +1 -0
- package/dist/components/AuthModal/index.d.ts +6 -0
- package/dist/components/AuthModal/index.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalBanner.d.ts +11 -0
- package/dist/components/AuthModal/subcomponents/AuthModalBanner.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalBanner.js +58 -0
- package/dist/components/AuthModal/subcomponents/AuthModalIdentifierForm.d.ts +11 -0
- package/dist/components/AuthModal/subcomponents/AuthModalIdentifierForm.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalIdentifierForm.js +62 -0
- package/dist/components/AuthModal/subcomponents/AuthModalOAuth.d.ts +11 -0
- package/dist/components/AuthModal/subcomponents/AuthModalOAuth.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalOAuth.js +19 -0
- package/dist/components/AuthModal/subcomponents/AuthModalOtpForm.d.ts +10 -0
- package/dist/components/AuthModal/subcomponents/AuthModalOtpForm.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalOtpForm.js +62 -0
- package/dist/components/AuthModal/subcomponents/AuthModalParts.d.ts +44 -0
- package/dist/components/AuthModal/subcomponents/AuthModalParts.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalParts.js +134 -0
- package/dist/components/AuthModal/subcomponents/AuthModalPasswordForm.d.ts +10 -0
- package/dist/components/AuthModal/subcomponents/AuthModalPasswordForm.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalPasswordForm.js +54 -0
- package/dist/components/AuthModal/subcomponents/AuthModalSetPasswordForm.d.ts +10 -0
- package/dist/components/AuthModal/subcomponents/AuthModalSetPasswordForm.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalSetPasswordForm.js +79 -0
- package/dist/components/AuthModal/subcomponents/AuthModalSuccess.d.ts +10 -0
- package/dist/components/AuthModal/subcomponents/AuthModalSuccess.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/AuthModalSuccess.js +26 -0
- package/dist/components/AuthModal/subcomponents/OAuthButton.d.ts +12 -0
- package/dist/components/AuthModal/subcomponents/OAuthButton.d.ts.map +1 -0
- package/dist/components/AuthModal/subcomponents/OAuthButton.js +38 -0
- package/dist/components/AuthModal/subcomponents/index.d.ts +9 -0
- package/dist/components/AuthModal/subcomponents/index.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.styles.js +11 -11
- package/dist/components/Badge/Badge.styles.js +8 -8
- package/dist/components/Button/Button.styles.js +7 -7
- package/dist/components/Card/Card.styles.d.ts.map +1 -1
- package/dist/components/Card/Card.styles.js +5 -5
- package/dist/components/Checkbox/Checkbox.js +4 -4
- package/dist/components/Checkbox/Checkbox.styles.js +1 -1
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Chip/Chip.styles.js +5 -5
- package/dist/components/DataList/DataList.styles.js +3 -3
- package/dist/components/Dialog/Dialog.styles.js +6 -6
- package/dist/components/Divider/Divider.js +1 -1
- package/dist/components/Drawer/Drawer.styles.js +2 -2
- package/dist/components/Dropdown/Dropdown.js +2 -2
- package/dist/components/Dropdown/Dropdown.styles.js +2 -2
- package/dist/components/EmptyState/EmptyState.js +2 -2
- package/dist/components/EmptyState/EmptyState.styles.js +3 -3
- package/dist/components/FormField/FormField.js +1 -1
- package/dist/components/Heading/Heading.styles.d.ts.map +1 -1
- package/dist/components/Heading/Heading.styles.js +12 -10
- package/dist/components/Icon/Icon.styles.js +6 -6
- package/dist/components/ImageUpload/ImageUpload.js +6 -6
- package/dist/components/ImageUpload/subcomponents/ImageUploadDropzone.js +10 -10
- package/dist/components/ImageUpload/subcomponents/ImageUploadModal.js +8 -8
- package/dist/components/ImageUpload/subcomponents/ImageUploadSinglePreview.js +7 -7
- package/dist/components/ImageUpload/subcomponents/ImageUploadThumbnailCard.js +10 -10
- package/dist/components/Input/Input.js +4 -4
- package/dist/components/Input/Input.styles.js +6 -6
- package/dist/components/Label/Label.styles.js +4 -4
- package/dist/components/LinkButton/LinkButton.styles.js +6 -6
- package/dist/components/List/List.js +1 -1
- package/dist/components/List/List.styles.js +3 -3
- package/dist/components/NavFooter/NavFooter.styles.js +9 -9
- package/dist/components/NavFooter/subcomponents/FooterBrand.js +3 -3
- package/dist/components/NavFooter/subcomponents/FooterLegalBar.js +1 -1
- package/dist/components/NavFooter/subcomponents/FooterNavSection.js +4 -4
- package/dist/components/NavFooter/subcomponents/FooterNewsletter.js +7 -7
- package/dist/components/NavFooter/subcomponents/FooterOffice.js +5 -5
- package/dist/components/NavFooter/subcomponents/FooterSocial.js +3 -3
- package/dist/components/NavHeader/NavHeader.d.ts.map +1 -1
- package/dist/components/NavHeader/NavHeader.js +11 -3
- package/dist/components/NavHeader/NavHeader.styles.js +16 -16
- package/dist/components/NavHeader/NavHeader.types.d.ts +19 -0
- package/dist/components/NavHeader/NavHeader.types.d.ts.map +1 -1
- package/dist/components/NavHeader/subcomponents/NavActionLabelSkeleton.d.ts +4 -0
- package/dist/components/NavHeader/subcomponents/NavActionLabelSkeleton.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/NavActionLabelSkeleton.js +16 -0
- package/dist/components/NavHeader/subcomponents/NavActionOverflow.d.ts.map +1 -1
- package/dist/components/NavHeader/subcomponents/NavActionOverflow.js +6 -5
- package/dist/components/NavHeader/subcomponents/NavActions.d.ts +9 -0
- package/dist/components/NavHeader/subcomponents/NavActions.d.ts.map +1 -1
- package/dist/components/NavHeader/subcomponents/NavActions.js +51 -15
- package/dist/components/NavHeader/subcomponents/NavBrand.d.ts.map +1 -1
- package/dist/components/NavHeader/subcomponents/NavBrand.js +14 -15
- package/dist/components/NavHeader/subcomponents/NavItems.js +3 -3
- package/dist/components/NavHeader/subcomponents/NavItemsOverflow.js +7 -7
- package/dist/components/NavHeader/subcomponents/NavMobileSearchDrawer.js +5 -5
- package/dist/components/NavHeader/subcomponents/NavMobileTabSlider.js +2 -2
- package/dist/components/NavHeader/subcomponents/NavSearch.js +5 -5
- package/dist/components/NavHeader/subcomponents/OfferBanner.js +1 -1
- package/dist/components/OtpInput/OtpInput.d.ts +4 -0
- package/dist/components/OtpInput/OtpInput.d.ts.map +1 -0
- package/dist/components/OtpInput/OtpInput.js +114 -0
- package/dist/components/OtpInput/OtpInput.styles.d.ts +10 -0
- package/dist/components/OtpInput/OtpInput.styles.d.ts.map +1 -0
- package/dist/components/OtpInput/OtpInput.styles.js +49 -0
- package/dist/components/OtpInput/OtpInput.types.d.ts +40 -0
- package/dist/components/OtpInput/OtpInput.types.d.ts.map +1 -0
- package/dist/components/OtpInput/index.d.ts +4 -0
- package/dist/components/OtpInput/index.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.styles.js +3 -3
- package/dist/components/Popover/Popover.styles.js +1 -1
- package/dist/components/Progress/Progress.js +2 -2
- package/dist/components/Radio/Radio.js +4 -4
- package/dist/components/Radio/Radio.styles.js +1 -1
- package/dist/components/RangeSlider/RangeSlider.js +3 -3
- package/dist/components/RangeSlider/RangeSlider.styles.js +1 -1
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Select/Select.styles.js +8 -8
- package/dist/components/SideBarNavigation/SideBarNavigation.styles.js +8 -8
- package/dist/components/SideBarNavigation/subcomponents/SidebarBranding.js +3 -3
- package/dist/components/SideBarNavigation/subcomponents/SidebarFooter.js +1 -1
- package/dist/components/SideBarNavigation/subcomponents/SidebarPopoverMenu.js +4 -4
- package/dist/components/SideBarNavigation/subcomponents/SidebarProfile.js +9 -9
- package/dist/components/SideBarNavigation/subcomponents/SidebarSubItem.js +2 -2
- package/dist/components/Skeleton/Skeleton.styles.js +1 -1
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.js +9 -7
- package/dist/components/Spinner/Spinner.styles.d.ts +8 -2
- package/dist/components/Spinner/Spinner.styles.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.styles.js +27 -24
- package/dist/components/Spinner/Spinner.types.d.ts +9 -0
- package/dist/components/Spinner/Spinner.types.d.ts.map +1 -1
- package/dist/components/Stat/Stat.styles.js +4 -4
- package/dist/components/Switch/Switch.js +2 -2
- package/dist/components/Switch/Switch.styles.js +1 -1
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/Table.styles.js +5 -5
- package/dist/components/Table/TablePagination.js +4 -4
- package/dist/components/Tabs/Tabs.js +2 -2
- package/dist/components/Tabs/Tabs.styles.js +8 -8
- package/dist/components/Text/Text.d.ts.map +1 -1
- package/dist/components/Text/Text.js +2 -0
- package/dist/components/Text/Text.styles.d.ts +1 -0
- package/dist/components/Text/Text.styles.d.ts.map +1 -1
- package/dist/components/Text/Text.styles.js +21 -13
- package/dist/components/Text/Text.types.d.ts +5 -0
- package/dist/components/Text/Text.types.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +4 -4
- package/dist/components/Textarea/Textarea.styles.js +6 -6
- package/dist/components/Toast/Toast.js +3 -3
- package/dist/components/Toast/Toast.styles.js +5 -5
- package/dist/components/Toast/ToastContainer.js +1 -1
- package/dist/components/Tooltip/Tooltip.styles.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/package.json +7 -6
- package/dist/components/CrossZoneLink/CrossZoneLink.d.ts +0 -10
- package/dist/components/CrossZoneLink/CrossZoneLink.d.ts.map +0 -1
- package/dist/components/CrossZoneLink/CrossZoneLink.js +0 -111
- package/dist/components/CrossZoneLink/CrossZoneLink.styles.d.ts +0 -8
- package/dist/components/CrossZoneLink/CrossZoneLink.styles.d.ts.map +0 -1
- package/dist/components/CrossZoneLink/CrossZoneLink.styles.js +0 -33
- package/dist/components/CrossZoneLink/CrossZoneLink.types.d.ts +0 -31
- package/dist/components/CrossZoneLink/CrossZoneLink.types.d.ts.map +0 -1
- package/dist/components/CrossZoneLink/index.d.ts +0 -4
- package/dist/components/CrossZoneLink/index.d.ts.map +0 -1
|
@@ -25,7 +25,7 @@ const AccordionTrigger = React.forwardRef(({ className, children, ...props }, re
|
|
|
25
25
|
...props,
|
|
26
26
|
children: [
|
|
27
27
|
children,
|
|
28
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-
|
|
28
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-grey-500 transition-transform duration-200" })
|
|
29
29
|
]
|
|
30
30
|
}
|
|
31
31
|
) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"Accordion.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,oFAAuD,CAAC;AAE1F,eAAO,MAAM,wBAAwB,oFAEpC,CAAC;AAEF,eAAO,MAAM,wBAAwB,oFAEpC,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
2
|
|
|
3
|
-
const accordionItemVariants = cva("border-b border-
|
|
3
|
+
const accordionItemVariants = cva("border-b border-grey-100 dark:border-grey-800");
|
|
4
4
|
const accordionTriggerVariants = cva(
|
|
5
|
-
"flex flex-1 items-center justify-between py-4 text-
|
|
5
|
+
"flex flex-1 items-center justify-between py-4 text-body-2 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180 cursor-pointer"
|
|
6
6
|
);
|
|
7
7
|
const accordionContentVariants = cva(
|
|
8
|
-
"overflow-hidden text-
|
|
8
|
+
"overflow-hidden text-body-2 data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
export { accordionContentVariants, accordionItemVariants, accordionTriggerVariants };
|
|
@@ -61,7 +61,7 @@ const Alert = React.forwardRef(
|
|
|
61
61
|
type: "button",
|
|
62
62
|
onClick: handleDismiss,
|
|
63
63
|
"aria-label": "Dismiss alert",
|
|
64
|
-
className: "shrink-0 p-1 -mr-1 -mt-1 text-muted-foreground hover:text-foreground rounded-sm transition-colors hover:bg-
|
|
64
|
+
className: "shrink-0 p-1 -mr-1 -mt-1 text-muted-foreground hover:text-foreground rounded-sm transition-colors hover:bg-grey-1000/5 dark:hover:bg-grey-50/5 cursor-pointer active:scale-95",
|
|
65
65
|
children: /* @__PURE__ */ jsx(X, { className: "size-4" })
|
|
66
66
|
}
|
|
67
67
|
)
|
|
@@ -89,7 +89,7 @@ const AlertDescription = React.forwardRef(
|
|
|
89
89
|
{
|
|
90
90
|
ref,
|
|
91
91
|
"data-slot": "alert-description",
|
|
92
|
-
className: cn("text-
|
|
92
|
+
className: cn("text-body-3 text-muted-foreground leading-relaxed", className),
|
|
93
93
|
...props
|
|
94
94
|
}
|
|
95
95
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
2
|
|
|
3
3
|
const alertVariants = cva(
|
|
4
|
-
"relative flex w-full gap-3 p-4 rounded-lg border text-
|
|
4
|
+
"relative flex w-full gap-3 p-4 rounded-lg border text-body-2 transition-all duration-200",
|
|
5
5
|
{
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
@@ -12,9 +12,9 @@ const alertVariants = cva(
|
|
|
12
12
|
destructive: "border-destructive/30 bg-destructive/10 text-foreground dark:border-destructive/40 dark:bg-destructive/15"
|
|
13
13
|
},
|
|
14
14
|
size: {
|
|
15
|
-
sm: "p-3 text-
|
|
16
|
-
default: "p-4 text-
|
|
17
|
-
lg: "p-5 text-
|
|
15
|
+
sm: "p-3 text-body-3 gap-2.5",
|
|
16
|
+
default: "p-4 text-body-2 gap-3",
|
|
17
|
+
lg: "p-5 text-body-1 gap-3.5"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
defaultVariants: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
2
|
|
|
3
3
|
const alertDialogOverlayVariants = cva(
|
|
4
|
-
"fixed inset-0 z-50 bg-
|
|
4
|
+
"fixed inset-0 z-50 bg-grey-1000/60 backdrop-blur-xs transition-opacity duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out"
|
|
5
5
|
);
|
|
6
6
|
const alertDialogContentVariants = cva(
|
|
7
|
-
"relative pointer-events-auto flex flex-col w-full max-w-lg rounded-xl border border-grey-200 dark:border-grey-800 bg-
|
|
7
|
+
"relative pointer-events-auto flex flex-col w-full max-w-lg rounded-xl border border-grey-200 dark:border-grey-800 bg-grey-50 dark:bg-grey-900 shadow-xl font-sans text-foreground overflow-hidden p-6 gap-4 data-[state=open]:animate-dialog-scale-in data-[state=closed]:animate-dialog-scale-out"
|
|
8
8
|
);
|
|
9
9
|
const alertDialogHeaderVariants = cva(
|
|
10
10
|
"flex flex-col space-y-1.5 text-left"
|
|
@@ -16,10 +16,10 @@ const alertDialogFooterVariants = cva(
|
|
|
16
16
|
"flex flex-col-reverse sm:flex-row sm:justify-end gap-2.5 pt-2"
|
|
17
17
|
);
|
|
18
18
|
const alertDialogTitleVariants = cva(
|
|
19
|
-
"text-
|
|
19
|
+
"text-h6 font-semibold leading-none tracking-tight text-foreground"
|
|
20
20
|
);
|
|
21
21
|
const alertDialogDescriptionVariants = cva(
|
|
22
|
-
"text-
|
|
22
|
+
"text-body-2 text-muted-foreground leading-relaxed"
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
export { alertDialogBodyVariants, alertDialogContentVariants, alertDialogDescriptionVariants, alertDialogFooterVariants, alertDialogHeaderVariants, alertDialogOverlayVariants, alertDialogTitleVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthModal.d.ts","sourceRoot":"","sources":["../../../src/components/AuthModal/AuthModal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAWxD,eAAO,MAAM,SAAS,uFA6ErB,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
5
|
+
import { X } from '@timmbr/icons';
|
|
6
|
+
import { cn } from '@timmbr/utils';
|
|
7
|
+
import { DEFAULT_AUTH_MODAL_LABELS, AuthModalLabelsContext } from './AuthModal.labels.js';
|
|
8
|
+
import { authModalCardVariants, authModalContainerVariants } from './AuthModal.styles.js';
|
|
9
|
+
import { AuthModalBanner } from './subcomponents/AuthModalBanner.js';
|
|
10
|
+
import { AuthModalIdentifierForm } from './subcomponents/AuthModalIdentifierForm.js';
|
|
11
|
+
import { AuthModalOAuth } from './subcomponents/AuthModalOAuth.js';
|
|
12
|
+
import { AuthModalSuccess } from './subcomponents/AuthModalSuccess.js';
|
|
13
|
+
import { AuthModalSetPasswordForm } from './subcomponents/AuthModalSetPasswordForm.js';
|
|
14
|
+
import { AuthModalPasswordForm } from './subcomponents/AuthModalPasswordForm.js';
|
|
15
|
+
import { AuthModalOtpForm } from './subcomponents/AuthModalOtpForm.js';
|
|
16
|
+
|
|
17
|
+
const AuthModal = React.forwardRef(
|
|
18
|
+
({ isOpen, onClose, banner, form, oauth, legal, labels: labelOverrides, className }, ref) => {
|
|
19
|
+
const step = form.step ?? "IDENTIFIER";
|
|
20
|
+
const labels = React.useMemo(
|
|
21
|
+
() => ({ ...DEFAULT_AUTH_MODAL_LABELS, ...labelOverrides }),
|
|
22
|
+
[labelOverrides]
|
|
23
|
+
);
|
|
24
|
+
const renderStep = () => {
|
|
25
|
+
switch (step) {
|
|
26
|
+
case "OTP":
|
|
27
|
+
return /* @__PURE__ */ jsx(AuthModalOtpForm, { form });
|
|
28
|
+
case "PASSWORD":
|
|
29
|
+
return /* @__PURE__ */ jsx(AuthModalPasswordForm, { form });
|
|
30
|
+
case "SET_PASSWORD":
|
|
31
|
+
return /* @__PURE__ */ jsx(AuthModalSetPasswordForm, { form });
|
|
32
|
+
case "SUCCESS":
|
|
33
|
+
return /* @__PURE__ */ jsx(AuthModalSuccess, { form });
|
|
34
|
+
case "IDENTIFIER":
|
|
35
|
+
default:
|
|
36
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37
|
+
/* @__PURE__ */ jsx(AuthModalIdentifierForm, { form, legal }),
|
|
38
|
+
/* @__PURE__ */ jsx(AuthModalOAuth, { providers: oauth?.providers, disabled: form.isLoading })
|
|
39
|
+
] });
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ jsx(AuthModalLabelsContext.Provider, { value: labels, children: /* @__PURE__ */ jsx(DialogPrimitive.Root, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { children: [
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
DialogPrimitive.Overlay,
|
|
45
|
+
{
|
|
46
|
+
"data-slot": "auth-modal-overlay",
|
|
47
|
+
className: "fixed inset-0 z-50 bg-grey-1000/50 backdrop-blur-[2px] transition-opacity data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-4 pointer-events-none", children: /* @__PURE__ */ jsxs(
|
|
51
|
+
DialogPrimitive.Content,
|
|
52
|
+
{
|
|
53
|
+
ref,
|
|
54
|
+
"data-slot": "auth-modal-content",
|
|
55
|
+
className: cn(
|
|
56
|
+
authModalContainerVariants(),
|
|
57
|
+
"pointer-events-auto transition-all data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
58
|
+
className
|
|
59
|
+
),
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx(DialogPrimitive.Title, { className: "sr-only", children: labels.dialogTitle }),
|
|
62
|
+
/* @__PURE__ */ jsx(DialogPrimitive.Description, { className: "sr-only", children: labels.dialogDescription }),
|
|
63
|
+
/* @__PURE__ */ jsx(
|
|
64
|
+
DialogPrimitive.Close,
|
|
65
|
+
{
|
|
66
|
+
"data-slot": "auth-modal-close",
|
|
67
|
+
"aria-label": labels.close,
|
|
68
|
+
className: "absolute right-3 top-3 z-30 rounded-sm p-1.5 text-grey-700 hover:text-grey-950 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",
|
|
69
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
AuthModalBanner,
|
|
74
|
+
{
|
|
75
|
+
data: banner?.data,
|
|
76
|
+
promoTermsUrl: banner?.promoTermsUrl,
|
|
77
|
+
className: banner?.className
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsx("div", { "data-slot": "auth-modal-card", className: authModalCardVariants(), children: /* @__PURE__ */ jsx("div", { children: renderStep() }) })
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
) })
|
|
84
|
+
] }) }) });
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
AuthModal.displayName = "AuthModal";
|
|
88
|
+
|
|
89
|
+
export { AuthModal };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { AuthModalLabels } from './AuthModal.types';
|
|
3
|
+
export declare const DEFAULT_AUTH_MODAL_LABELS: AuthModalLabels;
|
|
4
|
+
export declare const AuthModalLabelsContext: React.Context<AuthModalLabels>;
|
|
5
|
+
export declare function useAuthModalLabels(): AuthModalLabels;
|
|
6
|
+
//# sourceMappingURL=AuthModal.labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthModal.labels.d.ts","sourceRoot":"","sources":["../../../src/components/AuthModal/AuthModal.labels.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,eAAO,MAAM,yBAAyB,EAAE,eA6CvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,gCAElC,CAAC;AAEF,wBAAgB,kBAAkB,oBAEjC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_AUTH_MODAL_LABELS = {
|
|
5
|
+
dialogTitle: "Sign in",
|
|
6
|
+
dialogDescription: "Sign in or create an account with your email or mobile number.",
|
|
7
|
+
close: "Close",
|
|
8
|
+
identifierTitle: "Log in or Sign up",
|
|
9
|
+
identifierSubtitle: "Enter your email or mobile number to continue",
|
|
10
|
+
identifierLabel: "Email or mobile number",
|
|
11
|
+
identifierPlaceholder: "Email or Mobile number",
|
|
12
|
+
continue: "Continue",
|
|
13
|
+
usePassword: "Use password instead",
|
|
14
|
+
legalPrefix: "By continuing, you agree to our",
|
|
15
|
+
termsOfUse: "Terms of Use",
|
|
16
|
+
privacyPolicy: "Privacy Policy",
|
|
17
|
+
oauthDivider: "or",
|
|
18
|
+
oauthContinueWith: (name) => `Continue with ${name}`,
|
|
19
|
+
otpTitle: "Verify with OTP",
|
|
20
|
+
otpSentTo: "Sent to",
|
|
21
|
+
otpLabel: "Verification code",
|
|
22
|
+
otpSubmit: "Verify & Proceed",
|
|
23
|
+
otpResend: "Resend OTP",
|
|
24
|
+
otpResendIn: (s) => `Resend OTP in ${s}s`,
|
|
25
|
+
edit: "Edit",
|
|
26
|
+
passwordTitle: "Enter your password",
|
|
27
|
+
passwordLabel: "Password",
|
|
28
|
+
passwordPlaceholder: "Password",
|
|
29
|
+
passwordSubmit: "Log in",
|
|
30
|
+
forgotPassword: "Forgot password? Log in with OTP",
|
|
31
|
+
showPassword: "Show password",
|
|
32
|
+
hidePassword: "Hide password",
|
|
33
|
+
setPasswordCreateTitle: "Create a password",
|
|
34
|
+
setPasswordCreateSubtitle: "Sign in faster next time with your password.",
|
|
35
|
+
setPasswordResetTitle: "Set a new password",
|
|
36
|
+
setPasswordResetSubtitle: "You're verified. Choose a new password for your account.",
|
|
37
|
+
newPasswordLabel: "New password",
|
|
38
|
+
confirmPasswordLabel: "Confirm password",
|
|
39
|
+
passwordHint: "At least 8 characters, with an uppercase letter, a number and a symbol.",
|
|
40
|
+
passwordMismatch: "Passwords don't match.",
|
|
41
|
+
setPasswordSubmit: "Save password",
|
|
42
|
+
skipForNow: "Skip for now",
|
|
43
|
+
successTitle: "You're signed in"
|
|
44
|
+
};
|
|
45
|
+
const AuthModalLabelsContext = React.createContext(
|
|
46
|
+
DEFAULT_AUTH_MODAL_LABELS
|
|
47
|
+
);
|
|
48
|
+
function useAuthModalLabels() {
|
|
49
|
+
return React.useContext(AuthModalLabelsContext);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { AuthModalLabelsContext, DEFAULT_AUTH_MODAL_LABELS, useAuthModalLabels };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const authModalContainerVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const authModalBannerVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
|
+
export declare const authModalCardVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
4
|
+
export declare const authModalHeadingVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
5
|
+
export declare const authModalSubtitleVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
6
|
+
export declare const authModalInputVariants: (props?: ({
|
|
7
|
+
invalid?: boolean | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export declare const authModalSubmitButtonVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
10
|
+
export declare const authModalSecondaryButtonVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
11
|
+
export declare const authModalLinkVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
12
|
+
//# sourceMappingURL=AuthModal.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthModal.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AuthModal/AuthModal.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,0BAA0B,oFAEtC,CAAC;AAEF,eAAO,MAAM,uBAAuB,oFAEnC,CAAC;AAEF,eAAO,MAAM,qBAAqB,oFAEjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,oFAEpC,CAAC;AAEF,eAAO,MAAM,yBAAyB,oFAA0C,CAAC;AAEjF,eAAO,MAAM,sBAAsB;;8EAWlC,CAAC;AAEF,eAAO,MAAM,6BAA6B,oFAEzC,CAAC;AAEF,eAAO,MAAM,gCAAgC,oFAE5C,CAAC;AAEF,eAAO,MAAM,qBAAqB,oFAEjC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
|
|
3
|
+
const authModalContainerVariants = cva(
|
|
4
|
+
"relative flex w-full max-w-[675px] bg-grey-50 overflow-hidden rounded-sm shadow-[0px_12px_24px_-4px_rgba(0,0,0,0.15)] flex-col sm:flex-row sm:min-h-[454px] max-h-[calc(100dvh-24px)] sm:max-h-[calc(100dvh-32px)]"
|
|
5
|
+
);
|
|
6
|
+
const authModalBannerVariants = cva(
|
|
7
|
+
"relative hidden sm:flex shrink-0 w-[320px] flex-col justify-between p-8 overflow-hidden select-none"
|
|
8
|
+
);
|
|
9
|
+
const authModalCardVariants = cva(
|
|
10
|
+
"flex-1 min-w-0 min-h-0 p-6 sm:p-8 flex flex-col justify-between overflow-y-auto"
|
|
11
|
+
);
|
|
12
|
+
const authModalHeadingVariants = cva(
|
|
13
|
+
"text-h4 text-grey-950 tracking-tight outline-none"
|
|
14
|
+
);
|
|
15
|
+
const authModalSubtitleVariants = cva("text-body-2 text-grey-600 mt-1.5");
|
|
16
|
+
const authModalInputVariants = cva(
|
|
17
|
+
"w-full px-4 py-3 rounded-lg border bg-grey-50 text-body-1 text-grey-950 placeholder:text-sand-muted focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent transition-all disabled:opacity-50",
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
invalid: {
|
|
21
|
+
true: "border-destructive",
|
|
22
|
+
false: "border-border-warm"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: { invalid: false }
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
const authModalSubmitButtonVariants = cva(
|
|
29
|
+
"w-full py-3 px-4 rounded-lg bg-primary text-grey-50 font-medium text-body-1 hover:bg-primary-600 active:bg-primary-700 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 cursor-pointer shadow-sm"
|
|
30
|
+
);
|
|
31
|
+
const authModalSecondaryButtonVariants = cva(
|
|
32
|
+
"w-full py-3 px-4 rounded-lg border border-border-warm bg-grey-50 text-grey-950 font-medium text-body-2 hover:bg-bg-2 active:bg-bg-1 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-3 cursor-pointer"
|
|
33
|
+
);
|
|
34
|
+
const authModalLinkVariants = cva(
|
|
35
|
+
"font-sans font-medium text-primary hover:underline cursor-pointer disabled:opacity-50 disabled:no-underline disabled:cursor-not-allowed focus:outline-none focus-visible:underline"
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export { authModalBannerVariants, authModalCardVariants, authModalContainerVariants, authModalHeadingVariants, authModalInputVariants, authModalLinkVariants, authModalSecondaryButtonVariants, authModalSubmitButtonVariants, authModalSubtitleVariants };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { ReactNode, FormEvent } from 'react';
|
|
2
|
+
export interface AuthModalBannerData {
|
|
3
|
+
title?: string;
|
|
4
|
+
subtitle?: string;
|
|
5
|
+
promoBadge?: string;
|
|
6
|
+
termsNotice?: string;
|
|
7
|
+
imageUrl?: string;
|
|
8
|
+
iconUrl?: string;
|
|
9
|
+
logoUrl?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* IDENTIFIER → OTP | PASSWORD → [SET_PASSWORD] → SUCCESS
|
|
13
|
+
* - IDENTIFIER: email or phone, "Continue" (OTP) or "Use password instead"
|
|
14
|
+
* - OTP: one-time code
|
|
15
|
+
* - PASSWORD: password sign-in, with "Forgot password?"
|
|
16
|
+
* - SET_PASSWORD: create (new account, skippable) or reset (forgot password)
|
|
17
|
+
* - SUCCESS: signed-in confirmation
|
|
18
|
+
*/
|
|
19
|
+
export type AuthModalStep = 'IDENTIFIER' | 'OTP' | 'PASSWORD' | 'SET_PASSWORD' | 'SUCCESS';
|
|
20
|
+
export type AuthModalSetPasswordMode = 'create' | 'reset';
|
|
21
|
+
export interface AuthOAuthProvider {
|
|
22
|
+
/** Provider identifier, e.g. 'google', 'apple', 'github', or custom */
|
|
23
|
+
id: 'google' | 'apple' | 'github' | string;
|
|
24
|
+
/** Display label for the provider, e.g. 'Google', 'Apple', 'GitHub' */
|
|
25
|
+
name: string;
|
|
26
|
+
/** Custom icon ReactNode. If omitted, built-in icon is used for google, apple, github */
|
|
27
|
+
icon?: ReactNode;
|
|
28
|
+
/** Click handler for initiating OAuth flow */
|
|
29
|
+
onClick: () => void;
|
|
30
|
+
/** Whether this provider is currently in a loading state */
|
|
31
|
+
isLoading?: boolean;
|
|
32
|
+
/** Whether this provider is disabled */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface AuthModalBannerProps {
|
|
36
|
+
/** Promotional banner content. The banner is hidden when no image is provided. */
|
|
37
|
+
data?: AuthModalBannerData;
|
|
38
|
+
/** Link for the promo's terms notice (e.g. "*T&C Apply"); not the site's Terms of Use */
|
|
39
|
+
promoTermsUrl?: string;
|
|
40
|
+
/** Custom banner wrapper class */
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface AuthModalFormProps {
|
|
44
|
+
/** Current step (see AuthModalStep) */
|
|
45
|
+
step?: AuthModalStep;
|
|
46
|
+
/** Whether an async request is currently loading */
|
|
47
|
+
isLoading?: boolean;
|
|
48
|
+
/** Error message for the current step */
|
|
49
|
+
error?: string | null;
|
|
50
|
+
/** Identifier input value (phone number or email) */
|
|
51
|
+
identifier?: string;
|
|
52
|
+
onIdentifierChange?: (value: string) => void;
|
|
53
|
+
/** Primary action: send a one-time code */
|
|
54
|
+
onIdentifierSubmit?: (e: FormEvent) => void;
|
|
55
|
+
/** Secondary action: switch to the PASSWORD step. Hidden when omitted. */
|
|
56
|
+
onUsePassword?: () => void;
|
|
57
|
+
/** One-time code value */
|
|
58
|
+
otp?: string;
|
|
59
|
+
onOtpChange?: (value: string) => void;
|
|
60
|
+
onOtpSubmit?: (e: FormEvent) => void;
|
|
61
|
+
/** Number of digits in the code. Defaults to 6 */
|
|
62
|
+
otpLength?: number;
|
|
63
|
+
onResendOtp?: () => void;
|
|
64
|
+
/** Resend countdown in seconds (0 = enabled) */
|
|
65
|
+
resendCountdown?: number;
|
|
66
|
+
/** Masked destination where the code was sent (e.g. a***x@gmail.com) */
|
|
67
|
+
destination?: string;
|
|
68
|
+
/** "Edit" link on OTP/PASSWORD steps: go back to IDENTIFIER */
|
|
69
|
+
onEditIdentifier?: () => void;
|
|
70
|
+
password?: string;
|
|
71
|
+
onPasswordChange?: (value: string) => void;
|
|
72
|
+
onPasswordSubmit?: (e: FormEvent) => void;
|
|
73
|
+
/** "Forgot password?" — typically sends a one-time code instead */
|
|
74
|
+
onForgotPassword?: () => void;
|
|
75
|
+
setPasswordMode?: AuthModalSetPasswordMode;
|
|
76
|
+
newPassword?: string;
|
|
77
|
+
onNewPasswordChange?: (value: string) => void;
|
|
78
|
+
confirmPassword?: string;
|
|
79
|
+
onConfirmPasswordChange?: (value: string) => void;
|
|
80
|
+
onSetPasswordSubmit?: (e: FormEvent) => void;
|
|
81
|
+
/** "Skip for now" (create mode only). Hidden when omitted. */
|
|
82
|
+
onSkipSetPassword?: () => void;
|
|
83
|
+
/** Heading shown on the SUCCESS step */
|
|
84
|
+
successTitle?: string;
|
|
85
|
+
/** Supporting text shown on the SUCCESS step */
|
|
86
|
+
successMessage?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface AuthModalOAuthProps {
|
|
89
|
+
/** List of OAuth providers to display */
|
|
90
|
+
providers?: AuthOAuthProvider[];
|
|
91
|
+
}
|
|
92
|
+
export interface AuthModalLegalProps {
|
|
93
|
+
/** Terms of Service URL. Defaults to '/terms' */
|
|
94
|
+
termsUrl?: string;
|
|
95
|
+
/** Privacy Policy URL. Defaults to '/privacy' */
|
|
96
|
+
privacyUrl?: string;
|
|
97
|
+
}
|
|
98
|
+
/** All user-facing copy. Every key has an English default. */
|
|
99
|
+
export interface AuthModalLabels {
|
|
100
|
+
dialogTitle: string;
|
|
101
|
+
dialogDescription: string;
|
|
102
|
+
close: string;
|
|
103
|
+
identifierTitle: string;
|
|
104
|
+
identifierSubtitle: string;
|
|
105
|
+
identifierLabel: string;
|
|
106
|
+
identifierPlaceholder: string;
|
|
107
|
+
continue: string;
|
|
108
|
+
usePassword: string;
|
|
109
|
+
legalPrefix: string;
|
|
110
|
+
termsOfUse: string;
|
|
111
|
+
privacyPolicy: string;
|
|
112
|
+
oauthDivider: string;
|
|
113
|
+
oauthContinueWith: (providerName: string) => string;
|
|
114
|
+
otpTitle: string;
|
|
115
|
+
otpSentTo: string;
|
|
116
|
+
otpLabel: string;
|
|
117
|
+
otpSubmit: string;
|
|
118
|
+
otpResend: string;
|
|
119
|
+
otpResendIn: (seconds: number) => string;
|
|
120
|
+
edit: string;
|
|
121
|
+
passwordTitle: string;
|
|
122
|
+
passwordLabel: string;
|
|
123
|
+
passwordPlaceholder: string;
|
|
124
|
+
passwordSubmit: string;
|
|
125
|
+
forgotPassword: string;
|
|
126
|
+
showPassword: string;
|
|
127
|
+
hidePassword: string;
|
|
128
|
+
setPasswordCreateTitle: string;
|
|
129
|
+
setPasswordCreateSubtitle: string;
|
|
130
|
+
setPasswordResetTitle: string;
|
|
131
|
+
setPasswordResetSubtitle: string;
|
|
132
|
+
newPasswordLabel: string;
|
|
133
|
+
confirmPasswordLabel: string;
|
|
134
|
+
passwordHint: string;
|
|
135
|
+
passwordMismatch: string;
|
|
136
|
+
setPasswordSubmit: string;
|
|
137
|
+
skipForNow: string;
|
|
138
|
+
successTitle: string;
|
|
139
|
+
}
|
|
140
|
+
export interface AuthModalProps {
|
|
141
|
+
/** Controlled open state */
|
|
142
|
+
isOpen: boolean;
|
|
143
|
+
/** Callback fired when modal is closed */
|
|
144
|
+
onClose: () => void;
|
|
145
|
+
/** Promotional banner section configuration */
|
|
146
|
+
banner?: AuthModalBannerProps;
|
|
147
|
+
/** Form state, inputs, and submission callbacks */
|
|
148
|
+
form: AuthModalFormProps;
|
|
149
|
+
/** OAuth social login configuration (shown on the IDENTIFIER step) */
|
|
150
|
+
oauth?: AuthModalOAuthProps;
|
|
151
|
+
/** Legal links configuration */
|
|
152
|
+
legal?: AuthModalLegalProps;
|
|
153
|
+
/** Override any user-facing copy */
|
|
154
|
+
labels?: Partial<AuthModalLabels>;
|
|
155
|
+
/** Optional custom class name for dialog container */
|
|
156
|
+
className?: string;
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=AuthModal.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthModal.types.d.ts","sourceRoot":"","sources":["../../../src/components/AuthModal/AuthModal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,KAAK,GAAG,UAAU,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,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IAEnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,mDAAmD;IACnD,IAAI,EAAE,kBAAkB,CAAC;IACzB,sEAAsE;IACtE,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,gCAAgC;IAChC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,oCAAoC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAClC,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AuthModal/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { AuthModalBannerProps } from '../AuthModal.types';
|
|
3
|
+
/**
|
|
4
|
+
* Promotional side panel (≥ sm). All content comes from the consumer (CMS);
|
|
5
|
+
* without an image the banner isn't rendered at all.
|
|
6
|
+
*/
|
|
7
|
+
export declare function AuthModalBanner({ data, promoTermsUrl, className }: AuthModalBannerProps): React.JSX.Element | null;
|
|
8
|
+
export declare namespace AuthModalBanner {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=AuthModalBanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthModalBanner.d.ts","sourceRoot":"","sources":["../../../../src/components/AuthModal/subcomponents/AuthModalBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,oBAAoB,4BAqEvF;yBArEe,eAAe"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { cn } from '@timmbr/utils';
|
|
4
|
+
import { authModalBannerVariants } from '../AuthModal.styles.js';
|
|
5
|
+
|
|
6
|
+
function AuthModalBanner({ data, promoTermsUrl, className }) {
|
|
7
|
+
if (!data?.imageUrl) return null;
|
|
8
|
+
const brandIcon = data.iconUrl || data.logoUrl;
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "auth-modal-banner", className: cn(authModalBannerVariants(), className), children: [
|
|
10
|
+
/* @__PURE__ */ jsxs("div", { "aria-hidden": "true", className: "absolute inset-0 pointer-events-none z-0", children: [
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
"img",
|
|
13
|
+
{
|
|
14
|
+
src: data.imageUrl,
|
|
15
|
+
alt: "",
|
|
16
|
+
width: 320,
|
|
17
|
+
height: 454,
|
|
18
|
+
loading: "lazy",
|
|
19
|
+
decoding: "async",
|
|
20
|
+
className: "h-full w-full object-cover object-center"
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-grey-1000/20" })
|
|
24
|
+
] }),
|
|
25
|
+
(brandIcon || data.title || data.subtitle) && /* @__PURE__ */ jsxs("div", { className: "relative z-10 flex items-center gap-3 pt-2", children: [
|
|
26
|
+
brandIcon && /* @__PURE__ */ jsx(
|
|
27
|
+
"img",
|
|
28
|
+
{
|
|
29
|
+
src: brandIcon,
|
|
30
|
+
alt: "",
|
|
31
|
+
width: 56,
|
|
32
|
+
height: 56,
|
|
33
|
+
loading: "lazy",
|
|
34
|
+
decoding: "async",
|
|
35
|
+
className: "size-14 object-contain"
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ jsxs("div", { className: "text-grey-50 text-left leading-tight", children: [
|
|
39
|
+
data.title && /* @__PURE__ */ jsx("p", { className: "text-h4 tracking-[1.4px]", children: data.title }),
|
|
40
|
+
data.subtitle && /* @__PURE__ */ jsx("p", { className: "font-medium text-body-2 tracking-[0.7px]", children: data.subtitle })
|
|
41
|
+
] })
|
|
42
|
+
] }),
|
|
43
|
+
(data.promoBadge || data.termsNotice) && /* @__PURE__ */ jsxs("div", { className: "relative z-10 flex flex-col items-start gap-4 pb-2", children: [
|
|
44
|
+
data.promoBadge && /* @__PURE__ */ jsx("div", { className: "bg-primary-400 px-3.5 py-1.5 rounded-sm shadow-sm", children: /* @__PURE__ */ jsx("span", { className: "text-grey-50 font-semibold text-body-3 tracking-wider uppercase", children: data.promoBadge }) }),
|
|
45
|
+
data.termsNotice && (promoTermsUrl ? /* @__PURE__ */ jsx(
|
|
46
|
+
"a",
|
|
47
|
+
{
|
|
48
|
+
href: promoTermsUrl,
|
|
49
|
+
className: "text-grey-50/80 hover:text-grey-50 text-body-3 underline underline-offset-2 transition-colors",
|
|
50
|
+
children: data.termsNotice
|
|
51
|
+
}
|
|
52
|
+
) : /* @__PURE__ */ jsx("p", { className: "text-grey-50/80 text-body-3", children: data.termsNotice }))
|
|
53
|
+
] })
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
AuthModalBanner.displayName = "AuthModalBanner";
|
|
57
|
+
|
|
58
|
+
export { AuthModalBanner };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { AuthModalFormProps, AuthModalLegalProps } from '../AuthModal.types';
|
|
3
|
+
export interface AuthModalIdentifierFormProps {
|
|
4
|
+
form: AuthModalFormProps;
|
|
5
|
+
legal?: AuthModalLegalProps;
|
|
6
|
+
}
|
|
7
|
+
export declare function AuthModalIdentifierForm({ form, legal }: AuthModalIdentifierFormProps): React.JSX.Element;
|
|
8
|
+
export declare namespace AuthModalIdentifierForm {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=AuthModalIdentifierForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthModalIdentifierForm.d.ts","sourceRoot":"","sources":["../../../../src/components/AuthModal/subcomponents/AuthModalIdentifierForm.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGlF,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,kBAAkB,CAAC;IACzB,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B;AAKD,wBAAgB,uBAAuB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,4BAA4B,qBAkEpF;yBAlEe,uBAAuB"}
|