@paubox/ui 1.15.0 → 1.16.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/index.esm.js +1649 -1104
- package/package.json +1 -1
- package/src/lib/Inputs/AutoComplete.d.ts +41 -0
- package/src/lib/Inputs/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
export interface AutoCompleteOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AutoCompleteProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'type'> {
|
|
7
|
+
options: AutoCompleteOption[];
|
|
8
|
+
values: string[];
|
|
9
|
+
setValues: (values: string[]) => void;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
sz?: 'sm' | 'lg';
|
|
12
|
+
error?: boolean;
|
|
13
|
+
type?: 'primary' | 'secondary';
|
|
14
|
+
/** Max number of filtered options shown in the dropdown. */
|
|
15
|
+
maxMenuItems?: number;
|
|
16
|
+
/** Called with the current input text — use for async/server-side filtering. */
|
|
17
|
+
onInputChange?: (text: string) => void;
|
|
18
|
+
/** Optional no-results text shown when no options match the input. */
|
|
19
|
+
noResultsText?: string;
|
|
20
|
+
/** Allow adding values by typing and pressing comma (or pasting comma-separated text). */
|
|
21
|
+
allowFreeform?: boolean;
|
|
22
|
+
/** Icon rendered on the right side of the input (e.g. a loading spinner). */
|
|
23
|
+
rightIcon?: React.ElementType;
|
|
24
|
+
/** Accessible label for the input (screen readers). */
|
|
25
|
+
ariaLabel?: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* AutoComplete: single-line input that filters a closed list of options as
|
|
30
|
+
* the user types. Selected items render as removable chips. Multi-select.
|
|
31
|
+
*
|
|
32
|
+
* Keyboard:
|
|
33
|
+
* - ArrowDown / ArrowUp — move active option (opens list if closed).
|
|
34
|
+
* - Home / End — jump to first / last option.
|
|
35
|
+
* - Enter — select active option.
|
|
36
|
+
* - Escape — close list.
|
|
37
|
+
* - Backspace (empty) — remove the last selected chip.
|
|
38
|
+
*
|
|
39
|
+
* Implements the WAI-ARIA 1.2 combobox pattern with aria-activedescendant.
|
|
40
|
+
*/
|
|
41
|
+
export declare const AutoComplete: ({ options, values, setValues, placeholder, sz, error, type, maxMenuItems, onInputChange, noResultsText, allowFreeform, rightIcon: RightIcon, ariaLabel, className, disabled, ...inputProps }: AutoCompleteProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|