@passui/tanstack 0.1.2 → 0.2.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 (70) hide show
  1. package/README.md +56 -32
  2. package/dist/client/chunks/form-fields-DlWu70u5.js +630 -0
  3. package/dist/client/src/solid/auth-shell/index.js +28 -0
  4. package/dist/client/src/solid/document/index.js +51 -0
  5. package/dist/client/src/solid/form-fields/index.js +1 -0
  6. package/dist/client/src/solid/forms/index.js +33 -0
  7. package/dist/client/src/solid/mutation/index.js +46 -0
  8. package/dist/client/src/solid/route-boundary/index.js +73 -0
  9. package/dist/client/src/solid/settings/index.js +173 -0
  10. package/dist/client/src/solid/tables/index.js +500 -0
  11. package/dist/server/src/solid/auth-shell/index.js +28 -0
  12. package/dist/server/src/solid/document/index.js +55 -0
  13. package/dist/server/src/solid/form-fields/index.js +598 -0
  14. package/dist/server/src/solid/forms/index.js +33 -0
  15. package/dist/server/src/solid/mutation/index.js +46 -0
  16. package/dist/server/src/solid/route-boundary/index.js +73 -0
  17. package/dist/server/src/solid/settings/index.js +169 -0
  18. package/dist/server/src/solid/tables/index.js +480 -0
  19. package/dist/types/src/shared/optimistic.d.ts +2 -0
  20. package/dist/types/src/solid/auth-shell/auth-shell.d.ts +4 -0
  21. package/dist/types/src/solid/auth-shell/index.d.ts +1 -0
  22. package/dist/types/src/solid/document/compose-viewport.d.ts +14 -0
  23. package/dist/types/src/solid/document/index.d.ts +1 -0
  24. package/dist/types/src/solid/form-fields/avatar.d.ts +26 -0
  25. package/dist/types/src/solid/form-fields/fields.d.ts +45 -0
  26. package/dist/types/src/solid/form-fields/index.d.ts +3 -0
  27. package/dist/types/src/solid/form-fields/submit.d.ts +3 -0
  28. package/dist/types/src/solid/forms/contexts.d.ts +1 -0
  29. package/dist/types/src/solid/forms/form-alert.d.ts +6 -0
  30. package/dist/types/src/solid/forms/index.d.ts +43 -0
  31. package/dist/types/src/solid/mutation/index.d.ts +1 -0
  32. package/dist/types/src/solid/mutation/use-app-mutation.d.ts +22 -0
  33. package/dist/types/src/solid/route-boundary/boundaries.d.ts +8 -0
  34. package/dist/types/src/solid/route-boundary/index.d.ts +1 -0
  35. package/dist/types/src/solid/settings/index.d.ts +1 -0
  36. package/dist/types/src/solid/settings/setting-list.d.ts +37 -0
  37. package/dist/types/src/solid/tables/columns.d.ts +4 -0
  38. package/dist/types/src/solid/tables/data-table.d.ts +58 -0
  39. package/dist/types/src/solid/tables/filter-row.d.ts +9 -0
  40. package/dist/types/src/solid/tables/index.d.ts +4 -0
  41. package/dist/types/src/solid/tables/pagination.d.ts +7 -0
  42. package/package.json +154 -13
  43. package/src/mutation/use-app-mutation.ts +2 -6
  44. package/src/shared/index.ts +2 -0
  45. package/src/shared/optimistic.ts +7 -0
  46. package/src/shared/table.ts +30 -0
  47. package/src/solid/auth-shell/auth-shell.tsx +20 -0
  48. package/src/solid/auth-shell/index.ts +1 -0
  49. package/src/solid/document/compose-viewport.tsx +69 -0
  50. package/src/solid/document/index.ts +1 -0
  51. package/src/solid/form-fields/avatar.tsx +370 -0
  52. package/src/solid/form-fields/fields.tsx +336 -0
  53. package/src/solid/form-fields/index.ts +3 -0
  54. package/src/solid/form-fields/submit.tsx +31 -0
  55. package/src/solid/forms/contexts.ts +7 -0
  56. package/src/solid/forms/form-alert.tsx +19 -0
  57. package/src/solid/forms/index.ts +32 -0
  58. package/src/solid/mutation/index.ts +5 -0
  59. package/src/solid/mutation/use-app-mutation.ts +171 -0
  60. package/src/solid/route-boundary/boundaries.tsx +104 -0
  61. package/src/solid/route-boundary/index.ts +1 -0
  62. package/src/solid/settings/index.ts +1 -0
  63. package/src/solid/settings/setting-list.tsx +185 -0
  64. package/src/solid/styles.css +2 -0
  65. package/src/solid/tables/columns.tsx +40 -0
  66. package/src/solid/tables/data-table.tsx +448 -0
  67. package/src/solid/tables/filter-row.tsx +161 -0
  68. package/src/solid/tables/index.ts +4 -0
  69. package/src/solid/tables/pagination.tsx +78 -0
  70. package/src/tables/utils.ts +5 -35
package/README.md CHANGED
@@ -1,53 +1,77 @@
1
- # Passui TanStack integrations
1
+ # @passui/tanstack
2
2
 
3
- Optional TanStack Form, Table and Router integrations for Passui's native
4
- React controls. Passui itself works without this package.
3
+ Optional TanStack Form, Query, Table and Router integrations for Passui.
4
+ One package supports native React and native SolidJS through separate
5
+ entry points. Shared helpers have no UI runtime dependency.
5
6
 
6
- ## Install
7
+ ## SolidJS
7
8
 
8
9
  ```bash
9
- bun add @passui/react @passui/tanstack @tanstack/react-query
10
+ bunx @passui/cli@latest init --framework solid --integration tanstack
11
+ # Manual alternative
12
+ bun add @passui/solid @passui/tanstack solid-js tailwindcss @tanstack/solid-form @tanstack/solid-query @tanstack/solid-router @tanstack/solid-table
10
13
  ```
11
14
 
12
- Use React 19 and Tailwind CSS 4. Import this stylesheet once; it includes
13
- Passui's styles:
14
-
15
15
  ```css
16
- @import "@passui/tanstack/styles.css";
16
+ @import "@passui/tanstack/solid/styles.css";
17
17
  ```
18
18
 
19
- Import an integration from its own entry point:
20
-
21
- ```tsx
22
- import { useAppForm } from "@passui/tanstack/forms"
23
- import { useAppMutation } from "@passui/tanstack/mutation"
24
- import { ComposeViewport } from "@passui/tanstack/document"
19
+ ```ts
20
+ import { createAppForm } from "@passui/tanstack/solid/forms"
21
+ import { createAppMutation } from "@passui/tanstack/solid/mutation"
22
+ import { DataTable, selectColumn } from "@passui/tanstack/solid/tables"
23
+ import { ComposeViewport } from "@passui/tanstack/solid/document"
24
+ import { AuthShell } from "@passui/tanstack/solid/auth-shell"
25
+ import { SettingList } from "@passui/tanstack/solid/settings"
26
+ import { DefaultBoundary, DefaultLoader, NotFound } from "@passui/tanstack/solid/route-boundary"
25
27
  ```
26
28
 
27
- The package exports TypeScript and TSX source. Your app's bundler must
28
- process those files and its stylesheet through Tailwind CSS 4. Query
29
- integrations use your app's QueryClientProvider.
29
+ Solid form and mutation options are accessors: `createAppForm(() => ({
30
+ defaultValues, onSubmit }))` and `createAppMutation(() => ({ mutationFn }))`.
31
+ `useAppForm` and `useAppMutation` aliases are also exported. Field contexts
32
+ return an accessor; use `field().state.value`. Bound fields include input,
33
+ checkbox, textarea, switch, radioCard, multiselect, avatar and otp.
34
+ Mount Solid QueryClientProvider around mutation consumers.
30
35
 
31
- ## Publishing
36
+ Use SolidJS 1.9.17+ and compile this package's TSX through Solid. In Vite 8,
37
+ exclude `@passui/solid` and `@passui/tanstack` from `optimizeDeps`, include
38
+ `solid` in `resolve.conditions`, and put both packages plus
39
+ `/@tanstack\/solid-/` in `ssr.noExternal`. SSR conditions should include
40
+ `solid`, `module`, `node` and `development|production`. This compiles the
41
+ Solid framework source for the right server runtime. See the complete
42
+ config in `@passui/solid`'s README or use the generated starter.
32
43
 
33
- From the Pherus checkout:
44
+ ## React
34
45
 
35
46
  ```bash
36
- bun run typecheck
37
- bun run test
38
- bun run publish:check
39
- bun publish
47
+ bunx @passui/cli@latest init --framework react --integration tanstack
40
48
  ```
41
49
 
42
- Publish the matching Passui version first. Bun resolves the local
43
- `workspace:^` dependency to a public version range when packing. Login
44
- with an npm account that can publish under `@passui`. Credentials stay in
45
- your user npm configuration.
50
+ ```css
51
+ @import "@passui/tanstack/react/styles.css";
52
+ ```
53
+
54
+ React exports use `/react/forms`, `/react/form-fields`, `/react/mutation`,
55
+ `/react/tables`, `/react/document`, `/react/auth-shell`, `/react/settings`
56
+ and `/react/route-boundary`. Existing unprefixed paths, such as `/forms`,
57
+ remain React defaults. Existing `/styles.css` also remains available.
58
+
59
+ Starting at 0.2.0, framework dependencies are optional peers rather than
60
+ mandatory React dependencies. The CLI installs the appropriate peers
61
+ while preserving existing versions. Manual React setups must install the
62
+ React TanStack adapters they use; `/document` also imports TanStack React
63
+ devtools and their Query and Router panels. See package.json for supported
64
+ peer ranges. Solid consumers do not need React packages.
65
+
66
+ ## Shared core
46
67
 
47
- The Passui repository's `publish.yml` GitHub Actions workflow uses
48
- the `npm-publish` environment and npm OIDC authentication. Its trusted
49
- publisher must reference `phe-rus/passui`.
68
+ `@passui/tanstack/core` exports framework independent table helpers and
69
+ `shouldRestoreOptimisticSnapshot`. Both mutation adapters preserve newer
70
+ concurrent cache writes when an older optimistic request fails.
50
71
 
51
- ## License
72
+ The UI packages remain independent of this optional integration. Put
73
+ framework Scripts in ComposeViewport.Window's `after` slot, outside main.
74
+ Credentials stay outside this repository. Releases use the repository's
75
+ `publish.yml` workflow and the `npm-publish` environment with npm OIDC.
52
76
 
53
77
  MIT.