@abpjs/ui 0.2.0-next.2 → 0.2.0-next.21

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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _chakra_ui_react from '@chakra-ui/react';
2
2
  import { SystemConfig, SystemContext, LinkProps, HTMLChakraProps, SystemStyleObject, chakra, ButtonProps as ButtonProps$1, IconButtonProps as IconButtonProps$1, TableRowProps, Checkbox, Field as Field$1, NativeSelect, Switch, Alert, BoxProps as BoxProps$1, InputProps, Tooltip as Tooltip$1 } from '@chakra-ui/react';
3
3
  import * as react from 'react';
4
- import { ComponentType, ReactNode, ElementType, AnchorHTMLAttributes, ComponentProps, RefObject, ReactElement } from 'react';
4
+ import { ReactNode, ComponentType, ElementType, AnchorHTMLAttributes, ComponentProps, RefObject, ReactElement } from 'react';
5
5
  import { ThemeProviderProps } from 'next-themes';
6
6
  import { Announcements } from '@dnd-kit/core';
7
7
  import * as _ark_ui_react from '@ark-ui/react';
@@ -90,7 +90,43 @@ interface AbpLabels {
90
90
  /** Above a form with wrong fields, `{count}` of them (ICU plural). */
91
91
  formFix: string;
92
92
  queryList: QueryListLabels;
93
+ translations: TranslationsLabels;
94
+ picker: PickerLabels;
95
+ }
96
+ /** Strings of SearchPicker, PersonPicker and GroupPicker. `{count}` is filled in (ICU plural). */
97
+ interface PickerLabels {
98
+ placeholder: string;
99
+ searching: string;
100
+ noMatches: string;
101
+ /** Nothing to offer when nothing can be searched. */
102
+ noKnown: string;
103
+ /** Above the options: how many match what's typed. */
104
+ matches: string;
105
+ /** Above the options when there are more than shown. */
106
+ firstMatches: string;
107
+ searchPeople: string;
108
+ /** A person picker with no search: the people on the page. */
109
+ choosePerson: string;
110
+ noPeople: string;
111
+ noKnownPeople: string;
112
+ searchGroups: string;
113
+ noGroups: string;
114
+ }
115
+ declare const defaultPickerLabels: PickerLabels;
116
+ /** Strings of TranslatedInput. {name}, {filled}, {total}, {shown} are filled in by the component. */
117
+ interface TranslationsLabels {
118
+ /** Above the other languages' fields. */
119
+ title: string;
120
+ /** The button that opens them, for a screen reader. */
121
+ open: string;
122
+ /** The button's tooltip. */
123
+ count: string;
124
+ /** Under a language left empty: which name shows instead. */
125
+ missing: string;
126
+ /** The list of names already translated. */
127
+ suggestions: string;
93
128
  }
129
+ declare const defaultTranslationsLabels: TranslationsLabels;
94
130
  /** Strings of QueryableList. {name} placeholders are filled in by the component. */
95
131
  interface QueryListLabels {
96
132
  savedView: string;
@@ -191,8 +227,30 @@ interface QueryListLabels {
191
227
  }
192
228
  declare const defaultQueryListLabels: QueryListLabels;
193
229
  declare const defaultLabels: AbpLabels;
230
+ /**
231
+ * The labels a host gives: any of them, and any of a group's (the query list's, the pickers', the translations'); the
232
+ * rest are the defaults, so a group the package adds later needs nothing from a host that doesn't use it.
233
+ */
234
+ type AbpLabelsInput = Partial<Omit<AbpLabels, 'queryList' | 'translations' | 'picker'>> & {
235
+ queryList?: Partial<QueryListLabels>;
236
+ translations?: Partial<TranslationsLabels>;
237
+ picker?: Partial<PickerLabels>;
238
+ };
194
239
  declare function useAbpLabels(): AbpLabels;
195
240
 
241
+ /** A framework's hook for HTML to put in the page's head while it streams (Next's `useServerInsertedHTML`). */
242
+ type ServerInsertedHTML = (callback: () => ReactNode) => void;
243
+ /**
244
+ * Emotion's styles in the page's head on the server, so the first render matches the client's. Without it, a style
245
+ * Emotion writes during the server render (Chakra's global styles) lands inside the body where the client expects
246
+ * something else (next-themes' script), and React's hydration fails. The framework's hook comes from the host, so the
247
+ * package names no framework.
248
+ */
249
+ declare function EmotionRegistry({ useServerInsertedHTML, children }: {
250
+ useServerInsertedHTML: ServerInsertedHTML;
251
+ children: ReactNode;
252
+ }): react.JSX.Element;
253
+
196
254
  /**
197
255
  * An answer the server refused, in ABP's error shape (`{ error: { code, message, details, validationErrors } }`), or
198
256
  * a problem's title, or the status. Read as JSON whatever the content type says, as file routes answer refusals so.
@@ -218,6 +276,37 @@ declare function readAbpError(res: Response): Promise<AbpApiError>;
218
276
  /** An error as a person reads it. */
219
277
  declare function errorText(e: unknown): string;
220
278
  declare const isStepUp: (e: unknown) => boolean;
279
+ /** A strong step-up asked of someone with no strong factor yet (AbpGuard 0.7.0): they set one up, then step up. */
280
+ declare const STRONG_FACTOR_REQUIRED = "strong_factor_required";
281
+ /** A refusal the step-up dialog answers: a step-up, or a strong factor to set up first. */
282
+ declare const needsStepUp: (e: unknown) => e is AbpApiError;
283
+
284
+ /**
285
+ * What the server asked for (AbpGuard 0.7.0, ADR 0110 in the application it came from): a step-up at a level, with the
286
+ * person's ways best first, or a strong factor they don't have yet. Older servers send no level: the password level.
287
+ */
288
+ interface StepUpNeed {
289
+ /** `step_up_required`, or `strong_factor_required` when a strong step-up is asked of someone with no strong factor. */
290
+ code: string;
291
+ /** `password` (the password, with a code of a second factor when the person has one) or `strong` (a passkey, or the password and an authenticator code). */
292
+ level: 'password' | 'strong';
293
+ category: string | null;
294
+ /** The person's ways at that level, best first: `passkey`, `app`, `password`, `email`… Empty when the server doesn't say. */
295
+ methods: string[];
296
+ /** An authenticator code alone passes (the operator's setting, AbpGuard's `appCodeAlone`); else it goes with the password. */
297
+ appCodeAlone: boolean;
298
+ }
299
+ /** What asks the person to confirm who they are: true once confirmed (or a strong factor set up), false if they gave up. */
300
+ type StepUpHandler = (need: StepUpNeed) => Promise<boolean>;
301
+ /** The step-up dialog registers itself here (`StepUpDialog`, drawn by `AbpProvider`); null when it goes. */
302
+ declare function setStepUpHandler(next: StepUpHandler | null): void;
303
+ /** The need an error carries: its code, and the level and methods in its data. */
304
+ declare function stepUpNeedOf(code: string, data: Record<string, unknown> | null | undefined): StepUpNeed;
305
+ /**
306
+ * Asks the person to confirm who they are, once however many calls are waiting for it (ADR 0109 amendment). False when
307
+ * nothing is registered to ask with: the call then fails with the server's refusal, as it would without.
308
+ */
309
+ declare function requestStepUp(need?: StepUpNeed): Promise<boolean>;
221
310
 
222
311
  /** What a call sends: its method, a JSON body (or FormData as is), headers, and a way to stop it. */
223
312
  interface HostRequestInit {
@@ -227,6 +316,8 @@ interface HostRequestInit {
227
316
  signal?: AbortSignal;
228
317
  /** The answer as a file (a Blob and the name Content-Disposition gives) rather than JSON. */
229
318
  as?: 'json' | 'file';
319
+ /** False: a refusal that asks for a step-up is thrown, not asked (the step-up dialog's own calls). */
320
+ stepUp?: false;
230
321
  }
231
322
  /** A file the server answered with. */
232
323
  interface HostFile {
@@ -250,7 +341,7 @@ interface HostRequestOptions {
250
341
  * A 403 `step_up_required`: the host confirms the person again; true retries the call once. By default the step-up
251
342
  * dialog `AbpProvider` draws asks (`requestStepUp`), and without one the call fails as the server answered.
252
343
  */
253
- stepUp?: () => Promise<boolean>;
344
+ stepUp?: (need: StepUpNeed) => Promise<boolean>;
254
345
  /** More headers on every call (a development user, a tenant). */
255
346
  headers?: () => Record<string, string>;
256
347
  fetch?: typeof fetch;
@@ -276,7 +367,7 @@ type HostEvents = (path: string, onEvent: HostEventHandler, options?: {
276
367
  }) => Promise<string | null>;
277
368
  /** Reads a response's server-sent events to its end. */
278
369
  declare function readEvents(res: Response, onEvent: HostEventHandler): Promise<void>;
279
- /** Server-sent events for a host without its own reader: same origin, its headers, a 401 handed back, one step-up. */
370
+ /** Server-sent events for a host without its own reader: same origin, its headers, a 401 handed back, a step-up (the dialog's by default). */
280
371
  declare function createHostEvents(options?: Pick<HostRequestOptions, 'onUnauthorized' | 'stepUp' | 'headers' | 'fetch'>): HostEvents;
281
372
 
282
373
  /** A scope as a host knows it: a project, an org unit. */
@@ -290,9 +381,18 @@ interface HostScope {
290
381
  /** One of the site's languages, for names by language. */
291
382
  interface HostLanguage {
292
383
  code: string;
384
+ /** Its name in itself ("العربية"). */
293
385
  name: string;
386
+ /** Its name in English, shown beside `name` where they differ. */
387
+ englishName?: string;
294
388
  direction?: 'ltr' | 'rtl';
295
389
  }
390
+ /** A name someone already translated (a text of the host's, a setting's name): every language at once. */
391
+ interface NameSuggestion {
392
+ names: Record<string, string>;
393
+ /** Where it comes from, as the host words it ("Status · FIN"). */
394
+ source?: string;
395
+ }
296
396
  /**
297
397
  * What a host gives the screens (ADR 0109 amendment): how to call its server, where each package's API is, how to
298
398
  * move, what the person may do, its scopes and people, its languages, its words for any text, and the slots it fills.
@@ -321,6 +421,8 @@ interface AbpHost {
321
421
  names?: (accountIds: string[]) => Promise<Record<string, string>>;
322
422
  /** The site's languages, the first the default. */
323
423
  languages?: HostLanguage[];
424
+ /** Names already translated that start with what's typed, so a name is translated the same way everywhere. */
425
+ suggestNames?: (text: string, signal: AbortSignal) => Promise<NameSuggestion[]>;
324
426
  /** The host's words for any area's text, by area then language then key: `{ ai: { en: { 'models.title': 'AI models' } } }`. */
325
427
  texts?: Record<string, Record<string, Record<string, string>>>;
326
428
  /**
@@ -339,7 +441,10 @@ declare function HostProvider({ value, children }: {
339
441
  declare function useHost(): AbpHost;
340
442
  /** The host when there is one: for parts that also work without (a slot that draws nothing). */
341
443
  declare function useOptionalHost(): AbpHost | null;
342
- /** A package's calls on this host: its base path in front of each path. */
444
+ /**
445
+ * A package's calls on this host: its base path in front of each path. The same function while the area's path stays
446
+ * the same, whatever the host object is; each call goes through the host's current `request`.
447
+ */
343
448
  declare function useAreaRequest(area: string): HostRequest;
344
449
  interface ApiQuery<T> {
345
450
  data: T | undefined;
@@ -412,7 +517,7 @@ interface AbpProviderProps {
412
517
  /** BCP 47 locale ("en", "ar"). Sets direction for every component, portals included. */
413
518
  locale?: string;
414
519
  /** Translated strings for the components' own text (close, cancel, sort ...). */
415
- labels?: Partial<AbpLabels>;
520
+ labels?: AbpLabelsInput;
416
521
  /** The host router's link component (next/link in the shell). */
417
522
  linkComponent?: LinkComponent;
418
523
  /** Initial colour mode when the user has not chosen one. */
@@ -425,6 +530,12 @@ interface AbpProviderProps {
425
530
  timeZone?: string;
426
531
  /** How much the interface moves for the person (ADR 0058); as their system says when it's not given. */
427
532
  motion?: MotionSetting;
533
+ /**
534
+ * The framework's hook for HTML in the page's head while it streams (Next's `useServerInsertedHTML`): with it, Emotion's
535
+ * styles go there on the server, so the first render hydrates without a mismatch. A host that renders on the client
536
+ * only leaves it out.
537
+ */
538
+ useServerInsertedHTML?: ServerInsertedHTML;
428
539
  }
429
540
  /**
430
541
  * Chakra (with the host's system), colour mode (next-themes, class on <html>), locale and
@@ -433,7 +544,7 @@ interface AbpProviderProps {
433
544
  *
434
545
  * The host must also set `<html lang dir>` and `suppressHydrationWarning` on <html>.
435
546
  */
436
- declare function AbpProvider({ children, system, host, locale, labels, linkComponent, defaultColorMode, pluginTexts, productName, timeZone, motion }: AbpProviderProps): react.JSX.Element;
547
+ declare function AbpProvider({ children, useServerInsertedHTML, ...props }: AbpProviderProps): react.JSX.Element;
437
548
 
438
549
  type ColorMode = 'light' | 'dark';
439
550
  /** next-themes, configured the way Chakra v3 expects: a `light`/`dark` class on <html>. */
@@ -448,6 +559,209 @@ declare function ColorModeToggle({ size }: {
448
559
  size?: 'xs' | 'sm' | 'md';
449
560
  }): react.JSX.Element;
450
561
 
562
+ type NamesValue = Record<string, string>;
563
+ interface TranslatedInputProps {
564
+ /** Names by language code. */
565
+ value: NamesValue;
566
+ onChange: (value: NamesValue) => void;
567
+ /** Shown when nothing is given in a language, and the last resort for what shows (usually the object's key). */
568
+ fallback?: string;
569
+ 'aria-label'?: string;
570
+ placeholder?: string;
571
+ size?: 'xs' | 'sm' | 'md';
572
+ disabled?: boolean;
573
+ autoFocus?: boolean;
574
+ onBlur?: () => void;
575
+ /** Offer names already translated while typing (the host's `suggestNames`; default on where the host has it). */
576
+ suggest?: boolean;
577
+ }
578
+ /**
579
+ * A name in every language the site offers (the host's `languages`): the reader's language inline, the others behind a
580
+ * button that shows how many are filled in. Each language is typed in its own direction, and one left empty says which
581
+ * name shows instead. Where the host offers names already translated (`suggestNames`), typing lists them, and picking
582
+ * one fills in every language at once, so a name is translated the same way everywhere. A host with no languages gets
583
+ * one field.
584
+ */
585
+ declare function TranslatedInput({ value, onChange, fallback, 'aria-label': ariaLabel, placeholder, size, disabled, autoFocus, onBlur, suggest, }: TranslatedInputProps): react.JSX.Element;
586
+
587
+ /** What a list shows: a page of rows, sorted and narrowed (ADR 0109 amendment). */
588
+ interface ListQuery {
589
+ /** From 1. */
590
+ page: number;
591
+ pageSize: number;
592
+ /** A column's id and its direction; null for the list's own order. */
593
+ sort: {
594
+ columnId: string;
595
+ direction: 'asc' | 'desc';
596
+ } | null;
597
+ /** What's typed in the list's search. */
598
+ search: string;
599
+ /** The list's other filters by name (a status, a directory); an empty value is no filter. */
600
+ filters: Record<string, string>;
601
+ }
602
+ /** A page of a list: its rows and how many there are in all. */
603
+ interface ListPage<T> {
604
+ items: T[];
605
+ total: number;
606
+ }
607
+ /**
608
+ * Where a list's rows come from: the server package's own paging, or the host's (its query engine), which a host gives
609
+ * an area in place of the package's. `key` names what it lists: a different key is a different list, read afresh.
610
+ */
611
+ interface ListSource<T> {
612
+ key: string;
613
+ load: (query: ListQuery, signal: AbortSignal) => Promise<ListPage<T>>;
614
+ }
615
+ declare const DEFAULT_PAGE_SIZE = 25;
616
+ declare function emptyQuery(initial?: Partial<ListQuery>): ListQuery;
617
+ /** How a list's query maps onto a server's: the search's parameter, and each sortable column's field. */
618
+ interface AbpListOptions {
619
+ /** The parameter the search goes in (ABP's lists: `filter`). */
620
+ searchParam?: string;
621
+ /** A column's id to the server's field for `sorting`; a column not here sorts by its id. */
622
+ sortFields?: Record<string, string>;
623
+ /** Parameters every page asks with (a fixed scope, a kind). */
624
+ fixed?: Record<string, string>;
625
+ }
626
+ /** ABP's paging parameters for a query: `skipCount`, `maxResultCount`, `sorting` ("username desc"), the search and filters. */
627
+ declare function abpListParams(query: ListQuery, options?: AbpListOptions): URLSearchParams;
628
+ /** A list served in ABP's shape (`PagedAndSortedResultRequestDto` in, `{ totalCount, items }` out) at a path. */
629
+ declare function abpListSource<T>(request: HostRequest, path: string, options?: AbpListOptions): ListSource<T>;
630
+ /** How many pages a list has (at least one). */
631
+ declare const pageCount: (total: number, pageSize: number) => number;
632
+
633
+ interface ListState<T> {
634
+ /** The list's place: its page, size, sort, filters, and what's typed in its search (asked once typing settles). */
635
+ query: ListQuery;
636
+ /** The page's rows; undefined until the first page comes. */
637
+ rows: T[] | undefined;
638
+ total: number;
639
+ pages: number;
640
+ /** The first page is coming. */
641
+ loading: boolean;
642
+ /** Another page or a new search is coming: the rows shown are the last ones until it does. */
643
+ refreshing: boolean;
644
+ error: string | null;
645
+ setSearch: (search: string) => void;
646
+ /** One filter by name; null or '' removes it. */
647
+ setFilter: (name: string, value: string | null) => void;
648
+ setSort: (sort: ListQuery['sort']) => void;
649
+ setPage: (page: number) => void;
650
+ setPageSize: (pageSize: number) => void;
651
+ /** Reads the page again (after a change made elsewhere). */
652
+ reload: () => void;
653
+ /** For `DataTable`: the rows, the first load's placeholders, the error, and the sort, which the source applies. */
654
+ table: {
655
+ rows: T[] | undefined;
656
+ loading: boolean;
657
+ error: string | null;
658
+ sort: ListQuery['sort'];
659
+ onSortChange: (sort: ListQuery['sort']) => void;
660
+ sortMode: 'manual';
661
+ };
662
+ /** For `Pagination`: the page and how many. */
663
+ pagination: {
664
+ page: number;
665
+ pages: number;
666
+ onPage: (page: number) => void;
667
+ };
668
+ }
669
+ /**
670
+ * A list's page, search, filters and sort, read from its source (ADR 0109 amendment): a change of search, filters, sort
671
+ * or page size goes back to the first page; typing waits `searchDelay` ms; only the latest answer counts; a different
672
+ * source (its `key`) starts empty. `onQueryChange` hears every change, for a screen that keeps the list's place in its
673
+ * address.
674
+ */
675
+ declare function useListState<T>(source: ListSource<T>, options?: {
676
+ initial?: Partial<ListQuery>;
677
+ searchDelay?: number;
678
+ onQueryChange?: (query: ListQuery) => void;
679
+ }): ListState<T>;
680
+ /** An area's list served in ABP's shape at a path on this host (`/accounts/page`): the same source while the path is. */
681
+ declare function useAreaListSource<T>(area: string, path: string, options?: AbpListOptions): ListSource<T>;
682
+
683
+ /**
684
+ * A paged list's foot (`useListState`): its pages, and which rows of how many show ("26–50 of 112"), in the labels'
685
+ * `queryList` words. Nothing until the first page comes, or when the list is empty.
686
+ */
687
+ declare function ListFooter<T>({ list }: {
688
+ list: ListState<T>;
689
+ }): react.JSX.Element | null;
690
+
691
+ /** A value that follows another once it has stood still for `ms` (what's typed in a search box, before it asks). */
692
+ declare function useSettledValue<T>(value: T, ms?: number): T;
693
+
694
+ /**
695
+ * A text with the part matching what was typed in bold, every match, ignoring case; as it was when nothing is typed or
696
+ * nothing matches.
697
+ */
698
+ declare function Highlight({ text, query }: {
699
+ text: string;
700
+ query: string;
701
+ }): react.JSX.Element;
702
+ interface SearchPickerMessages {
703
+ placeholder: string;
704
+ searching: string;
705
+ noMatches: string;
706
+ noKnown: string;
707
+ /** Under the list when nothing can be searched and only `known` is offered. */
708
+ limitedHint?: string;
709
+ }
710
+ interface SearchPickerProps<T> {
711
+ value: T | null;
712
+ onChange: (item: T | null) => void;
713
+ /** Searches as the person types; null when there's nothing to search, and only `known` is offered. */
714
+ search: ((text: string) => Promise<T[]>) | null;
715
+ /** Items to offer without searching (people on the page…), filtered by the text typed. */
716
+ known?: T[];
717
+ getId: (item: T) => string;
718
+ /** The text the input shows for the chosen item, and what typing filters `known` by. */
719
+ label: (item: T) => string;
720
+ /** How an option reads in the list (with what's typed, to bold its match: `Highlight`); the label, its match bold, by default. */
721
+ renderOption?: (item: T, query: string) => ReactNode;
722
+ /**
723
+ * Making a new item from the text typed, offered last when no option is called just that ("Add “Acme” as a new
724
+ * vendor"); it resolves with the item made, which is then picked, or null when it wasn't.
725
+ */
726
+ create?: {
727
+ label: (text: string) => string;
728
+ onCreate: (text: string) => Promise<T | null>;
729
+ };
730
+ /** Offer an empty choice ("Unassigned"). */
731
+ clearLabel?: string;
732
+ /** With nothing picked, the closed input shows the placeholder rather than the empty choice's words. */
733
+ emptyShowsPlaceholder?: boolean;
734
+ /** The picker's words; the labels' `picker` defaults where not given. */
735
+ messages?: Partial<SearchPickerMessages>;
736
+ disabled?: boolean;
737
+ size?: 'sm' | 'md';
738
+ 'aria-label'?: string;
739
+ id?: string;
740
+ }
741
+ /** One item picked from a searchable list: an ARIA combobox with keyboard support. */
742
+ declare function SearchPicker<T>({ value, onChange, search, known, getId, label, renderOption, create, clearLabel, emptyShowsPlaceholder, messages: own, disabled, size, id, 'aria-label': ariaLabel, }: SearchPickerProps<T>): react.JSX.Element;
743
+ /** A person to pick: an account's id, username and name, and whether it's an agent's. */
744
+ interface PickerPerson {
745
+ id: string;
746
+ username: string;
747
+ displayName?: string | null;
748
+ }
749
+ /** A group (a team) to pick. */
750
+ interface PickerGroup {
751
+ id: string;
752
+ name: string;
753
+ }
754
+ declare const personLabel: (p: PickerPerson | null | undefined) => string;
755
+ /**
756
+ * Picks one person: their name and @username, searched by `search` (the area's call, or the host's); without one, the
757
+ * people already `known` on the page. `badge` marks a person where the host has something to say (an agent's account).
758
+ */
759
+ declare function PersonPicker<P extends PickerPerson>({ badge, messages, ...rest }: Omit<SearchPickerProps<P>, 'getId' | 'label' | 'renderOption'> & {
760
+ badge?: (person: P) => ReactNode;
761
+ }): react.JSX.Element;
762
+ /** Picks one group, searched by `search` (the area's call, or the host's). */
763
+ declare function GroupPicker<G extends PickerGroup>({ messages, ...rest }: Omit<SearchPickerProps<G>, 'getId' | 'label'>): react.JSX.Element;
764
+
451
765
  type Direction = 'ltr' | 'rtl';
452
766
  /** Text direction for a BCP 47 locale ("ar", "ar-SA" -> rtl). */
453
767
  declare function directionOf(locale: string): Direction;
@@ -1517,27 +1831,39 @@ declare function useSlotSaves(): {
1517
1831
  run: () => Promise<void>;
1518
1832
  };
1519
1833
 
1520
- /** What asks the person to confirm who they are: true once confirmed, false if they gave up. */
1521
- type StepUpHandler = () => Promise<boolean>;
1522
- /** The step-up dialog registers itself here (`StepUpDialog`, drawn by `AbpProvider`); null when it goes. */
1523
- declare function setStepUpHandler(next: StepUpHandler | null): void;
1524
- /**
1525
- * Asks the person to confirm who they are, once however many calls are waiting for it (ADR 0109 amendment). False when
1526
- * nothing is registered to ask with: the call then fails with the server's `step_up_required`, as it would without.
1527
- */
1528
- declare function requestStepUp(): Promise<boolean>;
1529
-
1530
1834
  /** Whether what was typed can be a code yet: six digits (spaces between are fine), or a recovery code's ten characters. */
1531
1835
  declare function looksLikeCode(value: string, recovery: boolean): boolean;
1532
1836
  /**
1533
- * Asks for the password again before a sensitive action (ADR 0109 amendment, on AbpGuard's step-up): the server answers
1534
- * 403 `step_up_required`, the host's request asks here, and the call is tried again once confirmed. A person with a
1535
- * second factor gives a code too, from their app, a recovery code, or one the site sends. Too many wrong passwords end
1536
- * the session (401), which the host's request hands to the host. `AbpProvider` draws it when the host gives
1537
- * `paths.guard`; a host with its own dialog sets `stepUpDialog: false`.
1837
+ * Confirms the person before a sensitive action (ADR 0109 amendment, on AbpGuard's step-up): the server answers 403
1838
+ * `step_up_required`, the host's request asks here, and the call is tried again once confirmed.
1839
+ *
1840
+ * - At the password level: the password, and a code of their second factor when they have one (their app, a recovery
1841
+ * code, or one the site sends).
1842
+ * - At the strong level (AbpGuard 0.7.0): a passkey first when they have one, or an authenticator code: alone where the
1843
+ * server says one passes alone (`appCodeAlone`, the operator's setting), else with the password. Where a code passes
1844
+ * alone it's offered at the password level too.
1845
+ * - Asked for a strong step-up with no strong factor (`strong_factor_required`): the password, then setting up a passkey
1846
+ * or the app here (with recovery codes, shown once, for a first factor); the call then asks again, and they confirm
1847
+ * with what they set up.
1848
+ *
1849
+ * Too many wrong passwords end the session (401), which the host's request hands to the host. `AbpProvider` draws it
1850
+ * when the host gives `paths.guard`; a host with its own dialog sets `stepUpDialog: false`.
1538
1851
  */
1539
1852
  declare function StepUpDialog(): react.JSX.Element;
1540
1853
 
1854
+ /**
1855
+ * Passkeys in the browser (WebAuthn), in the browser's own JSON both ways, as AbpGuard 0.7.0 speaks it: the options come
1856
+ * as `PublicKeyCredentialCreationOptionsJSON` / `PublicKeyCredentialRequestOptionsJSON`, and the answer goes back as the
1857
+ * credential's `toJSON()`. Browsers without the JSON methods get the same through base64url here.
1858
+ */
1859
+ type Json = Record<string, unknown>;
1860
+ /** Whether this browser can use passkeys at all (a secure page with WebAuthn). */
1861
+ declare function passkeysSupported(): boolean;
1862
+ /** Makes a passkey on this device from the server's creation options; null when the person cancelled. */
1863
+ declare function createPasskey(options: Json, signal?: AbortSignal): Promise<Json | null>;
1864
+ /** Proves a passkey from the server's request options; null when the person cancelled or had none here. */
1865
+ declare function getPasskey(options: Json, signal?: AbortSignal): Promise<Json | null>;
1866
+
1541
1867
  /**
1542
1868
  * A text with its values filled, in the subset of ICU message syntax the screens' texts use: `{name}`, plurals
1543
1869
  * (`{count, plural, =0 {none} one {# item} other {# items}}`, with Arabic's zero, two, few and many) and choices
@@ -2760,4 +3086,4 @@ interface TooltipProps extends Omit<Tooltip$1.RootProps, 'children'> {
2760
3086
  */
2761
3087
  declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLDivElement>>;
2762
3088
 
2763
- export { ABP_UI_VERSION, AbpApiError, type AbpBrand, type AbpHost, type AbpLabels, AbpProvider, type AbpProviderProps, type AbpSystemOptions, type ApiQuery, AppLink, type AppLinkProps, AppShell, type AppShellBrand, type AppShellNavItem, type AppShellNavSection, type AppShellPlace, type AppShellProps, type AppShellSidebar, type AreaTexts, type Arrival, ArriveOnChange, type ArriveOnChangeProps, AttentionChip, type AttentionChipProps, type AvatarPerson, AvatarStack, type AvatarStackProps, Bone, type BoneProps, type BreadcrumbItem, Breadcrumbs, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarGrid, type CalendarGridProps, type CalendarItem, type CardDates, CategoryProgress, type CategoryProgressProps, type CelebrateTarget, Chart, type ChartProps, type ChartSeries, CheckboxField, type CheckboxFieldProps, Collapse, type CollapseProps, type ColorMode, ColorModeProvider, ColorModeToggle, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, ConfirmProvider, CountBadge, type CountBadgeProps, Counter, type CounterProps, DashboardGrid, type DashboardGridProps, DataTable, type DataTableColumn, type DataTableProps, type DataTableSelection, type DataTableSort, type Direction, DirectionalIcon, DropHint, type DropHintProps, type DropZoneOptions, type DropZoneState, type DroppedFile, EMPTY_VALUE, EmptyState, type EmptyStateProps, FadeIn, type FadeInProps, Field, type FieldProps, FileDropArea, type FileDropAreaProps, FormDialog, type FormDialogProps, FormField, type GridItem, HighlightText, type HostEventHandler, type HostEvents, type HostFile, type HostLanguage, HostProvider, type HostRequest, type HostRequestInit, type HostRequestOptions, type HostScope, HostSlot, IconButton, type IconButtonProps, IconTile, type IconTileProps, Indicator, type IndicatorProps, InlineAlert, type InlineAlertProps, KanbanBoard, type KanbanBoardProps, type KanbanColumn, type KanbanItem, type KanbanLane, type KanbanMove, type LinkComponent, Loading, type LoadingProps, LoadingState, MotionProvider, type MotionSetting, type MotionState, Nudge, type NudgeProps, PageHeader, type PageHeaderProps, PageTitleProvider, Pagination, type PaginationProps, Panel, type PanelProps, PanelTone, type Particle, PathChips, type PathChipsProps, PersonChip, type PersonChipProps, type PlacedCard, PluginTextsProvider, type Pose, Presence, PresenceItem, type PresenceItemProps, PresenceList, type PresenceListProps, type PresenceProps, Pressable, type PressableProps, PriorityMark, type PriorityMarkProps, type PropertyItem, PropertyList, type PropertyListProps, type QueryConditionJson, type QueryExportFormat, type QueryField, type QueryGroup, type QueryJson, type QueryListLabels, type QueryNodeJson, type QueryRow, type QuerySuggestion, type QuerySuggestions, type QueryValueEditor, QueryableList, type QueryableListError, type QueryableListExport, type QueryableListProps, type QueryableListState, type QueryableListView, type QueueProgress, RecordKey, type RecordKeyProps, type RegisterSlotSave, Reveal, RevealItem, type RevealItemProps, type RevealProps, SHOWN, STEP_UP_REQUIRED, type Scale, SearchInput, type SearchInputProps, type SectionMove, SegmentedControl, type SegmentedControlProps, type SegmentedItem, SelectField, type SelectFieldProps, type SelectOption, type SettingsArea, SettingsLayout, type SettingsLayoutProps, type SettingsPage, type SettingsSection, SlideItem, type SlideItemProps, SlideList, type SlideListProps, type SlotSave, type SortDirection, type SortableSection, SortableSections, type SortableSectionsProps, type StatusCategory, StatusPill, type StatusPillProps, type StatusTone, StepUpDialog, type StepUpHandler, Swap, type SwapProps, SwitchField, type SwitchFieldProps, TITLE_SEPARATOR, TextBone, type TextBoneProps, TextSlot, type TextSlotProps, type TimelineCardItem, TimelineCards, type TimelineCardsProps, TimelineChart, type TimelineChartProps, type TimelineItem, type TimelineRow, type TimelineScale, type TitleParts, Toaster, Tooltip, type TooltipProps, UPLOADS_AT_ONCE, type UploadJob, UploadList, type UploadListProps, type UploadRow, type UploadState, abpConfig, arriveCss, asMotionSetting, avatarPalette, basicConditions, boneWidth, burst, compactLayout, compareOrdinal, composeTitle, covers, createAbpSystem, createAreaTexts, createHostEvents, createHostRequest, curves, defaultBrand, defaultLabels, defaultQueryListLabels, directionOf, droppedFiles, errorText, fileNameOf, findSettingsPage, folderOf, foldersFor, formatDateTime, formatMessage, formatNumber, ghostCss, groupKey, heavierFirst, hiddenPose, inSections, isStepUp, looksLikeCode, durations as motionDurations, notify, pageList, partsOf, pastedName, placeCards, placeItem, priorityLevel, progressOf, readAbpError, readEvents, refusal, requestStepUp, setStepUpHandler, settingsArea, shineCss, springs, staggerDelay, targetOf, toStart, toaster, useAbpLabels, useAbpLocale, useAbpTimeZone, useApiAction, useApiDownload, useApiQuery, useAreaEvents, useAreaRequest, useArriving, useCan, useCelebrate, useColorMode, useConfirm, useDropZone, useFilesOverPage, useFormatters, useHost, useHostLanguages, useLinkComponent, useLoading, useMe, useMotionSetting, useNames, useNavigate, useOptionalHost, usePageDrop, usePageTitle, usePageTitleParts, usePageTitleSite, usePastedFiles, usePluginTexts, useProductName, useSlotSaves, useTokenVar };
3089
+ export { ABP_UI_VERSION, AbpApiError, type AbpBrand, type AbpHost, type AbpLabels, type AbpLabelsInput, type AbpListOptions, AbpProvider, type AbpProviderProps, type AbpSystemOptions, type ApiQuery, AppLink, type AppLinkProps, AppShell, type AppShellBrand, type AppShellNavItem, type AppShellNavSection, type AppShellPlace, type AppShellProps, type AppShellSidebar, type AreaTexts, type Arrival, ArriveOnChange, type ArriveOnChangeProps, AttentionChip, type AttentionChipProps, type AvatarPerson, AvatarStack, type AvatarStackProps, Bone, type BoneProps, type BreadcrumbItem, Breadcrumbs, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarGrid, type CalendarGridProps, type CalendarItem, type CardDates, CategoryProgress, type CategoryProgressProps, type CelebrateTarget, Chart, type ChartProps, type ChartSeries, CheckboxField, type CheckboxFieldProps, Collapse, type CollapseProps, type ColorMode, ColorModeProvider, ColorModeToggle, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, ConfirmProvider, CountBadge, type CountBadgeProps, Counter, type CounterProps, DEFAULT_PAGE_SIZE, DashboardGrid, type DashboardGridProps, DataTable, type DataTableColumn, type DataTableProps, type DataTableSelection, type DataTableSort, type Direction, DirectionalIcon, DropHint, type DropHintProps, type DropZoneOptions, type DropZoneState, type DroppedFile, EMPTY_VALUE, EmotionRegistry, EmptyState, type EmptyStateProps, FadeIn, type FadeInProps, Field, type FieldProps, FileDropArea, type FileDropAreaProps, FormDialog, type FormDialogProps, FormField, type GridItem, GroupPicker, Highlight, HighlightText, type HostEventHandler, type HostEvents, type HostFile, type HostLanguage, HostProvider, type HostRequest, type HostRequestInit, type HostRequestOptions, type HostScope, HostSlot, IconButton, type IconButtonProps, IconTile, type IconTileProps, Indicator, type IndicatorProps, InlineAlert, type InlineAlertProps, KanbanBoard, type KanbanBoardProps, type KanbanColumn, type KanbanItem, type KanbanLane, type KanbanMove, type LinkComponent, ListFooter, type ListPage, type ListQuery, type ListSource, type ListState, Loading, type LoadingProps, LoadingState, MotionProvider, type MotionSetting, type MotionState, type NameSuggestion, type NamesValue, Nudge, type NudgeProps, PageHeader, type PageHeaderProps, PageTitleProvider, Pagination, type PaginationProps, Panel, type PanelProps, PanelTone, type Particle, PathChips, type PathChipsProps, PersonChip, type PersonChipProps, PersonPicker, type PickerGroup, type PickerLabels, type PickerPerson, type PlacedCard, PluginTextsProvider, type Pose, Presence, PresenceItem, type PresenceItemProps, PresenceList, type PresenceListProps, type PresenceProps, Pressable, type PressableProps, PriorityMark, type PriorityMarkProps, type PropertyItem, PropertyList, type PropertyListProps, type QueryConditionJson, type QueryExportFormat, type QueryField, type QueryGroup, type QueryJson, type QueryListLabels, type QueryNodeJson, type QueryRow, type QuerySuggestion, type QuerySuggestions, type QueryValueEditor, QueryableList, type QueryableListError, type QueryableListExport, type QueryableListProps, type QueryableListState, type QueryableListView, type QueueProgress, RecordKey, type RecordKeyProps, type RegisterSlotSave, Reveal, RevealItem, type RevealItemProps, type RevealProps, SHOWN, STEP_UP_REQUIRED, STRONG_FACTOR_REQUIRED, type Scale, SearchInput, type SearchInputProps, SearchPicker, type SearchPickerMessages, type SearchPickerProps, type SectionMove, SegmentedControl, type SegmentedControlProps, type SegmentedItem, SelectField, type SelectFieldProps, type SelectOption, type ServerInsertedHTML, type SettingsArea, SettingsLayout, type SettingsLayoutProps, type SettingsPage, type SettingsSection, SlideItem, type SlideItemProps, SlideList, type SlideListProps, type SlotSave, type SortDirection, type SortableSection, SortableSections, type SortableSectionsProps, type StatusCategory, StatusPill, type StatusPillProps, type StatusTone, StepUpDialog, type StepUpHandler, type StepUpNeed, Swap, type SwapProps, SwitchField, type SwitchFieldProps, TITLE_SEPARATOR, TextBone, type TextBoneProps, TextSlot, type TextSlotProps, type TimelineCardItem, TimelineCards, type TimelineCardsProps, TimelineChart, type TimelineChartProps, type TimelineItem, type TimelineRow, type TimelineScale, type TitleParts, Toaster, Tooltip, type TooltipProps, TranslatedInput, type TranslatedInputProps, type TranslationsLabels, UPLOADS_AT_ONCE, type UploadJob, UploadList, type UploadListProps, type UploadRow, type UploadState, abpConfig, abpListParams, abpListSource, arriveCss, asMotionSetting, avatarPalette, basicConditions, boneWidth, burst, compactLayout, compareOrdinal, composeTitle, covers, createAbpSystem, createAreaTexts, createHostEvents, createHostRequest, createPasskey, curves, defaultBrand, defaultLabels, defaultPickerLabels, defaultQueryListLabels, defaultTranslationsLabels, directionOf, droppedFiles, emptyQuery, errorText, fileNameOf, findSettingsPage, folderOf, foldersFor, formatDateTime, formatMessage, formatNumber, getPasskey, ghostCss, groupKey, heavierFirst, hiddenPose, inSections, isStepUp, looksLikeCode, durations as motionDurations, needsStepUp, notify, pageCount, pageList, partsOf, passkeysSupported, pastedName, personLabel, placeCards, placeItem, priorityLevel, progressOf, readAbpError, readEvents, refusal, requestStepUp, setStepUpHandler, settingsArea, shineCss, springs, staggerDelay, stepUpNeedOf, targetOf, toStart, toaster, useAbpLabels, useAbpLocale, useAbpTimeZone, useApiAction, useApiDownload, useApiQuery, useAreaEvents, useAreaListSource, useAreaRequest, useArriving, useCan, useCelebrate, useColorMode, useConfirm, useDropZone, useFilesOverPage, useFormatters, useHost, useHostLanguages, useLinkComponent, useListState, useLoading, useMe, useMotionSetting, useNames, useNavigate, useOptionalHost, usePageDrop, usePageTitle, usePageTitleParts, usePageTitleSite, usePastedFiles, usePluginTexts, useProductName, useSettledValue, useSlotSaves, useTokenVar };