@passui/tanstack 0.3.0 → 0.4.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.
- package/dist/document/compose-viewport.d.ts +13 -1
- package/dist/document/compose-viewport.js +15 -6
- package/dist/document/meta.d.ts +24 -0
- package/dist/document/meta.js +25 -0
- package/dist/document.d.ts +2 -1
- package/dist/document.js +3 -1
- package/dist/form-fields/fields.d.ts +7 -2
- package/dist/form-fields/fields.js +5 -2
- package/dist/forms/elements/form-alert.js +1 -1
- package/dist/forms/fields/avatar-picker.js +2 -2
- package/dist/forms/fields/avatar.js +2 -2
- package/dist/route-boundary/default-boundary.js +2 -2
- package/dist/route-boundary/not-founder.js +3 -3
- package/dist/settings/setting-list.js +5 -5
- package/dist/tables/data-table.js +12 -12
- package/dist/tables/filter-row.js +7 -7
- package/package.json +4 -4
|
@@ -9,12 +9,24 @@ type WindowProps = ComponentPropsWithoutRef<"body"> & {
|
|
|
9
9
|
* body", not nested inside the app's content wrapper.
|
|
10
10
|
*/
|
|
11
11
|
after?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* `"container"` (default) fixes `<body>` and scrolls inside `<main>`.
|
|
14
|
+
* `"document"` lets the page itself scroll, which is what lets iOS Safari
|
|
15
|
+
* collapse its toolbar and tint the overscroll area.
|
|
16
|
+
*/
|
|
17
|
+
scroll?: "container" | "document";
|
|
18
|
+
/**
|
|
19
|
+
* iOS only: a 6px transparent strip fixed to the bottom edge, so Safari
|
|
20
|
+
* treats the area under the toolbar as page chrome. Off unless a real
|
|
21
|
+
* device shows the gap it closes.
|
|
22
|
+
*/
|
|
23
|
+
edgeShim?: boolean;
|
|
12
24
|
};
|
|
13
25
|
export declare function ComposeViewport({ children, lang, className, ...props }: ComposeViewportProps): import("react").JSX.Element;
|
|
14
26
|
export declare namespace ComposeViewport {
|
|
15
27
|
export { Window };
|
|
16
28
|
export { Devtools };
|
|
17
29
|
}
|
|
18
|
-
declare function Window({ className, children, after, ...props }: WindowProps): import("react").JSX.Element;
|
|
30
|
+
declare function Window({ className, children, after, scroll, edgeShim, ...props }: WindowProps): import("react").JSX.Element;
|
|
19
31
|
declare function Devtools(): import("react").JSX.Element;
|
|
20
32
|
export {};
|
|
@@ -13,14 +13,23 @@ function ComposeViewport({ children, lang = "en", className, ...props }) {
|
|
|
13
13
|
children
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
function Window({ className, children, after, ...props }) {
|
|
16
|
+
function Window({ className, children, after, scroll = "container", edgeShim = false, ...props }) {
|
|
17
|
+
const documentScroll = scroll === "document";
|
|
17
18
|
return /* @__PURE__ */ jsxs("body", {
|
|
18
|
-
className: cn("bg-background
|
|
19
|
+
className: cn("bg-background w-full min-w-full", "selection:bg-accent/20", "typeset wrap-anywhere duration-200", "flex flex-col", documentScroll ? "min-h-dvh overflow-x-clip" : "fixed h-svh overflow-x-hidden", className),
|
|
19
20
|
...props,
|
|
20
|
-
children: [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsx("main", {
|
|
23
|
+
className: cn("no-scrollbar flex flex-1 flex-col", documentScroll ? "min-h-0 overflow-visible" : "min-h-svh overflow-auto"),
|
|
24
|
+
children
|
|
25
|
+
}),
|
|
26
|
+
edgeShim && /* @__PURE__ */ jsx("div", {
|
|
27
|
+
"aria-hidden": "true",
|
|
28
|
+
"data-slot": "edge-shim",
|
|
29
|
+
className: "ios:block pointer-events-none fixed inset-x-0 -bottom-px z-9999 hidden h-1.5 w-full"
|
|
30
|
+
}),
|
|
31
|
+
after
|
|
32
|
+
]
|
|
24
33
|
});
|
|
25
34
|
}
|
|
26
35
|
function Devtools() {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Head tags every Passui document needs. Spread them into the root route's
|
|
3
|
+
* `head().meta`:
|
|
4
|
+
*
|
|
5
|
+
* meta: [{ charSet: "utf-8" }, viewportMeta, ...themeColorMeta({ light, dark })]
|
|
6
|
+
*/
|
|
7
|
+
/** `viewport-fit=cover` lets `env(safe-area-inset-*)` report the notch and home bar. */
|
|
8
|
+
export declare const viewportMeta: {
|
|
9
|
+
readonly name: "viewport";
|
|
10
|
+
readonly content: "width=device-width, initial-scale=1, viewport-fit=cover";
|
|
11
|
+
};
|
|
12
|
+
/** Tints the browser chrome on Android. iOS Safari reads the page background instead. */
|
|
13
|
+
export declare function themeColorMeta(colors: {
|
|
14
|
+
light: string;
|
|
15
|
+
dark: string;
|
|
16
|
+
}): readonly [{
|
|
17
|
+
readonly name: "theme-color";
|
|
18
|
+
readonly content: string;
|
|
19
|
+
readonly media: "(prefers-color-scheme: light)";
|
|
20
|
+
}, {
|
|
21
|
+
readonly name: "theme-color";
|
|
22
|
+
readonly content: string;
|
|
23
|
+
readonly media: "(prefers-color-scheme: dark)";
|
|
24
|
+
}];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/document/meta.ts
|
|
2
|
+
/**
|
|
3
|
+
* Head tags every Passui document needs. Spread them into the root route's
|
|
4
|
+
* `head().meta`:
|
|
5
|
+
*
|
|
6
|
+
* meta: [{ charSet: "utf-8" }, viewportMeta, ...themeColorMeta({ light, dark })]
|
|
7
|
+
*/
|
|
8
|
+
/** `viewport-fit=cover` lets `env(safe-area-inset-*)` report the notch and home bar. */
|
|
9
|
+
const viewportMeta = {
|
|
10
|
+
name: "viewport",
|
|
11
|
+
content: "width=device-width, initial-scale=1, viewport-fit=cover"
|
|
12
|
+
};
|
|
13
|
+
/** Tints the browser chrome on Android. iOS Safari reads the page background instead. */
|
|
14
|
+
function themeColorMeta(colors) {
|
|
15
|
+
return [{
|
|
16
|
+
name: "theme-color",
|
|
17
|
+
content: colors.light,
|
|
18
|
+
media: "(prefers-color-scheme: light)"
|
|
19
|
+
}, {
|
|
20
|
+
name: "theme-color",
|
|
21
|
+
content: colors.dark,
|
|
22
|
+
media: "(prefers-color-scheme: dark)"
|
|
23
|
+
}];
|
|
24
|
+
}
|
|
25
|
+
export { themeColorMeta, viewportMeta };
|
package/dist/document.d.ts
CHANGED
package/dist/document.js
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
import { InputSize, InputVariant } from "@passui/react/input";
|
|
1
2
|
import { ComponentProps, ReactNode } from "react";
|
|
2
3
|
export declare const PeachFieldLabels: import("react").Context<{
|
|
3
4
|
show: string;
|
|
4
5
|
hide: string;
|
|
5
6
|
} | undefined>;
|
|
6
|
-
export type FieldInputProps = Omit<ComponentProps<"input">, "value" | "onChange" | "onBlur" | "name"> & {
|
|
7
|
+
export type FieldInputProps = Omit<ComponentProps<"input">, "value" | "onChange" | "onBlur" | "name" | "size"> & {
|
|
8
|
+
/** Height and text, from Passui's control scale. @default "md" */
|
|
9
|
+
size?: InputSize;
|
|
10
|
+
/** `floating` outlines the field and lifts the label into its top edge. @default "default" */
|
|
11
|
+
variant?: InputVariant;
|
|
7
12
|
label: string;
|
|
8
13
|
description?: string;
|
|
9
14
|
/** Leading icon or text inside the field. */
|
|
10
15
|
icon?: ReactNode;
|
|
11
16
|
};
|
|
12
17
|
/** A labelled input wired to the TanStack form field. Password fields get a show/hide button. */
|
|
13
|
-
export declare function FieldInput({ label, description, icon, type, id, ...props }: FieldInputProps): import("react").JSX.Element;
|
|
18
|
+
export declare function FieldInput({ label, description, icon, type, id, size, variant, ...props }: FieldInputProps): import("react").JSX.Element;
|
|
14
19
|
export declare function FieldCheckbox({ label }: {
|
|
15
20
|
label: string;
|
|
16
21
|
}): import("react").JSX.Element;
|
|
@@ -17,7 +17,7 @@ function useFieldErrors() {
|
|
|
17
17
|
return field.state.meta.isTouched ? Array.from(new Set(field.state.meta.errors.flatMap((error) => error && typeof error === "object" && "message" in error && error.message ? [String(error.message)] : []))) : [];
|
|
18
18
|
}
|
|
19
19
|
/** A labelled input wired to the TanStack form field. Password fields get a show/hide button. */
|
|
20
|
-
function FieldInput({ label, description, icon, type, id, ...props }) {
|
|
20
|
+
function FieldInput({ label, description, icon, type, id, size, variant, ...props }) {
|
|
21
21
|
const field = useFieldContext();
|
|
22
22
|
const reveal = useContext(PeachFieldLabels);
|
|
23
23
|
const [shown, setShown] = useState(false);
|
|
@@ -40,7 +40,7 @@ function FieldInput({ label, description, icon, type, id, ...props }) {
|
|
|
40
40
|
return /* @__PURE__ */ jsxs(Field, {
|
|
41
41
|
invalid,
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */ jsx(FieldLabel, {
|
|
43
|
+
variant === "floating" && !icon && !isPassword ? null : /* @__PURE__ */ jsx(FieldLabel, {
|
|
44
44
|
htmlFor: inputId,
|
|
45
45
|
children: label
|
|
46
46
|
}),
|
|
@@ -63,6 +63,9 @@ function FieldInput({ label, description, icon, type, id, ...props }) {
|
|
|
63
63
|
}) : null
|
|
64
64
|
] }) : /* @__PURE__ */ jsx(Input, {
|
|
65
65
|
...common,
|
|
66
|
+
size,
|
|
67
|
+
variant,
|
|
68
|
+
label,
|
|
66
69
|
type
|
|
67
70
|
}),
|
|
68
71
|
description ? /* @__PURE__ */ jsx(FieldDescription, {
|
|
@@ -6,7 +6,7 @@ import { WarningIcon } from "@passui/icons/warning";
|
|
|
6
6
|
function FormAlert({ children, className }) {
|
|
7
7
|
return /* @__PURE__ */ jsxs("div", {
|
|
8
8
|
role: "alert",
|
|
9
|
-
className: cn("bg-
|
|
9
|
+
className: cn("bg-danger/12 text-subheadline text-danger ring-danger/25 flex items-start gap-2.5 rounded-2xl px-4 py-3 font-medium ring-1 ring-inset", "motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-95 motion-safe:duration-300", className),
|
|
10
10
|
children: [/* @__PURE__ */ jsx(WarningIcon, {
|
|
11
11
|
size: 16,
|
|
12
12
|
className: "mt-px shrink-0"
|
|
@@ -50,7 +50,7 @@ function Option({ icon: Icon, tone = "default", onClick, children }) {
|
|
|
50
50
|
return /* @__PURE__ */ jsxs("button", {
|
|
51
51
|
type: "button",
|
|
52
52
|
onClick,
|
|
53
|
-
className: cn("text-subheadline flex w-full items-center gap-3 px-4 py-3 text-left transition-colors", "hover:bg-
|
|
53
|
+
className: cn("text-subheadline flex w-full items-center gap-3 px-4 py-3 text-left transition-colors", "hover:bg-label/[0.04] focus-visible:bg-label/[0.06] focus-visible:outline-none", tone === "destructive" && "text-danger"),
|
|
54
54
|
children: [/* @__PURE__ */ jsx(Icon, {
|
|
55
55
|
size: 18,
|
|
56
56
|
className: "shrink-0 opacity-80"
|
|
@@ -175,7 +175,7 @@ function AvatarPicker({ open, onOpenChange, label, image, clearable, labels, onC
|
|
|
175
175
|
})]
|
|
176
176
|
}),
|
|
177
177
|
/* @__PURE__ */ jsxs("div", {
|
|
178
|
-
className: "divide-
|
|
178
|
+
className: "divide-separator/40 border-separator/35 bg-elevated m-3 flex flex-col divide-y overflow-hidden rounded-2xl border shadow-xs",
|
|
179
179
|
children: [
|
|
180
180
|
/* @__PURE__ */ jsx(Option, {
|
|
181
181
|
icon: PhotoIcon,
|
|
@@ -110,7 +110,7 @@ function FieldAvatar({ compact = false, existingImage, label, accept = "image/pn
|
|
|
110
110
|
pending && /* @__PURE__ */ jsxs("div", {
|
|
111
111
|
className: "animate-in fade-in-0 slide-in-from-top-1 flex flex-col items-center gap-2 duration-300",
|
|
112
112
|
children: [/* @__PURE__ */ jsx("p", {
|
|
113
|
-
className: "text-
|
|
113
|
+
className: "text-label-secondary",
|
|
114
114
|
children: text.confirmHint
|
|
115
115
|
}), /* @__PURE__ */ jsxs("div", {
|
|
116
116
|
className: "flex items-center gap-1",
|
|
@@ -133,7 +133,7 @@ function FieldAvatar({ compact = false, existingImage, label, accept = "image/pn
|
|
|
133
133
|
type: "button",
|
|
134
134
|
variant: "ghost",
|
|
135
135
|
size: "sm",
|
|
136
|
-
className: "text-
|
|
136
|
+
className: "text-label-secondary",
|
|
137
137
|
onClick: () => field.handleChange(false),
|
|
138
138
|
children: [/* @__PURE__ */ jsx(TrashIcon, { size: 16 }), text.remove]
|
|
139
139
|
})
|
|
@@ -9,9 +9,9 @@ function DefaultBoundary({ error }) {
|
|
|
9
9
|
return /* @__PURE__ */ jsxs("div", {
|
|
10
10
|
className: "flex min-h-100 w-full flex-col items-center justify-center gap-6 p-6 text-center",
|
|
11
11
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
12
|
-
className: "border-
|
|
12
|
+
className: "border-danger/20 bg-danger/5 w-full max-w-md overflow-hidden rounded-md border p-4 text-left",
|
|
13
13
|
children: [/* @__PURE__ */ jsx("p", {
|
|
14
|
-
className: "text-caption text-
|
|
14
|
+
className: "text-caption text-danger mb-2 font-semibold tracking-wider uppercase",
|
|
15
15
|
children: "Application Error"
|
|
16
16
|
}), /* @__PURE__ */ jsx(ErrorComponent, { error })]
|
|
17
17
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -13,15 +13,15 @@ function NotFound({ children }) {
|
|
|
13
13
|
className: "flex flex-col items-center gap-2",
|
|
14
14
|
children: [
|
|
15
15
|
/* @__PURE__ */ jsx("span", {
|
|
16
|
-
className: "text-caption text-
|
|
16
|
+
className: "text-caption text-danger font-mono font-semibold tracking-widest uppercase",
|
|
17
17
|
children: "Error 404"
|
|
18
18
|
}),
|
|
19
19
|
/* @__PURE__ */ jsx("h2", {
|
|
20
|
-
className: "text-
|
|
20
|
+
className: "text-label text-2xl font-bold tracking-tight",
|
|
21
21
|
children: "Page Not Found"
|
|
22
22
|
}),
|
|
23
23
|
/* @__PURE__ */ jsx("p", {
|
|
24
|
-
className: "text-subheadline text-
|
|
24
|
+
className: "text-subheadline text-label-secondary max-w-70",
|
|
25
25
|
children: "The page you are looking for might have been moved, renamed, or deleted."
|
|
26
26
|
})
|
|
27
27
|
]
|
|
@@ -12,7 +12,7 @@ import { CopyIcon } from "@passui/icons/copy";
|
|
|
12
12
|
* (even rows wrapped in a Preview), a soft highlight under the one you point at.
|
|
13
13
|
*/
|
|
14
14
|
function SettingList({ id, as: Heading = "h2", icon, title, description, action, variant = "inset", children, className }) {
|
|
15
|
-
const lines = cn("[&>*+*]:border-
|
|
15
|
+
const lines = cn("[&>*+*]:border-separator/40 [&>*+*]:border-t", "[&_.setting-row+.setting-row]:border-separator/40 [&_.setting-row+.setting-row]:border-t");
|
|
16
16
|
if (variant === "tile") return /* @__PURE__ */ jsxs("section", {
|
|
17
17
|
id,
|
|
18
18
|
className: cn("border-separator/70 bg-elevated flex scroll-mt-24 flex-col overflow-hidden rounded-3xl border shadow-sm", className),
|
|
@@ -26,7 +26,7 @@ function SettingList({ id, as: Heading = "h2", icon, title, description, action,
|
|
|
26
26
|
className: "text-callout",
|
|
27
27
|
children: title
|
|
28
28
|
}), description && /* @__PURE__ */ jsx("p", {
|
|
29
|
-
className: "text-footnote text-
|
|
29
|
+
className: "text-footnote text-label-secondary",
|
|
30
30
|
children: description
|
|
31
31
|
})]
|
|
32
32
|
}),
|
|
@@ -53,14 +53,14 @@ function SettingList({ id, as: Heading = "h2", icon, title, description, action,
|
|
|
53
53
|
})]
|
|
54
54
|
}), action]
|
|
55
55
|
}), /* @__PURE__ */ jsx("div", {
|
|
56
|
-
className: cn("border-
|
|
56
|
+
className: cn("border-separator/35 bg-elevated flex flex-col overflow-hidden rounded-xl border shadow-xs", lines),
|
|
57
57
|
children
|
|
58
58
|
})]
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
function Row({ icon, title, description, value, trailing, to, params, hash, onClick, chevron, tone = "default" }) {
|
|
62
62
|
const interactive = Boolean(to || onClick);
|
|
63
|
-
const className = cn("setting-row flex min-h-10 w-full items-center gap-3 px-3.5 py-1.5 text-left", interactive && "hover:bg-
|
|
63
|
+
const className = cn("setting-row flex min-h-10 w-full items-center gap-3 px-3.5 py-1.5 text-left", interactive && "hover:bg-label/[0.035] focus-visible:bg-label/[0.05] cursor-pointer transition-colors focus-visible:outline-none", tone === "destructive" && "[&_h3]:text-danger");
|
|
64
64
|
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
65
65
|
icon,
|
|
66
66
|
/* @__PURE__ */ jsxs("span", {
|
|
@@ -74,7 +74,7 @@ function Row({ icon, title, description, value, trailing, to, params, hash, onCl
|
|
|
74
74
|
})]
|
|
75
75
|
}),
|
|
76
76
|
value && /* @__PURE__ */ jsx("span", {
|
|
77
|
-
className: "text-subheadline text-
|
|
77
|
+
className: "text-subheadline text-label-secondary max-w-[45%] truncate",
|
|
78
78
|
children: value
|
|
79
79
|
}),
|
|
80
80
|
trailing,
|
|
@@ -44,11 +44,11 @@ function ToolbarToggle({ label, count, open, onClick }) {
|
|
|
44
44
|
type: "button",
|
|
45
45
|
"aria-expanded": open,
|
|
46
46
|
onClick,
|
|
47
|
-
className: cn("border-
|
|
47
|
+
className: cn("border-separator/40 text-caption flex h-8 cursor-pointer items-center gap-1.5 rounded-full border px-3 transition-colors", open || count > 0 ? "bg-label/[0.07] text-label" : "text-label-secondary hover:bg-label/[0.04] hover:text-label"),
|
|
48
48
|
children: [
|
|
49
49
|
label,
|
|
50
50
|
count > 0 && /* @__PURE__ */ jsx("span", {
|
|
51
|
-
className: "bg-
|
|
51
|
+
className: "bg-label/10 rounded-full px-1.5 tabular-nums",
|
|
52
52
|
children: count
|
|
53
53
|
}),
|
|
54
54
|
/* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
@@ -172,7 +172,7 @@ function DataTable({ data, columns, getRowId, emptyMessage = "No results.", sear
|
|
|
172
172
|
]
|
|
173
173
|
}),
|
|
174
174
|
columnsOpen && /* @__PURE__ */ jsxs("div", {
|
|
175
|
-
className: "border-
|
|
175
|
+
className: "border-separator/40 bg-label/[0.025] flex flex-col gap-2 rounded-2xl border p-4",
|
|
176
176
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
177
177
|
className: "flex items-center justify-between",
|
|
178
178
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
@@ -183,7 +183,7 @@ function DataTable({ data, columns, getRowId, emptyMessage = "No results.", sear
|
|
|
183
183
|
variant: "ghost",
|
|
184
184
|
size: "sm",
|
|
185
185
|
onClick: () => table.resetColumnVisibility(),
|
|
186
|
-
className: "text-
|
|
186
|
+
className: "text-label-secondary hover:text-label",
|
|
187
187
|
children: "Show all"
|
|
188
188
|
})]
|
|
189
189
|
}), /* @__PURE__ */ jsx("div", {
|
|
@@ -205,7 +205,7 @@ function DataTable({ data, columns, getRowId, emptyMessage = "No results.", sear
|
|
|
205
205
|
})]
|
|
206
206
|
}),
|
|
207
207
|
filtersOpen && /* @__PURE__ */ jsxs("div", {
|
|
208
|
-
className: "border-
|
|
208
|
+
className: "border-separator/40 bg-label/[0.025] flex flex-col gap-2 rounded-2xl border p-4",
|
|
209
209
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
210
210
|
className: "flex items-center justify-between",
|
|
211
211
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
@@ -216,11 +216,11 @@ function DataTable({ data, columns, getRowId, emptyMessage = "No results.", sear
|
|
|
216
216
|
variant: "ghost",
|
|
217
217
|
size: "sm",
|
|
218
218
|
onClick: () => setColumnFilters([]),
|
|
219
|
-
className: "text-
|
|
219
|
+
className: "text-label-secondary hover:text-label",
|
|
220
220
|
children: [/* @__PURE__ */ jsx(CloseIcon, { size: 12 }), "Clear all"]
|
|
221
221
|
})]
|
|
222
222
|
}), filterableColumns.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
223
|
-
className: "text-caption text-
|
|
223
|
+
className: "text-caption text-label-secondary/60",
|
|
224
224
|
children: "No filterable columns."
|
|
225
225
|
}) : /* @__PURE__ */ jsx("div", {
|
|
226
226
|
className: "flex flex-col gap-3",
|
|
@@ -234,7 +234,7 @@ function DataTable({ data, columns, getRowId, emptyMessage = "No results.", sear
|
|
|
234
234
|
})]
|
|
235
235
|
}),
|
|
236
236
|
bulkActions && selectedCount > 0 && /* @__PURE__ */ jsxs("div", {
|
|
237
|
-
className: "border-
|
|
237
|
+
className: "border-separator/40 bg-label/[0.035] flex items-center gap-3 rounded-full border py-1.5 pr-1.5 pl-4",
|
|
238
238
|
children: [
|
|
239
239
|
/* @__PURE__ */ jsxs("span", {
|
|
240
240
|
className: "text-caption font-medium",
|
|
@@ -247,7 +247,7 @@ function DataTable({ data, columns, getRowId, emptyMessage = "No results.", sear
|
|
|
247
247
|
variant: "ghost",
|
|
248
248
|
size: "sm",
|
|
249
249
|
onClick: clearSelection,
|
|
250
|
-
className: "text-
|
|
250
|
+
className: "text-label-secondary hover:text-label ml-auto",
|
|
251
251
|
children: "Clear"
|
|
252
252
|
})
|
|
253
253
|
]
|
|
@@ -257,12 +257,12 @@ function DataTable({ data, columns, getRowId, emptyMessage = "No results.", sear
|
|
|
257
257
|
className: cn("divide-none!", isLoading && "opacity-60 transition-opacity"),
|
|
258
258
|
children: [
|
|
259
259
|
/* @__PURE__ */ jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, {
|
|
260
|
-
className: "border-
|
|
260
|
+
className: "border-separator/40 border-b hover:bg-transparent",
|
|
261
261
|
children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(TableHead, {
|
|
262
262
|
"aria-sort": header.column.getCanSort() ? header.column.getIsSorted() === "asc" ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : "none" : void 0,
|
|
263
263
|
children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ jsxs("button", {
|
|
264
264
|
type: "button",
|
|
265
|
-
className: "text-
|
|
265
|
+
className: "text-label-secondary hover:text-label flex w-fit items-center gap-1 focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
266
266
|
onClick: header.column.getToggleSortingHandler(),
|
|
267
267
|
children: [flexRender(header.column.columnDef.header, header.getContext()), /* @__PURE__ */ jsxs("div", {
|
|
268
268
|
className: "flex flex-col",
|
|
@@ -278,7 +278,7 @@ function DataTable({ data, columns, getRowId, emptyMessage = "No results.", sear
|
|
|
278
278
|
}, header.id))
|
|
279
279
|
}, headerGroup.id)) }),
|
|
280
280
|
/* @__PURE__ */ jsx(TableBody, { children: rows.length ? rows.map((row) => /* @__PURE__ */ jsx(TableRow, {
|
|
281
|
-
className: cn("border-
|
|
281
|
+
className: cn("border-separator/25 hover:bg-label/[0.025] border-b transition-colors last:border-b-0", onRowClick && "cursor-pointer"),
|
|
282
282
|
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
283
283
|
onClick: (event) => {
|
|
284
284
|
if (event.target instanceof Element && event.target.closest("a,button,input,select,textarea,[role='button'],[data-stop-row-click]")) return;
|
|
@@ -42,7 +42,7 @@ function FilterRow({ column, data, skip, isArrayColumn, isDateColumn }) {
|
|
|
42
42
|
return /* @__PURE__ */ jsxs("div", {
|
|
43
43
|
className: "flex items-center gap-3",
|
|
44
44
|
children: [/* @__PURE__ */ jsx("span", {
|
|
45
|
-
className: "text-caption2 text-
|
|
45
|
+
className: "text-caption2 text-label-secondary w-20 shrink-0 font-medium",
|
|
46
46
|
children: label
|
|
47
47
|
}), /* @__PURE__ */ jsxs("div", {
|
|
48
48
|
className: "flex items-center gap-2",
|
|
@@ -54,7 +54,7 @@ function FilterRow({ column, data, skip, isArrayColumn, isDateColumn }) {
|
|
|
54
54
|
className: "border-input/40 bg-background text-caption h-7 rounded-none border border-dashed px-2 outline-none"
|
|
55
55
|
}),
|
|
56
56
|
/* @__PURE__ */ jsx("span", {
|
|
57
|
-
className: "text-caption2 text-
|
|
57
|
+
className: "text-caption2 text-label-secondary",
|
|
58
58
|
children: "to"
|
|
59
59
|
}),
|
|
60
60
|
/* @__PURE__ */ jsx("input", {
|
|
@@ -68,7 +68,7 @@ function FilterRow({ column, data, skip, isArrayColumn, isDateColumn }) {
|
|
|
68
68
|
type: "button",
|
|
69
69
|
size: "icon-sm",
|
|
70
70
|
onClick: () => column.setFilterValue(void 0),
|
|
71
|
-
className: "text-
|
|
71
|
+
className: "text-label-secondary hover:text-label",
|
|
72
72
|
children: /* @__PURE__ */ jsx(CloseIcon, { size: 12 })
|
|
73
73
|
})
|
|
74
74
|
]
|
|
@@ -105,7 +105,7 @@ function FilterRow({ column, data, skip, isArrayColumn, isDateColumn }) {
|
|
|
105
105
|
variant: "ghost",
|
|
106
106
|
size: "sm",
|
|
107
107
|
onClick: () => column.setFilterValue(void 0),
|
|
108
|
-
className: "text-
|
|
108
|
+
className: "text-label-secondary hover:text-label",
|
|
109
109
|
children: [/* @__PURE__ */ jsx(CloseIcon, { size: 12 }), "Clear"]
|
|
110
110
|
})]
|
|
111
111
|
})]
|
|
@@ -113,7 +113,7 @@ function FilterRow({ column, data, skip, isArrayColumn, isDateColumn }) {
|
|
|
113
113
|
return /* @__PURE__ */ jsxs("div", {
|
|
114
114
|
className: "flex items-center gap-3",
|
|
115
115
|
children: [/* @__PURE__ */ jsx("span", {
|
|
116
|
-
className: "text-caption2 text-
|
|
116
|
+
className: "text-caption2 text-label-secondary w-20 shrink-0 font-medium capitalize",
|
|
117
117
|
children: label
|
|
118
118
|
}), /* @__PURE__ */ jsxs("div", {
|
|
119
119
|
className: "relative max-w-xs flex-1",
|
|
@@ -122,13 +122,13 @@ function FilterRow({ column, data, skip, isArrayColumn, isDateColumn }) {
|
|
|
122
122
|
placeholder: `Filter ${label.toLowerCase()}…`,
|
|
123
123
|
value: activeValue ?? "",
|
|
124
124
|
onChange: (e) => column.setFilterValue(e.target.value ? isArrayColumn ? [e.target.value] : e.target.value : void 0),
|
|
125
|
-
className: "border-input/40 bg-background text-caption placeholder:text-
|
|
125
|
+
className: "border-input/40 bg-background text-caption placeholder:text-label-secondary/40 h-7 w-full rounded-none border border-dashed px-2.5 outline-none"
|
|
126
126
|
}), activeValue && /* @__PURE__ */ jsx(Button, {
|
|
127
127
|
"aria-label": "Clear filter",
|
|
128
128
|
type: "button",
|
|
129
129
|
size: "icon-sm",
|
|
130
130
|
onClick: () => column.setFilterValue(void 0),
|
|
131
|
-
className: "text-
|
|
131
|
+
className: "text-label-secondary hover:text-label absolute top-1/2 right-1 -translate-y-1/2",
|
|
132
132
|
children: /* @__PURE__ */ jsx(CloseIcon, { size: 12 })
|
|
133
133
|
})]
|
|
134
134
|
})]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@passui/tanstack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@tanstack/react-router-devtools": "^1.167.2",
|
|
39
39
|
"@tanstack/react-table": "^9.2.4",
|
|
40
40
|
"motion": "^13.4.4",
|
|
41
|
-
"@passui/react": "^0.
|
|
41
|
+
"@passui/react": "^0.3.0",
|
|
42
42
|
"@passui/icons": "^0.1.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
"@tanstack/react-router-devtools": "^1.167.2",
|
|
57
57
|
"@tanstack/react-table": "^9.2.4",
|
|
58
58
|
"motion": "14.12.0",
|
|
59
|
-
"@passui/react": "^0.
|
|
59
|
+
"@passui/react": "^0.3.0",
|
|
60
60
|
"react": "^19.3.0",
|
|
61
61
|
"react-dom": "^19.3.0",
|
|
62
62
|
"@tanstack/react-query": "^5.104.0",
|
|
63
63
|
"tsdown": "0.23.7",
|
|
64
|
-
"@passui/icons": "^0.1.
|
|
64
|
+
"@passui/icons": "^0.1.1"
|
|
65
65
|
},
|
|
66
66
|
"exports": {
|
|
67
67
|
"./auth-shell": "./dist/auth-shell.js",
|