tempest-react-sdk 0.10.0 → 0.11.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.
@@ -82,15 +82,52 @@ import { useFormState } from 'react-hook-form';
82
82
  import { UseInfiniteQueryOptions } from '@tanstack/react-query';
83
83
  import { useLocation } from 'react-router-dom';
84
84
  import { useMatch } from 'react-router-dom';
85
+ import { UseMutationOptions } from '@tanstack/react-query';
86
+ import { UseMutationResult } from '@tanstack/react-query';
85
87
  import { useNavigate } from 'react-router-dom';
86
88
  import { useParams } from 'react-router-dom';
87
89
  import { UseQueryOptions } from '@tanstack/react-query';
90
+ import { UseQueryResult } from '@tanstack/react-query';
88
91
  import { useRouteError } from 'react-router-dom';
89
92
  import { useSearchParams } from 'react-router-dom';
90
93
  import { useWatch } from 'react-hook-form';
91
94
  import { WheelEventHandler } from 'react';
92
95
  import { z } from 'zod';
93
96
 
97
+ /**
98
+ * A pluggable access-control strategy. Implementations decide whether a given
99
+ * action is allowed, returning a plain boolean, a {@link CanResult}, or a
100
+ * promise of either (for async sources such as a remote policy server).
101
+ */
102
+ export declare interface AccessControl {
103
+ /**
104
+ * Resolve whether the described action is permitted.
105
+ *
106
+ * @param params - The action/resource being checked.
107
+ * @returns `true`/`false`, a {@link CanResult}, or a promise of either.
108
+ */
109
+ can: (params: CanParams) => boolean | CanResult | Promise<boolean | CanResult>;
110
+ }
111
+
112
+ /**
113
+ * Provide an {@link AccessControl} strategy to the React tree. Components such
114
+ * as `<Can>` and the `useCan` hook read it from context.
115
+ *
116
+ * @example
117
+ * ```tsx
118
+ * <AccessControlProvider control={createRoleAccessControl({ role: "admin", roles: { admin: ["*"] } })}>
119
+ * <App />
120
+ * </AccessControlProvider>
121
+ * ```
122
+ */
123
+ export declare function AccessControlProvider({ control, children }: AccessControlProviderProps): JSX.Element;
124
+
125
+ export declare interface AccessControlProviderProps {
126
+ /** The access-control strategy made available to descendants. */
127
+ control: AccessControl;
128
+ children: ReactNode;
129
+ }
130
+
94
131
  /**
95
132
  * Accessible accordion. Each item collapses/expands its content. Single-mode by
96
133
  * default — pass `multiple` to allow more than one item open at a time. Can be
@@ -682,6 +719,50 @@ export declare interface CalendarProps extends Omit<HTMLAttributes<HTMLDivElemen
682
719
  */
683
720
  export declare function camelCase(value: string): string;
684
721
 
722
+ /**
723
+ * Conditionally render based on an access check. Renders `children` when the
724
+ * action is allowed, otherwise `fallback` (or nothing). While an async check is
725
+ * pending, nothing is rendered.
726
+ *
727
+ * @example
728
+ * ```tsx
729
+ * <Can action="create" resource="posts" fallback={<p>No access</p>}>
730
+ * <NewPostButton />
731
+ * </Can>
732
+ * ```
733
+ */
734
+ export declare function Can({ action, resource, params, children, fallback }: CanProps): JSX.Element;
735
+
736
+ /**
737
+ * Arguments describing the access check to perform.
738
+ */
739
+ export declare interface CanParams {
740
+ /** The action being attempted (e.g. `"create"`, `"read"`, `"delete"`). */
741
+ action: string;
742
+ /** The resource the action targets (e.g. `"posts"`). Optional for global actions. */
743
+ resource?: string;
744
+ /** Arbitrary extra context an access-control strategy may inspect. */
745
+ params?: Record<string, unknown>;
746
+ }
747
+
748
+ export declare interface CanProps extends CanParams {
749
+ /** Rendered when the action is allowed. */
750
+ children: ReactNode;
751
+ /** Rendered when the action is denied. Defaults to nothing. */
752
+ fallback?: ReactNode;
753
+ }
754
+
755
+ /**
756
+ * Detailed result of an access check. Use the bare `boolean` form when no
757
+ * reason is needed, or this object to surface *why* access was denied.
758
+ */
759
+ export declare interface CanResult {
760
+ /** Whether the action is permitted. */
761
+ can: boolean;
762
+ /** Human-readable explanation, typically present when `can` is `false`. */
763
+ reason?: string;
764
+ }
765
+
685
766
  /**
686
767
  * Uppercase the first character of `value`, leaving the rest untouched.
687
768
  *
@@ -1003,6 +1084,24 @@ export declare interface ConfirmDialogProps {
1003
1084
  onCancel: () => void;
1004
1085
  }
1005
1086
 
1087
+ /** Options accepted by {@link ModalsApi.confirm}. */
1088
+ export declare interface ConfirmModalOptions {
1089
+ /** Header title. */
1090
+ title?: ReactNode;
1091
+ /** Prompt message rendered in the dialog body. */
1092
+ message: ReactNode;
1093
+ /** Confirm button label. Default `Confirmar`. */
1094
+ confirmLabel?: string;
1095
+ /** Cancel button label. Default `Cancelar`. */
1096
+ cancelLabel?: string;
1097
+ /** Render the confirm button in the danger variant. */
1098
+ danger?: boolean;
1099
+ /** Called when the user confirms. */
1100
+ onConfirm?: () => void | Promise<void>;
1101
+ /** Called when the user cancels or dismisses. */
1102
+ onCancel?: () => void;
1103
+ }
1104
+
1006
1105
  /** Default sink that writes to the browser console. */
1007
1106
  export declare const consoleSink: LoggerSink;
1008
1107
 
@@ -1083,6 +1182,13 @@ export declare interface CopyButtonProps extends ButtonHTMLAttributes<HTMLButton
1083
1182
  onCopied?: () => void;
1084
1183
  }
1085
1184
 
1185
+ export declare interface CounterHandlers {
1186
+ increment: () => void;
1187
+ decrement: () => void;
1188
+ set: (value: number) => void;
1189
+ reset: () => void;
1190
+ }
1191
+
1086
1192
  export declare const CPFInput: ForwardRefExoticComponent<Omit<InputProps, "value" | "onChange"> & {
1087
1193
  value: string;
1088
1194
  onChange: (value: string) => void;
@@ -1137,6 +1243,29 @@ export declare interface CreateAuthStoreOptions<TUser> {
1137
1243
  initialToken?: string | null;
1138
1244
  }
1139
1245
 
1246
+ /**
1247
+ * Create a {@link DataProvider} bound to an {@link ApiClient}.
1248
+ *
1249
+ * Maps Refine-style calls to the Tempest FastAPI SDK conventions: list →
1250
+ * `GET /{resource}?page=&size=&order_by=&ascending=&...filters`, one →
1251
+ * `GET /{resource}/{id}`, create → `POST`, update → `PATCH`/`PUT`,
1252
+ * delete → `DELETE`.
1253
+ *
1254
+ * @param client - The HTTP client created by `createApiClient`.
1255
+ * @param options - Optional overrides for param names, sort encoding,
1256
+ * update method and path building.
1257
+ * @returns A stateless data provider.
1258
+ *
1259
+ * @example
1260
+ * const dataProvider = createDataProvider(apiClient);
1261
+ * const page = await dataProvider.getList<User>("users", {
1262
+ * pagination: { page: 1, pageSize: 20 },
1263
+ * sort: { field: "created_at", order: "desc" },
1264
+ * filters: { active: true },
1265
+ * });
1266
+ */
1267
+ export declare function createDataProvider(client: ApiClient, options?: DataProviderOptions): DataProvider;
1268
+
1140
1269
  /**
1141
1270
  * Open a Server-Sent Events stream with automatic exponential-backoff reconnect.
1142
1271
  *
@@ -1379,6 +1508,30 @@ export declare function createQueryKeys<TKey extends string, TEntries extends Re
1379
1508
  */
1380
1509
  export declare function createRefreshQueue(refresh: () => Promise<void>): () => Promise<void>;
1381
1510
 
1511
+ /**
1512
+ * Build a simple RBAC {@link AccessControl} from a static permission set.
1513
+ *
1514
+ * Permission strings are `"<resource>:<action>"` (e.g. `"posts:create"`) or a
1515
+ * bare `"<action>"`. Wildcards are supported: `"*"` grants everything and
1516
+ * `"<resource>:*"` grants every action on a resource.
1517
+ *
1518
+ * The effective set is `config.permissions` plus, for each active role in
1519
+ * `config.role`, the permissions listed in `config.roles[role]`.
1520
+ *
1521
+ * @param config - Permissions, role map, and active role(s).
1522
+ * @returns An access-control strategy backed by the resolved permission set.
1523
+ *
1524
+ * @example
1525
+ * ```ts
1526
+ * const ac = createRoleAccessControl({
1527
+ * role: "editor",
1528
+ * roles: { editor: ["posts:*", "comments:read"] },
1529
+ * });
1530
+ * ac.can({ action: "create", resource: "posts" }); // true
1531
+ * ```
1532
+ */
1533
+ export declare function createRoleAccessControl(config: RoleAccessControlConfig): AccessControl;
1534
+
1382
1535
  /**
1383
1536
  * Attach auto-generated selector hooks to a Zustand store. Instead of writing
1384
1537
  * `useStore((s) => s.user)` at every call site, you get `useStore.use.user()`
@@ -1603,6 +1756,9 @@ export declare interface CursorParams {
1603
1756
  ascending?: boolean;
1604
1757
  }
1605
1758
 
1759
+ /** Filters passed to {@link DataProvider.getList}, spread verbatim into the query string. */
1760
+ export declare type DataFilters = Record<string, ParamValue>;
1761
+
1606
1762
  /**
1607
1763
  * Generic, typed list that renders a `<ul>` with one `<li>` per item.
1608
1764
  *
@@ -1629,6 +1785,86 @@ export declare interface DataListProps<T> extends HTMLAttributes<HTMLUListElemen
1629
1785
  empty?: ReactNode;
1630
1786
  }
1631
1787
 
1788
+ /**
1789
+ * Refine-style data provider over the Tempest FastAPI SDK CRUD/pagination
1790
+ * conventions. Implementations are stateless wrappers around an {@link ApiClient}.
1791
+ */
1792
+ export declare interface DataProvider {
1793
+ /**
1794
+ * Fetch a paginated list of a resource.
1795
+ *
1796
+ * @param resource - The resource name (e.g. `"users"`).
1797
+ * @param params - Pagination, sort and filter parameters.
1798
+ * @returns The offset-paginated envelope.
1799
+ */
1800
+ getList<T>(resource: string, params?: GetListParams): Promise<OffsetPage<T>>;
1801
+ /**
1802
+ * Fetch a single record by id.
1803
+ *
1804
+ * @param resource - The resource name.
1805
+ * @param id - The record id.
1806
+ * @returns The record.
1807
+ */
1808
+ getOne<T>(resource: string, id: string | number): Promise<T>;
1809
+ /**
1810
+ * Fetch many records by id (default: parallel {@link DataProvider.getOne}).
1811
+ *
1812
+ * @param resource - The resource name.
1813
+ * @param ids - The record ids.
1814
+ * @returns The records, in the same order as `ids`.
1815
+ */
1816
+ getMany<T>(resource: string, ids: (string | number)[]): Promise<T[]>;
1817
+ /**
1818
+ * Create a record.
1819
+ *
1820
+ * @param resource - The resource name.
1821
+ * @param data - The creation payload.
1822
+ * @returns The created record.
1823
+ */
1824
+ create<T>(resource: string, data: unknown): Promise<T>;
1825
+ /**
1826
+ * Update a record (PATCH by default, PUT when configured).
1827
+ *
1828
+ * @param resource - The resource name.
1829
+ * @param id - The record id.
1830
+ * @param data - The update payload.
1831
+ * @returns The updated record.
1832
+ */
1833
+ update<T>(resource: string, id: string | number, data: unknown): Promise<T>;
1834
+ /**
1835
+ * Delete a record by id.
1836
+ *
1837
+ * @param resource - The resource name.
1838
+ * @param id - The record id.
1839
+ * @returns The delete response (often the deleted record).
1840
+ */
1841
+ deleteOne<T>(resource: string, id: string | number): Promise<T>;
1842
+ }
1843
+
1844
+ /** Options to tailor {@link createDataProvider} to a backend's conventions. */
1845
+ export declare interface DataProviderOptions {
1846
+ /** Query-param name for the page number. Default: `"page"`. */
1847
+ pageParam?: string;
1848
+ /** Query-param name for the page size. Default: `"size"`. */
1849
+ sizeParam?: string;
1850
+ /** Query-param name for the sort field. Default: `"order_by"`. */
1851
+ sortFieldParam?: string;
1852
+ /** Query-param name for the sort order. Default: `"ascending"`. */
1853
+ sortOrderParam?: string;
1854
+ /**
1855
+ * When `true` (default), emit the sort order as a boolean
1856
+ * (`order:"asc"` → `true`). When `false`, emit the literal `"asc"`/`"desc"`.
1857
+ */
1858
+ sortOrderAsBoolean?: boolean;
1859
+ /** HTTP method used by {@link DataProvider.update}. Default: `"patch"`. */
1860
+ updateMethod?: "patch" | "put";
1861
+ /**
1862
+ * Build the request path for a resource (and optional id).
1863
+ * Default: `id == null ? "/" + resource : "/" + resource + "/" + id`.
1864
+ */
1865
+ buildPath?: (resource: string, id?: string | number) => string;
1866
+ }
1867
+
1632
1868
  /**
1633
1869
  * Stateful, headless data table built on top of {@link Table}. Adds
1634
1870
  * client-side searching, click-to-sort columns, and pagination while
@@ -1713,6 +1949,37 @@ export declare interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLIn
1713
1949
  wrapperClassName?: string;
1714
1950
  }
1715
1951
 
1952
+ /** A selected range. Either bound may be `null` while picking. */
1953
+ export declare interface DateRange {
1954
+ start: Date | null;
1955
+ end: Date | null;
1956
+ }
1957
+
1958
+ /**
1959
+ * Date-range picker: pick a start day, then an end day, across one or more
1960
+ * month grids. The hovered day previews the range before the end is committed.
1961
+ * Pure `Date` math — no date libraries. For a single date, use `Calendar`.
1962
+ *
1963
+ * Selection: first click sets `start` (clears `end`); the next click sets `end`
1964
+ * (auto-ordered if you click earlier than the start); a third click starts over.
1965
+ */
1966
+ export declare function DateRangePicker({ value, onChange, numberOfMonths, defaultMonth, minDate, maxDate, weekStartsOn, className, ...props }: DateRangePickerProps): JSX.Element;
1967
+
1968
+ export declare interface DateRangePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
1969
+ /** Controlled selected range. */
1970
+ value: DateRange;
1971
+ /** Called with the new range as the user picks start then end. */
1972
+ onChange: (range: DateRange) => void;
1973
+ /** How many month grids to show side by side. Default `2`. */
1974
+ numberOfMonths?: number;
1975
+ /** Initial visible month (uncontrolled). Defaults to the range start or today. */
1976
+ defaultMonth?: Date;
1977
+ minDate?: Date;
1978
+ maxDate?: Date;
1979
+ /** First column of the week — `0` Sunday (default) or `1` Monday. */
1980
+ weekStartsOn?: WeekStart_2;
1981
+ }
1982
+
1716
1983
  /**
1717
1984
  * Create a trailing-edge debounced version of `fn`.
1718
1985
  *
@@ -1805,6 +2072,12 @@ export declare interface DescriptionListProps extends HTMLAttributes<HTMLDListEl
1805
2072
  items: DescriptionListItem[];
1806
2073
  }
1807
2074
 
2075
+ export declare interface DisclosureHandlers {
2076
+ open: () => void;
2077
+ close: () => void;
2078
+ toggle: () => void;
2079
+ }
2080
+
1808
2081
  /**
1809
2082
  * Horizontal or vertical visual separator. When `label` is provided in
1810
2083
  * horizontal mode the divider splits and centers the label between two lines.
@@ -1897,6 +2170,37 @@ export declare interface DropdownMenuProps {
1897
2170
  className?: string;
1898
2171
  }
1899
2172
 
2173
+ /**
2174
+ * Drag-and-drop file area with a hidden file input. Clickable and keyboard
2175
+ * focusable; filters by `maxSize` before calling `onDrop`.
2176
+ *
2177
+ * @example
2178
+ * <Dropzone accept="image/*" maxSize={5 * 1024 * 1024} onDrop={setFiles}>
2179
+ * Solte imagens aqui ou clique para selecionar
2180
+ * </Dropzone>
2181
+ */
2182
+ export declare function Dropzone({ onDrop, accept, multiple, disabled, maxSize, onReject, children, className, }: DropzoneProps): JSX.Element;
2183
+
2184
+ /** Props for {@link Dropzone}. */
2185
+ export declare interface DropzoneProps {
2186
+ /** Called with the accepted files after a drop or file-dialog selection. */
2187
+ onDrop: (files: File[]) => void;
2188
+ /** `accept` attribute forwarded to the hidden file input. */
2189
+ accept?: string;
2190
+ /** Allow selecting/dropping multiple files. Default `true`. */
2191
+ multiple?: boolean;
2192
+ /** Disable interaction. */
2193
+ disabled?: boolean;
2194
+ /** Maximum file size in bytes; larger files are filtered out. */
2195
+ maxSize?: number;
2196
+ /** Called with files rejected by `maxSize`. */
2197
+ onReject?: (files: File[]) => void;
2198
+ /** Custom inner content. Falls back to a default prompt. */
2199
+ children?: ReactNode;
2200
+ /** Extra class applied to the drop area. */
2201
+ className?: string;
2202
+ }
2203
+
1900
2204
  export declare interface ElementSize {
1901
2205
  width: number;
1902
2206
  height: number;
@@ -2084,6 +2388,46 @@ export declare type FilterPredicate<T> = (item: T, search: string) => boolean;
2084
2388
 
2085
2389
  export declare type FlagValue = boolean | string | number | null;
2086
2390
 
2391
+ /**
2392
+ * Material Floating Action Button. Renders a round FAB when only an `icon` is
2393
+ * given, or an extended pill FAB when a `label` is also provided. By default it
2394
+ * is fixed to the bottom-right corner; set `position="none"` to place it inline.
2395
+ *
2396
+ * Spreads all native `<button>` props (`onClick`, `disabled`, etc.).
2397
+ *
2398
+ * @remarks
2399
+ * Always pass an `aria-label` when there is no `label`, since an icon-only FAB
2400
+ * has no accessible name otherwise.
2401
+ *
2402
+ * @example
2403
+ * <FloatingActionButton icon={<Plus />} aria-label="Adicionar" onClick={create} />
2404
+ *
2405
+ * @example
2406
+ * <FloatingActionButton icon={<Plus />} label="Novo" onClick={create} />
2407
+ */
2408
+ export declare function FloatingActionButton({ icon, label, position, size, variant, className, ...props }: FloatingActionButtonProps): JSX.Element;
2409
+
2410
+ declare type FloatingActionButtonPosition = "bottom-right" | "bottom-left" | "none";
2411
+
2412
+ export declare interface FloatingActionButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
2413
+ /** Icon rendered inside the FAB. Required. */
2414
+ icon: ReactNode;
2415
+ /** When present, renders an extended (pill) FAB with icon + label. */
2416
+ label?: ReactNode;
2417
+ /** Corner placement, or `"none"` for static/inline. Default `"bottom-right"`. */
2418
+ position?: FloatingActionButtonPosition;
2419
+ /** Size token. Default `"md"`. */
2420
+ size?: FloatingActionButtonSize;
2421
+ /** Visual style. Default `"primary"`. */
2422
+ variant?: FloatingActionButtonVariant;
2423
+ /** Extra class names merged onto the root. */
2424
+ className?: string;
2425
+ }
2426
+
2427
+ declare type FloatingActionButtonSize = "sm" | "md" | "lg";
2428
+
2429
+ declare type FloatingActionButtonVariant = "primary" | "surface";
2430
+
2087
2431
  /**
2088
2432
  * Typed, JSX-friendly list renderer.
2089
2433
  *
@@ -2356,6 +2700,22 @@ export declare interface GetInitialThemeOptions {
2356
2700
  defaultTheme?: ThemeMode;
2357
2701
  }
2358
2702
 
2703
+ /** Parameters for a paginated, sorted, filtered list request. */
2704
+ export declare interface GetListParams {
2705
+ /** Offset pagination — 1-based `page` and `pageSize`. */
2706
+ pagination?: {
2707
+ page?: number;
2708
+ pageSize?: number;
2709
+ };
2710
+ /** Single-field sort. `order` defaults to `"asc"`. */
2711
+ sort?: {
2712
+ field: string;
2713
+ order?: "asc" | "desc";
2714
+ };
2715
+ /** Arbitrary filter query params, spread onto the request. */
2716
+ filters?: DataFilters;
2717
+ }
2718
+
2359
2719
  /**
2360
2720
  * Thin wrapper over `@react-oauth/google`'s `<GoogleLogin>` that:
2361
2721
  *
@@ -2929,6 +3289,63 @@ export declare interface ListOptions<TItem> {
2929
3289
  filter?: (item: TItem) => boolean;
2930
3290
  }
2931
3291
 
3292
+ /**
3293
+ * Build the cache key for a resource list query.
3294
+ *
3295
+ * @param resource - The resource name.
3296
+ * @param params - The list params (page/sort/filters).
3297
+ * @returns A stable TanStack Query key.
3298
+ */
3299
+ export declare function listQueryKey(resource: string, params?: GetListParams): unknown[];
3300
+
3301
+ export declare interface ListStateHandlers<T> {
3302
+ append: (...items: T[]) => void;
3303
+ prepend: (...items: T[]) => void;
3304
+ insert: (index: number, ...items: T[]) => void;
3305
+ remove: (...indices: number[]) => void;
3306
+ reorder: (payload: ReorderPayload) => void;
3307
+ setItem: (index: number, item: T) => void;
3308
+ setState: (items: T[]) => void;
3309
+ apply: (fn: (item: T, index: number) => T) => void;
3310
+ clear: () => void;
3311
+ }
3312
+
3313
+ /**
3314
+ * The canonical Material list row: an optional leading slot, a title with an
3315
+ * optional subtitle, and an optional trailing slot. When `onClick` is supplied
3316
+ * the tile renders as a full-width, keyboard-accessible `<button>`; otherwise it
3317
+ * renders as a static `<div>`.
3318
+ *
3319
+ * @example
3320
+ * <ListTile
3321
+ * leading={<User />}
3322
+ * title="Maria Silva"
3323
+ * subtitle="maria@example.com"
3324
+ * trailing={<ChevronRight />}
3325
+ * onClick={() => open(user)}
3326
+ * />
3327
+ */
3328
+ export declare function ListTile({ leading, title, subtitle, trailing, onClick, disabled, selected, className, }: ListTileProps): JSX.Element;
3329
+
3330
+ export declare interface ListTileProps {
3331
+ /** Left slot — typically an icon or avatar. */
3332
+ leading?: ReactNode;
3333
+ /** Primary line. Required. */
3334
+ title: ReactNode;
3335
+ /** Secondary line rendered under the title. */
3336
+ subtitle?: ReactNode;
3337
+ /** Right slot — typically an icon, switch or meta text. */
3338
+ trailing?: ReactNode;
3339
+ /** When provided, the tile becomes an interactive button. */
3340
+ onClick?: () => void;
3341
+ /** When true, the tile is dimmed and non-interactive. */
3342
+ disabled?: boolean;
3343
+ /** When true, the tile is highlighted as the active row. */
3344
+ selected?: boolean;
3345
+ /** Extra class names merged onto the root. */
3346
+ className?: string;
3347
+ }
3348
+
2932
3349
  export declare type LocalStorageOptions<T> = {
2933
3350
  serialize?: (value: T) => string;
2934
3351
  deserialize?: (raw: string) => T;
@@ -3047,8 +3464,36 @@ export declare interface ModalProps {
3047
3464
  fullscreenOnMobile?: boolean;
3048
3465
  }
3049
3466
 
3467
+ /** Imperative API returned by {@link useModals}. */
3468
+ export declare interface ModalsApi {
3469
+ /** Push a content modal. Returns its stack id. */
3470
+ open: (options: OpenModalOptions) => string;
3471
+ /** Push a confirmation dialog. Returns its stack id. */
3472
+ confirm: (options: ConfirmModalOptions) => string;
3473
+ /** Remove the modal with the given id. */
3474
+ close: (id: string) => void;
3475
+ /** Remove every modal from the stack. */
3476
+ closeAll: () => void;
3477
+ }
3478
+
3050
3479
  export declare type ModalSize = "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
3051
3480
 
3481
+ /**
3482
+ * Provides imperative modal control via {@link useModals} and renders the open
3483
+ * modal stack. Mount once near the app root.
3484
+ *
3485
+ * @example
3486
+ * <ModalsProvider>
3487
+ * <App />
3488
+ * </ModalsProvider>
3489
+ */
3490
+ export declare function ModalsProvider({ children }: ModalsProviderProps): JSX.Element;
3491
+
3492
+ /** Props for {@link ModalsProvider}. */
3493
+ export declare interface ModalsProviderProps {
3494
+ children: ReactNode;
3495
+ }
3496
+
3052
3497
  /**
3053
3498
  * Render a monetary amount given in cents as a localized currency string
3054
3499
  * inside a `<span>`.
@@ -3087,6 +3532,41 @@ export declare interface MoneyProps extends HTMLAttributes<HTMLSpanElement> {
3087
3532
  locale?: string;
3088
3533
  }
3089
3534
 
3535
+ /**
3536
+ * MultiSelect — a filterable dropdown that selects many options, shown as
3537
+ * removable chips inside the field. Selecting toggles a value; Backspace on an
3538
+ * empty query removes the last chip.
3539
+ *
3540
+ * Keyboard: ArrowUp/ArrowDown navigate, Enter toggles the active option, Esc
3541
+ * closes, Backspace (empty input) pops the last chip.
3542
+ */
3543
+ export declare function MultiSelect({ options, value, onChange, label, placeholder, helperText, error, disabled, maxItems, filter, emptyMessage, className, }: MultiSelectProps): JSX.Element;
3544
+
3545
+ export declare interface MultiSelectOption {
3546
+ value: string;
3547
+ label: string;
3548
+ disabled?: boolean;
3549
+ }
3550
+
3551
+ export declare interface MultiSelectProps {
3552
+ options: MultiSelectOption[];
3553
+ /** Currently selected values. */
3554
+ value: string[];
3555
+ onChange: (value: string[]) => void;
3556
+ label?: string;
3557
+ placeholder?: string;
3558
+ helperText?: string;
3559
+ error?: string;
3560
+ disabled?: boolean;
3561
+ /** Cap the number of selectable items. */
3562
+ maxItems?: number;
3563
+ /** Custom filter — return true to keep the option. Default: case-insensitive substring on label. */
3564
+ filter?: (option: MultiSelectOption, query: string) => boolean;
3565
+ /** Message shown when no option matches. */
3566
+ emptyMessage?: string;
3567
+ className?: string;
3568
+ }
3569
+
3090
3570
  /**
3091
3571
  * Top app bar. Three-slot layout (logo / nav / actions) that collapses
3092
3572
  * gracefully on mobile (nav slot wraps below).
@@ -3161,8 +3641,114 @@ export declare interface NavigationMenuProps extends HTMLAttributes<HTMLElement>
3161
3641
  items: NavigationMenuItem[];
3162
3642
  }
3163
3643
 
3644
+ /**
3645
+ * Vertical, compact navigation column for desktop and tablet layouts. Each item
3646
+ * stacks an icon over its label, with the active item flagged via
3647
+ * `aria-current="page"`. Use `labelVisibility="selected"` to show only the
3648
+ * active item's label, or `"none"` for an icon-only rail.
3649
+ *
3650
+ * @example
3651
+ * <NavigationRail
3652
+ * header={<FloatingActionButton icon={<Plus />} position="none" />}
3653
+ * items={[
3654
+ * { key: "home", label: "Início", icon: <Home /> },
3655
+ * { key: "inbox", label: "Caixa", icon: <Inbox />, badge: 3 },
3656
+ * ]}
3657
+ * value={tab}
3658
+ * onChange={setTab}
3659
+ * />
3660
+ */
3661
+ export declare function NavigationRail({ items, value, onChange, header, footer, labelVisibility, className, ...props }: NavigationRailProps): JSX.Element;
3662
+
3663
+ export declare interface NavigationRailItem {
3664
+ /** Unique identifier — used as React key and for value matching. */
3665
+ key: string;
3666
+ /** Visible label. */
3667
+ label: ReactNode;
3668
+ /** Icon rendered above the label. */
3669
+ icon?: ReactNode;
3670
+ /** Optional badge content rendered over the icon. */
3671
+ badge?: ReactNode;
3672
+ /** When true, the item is not selectable. */
3673
+ disabled?: boolean;
3674
+ }
3675
+
3676
+ declare type NavigationRailLabelVisibility = "all" | "selected" | "none";
3677
+
3678
+ export declare interface NavigationRailProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
3679
+ items: NavigationRailItem[];
3680
+ /** Selected key. */
3681
+ value: string;
3682
+ /** Called with the new selected key on click. */
3683
+ onChange: (key: string) => void;
3684
+ /** Top slot — e.g. a FAB or logo. */
3685
+ header?: ReactNode;
3686
+ /** Bottom slot — pushed to the bottom of the rail. */
3687
+ footer?: ReactNode;
3688
+ /** Which item labels to show. Default `"all"`. */
3689
+ labelVisibility?: NavigationRailLabelVisibility;
3690
+ /** Extra class names merged onto the root. */
3691
+ className?: string;
3692
+ }
3693
+
3164
3694
  export { NavLink }
3165
3695
 
3696
+ /**
3697
+ * Module-level singleton progress controller. Drive it imperatively from
3698
+ * anywhere (router transitions, fetch interceptors) and render the visual bar
3699
+ * with {@link NProgressBar}.
3700
+ *
3701
+ * @example
3702
+ * nprogress.start();
3703
+ * await loadData();
3704
+ * nprogress.done();
3705
+ */
3706
+ export declare const nprogress: NProgressController;
3707
+
3708
+ /**
3709
+ * Fixed top loading bar bound to the {@link nprogress} singleton. Mount once
3710
+ * near the app root; it renders nothing while inactive.
3711
+ *
3712
+ * @example
3713
+ * <NProgressBar />
3714
+ */
3715
+ export declare function NProgressBar({ color, height, className }: NProgressBarProps): JSX.Element | null;
3716
+
3717
+ /** Props for {@link NProgressBar}. */
3718
+ export declare interface NProgressBarProps {
3719
+ /** Bar color. Defaults to `var(--tempest-primary)`. */
3720
+ color?: string;
3721
+ /** Bar height in pixels. Default `3`. */
3722
+ height?: number;
3723
+ /** Extra class applied to the bar element. */
3724
+ className?: string;
3725
+ }
3726
+
3727
+ /** Imperative top-loading-bar controller. */
3728
+ export declare interface NProgressController {
3729
+ /** Show the bar and start trickling toward ~0.9. */
3730
+ start: () => void;
3731
+ /** Complete to `1`, then hide the bar shortly after. */
3732
+ done: () => void;
3733
+ /** Set the progress explicitly. Values are clamped to `0..1`. */
3734
+ set: (n: number) => void;
3735
+ /** Increment progress by `amount` (default a small trickle step). */
3736
+ inc: (amount?: number) => void;
3737
+ /** Subscribe to state changes. Returns an unsubscribe function. */
3738
+ subscribe: (listener: NProgressListener) => () => void;
3739
+ }
3740
+
3741
+ /** Listener invoked whenever the progress state changes. */
3742
+ export declare type NProgressListener = (state: NProgressState) => void;
3743
+
3744
+ /** Snapshot of the progress controller state delivered to subscribers. */
3745
+ export declare interface NProgressState {
3746
+ /** Current progress, `0` (empty) to `1` (complete). */
3747
+ value: number;
3748
+ /** Whether the bar should be visible. */
3749
+ active: boolean;
3750
+ }
3751
+
3166
3752
  export declare interface OAuthCredential {
3167
3753
  /** Provider-issued ID token (JWT). */
3168
3754
  idToken: string;
@@ -3279,6 +3865,33 @@ export declare function omit<T extends object, K extends keyof T>(obj: T, keys:
3279
3865
  */
3280
3866
  export declare function once<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R;
3281
3867
 
3868
+ /**
3869
+ * Build the cache key for a single-record query.
3870
+ *
3871
+ * @param resource - The resource name.
3872
+ * @param id - The record id.
3873
+ * @returns A stable TanStack Query key.
3874
+ */
3875
+ export declare function oneQueryKey(resource: string, id: string | number | null | undefined): unknown[];
3876
+
3877
+ /** Options accepted by {@link ModalsApi.open}. */
3878
+ export declare interface OpenModalOptions {
3879
+ /** Header title. */
3880
+ title?: ReactNode;
3881
+ /** Modal body content. */
3882
+ children: ReactNode;
3883
+ /** Dialog size. Default `md`. */
3884
+ size?: ModalSize;
3885
+ /** Allow closing by clicking the backdrop. Default `true`. */
3886
+ closeOnBackdrop?: boolean;
3887
+ /** Allow closing with the Esc key. Default `true`. */
3888
+ closeOnEsc?: boolean;
3889
+ /** Hide the header close button. */
3890
+ hideCloseButton?: boolean;
3891
+ /** Called after the modal is removed from the stack. */
3892
+ onClose?: () => void;
3893
+ }
3894
+
3282
3895
  export { Outlet }
3283
3896
 
3284
3897
  /**
@@ -3331,6 +3944,9 @@ export declare interface PaginationProps {
3331
3944
 
3332
3945
  export { Params }
3333
3946
 
3947
+ /** Query-param values accepted by the API client for a list request. */
3948
+ declare type ParamValue = string | number | boolean | undefined | null;
3949
+
3334
3950
  /**
3335
3951
  * Validate an unknown response payload against a zod schema.
3336
3952
  *
@@ -3378,6 +3994,25 @@ export declare type PasswordStrength = 0 | 1 | 2 | 3 | 4;
3378
3994
 
3379
3995
  export { Path }
3380
3996
 
3997
+ /**
3998
+ * Extract a permission list from a JWT.
3999
+ *
4000
+ * Reads the configured claim (default `"permissions"`); if absent, falls back to
4001
+ * the OAuth `"scopes"`/`"scope"` claims. Array claims are used as-is; string
4002
+ * claims are split on whitespace. Returns `[]` on any decode failure or when no
4003
+ * recognizable claim is present.
4004
+ *
4005
+ * @param token - The JWT to inspect (signature is **not** verified).
4006
+ * @param options - Optional claim override.
4007
+ * @returns The list of permission strings, or `[]` on failure.
4008
+ */
4009
+ export declare function permissionsFromToken(token: string, options?: PermissionsFromTokenOptions): string[];
4010
+
4011
+ export declare interface PermissionsFromTokenOptions {
4012
+ /** JWT claim to read permissions from. Default: `"permissions"`. */
4013
+ claim?: string;
4014
+ }
4015
+
3381
4016
  export declare const PhoneInput: ForwardRefExoticComponent<Omit<InputProps, "value" | "onChange"> & {
3382
4017
  value: string;
3383
4018
  onChange: (value: string) => void;
@@ -3721,6 +4356,27 @@ export declare const REFETCH_TIME: {
3721
4356
  readonly SLOW: number;
3722
4357
  };
3723
4358
 
4359
+ /**
4360
+ * RefreshIndicator — pull-to-refresh wrapper for touch devices.
4361
+ *
4362
+ * Wraps scrollable `children` and listens for a downward drag that starts while the
4363
+ * container is scrolled to the top. Pulling past `threshold` and releasing triggers
4364
+ * `onRefresh`; the SDK {@link Spinner} is shown while pulling and during the refresh.
4365
+ */
4366
+ export declare function RefreshIndicator({ onRefresh, children, threshold, disabled, className, }: RefreshIndicatorProps): JSX.Element;
4367
+
4368
+ export declare interface RefreshIndicatorProps {
4369
+ /** Invoked when the user pulls past `threshold` and releases. May be async. */
4370
+ onRefresh: () => void | Promise<void>;
4371
+ /** Scrollable content to wrap. */
4372
+ children: ReactNode;
4373
+ /** Pixels the user must pull past to trigger a refresh. Defaults to `80`. */
4374
+ threshold?: number;
4375
+ /** When true, pull-to-refresh is inert. */
4376
+ disabled?: boolean;
4377
+ className?: string;
4378
+ }
4379
+
3724
4380
  /**
3725
4381
  * Register a service worker with consistent update-detection wiring.
3726
4382
  *
@@ -3783,6 +4439,11 @@ export declare interface RelativeTimeProps extends HTMLAttributes<HTMLTimeElemen
3783
4439
  locale?: "pt" | "en";
3784
4440
  }
3785
4441
 
4442
+ export declare interface ReorderPayload {
4443
+ from: number;
4444
+ to: number;
4445
+ }
4446
+
3786
4447
  export declare interface RequestOptions extends Omit<RequestInit, "body"> {
3787
4448
  body?: unknown;
3788
4449
  params?: Record<string, string | number | boolean | undefined | null>;
@@ -3878,6 +4539,15 @@ export declare interface RetryOptions {
3878
4539
  signal?: AbortSignal;
3879
4540
  }
3880
4541
 
4542
+ export declare interface RoleAccessControlConfig {
4543
+ /** Permission strings granted directly, regardless of role. */
4544
+ permissions?: string[];
4545
+ /** Map of role name → permission strings granted by that role. */
4546
+ roles?: Record<string, string[]>;
4547
+ /** The active role(s). Their permissions (from `roles`) are merged in. */
4548
+ role?: string | string[];
4549
+ }
4550
+
3881
4551
  export { Route }
3882
4552
 
3883
4553
  /**
@@ -4205,6 +4875,29 @@ export declare function skipWaiting(worker: ServiceWorker): void;
4205
4875
  */
4206
4876
  export declare function sleep(ms: number): Promise<void>;
4207
4877
 
4878
+ /**
4879
+ * Single-thumb slider built on a native `<input type="range">`, so it stays
4880
+ * accessible (keyboard + screen reader) with no positioning libs. The active
4881
+ * fill is a percentage-width bar. For a two-thumb range, use `RangeSlider`.
4882
+ */
4883
+ export declare function Slider({ value, onChange, min, max, step, label, helperText, disabled, formatValue, className, }: SliderProps): JSX.Element;
4884
+
4885
+ export declare interface SliderProps {
4886
+ /** Current value. */
4887
+ value: number;
4888
+ /** Called with the new value on every change. */
4889
+ onChange: (value: number) => void;
4890
+ min?: number;
4891
+ max?: number;
4892
+ step?: number;
4893
+ label?: string;
4894
+ helperText?: string;
4895
+ disabled?: boolean;
4896
+ /** Formatter for the value badge next to the label. Defaults to the raw number. */
4897
+ formatValue?: (value: number) => string;
4898
+ className?: string;
4899
+ }
4900
+
4208
4901
  /**
4209
4902
  * Convert a string into a URL-safe slug.
4210
4903
  *
@@ -4553,6 +5246,26 @@ export declare interface TempestAuth<TUser, TCredentials> {
4553
5246
  getToken: () => string | null;
4554
5247
  }
4555
5248
 
5249
+ /**
5250
+ * Inject a {@link DataProvider} into the React tree so the resource hooks
5251
+ * (`useList`, `useOne`, `useCreate`, …) can resolve it via {@link useDataProvider}.
5252
+ *
5253
+ * @example
5254
+ * const dataProvider = createDataProvider(apiClient);
5255
+ * <TempestDataProvider provider={dataProvider}>
5256
+ * <App />
5257
+ * </TempestDataProvider>
5258
+ */
5259
+ export declare function TempestDataProvider({ provider, children }: TempestDataProviderProps): JSX.Element;
5260
+
5261
+ /** Props for {@link TempestDataProvider}. */
5262
+ export declare interface TempestDataProviderProps {
5263
+ /** The data provider to expose to descendant resource hooks. */
5264
+ provider: DataProvider;
5265
+ /** The subtree that consumes the provider. */
5266
+ children: ReactNode;
5267
+ }
5268
+
4556
5269
  /**
4557
5270
  * A single declarative route node. Mirrors React Router's nested `<Route>`
4558
5271
  * model but adds first-class `lazy` (code-split with retry) and `guard`
@@ -4709,6 +5422,30 @@ export declare interface TimelineProps extends HTMLAttributes<HTMLOListElement>
4709
5422
  connector?: boolean;
4710
5423
  }
4711
5424
 
5425
+ /**
5426
+ * TimePicker — inline, dependency-free time picker with Material "spinner column" styling.
5427
+ *
5428
+ * Renders scrollable columns of selectable cells (hours, minutes, and AM/PM when
5429
+ * `use12Hours`). Always emits a 24h `"HH:MM"` string via `onChange`, regardless of
5430
+ * whether the 12h display is enabled.
5431
+ */
5432
+ export declare function TimePicker({ value, onChange, minuteStep, use12Hours, label, helperText, disabled, className, }: TimePickerProps): JSX.Element;
5433
+
5434
+ export declare interface TimePickerProps {
5435
+ /** Selected time as a 24h `"HH:MM"` string (e.g. `"14:30"`). May be `""` for none. */
5436
+ value: string;
5437
+ /** Fired with the new 24h `"HH:MM"` string whenever a cell is picked. */
5438
+ onChange: (value: string) => void;
5439
+ /** Granularity of the minute column. Defaults to `5`. */
5440
+ minuteStep?: number;
5441
+ /** When true, show a 1–12 hour column plus an AM/PM column (still emits 24h). */
5442
+ use12Hours?: boolean;
5443
+ label?: string;
5444
+ helperText?: string;
5445
+ disabled?: boolean;
5446
+ className?: string;
5447
+ }
5448
+
4712
5449
  export { To }
4713
5450
 
4714
5451
  export declare interface ToastApi {
@@ -4901,6 +5638,14 @@ export declare function unmask(value: string): string;
4901
5638
  */
4902
5639
  export declare function unregisterAllServiceWorkers(): Promise<number>;
4903
5640
 
5641
+ /** Variables accepted by the update mutation. */
5642
+ export declare interface UpdateVariables {
5643
+ /** The record id to update. */
5644
+ id: string | number;
5645
+ /** The update payload. */
5646
+ data: unknown;
5647
+ }
5648
+
4904
5649
  export declare interface UploadProgressEvent {
4905
5650
  /** Bytes already uploaded. */
4906
5651
  loaded: number;
@@ -4953,6 +5698,16 @@ export declare interface UploadWithProgressOptions {
4953
5698
  */
4954
5699
  export declare function urlBase64ToUint8Array(base64String: string): Uint8Array<ArrayBuffer>;
4955
5700
 
5701
+ /**
5702
+ * Read the current {@link AccessControl} from context.
5703
+ *
5704
+ * Returns `null` when no {@link AccessControlProvider} is present. Callers MUST
5705
+ * treat the absence of a provider as **"allow all"** — i.e. when this returns
5706
+ * `null`, access checks should default to permitted. This keeps the SDK
5707
+ * opt-in: dropping in a provider adds enforcement, removing it disables it.
5708
+ */
5709
+ export declare function useAccessControl(): AccessControl | null;
5710
+
4956
5711
  /**
4957
5712
  * Run an async function and track its `idle/pending/success/error` state.
4958
5713
  *
@@ -5024,6 +5779,36 @@ export declare interface UseBeforeInstallPromptResult {
5024
5779
  */
5025
5780
  export declare function useBreakpoint(): BreakpointHelpers;
5026
5781
 
5782
+ /**
5783
+ * Resolve an access check against the {@link AccessControl} in context.
5784
+ *
5785
+ * Handles sync booleans, sync {@link CanResult}, and promises of either. When
5786
+ * no provider is present, access is allowed (see `useAccessControl`). The check
5787
+ * re-runs whenever the params change.
5788
+ *
5789
+ * @param params - The action/resource being checked.
5790
+ */
5791
+ export declare function useCan(params: CanParams): UseCanResult;
5792
+
5793
+ export declare interface UseCanResult {
5794
+ /** Whether the action is permitted. Defaults to `true` while loading is not the concern of the caller. */
5795
+ allowed: boolean;
5796
+ /** `true` while an async `can` check is pending. */
5797
+ isLoading: boolean;
5798
+ /** Optional explanation, typically present when `allowed` is `false`. */
5799
+ reason?: string;
5800
+ }
5801
+
5802
+ /**
5803
+ * Call `handler` when a `mousedown` / `touchstart` occurs outside the returned
5804
+ * ref's element. SSR-safe — listeners are only attached in the browser.
5805
+ *
5806
+ * @typeParam T - element type to attach the ref to.
5807
+ * @param handler - invoked on an outside interaction.
5808
+ * @returns A ref to attach to the element treated as "inside".
5809
+ */
5810
+ export declare function useClickOutside<T extends HTMLElement = HTMLElement>(handler: () => void): RefObject<T | null>;
5811
+
5027
5812
  /**
5028
5813
  * Client-side filter helper. Performs a case-insensitive match on the listed
5029
5814
  * keys when no custom predicate is provided.
@@ -5056,6 +5841,32 @@ export declare interface UseClipboardResult {
5056
5841
  reset: () => void;
5057
5842
  }
5058
5843
 
5844
+ /**
5845
+ * Numeric counter clamped to an optional `[min, max]` range.
5846
+ *
5847
+ * @param initial - initial value (default `0`), clamped to the range.
5848
+ * @param options - optional `min` / `max` bounds.
5849
+ * @returns Tuple `[count, { increment, decrement, set, reset }]`.
5850
+ */
5851
+ export declare function useCounter(initial?: number, options?: UseCounterOptions): [number, CounterHandlers];
5852
+
5853
+ export declare interface UseCounterOptions {
5854
+ min?: number;
5855
+ max?: number;
5856
+ }
5857
+
5858
+ /**
5859
+ * Create a record and invalidate the resource list cache on success.
5860
+ *
5861
+ * @param resource - The resource name.
5862
+ * @param options - Extra TanStack Mutation options.
5863
+ * @returns The mutation; `mutate(data)` creates the record.
5864
+ */
5865
+ export declare function useCreate<T>(resource: string, options?: UseCreateOptions<T>): UseMutationResult<T, Error, unknown>;
5866
+
5867
+ /** Options for the create mutation (mutationFn + onSuccess are provided). */
5868
+ export declare type UseCreateOptions<T> = Omit<UseMutationOptions<T, Error, unknown>, "mutationFn">;
5869
+
5059
5870
  /**
5060
5871
  * Cursor-pagination hook over TanStack Query's `useInfiniteQuery` for the
5061
5872
  * Tempest `CursorPaginationSchema` envelope
@@ -5102,6 +5913,14 @@ export declare interface UseCursorQueryResult<T> {
5102
5913
  refetch: () => void;
5103
5914
  }
5104
5915
 
5916
+ /**
5917
+ * Read the {@link DataProvider} from context.
5918
+ *
5919
+ * @returns The data provider supplied to the nearest {@link TempestDataProvider}.
5920
+ * @throws {Error} When used outside a {@link TempestDataProvider}.
5921
+ */
5922
+ export declare function useDataProvider(): DataProvider;
5923
+
5105
5924
  /**
5106
5925
  * Debounce a fast-changing value. Returns the latest value once `delay` ms
5107
5926
  * have elapsed without further changes.
@@ -5119,6 +5938,37 @@ export declare function useDebounce<T>(value: T, delay?: number): T;
5119
5938
  */
5120
5939
  export declare function useDeepMemo<T>(value: T): T;
5121
5940
 
5941
+ /**
5942
+ * Delete a record by id and invalidate the resource list cache on success.
5943
+ *
5944
+ * @param resource - The resource name.
5945
+ * @param options - Extra TanStack Mutation options.
5946
+ * @returns The mutation; `mutate(id)` deletes the record.
5947
+ */
5948
+ export declare function useDelete<T>(resource: string, options?: UseDeleteOptions<T>): UseMutationResult<T, Error, string | number>;
5949
+
5950
+ /** Options for the delete mutation (mutationFn + onSuccess are provided). */
5951
+ export declare type UseDeleteOptions<T> = Omit<UseMutationOptions<T, Error, string | number>, "mutationFn">;
5952
+
5953
+ /**
5954
+ * Manage open/closed boolean state with stable `open`/`close`/`toggle` handlers.
5955
+ *
5956
+ * Richer than {@link useToggle} for UI elements like modals, drawers and
5957
+ * popovers: the handlers are referentially stable across renders.
5958
+ *
5959
+ * @param initial - initial opened state (default `false`).
5960
+ * @returns Tuple `[opened, { open, close, toggle }]`.
5961
+ */
5962
+ export declare function useDisclosure(initial?: boolean): [boolean, DisclosureHandlers];
5963
+
5964
+ /**
5965
+ * Set `document.title` while the component is mounted, restoring the previous
5966
+ * title on unmount. SSR-safe — no-op when `document` is unavailable.
5967
+ *
5968
+ * @param title - the title to apply.
5969
+ */
5970
+ export declare function useDocumentTitle(title: string): void;
5971
+
5122
5972
  /** Subscribe to `document.visibilityState`. Returns `"visible"` during SSR. */
5123
5973
  export declare function useDocumentVisibility(): DocumentVisibility;
5124
5974
 
@@ -5179,6 +6029,15 @@ export declare interface UseEventStreamResult<T> {
5179
6029
  reconnect: () => void;
5180
6030
  }
5181
6031
 
6032
+ /**
6033
+ * Swap the document favicon by updating the `<link rel="icon">` href.
6034
+ * Creates the link element when it is missing. SSR-safe — no-op when
6035
+ * `document` is unavailable.
6036
+ *
6037
+ * @param href - the favicon URL to apply.
6038
+ */
6039
+ export declare function useFavicon(href: string): void;
6040
+
5182
6041
  /**
5183
6042
  * Read a boolean flag and re-render when the adapter fires `onChange`.
5184
6043
  *
@@ -5270,6 +6129,13 @@ export declare interface UseIntersectionObserverOptions extends IntersectionObse
5270
6129
  */
5271
6130
  export declare function useInterval(fn: () => void, delay: number | null): void;
5272
6131
 
6132
+ /**
6133
+ * Return `true` on the first render of the component and `false` thereafter.
6134
+ *
6135
+ * @returns Whether the current render is the first one.
6136
+ */
6137
+ export declare function useIsFirstRender(): boolean;
6138
+
5273
6139
  /**
5274
6140
  * Bind a global keyboard shortcut. Supports modifier combinations and a
5275
6141
  * cross-OS `mod` key (Ctrl on Windows/Linux, Cmd on macOS).
@@ -5288,6 +6154,28 @@ export declare interface UseKeyboardShortcutOptions {
5288
6154
  ignoreInput?: boolean;
5289
6155
  }
5290
6156
 
6157
+ /**
6158
+ * Query a paginated list of a resource through the active {@link useDataProvider}.
6159
+ *
6160
+ * @param resource - The resource name.
6161
+ * @param params - Pagination, sort and filter parameters.
6162
+ * @param options - Extra TanStack Query options.
6163
+ * @returns The TanStack Query result for the offset page.
6164
+ */
6165
+ export declare function useList<T>(resource: string, params?: GetListParams, options?: UseListOptions<T>): UseQueryResult<OffsetPage<T>, Error>;
6166
+
6167
+ /** Extra TanStack Query options for {@link useList} (key + fn are provided). */
6168
+ export declare type UseListOptions<T> = Omit<UseQueryOptions<OffsetPage<T>, Error, OffsetPage<T>>, "queryKey" | "queryFn">;
6169
+
6170
+ /**
6171
+ * Manage an array as state with a rich set of immutable handlers.
6172
+ *
6173
+ * @typeParam T - element type.
6174
+ * @param initial - initial list (default `[]`).
6175
+ * @returns Tuple `[list, handlers]`.
6176
+ */
6177
+ export declare function useListState<T>(initial?: T[]): [T[], ListStateHandlers<T>];
6178
+
5291
6179
  /**
5292
6180
  * State synced with `localStorage`. SSR-safe — initial render returns the
5293
6181
  * provided default; the stored value is hydrated after mount. Updates to the
@@ -5320,6 +6208,27 @@ export declare interface UseLongPressOptions {
5320
6208
  moveThreshold?: number;
5321
6209
  }
5322
6210
 
6211
+ /**
6212
+ * Reactive `Map` wrapper. Mutating via `set` / `delete` / `clear` triggers a
6213
+ * re-render and yields a fresh `map` reference each time.
6214
+ *
6215
+ * @typeParam K - key type.
6216
+ * @typeParam V - value type.
6217
+ * @param initial - initial entries.
6218
+ * @returns `{ map, set, delete, clear, get, has, size }`.
6219
+ */
6220
+ export declare function useMap<K, V>(initial?: Iterable<readonly [K, V]>): UseMapResult<K, V>;
6221
+
6222
+ export declare interface UseMapResult<K, V> {
6223
+ map: ReadonlyMap<K, V>;
6224
+ set: (key: K, value: V) => void;
6225
+ delete: (key: K) => void;
6226
+ clear: () => void;
6227
+ get: (key: K) => V | undefined;
6228
+ has: (key: K) => boolean;
6229
+ size: number;
6230
+ }
6231
+
5323
6232
  export { useMatch }
5324
6233
 
5325
6234
  /**
@@ -5330,6 +6239,17 @@ export { useMatch }
5330
6239
  */
5331
6240
  export declare function useMediaQuery(query: string): boolean;
5332
6241
 
6242
+ /**
6243
+ * Access the imperative modals API. Must be used within a {@link ModalsProvider}.
6244
+ *
6245
+ * @example
6246
+ * const modals = useModals();
6247
+ * modals.confirm({ message: "Excluir item?", danger: true, onConfirm: del });
6248
+ *
6249
+ * @throws Error when called outside a {@link ModalsProvider}.
6250
+ */
6251
+ export declare function useModals(): ModalsApi;
6252
+
5333
6253
  export { useNavigate }
5334
6254
 
5335
6255
  /**
@@ -5381,6 +6301,23 @@ export declare interface UseOAuthCallbackResult<T> {
5381
6301
  status: "pending" | "success" | "error";
5382
6302
  }
5383
6303
 
6304
+ /**
6305
+ * Query a single record by id through the active {@link useDataProvider}.
6306
+ *
6307
+ * The query is disabled while `id` is `null`/`undefined`.
6308
+ *
6309
+ * @param resource - The resource name.
6310
+ * @param id - The record id.
6311
+ * @param options - Extra TanStack Query options.
6312
+ * @returns The TanStack Query result for the record.
6313
+ */
6314
+ export declare function useOne<T>(resource: string, id: string | number | null | undefined, options?: UseOneOptions<T>): UseQueryResult<T, Error>;
6315
+
6316
+ /** Extra TanStack Query options for {@link useOne} (key + fn + enabled are provided). */
6317
+ export declare type UseOneOptions<T> = Omit<UseQueryOptions<T, Error, T>, "queryKey" | "queryFn" | "enabled"> & {
6318
+ enabled?: boolean;
6319
+ };
6320
+
5384
6321
  /**
5385
6322
  * Track the browser's `navigator.onLine` value and re-render on changes.
5386
6323
  * Returns `true` during SSR (assumption: server is online).
@@ -5543,6 +6480,36 @@ export declare interface UsePushSubscriptionResult {
5543
6480
  refresh: () => Promise<void>;
5544
6481
  }
5545
6482
 
6483
+ /**
6484
+ * FIFO queue with an optional `limit`. When more items are added than `limit`
6485
+ * allows, the surplus is kept in an internal overflow buffer and surfaces into
6486
+ * `queue` as room frees up (e.g. after `cleanQueue`). Loosely mirrors Mantine's
6487
+ * `useQueue` shape.
6488
+ *
6489
+ * @typeParam T - element type.
6490
+ * @param options - `initialValues` and `limit` (default limit `Infinity`).
6491
+ * @returns `{ queue, add, update, cleanQueue, size }`.
6492
+ */
6493
+ export declare function useQueue<T>(options?: UseQueueOptions<T>): UseQueueResult<T>;
6494
+
6495
+ export declare interface UseQueueOptions<T> {
6496
+ initialValues?: T[];
6497
+ limit?: number;
6498
+ }
6499
+
6500
+ export declare interface UseQueueResult<T> {
6501
+ /** Items currently held within the queue (up to `limit`). */
6502
+ queue: T[];
6503
+ /** Append items; overflow beyond `limit` is held back, not dropped. */
6504
+ add: (...items: T[]) => void;
6505
+ /** Replace the held queue via a mapper over the current held items. */
6506
+ update: (fn: (state: T[]) => T[]) => void;
6507
+ /** Drop all currently held (visible) items, keeping any overflow. */
6508
+ cleanQueue: () => void;
6509
+ /** Number of visible items in the queue. */
6510
+ size: number;
6511
+ }
6512
+
5546
6513
  /**
5547
6514
  * Track size changes of a DOM element via `ResizeObserver`.
5548
6515
  * Returns `null` until the first measurement.
@@ -5559,6 +6526,26 @@ export declare function useScrollLock(active: boolean): void;
5559
6526
 
5560
6527
  export { useSearchParams }
5561
6528
 
6529
+ /**
6530
+ * Reactive `Set` wrapper. Mutating via `add` / `delete` / `clear` / `toggle`
6531
+ * triggers a re-render and yields a fresh `set` reference each time.
6532
+ *
6533
+ * @typeParam T - element type.
6534
+ * @param initial - initial values.
6535
+ * @returns `{ set, add, delete, clear, has, toggle, size }`.
6536
+ */
6537
+ export declare function useSet<T>(initial?: Iterable<T>): UseSetResult<T>;
6538
+
6539
+ export declare interface UseSetResult<T> {
6540
+ set: ReadonlySet<T>;
6541
+ add: (value: T) => void;
6542
+ delete: (value: T) => void;
6543
+ clear: () => void;
6544
+ has: (value: T) => boolean;
6545
+ toggle: (value: T) => void;
6546
+ size: number;
6547
+ }
6548
+
5562
6549
  /**
5563
6550
  * Returns a stable function reference that always invokes the latest
5564
6551
  * `callback` argument. Use to break dependency cycles in effects without
@@ -5616,6 +6603,18 @@ export declare function useToggle(initial?: boolean): [boolean, ToggleHelpers];
5616
6603
  */
5617
6604
  export declare function useTranslate(): I18nContextValue["t"];
5618
6605
 
6606
+ /**
6607
+ * Update a record and invalidate both the list and the single-record caches.
6608
+ *
6609
+ * @param resource - The resource name.
6610
+ * @param options - Extra TanStack Mutation options.
6611
+ * @returns The mutation; `mutate({ id, data })` updates the record.
6612
+ */
6613
+ export declare function useUpdate<T>(resource: string, options?: UseUpdateOptions<T>): UseMutationResult<T, Error, UpdateVariables>;
6614
+
6615
+ /** Options for the update mutation (mutationFn + onSuccess are provided). */
6616
+ export declare type UseUpdateOptions<T> = Omit<UseMutationOptions<T, Error, UpdateVariables>, "mutationFn">;
6617
+
5619
6618
  /**
5620
6619
  * React hook for the public ViaCEP service (`viacep.com.br`). No backend
5621
6620
  * required. Returns address fields when the CEP exists, or sets `error` for
@@ -6141,6 +7140,8 @@ export declare type WebSocketStatus = "idle" | "connecting" | "open" | "closing"
6141
7140
 
6142
7141
  export declare type WeekStart = 0 | 1;
6143
7142
 
7143
+ declare type WeekStart_2 = 0 | 1;
7144
+
6144
7145
  export declare interface WindowSize {
6145
7146
  width: number;
6146
7147
  height: number;