@jinaan/uikit 0.1.51 → 0.1.53
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/combobox.d.ts +50 -0
- package/dist/combobox.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +997 -867
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/combobox.tsx +252 -0
- package/src/index.ts +1 -0
- package/styles.css +2 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface ComboboxItem {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
/** Secondary line under the label (e.g. an email address). */
|
|
6
|
+
description?: string;
|
|
7
|
+
/** Small pill rendered after the label (e.g. "Default"). */
|
|
8
|
+
badge?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ComboboxProps {
|
|
11
|
+
items: ComboboxItem[];
|
|
12
|
+
/** Selected item value; null shows the placeholder. */
|
|
13
|
+
value: string | null;
|
|
14
|
+
onValueChange: (item: ComboboxItem) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Debounced + trimmed search term (fires after `debounceMs` once the term
|
|
17
|
+
* reaches `minSearchLength`). Omit to filter `items` client-side instead.
|
|
18
|
+
*/
|
|
19
|
+
onSearchChange?: (term: string) => void;
|
|
20
|
+
/** True while an async search is running; shows a centered spinner. */
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
/** Minimum search term length before searching/filtering. Default 3. */
|
|
23
|
+
minSearchLength?: number;
|
|
24
|
+
/** Debounce window for the search term, in ms. Default 300. */
|
|
25
|
+
debounceMs?: number;
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
searchPlaceholder?: string;
|
|
28
|
+
/** Shown when a completed search yields no rows. Default "No results found". */
|
|
29
|
+
emptyMessage?: string;
|
|
30
|
+
/** Hint below `minSearchLength`; defaults to "Type at least N characters to search". */
|
|
31
|
+
hintMessage?: string;
|
|
32
|
+
/** Custom row content; falls back to label + description + badge. */
|
|
33
|
+
renderItem?: (item: ComboboxItem) => ReactNode;
|
|
34
|
+
/** Custom selected-value content; falls back to the item label. */
|
|
35
|
+
renderValue?: (item: ComboboxItem) => ReactNode;
|
|
36
|
+
className?: string;
|
|
37
|
+
contentClassName?: string;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Searchable select (Clerk "Select…" parity): an inline secondary trigger that
|
|
42
|
+
* opens the standard dropdown surface with a search field and item rows.
|
|
43
|
+
* Searching debounces internally; render `items` either pre-filtered by the
|
|
44
|
+
* parent (async search through `onSearchChange` + `loading`) or let the
|
|
45
|
+
* component filter locally when `onSearchChange` is omitted. The content
|
|
46
|
+
* portals and anchors to the trigger with collision flip, so it overlays —
|
|
47
|
+
* it never grows the surrounding layout, and it nests safely inside dialogs.
|
|
48
|
+
*/
|
|
49
|
+
export declare function Combobox({ items, value, onValueChange, onSearchChange, loading, minSearchLength, debounceMs, placeholder, searchPlaceholder, emptyMessage, hintMessage, renderItem, renderValue, className, contentClassName, disabled, }: ComboboxProps): import("react").JSX.Element;
|
|
50
|
+
//# sourceMappingURL=combobox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../src/combobox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMrE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,uDAAuD;IACvD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,aAAa,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC5C;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,SAAS,CAAC;IAC/C,mEAAmE;IACnE,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,SAAS,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,KAAK,EACL,aAAa,EACb,cAAc,EACd,OAAe,EACf,eAAmB,EACnB,UAAgB,EAChB,WAAyB,EACzB,iBAA4B,EAC5B,YAAiC,EACjC,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,QAAgB,GACjB,EAAE,aAAa,+BAiLf"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,S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