@passflow/react 0.7.0 → 0.8.1

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 (123) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +27 -17
  3. package/dist/index.cjs.js +2 -34
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.es.js +123 -7308
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/src/components/error/index.d.ts.map +1 -1
  8. package/dist/src/components/flow/device-verify/index.d.ts +10 -0
  9. package/dist/src/components/flow/device-verify/index.d.ts.map +1 -0
  10. package/dist/src/components/flow/device-verify/screen.d.ts +4 -0
  11. package/dist/src/components/flow/device-verify/screen.d.ts.map +1 -0
  12. package/dist/src/components/flow/index.d.ts +1 -0
  13. package/dist/src/components/flow/index.d.ts.map +1 -1
  14. package/dist/src/components/flow/passflow/index.d.ts.map +1 -1
  15. package/dist/src/components/flow/two-factor-verify/index.d.ts.map +1 -1
  16. package/dist/src/components/form/cli-auth/index.d.ts +8 -0
  17. package/dist/src/components/form/cli-auth/index.d.ts.map +1 -0
  18. package/dist/src/components/form/cli-auth/screen.d.ts +5 -0
  19. package/dist/src/components/form/cli-auth/screen.d.ts.map +1 -0
  20. package/dist/src/components/form/cli-browser-auth/index.d.ts.map +1 -1
  21. package/dist/src/components/form/cli-qr-auth/index.d.ts.map +1 -1
  22. package/dist/src/components/form/forgot-password/forgot-password-success.d.ts.map +1 -1
  23. package/dist/src/components/form/index.d.ts +0 -1
  24. package/dist/src/components/form/index.d.ts.map +1 -1
  25. package/dist/src/components/form/invitation-join/index.d.ts.map +1 -1
  26. package/dist/src/components/form/signin/index.d.ts +2 -2
  27. package/dist/src/components/form/signin/index.d.ts.map +1 -1
  28. package/dist/src/components/form/signup/index.d.ts +2 -2
  29. package/dist/src/components/form/signup/index.d.ts.map +1 -1
  30. package/dist/src/components/form/verify-challenge/verify-challenge-otp-redirect.d.ts.map +1 -1
  31. package/dist/src/components/form/verify-challenge/verify-challenge-otp.d.ts.map +1 -1
  32. package/dist/src/components/form/wrapper/index.d.ts +1 -12
  33. package/dist/src/components/form/wrapper/index.d.ts.map +1 -1
  34. package/dist/src/components/provider/passflow-provider.d.ts +22 -0
  35. package/dist/src/components/provider/passflow-provider.d.ts.map +1 -1
  36. package/dist/src/components/ui/country-flag/index.d.ts +7 -0
  37. package/dist/src/components/ui/country-flag/index.d.ts.map +1 -0
  38. package/dist/src/components/ui/country-flag/positions.d.ts +245 -0
  39. package/dist/src/components/ui/country-flag/positions.d.ts.map +1 -0
  40. package/dist/src/components/ui/fields/field-phone.d.ts +1 -1
  41. package/dist/src/components/ui/fields/field-phone.d.ts.map +1 -1
  42. package/dist/src/components/ui/icon/index.d.ts +3 -1
  43. package/dist/src/components/ui/icon/index.d.ts.map +1 -1
  44. package/dist/src/components/ui/index.d.ts +2 -0
  45. package/dist/src/components/ui/index.d.ts.map +1 -1
  46. package/dist/src/components/ui/login-screen/code-entry.d.ts +4 -0
  47. package/dist/src/components/ui/login-screen/code-entry.d.ts.map +1 -0
  48. package/dist/src/components/ui/login-screen/credentials.d.ts +4 -0
  49. package/dist/src/components/ui/login-screen/credentials.d.ts.map +1 -0
  50. package/dist/src/components/ui/login-screen/device-approval.d.ts +4 -0
  51. package/dist/src/components/ui/login-screen/device-approval.d.ts.map +1 -0
  52. package/dist/src/components/ui/login-screen/general-error.d.ts +4 -0
  53. package/dist/src/components/ui/login-screen/general-error.d.ts.map +1 -0
  54. package/dist/src/components/ui/login-screen/index.d.ts +4 -0
  55. package/dist/src/components/ui/login-screen/index.d.ts.map +1 -0
  56. package/dist/src/components/ui/login-screen/invitation.d.ts +4 -0
  57. package/dist/src/components/ui/login-screen/invitation.d.ts.map +1 -0
  58. package/dist/src/components/ui/login-screen/login-screen.d.ts +4 -0
  59. package/dist/src/components/ui/login-screen/login-screen.d.ts.map +1 -0
  60. package/dist/src/components/ui/login-screen/passkey-progress.d.ts +4 -0
  61. package/dist/src/components/ui/login-screen/passkey-progress.d.ts.map +1 -0
  62. package/dist/src/components/ui/login-screen/shared.d.ts +15 -0
  63. package/dist/src/components/ui/login-screen/shared.d.ts.map +1 -0
  64. package/dist/src/components/ui/login-screen/shell.d.ts +13 -0
  65. package/dist/src/components/ui/login-screen/shell.d.ts.map +1 -0
  66. package/dist/src/components/ui/login-screen/status.d.ts +4 -0
  67. package/dist/src/components/ui/login-screen/status.d.ts.map +1 -0
  68. package/dist/src/components/ui/login-screen/types.d.ts +153 -0
  69. package/dist/src/components/ui/login-screen/types.d.ts.map +1 -0
  70. package/dist/src/components/ui/switch/index.d.ts +1 -0
  71. package/dist/src/components/ui/switch/index.d.ts.map +1 -1
  72. package/dist/src/hooks/index.d.ts +1 -0
  73. package/dist/src/hooks/index.d.ts.map +1 -1
  74. package/dist/src/hooks/use-app-settings.d.ts.map +1 -1
  75. package/dist/src/hooks/use-device-verify.d.ts +79 -0
  76. package/dist/src/hooks/use-device-verify.d.ts.map +1 -0
  77. package/dist/src/hooks/use-join-invite.d.ts.map +1 -1
  78. package/dist/src/hooks/use-passwordless-complete.d.ts.map +1 -1
  79. package/dist/src/hooks/use-signin.d.ts +3 -2
  80. package/dist/src/hooks/use-signin.d.ts.map +1 -1
  81. package/dist/src/hooks/use-signup.d.ts +3 -2
  82. package/dist/src/hooks/use-signup.d.ts.map +1 -1
  83. package/dist/src/types/auth-errors.d.ts +8 -0
  84. package/dist/src/types/auth-errors.d.ts.map +1 -0
  85. package/dist/src/types/device-errors.d.ts +91 -0
  86. package/dist/src/types/device-errors.d.ts.map +1 -0
  87. package/dist/src/types/index.d.ts +2 -0
  88. package/dist/src/types/index.d.ts.map +1 -1
  89. package/dist/src/utils/auth-error.d.ts +7 -0
  90. package/dist/src/utils/auth-error.d.ts.map +1 -0
  91. package/dist/src/utils/classify-device-error.d.ts +35 -0
  92. package/dist/src/utils/classify-device-error.d.ts.map +1 -0
  93. package/dist/src/utils/index.d.ts +3 -0
  94. package/dist/src/utils/index.d.ts.map +1 -1
  95. package/dist/src/utils/invitation-auth-chrome.d.ts +8 -0
  96. package/dist/src/utils/invitation-auth-chrome.d.ts.map +1 -0
  97. package/dist/src/utils/login-theme.d.ts +8 -0
  98. package/dist/src/utils/login-theme.d.ts.map +1 -0
  99. package/dist/style.css +2 -1
  100. package/package.json +18 -10
  101. package/dist/playwright/fixture/index.d.ts +0 -3
  102. package/dist/playwright/fixture/index.d.ts.map +0 -1
  103. package/dist/playwright/playwright.config.d.ts +0 -10
  104. package/dist/playwright/playwright.config.d.ts.map +0 -1
  105. package/dist/playwright/tests/invitation-flow.spec.d.ts +0 -2
  106. package/dist/playwright/tests/invitation-flow.spec.d.ts.map +0 -1
  107. package/dist/playwright/tests/signin.spec.d.ts +0 -2
  108. package/dist/playwright/tests/signin.spec.d.ts.map +0 -1
  109. package/dist/playwright/tests/signup.spec.d.ts +0 -2
  110. package/dist/playwright/tests/signup.spec.d.ts.map +0 -1
  111. package/dist/playwright/tests/validate.spec.d.ts +0 -2
  112. package/dist/playwright/tests/validate.spec.d.ts.map +0 -1
  113. package/dist/src/app.d.ts +0 -5
  114. package/dist/src/app.d.ts.map +0 -1
  115. package/dist/src/main.d.ts +0 -1
  116. package/dist/src/main.d.ts.map +0 -1
  117. package/dist/src/test/setup.d.ts +0 -1
  118. package/dist/src/test/setup.d.ts.map +0 -1
  119. package/dist/src/test/utils/render.d.ts +0 -4
  120. package/dist/src/test/utils/render.d.ts.map +0 -1
  121. package/dist/src/test/utils/test-passflow.d.ts +0 -6
  122. package/dist/src/test/utils/test-passflow.d.ts.map +0 -1
  123. package/dist/vite.svg +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,31 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@passflow/react` are documented in this file.
4
+
5
+ ## [0.8.1] - 2026-07-28
6
+
7
+ Version 0.8.1 is the first registry release after 0.7.1 and includes the previously unreleased 0.8.0 device-verification work.
8
+
9
+ ### Added
10
+
11
+ - A typed, Storybook-backed `LoginScreen` component system covering credential, passkey, code-entry, invitation, device-approval, status, and general-error states.
12
+ - RFC 8628 device verification through `DeviceVerifyFlow`, `useDeviceVerify`, typed device errors, and explicit device approval screens.
13
+ - Shared CLI browser and QR authentication state mapping through the component library.
14
+ - Bundled country flags and an improved international phone field with no runtime dependency on third-party flag assets.
15
+ - Storybook accessibility tooling and Playwright coverage for authentication states, interactions, responsive layouts, themes, and accessibility.
16
+ - Typed authentication error classification and shared login-theme and invitation-chrome mapping utilities.
17
+
18
+ ### Changed
19
+
20
+ - Sign-in, sign-up, invitation, CLI authentication, device verification, passwordless verification, and error screens now consume the shared UI component library instead of maintaining flow-local visual implementations.
21
+ - Authentication styling now resolves through the existing `--passflow-*` design tokens, with Storybook serving as the supported-state catalog.
22
+ - Build, Storybook, Vitest, Playwright, Vite, and pnpm tooling were upgraded and aligned with CI.
23
+ - The npm package now rebuilds during `prepack` and excludes demo, test, Storybook, and Playwright declarations from the published artifact.
24
+
25
+ ### Fixed
26
+
27
+ - OIDC credential flows no longer cancel the relying party callback with a competing post-login navigation after the interceptor has followed `redirect_url`.
28
+ - Sign-in and sign-up user-facing errors no longer expose raw backend or redirect details.
29
+ - Password, phone, icon, switch, provider, focus, loading, and validation states received accessibility and interaction fixes.
30
+
31
+ [0.8.1]: https://github.com/MadAppGang/passflow-react-sdk/compare/v0.7.1...v0.8.1
package/README.md CHANGED
@@ -56,6 +56,22 @@ pnpm build
56
56
 
57
57
  ## Local Development
58
58
 
59
+ ### Component development with Storybook
60
+
61
+ The visual source of truth lives in `src/components/ui` and is catalogued in Storybook.
62
+
63
+ ```sh
64
+ pnpm storybook
65
+ ```
66
+
67
+ Before reusing a new visual state in a flow, add it to the owning UI component and its co-located `*.stories.tsx` file. Verify the static catalog with:
68
+
69
+ ```sh
70
+ pnpm build-storybook
71
+ ```
72
+
73
+ Flows and form controllers should map domain state and callbacks into library components rather than creating or styling controls in place. See [`CLAUDE.md`](./CLAUDE.md) for the repository boundary.
74
+
59
75
  ### Using Local Passflow JS SDK
60
76
 
61
77
  For local development and testing with a local version of the Passflow JS SDK, you need to:
@@ -98,32 +114,26 @@ we are using pnpm. Please ansure you have it in the system.
98
114
 
99
115
  ## UI Testing
100
116
 
101
- We are using playwright to run UI tests.
102
-
103
- First, ensure you have all runtime binary enabled:
117
+ All UI behavior and Storybook state tests use Playwright. Install Chromium once:
104
118
 
105
- ```
106
- pnpm exec playwright install
119
+ ```sh
120
+ pnpm exec playwright install chromium
107
121
  ```
108
122
 
109
- and then feel free to run the tests:
123
+ Run the complete UI suite headlessly:
110
124
 
125
+ ```sh
126
+ pnpm test
111
127
  ```
112
- pnpm run test:ui
113
- ```
114
-
115
- ### Writing your own ui tests.
116
128
 
117
- You can find a tests in the `./tests` frolder.
129
+ Or launch Playwright's interactive test UI:
118
130
 
119
- Please create the new files using the current tests as a reference.
120
-
121
- To run the playwright in the design mode with ui, run the follwoing command:
122
-
123
- ```
124
- pnpm playwright test --ui
131
+ ```sh
132
+ pnpm test:ui
125
133
  ```
126
134
 
135
+ Both scripts automatically start the demo app and Storybook. `pnpm test` uses the economical headless configuration, while `pnpm test:ui` retains traces and a final full-page screenshot for every successful test. Select a runnable leaf test in Playwright UI to inspect its action timeline, DOM snapshots, and screenshot attachment. Tests live in `playwright/tests`; component-state tests render the real Storybook stories rather than recreating components in a test-only harness. Vitest remains for non-visual hooks, controllers, and utility logic.
136
+
127
137
  ## Installation
128
138
 
129
139
  ```bash