@passui/tanstack 0.2.5 → 0.2.7

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.
@@ -1 +1,6 @@
1
- export declare function DefaultLoader(): import("react").JSX.Element;
1
+ export type DefaultLoaderProps = {
2
+ /** Translated loading status for assistive technology; never displayed visually. */
3
+ label?: string;
4
+ className?: string;
5
+ };
6
+ export declare function DefaultLoader({ label, className }?: DefaultLoaderProps): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@passui/tanstack",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "@tanstack/react-router-devtools": "^1.167.2",
42
42
  "@tanstack/react-table": "^9.2.4",
43
43
  "motion": "^13.4.4",
44
- "@passui/react": "^0.1.20"
44
+ "@passui/react": "^0.1.24"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/node": "^26.6.3",
@@ -59,7 +59,7 @@
59
59
  "@tanstack/react-router-devtools": "^1.167.2",
60
60
  "@tanstack/react-table": "^9.2.4",
61
61
  "motion": "^13.4.4",
62
- "@passui/react": "^0.1.19",
62
+ "@passui/react": "^0.1.23",
63
63
  "react": "^19.3.0",
64
64
  "react-dom": "^19.3.0",
65
65
  "@tanstack/react-query": "^5.104.0"
@@ -9,7 +9,7 @@ export function FormAlert({ children, className }: { children: ReactNode; classN
9
9
  <div
10
10
  role="alert"
11
11
  className={cn(
12
- "flex items-start gap-2.5 rounded-2xl bg-destructive/12 px-4 py-3 text-sm font-medium text-destructive ring-1 ring-destructive/25 ring-inset",
12
+ "flex items-start gap-2.5 rounded-2xl bg-destructive/12 px-4 py-3 text-subheadline font-medium text-destructive ring-1 ring-destructive/25 ring-inset",
13
13
  "motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-95 motion-safe:duration-300",
14
14
  className
15
15
  )}
@@ -100,7 +100,7 @@ function Option({ icon, tone = "default", onClick, children }: OptionProps) {
100
100
  type="button"
101
101
  onClick={onClick}
102
102
  className={cn(
103
- "flex w-full items-center gap-3 px-4 py-3 text-left text-sm transition-colors",
103
+ "flex w-full items-center gap-3 px-4 py-3 text-left text-subheadline transition-colors",
104
104
  "hover:bg-foreground/[0.04] focus-visible:bg-foreground/[0.06] focus-visible:outline-none",
105
105
  tone === "destructive" && "text-destructive"
106
106
  )}
@@ -155,7 +155,7 @@ function CameraView({ labels, onCapture, onCancel }: CameraViewProps) {
155
155
  <div className="flex flex-col items-center gap-5 bg-neutral-950 px-5 pt-8 pb-6">
156
156
  <div className="relative size-64 overflow-hidden rounded-full ring-1 ring-white/20">
157
157
  {failed ? (
158
- <div className="flex size-full items-center justify-center p-8 text-center text-xs text-white/70">
158
+ <div className="flex size-full items-center justify-center p-8 text-center text-caption text-white/70">
159
159
  {labels.takePhoto}
160
160
  </div>
161
161
  ) : (
@@ -249,7 +249,7 @@ export function AvatarPicker({
249
249
  >
250
250
  <ProfileImage className="size-28 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.45)] ring-1 ring-white/50">
251
251
  <ProfileImageContent src={image} alt={label} />
252
- <ProfileImageFallback className="text-3xl">
252
+ <ProfileImageFallback className="text-title">
253
253
  {initials}
254
254
  </ProfileImageFallback>
255
255
  </ProfileImage>
@@ -284,7 +284,7 @@ export function AvatarPicker({
284
284
  onClick={() =>
285
285
  void renderMonogram(initials, gradient).then(onChoose)
286
286
  }
287
- className="flex size-10 items-center justify-center rounded-full text-sm font-semibold text-white shadow-xs ring-1 ring-black/5 transition-transform hover:scale-105 active:scale-95"
287
+ className="flex size-10 items-center justify-center rounded-full text-subheadline font-semibold text-white shadow-xs ring-1 ring-black/5 transition-transform hover:scale-105 active:scale-95"
288
288
  style={{
289
289
  backgroundImage: `linear-gradient(${gradient[0]}, ${gradient[1]})`,
290
290
  }}
@@ -160,7 +160,7 @@ export function FieldAvatar({
160
160
  alt={label}
161
161
  className="object-cover transition-[filter] duration-300 group-hover:brightness-90"
162
162
  />
163
- <ProfileImageFallback className={compact ? "text-xl" : "text-4xl"}>
163
+ <ProfileImageFallback className={compact ? "text-title3" : "text-large-title"}>
164
164
  {(label.charAt(0) || "?").toUpperCase()}
165
165
  </ProfileImageFallback>
166
166
  </ProfileImage>
@@ -169,7 +169,7 @@ export function FieldAvatar({
169
169
  <span
170
170
  className={cn(
171
171
  "absolute bottom-3 left-1/2 -translate-x-1/2 rounded-full px-3 py-1",
172
- "bg-black/35 text-xs font-medium text-white backdrop-blur-md",
172
+ "bg-black/35 text-caption font-medium text-white backdrop-blur-md",
173
173
  "opacity-0 transition-opacity duration-200 group-hover:opacity-100 group-focus-visible:opacity-100",
174
174
  dragOver && "opacity-100"
175
175
  )}
@@ -12,7 +12,7 @@ export function DefaultBoundary({ error }: ErrorComponentProps) {
12
12
  return (
13
13
  <div className="flex min-h-100 w-full flex-col items-center justify-center gap-6 p-6 text-center">
14
14
  <div className="w-full max-w-md overflow-hidden rounded-md border border-destructive/20 bg-destructive/5 p-4 text-left">
15
- <p className="mb-2 text-xs font-semibold tracking-wider text-destructive uppercase">
15
+ <p className="mb-2 text-caption font-semibold tracking-wider text-destructive uppercase">
16
16
  Application Error
17
17
  </p>
18
18
  <ErrorComponent error={error} />
@@ -1,13 +1,23 @@
1
- import { HugeiconsIcon } from "@hugeicons/react"
2
- import { Loading03Icon } from "@hugeicons/core-free-icons"
1
+ import { LoadingIcon } from "@passui/react/icons"
3
2
  import { cn } from "@passui/react/cn"
4
3
 
5
- export function DefaultLoader() {
4
+ export type DefaultLoaderProps = {
5
+ /** Translated loading status for assistive technology; never displayed visually. */
6
+ label?: string
7
+ className?: string
8
+ }
9
+
10
+ export function DefaultLoader({ label, className }: DefaultLoaderProps = {}) {
6
11
  return (
7
12
  <section
8
- className={cn("flex h-screen w-screen items-center justify-center", "bg-background")}
13
+ role="status"
14
+ aria-label={label}
15
+ className={cn("flex min-h-80 flex-1 items-center justify-center p-6", className)}
9
16
  >
10
- <HugeiconsIcon icon={Loading03Icon} className="size-5! animate-spin duration-500" />
17
+ <LoadingIcon
18
+ aria-hidden="true"
19
+ className="size-6! animate-spin motion-reduce:animate-none"
20
+ />
11
21
  </section>
12
22
  )
13
23
  }
@@ -13,13 +13,13 @@ export function NotFound({ children }: NotFoundProps) {
13
13
  <section className="mx-auto flex w-full max-w-sm flex-col items-center justify-center gap-4">
14
14
  {children ?? (
15
15
  <div className="flex flex-col items-center gap-2">
16
- <span className="font-mono text-xs font-semibold tracking-widest text-destructive uppercase">
16
+ <span className="font-mono text-caption font-semibold tracking-widest text-destructive uppercase">
17
17
  Error 404
18
18
  </span>
19
19
  <h2 className="text-2xl font-bold tracking-tight text-foreground">
20
20
  Page Not Found
21
21
  </h2>
22
- <p className="max-w-70 text-sm text-muted-foreground">
22
+ <p className="max-w-70 text-subheadline text-muted-foreground">
23
23
  The page you are looking for might have been moved, renamed, or deleted.
24
24
  </p>
25
25
  </div>
@@ -73,9 +73,9 @@ export function SettingList({
73
73
  <div className="flex items-center gap-3 border-b border-separator/60 px-4 py-4 sm:px-5 [&>span:first-child]:size-9 [&>span:first-child_.glyph]:size-4">
74
74
  {icon}
75
75
  <div className="flex min-w-0 flex-1 flex-col">
76
- <Heading className="text-base">{title}</Heading>
76
+ <Heading className="text-callout">{title}</Heading>
77
77
  {description && (
78
- <p className="text-[13px] text-muted-foreground">{description}</p>
78
+ <p className="text-footnote text-muted-foreground">{description}</p>
79
79
  )}
80
80
  </div>
81
81
  {action}
@@ -113,7 +113,7 @@ export function SettingList({
113
113
  {icon}
114
114
  <div className="min-w-0 wrap-anywhere">
115
115
  <Heading>{title}</Heading>
116
- {description && <p className="text-sm">{description}</p>}
116
+ {description && <p className="text-subheadline">{description}</p>}
117
117
  </div>
118
118
  </div>
119
119
  {action}
@@ -155,11 +155,13 @@ function Row({
155
155
  <>
156
156
  {icon}
157
157
  <span className="flex min-w-0 flex-1 flex-col">
158
- <h3 className="truncate text-sm">{title}</h3>
159
- {description && <p className="text-xs">{description}</p>}
158
+ <h3 className="truncate text-subheadline">{title}</h3>
159
+ {description && <p className="text-caption">{description}</p>}
160
160
  </span>
161
161
  {value && (
162
- <span className="max-w-[45%] truncate text-sm text-muted-foreground">{value}</span>
162
+ <span className="max-w-[45%] truncate text-subheadline text-muted-foreground">
163
+ {value}
164
+ </span>
163
165
  )}
164
166
  {trailing}
165
167
  {(chevron ?? interactive) && (
@@ -151,7 +151,7 @@ function ToolbarToggle({
151
151
  aria-expanded={open}
152
152
  onClick={onClick}
153
153
  className={cn(
154
- "flex h-8 cursor-pointer items-center gap-1.5 rounded-full border border-border/40 px-3 text-xs transition-colors",
154
+ "flex h-8 cursor-pointer items-center gap-1.5 rounded-full border border-border/40 px-3 text-caption transition-colors",
155
155
  engaged
156
156
  ? "bg-foreground/[0.07] text-foreground"
157
157
  : "text-muted-foreground hover:bg-foreground/[0.04] hover:text-foreground"
@@ -318,7 +318,7 @@ export function DataTable<TData extends RowData>({
318
318
  {columnsOpen && (
319
319
  <div className="flex flex-col gap-2 rounded-2xl border border-border/40 bg-foreground/[0.025] p-4">
320
320
  <div className="flex items-center justify-between">
321
- <h3 className="text-xs">Columns</h3>
321
+ <h3 className="text-caption">Columns</h3>
322
322
  {hiddenCount > 0 && (
323
323
  <Button
324
324
  type="button"
@@ -343,7 +343,7 @@ export function DataTable<TData extends RowData>({
343
343
  checked={visible}
344
344
  onChange={() => column.toggleVisibility()}
345
345
  />
346
- <span className="text-xs">{getColumnLabel(column)}</span>
346
+ <span className="text-caption">{getColumnLabel(column)}</span>
347
347
  </div>
348
348
  )
349
349
  })}
@@ -354,7 +354,7 @@ export function DataTable<TData extends RowData>({
354
354
  {filtersOpen && (
355
355
  <div className="flex flex-col gap-2 rounded-2xl border border-border/40 bg-foreground/[0.025] p-4">
356
356
  <div className="flex items-center justify-between">
357
- <h3 className="text-xs">Filters</h3>
357
+ <h3 className="text-caption">Filters</h3>
358
358
  {activeFilterCount > 0 && (
359
359
  <Button
360
360
  type="button"
@@ -369,7 +369,9 @@ export function DataTable<TData extends RowData>({
369
369
  )}
370
370
  </div>
371
371
  {filterableColumns.length === 0 ? (
372
- <p className="text-xs text-muted-foreground/60">No filterable columns.</p>
372
+ <p className="text-caption text-muted-foreground/60">
373
+ No filterable columns.
374
+ </p>
373
375
  ) : (
374
376
  <div className="flex flex-col gap-3">
375
377
  {filterableColumns.map((column) => (
@@ -395,7 +397,7 @@ export function DataTable<TData extends RowData>({
395
397
 
396
398
  {bulkActions && selectedCount > 0 && (
397
399
  <div className="flex items-center gap-3 rounded-full border border-border/40 bg-foreground/[0.035] py-1.5 pr-1.5 pl-4">
398
- <span className="text-xs font-medium">{selectedCount} selected</span>
400
+ <span className="text-caption font-medium">{selectedCount} selected</span>
399
401
  <div className="h-4 w-px bg-input/40" />
400
402
  {bulkActions(selectedRows, clearSelection)}
401
403
  <Button
@@ -69,7 +69,7 @@ export function FilterRow<TData extends RowData>({
69
69
  const [from, to] = (column.getFilterValue() as [string?, string?] | undefined) ?? []
70
70
  return (
71
71
  <div className="flex items-center gap-3">
72
- <span className="w-20 shrink-0 text-[11px] font-medium text-muted-foreground">
72
+ <span className="w-20 shrink-0 text-caption2 font-medium text-muted-foreground">
73
73
  {label}
74
74
  </span>
75
75
  <div className="flex items-center gap-2">
@@ -77,14 +77,14 @@ export function FilterRow<TData extends RowData>({
77
77
  type="date"
78
78
  value={from ?? ""}
79
79
  onChange={(e) => column.setFilterValue([e.target.value || undefined, to])}
80
- className="h-7 rounded-none border border-dashed border-input/40 bg-background px-2 text-xs outline-none"
80
+ className="h-7 rounded-none border border-dashed border-input/40 bg-background px-2 text-caption outline-none"
81
81
  />
82
- <span className="text-[11px] text-muted-foreground">to</span>
82
+ <span className="text-caption2 text-muted-foreground">to</span>
83
83
  <input
84
84
  type="date"
85
85
  value={to ?? ""}
86
86
  onChange={(e) => column.setFilterValue([from, e.target.value || undefined])}
87
- className="h-7 rounded-none border border-dashed border-input/40 bg-background px-2 text-xs outline-none"
87
+ className="h-7 rounded-none border border-dashed border-input/40 bg-background px-2 text-caption outline-none"
88
88
  />
89
89
  {(from || to) && (
90
90
  <IconButton
@@ -116,7 +116,7 @@ export function FilterRow<TData extends RowData>({
116
116
  if (uniqueValues.length > 0) {
117
117
  return (
118
118
  <div className="flex flex-col gap-1">
119
- <span className="text-xs">{label}</span>
119
+ <span className="text-caption">{label}</span>
120
120
  <div className="flex flex-wrap items-center gap-3">
121
121
  {uniqueValues.map((value) => {
122
122
  const active = activeValue === value
@@ -137,7 +137,7 @@ export function FilterRow<TData extends RowData>({
137
137
  checked={active}
138
138
  onChange={setActive}
139
139
  />
140
- <span className="text-xs">{value}</span>
140
+ <span className="text-caption">{value}</span>
141
141
  </div>
142
142
  )
143
143
  })}
@@ -160,7 +160,7 @@ export function FilterRow<TData extends RowData>({
160
160
 
161
161
  return (
162
162
  <div className="flex items-center gap-3">
163
- <span className="w-20 shrink-0 text-[11px] font-medium text-muted-foreground capitalize">
163
+ <span className="w-20 shrink-0 text-caption2 font-medium text-muted-foreground capitalize">
164
164
  {label}
165
165
  </span>
166
166
  <div className="relative max-w-xs flex-1">
@@ -177,7 +177,7 @@ export function FilterRow<TData extends RowData>({
177
177
  : undefined
178
178
  )
179
179
  }
180
- className="h-7 w-full rounded-none border border-dashed border-input/40 bg-background px-2.5 text-xs outline-none placeholder:text-muted-foreground/40"
180
+ className="h-7 w-full rounded-none border border-dashed border-input/40 bg-background px-2.5 text-caption outline-none placeholder:text-muted-foreground/40"
181
181
  />
182
182
  {activeValue && (
183
183
  <IconButton