@sudobility/building_blocks 0.0.201 → 0.0.203
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/{SafeSubscriptionContext-CNuEKeqJ.js → SafeSubscriptionContext-D4q_l1Kw.js} +8 -2
- package/dist/SafeSubscriptionContext-D4q_l1Kw.js.map +1 -0
- package/dist/{SubscriptionProviderWrapper-CBJ_psbw.js → SubscriptionProviderWrapper-B-B08xjD.js} +2 -2
- package/dist/{SubscriptionProviderWrapper-CBJ_psbw.js.map → SubscriptionProviderWrapper-B-B08xjD.js.map} +1 -1
- package/dist/components/pages/login-page.d.ts +3 -1
- package/dist/firebase.js +2 -2
- package/dist/index.js +144 -126
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/dist/SafeSubscriptionContext-CNuEKeqJ.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b, a, S, u } from "./SafeSubscriptionContext-
|
|
1
|
+
import { b, a, S, u } from "./SafeSubscriptionContext-D4q_l1Kw.js";
|
|
2
2
|
import { clsx } from "clsx";
|
|
3
3
|
import { twMerge } from "tailwind-merge";
|
|
4
4
|
import i18n from "i18next";
|
|
@@ -10,7 +10,7 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
|
10
10
|
import React, { useState, useRef, useMemo, useCallback, useEffect } from "react";
|
|
11
11
|
import { TopbarProvider, Topbar, TopbarLeft, TopbarNavigation, TopbarLogo, Logo, TopbarCenter, TopbarRight, TopbarActions, TopbarMobileContent, Footer, FooterCompact, FooterCompactLeft, FooterVersion, FooterCopyright, FooterCompactRight, FooterGrid, FooterLinkSection, FooterLink, FooterBottom, FooterBrand, FooterSocialLinks, LayoutProvider, AspectFitView, Label, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, MasterListItem, MasterDetailLayout, Section } from "@sudobility/components";
|
|
12
12
|
import { ChevronDownIcon, CalendarDaysIcon, PaintBrushIcon, LanguageIcon, ChevronRightIcon, EnvelopeIcon, DocumentTextIcon, CogIcon, HomeIcon } from "@heroicons/react/24/outline";
|
|
13
|
-
import { GRADIENT_CLASSES, textVariants } from "@sudobility/design";
|
|
13
|
+
import { GRADIENT_CLASSES, ui, textVariants, colors, buttonVariant, focusRing } from "@sudobility/design";
|
|
14
14
|
import { cva } from "class-variance-authority";
|
|
15
15
|
function cn(...inputs) {
|
|
16
16
|
return twMerge(clsx(inputs));
|
|
@@ -447,9 +447,9 @@ const AppTopBarWithWallet = ({
|
|
|
447
447
|
const breadcrumbContainerVariants = cva("border-b", {
|
|
448
448
|
variants: {
|
|
449
449
|
variant: {
|
|
450
|
-
default:
|
|
450
|
+
default: `${ui.background.surface} ${ui.border.default}`,
|
|
451
451
|
transparent: "bg-transparent border-transparent",
|
|
452
|
-
subtle:
|
|
452
|
+
subtle: `${ui.background.subtle} ${ui.border.default}`
|
|
453
453
|
}
|
|
454
454
|
},
|
|
455
455
|
defaultVariants: {
|
|
@@ -729,7 +729,7 @@ const ShareDropdown = ({
|
|
|
729
729
|
isOpen && /* @__PURE__ */ jsxs(
|
|
730
730
|
"div",
|
|
731
731
|
{
|
|
732
|
-
className:
|
|
732
|
+
className: `absolute right-0 top-10 z-[999999] w-40 ${ui.background.surface} rounded-lg shadow-xl border ${ui.border.default} py-1`,
|
|
733
733
|
role: "menu",
|
|
734
734
|
"aria-label": "Share options",
|
|
735
735
|
onKeyDown: handleMenuKeyDown,
|
|
@@ -848,15 +848,15 @@ const AppBreadcrumbs = ({
|
|
|
848
848
|
}
|
|
849
849
|
return /* @__PURE__ */ jsx("div", { className: cn(breadcrumbContainerVariants({ variant }), className), children: /* @__PURE__ */ jsx("div", { className: cn("max-w-7xl mx-auto px-4 py-2", contentClassName), children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
850
850
|
/* @__PURE__ */ jsx("nav", { "aria-label": "Breadcrumb", children: /* @__PURE__ */ jsx("ol", { className: "flex items-center text-sm space-x-2", children: items.map((item, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
851
|
-
/* @__PURE__ */ jsx("li", { children: item.current || !item.href ? /* @__PURE__ */ jsx("span", { className:
|
|
851
|
+
/* @__PURE__ */ jsx("li", { children: item.current || !item.href ? /* @__PURE__ */ jsx("span", { className: ui.text.body, children: item.label }) : /* @__PURE__ */ jsx(
|
|
852
852
|
"a",
|
|
853
853
|
{
|
|
854
854
|
href: item.href,
|
|
855
|
-
className:
|
|
855
|
+
className: `${ui.text.linkSubtle} transition-colors`,
|
|
856
856
|
children: item.label
|
|
857
857
|
}
|
|
858
858
|
) }),
|
|
859
|
-
index < items.length - 1 && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("span", { className:
|
|
859
|
+
index < items.length - 1 && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("span", { className: ui.text.muted, children: "/" }) })
|
|
860
860
|
] }, index)) }) }),
|
|
861
861
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
862
862
|
talkToFounder && /* @__PURE__ */ jsx(TalkToFounderButton, { config: talkToFounder }),
|
|
@@ -920,7 +920,7 @@ const AppFooter = ({
|
|
|
920
920
|
LinkComponent,
|
|
921
921
|
{
|
|
922
922
|
href: companyUrl,
|
|
923
|
-
className:
|
|
923
|
+
className: cn(ui.text.linkSubtle, ui.transition.default),
|
|
924
924
|
children: companyName
|
|
925
925
|
}
|
|
926
926
|
) : void 0;
|
|
@@ -962,7 +962,7 @@ const AppFooter = ({
|
|
|
962
962
|
link.href,
|
|
963
963
|
link.onClick
|
|
964
964
|
),
|
|
965
|
-
className:
|
|
965
|
+
className: cn(ui.text.linkMuted, ui.transition.default),
|
|
966
966
|
children: link.label
|
|
967
967
|
}
|
|
968
968
|
) : /* @__PURE__ */ jsx(
|
|
@@ -970,7 +970,7 @@ const AppFooter = ({
|
|
|
970
970
|
{
|
|
971
971
|
href: link.href,
|
|
972
972
|
onClick: createTrackedLinkHandler(link.label, link.href),
|
|
973
|
-
className:
|
|
973
|
+
className: cn(ui.text.linkMuted, ui.transition.default),
|
|
974
974
|
children: link.label
|
|
975
975
|
}
|
|
976
976
|
) }, link.href || index)) })
|
|
@@ -1039,7 +1039,7 @@ const AppFooterForHomePage = ({
|
|
|
1039
1039
|
LinkComponent,
|
|
1040
1040
|
{
|
|
1041
1041
|
href: companyUrl,
|
|
1042
|
-
className:
|
|
1042
|
+
className: cn(ui.text.linkSubtle, ui.transition.default),
|
|
1043
1043
|
children: companyName
|
|
1044
1044
|
}
|
|
1045
1045
|
) : void 0;
|
|
@@ -1564,38 +1564,56 @@ const AppSitemapPage = ({
|
|
|
1564
1564
|
}) => {
|
|
1565
1565
|
const content = /* @__PURE__ */ jsxs(Section, { spacing: "3xl", maxWidth: "6xl", className: cn(className), children: [
|
|
1566
1566
|
/* @__PURE__ */ jsxs("div", { className: "text-center mb-12", children: [
|
|
1567
|
-
/* @__PURE__ */ jsx("h1", { className:
|
|
1568
|
-
/* @__PURE__ */ jsx("p", { className:
|
|
1569
|
-
] }),
|
|
1570
|
-
languages.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-12 p-6 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
1571
|
-
/* @__PURE__ */ jsxs("h2", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-4 flex items-center", children: [
|
|
1572
|
-
/* @__PURE__ */ jsx(LanguageIcon, { className: "w-6 h-6 mr-2" }),
|
|
1573
|
-
text.languagesSectionTitle
|
|
1574
|
-
] }),
|
|
1575
|
-
/* @__PURE__ */ jsx("p", { className: "text-gray-600 dark:text-gray-300 mb-6", children: text.languagesDescription }),
|
|
1576
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4", children: languages.map((lang) => /* @__PURE__ */ jsxs(
|
|
1577
|
-
LinkComponent,
|
|
1578
|
-
{
|
|
1579
|
-
href: languageLinkPath ?? "/",
|
|
1580
|
-
language: lang.code,
|
|
1581
|
-
className: "flex items-center space-x-2 p-3 bg-white dark:bg-gray-800 rounded-lg hover:shadow-md transition-shadow",
|
|
1582
|
-
children: [
|
|
1583
|
-
/* @__PURE__ */ jsx("span", { className: "text-2xl", children: lang.flag }),
|
|
1584
|
-
/* @__PURE__ */ jsx("div", { className: "font-medium text-gray-900 dark:text-white", children: lang.name })
|
|
1585
|
-
]
|
|
1586
|
-
},
|
|
1587
|
-
lang.code
|
|
1588
|
-
)) })
|
|
1567
|
+
/* @__PURE__ */ jsx("h1", { className: `text-4xl font-bold ${ui.text.strong} mb-4`, children: text.title }),
|
|
1568
|
+
/* @__PURE__ */ jsx("p", { className: `text-xl ${ui.text.muted}`, children: text.subtitle })
|
|
1589
1569
|
] }),
|
|
1570
|
+
languages.length > 0 && /* @__PURE__ */ jsxs(
|
|
1571
|
+
"div",
|
|
1572
|
+
{
|
|
1573
|
+
className: `mb-12 p-6 ${colors.component.alert.info.base} ${colors.component.alert.info.dark} rounded-lg`,
|
|
1574
|
+
children: [
|
|
1575
|
+
/* @__PURE__ */ jsxs(
|
|
1576
|
+
"h2",
|
|
1577
|
+
{
|
|
1578
|
+
className: `text-xl font-semibold ${ui.text.strong} mb-4 flex items-center`,
|
|
1579
|
+
children: [
|
|
1580
|
+
/* @__PURE__ */ jsx(LanguageIcon, { className: "w-6 h-6 mr-2" }),
|
|
1581
|
+
text.languagesSectionTitle
|
|
1582
|
+
]
|
|
1583
|
+
}
|
|
1584
|
+
),
|
|
1585
|
+
/* @__PURE__ */ jsx("p", { className: `${ui.text.body} mb-6`, children: text.languagesDescription }),
|
|
1586
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4", children: languages.map((lang) => /* @__PURE__ */ jsxs(
|
|
1587
|
+
LinkComponent,
|
|
1588
|
+
{
|
|
1589
|
+
href: languageLinkPath ?? "/",
|
|
1590
|
+
language: lang.code,
|
|
1591
|
+
className: `flex items-center space-x-2 p-3 ${ui.background.surface} rounded-lg hover:shadow-md transition-shadow`,
|
|
1592
|
+
children: [
|
|
1593
|
+
/* @__PURE__ */ jsx("span", { className: "text-2xl", children: lang.flag }),
|
|
1594
|
+
/* @__PURE__ */ jsx("div", { className: `font-medium ${ui.text.strong}`, children: lang.name })
|
|
1595
|
+
]
|
|
1596
|
+
},
|
|
1597
|
+
lang.code
|
|
1598
|
+
)) })
|
|
1599
|
+
]
|
|
1600
|
+
}
|
|
1601
|
+
),
|
|
1590
1602
|
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8", children: sections.map((section, index) => /* @__PURE__ */ jsxs(
|
|
1591
1603
|
"div",
|
|
1592
1604
|
{
|
|
1593
|
-
className:
|
|
1605
|
+
className: `${ui.background.surface} rounded-lg shadow-sm p-6`,
|
|
1594
1606
|
children: [
|
|
1595
|
-
/* @__PURE__ */ jsxs(
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1607
|
+
/* @__PURE__ */ jsxs(
|
|
1608
|
+
"h2",
|
|
1609
|
+
{
|
|
1610
|
+
className: `text-lg font-semibold ${ui.text.strong} mb-4 flex items-center`,
|
|
1611
|
+
children: [
|
|
1612
|
+
getIcon(section.icon),
|
|
1613
|
+
section.title
|
|
1614
|
+
]
|
|
1615
|
+
}
|
|
1616
|
+
),
|
|
1599
1617
|
/* @__PURE__ */ jsx("ul", { className: "space-y-2", children: section.links.map((link, linkIndex) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
1600
1618
|
LinkComponent,
|
|
1601
1619
|
{
|
|
@@ -1614,16 +1632,18 @@ const AppSitemapPage = ({
|
|
|
1614
1632
|
},
|
|
1615
1633
|
index
|
|
1616
1634
|
)) }),
|
|
1617
|
-
quickLinks.length > 0 && /* @__PURE__ */ jsxs("div", { className:
|
|
1618
|
-
/* @__PURE__ */ jsx("h3", { className:
|
|
1635
|
+
quickLinks.length > 0 && /* @__PURE__ */ jsxs("div", { className: `mt-12 p-6 ${ui.background.subtle} rounded-lg`, children: [
|
|
1636
|
+
/* @__PURE__ */ jsx("h3", { className: `text-lg font-semibold ${ui.text.strong} mb-4`, children: text.quickLinksTitle }),
|
|
1619
1637
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-3", children: quickLinks.map((link, index) => {
|
|
1620
|
-
const baseClasses = "inline-flex items-center px-4 py-2 rounded-lg
|
|
1621
|
-
const variantClasses =
|
|
1638
|
+
const baseClasses = "inline-flex items-center px-4 py-2 rounded-lg";
|
|
1639
|
+
const variantClasses = buttonVariant(
|
|
1640
|
+
link.variant === "primary" ? "primary" : link.variant === "secondary" ? "secondary" : "outline"
|
|
1641
|
+
);
|
|
1622
1642
|
return /* @__PURE__ */ jsxs(
|
|
1623
1643
|
LinkComponent,
|
|
1624
1644
|
{
|
|
1625
1645
|
href: link.path,
|
|
1626
|
-
className:
|
|
1646
|
+
className: cn(baseClasses, variantClasses),
|
|
1627
1647
|
children: [
|
|
1628
1648
|
link.icon === "envelope" && /* @__PURE__ */ jsx(EnvelopeIcon, { className: "w-5 h-5 mr-2" }),
|
|
1629
1649
|
link.icon === "document" && /* @__PURE__ */ jsx(DocumentTextIcon, { className: "w-5 h-5 mr-2" }),
|
|
@@ -1646,13 +1666,13 @@ function isSectionWithList(section) {
|
|
|
1646
1666
|
function isSectionWithSubsections(section) {
|
|
1647
1667
|
return "subsections" in section && Array.isArray(section.subsections);
|
|
1648
1668
|
}
|
|
1649
|
-
const SectionHeading = ({ children }) => /* @__PURE__ */ jsx("h2", { className:
|
|
1650
|
-
const SubsectionHeading = ({ children }) => /* @__PURE__ */ jsx("h3", { className:
|
|
1669
|
+
const SectionHeading = ({ children }) => /* @__PURE__ */ jsx("h2", { className: `text-2xl font-bold ${ui.text.strong} mt-8 mb-4`, children });
|
|
1670
|
+
const SubsectionHeading = ({ children }) => /* @__PURE__ */ jsx("h3", { className: `text-xl font-semibold ${ui.text.strong} mt-6 mb-3`, children });
|
|
1651
1671
|
const Paragraph = ({
|
|
1652
1672
|
children,
|
|
1653
1673
|
className = ""
|
|
1654
|
-
}) => /* @__PURE__ */ jsx("p", { className:
|
|
1655
|
-
const List = ({ items }) => /* @__PURE__ */ jsx("ul", { className:
|
|
1674
|
+
}) => /* @__PURE__ */ jsx("p", { className: cn(ui.text.body, "mb-6", className), children });
|
|
1675
|
+
const List = ({ items }) => /* @__PURE__ */ jsx("ul", { className: `list-disc list-inside ${ui.text.body} mb-6 space-y-1`, children: items.map((item, index) => /* @__PURE__ */ jsx("li", { dangerouslySetInnerHTML: { __html: item } }, index)) });
|
|
1656
1676
|
const AppTextPage = ({
|
|
1657
1677
|
text,
|
|
1658
1678
|
lastUpdatedDate = (/* @__PURE__ */ new Date()).toLocaleDateString(),
|
|
@@ -1660,7 +1680,7 @@ const AppTextPage = ({
|
|
|
1660
1680
|
className
|
|
1661
1681
|
}) => {
|
|
1662
1682
|
const content = /* @__PURE__ */ jsxs(Section, { spacing: "3xl", maxWidth: "4xl", className: cn(className), children: [
|
|
1663
|
-
/* @__PURE__ */ jsx("h1", { className:
|
|
1683
|
+
/* @__PURE__ */ jsx("h1", { className: `text-4xl font-bold ${ui.text.strong} mb-8`, children: text.title }),
|
|
1664
1684
|
/* @__PURE__ */ jsxs("div", { className: "prose prose-lg dark:prose-invert max-w-none", children: [
|
|
1665
1685
|
text.lastUpdated && /* @__PURE__ */ jsx(Paragraph, { className: "mb-6", children: text.lastUpdated.replace("{{date}}", lastUpdatedDate) }),
|
|
1666
1686
|
text.sections.map((section, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
@@ -1694,28 +1714,21 @@ const AppTextPage = ({
|
|
|
1694
1714
|
dangerouslySetInnerHTML: { __html: text.contact.description }
|
|
1695
1715
|
}
|
|
1696
1716
|
) }) : /* @__PURE__ */ jsx(Paragraph, { children: text.contact.description }),
|
|
1697
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
1717
|
+
/* @__PURE__ */ jsx("div", { className: `${ui.background.subtle} p-4 rounded-lg`, children: /* @__PURE__ */ jsxs("p", { className: ui.text.body, children: [
|
|
1698
1718
|
text.contact.info.emailLabel,
|
|
1699
1719
|
" ",
|
|
1700
1720
|
/* @__PURE__ */ jsx(
|
|
1701
1721
|
"a",
|
|
1702
1722
|
{
|
|
1703
1723
|
href: `mailto:${text.contact.info.email}`,
|
|
1704
|
-
className:
|
|
1724
|
+
className: ui.text.link,
|
|
1705
1725
|
children: text.contact.info.email
|
|
1706
1726
|
}
|
|
1707
1727
|
),
|
|
1708
1728
|
/* @__PURE__ */ jsx("br", {}),
|
|
1709
1729
|
text.contact.info.websiteLabel,
|
|
1710
1730
|
" ",
|
|
1711
|
-
/* @__PURE__ */ jsx(
|
|
1712
|
-
"a",
|
|
1713
|
-
{
|
|
1714
|
-
href: text.contact.info.websiteUrl,
|
|
1715
|
-
className: "text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",
|
|
1716
|
-
children: text.contact.info.websiteUrl
|
|
1717
|
-
}
|
|
1718
|
-
),
|
|
1731
|
+
/* @__PURE__ */ jsx("a", { href: text.contact.info.websiteUrl, className: ui.text.link, children: text.contact.info.websiteUrl }),
|
|
1719
1732
|
text.contact.info.dpoLabel && text.contact.info.dpoEmail && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1720
1733
|
/* @__PURE__ */ jsx("br", {}),
|
|
1721
1734
|
text.contact.info.dpoLabel,
|
|
@@ -1724,27 +1737,33 @@ const AppTextPage = ({
|
|
|
1724
1737
|
"a",
|
|
1725
1738
|
{
|
|
1726
1739
|
href: `mailto:${text.contact.info.dpoEmail}`,
|
|
1727
|
-
className:
|
|
1740
|
+
className: ui.text.link,
|
|
1728
1741
|
children: text.contact.info.dpoEmail
|
|
1729
1742
|
}
|
|
1730
1743
|
)
|
|
1731
1744
|
] })
|
|
1732
1745
|
] }) }),
|
|
1733
|
-
text.contact.gdprNotice && /* @__PURE__ */ jsxs(
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
"
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1746
|
+
text.contact.gdprNotice && /* @__PURE__ */ jsxs(
|
|
1747
|
+
"div",
|
|
1748
|
+
{
|
|
1749
|
+
className: `mt-8 p-4 ${colors.component.alert.info.base} ${colors.component.alert.info.dark} rounded-lg`,
|
|
1750
|
+
children: [
|
|
1751
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-blue-900 dark:text-blue-200 mb-2", children: text.contact.gdprNotice.title }),
|
|
1752
|
+
/* @__PURE__ */ jsxs("p", { className: "text-blue-800 dark:text-blue-300", children: [
|
|
1753
|
+
text.contact.gdprNotice.content,
|
|
1754
|
+
" ",
|
|
1755
|
+
text.contact.info.dpoEmail && /* @__PURE__ */ jsx(
|
|
1756
|
+
"a",
|
|
1757
|
+
{
|
|
1758
|
+
href: `mailto:${text.contact.info.dpoEmail}`,
|
|
1759
|
+
className: ui.text.link,
|
|
1760
|
+
children: text.contact.info.dpoEmail
|
|
1761
|
+
}
|
|
1762
|
+
)
|
|
1763
|
+
] })
|
|
1764
|
+
]
|
|
1765
|
+
}
|
|
1766
|
+
)
|
|
1748
1767
|
] })
|
|
1749
1768
|
] })
|
|
1750
1769
|
] });
|
|
@@ -1806,52 +1825,31 @@ const USER_ACTION_ERROR_CODES = [
|
|
|
1806
1825
|
];
|
|
1807
1826
|
const colorVariantClasses = {
|
|
1808
1827
|
primary: {
|
|
1809
|
-
title: "text-
|
|
1810
|
-
|
|
1811
|
-
submitButton: "bg-primary-600 hover:bg-primary-700 focus:ring-primary-500 disabled:bg-primary-300",
|
|
1812
|
-
googleButtonFocusRing: "focus:ring-primary-500",
|
|
1813
|
-
toggleLink: "text-primary-600 hover:text-primary-500"
|
|
1828
|
+
title: "text-blue-600",
|
|
1829
|
+
toggleLink: "text-blue-600 hover:text-blue-500"
|
|
1814
1830
|
},
|
|
1815
1831
|
blue: {
|
|
1816
1832
|
title: "text-blue-600",
|
|
1817
|
-
inputFocus: "focus:ring-blue-500 focus:border-blue-500",
|
|
1818
|
-
submitButton: "bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 disabled:bg-blue-300",
|
|
1819
|
-
googleButtonFocusRing: "focus:ring-blue-500",
|
|
1820
1833
|
toggleLink: "text-blue-600 hover:text-blue-500"
|
|
1821
1834
|
},
|
|
1822
1835
|
indigo: {
|
|
1823
1836
|
title: "text-indigo-600",
|
|
1824
|
-
inputFocus: "focus:ring-indigo-500 focus:border-indigo-500",
|
|
1825
|
-
submitButton: "bg-indigo-600 hover:bg-indigo-700 focus:ring-indigo-500 disabled:bg-indigo-300",
|
|
1826
|
-
googleButtonFocusRing: "focus:ring-indigo-500",
|
|
1827
1837
|
toggleLink: "text-indigo-600 hover:text-indigo-500"
|
|
1828
1838
|
},
|
|
1829
1839
|
violet: {
|
|
1830
1840
|
title: "text-violet-600",
|
|
1831
|
-
inputFocus: "focus:ring-violet-500 focus:border-violet-500",
|
|
1832
|
-
submitButton: "bg-violet-600 hover:bg-violet-700 focus:ring-violet-500 disabled:bg-violet-300",
|
|
1833
|
-
googleButtonFocusRing: "focus:ring-violet-500",
|
|
1834
1841
|
toggleLink: "text-violet-600 hover:text-violet-500"
|
|
1835
1842
|
},
|
|
1836
1843
|
orange: {
|
|
1837
1844
|
title: "text-orange-600",
|
|
1838
|
-
inputFocus: "focus:ring-orange-500 focus:border-orange-500",
|
|
1839
|
-
submitButton: "bg-orange-600 hover:bg-orange-700 focus:ring-orange-500 disabled:bg-orange-300",
|
|
1840
|
-
googleButtonFocusRing: "focus:ring-orange-500",
|
|
1841
1845
|
toggleLink: "text-orange-600 hover:text-orange-500"
|
|
1842
1846
|
},
|
|
1843
1847
|
emerald: {
|
|
1844
1848
|
title: "text-emerald-600",
|
|
1845
|
-
inputFocus: "focus:ring-emerald-500 focus:border-emerald-500",
|
|
1846
|
-
submitButton: "bg-emerald-600 hover:bg-emerald-700 focus:ring-emerald-500 disabled:bg-emerald-300",
|
|
1847
|
-
googleButtonFocusRing: "focus:ring-emerald-500",
|
|
1848
1849
|
toggleLink: "text-emerald-600 hover:text-emerald-500"
|
|
1849
1850
|
},
|
|
1850
1851
|
rose: {
|
|
1851
1852
|
title: "text-rose-600",
|
|
1852
|
-
inputFocus: "focus:ring-rose-500 focus:border-rose-500",
|
|
1853
|
-
submitButton: "bg-rose-600 hover:bg-rose-700 focus:ring-rose-500 disabled:bg-rose-300",
|
|
1854
|
-
googleButtonFocusRing: "focus:ring-rose-500",
|
|
1855
1853
|
toggleLink: "text-rose-600 hover:text-rose-500"
|
|
1856
1854
|
}
|
|
1857
1855
|
};
|
|
@@ -1863,6 +1861,7 @@ function LoginPage({
|
|
|
1863
1861
|
onGoogleSignIn,
|
|
1864
1862
|
onSuccess,
|
|
1865
1863
|
onAuthError,
|
|
1864
|
+
text: textOverrides,
|
|
1866
1865
|
showGoogleSignIn = true,
|
|
1867
1866
|
showSignUp = true,
|
|
1868
1867
|
className = "",
|
|
@@ -1887,7 +1886,7 @@ function LoginPage({
|
|
|
1887
1886
|
const [isLoading, setIsLoading] = useState(false);
|
|
1888
1887
|
const [isGoogleSignInPending, setIsGoogleSignInPending] = useState(false);
|
|
1889
1888
|
const googleSignInStartTime = useRef(null);
|
|
1890
|
-
const colors = colorVariantClasses[colorVariant];
|
|
1889
|
+
const colors$1 = colorVariantClasses[colorVariant];
|
|
1891
1890
|
useEffect(() => {
|
|
1892
1891
|
const handleFocus = () => {
|
|
1893
1892
|
if (isGoogleSignInPending && googleSignInStartTime.current) {
|
|
@@ -1947,39 +1946,38 @@ function LoginPage({
|
|
|
1947
1946
|
googleSignInStartTime.current = null;
|
|
1948
1947
|
}
|
|
1949
1948
|
};
|
|
1950
|
-
const text = defaultText;
|
|
1949
|
+
const text = { ...defaultText, ...textOverrides };
|
|
1951
1950
|
return /* @__PURE__ */ jsx(
|
|
1952
1951
|
"div",
|
|
1953
1952
|
{
|
|
1954
1953
|
className: cn(
|
|
1955
|
-
|
|
1954
|
+
`min-h-screen flex items-center justify-center ${ui.background.subtle} py-12 px-4 sm:px-6 lg:px-8`,
|
|
1956
1955
|
className
|
|
1957
1956
|
),
|
|
1958
1957
|
children: /* @__PURE__ */ jsxs("div", { className: "max-w-md w-full space-y-8", children: [
|
|
1959
1958
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
1960
1959
|
logo && /* @__PURE__ */ jsx("div", { className: "flex justify-center mb-4", children: logo }),
|
|
1961
|
-
/* @__PURE__ */ jsx("h1", { className: cn("text-center text-3xl font-bold", colors.title), children: appName }),
|
|
1962
|
-
/* @__PURE__ */ jsx(
|
|
1960
|
+
/* @__PURE__ */ jsx("h1", { className: cn("text-center text-3xl font-bold", colors$1.title), children: appName }),
|
|
1961
|
+
/* @__PURE__ */ jsx(
|
|
1962
|
+
"h2",
|
|
1963
|
+
{
|
|
1964
|
+
className: `mt-6 text-center text-2xl font-semibold ${ui.text.strong}`,
|
|
1965
|
+
children: isSignUp && showSignUp ? text.createAccount : text.signInToAccount
|
|
1966
|
+
}
|
|
1967
|
+
)
|
|
1963
1968
|
] }),
|
|
1964
1969
|
/* @__PURE__ */ jsxs("form", { className: "mt-8 space-y-6", onSubmit: handleSubmit, children: [
|
|
1965
1970
|
error && /* @__PURE__ */ jsx(
|
|
1966
1971
|
"div",
|
|
1967
1972
|
{
|
|
1968
|
-
className:
|
|
1973
|
+
className: `${colors.component.alert.error.base} ${colors.component.alert.error.dark} border px-4 py-3 rounded-md text-sm`,
|
|
1969
1974
|
role: "alert",
|
|
1970
1975
|
children: error
|
|
1971
1976
|
}
|
|
1972
1977
|
),
|
|
1973
1978
|
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
1974
1979
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
1975
|
-
/* @__PURE__ */ jsx(
|
|
1976
|
-
"label",
|
|
1977
|
-
{
|
|
1978
|
-
htmlFor: "login-email",
|
|
1979
|
-
className: "block text-sm font-medium text-gray-700",
|
|
1980
|
-
children: text.emailLabel
|
|
1981
|
-
}
|
|
1982
|
-
),
|
|
1980
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "login-email", className: `block ${ui.text.label}`, children: text.emailLabel }),
|
|
1983
1981
|
/* @__PURE__ */ jsx(
|
|
1984
1982
|
"input",
|
|
1985
1983
|
{
|
|
@@ -1992,8 +1990,8 @@ function LoginPage({
|
|
|
1992
1990
|
onChange: (e) => setEmail(e.target.value),
|
|
1993
1991
|
placeholder: text.emailPlaceholder,
|
|
1994
1992
|
className: cn(
|
|
1995
|
-
|
|
1996
|
-
|
|
1993
|
+
`mt-1 appearance-none block w-full px-3 py-2 border rounded-md shadow-sm sm:text-sm ${colors.component.input.default.base} ${colors.component.input.default.dark}`,
|
|
1994
|
+
focusRing
|
|
1997
1995
|
)
|
|
1998
1996
|
}
|
|
1999
1997
|
)
|
|
@@ -2003,7 +2001,7 @@ function LoginPage({
|
|
|
2003
2001
|
"label",
|
|
2004
2002
|
{
|
|
2005
2003
|
htmlFor: "login-password",
|
|
2006
|
-
className:
|
|
2004
|
+
className: `block ${ui.text.label}`,
|
|
2007
2005
|
children: text.passwordLabel
|
|
2008
2006
|
}
|
|
2009
2007
|
),
|
|
@@ -2019,8 +2017,8 @@ function LoginPage({
|
|
|
2019
2017
|
onChange: (e) => setPassword(e.target.value),
|
|
2020
2018
|
placeholder: text.passwordPlaceholder,
|
|
2021
2019
|
className: cn(
|
|
2022
|
-
|
|
2023
|
-
|
|
2020
|
+
`mt-1 appearance-none block w-full px-3 py-2 border rounded-md shadow-sm sm:text-sm ${colors.component.input.default.base} ${colors.component.input.default.dark}`,
|
|
2021
|
+
focusRing
|
|
2024
2022
|
)
|
|
2025
2023
|
}
|
|
2026
2024
|
)
|
|
@@ -2032,8 +2030,9 @@ function LoginPage({
|
|
|
2032
2030
|
type: "submit",
|
|
2033
2031
|
disabled: isLoading,
|
|
2034
2032
|
className: cn(
|
|
2035
|
-
"w-full inline-flex items-center justify-center font-medium rounded-md
|
|
2036
|
-
|
|
2033
|
+
"w-full inline-flex items-center justify-center font-medium rounded-md px-4 py-2 text-sm",
|
|
2034
|
+
buttonVariant("primary"),
|
|
2035
|
+
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
2037
2036
|
),
|
|
2038
2037
|
children: [
|
|
2039
2038
|
isLoading && /* @__PURE__ */ jsxs(
|
|
@@ -2074,7 +2073,13 @@ function LoginPage({
|
|
|
2074
2073
|
showGoogleSignIn && onGoogleSignIn && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2075
2074
|
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
2076
2075
|
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ jsx("div", { className: "w-full border-t border-gray-300" }) }),
|
|
2077
|
-
/* @__PURE__ */ jsx("div", { className: "relative flex justify-center text-sm", children: /* @__PURE__ */ jsx(
|
|
2076
|
+
/* @__PURE__ */ jsx("div", { className: "relative flex justify-center text-sm", children: /* @__PURE__ */ jsx(
|
|
2077
|
+
"span",
|
|
2078
|
+
{
|
|
2079
|
+
className: `px-2 ${ui.background.subtle} ${ui.text.muted}`,
|
|
2080
|
+
children: text.orContinueWith
|
|
2081
|
+
}
|
|
2082
|
+
) })
|
|
2078
2083
|
] }),
|
|
2079
2084
|
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
|
|
2080
2085
|
"button",
|
|
@@ -2083,8 +2088,9 @@ function LoginPage({
|
|
|
2083
2088
|
onClick: handleGoogleSignIn,
|
|
2084
2089
|
disabled: isLoading,
|
|
2085
2090
|
className: cn(
|
|
2086
|
-
"w-full inline-flex items-center justify-center font-medium rounded-md
|
|
2087
|
-
|
|
2091
|
+
"w-full inline-flex items-center justify-center font-medium rounded-md px-4 py-2 text-sm",
|
|
2092
|
+
buttonVariant("outline"),
|
|
2093
|
+
`${ui.background.surface} ${ui.text.label} disabled:opacity-50 disabled:cursor-not-allowed`
|
|
2088
2094
|
),
|
|
2089
2095
|
children: [
|
|
2090
2096
|
isLoading ? /* @__PURE__ */ jsxs(
|
|
@@ -2124,7 +2130,7 @@ function LoginPage({
|
|
|
2124
2130
|
) })
|
|
2125
2131
|
] })
|
|
2126
2132
|
] }),
|
|
2127
|
-
showSignUp && /* @__PURE__ */ jsxs("p", { className:
|
|
2133
|
+
showSignUp && /* @__PURE__ */ jsxs("p", { className: `text-center text-sm ${ui.text.muted}`, children: [
|
|
2128
2134
|
isSignUp ? text.alreadyHaveAccount : text.dontHaveAccount,
|
|
2129
2135
|
" ",
|
|
2130
2136
|
/* @__PURE__ */ jsx(
|
|
@@ -2132,7 +2138,7 @@ function LoginPage({
|
|
|
2132
2138
|
{
|
|
2133
2139
|
type: "button",
|
|
2134
2140
|
onClick: () => setIsSignUp(!isSignUp),
|
|
2135
|
-
className: cn("font-medium", colors.toggleLink),
|
|
2141
|
+
className: cn("font-medium", colors$1.toggleLink),
|
|
2136
2142
|
children: isSignUp ? text.signIn : text.signUp
|
|
2137
2143
|
}
|
|
2138
2144
|
)
|
|
@@ -2147,13 +2153,25 @@ const EmptyState = ({
|
|
|
2147
2153
|
onPress
|
|
2148
2154
|
}) => {
|
|
2149
2155
|
return /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col items-center justify-center px-8", children: [
|
|
2150
|
-
/* @__PURE__ */ jsx(
|
|
2156
|
+
/* @__PURE__ */ jsx(
|
|
2157
|
+
"p",
|
|
2158
|
+
{
|
|
2159
|
+
className: cn(
|
|
2160
|
+
ui.text.muted,
|
|
2161
|
+
"text-center text-[15px] leading-relaxed mb-5"
|
|
2162
|
+
),
|
|
2163
|
+
children: message
|
|
2164
|
+
}
|
|
2165
|
+
),
|
|
2151
2166
|
/* @__PURE__ */ jsx(
|
|
2152
2167
|
"button",
|
|
2153
2168
|
{
|
|
2154
2169
|
type: "button",
|
|
2155
2170
|
onClick: onPress,
|
|
2156
|
-
className:
|
|
2171
|
+
className: cn(
|
|
2172
|
+
buttonVariant("primary"),
|
|
2173
|
+
"rounded-md px-6 py-2 text-sm font-medium min-h-[44px]"
|
|
2174
|
+
),
|
|
2157
2175
|
children: buttonLabel
|
|
2158
2176
|
}
|
|
2159
2177
|
)
|