@talogic/react 0.6.4 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2 -2
- package/app/app-shell.component.d.ts +31 -2
- package/app/index.d.ts +2 -2
- package/index.js +1588 -1059
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/talogic-react.css +1 -1
- package/tokens.css +21 -0
- package/ui/combobox/combobox-option.contract.d.ts +18 -0
- package/ui/combobox/combobox.component.d.ts +78 -0
- package/ui/combobox/index.d.ts +5 -0
- package/ui/combobox/option-search.hook.d.ts +25 -0
- package/ui/field/field-control.hook.d.ts +9 -0
- package/ui/field/index.d.ts +1 -1
- package/ui/file-drop/file-accept.policy.d.ts +25 -0
- package/ui/file-drop/file-drop-overlay.component.d.ts +31 -0
- package/ui/file-drop/index.d.ts +5 -0
- package/ui/file-drop/page-drop.hook.d.ts +29 -0
- package/ui/index.d.ts +3 -0
- package/ui/menu/index.d.ts +1 -0
- package/ui/navigation/index.d.ts +1 -1
- package/ui/navigation/tabs.component.d.ts +33 -14
- package/ui/overlay/index.d.ts +1 -0
- package/ui/overlay/portal.component.d.ts +11 -0
- package/ui/tags-input/index.d.ts +7 -0
- package/ui/tags-input/tag-entry.algorithm.d.ts +34 -0
- package/ui/tags-input/tag.component.d.ts +18 -0
- package/ui/tags-input/tags-field.recipe.d.ts +7 -0
- package/ui/tags-input/tags-input.component.d.ts +30 -0
|
@@ -7,6 +7,8 @@ export interface FieldControlState {
|
|
|
7
7
|
describedBy: string;
|
|
8
8
|
/** True when the field shows an error. */
|
|
9
9
|
invalid: boolean;
|
|
10
|
+
/** The id of the field's label, for a control that cannot take the label's `for` link. */
|
|
11
|
+
labelId?: string;
|
|
10
12
|
}
|
|
11
13
|
/** The context a {@link Field} provides. Null outside a field. */
|
|
12
14
|
export declare const FieldControlContext: import("react").Context<FieldControlState | null>;
|
|
@@ -24,3 +26,10 @@ export interface FieldControlProps {
|
|
|
24
26
|
* @returns The props to spread on the control element.
|
|
25
27
|
*/
|
|
26
28
|
export declare function useFieldControl(own?: FieldControlProps): FieldControlProps;
|
|
29
|
+
/**
|
|
30
|
+
* The id of the label of the {@link Field} around a control. A control whose library writes its own `id`, such as
|
|
31
|
+
* the cmdk input of a combobox, points `aria-labelledby` at it instead of relying on the label's `for` link.
|
|
32
|
+
*
|
|
33
|
+
* @returns The label id, or undefined outside a field.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useFieldLabelId(): string | undefined;
|
package/ui/field/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { controlClassName } from './control.recipe';
|
|
2
2
|
export { Field } from './field.component';
|
|
3
3
|
export type { FieldProps } from './field.component';
|
|
4
|
-
export { useFieldControl } from './field-control.hook';
|
|
4
|
+
export { useFieldControl, useFieldLabelId } from './field-control.hook';
|
|
5
5
|
export type { FieldControlProps } from './field-control.hook';
|
|
6
6
|
export { Input } from './input.component';
|
|
7
7
|
export type { InputProps } from './input.component';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a file matches an `accept` list, in the format of the `accept` attribute of `<input type="file">`:
|
|
3
|
+
* comma-separated extensions (`.pdf`), MIME types (`application/pdf`) and wildcards (`image/*`). An empty or
|
|
4
|
+
* missing list accepts every file. Case is ignored.
|
|
5
|
+
*
|
|
6
|
+
* @param file - The name and MIME type of the file. A name is missing while a drag is still over the page.
|
|
7
|
+
* @param file.name - The file name, with its extension.
|
|
8
|
+
* @param file.type - The MIME type, empty when the browser does not know it.
|
|
9
|
+
* @param accept - The accept list.
|
|
10
|
+
* @returns True when the file matches one entry of the list.
|
|
11
|
+
*/
|
|
12
|
+
export declare function acceptsFile(file: {
|
|
13
|
+
name?: string;
|
|
14
|
+
type: string;
|
|
15
|
+
}, accept?: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether a drag that is still over the page can hold an accepted file. During a drag the browser shows only MIME
|
|
18
|
+
* types, never names, so a list of extensions alone, or a file of unknown type, cannot be judged yet: the answer is
|
|
19
|
+
* then true, and the drop filters the files.
|
|
20
|
+
*
|
|
21
|
+
* @param types - The MIME types of the dragged items. Empty strings stand for unknown types.
|
|
22
|
+
* @param accept - The accept list (see {@link acceptsFile}).
|
|
23
|
+
* @returns False only when every dragged item has a known type that the list refuses.
|
|
24
|
+
*/
|
|
25
|
+
export declare function mayAcceptDrag(types: readonly string[], accept?: string): boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** Props of {@link FileDropOverlay}. */
|
|
3
|
+
export interface FileDropOverlayProps {
|
|
4
|
+
/** True while files are over the window: `isOver` from {@link usePageDrop}. */
|
|
5
|
+
open: boolean;
|
|
6
|
+
/** False when the files fail the accept list: `isAccepted` from {@link usePageDrop}. Default true. */
|
|
7
|
+
accepted?: boolean;
|
|
8
|
+
/** What to do, such as "Drop the quote to upload it". */
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
/** A second line, such as the accepted formats and the size limit. */
|
|
11
|
+
description?: ReactNode;
|
|
12
|
+
/** The title when the files fail the accept list. Default "These files cannot be uploaded here". */
|
|
13
|
+
rejectedTitle?: ReactNode;
|
|
14
|
+
/** An icon in place of the upload arrow. */
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
/** Classes for the full-screen layer. */
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The full-screen layer while files are held over the page: the page blurs under a brand tint, a dashed frame
|
|
21
|
+
* shows the drop area, and the message grows in with a pulse around its icon. It turns destructive when the files
|
|
22
|
+
* fail the accept list.
|
|
23
|
+
*
|
|
24
|
+
* It renders in a {@link Portal}, above every other layer, and stays mounted so it can fade in and out. It takes no
|
|
25
|
+
* pointer events, so the drop reaches the window listener of {@link usePageDrop} under it. A polite live region
|
|
26
|
+
* reads the message once when it opens. Reduced motion keeps only the fade.
|
|
27
|
+
*
|
|
28
|
+
* @param props - The open and accepted state, and the message.
|
|
29
|
+
* @returns The overlay.
|
|
30
|
+
*/
|
|
31
|
+
export declare function FileDropOverlay({ open, accepted, title, description, rejectedTitle, icon, className }: FileDropOverlayProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { acceptsFile, mayAcceptDrag } from './file-accept.policy';
|
|
2
|
+
export { FileDropOverlay } from './file-drop-overlay.component';
|
|
3
|
+
export type { FileDropOverlayProps } from './file-drop-overlay.component';
|
|
4
|
+
export { usePageDrop } from './page-drop.hook';
|
|
5
|
+
export type { PageDropOptions, PageDropState } from './page-drop.hook';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Options of {@link usePageDrop}. */
|
|
2
|
+
export interface PageDropOptions {
|
|
3
|
+
/** Given the dropped files: those the `accept` list takes, then those it refuses. */
|
|
4
|
+
onDrop: (accepted: File[], rejected: File[]) => void;
|
|
5
|
+
/** The files to take, in the format of the `accept` attribute of a file input. Default: every file. */
|
|
6
|
+
accept?: string;
|
|
7
|
+
/** Ignores every drag, for example while an upload runs. */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** What {@link usePageDrop} reports while a drag is over the window. */
|
|
11
|
+
export interface PageDropState {
|
|
12
|
+
/** True while a drag that carries files is over the window. */
|
|
13
|
+
isOver: boolean;
|
|
14
|
+
/** False when the dragged files certainly fail the `accept` list. True while the browser cannot tell yet. */
|
|
15
|
+
isAccepted: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Makes the whole window a drop target for files, so someone who arrives with a file in hand does not have to aim
|
|
19
|
+
* at a box. Pair it with {@link FileDropOverlay}.
|
|
20
|
+
*
|
|
21
|
+
* Only a drag that carries files counts: dragging selected text is not an upload. Entries are counted rather than
|
|
22
|
+
* trusted one by one, because a drag that moves onto a child fires `dragleave` on the parent it left. A drop zone
|
|
23
|
+
* that takes a drop for itself stops it before the window sees it, so a capture listener ends the drag state in
|
|
24
|
+
* every case.
|
|
25
|
+
*
|
|
26
|
+
* @param options - `onDrop`, `accept` and `disabled`.
|
|
27
|
+
* @returns Whether files are over the window, and whether they look acceptable.
|
|
28
|
+
*/
|
|
29
|
+
export declare function usePageDrop(options: PageDropOptions): PageDropState;
|
package/ui/index.d.ts
CHANGED
|
@@ -2,10 +2,13 @@ export * from './avatar';
|
|
|
2
2
|
export * from './badge';
|
|
3
3
|
export * from './button';
|
|
4
4
|
export * from './choice';
|
|
5
|
+
export * from './combobox';
|
|
5
6
|
export * from './feedback';
|
|
6
7
|
export * from './field';
|
|
8
|
+
export * from './file-drop';
|
|
7
9
|
export * from './layout';
|
|
8
10
|
export * from './menu';
|
|
9
11
|
export * from './navigation';
|
|
10
12
|
export * from './overlay';
|
|
11
13
|
export * from './sidebar';
|
|
14
|
+
export * from './tags-input';
|
package/ui/menu/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator,
|
|
|
4
4
|
export type { ContextMenuItemProps } from './context-menu.component';
|
|
5
5
|
export { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, } from './dropdown-menu.component';
|
|
6
6
|
export type { DropdownMenuItemProps } from './dropdown-menu.component';
|
|
7
|
+
export { menuItemClassName, menuSeparatorClassName, menuShortcutClassName } from './menu.recipe';
|
package/ui/navigation/index.d.ts
CHANGED
|
@@ -6,6 +6,6 @@ export { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMe
|
|
|
6
6
|
export { Pagination } from './pagination.component';
|
|
7
7
|
export type { PaginationProps } from './pagination.component';
|
|
8
8
|
export { Tabs, TabsContent, TabsList, TabsTrigger } from './tabs.component';
|
|
9
|
-
export type { TabsListProps } from './tabs.component';
|
|
9
|
+
export type { TabsListProps, TabsTriggerProps, TabsVariant } from './tabs.component';
|
|
10
10
|
export { Stepper } from './stepper.component';
|
|
11
11
|
export type { StepperProps, StepperStep } from './stepper.component';
|
|
@@ -1,37 +1,56 @@
|
|
|
1
1
|
import { Tabs as TabsPrimitive } from 'radix-ui';
|
|
2
|
-
import type
|
|
2
|
+
import { type ComponentProps } from 'react';
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
4
|
+
* The Tabs root. When the active tab changes, it records on `data-direction` which way the indicator moved, so the
|
|
5
|
+
* new panel slides in from that side: from the right for a tab further on, from the left for an earlier one, and
|
|
6
|
+
* from below or above in a vertical list. The first panel does not move, and reduced motion keeps panels still.
|
|
5
7
|
*
|
|
6
|
-
* @param props - Radix Tabs root props.
|
|
8
|
+
* @param props - Radix Tabs root props. `orientation="vertical"` puts the list beside the panels.
|
|
7
9
|
* @returns The tabs.
|
|
8
10
|
*/
|
|
9
|
-
export declare function Tabs({ className, ...props }: ComponentProps<typeof TabsPrimitive.Root>): import("react").JSX.Element;
|
|
11
|
+
export declare function Tabs({ className, value, defaultValue, onValueChange, orientation, ...props }: ComponentProps<typeof TabsPrimitive.Root>): import("react").JSX.Element;
|
|
12
|
+
/** The look of a {@link TabsList}. */
|
|
13
|
+
export type TabsVariant = 'pill' | 'underline' | 'outline';
|
|
10
14
|
/** Props of {@link TabsList}. */
|
|
11
15
|
export interface TabsListProps extends ComponentProps<typeof TabsPrimitive.List> {
|
|
12
16
|
/**
|
|
13
17
|
* `pill` switches views inside a panel. `underline` switches pages in a header, with a brand line under the
|
|
14
|
-
* active tab.
|
|
18
|
+
* active tab. `outline` opens documents or records: the active tab is a raised card with a brand cap that joins
|
|
19
|
+
* the panel below it.
|
|
15
20
|
*/
|
|
16
|
-
variant?:
|
|
21
|
+
variant?: TabsVariant;
|
|
22
|
+
/** Stretches the list to its container and shares the width equally between the tabs. */
|
|
23
|
+
fitted?: boolean;
|
|
17
24
|
}
|
|
18
25
|
/**
|
|
19
|
-
* The row of {@link TabsTrigger}s. One indicator slides to the active tab
|
|
20
|
-
* background of
|
|
26
|
+
* The row of {@link TabsTrigger}s, or the column in a vertical {@link Tabs}. One indicator slides to the active tab
|
|
27
|
+
* and takes its size: the raised background of `pill`, the brand line of `underline`, or the card of `outline`.
|
|
21
28
|
*
|
|
22
|
-
* @param props - `variant` and Radix Tabs list props.
|
|
29
|
+
* @param props - `variant`, `fitted` and Radix Tabs list props.
|
|
23
30
|
* @returns The tab list.
|
|
24
31
|
*/
|
|
25
|
-
export declare function TabsList({ className, variant, children, ...props }: TabsListProps): import("react").JSX.Element;
|
|
32
|
+
export declare function TabsList({ className, variant, fitted, children, ...props }: TabsListProps): import("react").JSX.Element;
|
|
33
|
+
/** Props of {@link TabsTrigger}. */
|
|
34
|
+
export interface TabsTriggerProps extends ComponentProps<typeof TabsPrimitive.Trigger> {
|
|
35
|
+
/** A count beside the label, such as unread items. It turns brand on the active tab. */
|
|
36
|
+
count?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Makes the tab closable: a small cross shows on it, and the Delete key closes the focused tab. Move the
|
|
39
|
+
* selection to another tab before you remove the active one.
|
|
40
|
+
*/
|
|
41
|
+
onClose?: () => void;
|
|
42
|
+
/** The name of the close action for assistive technology. Default `Close tab`. */
|
|
43
|
+
closeLabel?: string;
|
|
44
|
+
}
|
|
26
45
|
/**
|
|
27
|
-
* One tab. It reads the list's variant, so it has
|
|
46
|
+
* One tab. It reads the list's variant and orientation, so it has neither of its own.
|
|
28
47
|
*
|
|
29
|
-
* @param props - Radix Tabs trigger props.
|
|
48
|
+
* @param props - `count`, `onClose`, `closeLabel` and Radix Tabs trigger props.
|
|
30
49
|
* @returns The tab.
|
|
31
50
|
*/
|
|
32
|
-
export declare function TabsTrigger({ className, ...props }:
|
|
51
|
+
export declare function TabsTrigger({ className, count, onClose, closeLabel, onKeyDown, children, value, ...props }: TabsTriggerProps): import("react").JSX.Element;
|
|
33
52
|
/**
|
|
34
|
-
* The panel of one tab.
|
|
53
|
+
* The panel of one tab. After a change it slides in from the side the indicator came from (see {@link Tabs}).
|
|
35
54
|
*
|
|
36
55
|
* @param props - Radix Tabs content props.
|
|
37
56
|
* @returns The panel.
|
package/ui/overlay/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent,
|
|
|
2
2
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from './dialog.component';
|
|
3
3
|
export type { DialogContentProps } from './dialog.component';
|
|
4
4
|
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerTitle, DrawerTrigger } from './drawer.component';
|
|
5
|
+
export { Portal } from './portal.component';
|
|
5
6
|
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from './popover.component';
|
|
6
7
|
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetTitle, SheetTrigger } from './sheet.component';
|
|
7
8
|
export type { SheetContentProps } from './sheet.component';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Portal as PortalPrimitive } from 'radix-ui';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Renders its children at the end of `document.body`, or in `container`, outside the parent's DOM. Use it for
|
|
5
|
+
* layers that must sit above every other part of the page, such as {@link FileDropOverlay}, so a parent's
|
|
6
|
+
* `overflow`, `transform` or stacking context cannot clip or cover them. React context still flows through it.
|
|
7
|
+
*
|
|
8
|
+
* @param props - `container` (default `document.body`), `asChild` and the content.
|
|
9
|
+
* @returns The content in the portal, or nothing before the first client render.
|
|
10
|
+
*/
|
|
11
|
+
export declare function Portal(props: ComponentProps<typeof PortalPrimitive.Root>): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { addTags, splitTags, TAG_DELIMITERS } from './tag-entry.algorithm';
|
|
2
|
+
export type { TagAddition, TagRules } from './tag-entry.algorithm';
|
|
3
|
+
export { Tag } from './tag.component';
|
|
4
|
+
export type { TagProps } from './tag.component';
|
|
5
|
+
export { tagsFieldClassName, tagsFieldInputClassName } from './tags-field.recipe';
|
|
6
|
+
export { TagsInput } from './tags-input.component';
|
|
7
|
+
export type { TagsInputProps } from './tags-input.component';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** The characters that end one tag and start the next, in typed or pasted text. */
|
|
2
|
+
export declare const TAG_DELIMITERS: RegExp;
|
|
3
|
+
/**
|
|
4
|
+
* Splits typed or pasted text into tags: on commas, semicolons, new lines and tabs, trimmed, without empty parts.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text.
|
|
7
|
+
* @returns The tags in the text, in order.
|
|
8
|
+
*/
|
|
9
|
+
export declare function splitTags(text: string): string[];
|
|
10
|
+
/** The rules of {@link addTags}. */
|
|
11
|
+
export interface TagRules {
|
|
12
|
+
/** The most tags the list can hold. */
|
|
13
|
+
max?: number;
|
|
14
|
+
/** Accepts or refuses one tag, for example a check of an e-mail address. */
|
|
15
|
+
validate?: (tag: string) => boolean;
|
|
16
|
+
/** Keeps a tag that is already in the list. Default false: the same text, ignoring case, is skipped. */
|
|
17
|
+
allowDuplicates?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** The result of {@link addTags}. */
|
|
20
|
+
export interface TagAddition {
|
|
21
|
+
/** The new list. */
|
|
22
|
+
tags: string[];
|
|
23
|
+
/** The candidates that `validate` refused, or that did not fit under `max`. */
|
|
24
|
+
rejected: string[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Adds candidates to a tag list under the rules. A duplicate is skipped, not rejected: it is already there.
|
|
28
|
+
*
|
|
29
|
+
* @param current - The tags in the list now.
|
|
30
|
+
* @param candidates - The tags to add, in order.
|
|
31
|
+
* @param rules - `max`, `validate` and `allowDuplicates`.
|
|
32
|
+
* @returns The new list and the refused candidates.
|
|
33
|
+
*/
|
|
34
|
+
export declare function addTags(current: readonly string[], candidates: readonly string[], rules?: TagRules): TagAddition;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
/** Props of {@link Tag}. */
|
|
3
|
+
export interface TagProps extends ComponentProps<'span'> {
|
|
4
|
+
/** Shows a cross that calls this. Without it the tag cannot be removed. */
|
|
5
|
+
onRemove?: () => void;
|
|
6
|
+
/** The accessible name of the cross, such as "Remove ana@pargic.com". Default "Remove". */
|
|
7
|
+
removeLabel?: string;
|
|
8
|
+
/** Marks the tag that the next Backspace removes. */
|
|
9
|
+
highlighted?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* One value in a {@link TagsInput} or a multiple {@link Combobox}: a brand-tinted chip that grows in when added,
|
|
13
|
+
* with a cross to remove it.
|
|
14
|
+
*
|
|
15
|
+
* @param props - `onRemove`, `removeLabel`, `highlighted` and any `span` props.
|
|
16
|
+
* @returns The tag.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Tag({ className, children, onRemove, removeLabel, highlighted, ...props }: TagProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The field that holds tags and a text input: the look of a text control, a height that grows as tags wrap, and
|
|
3
|
+
* the focus ring on the whole field while its input has focus.
|
|
4
|
+
*/
|
|
5
|
+
export declare const tagsFieldClassName: string;
|
|
6
|
+
/** The text input inside {@link tagsFieldClassName}: no frame of its own, and it takes the rest of the line. */
|
|
7
|
+
export declare const tagsFieldInputClassName = "h-6 min-w-16 flex-1 bg-transparent px-1 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
import { type TagRules } from './tag-entry.algorithm';
|
|
3
|
+
/** Props of {@link TagsInput}. */
|
|
4
|
+
export interface TagsInputProps extends TagRules, Omit<ComponentProps<'input'>, 'value' | 'defaultValue' | 'onChange' | 'type' | 'max'> {
|
|
5
|
+
/** The tags, when the parent owns them. */
|
|
6
|
+
value?: string[];
|
|
7
|
+
/** The first tags, when the input owns them. */
|
|
8
|
+
defaultValue?: string[];
|
|
9
|
+
/** Called with the new list after a tag is added or removed. */
|
|
10
|
+
onValueChange?: (tags: string[]) => void;
|
|
11
|
+
/** Called with the text that `validate` or `max` refused. The text stays in the input, marked invalid. */
|
|
12
|
+
onReject?: (rejected: string[]) => void;
|
|
13
|
+
/** Adds the typed text when the input loses focus. Default true. */
|
|
14
|
+
addOnBlur?: boolean;
|
|
15
|
+
/** The accessible name of a tag's cross. Default `Remove <tag>`. */
|
|
16
|
+
removeLabel?: (tag: string) => string;
|
|
17
|
+
/** Classes for the field around the tags. */
|
|
18
|
+
fieldClassName?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A text input that turns entries into tags, for labels, keywords or e-mail recipients.
|
|
22
|
+
*
|
|
23
|
+
* Enter, a comma or a semicolon adds the typed text. A paste with several entries adds them all. Backspace in an
|
|
24
|
+
* empty input highlights the last tag, and a second Backspace removes it. Each tag also has a cross. Inside a
|
|
25
|
+
* {@link Field} it takes the field's label, hint and error.
|
|
26
|
+
*
|
|
27
|
+
* @param props - The tags, the rules (`max`, `validate`, `allowDuplicates`) and any `input` props.
|
|
28
|
+
* @returns The tags input.
|
|
29
|
+
*/
|
|
30
|
+
export declare function TagsInput({ value, defaultValue, onValueChange, onReject, max, validate, allowDuplicates, addOnBlur, removeLabel, fieldClassName, className, disabled, placeholder, onKeyDown, onPaste, onBlur, ...props }: TagsInputProps): import("react").JSX.Element;
|