@octaviaflow/core 3.1.0-beta.79 → 3.1.0-beta.81

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/index.js CHANGED
@@ -1186,6 +1186,7 @@ import {
1186
1186
  useId as useId4,
1187
1187
  useState as useState3
1188
1188
  } from "react";
1189
+ import { ArrowLeftIcon, CheckmarkFilledIcon } from "@octaviaflow/icons";
1189
1190
 
1190
1191
  // src/components/SocialButton/SocialButton.tsx
1191
1192
  import { LogoGithubIcon, LogoLinkedinIcon, LogoXIcon } from "@octaviaflow/icons";
@@ -1560,19 +1561,23 @@ function AuthFormHeader({ logo, title, titleId, description, headingLevel }) {
1560
1561
  description && /* @__PURE__ */ jsx6("p", { className: "ods-auth-form__desc", children: description })
1561
1562
  ] });
1562
1563
  }
1563
- function AuthFormSocial({ providers, onSocialClick, dividerLabel, disabled }) {
1564
+ function AuthFormSocial({ providers, onSocialClick, dividerLabel, disabled, position = "bottom" }) {
1564
1565
  if (!providers || providers.length === 0) return null;
1565
- return /* @__PURE__ */ jsxs6(Fragment4, { children: [
1566
+ const row = /* @__PURE__ */ jsx6("div", { className: "ods-auth-form__social", children: providers.map((provider) => /* @__PURE__ */ jsx6(
1567
+ SocialButton,
1568
+ {
1569
+ provider,
1570
+ disabled,
1571
+ onClick: () => onSocialClick?.(provider)
1572
+ },
1573
+ provider
1574
+ )) });
1575
+ return position === "top" ? /* @__PURE__ */ jsxs6(Fragment4, { children: [
1576
+ row,
1577
+ /* @__PURE__ */ jsx6(AuthDivider, { children: dividerLabel })
1578
+ ] }) : /* @__PURE__ */ jsxs6(Fragment4, { children: [
1566
1579
  /* @__PURE__ */ jsx6(AuthDivider, { children: dividerLabel }),
1567
- /* @__PURE__ */ jsx6("div", { className: "ods-auth-form__social", children: providers.map((provider) => /* @__PURE__ */ jsx6(
1568
- SocialButton,
1569
- {
1570
- provider,
1571
- disabled,
1572
- onClick: () => onSocialClick?.(provider)
1573
- },
1574
- provider
1575
- )) })
1580
+ row
1576
1581
  ] });
1577
1582
  }
1578
1583
  function AuthFormFooterLink({ prompt, label, href, onClick }) {
@@ -1605,6 +1610,7 @@ function AuthLoginForm({
1605
1610
  forgotLabel = "Forgot your password?",
1606
1611
  socialProviders = ["google"],
1607
1612
  onSocialClick,
1613
+ socialPosition = "bottom",
1608
1614
  socialDividerLabel = "Or, log in with",
1609
1615
  registerHref,
1610
1616
  onRegisterClick,
@@ -1646,6 +1652,16 @@ function AuthLoginForm({
1646
1652
  error && /* @__PURE__ */ jsx6(Banner, { variant: "error", children: error }),
1647
1653
  success && /* @__PURE__ */ jsx6(Banner, { variant: "success", children: success })
1648
1654
  ] }),
1655
+ socialPosition === "top" && /* @__PURE__ */ jsx6(
1656
+ AuthFormSocial,
1657
+ {
1658
+ providers: socialProviders,
1659
+ onSocialClick,
1660
+ dividerLabel: socialDividerLabel,
1661
+ disabled: loading,
1662
+ position: "top"
1663
+ }
1664
+ ),
1649
1665
  /* @__PURE__ */ jsxs6("div", { className: "ods-auth-form__fields", children: [
1650
1666
  /* @__PURE__ */ jsx6(
1651
1667
  Input,
@@ -1688,7 +1704,7 @@ function AuthLoginForm({
1688
1704
  hasForgot && (forgotHref ? /* @__PURE__ */ jsx6("a", { className: "ods-auth-form__link", href: forgotHref, onClick: onForgotClick, children: forgotLabel }) : /* @__PURE__ */ jsx6("button", { type: "button", className: "ods-auth-form__link", onClick: onForgotClick, children: forgotLabel }))
1689
1705
  ] }),
1690
1706
  /* @__PURE__ */ jsx6(Button, { type: "submit", variant: "primary", fullWidth: true, loading, children: submitLabel }),
1691
- /* @__PURE__ */ jsx6(
1707
+ socialPosition === "bottom" && /* @__PURE__ */ jsx6(
1692
1708
  AuthFormSocial,
1693
1709
  {
1694
1710
  providers: socialProviders,
@@ -1738,10 +1754,16 @@ function AuthSignupForm({
1738
1754
  passwordStrengthRules,
1739
1755
  submitLabel = "Create account",
1740
1756
  showTerms = true,
1741
- termsLabel = "I agree to the Terms of Service and Privacy Policy",
1757
+ termsLabel,
1758
+ termsHref = "https://octaviaflow.com/terms-and-conditions",
1759
+ privacyHref = "https://octaviaflow.com/privacy-policy",
1742
1760
  socialProviders = ["google"],
1743
1761
  onSocialClick,
1744
1762
  socialDividerLabel = "Or, sign up with",
1763
+ layout = "form-first",
1764
+ emailCtaLabel = "Sign up with email",
1765
+ backLabel = "Back to all options",
1766
+ highlights,
1745
1767
  signInHref,
1746
1768
  onSignInClick,
1747
1769
  signInPrompt = "Already have an account?",
@@ -1761,11 +1783,42 @@ function AuthSignupForm({
1761
1783
  const [isCompanyAccount, setIsCompanyAccount] = useState3(false);
1762
1784
  const [companyName, setCompanyName] = useState3("");
1763
1785
  const [domain, setDomain] = useState3("");
1786
+ const [entryMode, setEntryMode] = useState3("choice");
1787
+ const choiceScreen = layout === "choice-first" && entryMode === "choice";
1764
1788
  useEffect(() => {
1765
1789
  if (!showCompanyToggle || !isCompanyAccount || domain) return;
1766
1790
  const at = email.indexOf("@");
1767
1791
  if (at > -1 && at < email.length - 1) setDomain(email.slice(at + 1));
1768
1792
  }, [showCompanyToggle, isCompanyAccount, email, domain]);
1793
+ const termsContent = termsLabel ?? /* @__PURE__ */ jsxs6(Fragment4, { children: [
1794
+ "I agree to the",
1795
+ " ",
1796
+ /* @__PURE__ */ jsx6(
1797
+ "a",
1798
+ {
1799
+ className: "ods-auth-form__terms-link",
1800
+ href: termsHref,
1801
+ target: "_blank",
1802
+ rel: "noopener noreferrer",
1803
+ onClick: (e) => e.stopPropagation(),
1804
+ children: "Terms of Service"
1805
+ }
1806
+ ),
1807
+ " ",
1808
+ "and",
1809
+ " ",
1810
+ /* @__PURE__ */ jsx6(
1811
+ "a",
1812
+ {
1813
+ className: "ods-auth-form__terms-link",
1814
+ href: privacyHref,
1815
+ target: "_blank",
1816
+ rel: "noopener noreferrer",
1817
+ onClick: (e) => e.stopPropagation(),
1818
+ children: "Privacy Policy"
1819
+ }
1820
+ )
1821
+ ] });
1769
1822
  const handleSubmit = (event) => {
1770
1823
  event.preventDefault();
1771
1824
  const combinedName = nameLayout === "split" ? `${firstName} ${lastName}`.trim() : name;
@@ -1801,138 +1854,183 @@ function AuthSignupForm({
1801
1854
  error && /* @__PURE__ */ jsx6(Banner, { variant: "error", children: error }),
1802
1855
  success && /* @__PURE__ */ jsx6(Banner, { variant: "success", children: success })
1803
1856
  ] }),
1804
- /* @__PURE__ */ jsxs6("div", { className: "ods-auth-form__fields", children: [
1805
- nameLayout === "split" ? /* @__PURE__ */ jsxs6("div", { className: "ods-auth-form__grid2", children: [
1806
- /* @__PURE__ */ jsx6(
1857
+ choiceScreen && /* @__PURE__ */ jsxs6("div", { className: "ods-auth-form__choice", children: [
1858
+ /* @__PURE__ */ jsx6("div", { className: "ods-auth-form__social", children: (socialProviders ?? []).map((provider) => /* @__PURE__ */ jsx6(
1859
+ SocialButton,
1860
+ {
1861
+ provider,
1862
+ disabled: loading,
1863
+ onClick: () => onSocialClick?.(provider)
1864
+ },
1865
+ provider
1866
+ )) }),
1867
+ /* @__PURE__ */ jsx6(AuthDivider, { children: "or" }),
1868
+ /* @__PURE__ */ jsx6(
1869
+ Button,
1870
+ {
1871
+ type: "button",
1872
+ variant: "secondary",
1873
+ fullWidth: true,
1874
+ disabled: loading,
1875
+ onClick: () => setEntryMode("email"),
1876
+ children: emailCtaLabel
1877
+ }
1878
+ ),
1879
+ highlights && highlights.length > 0 && /* @__PURE__ */ jsx6("ul", { className: "ods-auth-form__highlights", children: highlights.map((item, i) => (
1880
+ // biome-ignore lint/suspicious/noArrayIndexKey: static copy row
1881
+ /* @__PURE__ */ jsxs6("li", { children: [
1882
+ /* @__PURE__ */ jsx6(CheckmarkFilledIcon, { size: "sm", "aria-hidden": "true" }),
1883
+ item
1884
+ ] }, i)
1885
+ )) })
1886
+ ] }),
1887
+ !choiceScreen && /* @__PURE__ */ jsxs6(Fragment4, { children: [
1888
+ layout === "choice-first" && /* @__PURE__ */ jsxs6(
1889
+ "button",
1890
+ {
1891
+ type: "button",
1892
+ className: "ods-auth-form__back",
1893
+ onClick: () => setEntryMode("choice"),
1894
+ disabled: loading,
1895
+ children: [
1896
+ /* @__PURE__ */ jsx6(ArrowLeftIcon, { size: "sm", "aria-hidden": "true" }),
1897
+ backLabel
1898
+ ]
1899
+ }
1900
+ ),
1901
+ /* @__PURE__ */ jsxs6("div", { className: "ods-auth-form__fields", children: [
1902
+ nameLayout === "split" ? /* @__PURE__ */ jsxs6("div", { className: "ods-auth-form__grid2", children: [
1903
+ /* @__PURE__ */ jsx6(
1904
+ Input,
1905
+ {
1906
+ label: firstNameLabel,
1907
+ type: "text",
1908
+ name: "firstName",
1909
+ autoComplete: "given-name",
1910
+ required: true,
1911
+ placeholder: firstNamePlaceholder,
1912
+ value: firstName,
1913
+ onChange: (e) => setFirstName(e.target.value),
1914
+ disabled: loading
1915
+ }
1916
+ ),
1917
+ /* @__PURE__ */ jsx6(
1918
+ Input,
1919
+ {
1920
+ label: lastNameLabel,
1921
+ type: "text",
1922
+ name: "lastName",
1923
+ autoComplete: "family-name",
1924
+ required: true,
1925
+ placeholder: lastNamePlaceholder,
1926
+ value: lastName,
1927
+ onChange: (e) => setLastName(e.target.value),
1928
+ disabled: loading
1929
+ }
1930
+ )
1931
+ ] }) : /* @__PURE__ */ jsx6(
1807
1932
  Input,
1808
1933
  {
1809
- label: firstNameLabel,
1934
+ label: nameLabel,
1810
1935
  type: "text",
1811
- name: "firstName",
1812
- autoComplete: "given-name",
1936
+ name: "name",
1937
+ autoComplete: "name",
1813
1938
  required: true,
1814
- placeholder: firstNamePlaceholder,
1815
- value: firstName,
1816
- onChange: (e) => setFirstName(e.target.value),
1939
+ placeholder: namePlaceholder,
1940
+ value: name,
1941
+ onChange: (e) => setName(e.target.value),
1817
1942
  disabled: loading
1818
1943
  }
1819
1944
  ),
1820
1945
  /* @__PURE__ */ jsx6(
1821
1946
  Input,
1822
1947
  {
1823
- label: lastNameLabel,
1824
- type: "text",
1825
- name: "lastName",
1826
- autoComplete: "family-name",
1948
+ label: emailLabel,
1949
+ type: "email",
1950
+ name: "email",
1951
+ autoComplete: "email",
1952
+ required: true,
1953
+ placeholder: emailPlaceholder,
1954
+ value: email,
1955
+ onChange: (e) => setEmail(e.target.value),
1956
+ disabled: loading
1957
+ }
1958
+ ),
1959
+ /* @__PURE__ */ jsx6(
1960
+ PasswordInput,
1961
+ {
1962
+ label: passwordLabel,
1963
+ name: "password",
1964
+ autoComplete: "new-password",
1827
1965
  required: true,
1828
- placeholder: lastNamePlaceholder,
1829
- value: lastName,
1830
- onChange: (e) => setLastName(e.target.value),
1966
+ placeholder: passwordPlaceholder,
1967
+ value: password,
1968
+ onChange: setPassword,
1969
+ strengthRules: passwordStrengthRules,
1831
1970
  disabled: loading
1832
1971
  }
1833
1972
  )
1834
- ] }) : /* @__PURE__ */ jsx6(
1835
- Input,
1836
- {
1837
- label: nameLabel,
1838
- type: "text",
1839
- name: "name",
1840
- autoComplete: "name",
1841
- required: true,
1842
- placeholder: namePlaceholder,
1843
- value: name,
1844
- onChange: (e) => setName(e.target.value),
1845
- disabled: loading
1846
- }
1847
- ),
1848
- /* @__PURE__ */ jsx6(
1849
- Input,
1973
+ ] }),
1974
+ showCompanyToggle && /* @__PURE__ */ jsxs6(Fragment4, { children: [
1975
+ /* @__PURE__ */ jsx6(
1976
+ Checkbox,
1977
+ {
1978
+ label: companyToggleLabel,
1979
+ checked: isCompanyAccount,
1980
+ onChange: setIsCompanyAccount,
1981
+ disabled: loading
1982
+ }
1983
+ ),
1984
+ isCompanyAccount && /* @__PURE__ */ jsxs6("div", { className: "ods-auth-form__grid2", children: [
1985
+ /* @__PURE__ */ jsx6(
1986
+ Input,
1987
+ {
1988
+ label: companyNameLabel,
1989
+ type: "text",
1990
+ name: "companyName",
1991
+ autoComplete: "organization",
1992
+ required: true,
1993
+ placeholder: companyNamePlaceholder,
1994
+ value: companyName,
1995
+ onChange: (e) => setCompanyName(e.target.value),
1996
+ disabled: loading
1997
+ }
1998
+ ),
1999
+ /* @__PURE__ */ jsx6(
2000
+ Input,
2001
+ {
2002
+ label: domainLabel,
2003
+ type: "text",
2004
+ name: "domain",
2005
+ placeholder: domainPlaceholder,
2006
+ value: domain,
2007
+ onChange: (e) => setDomain(e.target.value),
2008
+ disabled: loading
2009
+ }
2010
+ )
2011
+ ] })
2012
+ ] }),
2013
+ showTerms && /* @__PURE__ */ jsx6(
2014
+ Checkbox,
1850
2015
  {
1851
- label: emailLabel,
1852
- type: "email",
1853
- name: "email",
1854
- autoComplete: "email",
2016
+ label: termsContent,
2017
+ checked: acceptTerms,
2018
+ onChange: setAcceptTerms,
1855
2019
  required: true,
1856
- placeholder: emailPlaceholder,
1857
- value: email,
1858
- onChange: (e) => setEmail(e.target.value),
1859
2020
  disabled: loading
1860
2021
  }
1861
2022
  ),
1862
- /* @__PURE__ */ jsx6(
1863
- PasswordInput,
2023
+ /* @__PURE__ */ jsx6(Button, { type: "submit", variant: "primary", fullWidth: true, loading, children: submitLabel }),
2024
+ layout === "form-first" && /* @__PURE__ */ jsx6(
2025
+ AuthFormSocial,
1864
2026
  {
1865
- label: passwordLabel,
1866
- name: "password",
1867
- autoComplete: "new-password",
1868
- required: true,
1869
- placeholder: passwordPlaceholder,
1870
- value: password,
1871
- onChange: setPassword,
1872
- strengthRules: passwordStrengthRules,
2027
+ providers: socialProviders,
2028
+ onSocialClick,
2029
+ dividerLabel: socialDividerLabel,
1873
2030
  disabled: loading
1874
2031
  }
1875
2032
  )
1876
2033
  ] }),
1877
- showCompanyToggle && /* @__PURE__ */ jsxs6(Fragment4, { children: [
1878
- /* @__PURE__ */ jsx6(
1879
- Checkbox,
1880
- {
1881
- label: companyToggleLabel,
1882
- checked: isCompanyAccount,
1883
- onChange: setIsCompanyAccount,
1884
- disabled: loading
1885
- }
1886
- ),
1887
- isCompanyAccount && /* @__PURE__ */ jsxs6("div", { className: "ods-auth-form__grid2", children: [
1888
- /* @__PURE__ */ jsx6(
1889
- Input,
1890
- {
1891
- label: companyNameLabel,
1892
- type: "text",
1893
- name: "companyName",
1894
- autoComplete: "organization",
1895
- required: true,
1896
- placeholder: companyNamePlaceholder,
1897
- value: companyName,
1898
- onChange: (e) => setCompanyName(e.target.value),
1899
- disabled: loading
1900
- }
1901
- ),
1902
- /* @__PURE__ */ jsx6(
1903
- Input,
1904
- {
1905
- label: domainLabel,
1906
- type: "text",
1907
- name: "domain",
1908
- placeholder: domainPlaceholder,
1909
- value: domain,
1910
- onChange: (e) => setDomain(e.target.value),
1911
- disabled: loading
1912
- }
1913
- )
1914
- ] })
1915
- ] }),
1916
- showTerms && /* @__PURE__ */ jsx6(
1917
- Checkbox,
1918
- {
1919
- label: termsLabel,
1920
- checked: acceptTerms,
1921
- onChange: setAcceptTerms,
1922
- required: true,
1923
- disabled: loading
1924
- }
1925
- ),
1926
- /* @__PURE__ */ jsx6(Button, { type: "submit", variant: "primary", fullWidth: true, loading, children: submitLabel }),
1927
- /* @__PURE__ */ jsx6(
1928
- AuthFormSocial,
1929
- {
1930
- providers: socialProviders,
1931
- onSocialClick,
1932
- dividerLabel: socialDividerLabel,
1933
- disabled: loading
1934
- }
1935
- ),
1936
2034
  footer ?? /* @__PURE__ */ jsx6(
1937
2035
  AuthFormFooterLink,
1938
2036
  {
@@ -15670,7 +15768,7 @@ function FlowCanvas2({
15670
15768
  // src/components/FlowDoctor/FlowDoctor.tsx
15671
15769
  import {
15672
15770
  ArrowRightIcon as ArrowRightIcon3,
15673
- CheckmarkFilledIcon,
15771
+ CheckmarkFilledIcon as CheckmarkFilledIcon2,
15674
15772
  CheckmarkIcon as CheckmarkIcon8,
15675
15773
  ErrorFilledIcon,
15676
15774
  StethoscopeIcon,
@@ -15692,7 +15790,7 @@ function flowDoctorSummary(issues) {
15692
15790
  ].filter(Boolean).join(", ");
15693
15791
  }
15694
15792
  var VERDICT_ICON = {
15695
- clean: /* @__PURE__ */ jsx66(CheckmarkFilledIcon, { size: "md", "aria-hidden": "true" }),
15793
+ clean: /* @__PURE__ */ jsx66(CheckmarkFilledIcon2, { size: "md", "aria-hidden": "true" }),
15696
15794
  warning: /* @__PURE__ */ jsx66(WarningFilledIcon, { size: "md", "aria-hidden": "true" }),
15697
15795
  error: /* @__PURE__ */ jsx66(ErrorFilledIcon, { size: "md", "aria-hidden": "true" })
15698
15796
  };