@tamagui/select 1.0.1-beta.64 → 1.0.1-beta.67
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/Select.js +19 -5
- package/dist/cjs/Select.js.map +2 -2
- package/dist/esm/Select.js +15 -3
- package/dist/esm/Select.js.map +2 -2
- package/dist/jsx/Select.js +15 -10
- package/package.json +10 -10
- package/src/Select.tsx +38 -51
- package/types/Select.d.ts +41 -76
- package/types/Select.d.ts.map +1 -1
package/dist/cjs/Select.js
CHANGED
|
@@ -52,8 +52,10 @@ var Select_exports = {};
|
|
|
52
52
|
__export(Select_exports, {
|
|
53
53
|
Select: () => Select,
|
|
54
54
|
SelectIcon: () => SelectIcon,
|
|
55
|
+
SelectItem: () => SelectItem,
|
|
55
56
|
SelectSeparator: () => SelectSeparator,
|
|
56
57
|
SelectTrigger: () => SelectTrigger,
|
|
58
|
+
SelectViewport: () => SelectViewport,
|
|
57
59
|
SelectViewportFrame: () => SelectViewportFrame,
|
|
58
60
|
createSelectScope: () => createSelectScope
|
|
59
61
|
});
|
|
@@ -118,6 +120,7 @@ const SelectTrigger = React.forwardRef((props, forwardedRef) => {
|
|
|
118
120
|
tabIndex: -1,
|
|
119
121
|
borderWidth: 1,
|
|
120
122
|
componentName: TRIGGER_NAME,
|
|
123
|
+
size: context.size,
|
|
121
124
|
"aria-expanded": context.open,
|
|
122
125
|
"aria-autocomplete": "none",
|
|
123
126
|
disabled,
|
|
@@ -140,6 +143,7 @@ const SelectValue = SelectValueFrame.extractable(React.forwardRef(({ __scopeSele
|
|
|
140
143
|
onValueNodeHasChildrenChange(hasChildren);
|
|
141
144
|
}, [onValueNodeHasChildrenChange, hasChildren]);
|
|
142
145
|
return /* @__PURE__ */ React.createElement(SelectValueFrame, {
|
|
146
|
+
size: context.size,
|
|
143
147
|
ref: composedRefs,
|
|
144
148
|
pointerEvents: "none"
|
|
145
149
|
}, context.value === void 0 && placeholder !== void 0 ? placeholder : children);
|
|
@@ -151,14 +155,14 @@ const SelectIcon = (0, import_core.styled)(import_stacks.XStack, {
|
|
|
151
155
|
children: /* @__PURE__ */ React.createElement(import_text.Paragraph, null, "\u25BC")
|
|
152
156
|
});
|
|
153
157
|
const CONTENT_NAME = "SelectContent";
|
|
154
|
-
const SelectContent =
|
|
158
|
+
const SelectContent = /* @__PURE__ */ __name(({ children, __scopeSelect }) => {
|
|
155
159
|
const context = useSelectContext(CONTENT_NAME, __scopeSelect);
|
|
156
160
|
return /* @__PURE__ */ React.createElement(import_react_dom_interactions.FloatingPortal, null, context.open ? /* @__PURE__ */ React.createElement(import_react_dom_interactions.FloatingOverlay, {
|
|
157
161
|
lockScroll: true
|
|
158
162
|
}, children) : /* @__PURE__ */ React.createElement("div", {
|
|
159
163
|
style: { display: "none" }
|
|
160
164
|
}, children));
|
|
161
|
-
});
|
|
165
|
+
}, "SelectContent");
|
|
162
166
|
const VIEWPORT_NAME = "SelectViewport";
|
|
163
167
|
const SelectViewportFrame = (0, import_core.styled)(import_stacks.ThemeableStack, {
|
|
164
168
|
name: VIEWPORT_NAME,
|
|
@@ -170,7 +174,7 @@ const SelectViewportFrame = (0, import_core.styled)(import_stacks.ThemeableStack
|
|
|
170
174
|
size: {
|
|
171
175
|
"...size": (val, { tokens }) => {
|
|
172
176
|
return {
|
|
173
|
-
borderRadius: tokens.
|
|
177
|
+
borderRadius: tokens.radius[val] ?? val
|
|
174
178
|
};
|
|
175
179
|
}
|
|
176
180
|
}
|
|
@@ -192,6 +196,7 @@ const SelectViewport = React.forwardRef((props, forwardedRef) => {
|
|
|
192
196
|
context: context.floatingContext,
|
|
193
197
|
preventTabbing: true
|
|
194
198
|
}, /* @__PURE__ */ React.createElement("div", __spreadValues({}, context.interactions.getFloatingProps()), /* @__PURE__ */ React.createElement(SelectViewportFrame, __spreadProps(__spreadValues({
|
|
199
|
+
size: context.size,
|
|
195
200
|
"data-radix-select-viewport": "",
|
|
196
201
|
role: "presentation"
|
|
197
202
|
}, viewportProps), {
|
|
@@ -293,7 +298,8 @@ const SelectItem = React.forwardRef((props, forwardedRef) => {
|
|
|
293
298
|
"data-state": isSelected ? "active" : "inactive",
|
|
294
299
|
"aria-disabled": disabled || void 0,
|
|
295
300
|
"data-disabled": disabled ? "" : void 0,
|
|
296
|
-
tabIndex: disabled ? void 0 : -1
|
|
301
|
+
tabIndex: disabled ? void 0 : -1,
|
|
302
|
+
size: context.size
|
|
297
303
|
}, itemProps), selectItemProps)));
|
|
298
304
|
});
|
|
299
305
|
SelectItem.displayName = ITEM_NAME;
|
|
@@ -309,6 +315,7 @@ const SelectItemText = React.forwardRef((props, forwardedRef) => {
|
|
|
309
315
|
const ref = React.useRef(null);
|
|
310
316
|
const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref, itemContext.onItemTextChange);
|
|
311
317
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SelectItemTextFrame, __spreadProps(__spreadValues({
|
|
318
|
+
size: context.size,
|
|
312
319
|
id: itemContext.textId
|
|
313
320
|
}, itemTextProps), {
|
|
314
321
|
ref: composedRefs
|
|
@@ -352,11 +359,13 @@ SelectGroup.displayName = GROUP_NAME;
|
|
|
352
359
|
const LABEL_NAME = "SelectLabel";
|
|
353
360
|
const SelectLabel = React.forwardRef((props, forwardedRef) => {
|
|
354
361
|
const _a = props, { __scopeSelect } = _a, labelProps = __objRest(_a, ["__scopeSelect"]);
|
|
362
|
+
const context = useSelectContext(LABEL_NAME, __scopeSelect);
|
|
355
363
|
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
|
356
364
|
return /* @__PURE__ */ React.createElement(import_list_item.ListItem, __spreadProps(__spreadValues({
|
|
357
365
|
componentName: LABEL_NAME,
|
|
358
366
|
fontWeight: "800",
|
|
359
|
-
id: groupContext.id
|
|
367
|
+
id: groupContext.id,
|
|
368
|
+
size: context.size
|
|
360
369
|
}, labelProps), {
|
|
361
370
|
ref: forwardedRef
|
|
362
371
|
}));
|
|
@@ -452,6 +461,7 @@ const SelectSeparator = (0, import_core.styled)(import_separator.Separator, {
|
|
|
452
461
|
});
|
|
453
462
|
const Select = (0, import_core.withStaticProperties)((props) => {
|
|
454
463
|
const {
|
|
464
|
+
id,
|
|
455
465
|
__scopeSelect,
|
|
456
466
|
children,
|
|
457
467
|
open: openProp,
|
|
@@ -460,6 +470,7 @@ const Select = (0, import_core.withStaticProperties)((props) => {
|
|
|
460
470
|
value: valueProp,
|
|
461
471
|
defaultValue,
|
|
462
472
|
onValueChange,
|
|
473
|
+
size: sizeProp,
|
|
463
474
|
dir,
|
|
464
475
|
name,
|
|
465
476
|
autoComplete
|
|
@@ -774,6 +785,7 @@ const Select = (0, import_core.withStaticProperties)((props) => {
|
|
|
774
785
|
const [valueNode, setValueNode] = React.useState(null);
|
|
775
786
|
const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);
|
|
776
787
|
return /* @__PURE__ */ React.createElement(SelectProvider, {
|
|
788
|
+
size: sizeProp,
|
|
777
789
|
scope: __scopeSelect,
|
|
778
790
|
increaseHeight,
|
|
779
791
|
forceUpdate,
|
|
@@ -856,8 +868,10 @@ Select.displayName = SELECT_NAME;
|
|
|
856
868
|
0 && (module.exports = {
|
|
857
869
|
Select,
|
|
858
870
|
SelectIcon,
|
|
871
|
+
SelectItem,
|
|
859
872
|
SelectSeparator,
|
|
860
873
|
SelectTrigger,
|
|
874
|
+
SelectViewport,
|
|
861
875
|
SelectViewportFrame,
|
|
862
876
|
createSelectScope
|
|
863
877
|
});
|
package/dist/cjs/Select.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Select.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n ContextData,\n FloatingContext,\n FloatingFocusManager,\n FloatingOverlay,\n FloatingPortal,\n ReferenceType,\n autoUpdate,\n detectOverflow,\n flip,\n offset,\n size,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n useListNavigation,\n useRole,\n useTypeahead,\n} from '@floating-ui/react-dom-interactions'\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref'\nimport { usePrevious } from '@radix-ui/react-use-previous'\nimport { useComposedRefs } from '@tamagui/compose-refs'\nimport {\n GetProps,\n SizeTokens,\n Text,\n VariantSpreadExtras,\n VariantSpreadFunction,\n composeEventHandlers,\n getVariableValue,\n styled,\n useIsomorphicLayoutEffect,\n withStaticProperties,\n} from '@tamagui/core'\n// import { useDirection } from '@tamagui/react-direction'\n// import { DismissableLayer } from '@tamagui/react-dismissable-layer'\n// import { FocusScope } from '@tamagui/react-focus-scope'\nimport { useId } from '@tamagui/core'\nimport { createContextScope } from '@tamagui/create-context'\nimport type { Scope } from '@tamagui/create-context'\nimport { clamp } from '@tamagui/helpers'\nimport { ListItem, ListItemProps } from '@tamagui/list-item'\n// import { useLabelContext } from '@tamagui/react-label'\nimport { Portal } from '@tamagui/portal'\nimport { Separator } from '@tamagui/separator'\nimport { ThemeableStack, XStack, YStack, YStackProps } from '@tamagui/stacks'\nimport { Paragraph } from '@tamagui/text'\n// import { Primitive } from '@tamagui/react-primitive'\n// import type * as Radix from '@tamagui/react-primitive'\nimport { useControllableState } from '@tamagui/use-controllable-state'\n// import { useLayoutEffect } from '@tamagui/react-use-layout-effect'\n// import { usePrevious } from '@tamagui/react-use-previous'\n// import { VisuallyHidden } from '@tamagui/core'\n// import { hideOthers } from 'aria-hidden'\nimport * as React from 'react'\nimport * as ReactDOM from 'react-dom'\nimport { View } from 'react-native'\n\n// import { RemoveScroll } from 'react-remove-scroll'\n\ntype TamaguiElement = HTMLElement | View\n\n// Cross browser fixes for pinch-zooming/backdrop-filter \uD83D\uDE44\nconst userAgent = (typeof navigator !== 'undefined' && navigator.userAgent) || ''\nconst isFirefox = userAgent.toLowerCase().includes('firefox')\nif (isFirefox) {\n document.body.classList.add('firefox')\n}\nfunction getVisualOffsetTop() {\n return !/^((?!chrome|android).)*safari/i.test(userAgent) ? visualViewport.offsetTop : 0\n}\n\nconst getSelectItemSize = (val: SizeTokens, { tokens }: VariantSpreadExtras<any>) => {\n const padding = getVariableValue(tokens.size[val])\n return {\n paddingHorizontal: padding / 2,\n paddingVertical: padding / 4,\n }\n}\n\n/* -------------------------------------------------------------------------------------------------\n * SelectContext\n * -----------------------------------------------------------------------------------------------*/\n\nconst SELECT_NAME = 'Select'\nconst WINDOW_PADDING = 8\nconst SCROLL_ARROW_VELOCITY = 8\nconst SCROLL_ARROW_THRESHOLD = 8\nconst MIN_HEIGHT = 80\nconst FALLBACK_THRESHOLD = 16\n\ninterface SelectContextValue {\n value: any\n selectedIndex: number\n setSelectedIndex: (index: number) => void\n activeIndex: number | null\n setActiveIndex: (index: number | null) => void\n setValueAtIndex: (index: number, value: string) => void\n listRef: React.MutableRefObject<Array<HTMLElement | null>>\n floatingRef: React.MutableRefObject<HTMLElement | null>\n open: boolean\n setOpen: (open: boolean) => void\n onChange: (value: string) => void\n dataRef: React.MutableRefObject<ContextData>\n controlledScrolling: boolean\n valueNode: Element | null\n onValueNodeChange(node: HTMLElement): void\n valueNodeHasChildren: boolean\n onValueNodeHasChildrenChange(hasChildren: boolean): void\n canScrollUp: boolean\n canScrollDown: boolean\n floatingContext: FloatingContext<ReferenceType>\n increaseHeight: (floating: HTMLElement, amount?: any) => number | undefined\n forceUpdate: React.DispatchWithoutAction\n interactions: {\n getReferenceProps: (userProps?: React.HTMLProps<Element> | undefined) => any\n getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => any\n getItemProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => any\n }\n}\n\ntype ScopedProps<P> = P & { __scopeSelect?: Scope }\n\nconst [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME)\nconst [SelectProvider, useSelectContext] = createSelectContext<SelectContextValue>(SELECT_NAME)\n\n// const [SelectContentContextProvider, useSelectContentContext] =\n// createSelectContext<SelectContentContextValue>(CONTENT_NAME);\n\ntype GenericElement = HTMLElement | View\n\ntype Direction = 'ltr' | 'rtl'\n\nconst OPEN_KEYS = [' ', 'Enter', 'ArrowUp', 'ArrowDown']\nconst SELECTION_KEYS = [' ', 'Enter']\n\n/* -------------------------------------------------------------------------------------------------\n * SelectTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'SelectTrigger'\n\nexport type SelectTriggerProps = ListItemProps\n\nexport const SelectTrigger = React.forwardRef<GenericElement, SelectTriggerProps>(\n (props: ScopedProps<SelectTriggerProps>, forwardedRef) => {\n const {\n __scopeSelect,\n disabled = false,\n // @ts-ignore\n 'aria-labelledby': ariaLabelledby,\n ...triggerProps\n } = props\n const context = useSelectContext(TRIGGER_NAME, __scopeSelect)\n // const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange)\n // const getItems = useCollection(__scopeSelect)\n // const labelId = useLabelContext(context.trigger)\n // const labelledBy = ariaLabelledby || labelId\n\n return (\n <ListItem\n backgrounded\n radiused\n hoverable\n pressable\n focusable\n tabIndex={-1}\n borderWidth={1}\n componentName={TRIGGER_NAME}\n // aria-controls={context.contentId}\n aria-expanded={context.open}\n aria-autocomplete=\"none\"\n // aria-labelledby={labelledBy}\n // dir={context.dir}\n disabled={disabled}\n data-disabled={disabled ? '' : undefined}\n {...triggerProps}\n ref={forwardedRef}\n {...context.interactions.getReferenceProps()}\n />\n )\n }\n)\n\nSelectTrigger.displayName = TRIGGER_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectValue\n * -----------------------------------------------------------------------------------------------*/\n\nconst VALUE_NAME = 'SelectValue'\n\nconst SelectValueFrame = styled(Paragraph, {\n name: VALUE_NAME,\n})\n\ntype SelectValueProps = GetProps<typeof SelectValueFrame> & {\n placeholder?: React.ReactNode\n}\n\nconst SelectValue = SelectValueFrame.extractable(\n React.forwardRef<TamaguiElement, SelectValueProps>(\n ({ __scopeSelect, children, placeholder }: ScopedProps<SelectValueProps>, forwardedRef) => {\n // We ignore `className` and `style` as this part shouldn't be styled.\n const context = useSelectContext(VALUE_NAME, __scopeSelect)\n const { onValueNodeHasChildrenChange } = context\n const hasChildren = children !== undefined\n const composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange)\n\n React.useLayoutEffect(() => {\n onValueNodeHasChildrenChange(hasChildren)\n }, [onValueNodeHasChildrenChange, hasChildren])\n\n return (\n <SelectValueFrame\n ref={composedRefs}\n // we don't want events from the portalled `SelectValue` children to bubble\n // through the item they came from\n pointerEvents=\"none\"\n >\n {context.value === undefined && placeholder !== undefined ? placeholder : children}\n </SelectValueFrame>\n )\n }\n )\n)\n\nSelectValue.displayName = VALUE_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectIcon\n * -----------------------------------------------------------------------------------------------*/\n\nexport const SelectIcon = styled(XStack, {\n name: 'SelectIcon',\n // @ts-ignore\n 'aria-hidden': true,\n children: <Paragraph>\u25BC</Paragraph>,\n})\n\n/* -------------------------------------------------------------------------------------------------\n * SelectContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'SelectContent'\n\ntype SelectContentElement = any\ntype SelectContentProps = any\n\nconst SelectContent = React.forwardRef<SelectContentElement, SelectContentProps>(\n ({ children, __scopeSelect }: ScopedProps<SelectContentProps>, forwardedRef) => {\n const context = useSelectContext(CONTENT_NAME, __scopeSelect)\n return (\n <FloatingPortal>\n {context.open ? (\n <FloatingOverlay lockScroll>{children}</FloatingOverlay>\n ) : (\n <div style={{ display: 'none' }}>{children}</div>\n )}\n </FloatingPortal>\n )\n }\n)\n\n/* -------------------------------------------------------------------------------------------------\n * SelectViewport\n * -----------------------------------------------------------------------------------------------*/\n\nconst VIEWPORT_NAME = 'SelectViewport'\n\nexport const SelectViewportFrame = styled(ThemeableStack, {\n name: VIEWPORT_NAME,\n backgroundColor: '$background',\n elevate: true,\n overflow: 'hidden',\n \n // works on web just not typed\n // @ts-ignore\n userSelect: 'none',\n\n variants: {\n size: {\n '...size': (val, { tokens }) => {\n return {\n borderRadius: tokens.size[val] ?? val,\n }\n },\n },\n },\n\n defaultVariants: {\n size: '$2',\n },\n})\n\nexport type SelectViewportProps = GetProps<typeof SelectViewportFrame>\n\nconst SelectViewport = React.forwardRef<TamaguiElement, SelectViewportProps>(\n (props: ScopedProps<SelectViewportProps>, forwardedRef) => {\n const { __scopeSelect, children, ...viewportProps } = props\n const context = useSelectContext(VIEWPORT_NAME, __scopeSelect)\n const composedRefs = useComposedRefs(\n forwardedRef\n // contentContext.onViewportChange\n )\n const prevScrollTopRef = React.useRef(0)\n return (\n <>\n {/* Hide scrollbars cross-browser and enable momentum scroll for touch devices */}\n <style\n dangerouslySetInnerHTML={{\n __html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`,\n }}\n />\n <FloatingFocusManager context={context.floatingContext} preventTabbing>\n <div {...context.interactions.getFloatingProps()}>\n <SelectViewportFrame\n data-radix-select-viewport=\"\"\n // @ts-ignore\n role=\"presentation\"\n {...viewportProps}\n ref={composedRefs}\n >\n {children}\n </SelectViewportFrame>\n </div>\n </FloatingFocusManager>\n </>\n )\n }\n)\n\nSelectViewport.displayName = VIEWPORT_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'SelectItem'\n\ntype SelectItemContextValue = {\n value: string\n textId: string\n isSelected: boolean\n onItemTextChange(node: TamaguiElement | null): void\n}\n\nconst [SelectItemContextProvider, useSelectItemContext] =\n createSelectContext<SelectItemContextValue>(ITEM_NAME)\n\ninterface SelectItemProps extends YStackProps {\n value: string\n index: number\n disabled?: boolean\n textValue?: string\n}\n\n// const SelectItemFrame = styled(YStack, {\n// name: ITEM_NAME,\n// tag: 'li',\n// // @ts-ignore\n// role: 'option',\n// width: '100%',\n\n// hoverStyle: {\n// backgroundColor: '$backgroundHover',\n// },\n\n// focusStyle: {\n// backgroundColor: '$backgroundFocus',\n// },\n\n// variants: {\n// size: {\n// '...size': getSelectItemSize,\n// },\n// },\n\n// defaultVariants: {\n// size: '$4',\n// },\n// })\n\nconst SelectItem = React.forwardRef<TamaguiElement, SelectItemProps>(\n (props: ScopedProps<SelectItemProps>, forwardedRef) => {\n const {\n __scopeSelect,\n value,\n disabled = false,\n textValue: textValueProp,\n index,\n ...itemProps\n } = props\n const context = useSelectContext(ITEM_NAME, __scopeSelect)\n const isSelected = context.value === value\n const [textValue, setTextValue] = React.useState(textValueProp ?? '')\n const [isFocused, setIsFocused] = React.useState(false)\n const textId = useId()\n\n const {\n selectedIndex,\n setSelectedIndex,\n listRef,\n open,\n setOpen,\n onChange,\n activeIndex,\n setActiveIndex,\n setValueAtIndex,\n dataRef,\n } = context\n\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => {\n if (node instanceof HTMLElement) {\n listRef.current[index] = node\n }\n }\n // isSelected ? context.onSelectedItemChange : undefined\n )\n\n React.useEffect(() => {\n setValueAtIndex(index, value)\n }, [index])\n\n const timeoutRef = React.useRef<any>()\n const [allowMouseUp, setAllowMouseUp] = React.useState(false)\n\n function handleSelect() {\n setSelectedIndex(index)\n onChange(value)\n setOpen(false)\n }\n\n React.useEffect(() => {\n clearTimeout(timeoutRef.current)\n if (open) {\n if (selectedIndex !== index) {\n setAllowMouseUp(true)\n } else {\n timeoutRef.current = setTimeout(() => {\n setAllowMouseUp(true)\n }, 300)\n }\n } else {\n setAllowMouseUp(false)\n }\n }, [open, index, setActiveIndex, selectedIndex])\n\n function handleKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Enter' || (event.key === ' ' && !dataRef.current.typing)) {\n event.preventDefault()\n handleSelect()\n }\n }\n\n const selectItemProps = context.interactions.getItemProps({\n onClick: allowMouseUp ? handleSelect : undefined,\n onMouseUp: allowMouseUp ? handleSelect : undefined,\n onKeyDown: handleKeyDown,\n })\n\n return (\n <SelectItemContextProvider\n scope={__scopeSelect}\n value={value}\n textId={textId || ''}\n isSelected={isSelected}\n onItemTextChange={React.useCallback((node) => {\n // setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? '').trim())\n }, [])}\n >\n <ListItem\n backgrounded\n hoverable\n pressable\n focusable\n componentName={ITEM_NAME}\n ref={composedRefs}\n aria-labelledby={textId}\n // `isFocused` caveat fixes stuttering in VoiceOver\n aria-selected={isSelected && isFocused}\n data-state={isSelected ? 'active' : 'inactive'}\n aria-disabled={disabled || undefined}\n data-disabled={disabled ? '' : undefined}\n tabIndex={disabled ? undefined : -1}\n {...itemProps}\n {...selectItemProps}\n />\n </SelectItemContextProvider>\n )\n }\n)\n\nSelectItem.displayName = ITEM_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemText\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_TEXT_NAME = 'SelectItemText'\n\nconst SelectItemTextFrame = styled(Paragraph, {\n name: ITEM_TEXT_NAME,\n cursor: 'default',\n})\n\ntype SelectItemTextProps = GetProps<typeof SelectItemTextFrame>\n\nconst SelectItemText = React.forwardRef<TamaguiElement, SelectItemTextProps>(\n (props: ScopedProps<SelectItemTextProps>, forwardedRef) => {\n // We ignore `className` and `style` as this part shouldn't be styled.\n const { __scopeSelect, className, style, ...itemTextProps } = props\n const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect)\n const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect)\n const ref = React.useRef<TamaguiElement | null>(null)\n const composedRefs = useComposedRefs(\n forwardedRef,\n ref,\n itemContext.onItemTextChange\n // itemContext.isSelected ? contentContext.onSelectedItemTextChange : undefined\n )\n\n return (\n <>\n <SelectItemTextFrame id={itemContext.textId} {...itemTextProps} ref={composedRefs} />\n\n {/* Portal the select item text into the trigger value node */}\n {itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren\n ? ReactDOM.createPortal(itemTextProps.children, context.valueNode)\n : null}\n\n {/* Portal an option in the bubble select */}\n {/* {context.bubbleSelect\n ? ReactDOM.createPortal(\n // we use `.textContent` because `option` only support `string` or `number`\n <option value={itemContext.value}>{ref.current?.textContent}</option>,\n context.bubbleSelect\n )\n : null} */}\n </>\n )\n }\n)\n\nSelectItemText.displayName = ITEM_TEXT_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_INDICATOR_NAME = 'SelectItemIndicator'\n\nconst SelectItemIndicatorFrame = styled(XStack, {\n name: ITEM_TEXT_NAME,\n})\n\ntype SelectItemIndicatorProps = GetProps<typeof SelectItemIndicatorFrame>\n\nconst SelectItemIndicator = React.forwardRef<TamaguiElement, SelectItemIndicatorProps>(\n (props: ScopedProps<SelectItemIndicatorProps>, forwardedRef) => {\n const { __scopeSelect, ...itemIndicatorProps } = props\n const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect)\n return itemContext.isSelected ? (\n <SelectItemIndicatorFrame aria-hidden {...itemIndicatorProps} ref={forwardedRef} />\n ) : null\n }\n)\n\nSelectItemIndicator.displayName = ITEM_INDICATOR_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'SelectGroup'\n\ntype SelectGroupContextValue = { id: string }\n\nconst [SelectGroupContextProvider, useSelectGroupContext] =\n createSelectContext<SelectGroupContextValue>(GROUP_NAME)\n\nconst SelectGroupFrame = styled(YStack, {\n name: GROUP_NAME,\n width: '100%',\n})\n\ntype SelectGroupProps = GetProps<typeof SelectGroupFrame>\n\nconst SelectGroup = React.forwardRef<TamaguiElement, SelectGroupProps>(\n (props: ScopedProps<SelectGroupProps>, forwardedRef) => {\n const { __scopeSelect, ...groupProps } = props\n const groupId = useId()\n return (\n <SelectGroupContextProvider scope={__scopeSelect} id={groupId || ''}>\n <SelectGroupFrame\n // @ts-ignore\n role=\"group\"\n aria-labelledby={groupId}\n {...groupProps}\n ref={forwardedRef}\n />\n </SelectGroupContextProvider>\n )\n }\n)\n\nSelectGroup.displayName = GROUP_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'SelectLabel'\n\nexport type SelectLabelProps = ListItemProps\n\nconst SelectLabel = React.forwardRef<TamaguiElement, SelectLabelProps>(\n (props: ScopedProps<SelectLabelProps>, forwardedRef) => {\n const { __scopeSelect, ...labelProps } = props\n const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect)\n return (\n <ListItem\n componentName={LABEL_NAME}\n fontWeight=\"800\"\n id={groupContext.id}\n {...labelProps}\n // @ts-expect-error\n ref={forwardedRef}\n />\n )\n }\n)\n\nSelectLabel.displayName = LABEL_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollUpButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_UP_BUTTON_NAME = 'SelectScrollUpButton'\n\ninterface SelectScrollButtonProps\n extends Omit<SelectScrollButtonImplProps, 'dir' | 'componentName'> {}\n\nconst SelectScrollUpButton = React.forwardRef<TamaguiElement, SelectScrollButtonProps>(\n (props: ScopedProps<SelectScrollButtonProps>, forwardedRef) => {\n return (\n <SelectScrollButtonImpl\n componentName={SCROLL_UP_BUTTON_NAME}\n {...props}\n dir=\"up\"\n ref={forwardedRef}\n />\n )\n }\n)\n\nSelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollDownButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_DOWN_BUTTON_NAME = 'SelectScrollDownButton'\n\nconst SelectScrollDownButton = React.forwardRef<TamaguiElement, SelectScrollButtonProps>(\n (props: ScopedProps<SelectScrollButtonProps>, forwardedRef) => {\n return (\n <SelectScrollButtonImpl\n componentName={SCROLL_DOWN_BUTTON_NAME}\n {...props}\n dir=\"down\"\n ref={forwardedRef}\n />\n )\n }\n)\n\nSelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME\n\ntype SelectScrollButtonImplElement = TamaguiElement\ninterface SelectScrollButtonImplProps extends YStackProps {\n dir: 'up' | 'down'\n componentName: string\n}\n\nconst SelectScrollButtonImpl = React.forwardRef<\n SelectScrollButtonImplElement,\n SelectScrollButtonImplProps\n>((props: ScopedProps<SelectScrollButtonImplProps>, forwardedRef) => {\n const { __scopeSelect, dir, componentName, ...scrollIndicatorProps } = props\n const { floatingRef, increaseHeight, forceUpdate, ...context } = useSelectContext(\n componentName,\n __scopeSelect\n )\n const intervalRef = React.useRef<any>()\n const loopingRef = React.useRef(false)\n const isVisible = context[dir === 'down' ? 'canScrollDown' : 'canScrollUp']\n\n const { x, y, reference, floating, strategy, update, refs } = useFloating({\n strategy: 'fixed',\n placement: dir === 'up' ? 'top' : 'bottom',\n middleware: [offset(({ rects }) => -rects.floating.height)],\n })\n\n const composedRefs = useComposedRefs(forwardedRef, floating)\n\n React.useLayoutEffect(() => {\n reference(floatingRef.current)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [reference, floatingRef.current])\n\n React.useEffect(() => {\n if (!refs.reference.current || !refs.floating.current || !isVisible) {\n return\n }\n\n const cleanup = autoUpdate(refs.reference.current, refs.floating.current, update, {\n animationFrame: true,\n })\n\n return () => {\n clearInterval(intervalRef.current)\n loopingRef.current = false\n cleanup()\n }\n }, [isVisible, update, refs.floating, refs.reference])\n\n if (!isVisible) {\n return null\n }\n\n const handleScrollArrowChange = () => {\n const floating = floatingRef.current\n const isUp = dir === 'up'\n if (floating) {\n const value = isUp ? -SCROLL_ARROW_VELOCITY : SCROLL_ARROW_VELOCITY\n const multi =\n (isUp && floating.scrollTop <= SCROLL_ARROW_THRESHOLD * 2) ||\n (!isUp &&\n floating.scrollTop >=\n floating.scrollHeight - floating.clientHeight - SCROLL_ARROW_THRESHOLD * 2)\n ? 2\n : 1\n floating.scrollTop += multi * (isUp ? -SCROLL_ARROW_VELOCITY : SCROLL_ARROW_VELOCITY)\n\n increaseHeight(floating, multi === 2 ? value * 2 : value)\n // Ensure derived data (scroll arrows) is fresh\n forceUpdate()\n }\n }\n\n return (\n <YStack\n ref={composedRefs}\n componentName={componentName}\n aria-hidden\n {...scrollIndicatorProps}\n // @ts-expect-error\n position={strategy}\n left={x || 0}\n top={y || 0}\n width={`calc(${(floatingRef.current?.offsetWidth ?? 0) - 2}px)`}\n background={`linear-gradient(to ${\n dir === 'up' ? 'bottom' : 'top'\n }, #29282b 50%, rgba(53, 54, 55, 0.01))`}\n onPointerMove={() => {\n if (!loopingRef.current) {\n intervalRef.current = setInterval(handleScrollArrowChange, 1000 / 60)\n loopingRef.current = true\n }\n }}\n onPointerLeave={() => {\n loopingRef.current = false\n clearInterval(intervalRef.current)\n }}\n />\n )\n})\n\n/* -------------------------------------------------------------------------------------------------\n * SelectSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nexport const SelectSeparator = styled(Separator, {\n name: 'SelectSeparator',\n})\n\n/* -------------------------------------------------------------------------------------------------\n * Select\n * -----------------------------------------------------------------------------------------------*/\n\nexport interface SelectProps {\n children?: React.ReactNode\n value?: string\n defaultValue?: string\n onValueChange?(value: string): void\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?(open: boolean): void\n dir?: Direction\n name?: string\n autoComplete?: string\n}\n\nexport const Select = withStaticProperties(\n (props: ScopedProps<SelectProps>) => {\n const {\n __scopeSelect,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n value: valueProp,\n defaultValue,\n onValueChange,\n dir,\n name,\n autoComplete,\n } = props\n\n // const [trigger, setTrigger] = React.useState<SelectTriggerElement | null>(null)\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen || false,\n onChange: onOpenChange,\n })\n\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue || '',\n onChange: onValueChange,\n })\n\n const [activeIndex, setActiveIndex] = React.useState<number | null>(null)\n const selectedIndexRef = React.useRef<number | null>(null)\n const activeIndexRef = React.useRef<number | null>(null)\n const prevActiveIndex = usePrevious<number | null>(activeIndex)\n\n const [showArrows, setShowArrows] = React.useState(false)\n const [scrollTop, setScrollTop] = React.useState(0)\n const listItemsRef = React.useRef<Array<HTMLElement | null>>([])\n const listContentRef = React.useRef<string[]>([])\n\n const [selectedIndex, setSelectedIndex] = React.useState(\n Math.max(0, listContentRef.current.indexOf(value))\n )\n const [controlledScrolling, setControlledScrolling] = React.useState(false)\n const [middlewareType, setMiddlewareType] = React.useState<'align' | 'fallback'>('align')\n\n useIsomorphicLayoutEffect(() => {\n selectedIndexRef.current = selectedIndex\n activeIndexRef.current = activeIndex\n })\n\n // Wait for scroll position to settle before showing arrows to prevent\n // interference with pointer events.\n React.useEffect(() => {\n const frame = requestAnimationFrame(() => {\n setShowArrows(open)\n\n if (!open) {\n setScrollTop(0)\n setMiddlewareType('align')\n setActiveIndex(null)\n setControlledScrolling(false)\n }\n })\n return () => {\n cancelAnimationFrame(frame)\n }\n }, [open])\n\n function getFloatingPadding(floating: HTMLElement | null) {\n if (!floating) {\n return 0\n }\n return Number(getComputedStyle(floating).paddingLeft?.replace('px', ''))\n }\n\n const { x, y, reference, floating, strategy, context, refs, middlewareData, update } =\n useFloating({\n open,\n onOpenChange: setOpen,\n placement: 'bottom',\n middleware:\n middlewareType === 'align'\n ? [\n offset(({ rects }) => {\n const index = activeIndexRef.current ?? selectedIndexRef.current\n\n if (index == null) {\n return 0\n }\n\n const item = listItemsRef.current[index]\n\n if (item == null) {\n return 0\n }\n\n const offsetTop = item.offsetTop\n const itemHeight = item.offsetHeight\n const height = rects.reference.height\n\n return -offsetTop - height - (itemHeight - height) / 2\n }),\n // Custom `size` that can handle the opposite direction of the\n // placement\n {\n name: 'size',\n async fn(args) {\n const {\n elements: { floating },\n rects: { reference },\n middlewareData,\n } = args\n\n const overflow = await detectOverflow(args, {\n padding: WINDOW_PADDING,\n })\n\n const top = Math.max(0, overflow.top)\n const bottom = Math.max(0, overflow.bottom)\n const nextY = args.y + top\n\n if (middlewareData.size?.skip) {\n return {\n y: nextY,\n data: {\n y: middlewareData.size.y,\n },\n }\n }\n\n Object.assign(floating.style, {\n maxHeight: `${floating.scrollHeight - Math.abs(top + bottom)}px`,\n minWidth: `${reference.width + getFloatingPadding(floating) * 2}px`,\n })\n\n return {\n y: nextY,\n data: {\n y: top,\n skip: true,\n },\n reset: {\n rects: true,\n },\n }\n },\n },\n ]\n : [\n offset(5),\n flip(),\n size({\n apply({ rects, availableHeight, elements }) {\n Object.assign(elements.floating.style, {\n width: `${rects.reference.width}px`,\n maxHeight: `${availableHeight}px`,\n })\n },\n padding: WINDOW_PADDING,\n }),\n ],\n })\n\n const floatingRef = refs.floating\n const forceUpdate = React.useReducer(() => ({}), {})[1]\n\n const showUpArrow = showArrows && scrollTop > SCROLL_ARROW_THRESHOLD\n const showDownArrow =\n showArrows &&\n floatingRef.current &&\n scrollTop <\n floatingRef.current.scrollHeight - floatingRef.current.clientHeight - SCROLL_ARROW_THRESHOLD\n\n const interactions = useInteractions([\n useClick(context, { pointerDown: true }),\n useRole(context, { role: 'listbox' }),\n useDismiss(context),\n useListNavigation(context, {\n listRef: listItemsRef,\n activeIndex,\n selectedIndex,\n onNavigate: setActiveIndex,\n }),\n useTypeahead(context, {\n listRef: listContentRef,\n onMatch: open ? setActiveIndex : setSelectedIndex,\n selectedIndex,\n activeIndex,\n }),\n ])\n\n const increaseHeight = React.useCallback(\n (floating: HTMLElement, amount = 0) => {\n if (middlewareType === 'fallback') {\n return\n }\n\n const currentMaxHeight = Number(floating.style.maxHeight.replace('px', ''))\n const currentTop = Number(floating.style.top.replace('px', ''))\n const rect = floating.getBoundingClientRect()\n const rectTop = rect.top\n const rectBottom = rect.bottom\n const visualMaxHeight = visualViewport.height - WINDOW_PADDING * 2\n\n if (\n amount < 0 &&\n selectedIndexRef.current != null &&\n Math.round(rectBottom) <\n Math.round(visualViewport.height + getVisualOffsetTop() - WINDOW_PADDING)\n ) {\n floating.style.maxHeight = `${Math.min(visualMaxHeight, currentMaxHeight - amount)}px`\n }\n\n if (\n amount > 0 &&\n Math.round(rectTop) > Math.round(WINDOW_PADDING - getVisualOffsetTop()) &&\n floating.scrollHeight > floating.offsetHeight\n ) {\n const nextTop = Math.max(WINDOW_PADDING + getVisualOffsetTop(), currentTop - amount)\n\n const nextMaxHeight = Math.min(visualMaxHeight, currentMaxHeight + amount)\n\n Object.assign(floating.style, {\n maxHeight: `${nextMaxHeight}px`,\n top: `${nextTop}px`,\n })\n\n if (nextTop - WINDOW_PADDING > getVisualOffsetTop()) {\n floating.scrollTop -= nextMaxHeight - currentMaxHeight + getFloatingPadding(floating)\n }\n\n return currentTop - nextTop\n }\n },\n [middlewareType]\n )\n\n const touchPageYRef = React.useRef<number | null>(null)\n\n const handleWheel = React.useCallback(\n (event: WheelEvent | TouchEvent) => {\n const pinching = event.ctrlKey\n\n const currentTarget = event.currentTarget as HTMLElement\n\n function isWheelEvent(event: any): event is WheelEvent {\n return typeof event.deltaY === 'number'\n }\n\n function isTouchEvent(event: any): event is TouchEvent {\n return event.touches != null\n }\n\n if (\n Math.abs(\n (currentTarget?.offsetHeight ?? 0) - (visualViewport.height - WINDOW_PADDING * 2)\n ) > 1 &&\n !pinching\n ) {\n event.preventDefault()\n } else if (isWheelEvent(event) && isFirefox) {\n // Firefox needs this to propagate scrolling\n // during momentum scrolling phase if the\n // height reached its maximum (at boundaries)\n currentTarget.scrollTop += event.deltaY\n }\n\n if (!pinching) {\n let delta = 5\n\n if (isTouchEvent(event)) {\n const currentPageY = touchPageYRef.current\n const pageY = event.touches[0]?.pageY\n\n if (pageY != null) {\n touchPageYRef.current = pageY\n\n if (currentPageY != null) {\n delta = currentPageY - pageY\n }\n }\n }\n\n increaseHeight(currentTarget, isWheelEvent(event) ? event.deltaY : delta)\n setScrollTop(currentTarget.scrollTop)\n // Ensure derived data (scroll arrows) is fresh\n forceUpdate()\n }\n },\n [increaseHeight, forceUpdate]\n )\n\n // Handle `onWheel` event in an effect to remove the `passive` option so we\n // can .preventDefault() it\n React.useEffect(() => {\n function onTouchEnd() {\n touchPageYRef.current = null\n }\n\n const floating = floatingRef.current\n if (open && floating && middlewareType === 'align') {\n floating.addEventListener('wheel', handleWheel)\n floating.addEventListener('touchmove', handleWheel)\n floating.addEventListener('touchend', onTouchEnd, { passive: true })\n return () => {\n floating.removeEventListener('wheel', handleWheel)\n floating.removeEventListener('touchmove', handleWheel)\n floating.removeEventListener('touchend', onTouchEnd)\n }\n }\n }, [open, floatingRef, handleWheel, middlewareType])\n\n // Ensure the menu remains attached to the reference element when resizing.\n React.useEffect(() => {\n window.addEventListener('resize', update)\n return () => {\n window.removeEventListener('resize', update)\n }\n }, [update])\n\n // Scroll the active or selected item into view when in `controlledScrolling`\n // mode (i.e. arrow key nav).\n React.useLayoutEffect(() => {\n const floating = floatingRef.current\n\n if (open && controlledScrolling && floating) {\n const item =\n activeIndex != null\n ? listItemsRef.current[activeIndex]\n : selectedIndex != null\n ? listItemsRef.current[selectedIndex]\n : null\n\n if (item && prevActiveIndex != null) {\n const itemHeight = listItemsRef.current[prevActiveIndex]?.offsetHeight ?? 0\n\n const floatingHeight = floating.offsetHeight\n const top = item.offsetTop\n const bottom = top + itemHeight\n\n if (top < floating.scrollTop + 20) {\n const diff = floating.scrollTop - top + 20\n floating.scrollTop -= diff\n\n if (activeIndex != selectedIndex && activeIndex != null) {\n increaseHeight(floating, -diff)\n }\n } else if (bottom > floatingHeight + floating.scrollTop - 20) {\n const diff = bottom - floatingHeight - floating.scrollTop + 20\n\n floating.scrollTop += diff\n\n if (activeIndex != selectedIndex && activeIndex != null) {\n floating.scrollTop -= increaseHeight(floating, diff) ?? 0\n }\n }\n }\n }\n }, [\n open,\n controlledScrolling,\n prevActiveIndex,\n activeIndex,\n selectedIndex,\n floatingRef,\n increaseHeight,\n ])\n\n // Sync the height and the scrollTop values and device whether to use fallback\n // positioning.\n React.useLayoutEffect(() => {\n const floating = refs.floating.current\n const reference = refs.reference.current\n\n if (open && floating && reference && floating.offsetHeight < floating.scrollHeight) {\n const referenceRect = reference.getBoundingClientRect()\n\n if (middlewareType === 'fallback') {\n const item = listItemsRef.current[selectedIndex]\n if (item) {\n floating.scrollTop = item.offsetTop - floating.clientHeight + referenceRect.height\n }\n return\n }\n\n floating.scrollTop = middlewareData.size?.y\n\n const closeToBottom =\n visualViewport.height + getVisualOffsetTop() - referenceRect.bottom < FALLBACK_THRESHOLD\n const closeToTop = referenceRect.top < FALLBACK_THRESHOLD\n\n if (floating.offsetHeight < MIN_HEIGHT || closeToTop || closeToBottom) {\n setMiddlewareType('fallback')\n }\n }\n }, [\n open,\n increaseHeight,\n selectedIndex,\n middlewareType,\n refs.floating,\n refs.reference,\n // Always re-run this effect when the position has been computed so the\n // .scrollTop change works with fresh sizing.\n middlewareData,\n ])\n\n React.useLayoutEffect(() => {\n if (open && selectedIndex != null) {\n requestAnimationFrame(() => {\n listItemsRef.current[selectedIndex]?.focus({ preventScroll: true })\n })\n }\n }, [listItemsRef, selectedIndex, open])\n\n // Wait for scroll position to settle before showing arrows to prevent\n // interference with pointer events.\n React.useEffect(() => {\n const frame = requestAnimationFrame(() => {\n setShowArrows(open)\n\n if (!open) {\n setScrollTop(0)\n setMiddlewareType('align')\n setActiveIndex(null)\n setControlledScrolling(false)\n }\n })\n return () => cancelAnimationFrame(frame)\n }, [open])\n\n // We set this to true by default so that events bubble to forms without JS (SSR)\n // const isFormControl = trigger ? Boolean(trigger.closest('form')) : true\n // const [bubbleSelect, setBubbleSelect] = React.useState<HTMLSelectElement | null>(null)\n // const triggerPointerDownPosRef = React.useRef<{ x: number; y: number } | null>(null)\n\n const [valueNode, setValueNode] = React.useState<HTMLElement | null>(null)\n const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false)\n\n return (\n <SelectProvider\n scope={__scopeSelect}\n increaseHeight={increaseHeight}\n forceUpdate={forceUpdate}\n floatingRef={floatingRef}\n valueNode={valueNode}\n onValueNodeChange={setValueNode}\n valueNodeHasChildren={valueNodeHasChildren}\n onValueNodeHasChildrenChange={setValueNodeHasChildren}\n setValueAtIndex={(index, value) => {\n listContentRef.current[index] = value\n }}\n interactions={{\n ...interactions,\n getReferenceProps() {\n return interactions.getReferenceProps({\n ref: reference,\n className: 'SelectTrigger',\n onKeyDown(event) {\n if (\n event.key === 'Enter' ||\n (event.key === ' ' && !context.dataRef.current.typing)\n ) {\n event.preventDefault()\n setOpen(true)\n }\n },\n })\n },\n getFloatingProps() {\n return interactions.getFloatingProps({\n ref: floating,\n className: 'Select',\n style: {\n position: strategy,\n top: y ?? '',\n left: x ?? '',\n },\n onPointerEnter() {\n setControlledScrolling(false)\n },\n onPointerMove() {\n setControlledScrolling(false)\n },\n onKeyDown() {\n setControlledScrolling(true)\n },\n onScroll(event) {\n setScrollTop(event.currentTarget.scrollTop)\n },\n })\n },\n }}\n floatingContext={context}\n activeIndex={activeIndex}\n canScrollDown={!!showDownArrow}\n canScrollUp={!!showUpArrow}\n controlledScrolling\n dataRef={context.dataRef}\n listRef={listItemsRef}\n onChange={setValue}\n selectedIndex={0}\n setActiveIndex={setActiveIndex}\n setOpen={setOpen}\n setSelectedIndex={setSelectedIndex}\n value={value}\n // trigger={trigger}\n // onTriggerChange={setTrigger}\n // contentId={useId() || ''}\n // value={value}\n // onValueChange={setValue}\n open={open}\n // onOpenChange={setOpen}\n // TODO\n // dir={'rtl'} //direction}\n // bubbleSelect={bubbleSelect}\n // triggerPointerDownPosRef={triggerPointerDownPosRef}\n >\n {/* <Collection.Provider scope={__scopeSelect}>{children}</Collection.Provider> */}\n {children}\n {/* {isFormControl ? (\n <BubbleSelect\n ref={setBubbleSelect}\n aria-hidden\n tabIndex={-1}\n name={name}\n autoComplete={autoComplete}\n value={value}\n // enable form autofill\n onChange={(event) => setValue(event.target.value)}\n />\n ) : null} */}\n </SelectProvider>\n )\n },\n {\n Content: SelectContent,\n Group: SelectGroup,\n Icon: SelectIcon,\n Item: SelectItem,\n ItemIndicator: SelectItemIndicator,\n ItemText: SelectItemText,\n Label: SelectLabel,\n ScrollDownButton: SelectScrollDownButton,\n ScrollUpButton: SelectScrollUpButton,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Viewport: SelectViewport,\n }\n)\n\n// @ts-ignore\nSelect.displayName = SELECT_NAME\n\nexport { createSelectScope }\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oCAmBO;AAEP,gCAA4B;AAC5B,0BAAgC;AAChC,kBAWO;AAIP,mBAAsB;AACtB,4BAAmC;AAGnC,uBAAwC;AAGxC,uBAA0B;AAC1B,oBAA4D;AAC5D,kBAA0B;AAG1B,oCAAqC;AAKrC,YAAuB;AACvB,eAA0B;AAQ1B,MAAM,YAAa,OAAO,cAAc,eAAe,UAAU,aAAc;AAC/E,MAAM,YAAY,UAAU,YAAY,EAAE,SAAS,SAAS;AAC5D,IAAI,WAAW;AACb,WAAS,KAAK,UAAU,IAAI,SAAS;AACvC;AACA,8BAA8B;AAC5B,SAAO,CAAC,iCAAiC,KAAK,SAAS,IAAI,eAAe,YAAY;AACxF;AAFS;AAIT,MAAM,oBAAoB,wBAAC,KAAiB,EAAE,aAAuC;AACnF,QAAM,UAAU,kCAAiB,OAAO,KAAK,IAAI;AACjD,SAAO;AAAA,IACL,mBAAmB,UAAU;AAAA,IAC7B,iBAAiB,UAAU;AAAA,EAC7B;AACF,GAN0B;AAY1B,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM,wBAAwB;AAC9B,MAAM,yBAAyB;AAC/B,MAAM,aAAa;AACnB,MAAM,qBAAqB;AAkC3B,MAAM,CAAC,qBAAqB,qBAAqB,8CAAmB,WAAW;AAC/E,MAAM,CAAC,gBAAgB,oBAAoB,oBAAwC,WAAW;AAS9F,MAAM,YAAY,CAAC,KAAK,SAAS,WAAW,WAAW;AACvD,MAAM,iBAAiB,CAAC,KAAK,OAAO;AAMpC,MAAM,eAAe;AAId,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AA,IACA,eAAe,CAAC,CAAC;AAAA,IACjB,aAAa,CAAC,CAAC;AAAA,IACf,qBAAmB;AAAA,IACnB,SAAS,QAAQ;AAAA,IACjB,SAAS;AAAA,IACT,UAAU;AAAA,IACV,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAMA;AAAA,KAQC,QAaH;AAEJ,GACA;AAAA,EACE,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,eAAe;AAAA,EACf,UAAU;AAAA,EACV,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AACZ,CACF;AAGA,OAAO,cAAc;",
|
|
4
|
+
"sourcesContent": ["import {\n ContextData,\n FloatingContext,\n FloatingFocusManager,\n FloatingOverlay,\n FloatingPortal,\n ReferenceType,\n autoUpdate,\n detectOverflow,\n flip,\n offset,\n size,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n useListNavigation,\n useRole,\n useTypeahead,\n} from '@floating-ui/react-dom-interactions'\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref'\nimport { usePrevious } from '@radix-ui/react-use-previous'\nimport { useComposedRefs } from '@tamagui/compose-refs'\nimport {\n GetProps,\n SizeTokens,\n Text,\n VariantSpreadExtras,\n VariantSpreadFunction,\n composeEventHandlers,\n getVariableValue,\n styled,\n useIsomorphicLayoutEffect,\n withStaticProperties,\n} from '@tamagui/core'\n// import { useDirection } from '@tamagui/react-direction'\n// import { DismissableLayer } from '@tamagui/react-dismissable-layer'\n// import { FocusScope } from '@tamagui/react-focus-scope'\nimport { useId } from '@tamagui/core'\nimport { createContextScope } from '@tamagui/create-context'\nimport type { Scope } from '@tamagui/create-context'\nimport { clamp } from '@tamagui/helpers'\nimport { ListItem, ListItemProps } from '@tamagui/list-item'\n// import { useLabelContext } from '@tamagui/react-label'\nimport { Portal } from '@tamagui/portal'\nimport { Separator } from '@tamagui/separator'\nimport { ThemeableStack, XStack, YStack, YStackProps } from '@tamagui/stacks'\nimport { Paragraph } from '@tamagui/text'\n// import { Primitive } from '@tamagui/react-primitive'\n// import type * as Radix from '@tamagui/react-primitive'\nimport { useControllableState } from '@tamagui/use-controllable-state'\n// import { usePrevious } from '@tamagui/react-use-previous'\n// import { VisuallyHidden } from '@tamagui/core'\n// import { hideOthers } from 'aria-hidden'\nimport * as React from 'react'\nimport * as ReactDOM from 'react-dom'\nimport { View } from 'react-native'\n\n// import { RemoveScroll } from 'react-remove-scroll'\n\ntype TamaguiElement = HTMLElement | View\n\n// Cross browser fixes for pinch-zooming/backdrop-filter \uD83D\uDE44\nconst userAgent = (typeof navigator !== 'undefined' && navigator.userAgent) || ''\nconst isFirefox = userAgent.toLowerCase().includes('firefox')\nif (isFirefox) {\n document.body.classList.add('firefox')\n}\nfunction getVisualOffsetTop() {\n return !/^((?!chrome|android).)*safari/i.test(userAgent) ? visualViewport.offsetTop : 0\n}\n\nconst getSelectItemSize = (val: SizeTokens, { tokens }: VariantSpreadExtras<any>) => {\n const padding = getVariableValue(tokens.size[val])\n return {\n paddingHorizontal: padding / 2,\n paddingVertical: padding / 4,\n }\n}\n\n/* -------------------------------------------------------------------------------------------------\n * SelectContext\n * -----------------------------------------------------------------------------------------------*/\n\nconst SELECT_NAME = 'Select'\nconst WINDOW_PADDING = 8\nconst SCROLL_ARROW_VELOCITY = 8\nconst SCROLL_ARROW_THRESHOLD = 8\nconst MIN_HEIGHT = 80\nconst FALLBACK_THRESHOLD = 16\n\ninterface SelectContextValue {\n size?: SizeTokens\n value: any\n selectedIndex: number\n setSelectedIndex: (index: number) => void\n activeIndex: number | null\n setActiveIndex: (index: number | null) => void\n setValueAtIndex: (index: number, value: string) => void\n listRef: React.MutableRefObject<Array<HTMLElement | null>>\n floatingRef: React.MutableRefObject<HTMLElement | null>\n open: boolean\n setOpen: (open: boolean) => void\n onChange: (value: string) => void\n dataRef: React.MutableRefObject<ContextData>\n controlledScrolling: boolean\n valueNode: Element | null\n onValueNodeChange(node: HTMLElement): void\n valueNodeHasChildren: boolean\n onValueNodeHasChildrenChange(hasChildren: boolean): void\n canScrollUp: boolean\n canScrollDown: boolean\n floatingContext: FloatingContext<ReferenceType>\n increaseHeight: (floating: HTMLElement, amount?: any) => number | undefined\n forceUpdate: React.DispatchWithoutAction\n interactions: {\n getReferenceProps: (userProps?: React.HTMLProps<Element> | undefined) => any\n getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => any\n getItemProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => any\n }\n}\n\ntype ScopedProps<P> = P & { __scopeSelect?: Scope }\n\nconst [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME)\nconst [SelectProvider, useSelectContext] = createSelectContext<SelectContextValue>(SELECT_NAME)\n\n// const [SelectContentContextProvider, useSelectContentContext] =\n// createSelectContext<SelectContentContextValue>(CONTENT_NAME);\n\ntype GenericElement = HTMLElement | View\n\ntype Direction = 'ltr' | 'rtl'\n\nconst OPEN_KEYS = [' ', 'Enter', 'ArrowUp', 'ArrowDown']\nconst SELECTION_KEYS = [' ', 'Enter']\n\n/* -------------------------------------------------------------------------------------------------\n * SelectTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'SelectTrigger'\n\nexport type SelectTriggerProps = ListItemProps\n\nexport const SelectTrigger = React.forwardRef<GenericElement, SelectTriggerProps>(\n (props: ScopedProps<SelectTriggerProps>, forwardedRef) => {\n const {\n __scopeSelect,\n disabled = false,\n // @ts-ignore\n 'aria-labelledby': ariaLabelledby,\n ...triggerProps\n } = props\n const context = useSelectContext(TRIGGER_NAME, __scopeSelect)\n // const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange)\n // const getItems = useCollection(__scopeSelect)\n // const labelId = useLabelContext(context.trigger)\n // const labelledBy = ariaLabelledby || labelId\n\n return (\n <ListItem\n backgrounded\n radiused\n hoverable\n pressable\n focusable\n tabIndex={-1}\n borderWidth={1}\n componentName={TRIGGER_NAME}\n size={context.size}\n // aria-controls={context.contentId}\n aria-expanded={context.open}\n aria-autocomplete=\"none\"\n // aria-labelledby={labelledBy}\n // dir={context.dir}\n disabled={disabled}\n data-disabled={disabled ? '' : undefined}\n {...triggerProps}\n ref={forwardedRef}\n {...context.interactions.getReferenceProps()}\n />\n )\n }\n)\n\nSelectTrigger.displayName = TRIGGER_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectValue\n * -----------------------------------------------------------------------------------------------*/\n\nconst VALUE_NAME = 'SelectValue'\n\nconst SelectValueFrame = styled(Paragraph, {\n name: VALUE_NAME,\n})\n\ntype SelectValueProps = GetProps<typeof SelectValueFrame> & {\n placeholder?: React.ReactNode\n}\n\nconst SelectValue = SelectValueFrame.extractable(\n React.forwardRef<TamaguiElement, SelectValueProps>(\n ({ __scopeSelect, children, placeholder }: ScopedProps<SelectValueProps>, forwardedRef) => {\n // We ignore `className` and `style` as this part shouldn't be styled.\n const context = useSelectContext(VALUE_NAME, __scopeSelect)\n const { onValueNodeHasChildrenChange } = context\n const hasChildren = children !== undefined\n const composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange)\n\n React.useLayoutEffect(() => {\n onValueNodeHasChildrenChange(hasChildren)\n }, [onValueNodeHasChildrenChange, hasChildren])\n\n return (\n <SelectValueFrame\n size={context.size}\n ref={composedRefs}\n // we don't want events from the portalled `SelectValue` children to bubble\n // through the item they came from\n pointerEvents=\"none\"\n >\n {context.value === undefined && placeholder !== undefined ? placeholder : children}\n </SelectValueFrame>\n )\n }\n )\n)\n\nSelectValue.displayName = VALUE_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectIcon\n * -----------------------------------------------------------------------------------------------*/\n\nexport const SelectIcon = styled(XStack, {\n name: 'SelectIcon',\n // @ts-ignore\n 'aria-hidden': true,\n children: <Paragraph>\u25BC</Paragraph>,\n})\n\n/* -------------------------------------------------------------------------------------------------\n * SelectContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'SelectContent'\n\nexport type SelectContentProps = { children?: React.ReactNode }\n\nconst SelectContent = ({ children, __scopeSelect }: ScopedProps<SelectContentProps>) => {\n const context = useSelectContext(CONTENT_NAME, __scopeSelect)\n return (\n <FloatingPortal>\n {context.open ? (\n <FloatingOverlay lockScroll>{children}</FloatingOverlay>\n ) : (\n <div style={{ display: 'none' }}>{children}</div>\n )}\n </FloatingPortal>\n )\n}\n\n/* -------------------------------------------------------------------------------------------------\n * SelectViewport\n * -----------------------------------------------------------------------------------------------*/\n\nconst VIEWPORT_NAME = 'SelectViewport'\n\nexport const SelectViewportFrame = styled(ThemeableStack, {\n name: VIEWPORT_NAME,\n backgroundColor: '$background',\n elevate: true,\n overflow: 'hidden',\n userSelect: 'none',\n\n variants: {\n size: {\n '...size': (val, { tokens }) => {\n return {\n borderRadius: tokens.radius[val] ?? val,\n }\n },\n },\n },\n\n defaultVariants: {\n size: '$2',\n },\n})\n\nexport type SelectViewportProps = GetProps<typeof SelectViewportFrame>\n\nexport const SelectViewport = React.forwardRef<TamaguiElement, SelectViewportProps>(\n (props: ScopedProps<SelectViewportProps>, forwardedRef) => {\n const { __scopeSelect, children, ...viewportProps } = props\n const context = useSelectContext(VIEWPORT_NAME, __scopeSelect)\n const composedRefs = useComposedRefs(\n forwardedRef\n // contentContext.onViewportChange\n )\n const prevScrollTopRef = React.useRef(0)\n return (\n <>\n {/* Hide scrollbars cross-browser and enable momentum scroll for touch devices */}\n <style\n dangerouslySetInnerHTML={{\n __html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`,\n }}\n />\n <FloatingFocusManager context={context.floatingContext} preventTabbing>\n <div {...context.interactions.getFloatingProps()}>\n <SelectViewportFrame\n size={context.size}\n data-radix-select-viewport=\"\"\n // @ts-ignore\n role=\"presentation\"\n {...viewportProps}\n ref={composedRefs}\n >\n {children}\n </SelectViewportFrame>\n </div>\n </FloatingFocusManager>\n </>\n )\n }\n)\n\nSelectViewport.displayName = VIEWPORT_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'SelectItem'\n\ntype SelectItemContextValue = {\n value: string\n textId: string\n isSelected: boolean\n onItemTextChange(node: TamaguiElement | null): void\n}\n\nconst [SelectItemContextProvider, useSelectItemContext] =\n createSelectContext<SelectItemContextValue>(ITEM_NAME)\n\nexport interface SelectItemProps extends YStackProps {\n value: string\n index: number\n disabled?: boolean\n textValue?: string\n}\n\n// TODO styled(ListItem, { name: 'SelectItem' })\n\nexport const SelectItem = React.forwardRef<TamaguiElement, SelectItemProps>(\n (props: ScopedProps<SelectItemProps>, forwardedRef) => {\n const {\n __scopeSelect,\n value,\n disabled = false,\n textValue: textValueProp,\n index,\n ...itemProps\n } = props\n const context = useSelectContext(ITEM_NAME, __scopeSelect)\n const isSelected = context.value === value\n const [textValue, setTextValue] = React.useState(textValueProp ?? '')\n const [isFocused, setIsFocused] = React.useState(false)\n const textId = useId()\n\n const {\n selectedIndex,\n setSelectedIndex,\n listRef,\n open,\n setOpen,\n onChange,\n activeIndex,\n setActiveIndex,\n setValueAtIndex,\n dataRef,\n } = context\n\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => {\n if (node instanceof HTMLElement) {\n listRef.current[index] = node\n }\n }\n // isSelected ? context.onSelectedItemChange : undefined\n )\n\n React.useEffect(() => {\n setValueAtIndex(index, value)\n }, [index])\n\n const timeoutRef = React.useRef<any>()\n const [allowMouseUp, setAllowMouseUp] = React.useState(false)\n\n function handleSelect() {\n setSelectedIndex(index)\n onChange(value)\n setOpen(false)\n }\n\n React.useEffect(() => {\n clearTimeout(timeoutRef.current)\n if (open) {\n if (selectedIndex !== index) {\n setAllowMouseUp(true)\n } else {\n timeoutRef.current = setTimeout(() => {\n setAllowMouseUp(true)\n }, 300)\n }\n } else {\n setAllowMouseUp(false)\n }\n }, [open, index, setActiveIndex, selectedIndex])\n\n function handleKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Enter' || (event.key === ' ' && !dataRef.current.typing)) {\n event.preventDefault()\n handleSelect()\n }\n }\n\n const selectItemProps = context.interactions.getItemProps({\n onClick: allowMouseUp ? handleSelect : undefined,\n onMouseUp: allowMouseUp ? handleSelect : undefined,\n onKeyDown: handleKeyDown,\n })\n\n return (\n <SelectItemContextProvider\n scope={__scopeSelect}\n value={value}\n textId={textId || ''}\n isSelected={isSelected}\n onItemTextChange={React.useCallback((node) => {\n // setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? '').trim())\n }, [])}\n >\n <ListItem\n backgrounded\n hoverable\n pressable\n focusable\n componentName={ITEM_NAME}\n ref={composedRefs}\n aria-labelledby={textId}\n // `isFocused` caveat fixes stuttering in VoiceOver\n aria-selected={isSelected && isFocused}\n data-state={isSelected ? 'active' : 'inactive'}\n aria-disabled={disabled || undefined}\n data-disabled={disabled ? '' : undefined}\n tabIndex={disabled ? undefined : -1}\n size={context.size}\n {...itemProps}\n {...selectItemProps}\n />\n </SelectItemContextProvider>\n )\n }\n)\n\nSelectItem.displayName = ITEM_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemText\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_TEXT_NAME = 'SelectItemText'\n\nconst SelectItemTextFrame = styled(Paragraph, {\n name: ITEM_TEXT_NAME,\n cursor: 'default',\n})\n\ntype SelectItemTextProps = GetProps<typeof SelectItemTextFrame>\n\nconst SelectItemText = React.forwardRef<TamaguiElement, SelectItemTextProps>(\n (props: ScopedProps<SelectItemTextProps>, forwardedRef) => {\n // We ignore `className` and `style` as this part shouldn't be styled.\n const { __scopeSelect, className, style, ...itemTextProps } = props\n const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect)\n const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect)\n const ref = React.useRef<TamaguiElement | null>(null)\n const composedRefs = useComposedRefs(\n forwardedRef,\n ref,\n itemContext.onItemTextChange\n // itemContext.isSelected ? contentContext.onSelectedItemTextChange : undefined\n )\n\n return (\n <>\n <SelectItemTextFrame\n size={context.size}\n id={itemContext.textId}\n {...itemTextProps}\n ref={composedRefs}\n />\n\n {/* Portal the select item text into the trigger value node */}\n {itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren\n ? ReactDOM.createPortal(itemTextProps.children, context.valueNode)\n : null}\n\n {/* Portal an option in the bubble select */}\n {/* {context.bubbleSelect\n ? ReactDOM.createPortal(\n // we use `.textContent` because `option` only support `string` or `number`\n <option value={itemContext.value}>{ref.current?.textContent}</option>,\n context.bubbleSelect\n )\n : null} */}\n </>\n )\n }\n)\n\nSelectItemText.displayName = ITEM_TEXT_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_INDICATOR_NAME = 'SelectItemIndicator'\n\nconst SelectItemIndicatorFrame = styled(XStack, {\n name: ITEM_TEXT_NAME,\n})\n\ntype SelectItemIndicatorProps = GetProps<typeof SelectItemIndicatorFrame>\n\nconst SelectItemIndicator = React.forwardRef<TamaguiElement, SelectItemIndicatorProps>(\n (props: ScopedProps<SelectItemIndicatorProps>, forwardedRef) => {\n const { __scopeSelect, ...itemIndicatorProps } = props\n const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect)\n return itemContext.isSelected ? (\n <SelectItemIndicatorFrame aria-hidden {...itemIndicatorProps} ref={forwardedRef} />\n ) : null\n }\n)\n\nSelectItemIndicator.displayName = ITEM_INDICATOR_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'SelectGroup'\n\ntype SelectGroupContextValue = { id: string }\n\nconst [SelectGroupContextProvider, useSelectGroupContext] =\n createSelectContext<SelectGroupContextValue>(GROUP_NAME)\n\nconst SelectGroupFrame = styled(YStack, {\n name: GROUP_NAME,\n width: '100%',\n})\n\ntype SelectGroupProps = GetProps<typeof SelectGroupFrame>\n\nconst SelectGroup = React.forwardRef<TamaguiElement, SelectGroupProps>(\n (props: ScopedProps<SelectGroupProps>, forwardedRef) => {\n const { __scopeSelect, ...groupProps } = props\n const groupId = useId()\n return (\n <SelectGroupContextProvider scope={__scopeSelect} id={groupId || ''}>\n <SelectGroupFrame\n // @ts-ignore\n role=\"group\"\n aria-labelledby={groupId}\n {...groupProps}\n ref={forwardedRef}\n />\n </SelectGroupContextProvider>\n )\n }\n)\n\nSelectGroup.displayName = GROUP_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'SelectLabel'\n\nexport type SelectLabelProps = ListItemProps\n\nconst SelectLabel = React.forwardRef<TamaguiElement, SelectLabelProps>(\n (props: ScopedProps<SelectLabelProps>, forwardedRef) => {\n const { __scopeSelect, ...labelProps } = props\n const context = useSelectContext(LABEL_NAME, __scopeSelect)\n const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect)\n return (\n <ListItem\n componentName={LABEL_NAME}\n fontWeight=\"800\"\n id={groupContext.id}\n size={context.size}\n {...labelProps}\n // @ts-expect-error\n ref={forwardedRef}\n />\n )\n }\n)\n\nSelectLabel.displayName = LABEL_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollUpButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_UP_BUTTON_NAME = 'SelectScrollUpButton'\n\ninterface SelectScrollButtonProps\n extends Omit<SelectScrollButtonImplProps, 'dir' | 'componentName'> {}\n\nconst SelectScrollUpButton = React.forwardRef<TamaguiElement, SelectScrollButtonProps>(\n (props: ScopedProps<SelectScrollButtonProps>, forwardedRef) => {\n return (\n <SelectScrollButtonImpl\n componentName={SCROLL_UP_BUTTON_NAME}\n {...props}\n dir=\"up\"\n ref={forwardedRef}\n />\n )\n }\n)\n\nSelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollDownButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_DOWN_BUTTON_NAME = 'SelectScrollDownButton'\n\nconst SelectScrollDownButton = React.forwardRef<TamaguiElement, SelectScrollButtonProps>(\n (props: ScopedProps<SelectScrollButtonProps>, forwardedRef) => {\n return (\n <SelectScrollButtonImpl\n componentName={SCROLL_DOWN_BUTTON_NAME}\n {...props}\n dir=\"down\"\n ref={forwardedRef}\n />\n )\n }\n)\n\nSelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME\n\ntype SelectScrollButtonImplElement = TamaguiElement\ninterface SelectScrollButtonImplProps extends YStackProps {\n dir: 'up' | 'down'\n componentName: string\n}\n\nconst SelectScrollButtonImpl = React.forwardRef<\n SelectScrollButtonImplElement,\n SelectScrollButtonImplProps\n>((props: ScopedProps<SelectScrollButtonImplProps>, forwardedRef) => {\n const { __scopeSelect, dir, componentName, ...scrollIndicatorProps } = props\n const { floatingRef, increaseHeight, forceUpdate, ...context } = useSelectContext(\n componentName,\n __scopeSelect\n )\n const intervalRef = React.useRef<any>()\n const loopingRef = React.useRef(false)\n const isVisible = context[dir === 'down' ? 'canScrollDown' : 'canScrollUp']\n\n const { x, y, reference, floating, strategy, update, refs } = useFloating({\n strategy: 'fixed',\n placement: dir === 'up' ? 'top' : 'bottom',\n middleware: [offset(({ rects }) => -rects.floating.height)],\n })\n\n const composedRefs = useComposedRefs(forwardedRef, floating)\n\n React.useLayoutEffect(() => {\n reference(floatingRef.current)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [reference, floatingRef.current])\n\n React.useEffect(() => {\n if (!refs.reference.current || !refs.floating.current || !isVisible) {\n return\n }\n\n const cleanup = autoUpdate(refs.reference.current, refs.floating.current, update, {\n animationFrame: true,\n })\n\n return () => {\n clearInterval(intervalRef.current)\n loopingRef.current = false\n cleanup()\n }\n }, [isVisible, update, refs.floating, refs.reference])\n\n if (!isVisible) {\n return null\n }\n\n const handleScrollArrowChange = () => {\n const floating = floatingRef.current\n const isUp = dir === 'up'\n if (floating) {\n const value = isUp ? -SCROLL_ARROW_VELOCITY : SCROLL_ARROW_VELOCITY\n const multi =\n (isUp && floating.scrollTop <= SCROLL_ARROW_THRESHOLD * 2) ||\n (!isUp &&\n floating.scrollTop >=\n floating.scrollHeight - floating.clientHeight - SCROLL_ARROW_THRESHOLD * 2)\n ? 2\n : 1\n floating.scrollTop += multi * (isUp ? -SCROLL_ARROW_VELOCITY : SCROLL_ARROW_VELOCITY)\n\n increaseHeight(floating, multi === 2 ? value * 2 : value)\n // Ensure derived data (scroll arrows) is fresh\n forceUpdate()\n }\n }\n\n return (\n <YStack\n ref={composedRefs}\n componentName={componentName}\n aria-hidden\n {...scrollIndicatorProps}\n // @ts-expect-error\n position={strategy}\n left={x || 0}\n top={y || 0}\n width={`calc(${(floatingRef.current?.offsetWidth ?? 0) - 2}px)`}\n background={`linear-gradient(to ${\n dir === 'up' ? 'bottom' : 'top'\n }, #29282b 50%, rgba(53, 54, 55, 0.01))`}\n onPointerMove={() => {\n if (!loopingRef.current) {\n intervalRef.current = setInterval(handleScrollArrowChange, 1000 / 60)\n loopingRef.current = true\n }\n }}\n onPointerLeave={() => {\n loopingRef.current = false\n clearInterval(intervalRef.current)\n }}\n />\n )\n})\n\n/* -------------------------------------------------------------------------------------------------\n * SelectSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nexport const SelectSeparator = styled(Separator, {\n name: 'SelectSeparator',\n})\n\n/* -------------------------------------------------------------------------------------------------\n * Select\n * -----------------------------------------------------------------------------------------------*/\n\nexport interface SelectProps {\n id?: string\n children?: React.ReactNode\n value?: string\n defaultValue?: string\n onValueChange?(value: string): void\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?(open: boolean): void\n dir?: Direction\n name?: string\n autoComplete?: string\n size?: SizeTokens\n}\n\nexport const Select = withStaticProperties(\n (props: ScopedProps<SelectProps>) => {\n const {\n // TODO use id for focusing from label\n id,\n __scopeSelect,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n value: valueProp,\n defaultValue,\n onValueChange,\n size: sizeProp,\n dir,\n name,\n autoComplete,\n } = props\n\n // const [trigger, setTrigger] = React.useState<SelectTriggerElement | null>(null)\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen || false,\n onChange: onOpenChange,\n })\n\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue || '',\n onChange: onValueChange,\n })\n\n const [activeIndex, setActiveIndex] = React.useState<number | null>(null)\n const selectedIndexRef = React.useRef<number | null>(null)\n const activeIndexRef = React.useRef<number | null>(null)\n const prevActiveIndex = usePrevious<number | null>(activeIndex)\n\n const [showArrows, setShowArrows] = React.useState(false)\n const [scrollTop, setScrollTop] = React.useState(0)\n const listItemsRef = React.useRef<Array<HTMLElement | null>>([])\n const listContentRef = React.useRef<string[]>([])\n\n const [selectedIndex, setSelectedIndex] = React.useState(\n Math.max(0, listContentRef.current.indexOf(value))\n )\n const [controlledScrolling, setControlledScrolling] = React.useState(false)\n const [middlewareType, setMiddlewareType] = React.useState<'align' | 'fallback'>('align')\n\n useIsomorphicLayoutEffect(() => {\n selectedIndexRef.current = selectedIndex\n activeIndexRef.current = activeIndex\n })\n\n // Wait for scroll position to settle before showing arrows to prevent\n // interference with pointer events.\n React.useEffect(() => {\n const frame = requestAnimationFrame(() => {\n setShowArrows(open)\n\n if (!open) {\n setScrollTop(0)\n setMiddlewareType('align')\n setActiveIndex(null)\n setControlledScrolling(false)\n }\n })\n return () => {\n cancelAnimationFrame(frame)\n }\n }, [open])\n\n function getFloatingPadding(floating: HTMLElement | null) {\n if (!floating) {\n return 0\n }\n return Number(getComputedStyle(floating).paddingLeft?.replace('px', ''))\n }\n\n const { x, y, reference, floating, strategy, context, refs, middlewareData, update } =\n useFloating({\n open,\n onOpenChange: setOpen,\n placement: 'bottom',\n middleware:\n middlewareType === 'align'\n ? [\n offset(({ rects }) => {\n const index = activeIndexRef.current ?? selectedIndexRef.current\n\n if (index == null) {\n return 0\n }\n\n const item = listItemsRef.current[index]\n\n if (item == null) {\n return 0\n }\n\n const offsetTop = item.offsetTop\n const itemHeight = item.offsetHeight\n const height = rects.reference.height\n\n return -offsetTop - height - (itemHeight - height) / 2\n }),\n // Custom `size` that can handle the opposite direction of the\n // placement\n {\n name: 'size',\n async fn(args) {\n const {\n elements: { floating },\n rects: { reference },\n middlewareData,\n } = args\n\n const overflow = await detectOverflow(args, {\n padding: WINDOW_PADDING,\n })\n\n const top = Math.max(0, overflow.top)\n const bottom = Math.max(0, overflow.bottom)\n const nextY = args.y + top\n\n if (middlewareData.size?.skip) {\n return {\n y: nextY,\n data: {\n y: middlewareData.size.y,\n },\n }\n }\n\n Object.assign(floating.style, {\n maxHeight: `${floating.scrollHeight - Math.abs(top + bottom)}px`,\n minWidth: `${reference.width + getFloatingPadding(floating) * 2}px`,\n })\n\n return {\n y: nextY,\n data: {\n y: top,\n skip: true,\n },\n reset: {\n rects: true,\n },\n }\n },\n },\n ]\n : [\n offset(5),\n flip(),\n size({\n apply({ rects, availableHeight, elements }) {\n Object.assign(elements.floating.style, {\n width: `${rects.reference.width}px`,\n maxHeight: `${availableHeight}px`,\n })\n },\n padding: WINDOW_PADDING,\n }),\n ],\n })\n\n const floatingRef = refs.floating\n const forceUpdate = React.useReducer(() => ({}), {})[1]\n\n const showUpArrow = showArrows && scrollTop > SCROLL_ARROW_THRESHOLD\n const showDownArrow =\n showArrows &&\n floatingRef.current &&\n scrollTop <\n floatingRef.current.scrollHeight - floatingRef.current.clientHeight - SCROLL_ARROW_THRESHOLD\n\n const interactions = useInteractions([\n useClick(context, { pointerDown: true }),\n useRole(context, { role: 'listbox' }),\n useDismiss(context),\n useListNavigation(context, {\n listRef: listItemsRef,\n activeIndex,\n selectedIndex,\n onNavigate: setActiveIndex,\n }),\n useTypeahead(context, {\n listRef: listContentRef,\n onMatch: open ? setActiveIndex : setSelectedIndex,\n selectedIndex,\n activeIndex,\n }),\n ])\n\n const increaseHeight = React.useCallback(\n (floating: HTMLElement, amount = 0) => {\n if (middlewareType === 'fallback') {\n return\n }\n\n const currentMaxHeight = Number(floating.style.maxHeight.replace('px', ''))\n const currentTop = Number(floating.style.top.replace('px', ''))\n const rect = floating.getBoundingClientRect()\n const rectTop = rect.top\n const rectBottom = rect.bottom\n const visualMaxHeight = visualViewport.height - WINDOW_PADDING * 2\n\n if (\n amount < 0 &&\n selectedIndexRef.current != null &&\n Math.round(rectBottom) <\n Math.round(visualViewport.height + getVisualOffsetTop() - WINDOW_PADDING)\n ) {\n floating.style.maxHeight = `${Math.min(visualMaxHeight, currentMaxHeight - amount)}px`\n }\n\n if (\n amount > 0 &&\n Math.round(rectTop) > Math.round(WINDOW_PADDING - getVisualOffsetTop()) &&\n floating.scrollHeight > floating.offsetHeight\n ) {\n const nextTop = Math.max(WINDOW_PADDING + getVisualOffsetTop(), currentTop - amount)\n\n const nextMaxHeight = Math.min(visualMaxHeight, currentMaxHeight + amount)\n\n Object.assign(floating.style, {\n maxHeight: `${nextMaxHeight}px`,\n top: `${nextTop}px`,\n })\n\n if (nextTop - WINDOW_PADDING > getVisualOffsetTop()) {\n floating.scrollTop -= nextMaxHeight - currentMaxHeight + getFloatingPadding(floating)\n }\n\n return currentTop - nextTop\n }\n },\n [middlewareType]\n )\n\n const touchPageYRef = React.useRef<number | null>(null)\n\n const handleWheel = React.useCallback(\n (event: WheelEvent | TouchEvent) => {\n const pinching = event.ctrlKey\n\n const currentTarget = event.currentTarget as HTMLElement\n\n function isWheelEvent(event: any): event is WheelEvent {\n return typeof event.deltaY === 'number'\n }\n\n function isTouchEvent(event: any): event is TouchEvent {\n return event.touches != null\n }\n\n if (\n Math.abs(\n (currentTarget?.offsetHeight ?? 0) - (visualViewport.height - WINDOW_PADDING * 2)\n ) > 1 &&\n !pinching\n ) {\n event.preventDefault()\n } else if (isWheelEvent(event) && isFirefox) {\n // Firefox needs this to propagate scrolling\n // during momentum scrolling phase if the\n // height reached its maximum (at boundaries)\n currentTarget.scrollTop += event.deltaY\n }\n\n if (!pinching) {\n let delta = 5\n\n if (isTouchEvent(event)) {\n const currentPageY = touchPageYRef.current\n const pageY = event.touches[0]?.pageY\n\n if (pageY != null) {\n touchPageYRef.current = pageY\n\n if (currentPageY != null) {\n delta = currentPageY - pageY\n }\n }\n }\n\n increaseHeight(currentTarget, isWheelEvent(event) ? event.deltaY : delta)\n setScrollTop(currentTarget.scrollTop)\n // Ensure derived data (scroll arrows) is fresh\n forceUpdate()\n }\n },\n [increaseHeight, forceUpdate]\n )\n\n // Handle `onWheel` event in an effect to remove the `passive` option so we\n // can .preventDefault() it\n React.useEffect(() => {\n function onTouchEnd() {\n touchPageYRef.current = null\n }\n\n const floating = floatingRef.current\n if (open && floating && middlewareType === 'align') {\n floating.addEventListener('wheel', handleWheel)\n floating.addEventListener('touchmove', handleWheel)\n floating.addEventListener('touchend', onTouchEnd, { passive: true })\n return () => {\n floating.removeEventListener('wheel', handleWheel)\n floating.removeEventListener('touchmove', handleWheel)\n floating.removeEventListener('touchend', onTouchEnd)\n }\n }\n }, [open, floatingRef, handleWheel, middlewareType])\n\n // Ensure the menu remains attached to the reference element when resizing.\n React.useEffect(() => {\n window.addEventListener('resize', update)\n return () => {\n window.removeEventListener('resize', update)\n }\n }, [update])\n\n // Scroll the active or selected item into view when in `controlledScrolling`\n // mode (i.e. arrow key nav).\n React.useLayoutEffect(() => {\n const floating = floatingRef.current\n\n if (open && controlledScrolling && floating) {\n const item =\n activeIndex != null\n ? listItemsRef.current[activeIndex]\n : selectedIndex != null\n ? listItemsRef.current[selectedIndex]\n : null\n\n if (item && prevActiveIndex != null) {\n const itemHeight = listItemsRef.current[prevActiveIndex]?.offsetHeight ?? 0\n\n const floatingHeight = floating.offsetHeight\n const top = item.offsetTop\n const bottom = top + itemHeight\n\n if (top < floating.scrollTop + 20) {\n const diff = floating.scrollTop - top + 20\n floating.scrollTop -= diff\n\n if (activeIndex != selectedIndex && activeIndex != null) {\n increaseHeight(floating, -diff)\n }\n } else if (bottom > floatingHeight + floating.scrollTop - 20) {\n const diff = bottom - floatingHeight - floating.scrollTop + 20\n\n floating.scrollTop += diff\n\n if (activeIndex != selectedIndex && activeIndex != null) {\n floating.scrollTop -= increaseHeight(floating, diff) ?? 0\n }\n }\n }\n }\n }, [\n open,\n controlledScrolling,\n prevActiveIndex,\n activeIndex,\n selectedIndex,\n floatingRef,\n increaseHeight,\n ])\n\n // Sync the height and the scrollTop values and device whether to use fallback\n // positioning.\n React.useLayoutEffect(() => {\n const floating = refs.floating.current\n const reference = refs.reference.current\n\n if (open && floating && reference && floating.offsetHeight < floating.scrollHeight) {\n const referenceRect = reference.getBoundingClientRect()\n\n if (middlewareType === 'fallback') {\n const item = listItemsRef.current[selectedIndex]\n if (item) {\n floating.scrollTop = item.offsetTop - floating.clientHeight + referenceRect.height\n }\n return\n }\n\n floating.scrollTop = middlewareData.size?.y\n\n const closeToBottom =\n visualViewport.height + getVisualOffsetTop() - referenceRect.bottom < FALLBACK_THRESHOLD\n const closeToTop = referenceRect.top < FALLBACK_THRESHOLD\n\n if (floating.offsetHeight < MIN_HEIGHT || closeToTop || closeToBottom) {\n setMiddlewareType('fallback')\n }\n }\n }, [\n open,\n increaseHeight,\n selectedIndex,\n middlewareType,\n refs.floating,\n refs.reference,\n // Always re-run this effect when the position has been computed so the\n // .scrollTop change works with fresh sizing.\n middlewareData,\n ])\n\n React.useLayoutEffect(() => {\n if (open && selectedIndex != null) {\n requestAnimationFrame(() => {\n listItemsRef.current[selectedIndex]?.focus({ preventScroll: true })\n })\n }\n }, [listItemsRef, selectedIndex, open])\n\n // Wait for scroll position to settle before showing arrows to prevent\n // interference with pointer events.\n React.useEffect(() => {\n const frame = requestAnimationFrame(() => {\n setShowArrows(open)\n\n if (!open) {\n setScrollTop(0)\n setMiddlewareType('align')\n setActiveIndex(null)\n setControlledScrolling(false)\n }\n })\n return () => cancelAnimationFrame(frame)\n }, [open])\n\n // We set this to true by default so that events bubble to forms without JS (SSR)\n // const isFormControl = trigger ? Boolean(trigger.closest('form')) : true\n // const [bubbleSelect, setBubbleSelect] = React.useState<HTMLSelectElement | null>(null)\n // const triggerPointerDownPosRef = React.useRef<{ x: number; y: number } | null>(null)\n\n const [valueNode, setValueNode] = React.useState<HTMLElement | null>(null)\n const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false)\n\n return (\n <SelectProvider\n size={sizeProp}\n scope={__scopeSelect}\n increaseHeight={increaseHeight}\n forceUpdate={forceUpdate}\n floatingRef={floatingRef}\n valueNode={valueNode}\n onValueNodeChange={setValueNode}\n valueNodeHasChildren={valueNodeHasChildren}\n onValueNodeHasChildrenChange={setValueNodeHasChildren}\n setValueAtIndex={(index, value) => {\n listContentRef.current[index] = value\n }}\n interactions={{\n ...interactions,\n getReferenceProps() {\n return interactions.getReferenceProps({\n ref: reference,\n className: 'SelectTrigger',\n onKeyDown(event) {\n if (\n event.key === 'Enter' ||\n (event.key === ' ' && !context.dataRef.current.typing)\n ) {\n event.preventDefault()\n setOpen(true)\n }\n },\n })\n },\n getFloatingProps() {\n return interactions.getFloatingProps({\n ref: floating,\n className: 'Select',\n style: {\n position: strategy,\n top: y ?? '',\n left: x ?? '',\n },\n onPointerEnter() {\n setControlledScrolling(false)\n },\n onPointerMove() {\n setControlledScrolling(false)\n },\n onKeyDown() {\n setControlledScrolling(true)\n },\n onScroll(event) {\n setScrollTop(event.currentTarget.scrollTop)\n },\n })\n },\n }}\n floatingContext={context}\n activeIndex={activeIndex}\n canScrollDown={!!showDownArrow}\n canScrollUp={!!showUpArrow}\n controlledScrolling\n dataRef={context.dataRef}\n listRef={listItemsRef}\n onChange={setValue}\n selectedIndex={0}\n setActiveIndex={setActiveIndex}\n setOpen={setOpen}\n setSelectedIndex={setSelectedIndex}\n value={value}\n // trigger={trigger}\n // onTriggerChange={setTrigger}\n // contentId={useId() || ''}\n // value={value}\n // onValueChange={setValue}\n open={open}\n // onOpenChange={setOpen}\n // TODO\n // dir={'rtl'} //direction}\n // bubbleSelect={bubbleSelect}\n // triggerPointerDownPosRef={triggerPointerDownPosRef}\n >\n {/* <Collection.Provider scope={__scopeSelect}>{children}</Collection.Provider> */}\n {children}\n {/* {isFormControl ? (\n <BubbleSelect\n ref={setBubbleSelect}\n aria-hidden\n tabIndex={-1}\n name={name}\n autoComplete={autoComplete}\n value={value}\n // enable form autofill\n onChange={(event) => setValue(event.target.value)}\n />\n ) : null} */}\n </SelectProvider>\n )\n },\n {\n Content: SelectContent,\n Group: SelectGroup,\n Icon: SelectIcon,\n Item: SelectItem,\n ItemIndicator: SelectItemIndicator,\n ItemText: SelectItemText,\n Label: SelectLabel,\n ScrollDownButton: SelectScrollDownButton,\n ScrollUpButton: SelectScrollUpButton,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Viewport: SelectViewport,\n }\n)\n\n// @ts-ignore\nSelect.displayName = SELECT_NAME\n\nexport { createSelectScope }\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oCAmBO;AAEP,gCAA4B;AAC5B,0BAAgC;AAChC,kBAWO;AAIP,mBAAsB;AACtB,4BAAmC;AAGnC,uBAAwC;AAGxC,uBAA0B;AAC1B,oBAA4D;AAC5D,kBAA0B;AAG1B,oCAAqC;AAIrC,YAAuB;AACvB,eAA0B;AAQ1B,MAAM,YAAa,OAAO,cAAc,eAAe,UAAU,aAAc;AAC/E,MAAM,YAAY,UAAU,YAAY,EAAE,SAAS,SAAS;AAC5D,IAAI,WAAW;AACb,WAAS,KAAK,UAAU,IAAI,SAAS;AACvC;AACA,8BAA8B;AAC5B,SAAO,CAAC,iCAAiC,KAAK,SAAS,IAAI,eAAe,YAAY;AACxF;AAFS;AAIT,MAAM,oBAAoB,wBAAC,KAA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@ -78,6 +78,7 @@ const SelectTrigger = React.forwardRef((props, forwardedRef) => {
|
|
|
78
78
|
tabIndex: -1,
|
|
79
79
|
borderWidth: 1,
|
|
80
80
|
componentName: TRIGGER_NAME,
|
|
81
|
+
size: context.size,
|
|
81
82
|
"aria-expanded": context.open,
|
|
82
83
|
"aria-autocomplete": "none",
|
|
83
84
|
disabled,
|
|
@@ -101,6 +102,7 @@ const SelectValue = SelectValueFrame.extractable(React.forwardRef(({ __scopeSele
|
|
|
101
102
|
onValueNodeHasChildrenChange(hasChildren);
|
|
102
103
|
}, [onValueNodeHasChildrenChange, hasChildren]);
|
|
103
104
|
return /* @__PURE__ */ React.createElement(SelectValueFrame, {
|
|
105
|
+
size: context.size,
|
|
104
106
|
ref: composedRefs,
|
|
105
107
|
pointerEvents: "none"
|
|
106
108
|
}, context.value === void 0 && placeholder !== void 0 ? placeholder : children);
|
|
@@ -112,14 +114,14 @@ const SelectIcon = styled(XStack, {
|
|
|
112
114
|
children: /* @__PURE__ */ React.createElement(Paragraph, null, "\u25BC")
|
|
113
115
|
});
|
|
114
116
|
const CONTENT_NAME = "SelectContent";
|
|
115
|
-
const SelectContent =
|
|
117
|
+
const SelectContent = /* @__PURE__ */ __name(({ children, __scopeSelect }) => {
|
|
116
118
|
const context = useSelectContext(CONTENT_NAME, __scopeSelect);
|
|
117
119
|
return /* @__PURE__ */ React.createElement(FloatingPortal, null, context.open ? /* @__PURE__ */ React.createElement(FloatingOverlay, {
|
|
118
120
|
lockScroll: true
|
|
119
121
|
}, children) : /* @__PURE__ */ React.createElement("div", {
|
|
120
122
|
style: { display: "none" }
|
|
121
123
|
}, children));
|
|
122
|
-
});
|
|
124
|
+
}, "SelectContent");
|
|
123
125
|
const VIEWPORT_NAME = "SelectViewport";
|
|
124
126
|
const SelectViewportFrame = styled(ThemeableStack, {
|
|
125
127
|
name: VIEWPORT_NAME,
|
|
@@ -132,7 +134,7 @@ const SelectViewportFrame = styled(ThemeableStack, {
|
|
|
132
134
|
"...size": (val, { tokens }) => {
|
|
133
135
|
var _a;
|
|
134
136
|
return {
|
|
135
|
-
borderRadius: (_a = tokens.
|
|
137
|
+
borderRadius: (_a = tokens.radius[val]) != null ? _a : val
|
|
136
138
|
};
|
|
137
139
|
}
|
|
138
140
|
}
|
|
@@ -156,6 +158,7 @@ const SelectViewport = React.forwardRef((props, forwardedRef) => {
|
|
|
156
158
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
157
159
|
...context.interactions.getFloatingProps()
|
|
158
160
|
}, /* @__PURE__ */ React.createElement(SelectViewportFrame, {
|
|
161
|
+
size: context.size,
|
|
159
162
|
"data-radix-select-viewport": "",
|
|
160
163
|
role: "presentation",
|
|
161
164
|
...viewportProps,
|
|
@@ -253,6 +256,7 @@ const SelectItem = React.forwardRef((props, forwardedRef) => {
|
|
|
253
256
|
"aria-disabled": disabled || void 0,
|
|
254
257
|
"data-disabled": disabled ? "" : void 0,
|
|
255
258
|
tabIndex: disabled ? void 0 : -1,
|
|
259
|
+
size: context.size,
|
|
256
260
|
...itemProps,
|
|
257
261
|
...selectItemProps
|
|
258
262
|
}));
|
|
@@ -270,6 +274,7 @@ const SelectItemText = React.forwardRef((props, forwardedRef) => {
|
|
|
270
274
|
const ref = React.useRef(null);
|
|
271
275
|
const composedRefs = useComposedRefs(forwardedRef, ref, itemContext.onItemTextChange);
|
|
272
276
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SelectItemTextFrame, {
|
|
277
|
+
size: context.size,
|
|
273
278
|
id: itemContext.textId,
|
|
274
279
|
...itemTextProps,
|
|
275
280
|
ref: composedRefs
|
|
@@ -313,11 +318,13 @@ SelectGroup.displayName = GROUP_NAME;
|
|
|
313
318
|
const LABEL_NAME = "SelectLabel";
|
|
314
319
|
const SelectLabel = React.forwardRef((props, forwardedRef) => {
|
|
315
320
|
const { __scopeSelect, ...labelProps } = props;
|
|
321
|
+
const context = useSelectContext(LABEL_NAME, __scopeSelect);
|
|
316
322
|
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
|
317
323
|
return /* @__PURE__ */ React.createElement(ListItem, {
|
|
318
324
|
componentName: LABEL_NAME,
|
|
319
325
|
fontWeight: "800",
|
|
320
326
|
id: groupContext.id,
|
|
327
|
+
size: context.size,
|
|
321
328
|
...labelProps,
|
|
322
329
|
ref: forwardedRef
|
|
323
330
|
});
|
|
@@ -413,6 +420,7 @@ const SelectSeparator = styled(Separator, {
|
|
|
413
420
|
});
|
|
414
421
|
const Select = withStaticProperties((props) => {
|
|
415
422
|
const {
|
|
423
|
+
id,
|
|
416
424
|
__scopeSelect,
|
|
417
425
|
children,
|
|
418
426
|
open: openProp,
|
|
@@ -421,6 +429,7 @@ const Select = withStaticProperties((props) => {
|
|
|
421
429
|
value: valueProp,
|
|
422
430
|
defaultValue,
|
|
423
431
|
onValueChange,
|
|
432
|
+
size: sizeProp,
|
|
424
433
|
dir,
|
|
425
434
|
name,
|
|
426
435
|
autoComplete
|
|
@@ -736,6 +745,7 @@ const Select = withStaticProperties((props) => {
|
|
|
736
745
|
const [valueNode, setValueNode] = React.useState(null);
|
|
737
746
|
const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);
|
|
738
747
|
return /* @__PURE__ */ React.createElement(SelectProvider, {
|
|
748
|
+
size: sizeProp,
|
|
739
749
|
scope: __scopeSelect,
|
|
740
750
|
increaseHeight,
|
|
741
751
|
forceUpdate,
|
|
@@ -818,8 +828,10 @@ Select.displayName = SELECT_NAME;
|
|
|
818
828
|
export {
|
|
819
829
|
Select,
|
|
820
830
|
SelectIcon,
|
|
831
|
+
SelectItem,
|
|
821
832
|
SelectSeparator,
|
|
822
833
|
SelectTrigger,
|
|
834
|
+
SelectViewport,
|
|
823
835
|
SelectViewportFrame,
|
|
824
836
|
createSelectScope
|
|
825
837
|
};
|