@shipfox/client-auth 4.0.0 → 5.0.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.
Files changed (84) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +13 -0
  3. package/dist/components/email-code-verification.d.ts.map +1 -1
  4. package/dist/components/email-code-verification.js +1 -1
  5. package/dist/components/email-code-verification.js.map +1 -1
  6. package/dist/components/workspace-switcher.stories.d.ts +1 -1
  7. package/dist/continuation.d.ts +1 -1
  8. package/dist/continuation.d.ts.map +1 -1
  9. package/dist/continuation.js +1 -1
  10. package/dist/continuation.js.map +1 -1
  11. package/dist/hooks/api/auth-mapper.d.ts +21 -0
  12. package/dist/hooks/api/auth-mapper.d.ts.map +1 -0
  13. package/dist/hooks/api/auth-mapper.js +25 -0
  14. package/dist/hooks/api/auth-mapper.js.map +1 -0
  15. package/dist/hooks/api/login-auth.d.ts +3 -25
  16. package/dist/hooks/api/login-auth.d.ts.map +1 -1
  17. package/dist/hooks/api/login-auth.js +5 -2
  18. package/dist/hooks/api/login-auth.js.map +1 -1
  19. package/dist/hooks/api/password-reset-auth.d.ts +3 -25
  20. package/dist/hooks/api/password-reset-auth.d.ts.map +1 -1
  21. package/dist/hooks/api/password-reset-auth.js +5 -2
  22. package/dist/hooks/api/password-reset-auth.js.map +1 -1
  23. package/dist/hooks/api/signup-auth.d.ts +1 -25
  24. package/dist/hooks/api/signup-auth.d.ts.map +1 -1
  25. package/dist/hooks/api/signup-auth.js +5 -2
  26. package/dist/hooks/api/signup-auth.js.map +1 -1
  27. package/dist/hooks/api/verify-email-auth.d.ts +1 -12
  28. package/dist/hooks/api/verify-email-auth.d.ts.map +1 -1
  29. package/dist/hooks/api/verify-email-auth.js +6 -3
  30. package/dist/hooks/api/verify-email-auth.js.map +1 -1
  31. package/dist/hooks/api/workspace-auth.d.ts +3 -17
  32. package/dist/hooks/api/workspace-auth.d.ts.map +1 -1
  33. package/dist/hooks/api/workspace-auth.js +5 -2
  34. package/dist/hooks/api/workspace-auth.js.map +1 -1
  35. package/dist/hooks/api/workspace-mapper.d.ts +8 -0
  36. package/dist/hooks/api/workspace-mapper.d.ts.map +1 -0
  37. package/dist/hooks/api/workspace-mapper.js +9 -0
  38. package/dist/hooks/api/workspace-mapper.js.map +1 -0
  39. package/dist/index.d.ts +0 -1
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +0 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist/pages/invitation-context.d.ts +9 -14
  44. package/dist/pages/invitation-context.d.ts.map +1 -1
  45. package/dist/pages/invitation-context.js +4 -27
  46. package/dist/pages/invitation-context.js.map +1 -1
  47. package/dist/pages/login-page.js +2 -2
  48. package/dist/pages/login-page.js.map +1 -1
  49. package/dist/pages/logout-page.js +1 -1
  50. package/dist/pages/logout-page.js.map +1 -1
  51. package/dist/pages/password-reset-page.d.ts.map +1 -1
  52. package/dist/pages/password-reset-page.js +1 -4
  53. package/dist/pages/password-reset-page.js.map +1 -1
  54. package/dist/pages/signup-page.js +9 -9
  55. package/dist/pages/signup-page.js.map +1 -1
  56. package/dist/tsconfig.test.tsbuildinfo +1 -1
  57. package/package.json +4 -3
  58. package/src/components/email-code-verification.tsx +1 -1
  59. package/src/continuation.ts +1 -1
  60. package/src/hooks/api/auth-mapper.test.ts +77 -0
  61. package/src/hooks/api/auth-mapper.ts +39 -0
  62. package/src/hooks/api/login-auth.test.ts +1 -1
  63. package/src/hooks/api/login-auth.ts +8 -3
  64. package/src/hooks/api/password-reset-auth.test.ts +1 -1
  65. package/src/hooks/api/password-reset-auth.ts +15 -9
  66. package/src/hooks/api/signup-auth.ts +8 -3
  67. package/src/hooks/api/verify-email-auth.ts +17 -11
  68. package/src/hooks/api/workspace-auth.ts +8 -3
  69. package/src/hooks/api/workspace-mapper.test.ts +21 -0
  70. package/src/hooks/api/workspace-mapper.ts +11 -0
  71. package/src/index.ts +0 -1
  72. package/src/pages/invitation-context.ts +8 -31
  73. package/src/pages/login-page.test.tsx +1 -1
  74. package/src/pages/login-page.tsx +2 -2
  75. package/src/pages/logout-page.tsx +1 -1
  76. package/src/pages/password-reset-page.tsx +1 -4
  77. package/src/pages/signup-page.test.tsx +1 -1
  78. package/src/pages/signup-page.tsx +9 -9
  79. package/tsconfig.build.tsbuildinfo +1 -1
  80. package/dist/components/auth-shell.d.ts +0 -13
  81. package/dist/components/auth-shell.d.ts.map +0 -1
  82. package/dist/components/auth-shell.js +0 -68
  83. package/dist/components/auth-shell.js.map +0 -1
  84. package/src/components/auth-shell.tsx +0 -68
@@ -1,13 +0,0 @@
1
- import { type HeaderProps } from '@shipfox/react-ui/typography';
2
- import type { PropsWithChildren, ReactNode, Ref } from 'react';
3
- export interface AuthShellProps {
4
- title: string;
5
- description: string;
6
- children: ReactNode;
7
- className?: string;
8
- headingProps?: Omit<HeaderProps, 'children' | 'id'> | undefined;
9
- headingRef?: Ref<HTMLHeadingElement> | undefined;
10
- }
11
- export declare function AuthShell({ title, description, children, className, headingProps, headingRef, }: AuthShellProps): import("react").JSX.Element;
12
- export declare function AuthActions({ children }: PropsWithChildren): import("react").JSX.Element;
13
- //# sourceMappingURL=auth-shell.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-shell.d.ts","sourceRoot":"","sources":["../../src/components/auth-shell.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,WAAW,EAAO,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAC,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAC,MAAM,OAAO,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IAChE,UAAU,CAAC,EAAE,GAAG,CAAC,kBAAkB,CAAC,GAAG,SAAS,CAAC;CAClD;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,GACX,EAAE,cAAc,+BA2ChB;AAED,wBAAgB,WAAW,CAAC,EAAC,QAAQ,EAAC,EAAE,iBAAiB,+BAExD"}
@@ -1,68 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Icon } from '@shipfox/react-ui/icon';
3
- import { Header, Text } from '@shipfox/react-ui/typography';
4
- export function AuthShell({ title, description, children, className, headingProps, headingRef }) {
5
- return /*#__PURE__*/ _jsxs("main", {
6
- className: "relative flex min-h-screen items-center justify-center overflow-hidden bg-background-subtle-base px-24 py-32 max-[520px]:items-start max-[520px]:px-20 max-[520px]:pb-32 max-[520px]:pt-56",
7
- children: [
8
- /*#__PURE__*/ _jsx("div", {
9
- className: "pointer-events-none absolute left-1/2 top-0 h-[380px] w-full max-w-[880px] -translate-x-1/2 -translate-y-[120px] opacity-55 max-[520px]:-translate-y-[170px] max-[520px]:opacity-35",
10
- "aria-hidden": "true",
11
- style: {
12
- maskImage: 'radial-gradient(ellipse 85% 100% at 50% 0%, #000 0%, #000 24%, transparent 78%)',
13
- WebkitMaskImage: 'radial-gradient(ellipse 85% 100% at 50% 0%, #000 0%, #000 24%, transparent 78%)'
14
- },
15
- children: /*#__PURE__*/ _jsx("div", {
16
- className: "h-full w-full bg-[radial-gradient(circle,rgba(230,62,0,0.48)_1.6px,transparent_1.8px)] bg-[length:44px_44px]"
17
- })
18
- }),
19
- /*#__PURE__*/ _jsxs("section", {
20
- className: className ?? 'relative flex w-full max-w-[384px] flex-col items-stretch gap-28',
21
- "aria-labelledby": "auth-title",
22
- children: [
23
- /*#__PURE__*/ _jsxs("div", {
24
- className: "flex flex-col items-center gap-16",
25
- children: [
26
- /*#__PURE__*/ _jsx("div", {
27
- className: "flex size-64 items-center justify-center rounded-12 border border-border-neutral-base bg-background-neutral-base p-10 shadow-button-neutral",
28
- children: /*#__PURE__*/ _jsx(Icon, {
29
- name: "shipfox",
30
- className: "size-42 text-background-highlight-interactive"
31
- })
32
- }),
33
- /*#__PURE__*/ _jsxs("div", {
34
- className: "flex min-w-[128px] flex-col items-center gap-4 text-center",
35
- children: [
36
- /*#__PURE__*/ _jsx(Header, {
37
- id: "auth-title",
38
- variant: "h1",
39
- tabIndex: -1,
40
- ...headingProps,
41
- ...headingRef ? {
42
- ref: headingRef
43
- } : {},
44
- children: title
45
- }),
46
- /*#__PURE__*/ _jsx(Text, {
47
- size: "sm",
48
- className: "text-foreground-neutral-subtle",
49
- children: description
50
- })
51
- ]
52
- })
53
- ]
54
- }),
55
- children
56
- ]
57
- })
58
- ]
59
- });
60
- }
61
- export function AuthActions({ children }) {
62
- return /*#__PURE__*/ _jsx("div", {
63
- className: "flex flex-col gap-20",
64
- children: children
65
- });
66
- }
67
-
68
- //# sourceMappingURL=auth-shell.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/auth-shell.tsx"],"sourcesContent":["import {Icon} from '@shipfox/react-ui/icon';\nimport {Header, type HeaderProps, Text} from '@shipfox/react-ui/typography';\nimport type {PropsWithChildren, ReactNode, Ref} from 'react';\n\nexport interface AuthShellProps {\n title: string;\n description: string;\n children: ReactNode;\n className?: string;\n headingProps?: Omit<HeaderProps, 'children' | 'id'> | undefined;\n headingRef?: Ref<HTMLHeadingElement> | undefined;\n}\n\nexport function AuthShell({\n title,\n description,\n children,\n className,\n headingProps,\n headingRef,\n}: AuthShellProps) {\n return (\n <main className=\"relative flex min-h-screen items-center justify-center overflow-hidden bg-background-subtle-base px-24 py-32 max-[520px]:items-start max-[520px]:px-20 max-[520px]:pb-32 max-[520px]:pt-56\">\n <div\n className=\"pointer-events-none absolute left-1/2 top-0 h-[380px] w-full max-w-[880px] -translate-x-1/2 -translate-y-[120px] opacity-55 max-[520px]:-translate-y-[170px] max-[520px]:opacity-35\"\n aria-hidden=\"true\"\n style={{\n maskImage:\n 'radial-gradient(ellipse 85% 100% at 50% 0%, #000 0%, #000 24%, transparent 78%)',\n WebkitMaskImage:\n 'radial-gradient(ellipse 85% 100% at 50% 0%, #000 0%, #000 24%, transparent 78%)',\n }}\n >\n <div className=\"h-full w-full bg-[radial-gradient(circle,rgba(230,62,0,0.48)_1.6px,transparent_1.8px)] bg-[length:44px_44px]\" />\n </div>\n\n <section\n className={className ?? 'relative flex w-full max-w-[384px] flex-col items-stretch gap-28'}\n aria-labelledby=\"auth-title\"\n >\n <div className=\"flex flex-col items-center gap-16\">\n <div className=\"flex size-64 items-center justify-center rounded-12 border border-border-neutral-base bg-background-neutral-base p-10 shadow-button-neutral\">\n <Icon name=\"shipfox\" className=\"size-42 text-background-highlight-interactive\" />\n </div>\n <div className=\"flex min-w-[128px] flex-col items-center gap-4 text-center\">\n <Header\n id=\"auth-title\"\n variant=\"h1\"\n tabIndex={-1}\n {...headingProps}\n {...(headingRef ? ({ref: headingRef} as HeaderProps) : {})}\n >\n {title}\n </Header>\n <Text size=\"sm\" className=\"text-foreground-neutral-subtle\">\n {description}\n </Text>\n </div>\n </div>\n {children}\n </section>\n </main>\n );\n}\n\nexport function AuthActions({children}: PropsWithChildren) {\n return <div className=\"flex flex-col gap-20\">{children}</div>;\n}\n"],"names":["Icon","Header","Text","AuthShell","title","description","children","className","headingProps","headingRef","main","div","aria-hidden","style","maskImage","WebkitMaskImage","section","aria-labelledby","name","id","variant","tabIndex","ref","size","AuthActions"],"mappings":";AAAA,SAAQA,IAAI,QAAO,yBAAyB;AAC5C,SAAQC,MAAM,EAAoBC,IAAI,QAAO,+BAA+B;AAY5E,OAAO,SAASC,UAAU,EACxBC,KAAK,EACLC,WAAW,EACXC,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZC,UAAU,EACK;IACf,qBACE,MAACC;QAAKH,WAAU;;0BACd,KAACI;gBACCJ,WAAU;gBACVK,eAAY;gBACZC,OAAO;oBACLC,WACE;oBACFC,iBACE;gBACJ;0BAEA,cAAA,KAACJ;oBAAIJ,WAAU;;;0BAGjB,MAACS;gBACCT,WAAWA,aAAa;gBACxBU,mBAAgB;;kCAEhB,MAACN;wBAAIJ,WAAU;;0CACb,KAACI;gCAAIJ,WAAU;0CACb,cAAA,KAACP;oCAAKkB,MAAK;oCAAUX,WAAU;;;0CAEjC,MAACI;gCAAIJ,WAAU;;kDACb,KAACN;wCACCkB,IAAG;wCACHC,SAAQ;wCACRC,UAAU,CAAC;wCACV,GAAGb,YAAY;wCACf,GAAIC,aAAc;4CAACa,KAAKb;wCAAU,IAAoB,CAAC,CAAC;kDAExDL;;kDAEH,KAACF;wCAAKqB,MAAK;wCAAKhB,WAAU;kDACvBF;;;;;;oBAINC;;;;;AAIT;AAEA,OAAO,SAASkB,YAAY,EAAClB,QAAQ,EAAoB;IACvD,qBAAO,KAACK;QAAIJ,WAAU;kBAAwBD;;AAChD"}
@@ -1,68 +0,0 @@
1
- import {Icon} from '@shipfox/react-ui/icon';
2
- import {Header, type HeaderProps, Text} from '@shipfox/react-ui/typography';
3
- import type {PropsWithChildren, ReactNode, Ref} from 'react';
4
-
5
- export interface AuthShellProps {
6
- title: string;
7
- description: string;
8
- children: ReactNode;
9
- className?: string;
10
- headingProps?: Omit<HeaderProps, 'children' | 'id'> | undefined;
11
- headingRef?: Ref<HTMLHeadingElement> | undefined;
12
- }
13
-
14
- export function AuthShell({
15
- title,
16
- description,
17
- children,
18
- className,
19
- headingProps,
20
- headingRef,
21
- }: AuthShellProps) {
22
- return (
23
- <main className="relative flex min-h-screen items-center justify-center overflow-hidden bg-background-subtle-base px-24 py-32 max-[520px]:items-start max-[520px]:px-20 max-[520px]:pb-32 max-[520px]:pt-56">
24
- <div
25
- className="pointer-events-none absolute left-1/2 top-0 h-[380px] w-full max-w-[880px] -translate-x-1/2 -translate-y-[120px] opacity-55 max-[520px]:-translate-y-[170px] max-[520px]:opacity-35"
26
- aria-hidden="true"
27
- style={{
28
- maskImage:
29
- 'radial-gradient(ellipse 85% 100% at 50% 0%, #000 0%, #000 24%, transparent 78%)',
30
- WebkitMaskImage:
31
- 'radial-gradient(ellipse 85% 100% at 50% 0%, #000 0%, #000 24%, transparent 78%)',
32
- }}
33
- >
34
- <div className="h-full w-full bg-[radial-gradient(circle,rgba(230,62,0,0.48)_1.6px,transparent_1.8px)] bg-[length:44px_44px]" />
35
- </div>
36
-
37
- <section
38
- className={className ?? 'relative flex w-full max-w-[384px] flex-col items-stretch gap-28'}
39
- aria-labelledby="auth-title"
40
- >
41
- <div className="flex flex-col items-center gap-16">
42
- <div className="flex size-64 items-center justify-center rounded-12 border border-border-neutral-base bg-background-neutral-base p-10 shadow-button-neutral">
43
- <Icon name="shipfox" className="size-42 text-background-highlight-interactive" />
44
- </div>
45
- <div className="flex min-w-[128px] flex-col items-center gap-4 text-center">
46
- <Header
47
- id="auth-title"
48
- variant="h1"
49
- tabIndex={-1}
50
- {...headingProps}
51
- {...(headingRef ? ({ref: headingRef} as HeaderProps) : {})}
52
- >
53
- {title}
54
- </Header>
55
- <Text size="sm" className="text-foreground-neutral-subtle">
56
- {description}
57
- </Text>
58
- </div>
59
- </div>
60
- {children}
61
- </section>
62
- </main>
63
- );
64
- }
65
-
66
- export function AuthActions({children}: PropsWithChildren) {
67
- return <div className="flex flex-col gap-20">{children}</div>;
68
- }