@huin-core/react-select 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.mts +145 -0
- package/dist/index.d.ts +145 -0
- package/dist/index.js +1385 -0
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +1353 -0
- package/dist/index.mjs.map +7 -0
- package/package.json +20 -20
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../src/Select.tsx", "../src/SelectTrigger.tsx", "../src/SelectContent.tsx", "../src/SelectViewport.tsx", "../src/SelectValue.tsx", "../src/SelectIcon.tsx", "../src/SelectPortal.tsx", "../src/SelectGroup.tsx", "../src/SelectLabel.tsx", "../src/SelectItem.tsx", "../src/SelectItemText.tsx", "../src/SelectItemIndicator.tsx", "../src/SelectScrollUpButton.tsx", "../src/SelectScrollDownButton.tsx", "../src/SelectSeparator.tsx", "../src/SelectArrow.tsx"],
|
4
|
+
"sourcesContent": ["import * as React from \"react\";\nimport { createCollection } from \"@huin-core/react-collection\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { createContextScope } from \"@huin-core/react-context\";\nimport { useDirection } from \"@huin-core/react-direction\";\nimport { useId } from \"@huin-core/react-id\";\nimport * as PopperPrimitive from \"@huin-core/react-popper\";\nimport { createPopperScope } from \"@huin-core/react-popper\";\nimport { useControllableState } from \"@huin-core/react-use-controllable-state\";\nimport { usePrevious } from \"@huin-core/react-use-previous\";\nimport { VisuallyHidden } from \"@huin-core/react-visually-hidden\";\n\nimport type { Scope } from \"@huin-core/react-context\";\nimport { SelectItemElement } from \"./SelectItem\";\nimport { SelectTriggerElement } from \"./SelectTrigger\";\nimport { SelectValueElement } from \"./SelectValue\";\n\ntype Direction = \"ltr\" | \"rtl\";\n\n\n/* -------------------------------------------------------------------------------------------------\n * Select\n * -----------------------------------------------------------------------------------------------*/\n\nconst SELECT_NAME = \"Select\";\n\ntype ItemData = { value: string; disabled: boolean; textValue: string };\nexport const [Collection, useCollection, createCollectionScope] = createCollection<\n SelectItemElement,\n ItemData\n>(SELECT_NAME);\n\nexport type ScopedProps<P> = P & { __scopeSelect?: Scope };\nexport const [createSelectContext, createSelectScope] = createContextScope(\n SELECT_NAME,\n [createCollectionScope, createPopperScope]\n);\nexport const usePopperScope = createPopperScope();\n\ntype SelectContextValue = {\n trigger: SelectTriggerElement | null;\n onTriggerChange(node: SelectTriggerElement | null): void;\n valueNode: SelectValueElement | null;\n onValueNodeChange(node: SelectValueElement): void;\n valueNodeHasChildren: boolean;\n onValueNodeHasChildrenChange(hasChildren: boolean): void;\n contentId: string;\n value?: string;\n onValueChange(value: string): void;\n open: boolean;\n required?: boolean;\n onOpenChange(open: boolean): void;\n dir: SelectProps[\"dir\"];\n triggerPointerDownPosRef: React.MutableRefObject<{\n x: number;\n y: number;\n } | null>;\n disabled?: boolean;\n};\n\nexport const [SelectProvider, useSelectContext] =\n createSelectContext<SelectContextValue>(SELECT_NAME);\n\ntype NativeOption = React.ReactElement<React.ComponentProps<\"option\">>;\n\ntype SelectNativeOptionsContextValue = {\n onNativeOptionAdd(option: NativeOption): void;\n onNativeOptionRemove(option: NativeOption): void;\n};\nexport const [SelectNativeOptionsProvider, useSelectNativeOptionsContext] =\n createSelectContext<SelectNativeOptionsContextValue>(SELECT_NAME);\n\ninterface SelectProps {\n children?: React.ReactNode;\n value?: string;\n defaultValue?: string;\n onValueChange?(value: string): void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n name?: string;\n autoComplete?: string;\n disabled?: boolean;\n required?: boolean;\n}\n\nconst Select: React.FC<SelectProps> = (props: ScopedProps<SelectProps>) => {\n const {\n __scopeSelect,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n value: valueProp,\n defaultValue,\n onValueChange,\n dir,\n name,\n autoComplete,\n disabled,\n required,\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const [trigger, setTrigger] = React.useState<SelectTriggerElement | null>(\n null\n );\n const [valueNode, setValueNode] = React.useState<SelectValueElement | null>(\n null\n );\n const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);\n const direction = useDirection(dir);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n const triggerPointerDownPosRef = React.useRef<{\n x: number;\n y: number;\n } | null>(null);\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 [nativeOptionsSet, setNativeOptionsSet] = React.useState(\n new Set<NativeOption>()\n );\n\n // The native `select` only associates the correct default value if the corresponding\n // `option` is rendered as a child **at the same time** as itself.\n // Because it might take a few renders for our items to gather the information to build\n // the native `option`(s), we generate a key on the `select` to make sure React re-builds it\n // each time the options change.\n const nativeSelectKey = Array.from(nativeOptionsSet)\n .map((option) => option.props.value)\n .join(\";\");\n\n return (\n <PopperPrimitive.Root {...popperScope}>\n <SelectProvider\n required={required}\n scope={__scopeSelect}\n trigger={trigger}\n onTriggerChange={setTrigger}\n valueNode={valueNode}\n onValueNodeChange={setValueNode}\n valueNodeHasChildren={valueNodeHasChildren}\n onValueNodeHasChildrenChange={setValueNodeHasChildren}\n contentId={useId()}\n value={value}\n onValueChange={setValue}\n open={open}\n onOpenChange={setOpen}\n dir={direction}\n triggerPointerDownPosRef={triggerPointerDownPosRef}\n disabled={disabled}\n >\n <Collection.Provider scope={__scopeSelect}>\n <SelectNativeOptionsProvider\n scope={props.__scopeSelect}\n onNativeOptionAdd={React.useCallback((option) => {\n setNativeOptionsSet((prev) => new Set(prev).add(option));\n }, [])}\n onNativeOptionRemove={React.useCallback((option) => {\n setNativeOptionsSet((prev) => {\n const optionsSet = new Set(prev);\n optionsSet.delete(option);\n return optionsSet;\n });\n }, [])}\n >\n {children}\n </SelectNativeOptionsProvider>\n </Collection.Provider>\n\n {isFormControl ? (\n <BubbleSelect\n key={nativeSelectKey}\n aria-hidden\n required={required}\n tabIndex={-1}\n name={name}\n autoComplete={autoComplete}\n value={value}\n // enable form autofill\n onChange={(event) => setValue(event.target.value)}\n disabled={disabled}\n >\n {value === undefined ? <option value=\"\" /> : null}\n {Array.from(nativeOptionsSet)}\n </BubbleSelect>\n ) : null}\n </SelectProvider>\n </PopperPrimitive.Root>\n );\n};\n\nSelect.displayName = SELECT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\n\nconst BubbleSelect = React.forwardRef<\n HTMLSelectElement,\n 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(\n selectProto,\n \"value\"\n ) 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 return (\n <VisuallyHidden asChild>\n <select {...selectProps} ref={composedRefs} defaultValue={value} />\n </VisuallyHidden>\n );\n});\n\nBubbleSelect.displayName = \"BubbleSelect\";\n\nconst Root = Select;\n\nexport { Select, Root };\nexport type { SelectProps };\n", "import React from \"react\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport {\n ScopedProps,\n useCollection,\n usePopperScope,\n useSelectContext,\n} from \"./Select\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { findNextItem, useTypeaheadSearch } from \"./SelectContent\";\nimport * as PopperPrimitive from \"@huin-core/react-popper\";\nimport { shouldShowPlaceholder } from \"./SelectValue\";\nimport { composeEventHandlers } from \"@huin-core/primitive\";\n\nconst OPEN_KEYS = [\" \", \"Enter\", \"ArrowUp\", \"ArrowDown\"];\n\nconst TRIGGER_NAME = \"SelectTrigger\";\n\nexport type SelectTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<\n typeof Primitive.button\n>;\ninterface SelectTriggerProps extends PrimitiveButtonProps {}\n\nconst SelectTrigger = React.forwardRef<\n SelectTriggerElement,\n SelectTriggerProps\n>((props: ScopedProps<SelectTriggerProps>, forwardedRef) => {\n const { __scopeSelect, disabled = false, ...triggerProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(TRIGGER_NAME, __scopeSelect);\n const isDisabled = context.disabled || disabled;\n const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);\n const getItems = useCollection(__scopeSelect);\n const pointerTypeRef = React.useRef<React.PointerEvent['pointerType']>('touch');\n\n const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch(\n (search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find(\n (item) => item.value === context.value\n );\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem !== undefined) {\n context.onValueChange(nextItem.value);\n }\n }\n );\n\n const handleOpen = (pointerEvent?: React.MouseEvent | React.PointerEvent) => {\n if (!isDisabled) {\n context.onOpenChange(true);\n // reset typeahead when we open\n resetTypeahead();\n }\n\n if (pointerEvent) {\n context.triggerPointerDownPosRef.current = {\n x: Math.round(pointerEvent.pageX),\n y: Math.round(pointerEvent.pageY),\n };\n }\n };\n\n return (\n <PopperPrimitive.Anchor asChild {...popperScope}>\n <Primitive.button\n type=\"button\"\n role=\"combobox\"\n aria-controls={context.contentId}\n aria-expanded={context.open}\n aria-required={context.required}\n aria-autocomplete=\"none\"\n dir={context.dir}\n data-state={context.open ? 'open' : 'closed'}\n disabled={isDisabled}\n data-disabled={isDisabled ? '' : undefined}\n data-placeholder={shouldShowPlaceholder(context.value) ? '' : undefined}\n {...triggerProps}\n ref={composedRefs}\n // Enable compatibility with native label or custom `Label` \"click\" for Safari:\n onClick={composeEventHandlers(triggerProps.onClick, (event) => {\n // Whilst browsers generally have no issue focusing the trigger when clicking\n // on a label, Safari seems to struggle with the fact that there's no `onClick`.\n // We force `focus` in this case. Note: this doesn't create any other side-effect\n // because we are preventing default in `onPointerDown` so effectively\n // this only runs for a label \"click\"\n event.currentTarget.focus();\n\n // Open on click when using a touch or pen device\n if (pointerTypeRef.current !== 'mouse') {\n handleOpen(event);\n }\n })}\n onPointerDown={composeEventHandlers(triggerProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n\n // prevent implicit pointer capture\n // https://www.w3.org/TR/pointerevents3/#implicit-pointer-capture\n const target = event.target as HTMLElement;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click); also not for touch\n // devices because that would open the menu on scroll. (pen devices behave as touch on iOS).\n if (event.button === 0 && event.ctrlKey === false && event.pointerType === 'mouse') {\n handleOpen(event);\n // prevent trigger from stealing focus from the active item after opening.\n event.preventDefault();\n }\n })}\n onKeyDown={composeEventHandlers(triggerProps.onKeyDown, (event) => {\n const isTypingAhead = searchRef.current !== '';\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n if (isTypingAhead && event.key === ' ') return;\n if (OPEN_KEYS.includes(event.key)) {\n handleOpen();\n event.preventDefault();\n }\n })}\n />\n </PopperPrimitive.Anchor>\n );\n});\n\nSelectTrigger.displayName = TRIGGER_NAME;\n\nexport { SelectTrigger };\nexport type { SelectTriggerProps };\n", "import React from \"react\";\nimport {\n Collection,\n createSelectContext,\n ScopedProps,\n useCollection,\n usePopperScope,\n useSelectContext,\n} from \"./Select\";\nimport { useLayoutEffect } from \"@huin-core/react-use-layout-effect\";\nimport ReactDOM from \"react-dom\";\nimport { Primitive } from \"@huin-core/react-primitive\";\n\nimport { PrimitiveDivProps, SelectViewportElement, SelectViewportProvider } from \"./SelectViewport\";\nimport { SelectItemElement } from \"./SelectItem\";\nimport { SelectItemTextElement } from \"./SelectItemText\";\nimport { DismissableLayer } from \"@huin-core/react-dismissable-layer\";\nimport { FocusScope } from \"@huin-core/react-focus-scope\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { hideOthers } from \"aria-hidden\";\nimport { useFocusGuards } from \"@huin-core/react-focus-guards\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { Slot } from \"@huin-core/react-slot\";\nimport { composeEventHandlers } from \"@huin-core/primitive\";\nimport { clamp } from \"@huin-core/number\";\nimport * as PopperPrimitive from \"@huin-core/react-popper\";\nimport { useCallbackRef } from \"@huin-core/react-use-callback-ref\";\nimport { SelectScrollButtonImplElement } from \"./SelectScrollDownButton\";\n\nconst CONTENT_NAME = 'SelectContent';\n\ntype SelectContentElement = SelectContentImplElement;\ninterface SelectContentProps extends SelectContentImplProps {}\n\nconst SelectContent = React.forwardRef<SelectContentElement, SelectContentProps>(\n (props: ScopedProps<SelectContentProps>, forwardedRef) => {\n const context = useSelectContext(CONTENT_NAME, props.__scopeSelect);\n const [fragment, setFragment] = React.useState<DocumentFragment>();\n\n // setting the fragment in `useLayoutEffect` as `DocumentFragment` doesn't exist on the server\n useLayoutEffect(() => {\n setFragment(new DocumentFragment());\n }, []);\n\n if (!context.open) {\n const frag = fragment as Element | undefined;\n return frag\n ? ReactDOM.createPortal(\n <SelectContentProvider scope={props.__scopeSelect}>\n <Collection.Slot scope={props.__scopeSelect}>\n <div>{props.children}</div>\n </Collection.Slot>\n </SelectContentProvider>,\n frag\n )\n : null;\n }\n\n return <SelectContentImpl {...props} ref={forwardedRef} />;\n }\n);\n\nSelectContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectContentImpl\n * -----------------------------------------------------------------------------------------------*/\n\nexport const CONTENT_MARGIN = 10;\n\ntype SelectContentContextValue = {\n content?: SelectContentElement | null;\n viewport?: SelectViewportElement | null;\n onViewportChange?: (node: SelectViewportElement | null) => void;\n itemRefCallback?: (\n node: SelectItemElement | null,\n value: string,\n disabled: boolean\n ) => void;\n selectedItem?: SelectItemElement | null;\n onItemLeave?: () => void;\n itemTextRefCallback?: (\n node: SelectItemTextElement | null,\n value: string,\n disabled: boolean\n ) => void;\n focusSelectedItem?: () => void;\n selectedItemText?: SelectItemTextElement | null;\n position?: SelectContentProps[\"position\"];\n isPositioned?: boolean;\n searchRef?: React.RefObject<string>;\n};\n\nexport const [SelectContentProvider, useSelectContentContext] =\n createSelectContext<SelectContentContextValue>(CONTENT_NAME);\n\nconst CONTENT_IMPL_NAME = \"SelectContentImpl\";\n\ntype SelectContentImplElement =\n | SelectPopperPositionElement\n | SelectItemAlignedPositionElement;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef<\n typeof DismissableLayer\n>;\ntype FocusScopeProps = React.ComponentPropsWithoutRef<typeof FocusScope>;\n\ntype SelectPopperPrivateProps = { onPlaced?: PopperContentProps[\"onPlaced\"] };\n\ninterface SelectContentImplProps\n extends Omit<SelectPopperPositionProps, keyof SelectPopperPrivateProps>,\n Omit<SelectItemAlignedPositionProps, keyof SelectPopperPrivateProps> {\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps[\"onUnmountAutoFocus\"];\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: DismissableLayerProps[\"onEscapeKeyDown\"];\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onPointerDownOutside?: DismissableLayerProps[\"onPointerDownOutside\"];\n\n position?: \"item-aligned\" | \"popper\";\n}\n\nconst SelectContentImpl = React.forwardRef<\n SelectContentImplElement,\n SelectContentImplProps\n>((props: ScopedProps<SelectContentImplProps>, forwardedRef) => {\n const {\n __scopeSelect,\n position = \"item-aligned\",\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n //\n // PopperContent props\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions,\n //\n ...contentProps\n } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const [content, setContent] = React.useState<SelectContentImplElement | null>(\n null\n );\n const [viewport, setViewport] = React.useState<SelectViewportElement | null>(\n null\n );\n const composedRefs = useComposedRefs(forwardedRef, (node) =>\n setContent(node)\n );\n const [selectedItem, setSelectedItem] =\n React.useState<SelectItemElement | null>(null);\n const [selectedItemText, setSelectedItemText] =\n React.useState<SelectItemTextElement | null>(null);\n const getItems = useCollection(__scopeSelect);\n const [isPositioned, setIsPositioned] = React.useState(false);\n const firstValidItemFoundRef = React.useRef(false);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n if (content) return hideOthers(content);\n }, [content]);\n\n // Make sure the whole tree has focus guards as our `Select` may be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n const focusFirst = React.useCallback(\n (candidates: Array<HTMLElement | null>) => {\n const [firstItem, ...restItems] = getItems().map(\n (item) => item.ref.current\n );\n const [lastItem] = restItems.slice(-1);\n\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate?.scrollIntoView({ block: \"nearest\" });\n // viewport might have padding so scroll to its edges when focusing first/last items.\n if (candidate === firstItem && viewport) viewport.scrollTop = 0;\n if (candidate === lastItem && viewport)\n viewport.scrollTop = viewport.scrollHeight;\n candidate?.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n },\n [getItems, viewport]\n );\n\n const focusSelectedItem = React.useCallback(\n () => focusFirst([selectedItem, content]),\n [focusFirst, selectedItem, content]\n );\n\n // Since this is not dependent on layout, we want to ensure this runs at the same time as\n // other effects across components. Hence why we don't call `focusSelectedItem` inside `position`.\n React.useEffect(() => {\n if (isPositioned) {\n focusSelectedItem();\n }\n }, [isPositioned, focusSelectedItem]);\n\n // prevent selecting items on `pointerup` in some cases after opening from `pointerdown`\n // and close on `pointerup` outside.\n const { onOpenChange, triggerPointerDownPosRef } = context;\n React.useEffect(() => {\n if (content) {\n let pointerMoveDelta = { x: 0, y: 0 };\n\n const handlePointerMove = (event: PointerEvent) => {\n pointerMoveDelta = {\n x: Math.abs(\n Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)\n ),\n y: Math.abs(\n Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0)\n ),\n };\n };\n const handlePointerUp = (event: PointerEvent) => {\n // If the pointer hasn't moved by a certain threshold then we prevent selecting item on `pointerup`.\n if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) {\n event.preventDefault();\n } else {\n // otherwise, if the event was outside the content, close.\n if (!content.contains(event.target as HTMLElement)) {\n onOpenChange(false);\n }\n }\n document.removeEventListener(\"pointermove\", handlePointerMove);\n triggerPointerDownPosRef.current = null;\n };\n\n if (triggerPointerDownPosRef.current !== null) {\n document.addEventListener(\"pointermove\", handlePointerMove);\n document.addEventListener(\"pointerup\", handlePointerUp, {\n capture: true,\n once: true,\n });\n }\n\n return () => {\n document.removeEventListener(\"pointermove\", handlePointerMove);\n document.removeEventListener(\"pointerup\", handlePointerUp, {\n capture: true,\n });\n };\n }\n }, [content, onOpenChange, triggerPointerDownPosRef]);\n\n React.useEffect(() => {\n const close = () => onOpenChange(false);\n window.addEventListener(\"blur\", close);\n window.addEventListener(\"resize\", close);\n return () => {\n window.removeEventListener(\"blur\", close);\n window.removeEventListener(\"resize\", close);\n };\n }, [onOpenChange]);\n\n const [searchRef, handleTypeaheadSearch] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find(\n (item) => item.ref.current === document.activeElement\n );\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem) {\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => (nextItem.ref.current as HTMLElement).focus());\n }\n });\n\n const itemRefCallback = React.useCallback(\n (node: SelectItemElement | null, value: string, disabled: boolean) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem =\n context.value !== undefined && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItem(node);\n if (isFirstValidItem) firstValidItemFoundRef.current = true;\n }\n },\n [context.value]\n );\n const handleItemLeave = React.useCallback(() => content?.focus(), [content]);\n const itemTextRefCallback = React.useCallback(\n (node: SelectItemTextElement | null, value: string, disabled: boolean) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem =\n context.value !== undefined && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItemText(node);\n }\n },\n [context.value]\n );\n\n const SelectPosition =\n position === \"popper\" ? SelectPopperPosition : SelectItemAlignedPosition;\n\n // Silently ignore props that are not supported by `SelectItemAlignedPosition`\n const popperContentProps =\n SelectPosition === SelectPopperPosition\n ? {\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions,\n }\n : {};\n\n return (\n <SelectContentProvider\n scope={__scopeSelect}\n content={content}\n viewport={viewport}\n onViewportChange={setViewport}\n itemRefCallback={itemRefCallback}\n selectedItem={selectedItem}\n onItemLeave={handleItemLeave}\n itemTextRefCallback={itemTextRefCallback}\n focusSelectedItem={focusSelectedItem}\n selectedItemText={selectedItemText}\n position={position}\n isPositioned={isPositioned}\n searchRef={searchRef}\n >\n <RemoveScroll as={Slot} allowPinchZoom>\n <FocusScope\n asChild\n // we make sure we're not trapping once it's been closed\n // (closed !== unmounted when animating out)\n trapped={context.open}\n onMountAutoFocus={(event) => {\n // we prevent open autofocus because we manually focus the selected item\n event.preventDefault();\n }}\n onUnmountAutoFocus={composeEventHandlers(\n onCloseAutoFocus,\n (event) => {\n context.trigger?.focus({ preventScroll: true });\n event.preventDefault();\n }\n )}\n >\n <DismissableLayer\n asChild\n disableOutsidePointerEvents\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n // When focus is trapped, a focusout event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={(event) => event.preventDefault()}\n onDismiss={() => context.onOpenChange(false)}\n >\n <SelectPosition\n role=\"listbox\"\n id={context.contentId}\n data-state={context.open ? \"open\" : \"closed\"}\n dir={context.dir}\n onContextMenu={(event) => event.preventDefault()}\n {...contentProps}\n {...popperContentProps}\n onPlaced={() => setIsPositioned(true)}\n ref={composedRefs}\n style={{\n // flex layout so we can place the scroll buttons properly\n display: \"flex\",\n flexDirection: \"column\",\n // reset the outline by default as the content MAY get focused\n outline: \"none\",\n ...contentProps.style,\n }}\n onKeyDown={composeEventHandlers(\n contentProps.onKeyDown,\n (event) => {\n const isModifierKey =\n event.ctrlKey || event.altKey || event.metaKey;\n\n // select should not be navigated using tab key so we prevent it\n if (event.key === \"Tab\") event.preventDefault();\n\n if (!isModifierKey && event.key.length === 1)\n handleTypeaheadSearch(event.key);\n\n if (\n [\"ArrowUp\", \"ArrowDown\", \"Home\", \"End\"].includes(event.key)\n ) {\n const items = getItems().filter((item) => !item.disabled);\n let candidateNodes = items.map((item) => item.ref.current!);\n\n if ([\"ArrowUp\", \"End\"].includes(event.key)) {\n candidateNodes = candidateNodes.slice().reverse();\n }\n if ([\"ArrowUp\", \"ArrowDown\"].includes(event.key)) {\n const currentElement = event.target as SelectItemElement;\n const currentIndex =\n candidateNodes.indexOf(currentElement);\n candidateNodes = candidateNodes.slice(currentIndex + 1);\n }\n\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => focusFirst(candidateNodes));\n\n event.preventDefault();\n }\n }\n )}\n />\n </DismissableLayer>\n </FocusScope>\n </RemoveScroll>\n </SelectContentProvider>\n );\n});\n\nSelectContentImpl.displayName = CONTENT_IMPL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemAlignedPosition\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_ALIGNED_POSITION_NAME = \"SelectItemAlignedPosition\";\n\ntype SelectItemAlignedPositionElement = React.ElementRef<typeof Primitive.div>;\ninterface SelectItemAlignedPositionProps\n extends PrimitiveDivProps,\n SelectPopperPrivateProps {}\n\nconst SelectItemAlignedPosition = React.forwardRef<\n SelectItemAlignedPositionElement,\n SelectItemAlignedPositionProps\n>((props: ScopedProps<SelectItemAlignedPositionProps>, forwardedRef) => {\n const { __scopeSelect, onPlaced, ...popperProps } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(CONTENT_NAME, __scopeSelect);\n const [contentWrapper, setContentWrapper] =\n React.useState<HTMLDivElement | null>(null);\n const [content, setContent] =\n React.useState<SelectItemAlignedPositionElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) =>\n setContent(node)\n );\n const getItems = useCollection(__scopeSelect);\n const shouldExpandOnScrollRef = React.useRef(false);\n const shouldRepositionRef = React.useRef(true);\n\n const { viewport, selectedItem, selectedItemText, focusSelectedItem } =\n contentContext;\n const position = React.useCallback(() => {\n if (\n context.trigger &&\n context.valueNode &&\n contentWrapper &&\n content &&\n viewport &&\n selectedItem &&\n selectedItemText\n ) {\n const triggerRect = context.trigger.getBoundingClientRect();\n\n // -----------------------------------------------------------------------------------------\n // Horizontal positioning\n // -----------------------------------------------------------------------------------------\n const contentRect = content.getBoundingClientRect();\n const valueNodeRect = context.valueNode.getBoundingClientRect();\n const itemTextRect = selectedItemText.getBoundingClientRect();\n\n if (context.dir !== \"rtl\") {\n const itemTextOffset = itemTextRect.left - contentRect.left;\n const left = valueNodeRect.left - itemTextOffset;\n const leftDelta = triggerRect.left - left;\n const minContentWidth = triggerRect.width + leftDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const rightEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedLeft = clamp(left, [\n CONTENT_MARGIN,\n rightEdge - contentWidth,\n ]);\n\n contentWrapper.style.minWidth = minContentWidth + \"px\";\n contentWrapper.style.left = clampedLeft + \"px\";\n } else {\n const itemTextOffset = contentRect.right - itemTextRect.right;\n const right = window.innerWidth - valueNodeRect.right - itemTextOffset;\n const rightDelta = window.innerWidth - triggerRect.right - right;\n const minContentWidth = triggerRect.width + rightDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const leftEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedRight = clamp(right, [\n CONTENT_MARGIN,\n leftEdge - contentWidth,\n ]);\n\n contentWrapper.style.minWidth = minContentWidth + \"px\";\n contentWrapper.style.right = clampedRight + \"px\";\n }\n\n // -----------------------------------------------------------------------------------------\n // Vertical positioning\n // -----------------------------------------------------------------------------------------\n const items = getItems();\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const itemsHeight = viewport.scrollHeight;\n\n const contentStyles = window.getComputedStyle(content);\n const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);\n const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);\n const contentBorderBottomWidth = parseInt(\n contentStyles.borderBottomWidth,\n 10\n );\n const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);\n const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth; // prettier-ignore\n const minContentHeight = Math.min(\n selectedItem.offsetHeight * 5,\n fullContentHeight\n );\n\n const viewportStyles = window.getComputedStyle(viewport);\n const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);\n const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);\n\n const topEdgeToTriggerMiddle =\n triggerRect.top + triggerRect.height / 2 - CONTENT_MARGIN;\n const triggerMiddleToBottomEdge =\n availableHeight - topEdgeToTriggerMiddle;\n\n const selectedItemHalfHeight = selectedItem.offsetHeight / 2;\n const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;\n const contentTopToItemMiddle =\n contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;\n const itemMiddleToContentBottom =\n fullContentHeight - contentTopToItemMiddle;\n\n const willAlignWithoutTopOverflow =\n contentTopToItemMiddle <= topEdgeToTriggerMiddle;\n\n if (willAlignWithoutTopOverflow) {\n const isLastItem = selectedItem === items[items.length - 1].ref.current;\n contentWrapper.style.bottom = 0 + \"px\";\n const viewportOffsetBottom =\n content.clientHeight - viewport.offsetTop - viewport.offsetHeight;\n const clampedTriggerMiddleToBottomEdge = Math.max(\n triggerMiddleToBottomEdge,\n selectedItemHalfHeight +\n // viewport might have padding bottom, include it to avoid a scrollable viewport\n (isLastItem ? viewportPaddingBottom : 0) +\n viewportOffsetBottom +\n contentBorderBottomWidth\n );\n const height =\n contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;\n contentWrapper.style.height = height + \"px\";\n } else {\n const isFirstItem = selectedItem === items[0].ref.current;\n contentWrapper.style.top = 0 + \"px\";\n const clampedTopEdgeToTriggerMiddle = Math.max(\n topEdgeToTriggerMiddle,\n contentBorderTopWidth +\n viewport.offsetTop +\n // viewport might have padding top, include it to avoid a scrollable viewport\n (isFirstItem ? viewportPaddingTop : 0) +\n selectedItemHalfHeight\n );\n const height =\n clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;\n contentWrapper.style.height = height + \"px\";\n viewport.scrollTop =\n contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;\n }\n\n contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;\n contentWrapper.style.minHeight = minContentHeight + \"px\";\n contentWrapper.style.maxHeight = availableHeight + \"px\";\n // -----------------------------------------------------------------------------------------\n\n onPlaced?.();\n\n // we don't want the initial scroll position adjustment to trigger \"expand on scroll\"\n // so we explicitly turn it on only after they've registered.\n requestAnimationFrame(() => (shouldExpandOnScrollRef.current = true));\n }\n }, [\n getItems,\n context.trigger,\n context.valueNode,\n contentWrapper,\n content,\n viewport,\n selectedItem,\n selectedItemText,\n context.dir,\n onPlaced,\n ]);\n\n useLayoutEffect(() => position(), [position]);\n\n // copy z-index from content to wrapper\n const [contentZIndex, setContentZIndex] = React.useState<string>();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n\n // When the viewport becomes scrollable at the top, the scroll up button will mount.\n // Because it is part of the normal flow, it will push down the viewport, thus throwing our\n // trigger => selectedItem alignment off by the amount the viewport was pushed down.\n // We wait for this to happen and then re-run the positining logic one more time to account for it.\n const handleScrollButtonChange = React.useCallback(\n (node: SelectScrollButtonImplElement | null) => {\n if (node && shouldRepositionRef.current === true) {\n position();\n focusSelectedItem?.();\n shouldRepositionRef.current = false;\n }\n },\n [position, focusSelectedItem]\n );\n\n return (\n <SelectViewportProvider\n scope={__scopeSelect}\n contentWrapper={contentWrapper}\n shouldExpandOnScrollRef={shouldExpandOnScrollRef}\n onScrollButtonChange={handleScrollButtonChange}\n >\n <div\n ref={setContentWrapper}\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n position: \"fixed\",\n zIndex: contentZIndex,\n }}\n >\n <Primitive.div\n {...popperProps}\n ref={composedRefs}\n style={{\n // When we get the height of the content, it includes borders. If we were to set\n // the height without having `boxSizing: 'border-box'` it would be too big.\n boxSizing: \"border-box\",\n // We need to ensure the content doesn't get taller than the wrapper\n maxHeight: \"100%\",\n ...popperProps.style,\n }}\n />\n </div>\n </SelectViewportProvider>\n );\n});\n\nSelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectPopperPosition\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_POSITION_NAME = \"SelectPopperPosition\";\n\ntype SelectPopperPositionElement = React.ElementRef<\n typeof PopperPrimitive.Content\n>;\ntype PopperContentProps = React.ComponentPropsWithoutRef<\n typeof PopperPrimitive.Content\n>;\ninterface SelectPopperPositionProps\n extends PopperContentProps,\n SelectPopperPrivateProps {}\n\nconst SelectPopperPosition = React.forwardRef<\n SelectPopperPositionElement,\n SelectPopperPositionProps\n>((props: ScopedProps<SelectPopperPositionProps>, forwardedRef) => {\n const {\n __scopeSelect,\n align = \"start\",\n collisionPadding = CONTENT_MARGIN,\n ...popperProps\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n\n return (\n <PopperPrimitive.Content\n {...popperScope}\n {...popperProps}\n ref={forwardedRef}\n align={align}\n collisionPadding={collisionPadding}\n style={{\n // Ensure border-box for floating-ui calculations\n boxSizing: \"border-box\",\n ...popperProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--huin-core-select-content-transform-origin\":\n \"var(--huin-core-popper-transform-origin)\",\n \"--huin-core-select-content-available-width\":\n \"var(--huin-core-popper-available-width)\",\n \"--huin-core-select-content-available-height\":\n \"var(--huin-core-popper-available-height)\",\n \"--huin-core-select-trigger-width\": \"var(--huin-core-popper-anchor-width)\",\n \"--huin-core-select-trigger-height\": \"var(--huin-core-popper-anchor-height)\",\n },\n }}\n />\n );\n});\n\nSelectPopperPosition.displayName = POPPER_POSITION_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\n\nexport function useTypeaheadSearch(onSearchChange: (search: string) => void) {\n const handleSearchChange = useCallbackRef(onSearchChange);\n const searchRef = React.useRef(\"\");\n const timerRef = React.useRef(0);\n\n const handleTypeaheadSearch = React.useCallback(\n (key: string) => {\n const search = searchRef.current + key;\n handleSearchChange(search);\n\n (function updateSearch(value: string) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n // Reset `searchRef` 1 second after it was last updated\n if (value !== \"\")\n timerRef.current = window.setTimeout(() => updateSearch(\"\"), 1000);\n })(search);\n },\n [handleSearchChange]\n );\n\n const resetTypeahead = React.useCallback(() => {\n searchRef.current = \"\";\n window.clearTimeout(timerRef.current);\n }, []);\n\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n\n return [searchRef, handleTypeaheadSearch, resetTypeahead] as const;\n}\n\n/**\n * This is the \"meat\" of the typeahead matching logic. It takes in a list of items,\n * the search and the current item, and returns the next item (or `undefined`).\n *\n * We normalize the search because if a user has repeatedly pressed a character,\n * we want the exact same behavior as if we only had that one character\n * (ie. cycle through items starting with that character)\n *\n * We also reorder the items by wrapping the array around the current item.\n * This is so we always look forward from the current item, and picking the first\n * item will always be the correct one.\n *\n * Finally, if the normalized search is exactly one character, we exclude the\n * current item from the values because otherwise it would be the first to match always\n * and focus would never move. This is as opposed to the regular case, where we\n * don't want focus to move if the current item still matches.\n */\nexport function findNextItem<T extends { textValue: string }>(\n items: T[],\n search: string,\n currentItem?: T\n) {\n const isRepeated =\n search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const currentItemIndex = currentItem ? items.indexOf(currentItem) : -1;\n let wrappedItems = wrapArray(items, Math.max(currentItemIndex, 0));\n const excludeCurrentItem = normalizedSearch.length === 1;\n if (excludeCurrentItem)\n wrappedItems = wrappedItems.filter((v) => v !== currentItem);\n const nextItem = wrappedItems.find((item) =>\n item.textValue.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextItem !== currentItem ? nextItem : undefined;\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray<T>(array: T[], startIndex: number) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\n\n\n\nexport { SelectContent };\nexport type { SelectContentProps };\n", "import React from \"react\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { Collection, createSelectContext, ScopedProps } from \"./Select\";\nimport { CONTENT_MARGIN, useSelectContentContext } from \"./SelectContent\";\nimport { SelectScrollButtonImplElement } from \"./SelectScrollDownButton\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { composeEventHandlers } from \"@huin-core/primitive\";\n\n\nexport const CONTENT_NAME = \"SelectContent\";\n\ntype SelectViewportContextValue = {\n contentWrapper?: HTMLDivElement | null;\n shouldExpandOnScrollRef?: React.RefObject<boolean>;\n onScrollButtonChange?: (node: SelectScrollButtonImplElement | null) => void;\n};\n\nexport const [SelectViewportProvider, useSelectViewportContext] =\n createSelectContext<SelectViewportContextValue>(CONTENT_NAME, {});\n\nconst VIEWPORT_NAME = \"SelectViewport\";\n\nexport type SelectViewportElement = React.ElementRef<typeof Primitive.div>;\nexport type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface SelectViewportProps extends PrimitiveDivProps {\n nonce?: string;\n}\n\nconst SelectViewport = React.forwardRef<\n SelectViewportElement,\n SelectViewportProps\n>((props: ScopedProps<SelectViewportProps>, forwardedRef) => {\n const { __scopeSelect, nonce, ...viewportProps } = props;\n const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);\n const viewportContext = useSelectViewportContext(\n VIEWPORT_NAME,\n __scopeSelect\n );\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-huin-core-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-huin-core-select-viewport]::-webkit-scrollbar{display:none}`,\n }}\n nonce={nonce}\n />\n <Collection.Slot scope={__scopeSelect}>\n <Primitive.div\n data-huin-core-select-viewport=\"\"\n role=\"presentation\"\n {...viewportProps}\n ref={composedRefs}\n style={{\n // we use position: 'relative' here on the `viewport` so that when we call\n // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport\n // (independent of the scrollUpButton).\n position: \"relative\",\n flex: 1,\n overflow: \"auto\",\n ...viewportProps.style,\n }}\n onScroll={composeEventHandlers(viewportProps.onScroll, (event) => {\n const viewport = event.currentTarget;\n const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;\n if (shouldExpandOnScrollRef?.current && contentWrapper) {\n const scrolledBy = Math.abs(\n prevScrollTopRef.current - viewport.scrollTop\n );\n if (scrolledBy > 0) {\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const cssMinHeight = parseFloat(contentWrapper.style.minHeight);\n const cssHeight = parseFloat(contentWrapper.style.height);\n const prevHeight = Math.max(cssMinHeight, cssHeight);\n\n if (prevHeight < availableHeight) {\n const nextHeight = prevHeight + scrolledBy;\n const clampedNextHeight = Math.min(\n availableHeight,\n nextHeight\n );\n const heightDiff = nextHeight - clampedNextHeight;\n\n contentWrapper.style.height = clampedNextHeight + \"px\";\n if (contentWrapper.style.bottom === \"0px\") {\n viewport.scrollTop = heightDiff > 0 ? heightDiff : 0;\n // ensure the content stays pinned to the bottom\n contentWrapper.style.justifyContent = \"flex-end\";\n }\n }\n }\n }\n prevScrollTopRef.current = viewport.scrollTop;\n })}\n />\n </Collection.Slot>\n </>\n );\n});\n\nSelectViewport.displayName = VIEWPORT_NAME;\n\nexport { SelectViewport };\nexport type { SelectViewportProps };\n", "import React from \"react\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { ScopedProps, useSelectContext } from \"./Select\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { useLayoutEffect } from \"@huin-core/react-use-layout-effect\";\n\nconst VALUE_NAME = \"SelectValue\";\n\nexport type SelectValueElement = React.ElementRef<typeof Primitive.span>;\nexport type PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface SelectValueProps extends Omit<PrimitiveSpanProps, \"placeholder\"> {\n placeholder?: React.ReactNode;\n}\n\nconst SelectValue = React.forwardRef<SelectValueElement, SelectValueProps>(\n (props: ScopedProps<SelectValueProps>, forwardedRef) => {\n // We ignore `className` and `style` as this part shouldn't be styled.\n const { __scopeSelect, className, style, children, placeholder = '', ...valueProps } = props;\n\n const context = useSelectContext(VALUE_NAME, __scopeSelect);\n const { onValueNodeHasChildrenChange } = context;\n const hasChildren = children !== undefined;\n const composedRefs = useComposedRefs(\n forwardedRef,\n context.onValueNodeChange\n );\n\n useLayoutEffect(() => {\n onValueNodeHasChildrenChange(hasChildren);\n }, [onValueNodeHasChildrenChange, hasChildren]);\n return (\n <Primitive.span\n {...valueProps}\n ref={composedRefs}\n // we don't want events from the portalled `SelectValue` children to bubble\n // through the item they came from\n style={{ pointerEvents: 'none' }}\n >\n {shouldShowPlaceholder(context.value) ? <>{placeholder}</> : children}\n </Primitive.span>\n );\n }\n);\n\nSelectValue.displayName = VALUE_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport function shouldShowPlaceholder(value?: string) {\n return value === \"\" || value === undefined;\n}\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { SelectValue };\nexport type { SelectValueProps };\n", "import React from \"react\";\nimport { PrimitiveSpanProps } from \"./SelectValue\";\nimport { ScopedProps } from \"./Select\";\nimport { Primitive } from \"@huin-core/react-primitive\";\n\nconst ICON_NAME = \"SelectIcon\";\n\ntype SelectIconElement = React.ElementRef<typeof Primitive.span>;\ninterface SelectIconProps extends PrimitiveSpanProps {}\n\nconst SelectIcon = React.forwardRef<SelectIconElement, SelectIconProps>(\n (props: ScopedProps<SelectIconProps>, forwardedRef) => {\n const { __scopeSelect, children, ...iconProps } = props;\n return (\n <Primitive.span aria-hidden {...iconProps} ref={forwardedRef}>\n {children || \"\u25BC\"}\n </Primitive.span>\n );\n }\n);\n\nSelectIcon.displayName = ICON_NAME;\n\nexport { SelectIcon };\nexport type { SelectIconProps };\n", "import { ScopedProps } from \"./Select\";\nimport { Portal as PortalPrimitive } from \"@huin-core/react-portal\";\n\nconst PORTAL_NAME = \"SelectPortal\";\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface SelectPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps[\"container\"];\n}\n\nconst SelectPortal: React.FC<SelectPortalProps> = (\n props: ScopedProps<SelectPortalProps>\n) => {\n return <PortalPrimitive asChild {...props} />;\n};\n\nSelectPortal.displayName = PORTAL_NAME;\n\nexport { SelectPortal };\nexport type { SelectPortalProps };\n", "import React from \"react\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { createSelectContext, ScopedProps } from \"./Select\";\nimport { PrimitiveDivProps } from \"./SelectViewport\";\nimport { useId } from \"@huin-core/react-id\";\n\nconst GROUP_NAME = \"SelectGroup\";\n\ntype SelectGroupContextValue = { id: string };\n\nexport const [SelectGroupContextProvider, useSelectGroupContext] =\n createSelectContext<SelectGroupContextValue>(GROUP_NAME);\n\ntype SelectGroupElement = React.ElementRef<typeof Primitive.div>;\ninterface SelectGroupProps extends PrimitiveDivProps {}\n\nconst SelectGroup = React.forwardRef<SelectGroupElement, SelectGroupProps>(\n (props: ScopedProps<SelectGroupProps>, forwardedRef) => {\n const { __scopeSelect, ...groupProps } = props;\n const groupId = useId();\n return (\n <SelectGroupContextProvider scope={__scopeSelect} id={groupId}>\n <Primitive.div\n role=\"group\"\n aria-labelledby={groupId}\n {...groupProps}\n ref={forwardedRef}\n />\n </SelectGroupContextProvider>\n );\n }\n);\n\nSelectGroup.displayName = GROUP_NAME;\n\nexport { SelectGroup };\nexport type { SelectGroupProps };\n", "import React from \"react\";\nimport { ScopedProps } from \"./Select\";\nimport { PrimitiveDivProps } from \"./SelectViewport\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { useSelectGroupContext } from \"./SelectGroup\";\n\nconst LABEL_NAME = \"SelectLabel\";\n\ntype SelectLabelElement = React.ElementRef<typeof Primitive.div>;\ninterface SelectLabelProps extends PrimitiveDivProps {}\n\nconst SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(\n (props: ScopedProps<SelectLabelProps>, forwardedRef) => {\n const { __scopeSelect, ...labelProps } = props;\n const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);\n return (\n <Primitive.div id={groupContext.id} {...labelProps} ref={forwardedRef} />\n );\n }\n);\n\nSelectLabel.displayName = LABEL_NAME;\n\nexport { SelectLabel };\nexport type { SelectLabelProps };\n", "import React from \"react\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport {\n Collection,\n createSelectContext,\n ScopedProps,\n useSelectContext,\n} from \"./Select\";\nimport { SelectItemTextElement } from \"./SelectItemText\";\nimport { PrimitiveDivProps } from \"./SelectViewport\";\nimport { useSelectContentContext } from \"./SelectContent\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { useId } from \"@huin-core/react-id\";\nimport { composeEventHandlers } from \"@huin-core/primitive\";\n\nconst SELECTION_KEYS = [\" \", \"Enter\"];\nconst ITEM_NAME = \"SelectItem\";\n\ntype SelectItemContextValue = {\n value: string;\n disabled: boolean;\n textId: string;\n isSelected: boolean;\n onItemTextChange(node: SelectItemTextElement | null): void;\n};\n\nexport const [SelectItemContextProvider, useSelectItemContext] =\n createSelectContext<SelectItemContextValue>(ITEM_NAME);\n\nexport type SelectItemElement = React.ElementRef<typeof Primitive.div>;\ninterface SelectItemProps extends PrimitiveDivProps {\n value: string;\n disabled?: boolean;\n textValue?: string;\n}\n\nconst SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>(\n (props: ScopedProps<SelectItemProps>, forwardedRef) => {\n const {\n __scopeSelect,\n value,\n disabled = false,\n textValue: textValueProp,\n ...itemProps\n } = props;\n const context = useSelectContext(ITEM_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(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 composedRefs = useComposedRefs(forwardedRef, (node) =>\n contentContext.itemRefCallback?.(node, value, disabled)\n );\n const textId = useId();\n const pointerTypeRef = React.useRef<React.PointerEvent['pointerType']>('touch');\n\n const handleSelect = () => {\n if (!disabled) {\n context.onValueChange(value);\n context.onOpenChange(false);\n }\n };\n\n if (value === \"\") {\n throw new Error(\n \"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.\"\n );\n }\n\n return (\n <SelectItemContextProvider\n scope={__scopeSelect}\n value={value}\n disabled={disabled}\n textId={textId}\n isSelected={isSelected}\n onItemTextChange={React.useCallback((node) => {\n setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? '').trim());\n }, [])}\n >\n <Collection.ItemSlot\n scope={__scopeSelect}\n value={value}\n disabled={disabled}\n textValue={textValue}\n >\n <Primitive.div\n role=\"option\"\n aria-labelledby={textId}\n data-highlighted={isFocused ? '' : undefined}\n // `isFocused` caveat fixes stuttering in VoiceOver\n aria-selected={isSelected && isFocused}\n data-state={isSelected ? 'checked' : 'unchecked'}\n aria-disabled={disabled || undefined}\n data-disabled={disabled ? '' : undefined}\n tabIndex={disabled ? undefined : -1}\n {...itemProps}\n ref={composedRefs}\n onFocus={composeEventHandlers(itemProps.onFocus, () => setIsFocused(true))}\n onBlur={composeEventHandlers(itemProps.onBlur, () => setIsFocused(false))}\n onClick={composeEventHandlers(itemProps.onClick, () => {\n // Open on click when using a touch or pen device\n if (pointerTypeRef.current !== 'mouse') handleSelect();\n })}\n onPointerUp={composeEventHandlers(itemProps.onPointerUp, () => {\n // Using a mouse you should be able to do pointer down, move through\n // the list, and release the pointer over the item to select it.\n if (pointerTypeRef.current === 'mouse') handleSelect();\n })}\n onPointerDown={composeEventHandlers(itemProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n })}\n onPointerMove={composeEventHandlers(itemProps.onPointerMove, (event) => {\n // Remember pointer type when sliding over to this item from another one\n pointerTypeRef.current = event.pointerType;\n if (disabled) {\n contentContext.onItemLeave?.();\n } else if (pointerTypeRef.current === 'mouse') {\n // even though safari doesn't support this option, it's acceptable\n // as it only means it might scroll a few pixels when using the pointer.\n event.currentTarget.focus({ preventScroll: true });\n }\n })}\n onPointerLeave={composeEventHandlers(itemProps.onPointerLeave, (event) => {\n if (event.currentTarget === document.activeElement) {\n contentContext.onItemLeave?.();\n }\n })}\n onKeyDown={composeEventHandlers(itemProps.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef?.current !== '';\n if (isTypingAhead && event.key === ' ') return;\n if (SELECTION_KEYS.includes(event.key)) handleSelect();\n // prevent page scroll if using the space key to select an item\n if (event.key === ' ') event.preventDefault();\n })}\n />\n </Collection.ItemSlot>\n </SelectItemContextProvider>\n );\n }\n);\n\nSelectItem.displayName = ITEM_NAME;\n\nexport { SelectItem };\nexport type { SelectItemProps };\n", "import React from \"react\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport {\n ScopedProps,\n useSelectContext,\n useSelectNativeOptionsContext,\n} from \"./Select\";\nimport { PrimitiveSpanProps } from \"./SelectValue\";\nimport { useSelectContentContext } from \"./SelectContent\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { useLayoutEffect } from \"@huin-core/react-use-layout-effect\";\nimport ReactDOM from \"react-dom\";\nimport { useSelectItemContext } from \"./SelectItem\";\n\nconst ITEM_TEXT_NAME = \"SelectItemText\";\n\nexport type SelectItemTextElement = React.ElementRef<typeof Primitive.span>;\ninterface SelectItemTextProps extends PrimitiveSpanProps {}\n\nconst SelectItemText = React.forwardRef<\n SelectItemTextElement,\n 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 contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);\n const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);\n const nativeOptionsContext = useSelectNativeOptionsContext(\n ITEM_TEXT_NAME,\n __scopeSelect\n );\n const [itemTextNode, setItemTextNode] =\n React.useState<SelectItemTextElement | null>(null);\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => setItemTextNode(node),\n itemContext.onItemTextChange,\n (node) =>\n contentContext.itemTextRefCallback?.(\n node,\n itemContext.value,\n itemContext.disabled\n )\n );\n\n const textContent = itemTextNode?.textContent;\n const nativeOption = React.useMemo(\n () => (\n <option\n key={itemContext.value}\n value={itemContext.value}\n disabled={itemContext.disabled}\n >\n {textContent}\n </option>\n ),\n [itemContext.disabled, itemContext.value, textContent]\n );\n\n const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;\n useLayoutEffect(() => {\n onNativeOptionAdd(nativeOption);\n return () => onNativeOptionRemove(nativeOption);\n }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);\n\n return (\n <>\n <Primitive.span id={itemContext.textId} {...itemTextProps} ref={composedRefs} />\n\n {/* Portal the select item text into the trigger value node */}\n {itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren\n ? ReactDOM.createPortal(itemTextProps.children, context.valueNode)\n : null}\n </>\n );\n});\n\nSelectItemText.displayName = ITEM_TEXT_NAME;\n\nexport { SelectItemText };\nexport type { SelectItemTextProps };\n", "import React from \"react\";\nimport { PrimitiveSpanProps } from \"./SelectValue\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { ScopedProps } from \"./Select\";\nimport { useSelectItemContext } from \"./SelectItem\";\n\nconst ITEM_INDICATOR_NAME = \"SelectItemIndicator\";\n\ntype SelectItemIndicatorElement = React.ElementRef<typeof Primitive.span>;\ninterface SelectItemIndicatorProps extends PrimitiveSpanProps {}\n\nconst SelectItemIndicator = React.forwardRef<\n SelectItemIndicatorElement,\n SelectItemIndicatorProps\n>((props: ScopedProps<SelectItemIndicatorProps>, forwardedRef) => {\n const { __scopeSelect, ...itemIndicatorProps } = props;\n const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);\n return itemContext.isSelected ? (\n <Primitive.span aria-hidden {...itemIndicatorProps} ref={forwardedRef} />\n ) : null;\n});\n\nSelectItemIndicator.displayName = ITEM_INDICATOR_NAME;\n\nexport { SelectItemIndicator };\nexport type { SelectItemIndicatorProps };\n", "import React from \"react\";\nimport {\n SelectScrollButtonImpl,\n SelectScrollButtonImplElement,\n SelectScrollButtonImplProps,\n} from \"./SelectScrollDownButton\";\nimport { ScopedProps } from \"./Select\";\nimport { useSelectContentContext } from \"./SelectContent\";\nimport { useSelectViewportContext } from \"./SelectViewport\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { useLayoutEffect } from \"@huin-core/react-use-layout-effect\";\n\nconst SCROLL_UP_BUTTON_NAME = \"SelectScrollUpButton\";\n\ntype SelectScrollUpButtonElement = SelectScrollButtonImplElement;\ninterface SelectScrollUpButtonProps\n extends Omit<SelectScrollButtonImplProps, \"onAutoScroll\"> {}\n\nconst SelectScrollUpButton = React.forwardRef<\n SelectScrollUpButtonElement,\n SelectScrollUpButtonProps\n>((props: ScopedProps<SelectScrollUpButtonProps>, forwardedRef) => {\n const contentContext = useSelectContentContext(\n SCROLL_UP_BUTTON_NAME,\n props.__scopeSelect\n );\n const viewportContext = useSelectViewportContext(\n SCROLL_UP_BUTTON_NAME,\n props.__scopeSelect\n );\n const [canScrollUp, setCanScrollUp] = React.useState(false);\n const composedRefs = useComposedRefs(\n forwardedRef,\n viewportContext.onScrollButtonChange\n );\n\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n const viewport = contentContext.viewport;\n function handleScroll() {\n const canScrollUp = viewport.scrollTop > 0;\n setCanScrollUp(canScrollUp);\n }\n handleScroll();\n viewport.addEventListener(\"scroll\", handleScroll);\n return () => viewport.removeEventListener(\"scroll\", handleScroll);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n\n return canScrollUp ? (\n <SelectScrollButtonImpl\n {...props}\n ref={composedRefs}\n onAutoScroll={() => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight;\n }\n }}\n />\n ) : null;\n});\n\nSelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;\n\nexport { SelectScrollUpButton };\nexport type { SelectScrollUpButtonProps };\n", "import React from \"react\";\nimport { ScopedProps, useCollection } from \"./Select\";\nimport { useSelectContentContext } from \"./SelectContent\";\nimport { useComposedRefs } from \"@huin-core/react-compose-refs\";\nimport { useLayoutEffect } from \"@huin-core/react-use-layout-effect\";\nimport { PrimitiveDivProps, useSelectViewportContext } from \"./SelectViewport\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { composeEventHandlers } from \"@huin-core/primitive\";\n\nconst SCROLL_DOWN_BUTTON_NAME = \"SelectScrollDownButton\";\n\ntype SelectScrollDownButtonElement = SelectScrollButtonImplElement;\ninterface SelectScrollDownButtonProps\n extends Omit<SelectScrollButtonImplProps, \"onAutoScroll\"> {}\n\nconst SelectScrollDownButton = React.forwardRef<\n SelectScrollDownButtonElement,\n SelectScrollDownButtonProps\n>((props: ScopedProps<SelectScrollDownButtonProps>, forwardedRef) => {\n const contentContext = useSelectContentContext(\n SCROLL_DOWN_BUTTON_NAME,\n props.__scopeSelect\n );\n const viewportContext = useSelectViewportContext(\n SCROLL_DOWN_BUTTON_NAME,\n props.__scopeSelect\n );\n const [canScrollDown, setCanScrollDown] = React.useState(false);\n const composedRefs = useComposedRefs(\n forwardedRef,\n viewportContext.onScrollButtonChange\n );\n\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n const viewport = contentContext.viewport;\n function handleScroll() {\n const maxScroll = viewport.scrollHeight - viewport.clientHeight;\n // we use Math.ceil here because if the UI is zoomed-in\n // `scrollTop` is not always reported as an integer\n const canScrollDown = Math.ceil(viewport.scrollTop) < maxScroll;\n setCanScrollDown(canScrollDown);\n }\n handleScroll();\n viewport.addEventListener(\"scroll\", handleScroll);\n return () => viewport.removeEventListener(\"scroll\", handleScroll);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n\n return canScrollDown ? (\n <SelectScrollButtonImpl\n {...props}\n ref={composedRefs}\n onAutoScroll={() => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop + selectedItem.offsetHeight;\n }\n }}\n />\n ) : null;\n});\n\nSelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;\n\nexport type SelectScrollButtonImplElement = React.ElementRef<\n typeof Primitive.div\n>;\nexport interface SelectScrollButtonImplProps extends PrimitiveDivProps {\n onAutoScroll(): void;\n}\n\nexport const SelectScrollButtonImpl = React.forwardRef<\n SelectScrollButtonImplElement,\n SelectScrollButtonImplProps\n>((props: ScopedProps<SelectScrollButtonImplProps>, forwardedRef) => {\n const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;\n const contentContext = useSelectContentContext(\n \"SelectScrollButton\",\n __scopeSelect\n );\n const autoScrollTimerRef = React.useRef<number | null>(null);\n const getItems = useCollection(__scopeSelect);\n\n const clearAutoScrollTimer = React.useCallback(() => {\n if (autoScrollTimerRef.current !== null) {\n window.clearInterval(autoScrollTimerRef.current);\n autoScrollTimerRef.current = null;\n }\n }, []);\n\n React.useEffect(() => {\n return () => clearAutoScrollTimer();\n }, [clearAutoScrollTimer]);\n\n // When the viewport becomes scrollable on either side, the relevant scroll button will mount.\n // Because it is part of the normal flow, it will push down (top button) or shrink (bottom button)\n // the viewport, potentially causing the active item to now be partially out of view.\n // We re-run the `scrollIntoView` logic to make sure it stays within the viewport.\n useLayoutEffect(() => {\n const activeItem = getItems().find(\n (item) => item.ref.current === document.activeElement\n );\n activeItem?.ref.current?.scrollIntoView({ block: \"nearest\" });\n }, [getItems]);\n\n return (\n <Primitive.div\n aria-hidden\n {...scrollIndicatorProps}\n ref={forwardedRef}\n style={{ flexShrink: 0, ...scrollIndicatorProps.style }}\n onPointerDown={composeEventHandlers(\n scrollIndicatorProps.onPointerDown,\n () => {\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n }\n )}\n onPointerMove={composeEventHandlers(\n scrollIndicatorProps.onPointerMove,\n () => {\n contentContext.onItemLeave?.();\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n }\n )}\n onPointerLeave={composeEventHandlers(\n scrollIndicatorProps.onPointerLeave,\n () => {\n clearAutoScrollTimer();\n }\n )}\n />\n );\n});\n\nexport { SelectScrollDownButton };\nexport type { SelectScrollDownButtonProps };\n", "import React from \"react\";\nimport { PrimitiveDivProps } from \"./SelectViewport\";\nimport { Primitive } from \"@huin-core/react-primitive\";\nimport { ScopedProps } from \"./Select\";\n\nconst SEPARATOR_NAME = \"SelectSeparator\";\n\ntype SelectSeparatorElement = React.ElementRef<typeof Primitive.div>;\ninterface SelectSeparatorProps extends PrimitiveDivProps {}\n\nconst SelectSeparator = React.forwardRef<\n SelectSeparatorElement,\n SelectSeparatorProps\n>((props: ScopedProps<SelectSeparatorProps>, forwardedRef) => {\n const { __scopeSelect, ...separatorProps } = props;\n return <Primitive.div aria-hidden {...separatorProps} ref={forwardedRef} />;\n\n});\n\nSelectSeparator.displayName = SEPARATOR_NAME;\n\nexport { SelectSeparator };\nexport type { SelectSeparatorProps };\n", "import * as PopperPrimitive from \"@huin-core/react-popper\";\nimport { ScopedProps, usePopperScope, useSelectContext } from \"./Select\";\nimport React from \"react\";\nimport { useSelectContentContext } from \"./SelectContent\";\n\nconst ARROW_NAME = \"SelectArrow\";\n\ntype SelectArrowElement = React.ElementRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = React.ComponentPropsWithoutRef<\n typeof PopperPrimitive.Arrow\n>;\ninterface SelectArrowProps extends PopperArrowProps {}\n\nconst SelectArrow = React.forwardRef<SelectArrowElement, SelectArrowProps>(\n (props: ScopedProps<SelectArrowProps>, forwardedRef) => {\n const { __scopeSelect, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(ARROW_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ARROW_NAME, __scopeSelect);\n return context.open && contentContext.position === \"popper\" ? (\n <PopperPrimitive.Arrow\n {...popperScope}\n {...arrowProps}\n ref={forwardedRef}\n />\n ) : null;\n }\n);\n\nSelectArrow.displayName = ARROW_NAME;\n\nexport { SelectArrow };\nexport type { SelectArrowProps };\n"],
|
5
|
+
"mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,aAAa;AACtB,YAAY,qBAAqB;AACjC,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAyJrB,cAkBA,YAlBA;AA3IV,IAAM,cAAc;AAGb,IAAM,CAAC,YAAY,eAAe,qBAAqB,IAAI,iBAGhE,WAAW;AAGN,IAAM,CAAC,qBAAqB,iBAAiB,IAAI;AAAA,EACtD;AAAA,EACA,CAAC,uBAAuB,iBAAiB;AAC3C;AACO,IAAM,iBAAiB,kBAAkB;AAuBzC,IAAM,CAAC,gBAAgB,gBAAgB,IAC5C,oBAAwC,WAAW;AAQ9C,IAAM,CAAC,6BAA6B,6BAA6B,IACtE,oBAAqD,WAAW;AAiBlE,IAAM,SAAgC,CAAC,UAAoC;AACzE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ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"Primitive", "useComposedRefs", "React", "Primitive", "React", "useComposedRefs", "jsx", "jsxs", "React", "useComposedRefs", "composeEventHandlers", "PopperPrimitive", "jsx", "CONTENT_NAME", "React", "Primitive", "PopperPrimitive", "React", "Primitive", "useComposedRefs", "useLayoutEffect", "Fragment", "jsx", "React", "Primitive", "composeEventHandlers", "jsx", "React", "useComposedRefs", "Primitive", "React", "Primitive", "jsx", "jsx", "React", "Primitive", "useId", "jsx", "React", "Primitive", "React", "Primitive", "jsx", "React", "Primitive", "React", "Primitive", "useComposedRefs", "useId", "composeEventHandlers", "jsx", "React", "Primitive", "React", "Primitive", "useComposedRefs", "useLayoutEffect", "ReactDOM", "Fragment", "jsx", "jsxs", "React", "useComposedRefs", "useLayoutEffect", "Primitive", "ReactDOM", "React", "Primitive", "jsx", "React", "Primitive", "React", "React", "useComposedRefs", "useLayoutEffect", "Primitive", "composeEventHandlers", "jsx", "React", "useComposedRefs", "useLayoutEffect", "handleScroll", "canScrollDown", "useComposedRefs", "useLayoutEffect", "jsx", "React", "handleScroll", "canScrollUp", "React", "Primitive", "jsx", "PopperPrimitive", "React", "jsx", "React"]
|
7
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@huin-core/react-select",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.3",
|
4
4
|
"license": "MIT",
|
5
5
|
"exports": {
|
6
6
|
".": {
|
@@ -28,25 +28,25 @@
|
|
28
28
|
"version": "yarn version"
|
29
29
|
},
|
30
30
|
"dependencies": {
|
31
|
-
"@huin-core/number": "
|
32
|
-
"@huin-core/primitive": "
|
33
|
-
"@huin-core/react-collection": "
|
34
|
-
"@huin-core/react-compose-refs": "
|
35
|
-
"@huin-core/react-context": "
|
36
|
-
"@huin-core/react-direction": "
|
37
|
-
"@huin-core/react-dismissable-layer": "
|
38
|
-
"@huin-core/react-focus-guards": "
|
39
|
-
"@huin-core/react-focus-scope": "
|
40
|
-
"@huin-core/react-id": "
|
41
|
-
"@huin-core/react-popper": "
|
42
|
-
"@huin-core/react-portal": "
|
43
|
-
"@huin-core/react-primitive": "
|
44
|
-
"@huin-core/react-slot": "
|
45
|
-
"@huin-core/react-use-callback-ref": "
|
46
|
-
"@huin-core/react-use-controllable-state": "
|
47
|
-
"@huin-core/react-use-layout-effect": "
|
48
|
-
"@huin-core/react-use-previous": "
|
49
|
-
"@huin-core/react-visually-hidden": "
|
31
|
+
"@huin-core/number": "latest",
|
32
|
+
"@huin-core/primitive": "latest",
|
33
|
+
"@huin-core/react-collection": "latest",
|
34
|
+
"@huin-core/react-compose-refs": "latest",
|
35
|
+
"@huin-core/react-context": "latest",
|
36
|
+
"@huin-core/react-direction": "latest",
|
37
|
+
"@huin-core/react-dismissable-layer": "latest",
|
38
|
+
"@huin-core/react-focus-guards": "latest",
|
39
|
+
"@huin-core/react-focus-scope": "latest",
|
40
|
+
"@huin-core/react-id": "latest",
|
41
|
+
"@huin-core/react-popper": "latest",
|
42
|
+
"@huin-core/react-portal": "latest",
|
43
|
+
"@huin-core/react-primitive": "latest",
|
44
|
+
"@huin-core/react-slot": "latest",
|
45
|
+
"@huin-core/react-use-callback-ref": "latest",
|
46
|
+
"@huin-core/react-use-controllable-state": "latest",
|
47
|
+
"@huin-core/react-use-layout-effect": "latest",
|
48
|
+
"@huin-core/react-use-previous": "latest",
|
49
|
+
"@huin-core/react-visually-hidden": "latest",
|
50
50
|
"aria-hidden": "^1.1.1",
|
51
51
|
"react-remove-scroll": "2.5.7"
|
52
52
|
},
|