@bazza-ui/react 0.1.0-canary.16 → 0.1.0-canary.17
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/index.cjs +1 -1
- package/dist/combobox/index.cjs.map +1 -1
- package/dist/combobox/index.d.ts +842 -834
- package/dist/combobox/index.js +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/command-menu/index.cjs +1 -1
- package/dist/command-menu/index.cjs.map +1 -1
- package/dist/command-menu/index.d.ts +123 -96
- package/dist/command-menu/index.js +1 -1
- package/dist/command-menu/index.js.map +1 -1
- package/dist/context-menu/index.cjs +1 -1
- package/dist/context-menu/index.cjs.map +1 -1
- package/dist/context-menu/index.d.ts +701 -658
- package/dist/context-menu/index.js +1 -1
- package/dist/context-menu/index.js.map +1 -1
- package/dist/dropdown-menu/index.cjs +1 -1
- package/dist/dropdown-menu/index.cjs.map +1 -1
- package/dist/dropdown-menu/index.d.ts +723 -680
- package/dist/dropdown-menu/index.js +1 -1
- package/dist/dropdown-menu/index.js.map +1 -1
- package/dist/events-DDOsDu4X.d.ts +2091 -0
- package/dist/index-Cabqj7qI.d.ts +2003 -0
- package/dist/index-D8OrKThQ.d.ts +977 -0
- package/dist/internal/listbox/index.cjs +1 -2
- package/dist/internal/listbox/index.d.ts +2 -272
- package/dist/internal/listbox/index.js +1 -2
- package/dist/internal/popup-menu/index.cjs +1 -2
- package/dist/internal/popup-menu/index.d.ts +4 -238
- package/dist/internal/popup-menu/index.js +1 -2
- package/dist/items-CD2hw6-3.js +2 -0
- package/dist/items-CD2hw6-3.js.map +1 -0
- package/dist/items-DYDljwnt.cjs +2 -0
- package/dist/items-DYDljwnt.cjs.map +1 -0
- package/dist/{items-B6HeFO_8.d.cts → items-ceX--VIv.d.ts} +21 -19
- package/dist/kbd/index.cjs +1 -1
- package/dist/kbd/index.cjs.map +1 -1
- package/dist/kbd/index.d.ts +35 -35
- package/dist/kbd/index.js +1 -1
- package/dist/kbd/index.js.map +1 -1
- package/dist/listbox-CnwUlLZA.js +2 -0
- package/dist/listbox-CnwUlLZA.js.map +1 -0
- package/dist/listbox-DYvJTiF6.cjs +2 -0
- package/dist/listbox-DYvJTiF6.cjs.map +1 -0
- package/dist/loaders/index.cjs +1 -1
- package/dist/loaders/index.cjs.map +1 -1
- package/dist/loaders/index.d.ts +218 -188
- package/dist/loaders/index.js +1 -1
- package/dist/loaders/index.js.map +1 -1
- package/dist/merge-element-props-0mpNO7ZH.cjs +2 -0
- package/dist/merge-element-props-0mpNO7ZH.cjs.map +1 -0
- package/dist/merge-element-props-PxUvRHax.js +2 -0
- package/dist/merge-element-props-PxUvRHax.js.map +1 -0
- package/dist/platform-C-sxBTRa.cjs +2 -0
- package/dist/platform-C-sxBTRa.cjs.map +1 -0
- package/dist/platform-C4_cGUkS.js +2 -0
- package/dist/platform-C4_cGUkS.js.map +1 -0
- package/dist/popup-menu-BBAzAXIe.cjs +2 -0
- package/dist/popup-menu-BBAzAXIe.cjs.map +1 -0
- package/dist/popup-menu-HmBMJEZc.js +2 -0
- package/dist/popup-menu-HmBMJEZc.js.map +1 -0
- package/dist/resolve-state-props-C-zbhdXd.cjs +2 -0
- package/dist/resolve-state-props-C-zbhdXd.cjs.map +1 -0
- package/dist/resolve-state-props-D31kizRZ.js +2 -0
- package/dist/resolve-state-props-D31kizRZ.js.map +1 -0
- package/dist/rolldown-runtime-5lHFv1cW.cjs +1 -0
- package/dist/rolldown-runtime-DK3Fl9T5.js +1 -0
- package/dist/select/index.cjs +1 -1
- package/dist/select/index.cjs.map +1 -1
- package/dist/select/index.d.ts +835 -828
- package/dist/select/index.js +1 -1
- package/dist/select/index.js.map +1 -1
- package/dist/suggestion-menu/index.cjs +4 -0
- package/dist/suggestion-menu/index.cjs.map +1 -0
- package/dist/suggestion-menu/index.d.ts +359 -0
- package/dist/suggestion-menu/index.js +4 -0
- package/dist/suggestion-menu/index.js.map +1 -0
- package/dist/types-BbN28E3_.d.ts +50 -0
- package/dist/video-player/index.cjs +2 -2
- package/dist/video-player/index.cjs.map +1 -1
- package/dist/video-player/index.d.ts +964 -1000
- package/dist/video-player/index.js +2 -2
- package/dist/video-player/index.js.map +1 -1
- package/package.json +14 -5
- package/dist/ListboxStore-B8oTpM57.d.cts +0 -453
- package/dist/ListboxStore-CV5vPUUc.d.ts +0 -453
- package/dist/chunk-3HMQLMSF.js +0 -2
- package/dist/chunk-3HMQLMSF.js.map +0 -1
- package/dist/chunk-4C666HHU.js +0 -2
- package/dist/chunk-4C666HHU.js.map +0 -1
- package/dist/chunk-5T5B5SPR.cjs +0 -2
- package/dist/chunk-5T5B5SPR.cjs.map +0 -1
- package/dist/chunk-A4Z5BY7H.js +0 -2
- package/dist/chunk-A4Z5BY7H.js.map +0 -1
- package/dist/chunk-IT372NHF.js +0 -2
- package/dist/chunk-IT372NHF.js.map +0 -1
- package/dist/chunk-JFEVUUPC.cjs +0 -2
- package/dist/chunk-JFEVUUPC.cjs.map +0 -1
- package/dist/chunk-KO3DXT3Y.js +0 -2
- package/dist/chunk-KO3DXT3Y.js.map +0 -1
- package/dist/chunk-LXXK4S4Q.js +0 -2
- package/dist/chunk-LXXK4S4Q.js.map +0 -1
- package/dist/chunk-M4G6J7DP.cjs +0 -2
- package/dist/chunk-M4G6J7DP.cjs.map +0 -1
- package/dist/chunk-MPPIEWSL.js +0 -2
- package/dist/chunk-MPPIEWSL.js.map +0 -1
- package/dist/chunk-PCNHYMD6.cjs +0 -2
- package/dist/chunk-PCNHYMD6.cjs.map +0 -1
- package/dist/chunk-RTG6U56O.cjs +0 -2
- package/dist/chunk-RTG6U56O.cjs.map +0 -1
- package/dist/chunk-SCDHQZFI.cjs +0 -2
- package/dist/chunk-SCDHQZFI.cjs.map +0 -1
- package/dist/chunk-XMZZ62VJ.cjs +0 -2
- package/dist/chunk-XMZZ62VJ.cjs.map +0 -1
- package/dist/combobox/index.d.cts +0 -1066
- package/dist/command-menu/index.d.cts +0 -154
- package/dist/command-score-CTJ9NV6n.d.cts +0 -23
- package/dist/command-score-CTJ9NV6n.d.ts +0 -23
- package/dist/context-menu/index.d.cts +0 -696
- package/dist/dropdown-menu/index.d.cts +0 -723
- package/dist/events-BTHQ2OoH.d.ts +0 -1860
- package/dist/events-DVcrtGe3.d.cts +0 -1860
- package/dist/input-C95v6jB0.d.cts +0 -46
- package/dist/input-CYweYB_i.d.ts +0 -46
- package/dist/internal/listbox/index.cjs.map +0 -1
- package/dist/internal/listbox/index.d.cts +0 -272
- package/dist/internal/listbox/index.js.map +0 -1
- package/dist/internal/popup-menu/index.cjs.map +0 -1
- package/dist/internal/popup-menu/index.d.cts +0 -238
- package/dist/internal/popup-menu/index.js.map +0 -1
- package/dist/items-B6HeFO_8.d.ts +0 -37
- package/dist/kbd/index.d.cts +0 -61
- package/dist/loaders/index.d.cts +0 -363
- package/dist/loading-C6WZGUc3.d.cts +0 -29
- package/dist/loading-CC4n55sR.d.ts +0 -29
- package/dist/resolve-B-j0eW24.d.cts +0 -406
- package/dist/resolve-B1F-a3P1.d.ts +0 -406
- package/dist/scroll-arrow-BBoKckL_.d.cts +0 -544
- package/dist/scroll-arrow-fl3B5sVO.d.ts +0 -544
- package/dist/select/index.d.cts +0 -1005
- package/dist/separator-Dn15rte3.d.ts +0 -275
- package/dist/separator-NjsBVzek.d.cts +0 -275
- package/dist/surface-context-CGLDpMej.d.ts +0 -14
- package/dist/surface-context-CN4Lb_6F.d.cts +0 -14
- package/dist/type-guards-BHHzjRvZ.d.cts +0 -351
- package/dist/type-guards-C0e_GpeY.d.ts +0 -351
- package/dist/types-DT4FOOa2.d.cts +0 -51
- package/dist/types-DT4FOOa2.d.ts +0 -51
- package/dist/use-listbox-item-NzZuY34-.d.cts +0 -212
- package/dist/use-listbox-item-NzZuY34-.d.ts +0 -212
- package/dist/video-player/index.d.cts +0 -1391
package/dist/select/index.d.ts
CHANGED
|
@@ -1,151 +1,144 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
readonly selected: "data-selected";
|
|
36
|
-
/** Present when this row is the first visible list-level row (not inside a group). */
|
|
37
|
-
readonly first: "data-first";
|
|
38
|
-
/** Present when this row is the last visible list-level row (not inside a group). */
|
|
39
|
-
readonly last: "data-last";
|
|
40
|
-
/** Present when this row is the first visible row within its group. */
|
|
41
|
-
readonly firstInGroup: "data-first-in-group";
|
|
42
|
-
/** Present when this row is the last visible row within its group. */
|
|
43
|
-
readonly lastInGroup: "data-last-in-group";
|
|
1
|
+
import { B as VirtualItem, F as ListboxContext, I as ListboxState, L as ListboxStore, M as FilterFn, P as ItemRegistration, b as useMaybeSurfaceContext, i as defaultFilter, r as commandScore, x as useSurfaceContext, y as SurfaceContextValue } from "../index-D8OrKThQ.js";
|
|
2
|
+
import { Dn as triggerPress, En as triggerHover, bn as pointer, dn as imperativeAction, gn as listNavigation, hn as keyboard, ln as escapeKey, mn as itemPress, on as ChangeEventDetails, sn as GenericEventDetails, un as focusOut, vn as none, xn as reason_parts_d_exports, yn as outsidePress } from "../events-DDOsDu4X.js";
|
|
3
|
+
import { n as ComponentRenderFn, t as ComponentProps } from "../types-BbN28E3_.js";
|
|
4
|
+
import { At as PopupMenuInputState, Ct as PopupMenuList, Dt as PopupMenuListCssVars, Et as PopupMenuListState, Ft as PopupMenuIconProps, H as PopupMenuGroupLabel, I as PopupMenuSeparator, It as PopupMenuIconState, J as PopupMenuGroupState, K as PopupMenuGroup, L as PopupMenuSeparatorProps, Mt as PopupMenuEmptyProps, Nt as PopupMenuEmptyState, Ot as PopupMenuInput, Pt as PopupMenuIcon, Qt as PopupMenuPopup, R as PopupMenuSeparatorState, Sn as PopupMenuDebugOptions, Tt as PopupMenuListProps, U as PopupMenuGroupLabelProps, W as PopupMenuGroupLabelState, Xt as PopupMenuPortal, Yt as PopupMenuPositionerCssVars, Zt as PopupMenuPortalProps, _t as PopupMenuScrollDownArrowProps, an as PopupMenuArrowProps, dt as PopupMenuSurface, en as PopupMenuPopupState, ft as PopupMenuSurfaceProps, gt as PopupMenuScrollDownArrow, ht as PopupMenuScrollArrowState, in as PopupMenuArrow, jt as PopupMenuEmpty, kt as PopupMenuInputProps, mt as PopupMenuScrollArrowProps, nn as PopupMenuBackdrop, pt as PopupMenuSurfaceState, q as PopupMenuGroupProps, rn as PopupMenuBackdropProps, sn as PopupMenuRootActions, vt as PopupMenuScrollUpArrow, wt as PopupMenuListChildrenState, yt as PopupMenuScrollUpArrowProps } from "../index-Cabqj7qI.js";
|
|
5
|
+
import { n as ItemEqualityComparer, t as Items } from "../items-ceX--VIv.js";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { Popover, PopoverPositionerProps, PopoverRootProps } from "@base-ui/react/popover";
|
|
8
|
+
//#region src/select/item/item.data-attrs.d.ts
|
|
9
|
+
export declare const SelectItemDataAttributes: {
|
|
10
|
+
/**
|
|
11
|
+
* Identifies the component part.
|
|
12
|
+
* @type {'bazzaui-select-item'}
|
|
13
|
+
*/
|
|
14
|
+
readonly slot: 'bazzaui-select-item';
|
|
15
|
+
/**
|
|
16
|
+
* Present when the item is highlighted via keyboard or pointer.
|
|
17
|
+
*/
|
|
18
|
+
readonly highlighted: 'data-highlighted';
|
|
19
|
+
/**
|
|
20
|
+
* Present when the item is disabled.
|
|
21
|
+
*/
|
|
22
|
+
readonly disabled: 'data-disabled';
|
|
23
|
+
/**
|
|
24
|
+
* Present when the item is currently selected.
|
|
25
|
+
*/
|
|
26
|
+
readonly selected: 'data-selected';
|
|
27
|
+
/** Present when this row is the first visible list-level row (not inside a group). */
|
|
28
|
+
readonly first: 'data-first';
|
|
29
|
+
/** Present when this row is the last visible list-level row (not inside a group). */
|
|
30
|
+
readonly last: 'data-last';
|
|
31
|
+
/** Present when this row is the first visible row within its group. */
|
|
32
|
+
readonly firstInGroup: 'data-first-in-group';
|
|
33
|
+
/** Present when this row is the last visible row within its group. */
|
|
34
|
+
readonly lastInGroup: 'data-last-in-group';
|
|
44
35
|
};
|
|
45
|
-
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/select/item/item.d.ts
|
|
46
38
|
interface SelectItemState extends Record<string, unknown> {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Whether the item is highlighted (via keyboard or pointer).
|
|
41
|
+
*/
|
|
42
|
+
highlighted: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the item is disabled.
|
|
45
|
+
*/
|
|
46
|
+
disabled: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the item is currently selected.
|
|
49
|
+
*/
|
|
50
|
+
selected: boolean;
|
|
51
|
+
first: boolean;
|
|
52
|
+
last: boolean;
|
|
53
|
+
firstInGroup: boolean;
|
|
54
|
+
lastInGroup: boolean;
|
|
63
55
|
}
|
|
64
56
|
interface SelectItemProps<Value = unknown> extends ComponentProps<'div', SelectItem.State> {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
declare const SelectItem: <Value = unknown>(props: SelectItemProps<Value> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
100
|
-
declare namespace SelectItem {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
declare const SelectItemIndicatorDataAttributes: {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
57
|
+
/**
|
|
58
|
+
* The value of this item. Required and must be unique within the Select.
|
|
59
|
+
* Can be a primitive or an object.
|
|
60
|
+
*
|
|
61
|
+
* Pass `null` to render a clearable item: selecting it clears the selection
|
|
62
|
+
* and its label is used as the trigger placeholder (Base UI parity).
|
|
63
|
+
*/
|
|
64
|
+
value: Value | null;
|
|
65
|
+
/**
|
|
66
|
+
* Text value to use for display in Select.Value when this item is selected.
|
|
67
|
+
* If not provided, the text content of the item will be used.
|
|
68
|
+
* For object values, this can be auto-detected from `{ label }` shape.
|
|
69
|
+
*/
|
|
70
|
+
textValue?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Additional keywords to match against when filtering.
|
|
73
|
+
* Useful for aliases or synonyms.
|
|
74
|
+
*/
|
|
75
|
+
keywords?: string[];
|
|
76
|
+
/**
|
|
77
|
+
* Whether this item is disabled.
|
|
78
|
+
* Disabled items are not selectable and are skipped during keyboard navigation.
|
|
79
|
+
*/
|
|
80
|
+
disabled?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Callback when this item is selected.
|
|
83
|
+
*/
|
|
84
|
+
onSelect?: () => void;
|
|
85
|
+
/**
|
|
86
|
+
* Whether to force render this item regardless of filter results.
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
forceMount?: boolean;
|
|
90
|
+
}
|
|
91
|
+
export declare const SelectItem: <Value = unknown>(props: SelectItemProps<Value> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
92
|
+
export declare namespace SelectItem {
|
|
93
|
+
type State = SelectItemState;
|
|
94
|
+
interface Props<Value = unknown> extends SelectItemProps<Value> {}
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/select/item-indicator/item-indicator.data-attrs.d.ts
|
|
98
|
+
export declare const SelectItemIndicatorDataAttributes: {
|
|
99
|
+
/**
|
|
100
|
+
* Identifies the component part.
|
|
101
|
+
* @type {'bazzaui-select-item-indicator'}
|
|
102
|
+
*/
|
|
103
|
+
readonly slot: 'bazzaui-select-item-indicator';
|
|
104
|
+
/**
|
|
105
|
+
* Present when the parent item is selected.
|
|
106
|
+
*/
|
|
107
|
+
readonly selected: 'data-selected';
|
|
108
|
+
/**
|
|
109
|
+
* Present when the parent item is highlighted via keyboard or pointer.
|
|
110
|
+
*/
|
|
111
|
+
readonly highlighted: 'data-highlighted';
|
|
120
112
|
};
|
|
121
|
-
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/select/item-indicator/item-indicator.d.ts
|
|
122
115
|
interface SelectItemIndicatorState extends Record<string, unknown> {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Whether the item is selected.
|
|
118
|
+
*/
|
|
119
|
+
selected: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Whether the item is highlighted (via keyboard or pointer).
|
|
122
|
+
*/
|
|
123
|
+
highlighted: boolean;
|
|
131
124
|
}
|
|
132
125
|
interface SelectItemIndicatorProps extends Omit<ComponentProps<'span', SelectItemIndicator.State>, 'children'> {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Whether to force render even when the item is not selected.
|
|
128
|
+
* @default false
|
|
129
|
+
*/
|
|
130
|
+
forceMount?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Whether to keep the element mounted even when not selected.
|
|
133
|
+
* Unlike forceMount, this still conditionally renders children.
|
|
134
|
+
* Useful for checkbox-style indicators where the container is always visible.
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
137
|
+
keepMounted?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Content to render. Can be a ReactNode or a function that receives state.
|
|
140
|
+
*/
|
|
141
|
+
children?: React.ReactNode | ((state: SelectItemIndicator.State) => React.ReactNode);
|
|
149
142
|
}
|
|
150
143
|
/**
|
|
151
144
|
* Indicator that shows when the item is selected.
|
|
@@ -153,34 +146,33 @@ interface SelectItemIndicatorProps extends Omit<ComponentProps<'span', SelectIte
|
|
|
153
146
|
* Only renders when the item is selected (unless forceMount or keepMounted is true).
|
|
154
147
|
* Renders a `<span>` element.
|
|
155
148
|
*/
|
|
156
|
-
declare const SelectItemIndicator: React.ForwardRefExoticComponent<Omit<SelectItemIndicator.Props, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
157
|
-
declare namespace SelectItemIndicator {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
type State = SelectItemIndicatorState;
|
|
149
|
+
export declare const SelectItemIndicator: React.ForwardRefExoticComponent<Omit<SelectItemIndicator.Props, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
150
|
+
export declare namespace SelectItemIndicator {
|
|
151
|
+
interface Props extends SelectItemIndicatorProps {}
|
|
152
|
+
type State = SelectItemIndicatorState;
|
|
161
153
|
}
|
|
162
|
-
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region src/select/item-label/item-label.d.ts
|
|
163
156
|
interface SelectItemLabelState extends Record<string, unknown> {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
interface SelectItemLabelProps extends ComponentProps<'span', SelectItemLabel.State> {
|
|
183
|
-
}
|
|
157
|
+
/**
|
|
158
|
+
* The serialized string key for the parent item's value.
|
|
159
|
+
* For object values, this is the result of `itemToStringValue` or the auto-detected `.value` property.
|
|
160
|
+
*/
|
|
161
|
+
value: string;
|
|
162
|
+
/**
|
|
163
|
+
* Whether the parent item is selected.
|
|
164
|
+
*/
|
|
165
|
+
selected: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Whether the parent item is highlighted.
|
|
168
|
+
*/
|
|
169
|
+
highlighted: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Whether the parent item is disabled.
|
|
172
|
+
*/
|
|
173
|
+
disabled: boolean;
|
|
174
|
+
}
|
|
175
|
+
interface SelectItemLabelProps extends ComponentProps<'span', SelectItemLabel.State> {}
|
|
184
176
|
/**
|
|
185
177
|
* The label/text content of a Select.Item.
|
|
186
178
|
*
|
|
@@ -193,41 +185,41 @@ interface SelectItemLabelProps extends ComponentProps<'span', SelectItemLabel.St
|
|
|
193
185
|
*
|
|
194
186
|
* Renders a `<span>` element.
|
|
195
187
|
*/
|
|
196
|
-
declare const SelectItemLabel: React.ForwardRefExoticComponent<Omit<SelectItemLabel.Props, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
197
|
-
declare namespace SelectItemLabel {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
type State = SelectItemLabelState;
|
|
188
|
+
export declare const SelectItemLabel: React.ForwardRefExoticComponent<Omit<SelectItemLabel.Props, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
189
|
+
export declare namespace SelectItemLabel {
|
|
190
|
+
interface Props extends SelectItemLabelProps {}
|
|
191
|
+
type State = SelectItemLabelState;
|
|
201
192
|
}
|
|
202
|
-
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/select/popup/popup.d.ts
|
|
203
195
|
interface SelectPopupState extends Omit<PopupMenuPopupState, 'side'> {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
196
|
+
/**
|
|
197
|
+
* Side the popup is placed on relative to the trigger.
|
|
198
|
+
*
|
|
199
|
+
* Reports `'none'` while `alignItemWithTrigger` positioning is active, because
|
|
200
|
+
* the popup overlaps the trigger and therefore has no physical side. This
|
|
201
|
+
* mirrors Base UI's behavior instead of leaking the `'bottom'` fallback that
|
|
202
|
+
* the underlying Popover computes when no side is provided.
|
|
203
|
+
*/
|
|
204
|
+
side: PopupMenuPopupState['side'] | 'none';
|
|
205
|
+
/**
|
|
206
|
+
* Whether the popup is currently using align-item-with-trigger positioning.
|
|
207
|
+
* This reflects the actual state, not just the prop value - it will be false
|
|
208
|
+
* if alignment couldn't be applied (e.g., not enough space, no selected item).
|
|
209
|
+
*/
|
|
210
|
+
alignItemWithTriggerActive: boolean;
|
|
219
211
|
}
|
|
220
212
|
interface SelectPopupProps extends Omit<PopupMenuPopup.Props, 'className' | 'render'> {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
213
|
+
/**
|
|
214
|
+
* CSS class applied to the element, or a function that
|
|
215
|
+
* returns a class based on the component's state.
|
|
216
|
+
*/
|
|
217
|
+
className?: string | ((state: SelectPopupState) => string);
|
|
218
|
+
/**
|
|
219
|
+
* Allows replacing the popup element with a custom element.
|
|
220
|
+
* The render state includes Select-specific alignment state.
|
|
221
|
+
*/
|
|
222
|
+
render?: React.ReactElement | ComponentRenderFn<React.HTMLAttributes<HTMLElement>, SelectPopupState>;
|
|
231
223
|
}
|
|
232
224
|
/**
|
|
233
225
|
* A container for the select popup contents.
|
|
@@ -235,38 +227,40 @@ interface SelectPopupProps extends Omit<PopupMenuPopup.Props, 'className' | 'ren
|
|
|
235
227
|
*
|
|
236
228
|
* Renders a `<div>` element.
|
|
237
229
|
*/
|
|
238
|
-
declare const SelectPopup: React.ForwardRefExoticComponent<Omit<SelectPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
239
|
-
declare namespace SelectPopup {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
230
|
+
export declare const SelectPopup: React.ForwardRefExoticComponent<Omit<SelectPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
231
|
+
export declare namespace SelectPopup {
|
|
232
|
+
type Props = SelectPopupProps;
|
|
233
|
+
type State = SelectPopupState;
|
|
234
|
+
}
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region src/select/positioner/positioner.data-attrs.d.ts
|
|
237
|
+
export declare const SelectPositionerDataAttributes: {
|
|
238
|
+
/**
|
|
239
|
+
* Identifies the component part.
|
|
240
|
+
* @type {'bazzaui-select-positioner'}
|
|
241
|
+
*/
|
|
242
|
+
readonly slot: 'bazzaui-select-positioner';
|
|
250
243
|
};
|
|
251
|
-
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region src/select/positioner/positioner.d.ts
|
|
252
246
|
interface SelectPositionerProps extends PopoverPositionerProps {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
247
|
+
/**
|
|
248
|
+
* Whether the positioner overlaps the trigger so the selected item's text is
|
|
249
|
+
* aligned with the trigger's value text (a native-select feel).
|
|
250
|
+
*
|
|
251
|
+
* Only applies to mouse/pen/keyboard input. When disabled, the popup falls
|
|
252
|
+
* back to standard anchored positioning on the configured `side`. It is
|
|
253
|
+
* automatically disabled when:
|
|
254
|
+
* - the select is searchable — a `Select.Input` is present (a `hideUntilActive`
|
|
255
|
+
* input counts once it activates), so the filtered list anchors to the
|
|
256
|
+
* trigger like a combobox;
|
|
257
|
+
* - the select was opened by touch (the full list is shown instead);
|
|
258
|
+
* - the trigger is too close to a viewport edge; or
|
|
259
|
+
* - there isn't enough room for a reasonably sized popup.
|
|
260
|
+
*
|
|
261
|
+
* @default true
|
|
262
|
+
*/
|
|
263
|
+
alignItemWithTrigger?: boolean;
|
|
270
264
|
}
|
|
271
265
|
/**
|
|
272
266
|
* Positions the select popup against its trigger.
|
|
@@ -279,12 +273,13 @@ interface SelectPositionerProps extends PopoverPositionerProps {
|
|
|
279
273
|
*
|
|
280
274
|
* Renders a `<div>` element.
|
|
281
275
|
*/
|
|
282
|
-
declare const SelectPositioner: React.ForwardRefExoticComponent<Omit<SelectPositionerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
283
|
-
declare namespace SelectPositioner {
|
|
284
|
-
|
|
285
|
-
|
|
276
|
+
export declare const SelectPositioner: React.ForwardRefExoticComponent<Omit<SelectPositionerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
277
|
+
export declare namespace SelectPositioner {
|
|
278
|
+
type Props = SelectPositionerProps;
|
|
279
|
+
type State = Popover.Positioner.State;
|
|
286
280
|
}
|
|
287
|
-
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region src/select/events.d.ts
|
|
288
283
|
/**
|
|
289
284
|
* Reasons why the select's open state changed.
|
|
290
285
|
*/
|
|
@@ -301,190 +296,191 @@ type SelectHighlightChangeReason = typeof pointer | typeof keyboard | typeof non
|
|
|
301
296
|
* Event details passed to the `onHighlightChange` callback.
|
|
302
297
|
*/
|
|
303
298
|
type SelectHighlightChangeEventDetails = GenericEventDetails<SelectHighlightChangeReason, {
|
|
304
|
-
|
|
299
|
+
index: number;
|
|
305
300
|
}>;
|
|
306
|
-
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/select/root/root.d.ts
|
|
307
303
|
/**
|
|
308
304
|
* Helper type to determine the value type based on the multiple flag.
|
|
309
305
|
*/
|
|
310
306
|
type SelectValue$1<Value, Multiple extends boolean | undefined> = Multiple extends true ? Value[] : Value | null;
|
|
311
307
|
interface SelectRootProps<Value = unknown, Multiple extends boolean | undefined = false> extends Omit<PopoverRootProps, 'open' | 'onOpenChange' | 'defaultOpen' | 'actionsRef'> {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
308
|
+
/**
|
|
309
|
+
* Whether the select is open.
|
|
310
|
+
* Use for controlled mode.
|
|
311
|
+
*/
|
|
312
|
+
open?: boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Callback when the open state changes.
|
|
315
|
+
* The second parameter contains event details including the reason for the change.
|
|
316
|
+
*/
|
|
317
|
+
onOpenChange?: (open: boolean, eventDetails: SelectOpenChangeEventDetails) => void;
|
|
318
|
+
/**
|
|
319
|
+
* Callback called after any animations complete when the select opens or closes.
|
|
320
|
+
* Useful for resetting state after exit animations finish.
|
|
321
|
+
*/
|
|
322
|
+
onOpenChangeComplete?: (open: boolean) => void;
|
|
323
|
+
/**
|
|
324
|
+
* A ref to imperative actions.
|
|
325
|
+
* - `close`: closes the menu imperatively.
|
|
326
|
+
* - `unmount`: unmounts the popup imperatively (when keep-mounted mode is enabled).
|
|
327
|
+
* - `setDisabled`: enables/disables the menu imperatively.
|
|
328
|
+
*/
|
|
329
|
+
actionsRef?: React.RefObject<SelectRoot.Actions | null>;
|
|
330
|
+
/**
|
|
331
|
+
* Whether the select is initially open.
|
|
332
|
+
* Use for uncontrolled mode.
|
|
333
|
+
* @default false
|
|
334
|
+
*/
|
|
335
|
+
defaultOpen?: boolean;
|
|
336
|
+
/**
|
|
337
|
+
* Current selected value (single-select mode).
|
|
338
|
+
* Use for controlled mode.
|
|
339
|
+
* Can be a primitive or an object.
|
|
340
|
+
*/
|
|
341
|
+
value?: SelectValue$1<Value, Multiple>;
|
|
342
|
+
/**
|
|
343
|
+
* Default selected value (single-select mode).
|
|
344
|
+
* Use for uncontrolled mode.
|
|
345
|
+
*/
|
|
346
|
+
defaultValue?: SelectValue$1<Value, Multiple>;
|
|
347
|
+
/**
|
|
348
|
+
* Callback when the selected value changes (single-select mode).
|
|
349
|
+
*
|
|
350
|
+
* Note: when a clearable (`null`) item is selected, this is called with
|
|
351
|
+
* `null` at runtime. If you use `null` items, handle that case.
|
|
352
|
+
*/
|
|
353
|
+
onValueChange?: (value: Value) => void;
|
|
354
|
+
/**
|
|
355
|
+
* Whether multi-select mode is enabled.
|
|
356
|
+
* @default false
|
|
357
|
+
*/
|
|
358
|
+
multiple?: Multiple;
|
|
359
|
+
/**
|
|
360
|
+
* Current selected values (multi-select mode).
|
|
361
|
+
* Use for controlled mode.
|
|
362
|
+
*/
|
|
363
|
+
values?: Value[];
|
|
364
|
+
/**
|
|
365
|
+
* Default selected values (multi-select mode).
|
|
366
|
+
* Use for uncontrolled mode.
|
|
367
|
+
*/
|
|
368
|
+
defaultValues?: Value[];
|
|
369
|
+
/**
|
|
370
|
+
* Callback when the selected values change (multi-select mode).
|
|
371
|
+
*/
|
|
372
|
+
onValuesChange?: (values: Value[]) => void;
|
|
373
|
+
/**
|
|
374
|
+
* Custom comparison logic used to determine if a select item value
|
|
375
|
+
* matches the current selected value.
|
|
376
|
+
* Useful when item values are objects without matching referentially.
|
|
377
|
+
* Defaults to Object.is comparison.
|
|
378
|
+
*/
|
|
379
|
+
isItemEqualToValue?: ItemEqualityComparer<Value>;
|
|
380
|
+
/**
|
|
381
|
+
* When the item values are objects (`<Select.Item value={object}>`),
|
|
382
|
+
* this function converts the object value to a string representation
|
|
383
|
+
* for display in the trigger.
|
|
384
|
+
* If the shape of the object is `{ value, label }`, the label will be
|
|
385
|
+
* used automatically without needing to specify this prop.
|
|
386
|
+
*/
|
|
387
|
+
itemToStringLabel?: (itemValue: Value) => string;
|
|
388
|
+
/**
|
|
389
|
+
* When the item values are objects (`<Select.Item value={object}>`),
|
|
390
|
+
* this function converts the object value to a string representation
|
|
391
|
+
* for form submission.
|
|
392
|
+
* If the shape of the object is `{ value, label }`, the value will be
|
|
393
|
+
* used automatically without needing to specify this prop.
|
|
394
|
+
*/
|
|
395
|
+
itemToStringValue?: (itemValue: Value) => string;
|
|
396
|
+
/**
|
|
397
|
+
* Form field name for submission.
|
|
398
|
+
* When set, hidden input(s) will be rendered for form submission.
|
|
399
|
+
*/
|
|
400
|
+
name?: string;
|
|
401
|
+
/**
|
|
402
|
+
* Associate with a form by ID.
|
|
403
|
+
*/
|
|
404
|
+
form?: string;
|
|
405
|
+
/**
|
|
406
|
+
* Whether this field is required.
|
|
407
|
+
*/
|
|
408
|
+
required?: boolean;
|
|
409
|
+
/**
|
|
410
|
+
* Whether the select is disabled.
|
|
411
|
+
* @default false
|
|
412
|
+
*/
|
|
413
|
+
disabled?: boolean;
|
|
414
|
+
/**
|
|
415
|
+
* Placeholder text when no value is selected.
|
|
416
|
+
* @default "Select..."
|
|
417
|
+
*/
|
|
418
|
+
placeholder?: string;
|
|
419
|
+
/**
|
|
420
|
+
* Data structure of the items rendered in the select popup.
|
|
421
|
+
* When specified, `<Select.Value>` renders the label of the selected item
|
|
422
|
+
* instead of the raw value.
|
|
423
|
+
*
|
|
424
|
+
* Can be a record mapping values to labels, or an array of
|
|
425
|
+
* `{ value, label, keywords? }` objects. Only the array form can express
|
|
426
|
+
* `keywords` (extra filter terms) or a `null` (clearable) value.
|
|
427
|
+
* @example
|
|
428
|
+
* ```tsx
|
|
429
|
+
* // Record format
|
|
430
|
+
* <Select.Root items={{ us: 'United States', uk: 'United Kingdom' }}>
|
|
431
|
+
*
|
|
432
|
+
* // Array format (supports keywords and a null clearable item)
|
|
433
|
+
* <Select.Root items={[
|
|
434
|
+
* { value: null, label: 'Select a country' },
|
|
435
|
+
* { value: 'us', label: 'United States', keywords: ['america', 'usa'] },
|
|
436
|
+
* { value: 'uk', label: 'United Kingdom' },
|
|
437
|
+
* ]}>
|
|
438
|
+
* ```
|
|
439
|
+
*/
|
|
440
|
+
items?: Items;
|
|
441
|
+
/**
|
|
442
|
+
* Determines if the select enters a modal state when open.
|
|
443
|
+
*
|
|
444
|
+
* - `true`: user interaction is limited to the select: document page scroll
|
|
445
|
+
* is locked, and pointer interactions on outside elements are disabled.
|
|
446
|
+
* - `false`: user interaction with the rest of the document is allowed.
|
|
447
|
+
* - `'trap-focus'`: focus is trapped inside the select, but document page
|
|
448
|
+
* scroll is not locked and pointer interactions outside of it remain enabled.
|
|
449
|
+
*
|
|
450
|
+
* @default true
|
|
451
|
+
*/
|
|
452
|
+
modal?: boolean | 'trap-focus';
|
|
453
|
+
/**
|
|
454
|
+
* When to close the select on outside interactions.
|
|
455
|
+
* - 'pointerdown': Close immediately when pointer is pressed outside (default)
|
|
456
|
+
* - 'click': Close when a full click (pointerdown + pointerup) occurs outside
|
|
457
|
+
* @default 'pointerdown'
|
|
458
|
+
*/
|
|
459
|
+
closeOnOutsidePress?: 'click' | 'pointerdown';
|
|
460
|
+
/**
|
|
461
|
+
* Whether virtualization mode is enabled.
|
|
462
|
+
* When true, items should provide an explicit `index` prop and
|
|
463
|
+
* the `virtualItems` prop should be provided for navigation to work correctly.
|
|
464
|
+
* @default false
|
|
465
|
+
*/
|
|
466
|
+
virtualized?: boolean;
|
|
467
|
+
/**
|
|
468
|
+
* Pre-registered items for virtualization.
|
|
469
|
+
* When provided with `virtualized={true}`, this allows navigation to work
|
|
470
|
+
* for items that aren't currently mounted in the DOM.
|
|
471
|
+
*/
|
|
472
|
+
virtualItems?: VirtualItem[];
|
|
473
|
+
/**
|
|
474
|
+
* Callback when the highlighted item changes.
|
|
475
|
+
* Useful for synchronizing with a virtualizer (e.g., scrollToIndex) or other UI state.
|
|
476
|
+
* The third parameter contains event details including the reason for the change.
|
|
477
|
+
*/
|
|
478
|
+
onHighlightChange?: (id: string | null, index: number, eventDetails: SelectHighlightChangeEventDetails) => void;
|
|
479
|
+
/**
|
|
480
|
+
* Debug visualization options for submenu interaction heuristics.
|
|
481
|
+
*/
|
|
482
|
+
debug?: PopupMenuDebugOptions;
|
|
483
|
+
children: React.ReactNode;
|
|
488
484
|
}
|
|
489
485
|
/**
|
|
490
486
|
* Groups all parts of the select.
|
|
@@ -494,29 +490,29 @@ interface SelectRootProps<Value = unknown, Multiple extends boolean | undefined
|
|
|
494
490
|
* @template Value - The type of the select value (can be a primitive or object)
|
|
495
491
|
* @template Multiple - Whether multiple selection is enabled
|
|
496
492
|
*/
|
|
497
|
-
declare function SelectRoot<Value = unknown, Multiple extends boolean | undefined = false>(props: SelectRootProps<Value, Multiple>): React.JSX.Element;
|
|
498
|
-
declare namespace SelectRoot {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
493
|
+
export declare function SelectRoot<Value = unknown, Multiple extends boolean | undefined = false>(props: SelectRootProps<Value, Multiple>): React.JSX.Element;
|
|
494
|
+
export declare namespace SelectRoot {
|
|
495
|
+
interface Props<Value = unknown, Multiple extends boolean | undefined = false> extends SelectRootProps<Value, Multiple> {}
|
|
496
|
+
type OpenChangeEventDetails = SelectOpenChangeEventDetails;
|
|
497
|
+
type HighlightChangeEventDetails = SelectHighlightChangeEventDetails;
|
|
498
|
+
type Actions = PopupMenuRootActions;
|
|
499
|
+
}
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region src/select/surface/surface.d.ts
|
|
506
502
|
interface SelectSurfaceProps extends Omit<PopupMenuSurfaceProps, 'autoHighlightFirst'> {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
503
|
+
/**
|
|
504
|
+
* Controls auto-highlighting behavior when the select opens.
|
|
505
|
+
* - `true`: highlight the first item (default when alignItemWithTrigger is inactive)
|
|
506
|
+
* - `false`: don't auto-highlight any item
|
|
507
|
+
* - `'selected'`: highlight the currently selected item, or first item if none selected
|
|
508
|
+
* - `string`: highlight the item with this specific value
|
|
509
|
+
*
|
|
510
|
+
* Note: When the Positioner's `alignItemWithTrigger` is active and this prop
|
|
511
|
+
* is not explicitly set, the selected item is automatically highlighted.
|
|
512
|
+
*
|
|
513
|
+
* @default true (or selected value when alignItemWithTrigger is active)
|
|
514
|
+
*/
|
|
515
|
+
autoHighlightFirst?: boolean | 'selected' | string;
|
|
520
516
|
}
|
|
521
517
|
/**
|
|
522
518
|
* Provides search context and manages item registration for Select.
|
|
@@ -527,73 +523,74 @@ interface SelectSurfaceProps extends Omit<PopupMenuSurfaceProps, 'autoHighlightF
|
|
|
527
523
|
* Place inside Select.Popup to enable search functionality.
|
|
528
524
|
* Renders a `<div>` element.
|
|
529
525
|
*/
|
|
530
|
-
declare const SelectSurface: React.ForwardRefExoticComponent<Omit<SelectSurface.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
531
|
-
declare namespace SelectSurface {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
declare const SelectTriggerDataAttributes: {
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
526
|
+
export declare const SelectSurface: React.ForwardRefExoticComponent<Omit<SelectSurface.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
527
|
+
export declare namespace SelectSurface {
|
|
528
|
+
type State = PopupMenuSurface.State;
|
|
529
|
+
interface Props extends SelectSurfaceProps {}
|
|
530
|
+
}
|
|
531
|
+
//#endregion
|
|
532
|
+
//#region src/select/trigger/trigger.data-attrs.d.ts
|
|
533
|
+
export declare const SelectTriggerDataAttributes: {
|
|
534
|
+
/**
|
|
535
|
+
* Identifies the component part.
|
|
536
|
+
* @type {'bazzaui-select-trigger'}
|
|
537
|
+
*/
|
|
538
|
+
readonly slot: 'bazzaui-select-trigger';
|
|
539
|
+
/**
|
|
540
|
+
* Present when the select dropdown is open.
|
|
541
|
+
*/
|
|
542
|
+
readonly open: 'data-open';
|
|
543
|
+
/**
|
|
544
|
+
* Present when the select dropdown is closed.
|
|
545
|
+
*/
|
|
546
|
+
readonly closed: 'data-closed';
|
|
547
|
+
/**
|
|
548
|
+
* Present when the trigger is disabled.
|
|
549
|
+
*/
|
|
550
|
+
readonly disabled: 'data-disabled';
|
|
551
|
+
/**
|
|
552
|
+
* Present when no value is selected (showing placeholder).
|
|
553
|
+
*/
|
|
554
|
+
readonly placeholder: 'data-placeholder';
|
|
559
555
|
};
|
|
560
|
-
|
|
556
|
+
//#endregion
|
|
557
|
+
//#region src/select/trigger/trigger.d.ts
|
|
561
558
|
interface SelectTriggerState extends Record<string, unknown> {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
559
|
+
/**
|
|
560
|
+
* Whether the select is open.
|
|
561
|
+
*/
|
|
562
|
+
open: boolean;
|
|
563
|
+
/**
|
|
564
|
+
* Whether the select is disabled.
|
|
565
|
+
*/
|
|
566
|
+
disabled: boolean;
|
|
567
|
+
/**
|
|
568
|
+
* Whether the select currently shows placeholder (no value selected).
|
|
569
|
+
*/
|
|
570
|
+
placeholder: boolean;
|
|
574
571
|
}
|
|
575
572
|
interface SelectTriggerProps extends ComponentProps<'button', SelectTrigger.State> {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
573
|
+
/**
|
|
574
|
+
* Whether the trigger is disabled.
|
|
575
|
+
*/
|
|
576
|
+
disabled?: boolean;
|
|
577
|
+
/**
|
|
578
|
+
* Whether the select opens when hovering the trigger.
|
|
579
|
+
* @default false
|
|
580
|
+
*/
|
|
581
|
+
openOnHover?: boolean;
|
|
582
|
+
/**
|
|
583
|
+
* Delay before opening on hover (in milliseconds).
|
|
584
|
+
* Only applies when `openOnHover` is true.
|
|
585
|
+
* @default 100
|
|
586
|
+
*/
|
|
587
|
+
delay?: number;
|
|
588
|
+
/**
|
|
589
|
+
* Delay before closing when pointer leaves (in milliseconds).
|
|
590
|
+
* Only applies when `openOnHover` is true.
|
|
591
|
+
* @default 0
|
|
592
|
+
*/
|
|
593
|
+
closeDelay?: number;
|
|
597
594
|
}
|
|
598
595
|
/**
|
|
599
596
|
* A button that opens the select dropdown.
|
|
@@ -602,123 +599,121 @@ interface SelectTriggerProps extends ComponentProps<'button', SelectTrigger.Stat
|
|
|
602
599
|
* Supports `openOnHover` to open the select when hovering the trigger,
|
|
603
600
|
* with configurable `delay` and `closeDelay`.
|
|
604
601
|
*/
|
|
605
|
-
declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectTrigger.Props, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
606
|
-
declare namespace SelectTrigger {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
type State = SelectTriggerState;
|
|
602
|
+
export declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectTrigger.Props, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
603
|
+
export declare namespace SelectTrigger {
|
|
604
|
+
interface Props extends SelectTriggerProps {}
|
|
605
|
+
type State = SelectTriggerState;
|
|
610
606
|
}
|
|
611
|
-
|
|
607
|
+
//#endregion
|
|
608
|
+
//#region src/select/value/value.d.ts
|
|
612
609
|
interface SelectValueState<Value = unknown> extends Record<string, unknown> {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
610
|
+
/**
|
|
611
|
+
* The currently selected value (single-select mode).
|
|
612
|
+
*/
|
|
613
|
+
value: Value | null;
|
|
614
|
+
/**
|
|
615
|
+
* The currently selected values (multi-select mode).
|
|
616
|
+
*/
|
|
617
|
+
values: Value[];
|
|
618
|
+
/**
|
|
619
|
+
* Whether the select is in multi-select mode.
|
|
620
|
+
*/
|
|
621
|
+
multiple: boolean;
|
|
622
|
+
/**
|
|
623
|
+
* Whether a value is currently selected.
|
|
624
|
+
*/
|
|
625
|
+
hasValue: boolean;
|
|
626
|
+
/**
|
|
627
|
+
* The placeholder text.
|
|
628
|
+
*/
|
|
629
|
+
placeholder: string;
|
|
630
|
+
/**
|
|
631
|
+
* Get the display content for a value.
|
|
632
|
+
* First checks the item text registry (populated when items mount),
|
|
633
|
+
* then falls back to the `items` prop passed to SelectRoot,
|
|
634
|
+
* then falls back to `itemToStringLabel` for object values.
|
|
635
|
+
*/
|
|
636
|
+
getValueText: (value: Value) => React.ReactNode | undefined;
|
|
640
637
|
}
|
|
641
638
|
interface SelectValueProps<Value = unknown> extends Omit<ComponentProps<'span', SelectValueState<Value>>, 'children'> {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
}
|
|
654
|
-
declare const SelectValue: <Value = unknown>(props: SelectValueProps<Value> & React.RefAttributes<HTMLSpanElement>) => React.ReactElement;
|
|
655
|
-
declare namespace SelectValue {
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
declare
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
}
|
|
721
|
-
|
|
639
|
+
/**
|
|
640
|
+
* Placeholder text when no value is selected.
|
|
641
|
+
* Overrides the placeholder set on Select.Root.
|
|
642
|
+
*/
|
|
643
|
+
placeholder?: string;
|
|
644
|
+
/**
|
|
645
|
+
* Custom render function for the selected value content.
|
|
646
|
+
* Receives the current state and should return the content to render.
|
|
647
|
+
* This is different from the `render` prop which replaces the element.
|
|
648
|
+
*/
|
|
649
|
+
children?: React.ReactNode | ((state: SelectValueState<Value>) => React.ReactNode);
|
|
650
|
+
}
|
|
651
|
+
export declare const SelectValue: <Value = unknown>(props: SelectValueProps<Value> & React.RefAttributes<HTMLSpanElement>) => React.ReactElement;
|
|
652
|
+
export declare namespace SelectValue {
|
|
653
|
+
interface Props extends SelectValueProps<unknown> {}
|
|
654
|
+
type State = SelectValueState<unknown>;
|
|
655
|
+
}
|
|
656
|
+
declare namespace index_parts_d_exports {
|
|
657
|
+
export { PopupMenuArrow as Arrow, PopupMenuBackdrop as Backdrop, PopupMenuEmpty as Empty, PopupMenuGroup as Group, PopupMenuGroupLabel as GroupLabel, PopupMenuIcon as Icon, PopupMenuInput as Input, SelectItem as Item, SelectItemIndicator as ItemIndicator, SelectItemLabel as ItemLabel, PopupMenuList as List, SelectPopup as Popup, PopupMenuPortal as Portal, SelectPositioner as Positioner, SelectRoot as Root, PopupMenuScrollDownArrow as ScrollDownArrow, PopupMenuScrollUpArrow as ScrollUpArrow, SelectPopupProps, SelectPopupState, PopupMenuSeparator as Separator, SelectSurface as Surface, SelectTrigger as Trigger, SelectValue as Value, VirtualItem };
|
|
658
|
+
}
|
|
659
|
+
//#endregion
|
|
660
|
+
//#region src/select/arrow/arrow.data-attrs.d.ts
|
|
661
|
+
export declare enum SelectArrowDataAttributes {
|
|
662
|
+
/**
|
|
663
|
+
* Identifies the component part.
|
|
664
|
+
* @type {'bazzaui-select-arrow'}
|
|
665
|
+
*/
|
|
666
|
+
slot = "bazzaui-select-arrow",
|
|
667
|
+
/**
|
|
668
|
+
* Present when the popup menu is open.
|
|
669
|
+
*/
|
|
670
|
+
open = "data-open",
|
|
671
|
+
/**
|
|
672
|
+
* Present when the popup menu is closed.
|
|
673
|
+
*/
|
|
674
|
+
closed = "data-closed",
|
|
675
|
+
/**
|
|
676
|
+
* Indicates which side the popup is positioned relative to the trigger.
|
|
677
|
+
* @type {'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'}
|
|
678
|
+
*/
|
|
679
|
+
side = "data-side",
|
|
680
|
+
/**
|
|
681
|
+
* Indicates how the popup is aligned relative to specified side.
|
|
682
|
+
* @type {'start' | 'center' | 'end'}
|
|
683
|
+
*/
|
|
684
|
+
align = "data-align",
|
|
685
|
+
/**
|
|
686
|
+
* Present when the arrow is not centered due to collision avoidance.
|
|
687
|
+
*/
|
|
688
|
+
uncentered = "data-uncentered"
|
|
689
|
+
}
|
|
690
|
+
//#endregion
|
|
691
|
+
//#region src/select/backdrop/backdrop.data-attrs.d.ts
|
|
692
|
+
export declare enum SelectBackdropDataAttributes {
|
|
693
|
+
/**
|
|
694
|
+
* Identifies the component part.
|
|
695
|
+
* @type {'bazzaui-select-backdrop'}
|
|
696
|
+
*/
|
|
697
|
+
slot = "bazzaui-select-backdrop",
|
|
698
|
+
/**
|
|
699
|
+
* Present when the popup menu is open.
|
|
700
|
+
*/
|
|
701
|
+
open = "data-open",
|
|
702
|
+
/**
|
|
703
|
+
* Present when the popup menu is closed.
|
|
704
|
+
*/
|
|
705
|
+
closed = "data-closed",
|
|
706
|
+
/**
|
|
707
|
+
* Present when the popup menu is animating in.
|
|
708
|
+
*/
|
|
709
|
+
startingStyle = "data-starting-style",
|
|
710
|
+
/**
|
|
711
|
+
* Present when the popup menu is animating out.
|
|
712
|
+
*/
|
|
713
|
+
endingStyle = "data-ending-style"
|
|
714
|
+
}
|
|
715
|
+
//#endregion
|
|
716
|
+
//#region src/select/empty/empty.data-attrs.d.ts
|
|
722
717
|
/**
|
|
723
718
|
* Data attributes applied to Select.Empty for styling.
|
|
724
719
|
* Displayed when no items match the current search filter.
|
|
@@ -732,56 +727,61 @@ declare enum SelectBackdropDataAttributes {
|
|
|
732
727
|
* }
|
|
733
728
|
* ```
|
|
734
729
|
*/
|
|
735
|
-
declare enum SelectEmptyDataAttributes {
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
730
|
+
export declare enum SelectEmptyDataAttributes {
|
|
731
|
+
/**
|
|
732
|
+
* Identifies the component part.
|
|
733
|
+
* @type {'bazzaui-select-empty'}
|
|
734
|
+
*/
|
|
735
|
+
slot = "bazzaui-select-empty"
|
|
736
|
+
}
|
|
737
|
+
//#endregion
|
|
738
|
+
//#region src/select/group/group.data-attrs.d.ts
|
|
739
|
+
export declare enum SelectGroupDataAttributes {
|
|
740
|
+
/**
|
|
741
|
+
* Identifies the component part.
|
|
742
|
+
* @type {'bazzaui-select-group'}
|
|
743
|
+
*/
|
|
744
|
+
slot = "bazzaui-select-group"
|
|
745
|
+
}
|
|
746
|
+
//#endregion
|
|
747
|
+
//#region src/select/group-label/group-label.data-attrs.d.ts
|
|
748
|
+
export declare enum SelectGroupLabelDataAttributes {
|
|
749
|
+
/**
|
|
750
|
+
* Identifies the component part.
|
|
751
|
+
* @type {'bazzaui-select-group-label'}
|
|
752
|
+
*/
|
|
753
|
+
slot = "bazzaui-select-group-label"
|
|
754
|
+
}
|
|
755
|
+
//#endregion
|
|
756
|
+
//#region src/select/icon/icon.data-attrs.d.ts
|
|
757
|
+
export declare const SelectIconDataAttributes: {
|
|
758
|
+
/**
|
|
759
|
+
* Identifies the component part.
|
|
760
|
+
* @type {'bazzaui-select-icon'}
|
|
761
|
+
*/
|
|
762
|
+
readonly slot: 'bazzaui-select-icon';
|
|
763
|
+
/** Present when the popup is open. */
|
|
764
|
+
readonly open: 'data-popup-open';
|
|
767
765
|
};
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
766
|
+
//#endregion
|
|
767
|
+
//#region src/select/input/input.data-attrs.d.ts
|
|
768
|
+
export declare enum SelectInputDataAttributes {
|
|
769
|
+
/**
|
|
770
|
+
* Identifies the component part.
|
|
771
|
+
* @type {'bazzaui-select-input'}
|
|
772
|
+
*/
|
|
773
|
+
slot = "bazzaui-select-input",
|
|
774
|
+
/**
|
|
775
|
+
* Present when the popup menu is open.
|
|
776
|
+
*/
|
|
777
|
+
open = "data-open",
|
|
778
|
+
/**
|
|
779
|
+
* Present when the popup menu is closed.
|
|
780
|
+
*/
|
|
781
|
+
closed = "data-closed"
|
|
782
|
+
}
|
|
783
|
+
//#endregion
|
|
784
|
+
//#region src/select/list/list.data-attrs.d.ts
|
|
785
785
|
/**
|
|
786
786
|
* Data attributes applied to Select.List for styling.
|
|
787
787
|
* Container for select items with role="listbox".
|
|
@@ -794,61 +794,65 @@ declare enum SelectInputDataAttributes {
|
|
|
794
794
|
* }
|
|
795
795
|
* ```
|
|
796
796
|
*/
|
|
797
|
-
declare enum SelectListDataAttributes {
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
}
|
|
809
|
-
|
|
797
|
+
export declare enum SelectListDataAttributes {
|
|
798
|
+
/**
|
|
799
|
+
* Identifies the component part.
|
|
800
|
+
* @type {'bazzaui-select-list'}
|
|
801
|
+
*/
|
|
802
|
+
slot = "bazzaui-select-list",
|
|
803
|
+
/**
|
|
804
|
+
* Always present on the list element.
|
|
805
|
+
* Used for styling and by useStickyRowWidth to find the list container.
|
|
806
|
+
*/
|
|
807
|
+
list = "data-popup-menu-list"
|
|
808
|
+
}
|
|
809
|
+
//#endregion
|
|
810
|
+
//#region src/select/popup/popup.data-attrs.d.ts
|
|
810
811
|
/**
|
|
811
812
|
* Select-specific popup data attributes (in addition to PopupMenuPopupDataAttributes).
|
|
812
813
|
*/
|
|
813
|
-
declare enum SelectPopupDataAttributes {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
814
|
+
export declare enum SelectPopupDataAttributes {
|
|
815
|
+
/**
|
|
816
|
+
* Present when the popup is using align-item-with-trigger positioning.
|
|
817
|
+
* This reflects the actual state, not just the prop value.
|
|
818
|
+
*/
|
|
819
|
+
alignItemWithTrigger = "data-align-item-with-trigger"
|
|
820
|
+
}
|
|
821
|
+
//#endregion
|
|
822
|
+
//#region src/select/scroll-arrow/scroll-arrow.data-attrs.d.ts
|
|
823
|
+
export declare const SelectScrollArrowDataAttributes: {
|
|
824
|
+
/**
|
|
825
|
+
* Identifies the component part for scroll up arrow.
|
|
826
|
+
* @type {'bazzaui-select-scroll-up-arrow'}
|
|
827
|
+
*/
|
|
828
|
+
readonly slotUp: 'bazzaui-select-scroll-up-arrow';
|
|
829
|
+
/**
|
|
830
|
+
* Identifies the component part for scroll down arrow.
|
|
831
|
+
* @type {'bazzaui-select-scroll-down-arrow'}
|
|
832
|
+
*/
|
|
833
|
+
readonly slotDown: 'bazzaui-select-scroll-down-arrow';
|
|
834
|
+
/**
|
|
835
|
+
* Direction of the scroll arrow.
|
|
836
|
+
* @type {'up' | 'down'}
|
|
837
|
+
*/
|
|
838
|
+
readonly direction: 'data-direction';
|
|
839
|
+
/**
|
|
840
|
+
* Side of the popup.
|
|
841
|
+
* @type {'top' | 'bottom' | 'left' | 'right'}
|
|
842
|
+
*/
|
|
843
|
+
readonly side: 'data-side';
|
|
842
844
|
};
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
845
|
+
//#endregion
|
|
846
|
+
//#region src/select/separator/separator.data-attrs.d.ts
|
|
847
|
+
export declare enum SelectSeparatorDataAttributes {
|
|
848
|
+
/**
|
|
849
|
+
* Identifies the component part.
|
|
850
|
+
* @type {'bazzaui-select-separator'}
|
|
851
|
+
*/
|
|
852
|
+
slot = "bazzaui-select-separator"
|
|
853
|
+
}
|
|
854
|
+
//#endregion
|
|
855
|
+
//#region src/select/contexts/select-context.d.ts
|
|
852
856
|
/**
|
|
853
857
|
* Item text registry for displaying selected values.
|
|
854
858
|
* Maps serialized item value to its text content.
|
|
@@ -861,86 +865,87 @@ type ItemTextRegistry = Map<string, string>;
|
|
|
861
865
|
* @template Value - The type of the select value (can be a primitive or object)
|
|
862
866
|
*/
|
|
863
867
|
interface SelectContextValue<Value = unknown> {
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
868
|
+
/** Whether multi-select mode is enabled */
|
|
869
|
+
multiple: boolean;
|
|
870
|
+
/** Current selected value (single-select mode) */
|
|
871
|
+
value: Value | null;
|
|
872
|
+
/** Current selected values (multi-select mode) */
|
|
873
|
+
values: Value[];
|
|
874
|
+
/** Callback when value changes (single-select mode; `null` clears it) */
|
|
875
|
+
onValueChange: (value: Value | null) => void;
|
|
876
|
+
/** Callback when values change (multi-select mode) */
|
|
877
|
+
onValuesChange: (values: Value[]) => void;
|
|
878
|
+
/**
|
|
879
|
+
* Custom comparison logic used to determine if a select item value
|
|
880
|
+
* matches the current selected value.
|
|
881
|
+
* Useful when item values are objects without matching referentially.
|
|
882
|
+
* Defaults to Object.is comparison.
|
|
883
|
+
*/
|
|
884
|
+
isItemEqualToValue: ItemEqualityComparer<Value>;
|
|
885
|
+
/**
|
|
886
|
+
* When the item values are objects, this function converts the object
|
|
887
|
+
* value to a string representation for display in the trigger.
|
|
888
|
+
* If the shape of the object is { value, label }, the label will be
|
|
889
|
+
* used automatically without needing to specify this prop.
|
|
890
|
+
*/
|
|
891
|
+
itemToStringLabel?: (itemValue: Value) => string;
|
|
892
|
+
/**
|
|
893
|
+
* When the item values are objects, this function converts the object
|
|
894
|
+
* value to a string representation for form submission.
|
|
895
|
+
* If the shape of the object is { value, label }, the value will be
|
|
896
|
+
* used automatically without needing to specify this prop.
|
|
897
|
+
*/
|
|
898
|
+
itemToStringValue?: (itemValue: Value) => string;
|
|
899
|
+
/** Form field name for submission */
|
|
900
|
+
name?: string;
|
|
901
|
+
/** Associate with a form by ID */
|
|
902
|
+
form?: string;
|
|
903
|
+
/** Whether this field is required */
|
|
904
|
+
required?: boolean;
|
|
905
|
+
/** Whether the select is disabled */
|
|
906
|
+
disabled: boolean;
|
|
907
|
+
/** Placeholder text when no value selected */
|
|
908
|
+
placeholder: string;
|
|
909
|
+
/** Registry of item values to their text content */
|
|
910
|
+
itemTextRegistry: ItemTextRegistry;
|
|
911
|
+
/** Register an item's text content */
|
|
912
|
+
registerItemText: (value: string, text: string) => () => void;
|
|
913
|
+
/**
|
|
914
|
+
* Data structure of the items for label resolution.
|
|
915
|
+
* Used to display labels before items mount (e.g., on initial render with defaultValue).
|
|
916
|
+
* Can be a record mapping values to labels, or an array of
|
|
917
|
+
* `{ value, label, keywords? }` objects.
|
|
918
|
+
*/
|
|
919
|
+
items?: Items;
|
|
920
|
+
/** ID for the listbox element */
|
|
921
|
+
listId: string;
|
|
922
|
+
/** Ref to the trigger element */
|
|
923
|
+
triggerRef: React.RefObject<HTMLElement | null>;
|
|
924
|
+
/** Ref to the value display element (text in trigger) */
|
|
925
|
+
valueRef: React.RefObject<HTMLElement | null>;
|
|
926
|
+
/** Ref to the selected item's text element */
|
|
927
|
+
selectedItemTextRef: React.MutableRefObject<HTMLElement | null>;
|
|
928
|
+
/** Ref to the first item's text element (used when no selection for alignItemWithTrigger) */
|
|
929
|
+
firstItemTextRef: React.MutableRefObject<HTMLElement | null>;
|
|
930
|
+
/** Callback to set the trigger element */
|
|
931
|
+
setTriggerElement: (element: HTMLElement | null) => void;
|
|
932
|
+
/** Callback to set the value element */
|
|
933
|
+
setValueElement: (element: HTMLElement | null) => void;
|
|
934
|
+
/** Register a callback to reset positioning state after close animation */
|
|
935
|
+
registerResetPositioningCallback: (callback: (() => void) | null) => () => void;
|
|
932
936
|
}
|
|
933
937
|
/**
|
|
934
938
|
* Hook to access the Select context.
|
|
935
939
|
* Throws if used outside a Select.Root.
|
|
936
940
|
*/
|
|
937
|
-
declare function useSelectContext<Value = unknown>(): SelectContextValue<Value>;
|
|
941
|
+
export declare function useSelectContext<Value = unknown>(): SelectContextValue<Value>;
|
|
938
942
|
/**
|
|
939
943
|
* Hook to optionally access the Select context.
|
|
940
944
|
* Returns null if used outside a Select.Root.
|
|
941
945
|
*/
|
|
942
|
-
declare function useMaybeSelectContext<Value = unknown>(): SelectContextValue<Value> | null;
|
|
943
|
-
|
|
946
|
+
export declare function useMaybeSelectContext<Value = unknown>(): SelectContextValue<Value> | null;
|
|
947
|
+
//#endregion
|
|
948
|
+
//#region src/select/contexts/select-positioner-context.d.ts
|
|
944
949
|
type Side = 'top' | 'bottom' | 'left' | 'right';
|
|
945
950
|
type Align = 'start' | 'center' | 'end';
|
|
946
951
|
/**
|
|
@@ -948,58 +953,60 @@ type Align = 'start' | 'center' | 'end';
|
|
|
948
953
|
* Provides alignment state for coordinating positioning behavior.
|
|
949
954
|
*/
|
|
950
955
|
interface SelectPositionerContextValue {
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
956
|
+
/**
|
|
957
|
+
* Whether alignItemWithTrigger is actively being used.
|
|
958
|
+
* This may be false even if the prop is true (e.g., fallback scenarios).
|
|
959
|
+
*/
|
|
960
|
+
alignItemWithTriggerActive: boolean;
|
|
961
|
+
/**
|
|
962
|
+
* The rendered side of the popup (or 'none' when using align-item-with-trigger).
|
|
963
|
+
*/
|
|
964
|
+
side: Side | 'none';
|
|
965
|
+
/**
|
|
966
|
+
* The rendered alignment of the popup.
|
|
967
|
+
*/
|
|
968
|
+
align: Align;
|
|
969
|
+
/**
|
|
970
|
+
* Ref for the scroll up arrow element.
|
|
971
|
+
*/
|
|
972
|
+
scrollUpArrowRef: React.RefObject<HTMLDivElement | null>;
|
|
973
|
+
/**
|
|
974
|
+
* Ref for the scroll down arrow element.
|
|
975
|
+
*/
|
|
976
|
+
scrollDownArrowRef: React.RefObject<HTMLDivElement | null>;
|
|
977
|
+
/**
|
|
978
|
+
* Callback to disable alignItemWithTrigger (fallback to normal positioning).
|
|
979
|
+
*/
|
|
980
|
+
setAlignItemWithTriggerActive: (active: boolean) => void;
|
|
981
|
+
/**
|
|
982
|
+
* Callback to reset positioning state after close animation completes.
|
|
983
|
+
* This preserves positioning during exit animations.
|
|
984
|
+
*/
|
|
985
|
+
resetPositioningState: () => void;
|
|
981
986
|
}
|
|
982
987
|
/**
|
|
983
988
|
* Hook to access the Select Positioner context.
|
|
984
989
|
* Returns null if used outside a SelectPositioner.
|
|
985
990
|
*/
|
|
986
|
-
declare function useSelectPositionerContext(): SelectPositionerContextValue | null;
|
|
987
|
-
|
|
991
|
+
export declare function useSelectPositionerContext(): SelectPositionerContextValue | null;
|
|
992
|
+
//#endregion
|
|
993
|
+
//#region src/select/item/item-context.d.ts
|
|
988
994
|
interface SelectItemContextValue<Value = unknown> {
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
}
|
|
1002
|
-
declare function useSelectItemContext<Value = unknown>(): SelectItemContextValue<Value>;
|
|
1003
|
-
declare function useMaybeSelectItemContext<Value = unknown>(): SelectItemContextValue<Value> | null;
|
|
1004
|
-
|
|
1005
|
-
export {
|
|
995
|
+
/** Unique ID for this item (for DOM id attribute) */
|
|
996
|
+
id: string;
|
|
997
|
+
/** The value of this item (`null` for a clearable item) */
|
|
998
|
+
value: Value | null;
|
|
999
|
+
/** The text value/label for this item */
|
|
1000
|
+
textValue: string | undefined;
|
|
1001
|
+
/** Whether the item is highlighted */
|
|
1002
|
+
highlighted: boolean;
|
|
1003
|
+
/** Whether the item is disabled */
|
|
1004
|
+
disabled: boolean;
|
|
1005
|
+
/** Whether the item is selected */
|
|
1006
|
+
selected: boolean;
|
|
1007
|
+
}
|
|
1008
|
+
export declare function useSelectItemContext<Value = unknown>(): SelectItemContextValue<Value>;
|
|
1009
|
+
export declare function useMaybeSelectItemContext<Value = unknown>(): SelectItemContextValue<Value> | null;
|
|
1010
|
+
//#endregion
|
|
1011
|
+
export { index_parts_d_exports as Select, type PopupMenuArrow as SelectArrow, type PopupMenuArrowProps as SelectArrowProps, type PopupMenuBackdrop as SelectBackdrop, type PopupMenuBackdropProps as SelectBackdropProps, type SelectContextValue, type PopupMenuEmpty as SelectEmpty, type PopupMenuEmptyProps as SelectEmptyProps, type PopupMenuEmptyState as SelectEmptyState, type FilterFn as SelectFilterFn, type PopupMenuGroup as SelectGroup, type PopupMenuGroupLabel as SelectGroupLabel, type PopupMenuGroupLabelProps as SelectGroupLabelProps, type PopupMenuGroupLabelState as SelectGroupLabelState, type PopupMenuGroupProps as SelectGroupProps, type PopupMenuGroupState as SelectGroupState, type PopupMenuIconProps as SelectIconProps, type PopupMenuIconState as SelectIconState, type PopupMenuInput as SelectInput, type PopupMenuInputProps as SelectInputProps, type PopupMenuInputState as SelectInputState, type SelectItemContextValue, type SelectItemIndicatorProps, type SelectItemIndicatorState, type SelectItemLabelProps, type SelectItemProps, type ItemRegistration as SelectItemRegistration, type SelectItemState, type PopupMenuList as SelectList, type PopupMenuListChildrenState as SelectListChildrenState, PopupMenuListCssVars as SelectListCssVars, type PopupMenuListProps as SelectListProps, type PopupMenuListState as SelectListState, type SelectPopupProps, type SelectPopupState, type PopupMenuPortal as SelectPortal, type PopupMenuPortalProps as SelectPortalProps, type Align as SelectPositionerAlign, type SelectPositionerContextValue, PopupMenuPositionerCssVars as SelectPositionerCssVars, type SelectPositionerProps, type Side as SelectPositionerSide, type SelectRootProps, type PopupMenuScrollArrowProps as SelectScrollArrowProps, type PopupMenuScrollArrowState as SelectScrollArrowState, type PopupMenuScrollDownArrowProps as SelectScrollDownArrowProps, type PopupMenuScrollUpArrowProps as SelectScrollUpArrowProps, type PopupMenuSeparator as SelectSeparator, type PopupMenuSeparatorProps as SelectSeparatorProps, type PopupMenuSeparatorState as SelectSeparatorState, ListboxStore as SelectStore, type ListboxContext as SelectStoreContext, type ListboxState as SelectStoreState, type SelectSurfaceProps, type PopupMenuSurfaceState as SelectSurfaceState, type SelectTriggerProps, type SelectTriggerState, type SelectValueProps, type SelectValueState, type VirtualItem as SelectVirtualItem, type SurfaceContextValue, commandScore, defaultFilter, useMaybeSurfaceContext, useSurfaceContext };
|
|
1012
|
+
//# sourceMappingURL=index.d.ts.map
|