@tamagui/select 1.0.1-beta.21 → 1.0.1-beta.211
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/cjs/BubbleSelect.js +43 -0
- package/dist/cjs/BubbleSelect.js.map +7 -0
- package/dist/cjs/Select.js +412 -390
- package/dist/cjs/Select.js.map +3 -3
- package/dist/cjs/SelectContent.js +72 -0
- package/dist/cjs/SelectContent.js.map +7 -0
- package/dist/cjs/SelectContent.native.js +31 -0
- package/dist/cjs/SelectContent.native.js.map +7 -0
- package/dist/cjs/SelectImpl.js +286 -0
- package/dist/cjs/SelectImpl.js.map +7 -0
- package/dist/cjs/SelectScrollButton.js +157 -0
- package/dist/cjs/SelectScrollButton.js.map +7 -0
- package/dist/cjs/SelectScrollButton.native.js +32 -0
- package/dist/cjs/SelectScrollButton.native.js.map +7 -0
- package/dist/cjs/SelectViewport.js +126 -0
- package/dist/cjs/SelectViewport.js.map +7 -0
- package/dist/cjs/SelectViewport.native.js +41 -0
- package/dist/cjs/SelectViewport.native.js.map +7 -0
- package/dist/cjs/constants.js +47 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/context.js +49 -0
- package/dist/cjs/context.js.map +7 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/types.js +17 -0
- package/dist/cjs/types.js.map +7 -0
- package/dist/cjs/useSelectBreakpointActive.js +39 -0
- package/dist/cjs/useSelectBreakpointActive.js.map +7 -0
- package/dist/esm/BubbleSelect.js +24 -0
- package/dist/esm/BubbleSelect.js.map +7 -0
- package/dist/esm/Select.js +403 -358
- package/dist/esm/Select.js.map +3 -3
- package/dist/esm/SelectContent.js +48 -0
- package/dist/esm/SelectContent.js.map +7 -0
- package/dist/esm/SelectContent.native.js +7 -0
- package/dist/esm/SelectContent.native.js.map +7 -0
- package/dist/esm/SelectImpl.js +271 -0
- package/dist/esm/SelectImpl.js.map +7 -0
- package/dist/esm/SelectScrollButton.js +126 -0
- package/dist/esm/SelectScrollButton.js.map +7 -0
- package/dist/esm/SelectScrollButton.native.js +7 -0
- package/dist/esm/SelectScrollButton.native.js.map +7 -0
- package/dist/esm/SelectViewport.js +95 -0
- package/dist/esm/SelectViewport.js.map +7 -0
- package/dist/esm/SelectViewport.native.js +17 -0
- package/dist/esm/SelectViewport.native.js.map +7 -0
- package/dist/esm/constants.js +17 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/context.js +21 -0
- package/dist/esm/context.js.map +7 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/types.js +1 -0
- package/dist/esm/types.js.map +7 -0
- package/dist/esm/useSelectBreakpointActive.js +14 -0
- package/dist/esm/useSelectBreakpointActive.js.map +7 -0
- package/dist/jsx/BubbleSelect.js +24 -0
- package/dist/jsx/BubbleSelect.js.map +7 -0
- package/dist/jsx/Select.js +283 -271
- package/dist/jsx/Select.js.map +7 -0
- package/dist/jsx/SelectContent.js +27 -0
- package/dist/jsx/SelectContent.js.map +7 -0
- package/dist/jsx/SelectContent.native.js +7 -0
- package/dist/jsx/SelectContent.native.js.map +7 -0
- package/dist/jsx/SelectImpl.js +244 -0
- package/dist/jsx/SelectImpl.js.map +7 -0
- package/dist/jsx/SelectScrollButton.js +99 -0
- package/dist/jsx/SelectScrollButton.js.map +7 -0
- package/dist/jsx/SelectScrollButton.native.js +7 -0
- package/dist/jsx/SelectScrollButton.native.js.map +7 -0
- package/dist/jsx/SelectViewport.js +72 -0
- package/dist/jsx/SelectViewport.js.map +7 -0
- package/dist/jsx/SelectViewport.native.js +13 -0
- package/dist/jsx/SelectViewport.native.js.map +7 -0
- package/dist/jsx/constants.js +17 -0
- package/dist/jsx/constants.js.map +7 -0
- package/dist/jsx/context.js +15 -0
- package/dist/jsx/context.js.map +7 -0
- package/dist/jsx/index.js +2 -0
- package/dist/jsx/index.js.map +7 -0
- package/dist/jsx/types.js +1 -0
- package/dist/jsx/types.js.map +7 -0
- package/dist/jsx/useSelectBreakpointActive.js +14 -0
- package/dist/jsx/useSelectBreakpointActive.js.map +7 -0
- package/package.json +26 -16
- package/src/BubbleSelect.tsx +46 -0
- package/src/Select.tsx +618 -0
- package/src/SelectContent.native.tsx +5 -0
- package/src/SelectContent.tsx +45 -0
- package/src/SelectImpl.tsx +342 -0
- package/src/SelectScrollButton.native.tsx +7 -0
- package/src/SelectScrollButton.tsx +168 -0
- package/src/SelectViewport.native.tsx +14 -0
- package/src/SelectViewport.tsx +104 -0
- package/src/constants.tsx +7 -0
- package/src/context.tsx +19 -0
- package/src/index.tsx +8 -0
- package/src/types.tsx +94 -0
- package/src/useSelectBreakpointActive.tsx +15 -0
- package/types/BubbleSelect.d.ts +2 -0
- package/types/Select.d.ts +753 -0
- package/types/SelectContent.d.ts +5 -0
- package/types/SelectContent.native.d.ts +4 -0
- package/types/SelectImpl.d.ts +9 -0
- package/types/SelectScrollButton.d.ts +6 -0
- package/types/SelectScrollButton.native.d.ts +4 -0
- package/types/SelectViewport.d.ts +127 -0
- package/types/SelectViewport.native.d.ts +7 -0
- package/types/constants.d.ts +8 -0
- package/types/context.d.ts +21 -0
- package/types/index.d.ts +2 -0
- package/types/types.d.ts +84 -0
- package/types/useSelectBreakpointActive.d.ts +4 -0
- package/types/index.d.ts.map +0 -1
package/dist/cjs/Select.js
CHANGED
|
@@ -1,39 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
25
|
-
var __objRest = (source, exclude) => {
|
|
26
|
-
var target = {};
|
|
27
|
-
for (var prop in source)
|
|
28
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
if (source != null && __getOwnPropSymbols)
|
|
31
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
-
target[prop] = source[prop];
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
};
|
|
37
8
|
var __export = (target, all) => {
|
|
38
9
|
for (var name in all)
|
|
39
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -46,406 +17,457 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
46
17
|
}
|
|
47
18
|
return to;
|
|
48
19
|
};
|
|
49
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
50
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
51
25
|
var Select_exports = {};
|
|
52
26
|
__export(Select_exports, {
|
|
53
27
|
Select: () => Select,
|
|
54
|
-
|
|
55
|
-
SelectGroup: () => SelectGroup,
|
|
28
|
+
SelectGroupFrame: () => SelectGroupFrame,
|
|
56
29
|
SelectIcon: () => SelectIcon,
|
|
57
30
|
SelectItem: () => SelectItem,
|
|
58
|
-
|
|
59
|
-
SelectItemText: () => SelectItemText,
|
|
60
|
-
SelectLabel: () => SelectLabel,
|
|
61
|
-
SelectScrollDownButton: () => SelectScrollDownButton,
|
|
62
|
-
SelectScrollUpButton: () => SelectScrollUpButton,
|
|
31
|
+
SelectItemTextFrame: () => SelectItemTextFrame,
|
|
63
32
|
SelectSeparator: () => SelectSeparator,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
createSelectScope: () => createSelectScope
|
|
33
|
+
SelectSheetContents: () => SelectSheetContents,
|
|
34
|
+
SelectTrigger: () => SelectTrigger
|
|
67
35
|
});
|
|
68
36
|
module.exports = __toCommonJS(Select_exports);
|
|
69
|
-
var
|
|
70
|
-
var import_react_use_previous = require("@radix-ui/react-use-previous");
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
71
38
|
var import_compose_refs = require("@tamagui/compose-refs");
|
|
72
39
|
var import_core = require("@tamagui/core");
|
|
73
40
|
var import_core2 = require("@tamagui/core");
|
|
74
|
-
var
|
|
41
|
+
var import_core3 = require("@tamagui/core");
|
|
42
|
+
var import_list_item = require("@tamagui/list-item");
|
|
43
|
+
var import_portal = require("@tamagui/portal");
|
|
75
44
|
var import_separator = require("@tamagui/separator");
|
|
45
|
+
var import_sheet = require("@tamagui/sheet");
|
|
76
46
|
var import_stacks = require("@tamagui/stacks");
|
|
47
|
+
var import_text = require("@tamagui/text");
|
|
77
48
|
var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
78
49
|
var React = __toESM(require("react"));
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const MIN_HEIGHT = 80;
|
|
87
|
-
const FALLBACK_THRESHOLD = 16;
|
|
88
|
-
const [createSelectContext, createSelectScope] = (0, import_create_context.createContextScope)(SELECT_NAME);
|
|
89
|
-
const [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME);
|
|
90
|
-
const Select = /* @__PURE__ */ __name((props) => {
|
|
91
|
-
const {
|
|
92
|
-
__scopeSelect,
|
|
93
|
-
children,
|
|
94
|
-
open: openProp,
|
|
95
|
-
defaultOpen,
|
|
96
|
-
onOpenChange,
|
|
97
|
-
value: valueProp,
|
|
98
|
-
defaultValue,
|
|
99
|
-
onValueChange,
|
|
100
|
-
dir: dir2,
|
|
101
|
-
name,
|
|
102
|
-
autoComplete
|
|
103
|
-
} = props;
|
|
104
|
-
const [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
105
|
-
prop: openProp,
|
|
106
|
-
defaultProp: defaultOpen || false,
|
|
107
|
-
onChange: onOpenChange
|
|
108
|
-
});
|
|
109
|
-
const [value, setValue] = (0, import_use_controllable_state.useControllableState)({
|
|
110
|
-
prop: valueProp,
|
|
111
|
-
defaultProp: defaultValue || "",
|
|
112
|
-
onChange: onValueChange
|
|
113
|
-
});
|
|
114
|
-
const selectedIndexRef = React.useRef(null);
|
|
115
|
-
const activeIndexRef = React.useRef(null);
|
|
116
|
-
const prevActiveIndex = (0, import_react_use_previous.usePrevious)(activeIndex);
|
|
117
|
-
const [showArrows, setShowArrows] = React.useState(false);
|
|
118
|
-
const [scrollTop, setScrollTop] = React.useState(0);
|
|
119
|
-
const [activeIndex, setActiveIndex] = React.useState(null);
|
|
120
|
-
const [selectedIndex, setSelectedIndex] = React.useState(Math.max(0, listContentRef.current.indexOf(value)));
|
|
121
|
-
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
122
|
-
selectedIndexRef.current = selectedIndex;
|
|
123
|
-
activeIndexRef.current = activeIndex;
|
|
124
|
-
});
|
|
125
|
-
useEffect(() => {
|
|
126
|
-
const frame = requestAnimationFrame(() => {
|
|
127
|
-
setShowArrows(open);
|
|
128
|
-
if (!open) {
|
|
129
|
-
setScrollTop(0);
|
|
130
|
-
setMiddlewareType("align");
|
|
131
|
-
setActiveIndex(null);
|
|
132
|
-
setControlledScrolling(false);
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
return () => cancelAnimationFrame(frame);
|
|
136
|
-
}, [open]);
|
|
137
|
-
const showUpArrow = showArrows && scrollTop > SCROLL_ARROW_THRESHOLD;
|
|
138
|
-
const showDownArrow = showArrows && floatingRef.current && scrollTop < floatingRef.current.scrollHeight - floatingRef.current.clientHeight - SCROLL_ARROW_THRESHOLD;
|
|
139
|
-
return /* @__PURE__ */ React.createElement(SelectProvider, {
|
|
140
|
-
scope: __scopeSelect,
|
|
141
|
-
open
|
|
142
|
-
}, children);
|
|
143
|
-
}, "Select");
|
|
144
|
-
Select.displayName = SELECT_NAME;
|
|
50
|
+
var import_constants = require("./constants");
|
|
51
|
+
var import_context = require("./context");
|
|
52
|
+
var import_SelectContent = require("./SelectContent");
|
|
53
|
+
var import_SelectImpl = require("./SelectImpl");
|
|
54
|
+
var import_SelectScrollButton = require("./SelectScrollButton");
|
|
55
|
+
var import_SelectViewport = require("./SelectViewport");
|
|
56
|
+
var import_useSelectBreakpointActive = require("./useSelectBreakpointActive");
|
|
145
57
|
const TRIGGER_NAME = "SelectTrigger";
|
|
146
|
-
const SelectTrigger = React.forwardRef(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
event.target.releasePointerCapture(event.pointerId);
|
|
179
|
-
if (event.button === 0 && event.ctrlKey === false) {
|
|
180
|
-
handleOpen();
|
|
181
|
-
context.triggerPointerDownPosRef.current = {
|
|
182
|
-
x: Math.round(event.pageX),
|
|
183
|
-
y: Math.round(event.pageY)
|
|
184
|
-
};
|
|
185
|
-
event.preventDefault();
|
|
186
|
-
}
|
|
187
|
-
}),
|
|
188
|
-
onKeyDown: (0, import_core.composeEventHandlers)(triggerProps.onKeyDown, (event) => {
|
|
189
|
-
const isTypingAhead = searchRef.current !== "";
|
|
190
|
-
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
191
|
-
if (!isModifierKey && event.key.length === 1)
|
|
192
|
-
handleTypeaheadSearch(event.key);
|
|
193
|
-
if (isTypingAhead && event.key === " ")
|
|
194
|
-
return;
|
|
195
|
-
if (OPEN_KEYS.includes(event.key)) {
|
|
196
|
-
handleOpen();
|
|
197
|
-
event.preventDefault();
|
|
58
|
+
const SelectTrigger = React.forwardRef(
|
|
59
|
+
(props, forwardedRef) => {
|
|
60
|
+
const {
|
|
61
|
+
__scopeSelect,
|
|
62
|
+
disabled = false,
|
|
63
|
+
"aria-labelledby": ariaLabelledby,
|
|
64
|
+
...triggerProps
|
|
65
|
+
} = props;
|
|
66
|
+
const context = (0, import_context.useSelectContext)(TRIGGER_NAME, __scopeSelect);
|
|
67
|
+
const labelledBy = ariaLabelledby;
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_list_item.ListItem, {
|
|
69
|
+
componentName: TRIGGER_NAME,
|
|
70
|
+
backgrounded: true,
|
|
71
|
+
radiused: true,
|
|
72
|
+
hoverTheme: true,
|
|
73
|
+
pressTheme: true,
|
|
74
|
+
focusTheme: true,
|
|
75
|
+
focusable: true,
|
|
76
|
+
borderWidth: 1,
|
|
77
|
+
size: context.size,
|
|
78
|
+
"aria-expanded": context.open,
|
|
79
|
+
"aria-autocomplete": "none",
|
|
80
|
+
"aria-labelledby": labelledBy,
|
|
81
|
+
dir: context.dir,
|
|
82
|
+
disabled,
|
|
83
|
+
"data-disabled": disabled ? "" : void 0,
|
|
84
|
+
...triggerProps,
|
|
85
|
+
ref: forwardedRef,
|
|
86
|
+
...process.env.TAMAGUI_TARGET === "web" && context.interactions ? context.interactions.getReferenceProps() : {
|
|
87
|
+
onPress() {
|
|
88
|
+
context.setOpen(!context.open);
|
|
89
|
+
}
|
|
198
90
|
}
|
|
199
|
-
})
|
|
200
|
-
}
|
|
201
|
-
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
);
|
|
202
94
|
SelectTrigger.displayName = TRIGGER_NAME;
|
|
203
95
|
const VALUE_NAME = "SelectValue";
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
pointerEvents: "none"
|
|
208
|
-
}));
|
|
209
|
-
});
|
|
210
|
-
const ICON_NAME = "SelectIcon";
|
|
211
|
-
const SelectIcon = React.forwardRef((props, forwardedRef) => {
|
|
212
|
-
const _a = props, { __scopeSelect, children } = _a, iconProps = __objRest(_a, ["__scopeSelect", "children"]);
|
|
213
|
-
return /* @__PURE__ */ React.createElement(import_stacks.XStack, __spreadProps(__spreadValues({
|
|
214
|
-
"aria-hidden": true
|
|
215
|
-
}, iconProps), {
|
|
216
|
-
ref: forwardedRef
|
|
217
|
-
}), children || "\u25BC");
|
|
96
|
+
const SelectValueFrame = (0, import_core2.styled)(import_text.Paragraph, {
|
|
97
|
+
name: VALUE_NAME,
|
|
98
|
+
selectable: false
|
|
218
99
|
});
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
const
|
|
226
|
-
const
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}, labelProps), {
|
|
248
|
-
ref: forwardedRef
|
|
249
|
-
}));
|
|
100
|
+
const SelectValue = SelectValueFrame.extractable(
|
|
101
|
+
React.forwardRef(
|
|
102
|
+
({ __scopeSelect, children: childrenProp, placeholder }, forwardedRef) => {
|
|
103
|
+
const context = (0, import_context.useSelectContext)(VALUE_NAME, __scopeSelect);
|
|
104
|
+
const { onValueNodeHasChildrenChange } = context;
|
|
105
|
+
const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.onValueNodeChange);
|
|
106
|
+
const children = childrenProp ?? context.selectedItem;
|
|
107
|
+
const hasChildren = !!children;
|
|
108
|
+
const selectValueChildren = context.value === void 0 && placeholder !== void 0 ? placeholder : children;
|
|
109
|
+
(0, import_core2.useIsomorphicLayoutEffect)(() => {
|
|
110
|
+
onValueNodeHasChildrenChange(hasChildren);
|
|
111
|
+
}, [onValueNodeHasChildrenChange, hasChildren]);
|
|
112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectValueFrame, {
|
|
113
|
+
size: context.size,
|
|
114
|
+
ref: composedRefs,
|
|
115
|
+
pointerEvents: "none",
|
|
116
|
+
children: selectValueChildren
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
SelectValue.displayName = VALUE_NAME;
|
|
122
|
+
const SelectIcon = (0, import_core2.styled)(import_stacks.XStack, {
|
|
123
|
+
name: "SelectIcon",
|
|
124
|
+
"aria-hidden": true,
|
|
125
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_text.Paragraph, {
|
|
126
|
+
children: "\u25BC"
|
|
127
|
+
})
|
|
250
128
|
});
|
|
251
|
-
SelectLabel.displayName = LABEL_NAME;
|
|
252
129
|
const ITEM_NAME = "SelectItem";
|
|
253
|
-
const [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);
|
|
254
|
-
const SelectItem = React.forwardRef(
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
"data-disabled": disabled ? "" : void 0,
|
|
289
|
-
tabIndex: disabled ? void 0 : -1
|
|
290
|
-
}, itemProps), {
|
|
291
|
-
ref: composedRefs,
|
|
292
|
-
onFocus: (0, import_core.composeEventHandlers)(itemProps.onFocus, () => setIsFocused(true)),
|
|
293
|
-
onBlur: (0, import_core.composeEventHandlers)(itemProps.onBlur, () => setIsFocused(false)),
|
|
294
|
-
onPointerUp: (0, import_core.composeEventHandlers)(itemProps.onPointerUp, handleSelect),
|
|
295
|
-
onPointerMove: (0, import_core.composeEventHandlers)(itemProps.onPointerMove, (event) => {
|
|
296
|
-
if (disabled) {
|
|
297
|
-
contentContext.onItemLeave();
|
|
298
|
-
} else {
|
|
299
|
-
event.currentTarget.focus({ preventScroll: true });
|
|
130
|
+
const [SelectItemContextProvider, useSelectItemContext] = (0, import_context.createSelectContext)(ITEM_NAME);
|
|
131
|
+
const SelectItem = React.forwardRef(
|
|
132
|
+
(props, forwardedRef) => {
|
|
133
|
+
const {
|
|
134
|
+
__scopeSelect,
|
|
135
|
+
value,
|
|
136
|
+
disabled = false,
|
|
137
|
+
textValue: textValueProp,
|
|
138
|
+
index,
|
|
139
|
+
...itemProps
|
|
140
|
+
} = props;
|
|
141
|
+
const context = (0, import_context.useSelectContext)(ITEM_NAME, __scopeSelect);
|
|
142
|
+
const isSelected = context.value === value;
|
|
143
|
+
const textId = (0, import_core3.useId)();
|
|
144
|
+
const {
|
|
145
|
+
selectedIndex,
|
|
146
|
+
setSelectedIndex,
|
|
147
|
+
listRef,
|
|
148
|
+
open,
|
|
149
|
+
setOpen,
|
|
150
|
+
onChange,
|
|
151
|
+
setActiveIndex,
|
|
152
|
+
allowMouseUpRef,
|
|
153
|
+
allowSelectRef,
|
|
154
|
+
setValueAtIndex,
|
|
155
|
+
selectTimeoutRef,
|
|
156
|
+
dataRef
|
|
157
|
+
} = context;
|
|
158
|
+
const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, (node) => {
|
|
159
|
+
if (!import_core.isWeb)
|
|
160
|
+
return;
|
|
161
|
+
if (node instanceof HTMLElement) {
|
|
162
|
+
if (listRef) {
|
|
163
|
+
listRef.current[index] = node;
|
|
164
|
+
}
|
|
300
165
|
}
|
|
301
|
-
})
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
166
|
+
});
|
|
167
|
+
React.useEffect(() => {
|
|
168
|
+
setValueAtIndex(index, value);
|
|
169
|
+
}, [index, setValueAtIndex, value]);
|
|
170
|
+
function handleSelect() {
|
|
171
|
+
setSelectedIndex(index);
|
|
172
|
+
onChange(value);
|
|
173
|
+
setOpen(false);
|
|
174
|
+
}
|
|
175
|
+
const selectItemProps = context.interactions ? context.interactions.getItemProps({
|
|
176
|
+
onTouchStart() {
|
|
177
|
+
allowSelectRef.current = true;
|
|
178
|
+
allowMouseUpRef.current = false;
|
|
179
|
+
},
|
|
180
|
+
onKeyDown(event) {
|
|
181
|
+
if (event.key === "Enter" || event.key === " " && !(dataRef == null ? void 0 : dataRef.current.typing)) {
|
|
182
|
+
event.preventDefault();
|
|
183
|
+
handleSelect();
|
|
184
|
+
} else {
|
|
185
|
+
allowSelectRef.current = true;
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
onClick() {
|
|
189
|
+
if (allowSelectRef.current) {
|
|
190
|
+
setSelectedIndex(index);
|
|
191
|
+
setOpen(false);
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
onMouseUp() {
|
|
195
|
+
if (!allowMouseUpRef.current) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (allowSelectRef.current) {
|
|
199
|
+
handleSelect();
|
|
200
|
+
}
|
|
201
|
+
clearTimeout(selectTimeoutRef.current);
|
|
202
|
+
selectTimeoutRef.current = setTimeout(() => {
|
|
203
|
+
allowSelectRef.current = true;
|
|
204
|
+
});
|
|
305
205
|
}
|
|
306
|
-
})
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
206
|
+
}) : {
|
|
207
|
+
onPress: handleSelect
|
|
208
|
+
};
|
|
209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItemContextProvider, {
|
|
210
|
+
scope: __scopeSelect,
|
|
211
|
+
value,
|
|
212
|
+
textId: textId || "",
|
|
213
|
+
isSelected,
|
|
214
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_list_item.ListItem, {
|
|
215
|
+
backgrounded: true,
|
|
216
|
+
pressTheme: true,
|
|
217
|
+
cursor: "",
|
|
218
|
+
focusTheme: true,
|
|
219
|
+
componentName: ITEM_NAME,
|
|
220
|
+
ref: composedRefs,
|
|
221
|
+
"aria-labelledby": textId,
|
|
222
|
+
"aria-selected": isSelected,
|
|
223
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
224
|
+
"aria-disabled": disabled || void 0,
|
|
225
|
+
"data-disabled": disabled ? "" : void 0,
|
|
226
|
+
tabIndex: disabled ? void 0 : -1,
|
|
227
|
+
size: context.size,
|
|
228
|
+
...itemProps,
|
|
229
|
+
...selectItemProps
|
|
230
|
+
})
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
);
|
|
318
234
|
SelectItem.displayName = ITEM_NAME;
|
|
319
235
|
const ITEM_TEXT_NAME = "SelectItemText";
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
324
|
-
const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
325
|
-
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
326
|
-
const ref = React.useRef(null);
|
|
327
|
-
const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref, itemContext.onItemTextChange, itemContext.isSelected ? contentContext.onSelectedItemTextChange : void 0);
|
|
328
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Primitive.span, __spreadProps(__spreadValues({
|
|
329
|
-
id: itemContext.textId
|
|
330
|
-
}, itemTextProps), {
|
|
331
|
-
ref: composedRefs
|
|
332
|
-
})), itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM.createPortal(itemTextProps.children, context.valueNode) : null, context.bubbleSelect ? ReactDOM.createPortal(/* @__PURE__ */ React.createElement("option", {
|
|
333
|
-
value: itemContext.value
|
|
334
|
-
}, (_b = ref.current) == null ? void 0 : _b.textContent), context.bubbleSelect) : null);
|
|
236
|
+
const SelectItemTextFrame = (0, import_core2.styled)(import_text.Paragraph, {
|
|
237
|
+
name: ITEM_TEXT_NAME,
|
|
238
|
+
selectable: false
|
|
335
239
|
});
|
|
240
|
+
const SelectItemText = React.forwardRef(
|
|
241
|
+
(props, forwardedRef) => {
|
|
242
|
+
const { __scopeSelect, className, ...itemTextProps } = props;
|
|
243
|
+
const context = (0, import_context.useSelectContext)(ITEM_TEXT_NAME, __scopeSelect);
|
|
244
|
+
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
245
|
+
const ref = React.useRef(null);
|
|
246
|
+
const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref);
|
|
247
|
+
const isSelected = Boolean(itemContext.isSelected && context.valueNode);
|
|
248
|
+
const contents = React.useMemo(
|
|
249
|
+
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItemTextFrame, {
|
|
250
|
+
className,
|
|
251
|
+
size: context.size,
|
|
252
|
+
id: itemContext.textId,
|
|
253
|
+
...itemTextProps,
|
|
254
|
+
ref: composedRefs
|
|
255
|
+
}),
|
|
256
|
+
[props, context.size, className, itemContext.textId]
|
|
257
|
+
);
|
|
258
|
+
React.useEffect(() => {
|
|
259
|
+
if (isSelected) {
|
|
260
|
+
context.setSelectedItem(contents);
|
|
261
|
+
}
|
|
262
|
+
}, [isSelected, contents]);
|
|
263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
264
|
+
children: contents
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
);
|
|
336
268
|
SelectItemText.displayName = ITEM_TEXT_NAME;
|
|
337
269
|
const ITEM_INDICATOR_NAME = "SelectItemIndicator";
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
|
|
341
|
-
return itemContext.isSelected ? /* @__PURE__ */ React.createElement(Primitive.span, __spreadProps(__spreadValues({
|
|
342
|
-
"aria-hidden": true
|
|
343
|
-
}, itemIndicatorProps), {
|
|
344
|
-
ref: forwardedRef
|
|
345
|
-
})) : null;
|
|
270
|
+
const SelectItemIndicatorFrame = (0, import_core2.styled)(import_stacks.XStack, {
|
|
271
|
+
name: ITEM_TEXT_NAME
|
|
346
272
|
});
|
|
273
|
+
const SelectItemIndicator = React.forwardRef(
|
|
274
|
+
(props, forwardedRef) => {
|
|
275
|
+
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
276
|
+
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
|
|
277
|
+
return itemContext.isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItemIndicatorFrame, {
|
|
278
|
+
"aria-hidden": true,
|
|
279
|
+
...itemIndicatorProps,
|
|
280
|
+
ref: forwardedRef
|
|
281
|
+
}) : null;
|
|
282
|
+
}
|
|
283
|
+
);
|
|
347
284
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
348
|
-
const
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
return canScrollUp ? /* @__PURE__ */ React.createElement(SelectScrollButtonImpl, __spreadProps(__spreadValues({}, props), {
|
|
354
|
-
ref: composedRefs,
|
|
355
|
-
onAutoScroll: () => {
|
|
356
|
-
const { viewport, selectedItem } = contentContext;
|
|
357
|
-
if (viewport && selectedItem) {
|
|
358
|
-
viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
})) : null;
|
|
285
|
+
const GROUP_NAME = "SelectGroup";
|
|
286
|
+
const [SelectGroupContextProvider, useSelectGroupContext] = (0, import_context.createSelectContext)(GROUP_NAME);
|
|
287
|
+
const SelectGroupFrame = (0, import_core2.styled)(import_stacks.YStack, {
|
|
288
|
+
name: GROUP_NAME,
|
|
289
|
+
width: "100%"
|
|
362
290
|
});
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
291
|
+
const SelectGroup = React.forwardRef(
|
|
292
|
+
(props, forwardedRef) => {
|
|
293
|
+
const { __scopeSelect, ...groupProps } = props;
|
|
294
|
+
const groupId = (0, import_core3.useId)();
|
|
295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectGroupContextProvider, {
|
|
296
|
+
scope: __scopeSelect,
|
|
297
|
+
id: groupId || "",
|
|
298
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectGroupFrame, {
|
|
299
|
+
role: "group",
|
|
300
|
+
"aria-labelledby": groupId,
|
|
301
|
+
...groupProps,
|
|
302
|
+
ref: forwardedRef
|
|
303
|
+
})
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
SelectGroup.displayName = GROUP_NAME;
|
|
308
|
+
const LABEL_NAME = "SelectLabel";
|
|
309
|
+
const SelectLabel = React.forwardRef(
|
|
310
|
+
(props, forwardedRef) => {
|
|
311
|
+
const { __scopeSelect, ...labelProps } = props;
|
|
312
|
+
const context = (0, import_context.useSelectContext)(LABEL_NAME, __scopeSelect);
|
|
313
|
+
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
|
314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_list_item.ListItem, {
|
|
315
|
+
componentName: LABEL_NAME,
|
|
316
|
+
fontWeight: "800",
|
|
317
|
+
id: groupContext.id,
|
|
318
|
+
size: context.size,
|
|
319
|
+
...labelProps,
|
|
320
|
+
ref: forwardedRef
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
SelectLabel.displayName = LABEL_NAME;
|
|
325
|
+
const SelectSeparator = (0, import_core2.styled)(import_separator.Separator, {
|
|
326
|
+
name: "SelectSeparator"
|
|
378
327
|
});
|
|
379
|
-
|
|
380
|
-
const
|
|
381
|
-
const
|
|
382
|
-
const
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
placement: dir === "up" ? "top" : "bottom",
|
|
389
|
-
middleware: [(0, import_react_dom_interactions.offset)(({ floating: floating2 }) => -floating2.height)]
|
|
390
|
-
});
|
|
391
|
-
return /* @__PURE__ */ React.createElement(Primitive.div, __spreadProps(__spreadValues({
|
|
392
|
-
"aria-hidden": true
|
|
393
|
-
}, scrollIndicatorProps), {
|
|
394
|
-
ref: forwardedRef,
|
|
395
|
-
style: __spreadValues({ flexShrink: 0 }, scrollIndicatorProps.style),
|
|
396
|
-
onPointerMove: (0, import_core.composeEventHandlers)(scrollIndicatorProps.onPointerMove, () => {
|
|
397
|
-
contentContext.onItemLeave();
|
|
398
|
-
if (autoScrollTimerRef.current === null) {
|
|
399
|
-
autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
|
328
|
+
const SelectSheetController = (props) => {
|
|
329
|
+
const context = (0, import_context.useSelectContext)("SelectSheetController", props.__scopeSelect);
|
|
330
|
+
const showSheet = (0, import_useSelectBreakpointActive.useShowSelectSheet)(context);
|
|
331
|
+
const breakpointActive = (0, import_useSelectBreakpointActive.useSelectBreakpointActive)(context.sheetBreakpoint);
|
|
332
|
+
const getShowSheet = (0, import_core2.useGet)(showSheet);
|
|
333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sheet.SheetController, {
|
|
334
|
+
onOpenChange: (val) => {
|
|
335
|
+
if (getShowSheet()) {
|
|
336
|
+
props.onOpenChange(val);
|
|
400
337
|
}
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
})
|
|
406
|
-
}
|
|
407
|
-
const
|
|
408
|
-
const
|
|
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
|
-
|
|
338
|
+
},
|
|
339
|
+
open: context.open,
|
|
340
|
+
hidden: breakpointActive === false,
|
|
341
|
+
children: props.children
|
|
342
|
+
});
|
|
343
|
+
};
|
|
344
|
+
const SHEET_CONTENTS_NAME = "SelectSheetContents";
|
|
345
|
+
const SelectSheetContents = ({ __scopeSelect }) => {
|
|
346
|
+
const context = (0, import_context.useSelectContext)(SHEET_CONTENTS_NAME, __scopeSelect);
|
|
347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.PortalHost, {
|
|
348
|
+
name: `${context.scopeKey}SheetContents`
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
SelectSheetContents.displayName = SHEET_CONTENTS_NAME;
|
|
352
|
+
const SelectSheetImpl = (props) => {
|
|
353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
354
|
+
children: props.children
|
|
355
|
+
});
|
|
356
|
+
};
|
|
357
|
+
const Select = (0, import_core2.withStaticProperties)(
|
|
358
|
+
(props) => {
|
|
359
|
+
const {
|
|
360
|
+
__scopeSelect,
|
|
361
|
+
children,
|
|
362
|
+
open: openProp,
|
|
363
|
+
defaultOpen,
|
|
364
|
+
onOpenChange,
|
|
365
|
+
value: valueProp,
|
|
366
|
+
defaultValue,
|
|
367
|
+
onValueChange,
|
|
368
|
+
size: sizeProp = "$4",
|
|
369
|
+
sheetBreakpoint = false,
|
|
370
|
+
dir
|
|
371
|
+
} = props;
|
|
372
|
+
const isSheet = (0, import_useSelectBreakpointActive.useSelectBreakpointActive)(sheetBreakpoint);
|
|
373
|
+
const SelectImpl = isSheet ? SelectSheetImpl : import_SelectImpl.SelectInlineImpl;
|
|
374
|
+
const forceUpdate = React.useReducer(() => ({}), {})[1];
|
|
375
|
+
const [selectedItem, setSelectedItem] = React.useState(null);
|
|
376
|
+
const [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
377
|
+
prop: openProp,
|
|
378
|
+
defaultProp: defaultOpen || false,
|
|
379
|
+
onChange: onOpenChange,
|
|
380
|
+
strategy: "most-recent-wins"
|
|
381
|
+
});
|
|
382
|
+
const [value, setValue] = (0, import_use_controllable_state.useControllableState)({
|
|
383
|
+
prop: valueProp,
|
|
384
|
+
defaultProp: defaultValue || "",
|
|
385
|
+
onChange: onValueChange,
|
|
386
|
+
strategy: "most-recent-wins"
|
|
387
|
+
});
|
|
388
|
+
const [activeIndex, setActiveIndex] = React.useState(null);
|
|
389
|
+
const selectedIndexRef = React.useRef(null);
|
|
390
|
+
const activeIndexRef = React.useRef(null);
|
|
391
|
+
const listContentRef = React.useRef([]);
|
|
392
|
+
const [selectedIndex, setSelectedIndex] = React.useState(
|
|
393
|
+
Math.max(0, listContentRef.current.indexOf(value))
|
|
394
|
+
);
|
|
395
|
+
const [valueNode, setValueNode] = React.useState(null);
|
|
396
|
+
const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);
|
|
397
|
+
(0, import_core2.useIsomorphicLayoutEffect)(() => {
|
|
398
|
+
selectedIndexRef.current = selectedIndex;
|
|
399
|
+
activeIndexRef.current = activeIndex;
|
|
400
|
+
});
|
|
401
|
+
const id = (0, import_core3.useId)();
|
|
402
|
+
const scopeKey = __scopeSelect ? Object.keys(__scopeSelect)[0] ?? id : id;
|
|
403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.SelectProvider, {
|
|
404
|
+
dir,
|
|
405
|
+
blockSelection: false,
|
|
406
|
+
size: sizeProp,
|
|
407
|
+
fallback: false,
|
|
408
|
+
selectedItem,
|
|
409
|
+
setSelectedItem,
|
|
410
|
+
forceUpdate,
|
|
411
|
+
valueNode,
|
|
412
|
+
onValueNodeChange: setValueNode,
|
|
413
|
+
onValueNodeHasChildrenChange: setValueNodeHasChildren,
|
|
414
|
+
valueNodeHasChildren,
|
|
415
|
+
scopeKey,
|
|
416
|
+
sheetBreakpoint,
|
|
417
|
+
scope: __scopeSelect,
|
|
418
|
+
setValueAtIndex: (index, value2) => {
|
|
419
|
+
listContentRef.current[index] = value2;
|
|
420
|
+
},
|
|
421
|
+
activeIndex,
|
|
422
|
+
onChange: setValue,
|
|
423
|
+
selectedIndex,
|
|
424
|
+
setActiveIndex,
|
|
425
|
+
setOpen,
|
|
426
|
+
setSelectedIndex,
|
|
427
|
+
value,
|
|
428
|
+
open,
|
|
429
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectSheetController, {
|
|
430
|
+
onOpenChange: setOpen,
|
|
431
|
+
__scopeSelect,
|
|
432
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectImpl, {
|
|
433
|
+
activeIndexRef,
|
|
434
|
+
listContentRef,
|
|
435
|
+
selectedIndexRef,
|
|
436
|
+
...props,
|
|
437
|
+
open,
|
|
438
|
+
value,
|
|
439
|
+
children
|
|
440
|
+
})
|
|
441
|
+
})
|
|
442
|
+
});
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
Content: import_SelectContent.SelectContent,
|
|
446
|
+
Group: SelectGroup,
|
|
447
|
+
Icon: SelectIcon,
|
|
448
|
+
Item: SelectItem,
|
|
449
|
+
ItemIndicator: SelectItemIndicator,
|
|
450
|
+
ItemText: SelectItemText,
|
|
451
|
+
Label: SelectLabel,
|
|
452
|
+
ScrollDownButton: import_SelectScrollButton.SelectScrollDownButton,
|
|
453
|
+
ScrollUpButton: import_SelectScrollButton.SelectScrollUpButton,
|
|
454
|
+
Trigger: SelectTrigger,
|
|
455
|
+
Value: SelectValue,
|
|
456
|
+
Viewport: import_SelectViewport.SelectViewport,
|
|
457
|
+
SheetContents: SelectSheetContents,
|
|
458
|
+
Sheet: import_sheet.ControlledSheet
|
|
459
|
+
}
|
|
460
|
+
);
|
|
461
|
+
Select.displayName = import_constants.SELECT_NAME;
|
|
434
462
|
// Annotate the CommonJS export names for ESM import in node:
|
|
435
463
|
0 && (module.exports = {
|
|
436
464
|
Select,
|
|
437
|
-
|
|
438
|
-
SelectGroup,
|
|
465
|
+
SelectGroupFrame,
|
|
439
466
|
SelectIcon,
|
|
440
467
|
SelectItem,
|
|
441
|
-
|
|
442
|
-
SelectItemText,
|
|
443
|
-
SelectLabel,
|
|
444
|
-
SelectScrollDownButton,
|
|
445
|
-
SelectScrollUpButton,
|
|
468
|
+
SelectItemTextFrame,
|
|
446
469
|
SelectSeparator,
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
createSelectScope
|
|
470
|
+
SelectSheetContents,
|
|
471
|
+
SelectTrigger
|
|
450
472
|
});
|
|
451
473
|
//# sourceMappingURL=Select.js.map
|