@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
@@ -0,0 +1,22 @@
1
+ import type { QueryKey, MutationOptions } from "@tanstack/solid-query";
2
+ type OptimisticUpdate<TOptimisticData, TVariables> = {
3
+ queryKey: QueryKey;
4
+ /** Applied to the cache immediately, before the mutation resolves. Rolled back if it errors. */
5
+ updater: (old: TOptimisticData | undefined, variables: TVariables) => TOptimisticData;
6
+ };
7
+ type MutationContext<TOptimisticData> = {
8
+ previous: TOptimisticData | undefined;
9
+ next: TOptimisticData;
10
+ } | undefined;
11
+ export { shouldRestoreOptimisticSnapshot } from "../../shared/optimistic";
12
+ type AppMutationOptions<TData, TVariables, TOptimisticData> = Omit<MutationOptions<TData, Error, TVariables, MutationContext<TOptimisticData>>, "onSuccess" | "onError" | "onMutate" | "onSettled"> & {
13
+ /** Query keys to invalidate once the mutation settles, win or lose. */
14
+ invalidates?: QueryKey[];
15
+ optimisticUpdate?: OptimisticUpdate<TOptimisticData, TVariables>;
16
+ successMessage?: string | ((data: NoInfer<TData>, variables: NoInfer<TVariables>) => string);
17
+ successDescription?: string | ((data: NoInfer<TData>, variables: NoInfer<TVariables>) => string | undefined);
18
+ errorMessage?: string;
19
+ onSuccess?: (data: NoInfer<TData>, variables: NoInfer<TVariables>) => void;
20
+ onError?: (error: Error, variables: NoInfer<TVariables>) => void;
21
+ };
22
+ export declare function useAppMutation<TData, TVariables = void, TOptimisticData = unknown>(getOptions: () => AppMutationOptions<TData, TVariables, TOptimisticData>): import("@tanstack/solid-query").UseMutationResult<TData, Error, TVariables, MutationContext<TOptimisticData>>;
@@ -0,0 +1,8 @@
1
+ /** @jsxImportSource solid-js */
2
+ import { type JSX } from "solid-js";
3
+ import { type ErrorComponentProps } from "@tanstack/solid-router";
4
+ export declare function DefaultLoader(): JSX.Element;
5
+ export declare function DefaultBoundary(props: ErrorComponentProps): JSX.Element;
6
+ export declare function NotFound(props: {
7
+ children?: JSX.Element;
8
+ }): JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./boundaries";
@@ -0,0 +1 @@
1
+ export * from "./setting-list";
@@ -0,0 +1,37 @@
1
+ /** @jsxImportSource solid-js */
2
+ import { type JSX } from "solid-js";
3
+ import { type LinkProps } from "@tanstack/solid-router";
4
+ import { type IconButtonSize } from "@passui/solid/icon-button";
5
+ declare function Row(props: {
6
+ icon?: JSX.Element;
7
+ title: JSX.Element;
8
+ description?: JSX.Element;
9
+ value?: JSX.Element;
10
+ trailing?: JSX.Element;
11
+ to?: LinkProps["to"];
12
+ params?: LinkProps["params"];
13
+ hash?: string;
14
+ onClick?: () => void;
15
+ chevron?: boolean;
16
+ tone?: "default" | "destructive";
17
+ }): JSX.Element;
18
+ declare function Copy(props: {
19
+ value: string;
20
+ label?: string;
21
+ size?: IconButtonSize;
22
+ }): JSX.Element;
23
+ export declare const SettingList: ((props: {
24
+ id?: string;
25
+ as?: "h2" | "h3";
26
+ icon?: JSX.Element;
27
+ title?: string;
28
+ description?: string;
29
+ action?: JSX.Element;
30
+ variant?: "inset" | "tile";
31
+ children: JSX.Element;
32
+ className?: string;
33
+ }) => JSX.Element) & {
34
+ Row: typeof Row;
35
+ Copy: typeof Copy;
36
+ };
37
+ export {};
@@ -0,0 +1,4 @@
1
+ /** @jsxImportSource solid-js */
2
+ import type { RowData } from "@tanstack/solid-table";
3
+ import type { DataTableColumnDef } from "./data-table";
4
+ export declare function selectColumn<TData extends RowData>(): DataTableColumnDef<TData>;
@@ -0,0 +1,58 @@
1
+ /** @jsxImportSource solid-js */
2
+ import { type ColumnDef, type RowData, type ColumnVisibilityState } from "@tanstack/solid-table";
3
+ import { type JSX } from "solid-js";
4
+ export declare const baseTableFeatures: {
5
+ globalFilteringFeature: import("@tanstack/solid-table").TableFeature;
6
+ columnFilteringFeature: import("@tanstack/solid-table").TableFeature;
7
+ rowSortingFeature: import("@tanstack/solid-table").TableFeature;
8
+ rowPaginationFeature: import("@tanstack/solid-table").TableFeature;
9
+ columnVisibilityFeature: import("@tanstack/solid-table").TableFeature;
10
+ rowSelectionFeature: import("@tanstack/solid-table").TableFeature;
11
+ filteredRowModel: (table: import("@tanstack/solid-table").Table<any, any>) => () => import("@tanstack/solid-table").RowModel<any, any>;
12
+ sortedRowModel: (table: import("@tanstack/solid-table").Table<any, any>) => () => import("@tanstack/solid-table").RowModel<any, any>;
13
+ paginatedRowModel: (table: import("@tanstack/solid-table").Table<any, any>) => () => import("@tanstack/solid-table").RowModel<any, any>;
14
+ filterFns: {
15
+ includesString: import("@tanstack/solid-table").CreatedFilterFn<any, any>;
16
+ inNumberRange: import("@tanstack/solid-table").CreatedFilterFn<any, any>;
17
+ equals: import("@tanstack/solid-table").CreatedFilterFn<any, any>;
18
+ arrIncludes: import("@tanstack/solid-table").CreatedFilterFn<any, any>;
19
+ arrIncludesSome: import("@tanstack/solid-table").CreatedFilterFn<any, any>;
20
+ inDateRange: import("@tanstack/solid-table").CreatedFilterFn<any, any>;
21
+ };
22
+ sortFns: {
23
+ text: import("@tanstack/solid-table").CreatedSortFn<any, any>;
24
+ alphanumeric: import("@tanstack/solid-table").CreatedSortFn<any, any>;
25
+ datetime: import("@tanstack/solid-table").CreatedSortFn<any, any>;
26
+ };
27
+ };
28
+ export type DataTableFeatures = typeof baseTableFeatures;
29
+ /**
30
+ * `filterVariant: 'date'` is the one thing a caller has to opt into
31
+ * explicitly (`updatedAt`/`createdAt`, or a custom `type: 'date'` column):
32
+ * unlike an array-valued column (detected automatically below, from the
33
+ * actual data), a date is just a string or number at runtime, nothing to
34
+ * sniff it from safely.
35
+ */
36
+ export type DataTableColumnMeta = {
37
+ filterVariant?: "date";
38
+ };
39
+ export type DataTableColumnDef<TData extends RowData, TValue = unknown> = ColumnDef<DataTableFeatures, TData, TValue> & {
40
+ meta?: DataTableColumnMeta;
41
+ };
42
+ export type DataTableProps<TData extends RowData> = {
43
+ data: TData[];
44
+ columns: DataTableColumnDef<TData, any>[];
45
+ getRowId?: (row: TData, index: number) => string;
46
+ emptyMessage?: string;
47
+ searchPlaceholder?: string;
48
+ bulkActions?: (selected: TData[], clear: () => void) => JSX.Element;
49
+ pagination?: boolean;
50
+ pageSizeOptions?: number[];
51
+ onSelectedRowsChange?: (rows: TData[]) => void;
52
+ onRowClick?: (row: TData) => void;
53
+ footer?: (columns: number) => JSX.Element;
54
+ isLoading?: boolean;
55
+ initialColumnVisibility?: ColumnVisibilityState;
56
+ "aria-label"?: string;
57
+ };
58
+ export declare function DataTable<TData extends RowData>(props: DataTableProps<TData>): JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { Column, RowData } from "@tanstack/solid-table";
2
+ import type { DataTableFeatures } from "./data-table";
3
+ export declare function FilterRow<TData extends RowData>(props: {
4
+ column: Column<DataTableFeatures, TData, unknown>;
5
+ data: TData[];
6
+ skip: string[];
7
+ isArrayColumn: boolean;
8
+ isDateColumn?: boolean;
9
+ }): import("solid-js").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export * from "./data-table";
2
+ export * from "./pagination";
3
+ export * from "./filter-row";
4
+ export * from "./columns";
@@ -0,0 +1,7 @@
1
+ /** @jsxImportSource solid-js */
2
+ import type { RowData, SolidTable } from "@tanstack/solid-table";
3
+ import type { DataTableFeatures } from "./data-table";
4
+ export declare function DataTablePagination<TData extends RowData>(props: {
5
+ table: SolidTable<DataTableFeatures, TData>;
6
+ pageSizeOptions?: number[];
7
+ }): import("solid-js").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@passui/tanstack",
3
- "version": "0.1.2",
3
+ "version": "0.2.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -14,6 +14,7 @@
14
14
  "access": "public"
15
15
  },
16
16
  "files": [
17
+ "dist",
17
18
  "src",
18
19
  "README.md",
19
20
  "LICENSE"
@@ -22,10 +23,16 @@
22
23
  "typecheck": "tsc --noEmit",
23
24
  "test": "vitest run",
24
25
  "publish:check": "bun pm pack --dry-run",
25
- "build": "tsc --noEmit"
26
+ "build": "vite build --mode client && vite build --mode server && tsc -p tsconfig.build.json"
26
27
  },
27
28
  "dependencies": {
28
- "@hugeicons/core-free-icons": "^4.3.5",
29
+ "@hugeicons/core-free-icons": "^4.3.5"
30
+ },
31
+ "peerDependencies": {
32
+ "react": "^19.3.0",
33
+ "react-dom": "^19.3.0",
34
+ "@tanstack/react-query": "^5.104.0",
35
+ "tailwindcss": "^4.3.3",
29
36
  "@hugeicons/react": "^1.1.10",
30
37
  "@tanstack/react-devtools": "^0.10.13",
31
38
  "@tanstack/react-form": "^1.33.5",
@@ -34,13 +41,13 @@
34
41
  "@tanstack/react-router-devtools": "^1.167.2",
35
42
  "@tanstack/react-table": "^9.2.4",
36
43
  "motion": "^13.4.4",
37
- "@passui/react": "^0.1.14"
38
- },
39
- "peerDependencies": {
40
- "react": "^19.3.0",
41
- "react-dom": "^19.3.0",
42
- "@tanstack/react-query": "^5.104.0",
43
- "tailwindcss": "^4.3.3"
44
+ "@passui/react": "^0.1.15",
45
+ "@passui/solid": "^0.1.1",
46
+ "solid-js": "^1.9.17",
47
+ "@tanstack/solid-form": "^1.33.5",
48
+ "@tanstack/solid-query": "^5.104.5",
49
+ "@tanstack/solid-router": "^1.170.43",
50
+ "@tanstack/solid-table": "^9.3.1"
44
51
  },
45
52
  "devDependencies": {
46
53
  "@types/node": "^26.6.3",
@@ -49,7 +56,26 @@
49
56
  "tailwindcss": "^4.3.3",
50
57
  "typescript": "^7.0.2",
51
58
  "vitest": "5.0.5",
52
- "vite": "8.3.5"
59
+ "vite": "8.3.5",
60
+ "@hugeicons/react": "^1.1.10",
61
+ "@tanstack/react-devtools": "^0.10.13",
62
+ "@tanstack/react-form": "^1.33.5",
63
+ "@tanstack/react-query-devtools": "^5.104.0",
64
+ "@tanstack/react-router": "^1.170.39",
65
+ "@tanstack/react-router-devtools": "^1.167.2",
66
+ "@tanstack/react-table": "^9.2.4",
67
+ "motion": "^13.4.4",
68
+ "@passui/react": "^0.1.15",
69
+ "@passui/solid": "^0.1.1",
70
+ "solid-js": "1.9.17",
71
+ "@tanstack/solid-form": "1.33.5",
72
+ "@tanstack/solid-query": "5.104.5",
73
+ "@tanstack/solid-router": "1.170.43",
74
+ "@tanstack/solid-table": "9.3.1",
75
+ "vite-plugin-solid": "2.11.14",
76
+ "react": "^19.3.0",
77
+ "react-dom": "^19.3.0",
78
+ "@tanstack/react-query": "^5.104.0"
53
79
  },
54
80
  "exports": {
55
81
  "./forms": "./src/forms/index.ts",
@@ -60,7 +86,122 @@
60
86
  "./settings": "./src/settings/index.ts",
61
87
  "./mutation": "./src/mutation/index.ts",
62
88
  "./route-boundary": "./src/route-boundary/index.ts",
63
- "./styles.css": "./src/styles.css"
89
+ "./styles.css": "./src/styles.css",
90
+ "./react/forms": "./src/forms/index.ts",
91
+ "./solid/forms": {
92
+ "types": "./dist/types/src/solid/forms/index.d.ts",
93
+ "browser": "./dist/client/src/solid/forms/index.js",
94
+ "node": "./dist/server/src/solid/forms/index.js",
95
+ "default": "./dist/client/src/solid/forms/index.js"
96
+ },
97
+ "./react/form-fields": "./src/form-fields/index.ts",
98
+ "./solid/form-fields": {
99
+ "types": "./dist/types/src/solid/form-fields/index.d.ts",
100
+ "browser": "./dist/client/src/solid/form-fields/index.js",
101
+ "node": "./dist/server/src/solid/form-fields/index.js",
102
+ "default": "./dist/client/src/solid/form-fields/index.js"
103
+ },
104
+ "./react/tables": "./src/tables/index.ts",
105
+ "./solid/tables": {
106
+ "types": "./dist/types/src/solid/tables/index.d.ts",
107
+ "browser": "./dist/client/src/solid/tables/index.js",
108
+ "node": "./dist/server/src/solid/tables/index.js",
109
+ "default": "./dist/client/src/solid/tables/index.js"
110
+ },
111
+ "./react/document": "./src/document/index.ts",
112
+ "./solid/document": {
113
+ "types": "./dist/types/src/solid/document/index.d.ts",
114
+ "browser": "./dist/client/src/solid/document/index.js",
115
+ "node": "./dist/server/src/solid/document/index.js",
116
+ "default": "./dist/client/src/solid/document/index.js"
117
+ },
118
+ "./react/auth-shell": "./src/auth-shell/index.ts",
119
+ "./solid/auth-shell": {
120
+ "types": "./dist/types/src/solid/auth-shell/index.d.ts",
121
+ "browser": "./dist/client/src/solid/auth-shell/index.js",
122
+ "node": "./dist/server/src/solid/auth-shell/index.js",
123
+ "default": "./dist/client/src/solid/auth-shell/index.js"
124
+ },
125
+ "./react/settings": "./src/settings/index.ts",
126
+ "./solid/settings": {
127
+ "types": "./dist/types/src/solid/settings/index.d.ts",
128
+ "browser": "./dist/client/src/solid/settings/index.js",
129
+ "node": "./dist/server/src/solid/settings/index.js",
130
+ "default": "./dist/client/src/solid/settings/index.js"
131
+ },
132
+ "./react/mutation": "./src/mutation/index.ts",
133
+ "./solid/mutation": {
134
+ "types": "./dist/types/src/solid/mutation/index.d.ts",
135
+ "browser": "./dist/client/src/solid/mutation/index.js",
136
+ "node": "./dist/server/src/solid/mutation/index.js",
137
+ "default": "./dist/client/src/solid/mutation/index.js"
138
+ },
139
+ "./react/route-boundary": "./src/route-boundary/index.ts",
140
+ "./solid/route-boundary": {
141
+ "types": "./dist/types/src/solid/route-boundary/index.d.ts",
142
+ "browser": "./dist/client/src/solid/route-boundary/index.js",
143
+ "node": "./dist/server/src/solid/route-boundary/index.js",
144
+ "default": "./dist/client/src/solid/route-boundary/index.js"
145
+ },
146
+ "./react/styles.css": "./src/styles.css",
147
+ "./solid/styles.css": "./src/solid/styles.css",
148
+ "./core": "./src/shared/index.ts"
64
149
  },
65
- "description": "TanStack form, table and router integrations for Passui."
150
+ "description": "TanStack form, table and router integrations for Passui.",
151
+ "peerDependenciesMeta": {
152
+ "react": {
153
+ "optional": true
154
+ },
155
+ "react-dom": {
156
+ "optional": true
157
+ },
158
+ "@tanstack/react-query": {
159
+ "optional": true
160
+ },
161
+ "@hugeicons/react": {
162
+ "optional": true
163
+ },
164
+ "@tanstack/react-devtools": {
165
+ "optional": true
166
+ },
167
+ "@tanstack/react-form": {
168
+ "optional": true
169
+ },
170
+ "@tanstack/react-query-devtools": {
171
+ "optional": true
172
+ },
173
+ "@tanstack/react-router": {
174
+ "optional": true
175
+ },
176
+ "@tanstack/react-router-devtools": {
177
+ "optional": true
178
+ },
179
+ "@tanstack/react-table": {
180
+ "optional": true
181
+ },
182
+ "motion": {
183
+ "optional": true
184
+ },
185
+ "@passui/react": {
186
+ "optional": true
187
+ },
188
+ "@passui/solid": {
189
+ "optional": true
190
+ },
191
+ "solid-js": {
192
+ "optional": true
193
+ },
194
+ "@tanstack/solid-form": {
195
+ "optional": true
196
+ },
197
+ "@tanstack/solid-query": {
198
+ "optional": true
199
+ },
200
+ "@tanstack/solid-router": {
201
+ "optional": true
202
+ },
203
+ "@tanstack/solid-table": {
204
+ "optional": true
205
+ }
206
+ }
66
207
  }
@@ -24,12 +24,8 @@ type MutationContext<TOptimisticData> =
24
24
  }
25
25
  | undefined
26
26
 
27
- export function shouldRestoreOptimisticSnapshot<T>(
28
- current: T | undefined,
29
- expected: T
30
- ) {
31
- return current === expected
32
- }
27
+ import { shouldRestoreOptimisticSnapshot } from "../shared/optimistic"
28
+ export { shouldRestoreOptimisticSnapshot } from "../shared/optimistic"
33
29
 
34
30
  type AppMutationOptions<TData, TVariables, TOptimisticData> =
35
31
  Omit<
@@ -0,0 +1,2 @@
1
+ export * from "./optimistic"
2
+ export * from "./table"
@@ -0,0 +1,7 @@
1
+ /** Restore only the snapshot this mutation wrote, preserving newer concurrent writes. */
2
+ export function shouldRestoreOptimisticSnapshot<T>(
3
+ current: T | undefined,
4
+ expected: T
5
+ ) {
6
+ return current === expected
7
+ }
@@ -0,0 +1,30 @@
1
+ export function isArrayValuedColumn<TData>(
2
+ data: TData[],
3
+ colId: string
4
+ ): boolean {
5
+ return data.some((row) =>
6
+ Array.isArray((row as Record<string, unknown>)[colId])
7
+ )
8
+ }
9
+ export function getColumnLabel(column: {
10
+ columnDef: { header?: unknown }
11
+ id: string
12
+ }) {
13
+ const header = column.columnDef.header
14
+ return typeof header === "string"
15
+ ? header
16
+ : column.id
17
+ .replace(/([A-Z])/g, " $1")
18
+ .replace(/^./, (value) => value.toUpperCase())
19
+ }
20
+ export function columnIdOf(column: {
21
+ id?: string
22
+ accessorKey?: unknown
23
+ }): string | undefined {
24
+ return (
25
+ column.id ||
26
+ (typeof column.accessorKey === "string"
27
+ ? column.accessorKey
28
+ : undefined)
29
+ )
30
+ }
@@ -0,0 +1,20 @@
1
+ /** @jsxImportSource solid-js */
2
+ import { Outlet, useLocation } from "@tanstack/solid-router"
3
+ import { Show, type JSX } from "solid-js"
4
+ export function AuthShell(props: { brand: JSX.Element }) {
5
+ const location = useLocation()
6
+ return (
7
+ <section class="relative isolate flex min-h-dvh flex-col items-center justify-center px-4 py-12">
8
+ <div class="flex w-full max-w-[26rem] flex-col items-start gap-6">
9
+ {props.brand}
10
+ <Show when={location().pathname} keyed>
11
+ {(_pathname) => (
12
+ <div class="w-full motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-right-4 motion-safe:duration-500">
13
+ <Outlet />
14
+ </div>
15
+ )}
16
+ </Show>
17
+ </div>
18
+ </section>
19
+ )
20
+ }
@@ -0,0 +1 @@
1
+ export * from "./auth-shell"
@@ -0,0 +1,69 @@
1
+ /** @jsxImportSource solid-js */
2
+ import { splitProps, type JSX } from "solid-js"
3
+ import { HydrationScript } from "solid-js/web"
4
+ import { cn } from "@passui/solid/cn"
5
+ function Window(
6
+ props: JSX.HTMLAttributes<HTMLBodyElement> & {
7
+ after?: JSX.Element
8
+ before?: JSX.Element
9
+ className?: string
10
+ }
11
+ ) {
12
+ const [local, rest] = splitProps(props, [
13
+ "children",
14
+ "after",
15
+ "before",
16
+ "class",
17
+ "className",
18
+ ])
19
+ return (
20
+ <body
21
+ {...rest}
22
+ class={cn(
23
+ "fixed h-svh w-full min-w-full bg-background overflow-x-hidden typeset wrap-anywhere flex flex-col",
24
+ local.class,
25
+ local.className
26
+ )}
27
+ >
28
+ {local.before}
29
+ <main class="flex flex-1 flex-col min-h-svh overflow-auto no-scrollbar">
30
+ {local.children}
31
+ </main>
32
+ {local.after}
33
+ </body>
34
+ )
35
+ }
36
+ export const ComposeViewport = Object.assign(
37
+ function ComposeViewport(
38
+ props: JSX.IntrinsicElements["html"] & {
39
+ className?: string
40
+ head?: JSX.Element
41
+ }
42
+ ) {
43
+ const [local, rest] = splitProps(props, [
44
+ "class",
45
+ "className",
46
+ "lang",
47
+ "head",
48
+ "children",
49
+ ])
50
+ return (
51
+ <html
52
+ {...rest}
53
+ lang={local.lang ?? "en"}
54
+ class={cn(
55
+ "antialiased blur-none",
56
+ local.class,
57
+ local.className
58
+ )}
59
+ >
60
+ <head>
61
+ <HydrationScript />
62
+ {local.head}
63
+ </head>
64
+ {local.children}
65
+ </html>
66
+ )
67
+ },
68
+ { Window }
69
+ )
@@ -0,0 +1 @@
1
+ export * from "./compose-viewport"