@ikonai/sdk-react-ui 1.1.1 → 1.3.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 (73) hide show
  1. package/app/use-ikon-app.d.ts +6 -0
  2. package/auth/auth-service.d.ts +46 -2
  3. package/auth/index.d.ts +1 -1
  4. package/fonts/files/crimson-pro-latin-ext-italic.woff2 +0 -0
  5. package/fonts/files/crimson-pro-latin-ext-normal.woff2 +0 -0
  6. package/fonts/files/crimson-pro-latin-italic.woff2 +0 -0
  7. package/fonts/files/crimson-pro-latin-normal.woff2 +0 -0
  8. package/fonts/files/crimson-pro-vietnamese-italic.woff2 +0 -0
  9. package/fonts/files/crimson-pro-vietnamese-normal.woff2 +0 -0
  10. package/fonts/files/inter-cyrillic-ext-italic.woff2 +0 -0
  11. package/fonts/files/inter-cyrillic-ext-normal.woff2 +0 -0
  12. package/fonts/files/inter-cyrillic-italic.woff2 +0 -0
  13. package/fonts/files/inter-cyrillic-normal.woff2 +0 -0
  14. package/fonts/files/inter-greek-ext-italic.woff2 +0 -0
  15. package/fonts/files/inter-greek-ext-normal.woff2 +0 -0
  16. package/fonts/files/inter-greek-italic.woff2 +0 -0
  17. package/fonts/files/inter-greek-normal.woff2 +0 -0
  18. package/fonts/files/inter-latin-ext-italic.woff2 +0 -0
  19. package/fonts/files/inter-latin-ext-normal.woff2 +0 -0
  20. package/fonts/files/inter-latin-italic.woff2 +0 -0
  21. package/fonts/files/inter-latin-normal.woff2 +0 -0
  22. package/fonts/files/inter-vietnamese-italic.woff2 +0 -0
  23. package/fonts/files/inter-vietnamese-normal.woff2 +0 -0
  24. package/fonts/files/jetbrains-mono-cyrillic-ext-italic.woff2 +0 -0
  25. package/fonts/files/jetbrains-mono-cyrillic-ext-normal.woff2 +0 -0
  26. package/fonts/files/jetbrains-mono-cyrillic-italic.woff2 +0 -0
  27. package/fonts/files/jetbrains-mono-cyrillic-normal.woff2 +0 -0
  28. package/fonts/files/jetbrains-mono-greek-italic.woff2 +0 -0
  29. package/fonts/files/jetbrains-mono-greek-normal.woff2 +0 -0
  30. package/fonts/files/jetbrains-mono-latin-ext-italic.woff2 +0 -0
  31. package/fonts/files/jetbrains-mono-latin-ext-normal.woff2 +0 -0
  32. package/fonts/files/jetbrains-mono-latin-italic.woff2 +0 -0
  33. package/fonts/files/jetbrains-mono-latin-normal.woff2 +0 -0
  34. package/fonts/files/jetbrains-mono-vietnamese-italic.woff2 +0 -0
  35. package/fonts/files/jetbrains-mono-vietnamese-normal.woff2 +0 -0
  36. package/fonts/files/poppins-devanagari-400-italic.woff2 +0 -0
  37. package/fonts/files/poppins-devanagari-400-normal.woff2 +0 -0
  38. package/fonts/files/poppins-devanagari-500-italic.woff2 +0 -0
  39. package/fonts/files/poppins-devanagari-500-normal.woff2 +0 -0
  40. package/fonts/files/poppins-devanagari-600-italic.woff2 +0 -0
  41. package/fonts/files/poppins-devanagari-600-normal.woff2 +0 -0
  42. package/fonts/files/poppins-devanagari-700-italic.woff2 +0 -0
  43. package/fonts/files/poppins-devanagari-700-normal.woff2 +0 -0
  44. package/fonts/files/poppins-latin-400-italic.woff2 +0 -0
  45. package/fonts/files/poppins-latin-400-normal.woff2 +0 -0
  46. package/fonts/files/poppins-latin-500-italic.woff2 +0 -0
  47. package/fonts/files/poppins-latin-500-normal.woff2 +0 -0
  48. package/fonts/files/poppins-latin-600-italic.woff2 +0 -0
  49. package/fonts/files/poppins-latin-600-normal.woff2 +0 -0
  50. package/fonts/files/poppins-latin-700-italic.woff2 +0 -0
  51. package/fonts/files/poppins-latin-700-normal.woff2 +0 -0
  52. package/fonts/files/poppins-latin-ext-400-italic.woff2 +0 -0
  53. package/fonts/files/poppins-latin-ext-400-normal.woff2 +0 -0
  54. package/fonts/files/poppins-latin-ext-500-italic.woff2 +0 -0
  55. package/fonts/files/poppins-latin-ext-500-normal.woff2 +0 -0
  56. package/fonts/files/poppins-latin-ext-600-italic.woff2 +0 -0
  57. package/fonts/files/poppins-latin-ext-600-normal.woff2 +0 -0
  58. package/fonts/files/poppins-latin-ext-700-italic.woff2 +0 -0
  59. package/fonts/files/poppins-latin-ext-700-normal.woff2 +0 -0
  60. package/fonts/ikon-fonts.css +1379 -0
  61. package/fonts/licenses/crimson-pro-OFL.txt +93 -0
  62. package/fonts/licenses/inter-OFL.txt +93 -0
  63. package/fonts/licenses/jetbrains-mono-OFL.txt +93 -0
  64. package/fonts/licenses/poppins-OFL.txt +93 -0
  65. package/hooks/index.d.ts +0 -1
  66. package/index.d.ts +1 -1
  67. package/index.js +840 -797
  68. package/package.json +8 -3
  69. package/theme/ikon-app.css +246 -0
  70. package/theme/ikon-auth.css +311 -0
  71. package/theme/ikon-surface.css +111 -0
  72. package/theme/ikon-tokens.css +132 -0
  73. package/hooks/use-lazy-font.d.ts +0 -18
@@ -122,6 +122,12 @@ export interface UseIkonAppResult {
122
122
  * say the session has ended rather than show a generic connection error.
123
123
  */
124
124
  isSessionExpired: boolean;
125
+ /**
126
+ * True when the app's server started and then died before it could serve the session — nearly
127
+ * always an exception out of the app's own startup code. Terminal: the same bundle crashes the
128
+ * same way, so the app should say it failed to start instead of waiting out the connect budget.
129
+ */
130
+ isStartupFailed: boolean;
125
131
  /**
126
132
  * UI stores for rendering.
127
133
  */
@@ -7,6 +7,17 @@ export interface OAuthCallbackResult {
7
7
  token: string;
8
8
  provider: LoginMethod;
9
9
  }
10
+ /**
11
+ * Whether a same-origin auth response came from an LB with no `/ikon/auth` route — the app
12
+ * frontend answered instead of the auth service.
13
+ *
14
+ * The marker header settles it outright when present. The shape heuristic below is the fallback
15
+ * for an auth service deployed before the header existed, and it can only ever guess: it reads a
16
+ * 404/405 or an HTML 200 as the app frontend answering. That guess has misfired twice on
17
+ * /email/send's 204 — Express stamps its default text/html content type even on a bodyless
18
+ * response — which is why an HTML content type counts only together with a 200.
19
+ */
20
+ export declare function isRouteMissingResponse(response: Response): boolean;
10
21
  /**
11
22
  * Authenticate anonymously with the Ikon auth service.
12
23
  * Returns a session with a token for anonymous users. `flavor` names which not-signed-in identity
@@ -43,12 +54,45 @@ export declare function verifyLoginCode({ email, code, authUrl }: VerifyLoginCod
43
54
  * Returns the token and provider if present, or null if not an OAuth callback.
44
55
  */
45
56
  export declare function parseOAuthCallback(): OAuthCallbackResult | null;
57
+ /**
58
+ * Sign-in failure parsed from an OAuth callback redirect: the machine code from the `error` query
59
+ * param, plus the provider the callback names when it knows which one failed.
60
+ */
61
+ export interface OAuthErrorResult {
62
+ code: string;
63
+ provider: LoginMethod | null;
64
+ }
46
65
  /**
47
66
  * Get the error from an OAuth callback if present.
48
67
  */
49
- export declare function parseOAuthError(): string | null;
68
+ export declare function parseOAuthError(): OAuthErrorResult | null;
69
+ /**
70
+ * True when the URL asks this tab to skip the local-dev auto-login (`?ikon-signed-out`).
71
+ *
72
+ * A local `ikon app run` signs the developer straight in, which is what you want while building —
73
+ * and exactly what you cannot have while checking the signed-out product. Without this, seeing the
74
+ * public site means logging out by hand in a throwaway browser profile, so it tends not to happen
75
+ * and the guest experience ships unlooked-at. Local dev only: it suppresses the injected developer
76
+ * token and nothing else, so it grants no access and does nothing in a deployed build.
77
+ */
78
+ export declare function wantsSignedOut(): boolean;
79
+ /**
80
+ * Human-readable text for an OAuth callback error code. Unknown codes pass through verbatim so a
81
+ * backend code this build does not know yet still surfaces rather than disappearing.
82
+ *
83
+ * The refused-link text is written for the visitor's mental model, not the system's: they clicked
84
+ * the provider because they have an account THERE, so it must say the pre-existing account is on
85
+ * this app, must not sound like their provider account is broken, and must point at a concrete
86
+ * next step — the email code sign-in when this app offers it, since that proves mailbox ownership
87
+ * and reaches the existing account.
88
+ */
89
+ export declare function describeAuthError(code: string, provider?: string | null, options?: {
90
+ emailSignInAvailable?: boolean;
91
+ }): string;
50
92
  /**
51
- * Clear OAuth-related parameters from the URL.
93
+ * Clear OAuth-related parameters from the URL, preserving the app's own query parameters —
94
+ * a deep link like /projects/new?prompt=… must survive the OAuth round-trip so the app can
95
+ * read it after sign-in (the SDK sends path+query as the connect InitialPath).
52
96
  */
53
97
  export declare function clearOAuthParams(): void;
54
98
  /**
package/auth/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type { AuthConfig, AuthContextValue, AuthSession, AuthState, AuthUser, LoginMethod } from './types';
2
2
  export { clearAuthSession, isSignedInBootLikely, loadAuthSession, saveAuthSession, sessionToUser } from './storage';
3
- export { authenticateAnonymous, buildOAuthRedirectUrl, clearOAuthParams, getPasskeyAuthenticationOptions, getPasskeyRegistrationOptions, isPasskeySupported, parseOAuthCallback, parseOAuthError, sendLoginCode, verifyLoginCode, verifyPasskeyAuthentication, verifyPasskeyRegistration, type OAuthCallbackResult, type SendLoginCodeOptions, type VerifyLoginCodeOptions, } from './auth-service';
3
+ export { authenticateAnonymous, buildOAuthRedirectUrl, clearOAuthParams, describeAuthError, getPasskeyAuthenticationOptions, getPasskeyRegistrationOptions, isPasskeySupported, parseOAuthCallback, parseOAuthError, sendLoginCode, verifyLoginCode, verifyPasskeyAuthentication, verifyPasskeyRegistration, type OAuthCallbackResult, type OAuthErrorResult, type SendLoginCodeOptions, type VerifyLoginCodeOptions, } from './auth-service';
4
4
  export { AuthProvider, useAuth, useAuthOptional, type AuthProviderProps } from './auth-context';
5
5
  export { useAuthGuard, type UseAuthGuardOptions, type UseAuthGuardResult } from './use-auth-guard';