@tamagui/select 1.0.1-beta.75 → 1.0.1-beta.76
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 +0 -9
- package/dist/cjs/Select.js.map +2 -2
- package/dist/esm/BubbleSelect.js +16 -1
- package/dist/esm/BubbleSelect.js.map +1 -1
- package/dist/esm/Select.js +110 -92
- package/dist/esm/Select.js.map +2 -2
- package/dist/jsx/Select.js +0 -10
- package/package.json +10 -10
package/dist/cjs/Select.js
CHANGED
|
@@ -82,13 +82,6 @@ if (isFirefox) {
|
|
|
82
82
|
function getVisualOffsetTop() {
|
|
83
83
|
return !/^((?!chrome|android).)*safari/i.test(userAgent) ? visualViewport.offsetTop : 0;
|
|
84
84
|
}
|
|
85
|
-
const getSelectItemSize = (val, { tokens }) => {
|
|
86
|
-
const padding = (0, import_core.getVariableValue)(tokens.size[val]);
|
|
87
|
-
return {
|
|
88
|
-
paddingHorizontal: padding / 2,
|
|
89
|
-
paddingVertical: padding / 4
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
85
|
const SELECT_NAME = "Select";
|
|
93
86
|
const WINDOW_PADDING = 8;
|
|
94
87
|
const SCROLL_ARROW_VELOCITY = 8;
|
|
@@ -97,8 +90,6 @@ const MIN_HEIGHT = 80;
|
|
|
97
90
|
const FALLBACK_THRESHOLD = 16;
|
|
98
91
|
const [createSelectContext, createSelectScope] = (0, import_create_context.createContextScope)(SELECT_NAME);
|
|
99
92
|
const [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME);
|
|
100
|
-
const OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"];
|
|
101
|
-
const SELECTION_KEYS = [" ", "Enter"];
|
|
102
93
|
const TRIGGER_NAME = "SelectTrigger";
|
|
103
94
|
const SelectTrigger = React.forwardRef((props, forwardedRef) => {
|
|
104
95
|
const _a = props, {
|
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 { 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 hoverTheme\n pressTheme\n focusTheme\n focusable={false}\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 selectable: false,\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 maxHeight: '100%',\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.useLayoutEffect(() => {\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 // @ts-ignore\n setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? '').trim())\n }, [])}\n >\n <ListItem\n backgrounded\n hoverTheme\n pressTheme\n focusTheme\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\nexport const SelectItemTextFrame = styled(Paragraph, {\n name: ITEM_TEXT_NAME,\n selectable: false,\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\nexport const 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\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\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 zIndex={1000}\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\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 outline: 0,\n overflowY: 'auto',\n listStyleType: 'none',\n scrollbarWidth: 'none',\n userSelect: 'none',\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={selectedIndex}\n setActiveIndex={setActiveIndex}\n setOpen={setOpen}\n setSelectedIndex={setSelectedIndex}\n value={value}\n open={open}\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;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;AAEA,MAAM,oBAAoB,CAAC,KAAiB,EAAE,aAAuC;AACnF,QAAM,UAAU,kCAAiB,OAAO,KAAK,IAAI;AACjD,SAAO;AAAA,IACL,mBAAmB,UAAU;AAAA,IAC7B,iBAAiB,UAAU;AAAA,EAC7B;AACF;AAMA,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM,wBAAwB;AAC9B,MAAM,yBAAyB;AAC/B,MAAM,aAAa;AACnB,MAAM,qBAAqB;AAmC3B,MAAM,CAAC,qBAAqB,qBAAqB,8CAAmB,WAAW;AAC/E,MAAM,CAAC,gBAAgB,oBAAoB,oBAAwC,WAAW;AAS9F,MAAM,YAAY,CAAC,KAAK,SAAS,WAAW,WAAW;AACvD,MAAM,iBAAi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AM,KAAK;AAAA,YACX,SAAS;AAAA,YACT,WAAW;AAAA,YACX,eAAe;AAAA,YACf,gBAAgB;AAAA,YAChB,YAAY;AAAA,UACd;AAAA,UACA,iBAAiB;AACf,mCAAuB,KAAK;AAAA,UAC9B;AAAA,UACA,gBAAgB;AACd,mCAAuB,KAAK;AAAA,UAC9B;AAAA,UACA,YAAY;AACV,mCAAuB,IAAI;AAAA,UAC7B;AAAA,UACA,SAAS,OAAO;AACd,yBAAa,MAAM,cAAc,SAAS;AAAA,UAC5C;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,IACjB;AAAA,IACA,eAAe,CAAC,CAAC;AAAA,IACjB,aAAa,CAAC,CAAC;AAAA,IACf,qBAAmB;AAAA,IACnB,SAAS,QAAQ;AAAA,IACjB,SAAS;AAAA,IACT,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,KAGC,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\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\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 hoverTheme\n pressTheme\n focusTheme\n focusable={false}\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 selectable: false,\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 maxHeight: '100%',\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.useLayoutEffect(() => {\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 // @ts-ignore\n setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? '').trim())\n }, [])}\n >\n <ListItem\n backgrounded\n hoverTheme\n pressTheme\n focusTheme\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\nexport const SelectItemTextFrame = styled(Paragraph, {\n name: ITEM_TEXT_NAME,\n selectable: false,\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\nexport const 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\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\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 zIndex={1000}\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\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 outline: 0,\n overflowY: 'auto',\n listStyleType: 'none',\n scrollbarWidth: 'none',\n userSelect: 'none',\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={selectedIndex}\n setActiveIndex={setActiveIndex}\n setOpen={setOpen}\n setSelectedIndex={setSelectedIndex}\n value={value}\n open={open}\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;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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dist/esm/BubbleSelect.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
2
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var __objRest = (source, exclude) => {
|
|
5
|
+
var target = {};
|
|
6
|
+
for (var prop in source)
|
|
7
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8
|
+
target[prop] = source[prop];
|
|
9
|
+
if (source != null && __getOwnPropSymbols)
|
|
10
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
11
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
12
|
+
target[prop] = source[prop];
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
1
16
|
import { usePrevious } from "@radix-ui/react-use-previous";
|
|
2
17
|
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
3
18
|
import * as React from "react";
|
|
4
19
|
const BubbleSelect = React.forwardRef((props, forwardedRef) => {
|
|
5
|
-
const { value,
|
|
20
|
+
const _a = props, { value } = _a, selectProps = __objRest(_a, ["value"]);
|
|
6
21
|
const ref = React.useRef(null);
|
|
7
22
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
8
23
|
const prevValue = usePrevious(value);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/BubbleSelect.tsx"],
|
|
4
4
|
"sourcesContent": ["import { usePrevious } from '@radix-ui/react-use-previous'\nimport { useComposedRefs } from '@tamagui/compose-refs'\nimport * as React from 'react'\n\n/* -----------------------------------------------------------------------------------------------*/\nconst BubbleSelect = React.forwardRef<HTMLSelectElement, React.ComponentPropsWithoutRef<'select'>>(\n (props, forwardedRef) => {\n const { value, ...selectProps } = props\n const ref = React.useRef<HTMLSelectElement>(null)\n const composedRefs = useComposedRefs(forwardedRef, ref)\n const prevValue = usePrevious(value)\n\n // Bubble value change to parents (e.g form change event)\n React.useEffect(() => {\n const select = ref.current!\n const selectProto = window.HTMLSelectElement.prototype\n const descriptor = Object.getOwnPropertyDescriptor(selectProto, 'value') as PropertyDescriptor\n const setValue = descriptor.set\n if (prevValue !== value && setValue) {\n const event = new Event('change', { bubbles: true })\n setValue.call(select, value)\n select.dispatchEvent(event)\n }\n }, [prevValue, value])\n\n /**\n * We purposefully use a `select` here to support form autofill as much\n * as possible.\n *\n * We purposefully do not add the `value` attribute here to allow the value\n * to be set programatically and bubble to any parent form `onChange` event.\n * Adding the `value` will cause React to consider the programatic\n * dispatch a duplicate and it will get swallowed.\n *\n * We use `VisuallyHidden` rather than `display: \"none\"` because Safari autofill\n * won't work otherwise.\n */\n // TODO\n return null\n // return (\n // <VisuallyHidden asChild>\n // <select {...selectProps} ref={composedRefs} defaultValue={value} />\n // </VisuallyHidden>\n // )\n }\n)\n"],
|
|
5
|
-
"mappings": "AAAA;AACA;AACA;AAGA,MAAM,eAAe,MAAM,WACzB,CAAC,OAAO,iBAAiB;AACvB,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AACA;AACA;AAGA,MAAM,eAAe,MAAM,WACzB,CAAC,OAAO,iBAAiB;AACvB,QAAkC,YAA1B,YAA0B,IAAhB,wBAAgB,IAAhB,CAAV;AACR,QAAM,MAAM,MAAM,OAA0B,IAAI;AAChD,QAAM,eAAe,gBAAgB,cAAc,GAAG;AACtD,QAAM,YAAY,YAAY,KAAK;AAGnC,QAAM,UAAU,MAAM;AACpB,UAAM,SAAS,IAAI;AACnB,UAAM,cAAc,OAAO,kBAAkB;AAC7C,UAAM,aAAa,OAAO,yBAAyB,aAAa,OAAO;AACvE,UAAM,WAAW,WAAW;AAC5B,QAAI,cAAc,SAAS,UAAU;AACnC,YAAM,QAAQ,IAAI,MAAM,UAAU,EAAE,SAAS,KAAK,CAAC;AACnD,eAAS,KAAK,QAAQ,KAAK;AAC3B,aAAO,cAAc,KAAK;AAAA,IAC5B;AAAA,EACF,GAAG,CAAC,WAAW,KAAK,CAAC;AAerB,SAAO;AAMT,CACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/Select.js
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
1
32
|
import {
|
|
2
33
|
FloatingFocusManager,
|
|
3
34
|
FloatingOverlay,
|
|
@@ -18,7 +49,6 @@ import {
|
|
|
18
49
|
import { usePrevious } from "@radix-ui/react-use-previous";
|
|
19
50
|
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
20
51
|
import {
|
|
21
|
-
getVariableValue,
|
|
22
52
|
styled,
|
|
23
53
|
useIsomorphicLayoutEffect,
|
|
24
54
|
withStaticProperties
|
|
@@ -40,13 +70,6 @@ if (isFirefox) {
|
|
|
40
70
|
function getVisualOffsetTop() {
|
|
41
71
|
return !/^((?!chrome|android).)*safari/i.test(userAgent) ? visualViewport.offsetTop : 0;
|
|
42
72
|
}
|
|
43
|
-
const getSelectItemSize = (val, { tokens }) => {
|
|
44
|
-
const padding = getVariableValue(tokens.size[val]);
|
|
45
|
-
return {
|
|
46
|
-
paddingHorizontal: padding / 2,
|
|
47
|
-
paddingVertical: padding / 4
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
73
|
const SELECT_NAME = "Select";
|
|
51
74
|
const WINDOW_PADDING = 8;
|
|
52
75
|
const SCROLL_ARROW_VELOCITY = 8;
|
|
@@ -55,18 +78,19 @@ const MIN_HEIGHT = 80;
|
|
|
55
78
|
const FALLBACK_THRESHOLD = 16;
|
|
56
79
|
const [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME);
|
|
57
80
|
const [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME);
|
|
58
|
-
const OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"];
|
|
59
|
-
const SELECTION_KEYS = [" ", "Enter"];
|
|
60
81
|
const TRIGGER_NAME = "SelectTrigger";
|
|
61
82
|
const SelectTrigger = React.forwardRef((props, forwardedRef) => {
|
|
62
|
-
const {
|
|
83
|
+
const _a = props, {
|
|
63
84
|
__scopeSelect,
|
|
64
85
|
disabled = false,
|
|
65
|
-
"aria-labelledby": ariaLabelledby
|
|
66
|
-
|
|
67
|
-
|
|
86
|
+
"aria-labelledby": ariaLabelledby
|
|
87
|
+
} = _a, triggerProps = __objRest(_a, [
|
|
88
|
+
"__scopeSelect",
|
|
89
|
+
"disabled",
|
|
90
|
+
"aria-labelledby"
|
|
91
|
+
]);
|
|
68
92
|
const context = useSelectContext(TRIGGER_NAME, __scopeSelect);
|
|
69
|
-
return /* @__PURE__ */ React.createElement(ListItem, {
|
|
93
|
+
return /* @__PURE__ */ React.createElement(ListItem, __spreadValues(__spreadProps(__spreadValues({
|
|
70
94
|
backgrounded: true,
|
|
71
95
|
radiused: true,
|
|
72
96
|
hoverTheme: true,
|
|
@@ -79,11 +103,10 @@ const SelectTrigger = React.forwardRef((props, forwardedRef) => {
|
|
|
79
103
|
"aria-expanded": context.open,
|
|
80
104
|
"aria-autocomplete": "none",
|
|
81
105
|
disabled,
|
|
82
|
-
"data-disabled": disabled ? "" : void 0
|
|
83
|
-
|
|
84
|
-
ref: forwardedRef
|
|
85
|
-
|
|
86
|
-
});
|
|
106
|
+
"data-disabled": disabled ? "" : void 0
|
|
107
|
+
}, triggerProps), {
|
|
108
|
+
ref: forwardedRef
|
|
109
|
+
}), context.interactions.getReferenceProps()));
|
|
87
110
|
});
|
|
88
111
|
SelectTrigger.displayName = TRIGGER_NAME;
|
|
89
112
|
const VALUE_NAME = "SelectValue";
|
|
@@ -131,9 +154,8 @@ const SelectViewportFrame = styled(ThemeableStack, {
|
|
|
131
154
|
variants: {
|
|
132
155
|
size: {
|
|
133
156
|
"...size": (val, { tokens }) => {
|
|
134
|
-
var _a;
|
|
135
157
|
return {
|
|
136
|
-
borderRadius:
|
|
158
|
+
borderRadius: tokens.radius[val] ?? val
|
|
137
159
|
};
|
|
138
160
|
}
|
|
139
161
|
}
|
|
@@ -143,7 +165,7 @@ const SelectViewportFrame = styled(ThemeableStack, {
|
|
|
143
165
|
}
|
|
144
166
|
});
|
|
145
167
|
const SelectViewport = React.forwardRef((props, forwardedRef) => {
|
|
146
|
-
const { __scopeSelect, children,
|
|
168
|
+
const _a = props, { __scopeSelect, children } = _a, viewportProps = __objRest(_a, ["__scopeSelect", "children"]);
|
|
147
169
|
const context = useSelectContext(VIEWPORT_NAME, __scopeSelect);
|
|
148
170
|
const composedRefs = useComposedRefs(forwardedRef);
|
|
149
171
|
const prevScrollTopRef = React.useRef(0);
|
|
@@ -154,31 +176,34 @@ const SelectViewport = React.forwardRef((props, forwardedRef) => {
|
|
|
154
176
|
}), /* @__PURE__ */ React.createElement(FloatingFocusManager, {
|
|
155
177
|
context: context.floatingContext,
|
|
156
178
|
preventTabbing: true
|
|
157
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
158
|
-
...context.interactions.getFloatingProps()
|
|
159
|
-
}, /* @__PURE__ */ React.createElement(SelectViewportFrame, {
|
|
179
|
+
}, /* @__PURE__ */ React.createElement("div", __spreadValues({}, context.interactions.getFloatingProps()), /* @__PURE__ */ React.createElement(SelectViewportFrame, __spreadProps(__spreadValues({
|
|
160
180
|
size: context.size,
|
|
161
181
|
"data-radix-select-viewport": "",
|
|
162
|
-
role: "presentation"
|
|
163
|
-
|
|
182
|
+
role: "presentation"
|
|
183
|
+
}, viewportProps), {
|
|
164
184
|
ref: composedRefs
|
|
165
|
-
}, children))));
|
|
185
|
+
}), children))));
|
|
166
186
|
});
|
|
167
187
|
SelectViewport.displayName = VIEWPORT_NAME;
|
|
168
188
|
const ITEM_NAME = "SelectItem";
|
|
169
189
|
const [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);
|
|
170
190
|
const SelectItem = React.forwardRef((props, forwardedRef) => {
|
|
171
|
-
const {
|
|
191
|
+
const _a = props, {
|
|
172
192
|
__scopeSelect,
|
|
173
193
|
value,
|
|
174
194
|
disabled = false,
|
|
175
195
|
textValue: textValueProp,
|
|
176
|
-
index
|
|
177
|
-
|
|
178
|
-
|
|
196
|
+
index
|
|
197
|
+
} = _a, itemProps = __objRest(_a, [
|
|
198
|
+
"__scopeSelect",
|
|
199
|
+
"value",
|
|
200
|
+
"disabled",
|
|
201
|
+
"textValue",
|
|
202
|
+
"index"
|
|
203
|
+
]);
|
|
179
204
|
const context = useSelectContext(ITEM_NAME, __scopeSelect);
|
|
180
205
|
const isSelected = context.value === value;
|
|
181
|
-
const [textValue, setTextValue] = React.useState(textValueProp
|
|
206
|
+
const [textValue, setTextValue] = React.useState(textValueProp ?? "");
|
|
182
207
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
183
208
|
const textId = useId();
|
|
184
209
|
const {
|
|
@@ -239,12 +264,9 @@ const SelectItem = React.forwardRef((props, forwardedRef) => {
|
|
|
239
264
|
textId: textId || "",
|
|
240
265
|
isSelected,
|
|
241
266
|
onItemTextChange: React.useCallback((node) => {
|
|
242
|
-
setTextValue((prevTextValue) =>
|
|
243
|
-
var _a;
|
|
244
|
-
return prevTextValue || ((_a = node == null ? void 0 : node.textContent) != null ? _a : "").trim();
|
|
245
|
-
});
|
|
267
|
+
setTextValue((prevTextValue) => prevTextValue || ((node == null ? void 0 : node.textContent) ?? "").trim());
|
|
246
268
|
}, [])
|
|
247
|
-
}, /* @__PURE__ */ React.createElement(ListItem, {
|
|
269
|
+
}, /* @__PURE__ */ React.createElement(ListItem, __spreadValues(__spreadValues({
|
|
248
270
|
backgrounded: true,
|
|
249
271
|
hoverTheme: true,
|
|
250
272
|
pressTheme: true,
|
|
@@ -257,10 +279,8 @@ const SelectItem = React.forwardRef((props, forwardedRef) => {
|
|
|
257
279
|
"aria-disabled": disabled || void 0,
|
|
258
280
|
"data-disabled": disabled ? "" : void 0,
|
|
259
281
|
tabIndex: disabled ? void 0 : -1,
|
|
260
|
-
size: context.size
|
|
261
|
-
|
|
262
|
-
...selectItemProps
|
|
263
|
-
}));
|
|
282
|
+
size: context.size
|
|
283
|
+
}, itemProps), selectItemProps)));
|
|
264
284
|
});
|
|
265
285
|
SelectItem.displayName = ITEM_NAME;
|
|
266
286
|
const ITEM_TEXT_NAME = "SelectItemText";
|
|
@@ -269,17 +289,17 @@ const SelectItemTextFrame = styled(Paragraph, {
|
|
|
269
289
|
selectable: false
|
|
270
290
|
});
|
|
271
291
|
const SelectItemText = React.forwardRef((props, forwardedRef) => {
|
|
272
|
-
const { __scopeSelect, className, style,
|
|
292
|
+
const _a = props, { __scopeSelect, className, style } = _a, itemTextProps = __objRest(_a, ["__scopeSelect", "className", "style"]);
|
|
273
293
|
const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
274
294
|
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
275
295
|
const ref = React.useRef(null);
|
|
276
296
|
const composedRefs = useComposedRefs(forwardedRef, ref, itemContext.onItemTextChange);
|
|
277
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SelectItemTextFrame, {
|
|
297
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SelectItemTextFrame, __spreadProps(__spreadValues({
|
|
278
298
|
size: context.size,
|
|
279
|
-
id: itemContext.textId
|
|
280
|
-
|
|
299
|
+
id: itemContext.textId
|
|
300
|
+
}, itemTextProps), {
|
|
281
301
|
ref: composedRefs
|
|
282
|
-
}), itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM.createPortal(itemTextProps.children, context.valueNode) : null);
|
|
302
|
+
})), itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM.createPortal(itemTextProps.children, context.valueNode) : null);
|
|
283
303
|
});
|
|
284
304
|
SelectItemText.displayName = ITEM_TEXT_NAME;
|
|
285
305
|
const ITEM_INDICATOR_NAME = "SelectItemIndicator";
|
|
@@ -287,13 +307,13 @@ const SelectItemIndicatorFrame = styled(XStack, {
|
|
|
287
307
|
name: ITEM_TEXT_NAME
|
|
288
308
|
});
|
|
289
309
|
const SelectItemIndicator = React.forwardRef((props, forwardedRef) => {
|
|
290
|
-
const { __scopeSelect,
|
|
310
|
+
const _a = props, { __scopeSelect } = _a, itemIndicatorProps = __objRest(_a, ["__scopeSelect"]);
|
|
291
311
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
|
|
292
|
-
return itemContext.isSelected ? /* @__PURE__ */ React.createElement(SelectItemIndicatorFrame, {
|
|
293
|
-
"aria-hidden": true
|
|
294
|
-
|
|
312
|
+
return itemContext.isSelected ? /* @__PURE__ */ React.createElement(SelectItemIndicatorFrame, __spreadProps(__spreadValues({
|
|
313
|
+
"aria-hidden": true
|
|
314
|
+
}, itemIndicatorProps), {
|
|
295
315
|
ref: forwardedRef
|
|
296
|
-
}) : null;
|
|
316
|
+
})) : null;
|
|
297
317
|
});
|
|
298
318
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
299
319
|
const GROUP_NAME = "SelectGroup";
|
|
@@ -303,58 +323,58 @@ const SelectGroupFrame = styled(YStack, {
|
|
|
303
323
|
width: "100%"
|
|
304
324
|
});
|
|
305
325
|
const SelectGroup = React.forwardRef((props, forwardedRef) => {
|
|
306
|
-
const { __scopeSelect,
|
|
326
|
+
const _a = props, { __scopeSelect } = _a, groupProps = __objRest(_a, ["__scopeSelect"]);
|
|
307
327
|
const groupId = useId();
|
|
308
328
|
return /* @__PURE__ */ React.createElement(SelectGroupContextProvider, {
|
|
309
329
|
scope: __scopeSelect,
|
|
310
330
|
id: groupId || ""
|
|
311
|
-
}, /* @__PURE__ */ React.createElement(SelectGroupFrame, {
|
|
331
|
+
}, /* @__PURE__ */ React.createElement(SelectGroupFrame, __spreadProps(__spreadValues({
|
|
312
332
|
role: "group",
|
|
313
|
-
"aria-labelledby": groupId
|
|
314
|
-
|
|
333
|
+
"aria-labelledby": groupId
|
|
334
|
+
}, groupProps), {
|
|
315
335
|
ref: forwardedRef
|
|
316
|
-
}));
|
|
336
|
+
})));
|
|
317
337
|
});
|
|
318
338
|
SelectGroup.displayName = GROUP_NAME;
|
|
319
339
|
const LABEL_NAME = "SelectLabel";
|
|
320
340
|
const SelectLabel = React.forwardRef((props, forwardedRef) => {
|
|
321
|
-
const { __scopeSelect,
|
|
341
|
+
const _a = props, { __scopeSelect } = _a, labelProps = __objRest(_a, ["__scopeSelect"]);
|
|
322
342
|
const context = useSelectContext(LABEL_NAME, __scopeSelect);
|
|
323
343
|
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
|
324
|
-
return /* @__PURE__ */ React.createElement(ListItem, {
|
|
344
|
+
return /* @__PURE__ */ React.createElement(ListItem, __spreadProps(__spreadValues({
|
|
325
345
|
componentName: LABEL_NAME,
|
|
326
346
|
fontWeight: "800",
|
|
327
347
|
id: groupContext.id,
|
|
328
|
-
size: context.size
|
|
329
|
-
|
|
348
|
+
size: context.size
|
|
349
|
+
}, labelProps), {
|
|
330
350
|
ref: forwardedRef
|
|
331
|
-
});
|
|
351
|
+
}));
|
|
332
352
|
});
|
|
333
353
|
SelectLabel.displayName = LABEL_NAME;
|
|
334
354
|
const SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
335
355
|
const SelectScrollUpButton = React.forwardRef((props, forwardedRef) => {
|
|
336
|
-
return /* @__PURE__ */ React.createElement(SelectScrollButtonImpl, {
|
|
337
|
-
componentName: SCROLL_UP_BUTTON_NAME
|
|
338
|
-
|
|
356
|
+
return /* @__PURE__ */ React.createElement(SelectScrollButtonImpl, __spreadProps(__spreadValues({
|
|
357
|
+
componentName: SCROLL_UP_BUTTON_NAME
|
|
358
|
+
}, props), {
|
|
339
359
|
dir: "up",
|
|
340
360
|
ref: forwardedRef
|
|
341
|
-
});
|
|
361
|
+
}));
|
|
342
362
|
});
|
|
343
363
|
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
|
|
344
364
|
const SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
345
365
|
const SelectScrollDownButton = React.forwardRef((props, forwardedRef) => {
|
|
346
|
-
return /* @__PURE__ */ React.createElement(SelectScrollButtonImpl, {
|
|
347
|
-
componentName: SCROLL_DOWN_BUTTON_NAME
|
|
348
|
-
|
|
366
|
+
return /* @__PURE__ */ React.createElement(SelectScrollButtonImpl, __spreadProps(__spreadValues({
|
|
367
|
+
componentName: SCROLL_DOWN_BUTTON_NAME
|
|
368
|
+
}, props), {
|
|
349
369
|
dir: "down",
|
|
350
370
|
ref: forwardedRef
|
|
351
|
-
});
|
|
371
|
+
}));
|
|
352
372
|
});
|
|
353
373
|
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
354
374
|
const SelectScrollButtonImpl = React.forwardRef((props, forwardedRef) => {
|
|
355
|
-
var
|
|
356
|
-
const { __scopeSelect, dir, componentName,
|
|
357
|
-
const { floatingRef, increaseHeight, forceUpdate,
|
|
375
|
+
var _c;
|
|
376
|
+
const _a = props, { __scopeSelect, dir, componentName } = _a, scrollIndicatorProps = __objRest(_a, ["__scopeSelect", "dir", "componentName"]);
|
|
377
|
+
const _b = useSelectContext(componentName, __scopeSelect), { floatingRef, increaseHeight, forceUpdate } = _b, context = __objRest(_b, ["floatingRef", "increaseHeight", "forceUpdate"]);
|
|
358
378
|
const intervalRef = React.useRef();
|
|
359
379
|
const loopingRef = React.useRef(false);
|
|
360
380
|
const isVisible = context[dir === "down" ? "canScrollDown" : "canScrollUp"];
|
|
@@ -394,16 +414,16 @@ const SelectScrollButtonImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
394
414
|
forceUpdate();
|
|
395
415
|
}
|
|
396
416
|
};
|
|
397
|
-
return /* @__PURE__ */ React.createElement(YStack, {
|
|
417
|
+
return /* @__PURE__ */ React.createElement(YStack, __spreadProps(__spreadValues({
|
|
398
418
|
ref: composedRefs,
|
|
399
419
|
componentName,
|
|
400
|
-
"aria-hidden": true
|
|
401
|
-
|
|
420
|
+
"aria-hidden": true
|
|
421
|
+
}, scrollIndicatorProps), {
|
|
402
422
|
zIndex: 1e3,
|
|
403
423
|
position: strategy,
|
|
404
424
|
left: x || 0,
|
|
405
425
|
top: y || 0,
|
|
406
|
-
width: `calc(${((
|
|
426
|
+
width: `calc(${(((_c = floatingRef.current) == null ? void 0 : _c.offsetWidth) ?? 0) - 2}px)`,
|
|
407
427
|
background: `linear-gradient(to ${dir === "up" ? "bottom" : "top"}, #29282b 50%, rgba(53, 54, 55, 0.01))`,
|
|
408
428
|
onPointerMove: () => {
|
|
409
429
|
if (!loopingRef.current) {
|
|
@@ -415,7 +435,7 @@ const SelectScrollButtonImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
415
435
|
loopingRef.current = false;
|
|
416
436
|
clearInterval(intervalRef.current);
|
|
417
437
|
}
|
|
418
|
-
});
|
|
438
|
+
}));
|
|
419
439
|
});
|
|
420
440
|
const SelectSeparator = styled(Separator, {
|
|
421
441
|
name: "SelectSeparator"
|
|
@@ -488,8 +508,7 @@ const Select = withStaticProperties((props) => {
|
|
|
488
508
|
placement: "bottom",
|
|
489
509
|
middleware: middlewareType === "align" ? [
|
|
490
510
|
offset(({ rects }) => {
|
|
491
|
-
|
|
492
|
-
const index = (_a = activeIndexRef.current) != null ? _a : selectedIndexRef.current;
|
|
511
|
+
const index = activeIndexRef.current ?? selectedIndexRef.current;
|
|
493
512
|
if (index == null) {
|
|
494
513
|
return 0;
|
|
495
514
|
}
|
|
@@ -604,7 +623,7 @@ const Select = withStaticProperties((props) => {
|
|
|
604
623
|
}, [middlewareType]);
|
|
605
624
|
const touchPageYRef = React.useRef(null);
|
|
606
625
|
const handleWheel = React.useCallback((event) => {
|
|
607
|
-
var _a
|
|
626
|
+
var _a;
|
|
608
627
|
const pinching = event.ctrlKey;
|
|
609
628
|
const currentTarget = event.currentTarget;
|
|
610
629
|
function isWheelEvent(event2) {
|
|
@@ -613,7 +632,7 @@ const Select = withStaticProperties((props) => {
|
|
|
613
632
|
function isTouchEvent(event2) {
|
|
614
633
|
return event2.touches != null;
|
|
615
634
|
}
|
|
616
|
-
if (Math.abs(((
|
|
635
|
+
if (Math.abs(((currentTarget == null ? void 0 : currentTarget.offsetHeight) ?? 0) - (visualViewport.height - WINDOW_PADDING * 2)) > 1 && !pinching) {
|
|
617
636
|
event.preventDefault();
|
|
618
637
|
} else if (isWheelEvent(event) && isFirefox) {
|
|
619
638
|
currentTarget.scrollTop += event.deltaY;
|
|
@@ -622,7 +641,7 @@ const Select = withStaticProperties((props) => {
|
|
|
622
641
|
let delta = 5;
|
|
623
642
|
if (isTouchEvent(event)) {
|
|
624
643
|
const currentPageY = touchPageYRef.current;
|
|
625
|
-
const pageY = (
|
|
644
|
+
const pageY = (_a = event.touches[0]) == null ? void 0 : _a.pageY;
|
|
626
645
|
if (pageY != null) {
|
|
627
646
|
touchPageYRef.current = pageY;
|
|
628
647
|
if (currentPageY != null) {
|
|
@@ -658,12 +677,12 @@ const Select = withStaticProperties((props) => {
|
|
|
658
677
|
};
|
|
659
678
|
}, [update]);
|
|
660
679
|
React.useLayoutEffect(() => {
|
|
661
|
-
var _a
|
|
680
|
+
var _a;
|
|
662
681
|
const floating2 = floatingRef.current;
|
|
663
682
|
if (open && controlledScrolling && floating2) {
|
|
664
683
|
const item = activeIndex != null ? listItemsRef.current[activeIndex] : selectedIndex != null ? listItemsRef.current[selectedIndex] : null;
|
|
665
684
|
if (item && prevActiveIndex != null) {
|
|
666
|
-
const itemHeight = (
|
|
685
|
+
const itemHeight = ((_a = listItemsRef.current[prevActiveIndex]) == null ? void 0 : _a.offsetHeight) ?? 0;
|
|
667
686
|
const floatingHeight = floating2.offsetHeight;
|
|
668
687
|
const top = item.offsetTop;
|
|
669
688
|
const bottom = top + itemHeight;
|
|
@@ -677,7 +696,7 @@ const Select = withStaticProperties((props) => {
|
|
|
677
696
|
const diff = bottom - floatingHeight - floating2.scrollTop + 20;
|
|
678
697
|
floating2.scrollTop += diff;
|
|
679
698
|
if (activeIndex != selectedIndex && activeIndex != null) {
|
|
680
|
-
floating2.scrollTop -=
|
|
699
|
+
floating2.scrollTop -= increaseHeight(floating2, diff) ?? 0;
|
|
681
700
|
}
|
|
682
701
|
}
|
|
683
702
|
}
|
|
@@ -755,8 +774,7 @@ const Select = withStaticProperties((props) => {
|
|
|
755
774
|
setValueAtIndex: (index, value2) => {
|
|
756
775
|
listContentRef.current[index] = value2;
|
|
757
776
|
},
|
|
758
|
-
interactions: {
|
|
759
|
-
...interactions,
|
|
777
|
+
interactions: __spreadProps(__spreadValues({}, interactions), {
|
|
760
778
|
getReferenceProps() {
|
|
761
779
|
return interactions.getReferenceProps({
|
|
762
780
|
ref: reference,
|
|
@@ -775,8 +793,8 @@ const Select = withStaticProperties((props) => {
|
|
|
775
793
|
className: "Select",
|
|
776
794
|
style: {
|
|
777
795
|
position: strategy,
|
|
778
|
-
top: y
|
|
779
|
-
left: x
|
|
796
|
+
top: y ?? "",
|
|
797
|
+
left: x ?? "",
|
|
780
798
|
outline: 0,
|
|
781
799
|
overflowY: "auto",
|
|
782
800
|
listStyleType: "none",
|
|
@@ -797,7 +815,7 @@ const Select = withStaticProperties((props) => {
|
|
|
797
815
|
}
|
|
798
816
|
});
|
|
799
817
|
}
|
|
800
|
-
},
|
|
818
|
+
}),
|
|
801
819
|
floatingContext: context,
|
|
802
820
|
activeIndex,
|
|
803
821
|
canScrollDown: !!showDownArrow,
|
package/dist/esm/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 { 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 hoverTheme\n pressTheme\n focusTheme\n focusable={false}\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 selectable: false,\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 maxHeight: '100%',\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.useLayoutEffect(() => {\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 // @ts-ignore\n setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? '').trim())\n }, [])}\n >\n <ListItem\n backgrounded\n hoverTheme\n pressTheme\n focusTheme\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\nexport const SelectItemTextFrame = styled(Paragraph, {\n name: ITEM_TEXT_NAME,\n selectable: false,\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\nexport const 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\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\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 zIndex={1000}\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\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 outline: 0,\n overflowY: 'auto',\n listStyleType: 'none',\n scrollbarWidth: 'none',\n userSelect: 'none',\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={selectedIndex}\n setActiveIndex={setActiveIndex}\n setOpen={setOpen}\n setSelectedIndex={setSelectedIndex}\n value={value}\n open={open}\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;AAAA;AAAA;AAAA;AAAA;AAqBA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA;AACA;AAGA;AAGA;AACA;AACA;AAGA;AAIA;AACA;AAQA,MAAM,YAAa,OAAO,cAAc,eAAe,UAAU,aAAc;AAC/E,MAAM,YAAY,UAAU,YA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;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\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\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 hoverTheme\n pressTheme\n focusTheme\n focusable={false}\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 selectable: false,\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 maxHeight: '100%',\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.useLayoutEffect(() => {\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 // @ts-ignore\n setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? '').trim())\n }, [])}\n >\n <ListItem\n backgrounded\n hoverTheme\n pressTheme\n focusTheme\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\nexport const SelectItemTextFrame = styled(Paragraph, {\n name: ITEM_TEXT_NAME,\n selectable: false,\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\nexport const 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\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\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 zIndex={1000}\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\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 outline: 0,\n overflowY: 'auto',\n listStyleType: 'none',\n scrollbarWidth: 'none',\n userSelect: 'none',\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={selectedIndex}\n setActiveIndex={setActiveIndex}\n setOpen={setOpen}\n setSelectedIndex={setSelectedIndex}\n value={value}\n open={open}\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;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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;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/Select.js
CHANGED
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
import { usePrevious } from "@radix-ui/react-use-previous";
|
|
19
19
|
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
20
20
|
import {
|
|
21
|
-
getVariableValue,
|
|
22
21
|
styled,
|
|
23
22
|
useIsomorphicLayoutEffect,
|
|
24
23
|
withStaticProperties
|
|
@@ -40,13 +39,6 @@ if (isFirefox) {
|
|
|
40
39
|
function getVisualOffsetTop() {
|
|
41
40
|
return !/^((?!chrome|android).)*safari/i.test(userAgent) ? visualViewport.offsetTop : 0;
|
|
42
41
|
}
|
|
43
|
-
const getSelectItemSize = (val, { tokens }) => {
|
|
44
|
-
const padding = getVariableValue(tokens.size[val]);
|
|
45
|
-
return {
|
|
46
|
-
paddingHorizontal: padding / 2,
|
|
47
|
-
paddingVertical: padding / 4
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
42
|
const SELECT_NAME = "Select";
|
|
51
43
|
const WINDOW_PADDING = 8;
|
|
52
44
|
const SCROLL_ARROW_VELOCITY = 8;
|
|
@@ -55,8 +47,6 @@ const MIN_HEIGHT = 80;
|
|
|
55
47
|
const FALLBACK_THRESHOLD = 16;
|
|
56
48
|
const [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME);
|
|
57
49
|
const [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME);
|
|
58
|
-
const OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"];
|
|
59
|
-
const SELECTION_KEYS = [" ", "Enter"];
|
|
60
50
|
const TRIGGER_NAME = "SelectTrigger";
|
|
61
51
|
const SelectTrigger = React.forwardRef((props, forwardedRef) => {
|
|
62
52
|
const {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/select",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.76",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"@floating-ui/react-native": "^0.7.0",
|
|
27
27
|
"@radix-ui/react-use-callback-ref": "^0.1.0",
|
|
28
28
|
"@radix-ui/react-use-previous": "^0.1.1",
|
|
29
|
-
"@tamagui/compose-refs": "^1.0.1-beta.
|
|
30
|
-
"@tamagui/core": "^1.0.1-beta.
|
|
31
|
-
"@tamagui/create-context": "^1.0.1-beta.
|
|
32
|
-
"@tamagui/list-item": "^1.0.1-beta.
|
|
33
|
-
"@tamagui/separator": "^1.0.1-beta.
|
|
34
|
-
"@tamagui/stacks": "^1.0.1-beta.
|
|
35
|
-
"@tamagui/text": "^1.0.1-beta.
|
|
36
|
-
"@tamagui/use-controllable-state": "^1.0.1-beta.
|
|
29
|
+
"@tamagui/compose-refs": "^1.0.1-beta.76",
|
|
30
|
+
"@tamagui/core": "^1.0.1-beta.76",
|
|
31
|
+
"@tamagui/create-context": "^1.0.1-beta.76",
|
|
32
|
+
"@tamagui/list-item": "^1.0.1-beta.76",
|
|
33
|
+
"@tamagui/separator": "^1.0.1-beta.76",
|
|
34
|
+
"@tamagui/stacks": "^1.0.1-beta.76",
|
|
35
|
+
"@tamagui/text": "^1.0.1-beta.76",
|
|
36
|
+
"@tamagui/use-controllable-state": "^1.0.1-beta.76"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "*",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"react-native": "*"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
44
|
+
"@tamagui/build": "^1.0.1-beta.76",
|
|
45
45
|
"@types/react-native": "^0.67.3",
|
|
46
46
|
"react": "*",
|
|
47
47
|
"react-dom": "*",
|