@tamagui/select 1.0.1-beta.113 → 1.0.1-beta.114
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 +50 -558
- package/dist/cjs/Select.js.map +2 -2
- package/dist/cjs/SelectContent.js +53 -0
- package/dist/cjs/SelectContent.js.map +7 -0
- package/dist/cjs/SelectContent.native.js +31 -0
- package/dist/cjs/SelectContent.native.js.map +7 -0
- package/dist/cjs/SelectImpl.js +393 -0
- package/dist/cjs/SelectImpl.js.map +7 -0
- package/dist/cjs/SelectScrollButton.js +128 -0
- package/dist/cjs/SelectScrollButton.js.map +7 -0
- package/dist/cjs/SelectScrollButton.native.js +32 -0
- package/dist/cjs/SelectScrollButton.native.js.map +7 -0
- package/dist/cjs/SelectViewport.js +96 -0
- package/dist/cjs/SelectViewport.js.map +7 -0
- package/dist/cjs/SelectViewport.native.js +43 -0
- package/dist/cjs/SelectViewport.native.js.map +7 -0
- package/dist/cjs/constants.js +47 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/context.js +38 -0
- package/dist/cjs/context.js.map +7 -0
- package/dist/cjs/index.js +19 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/types.js +17 -0
- package/dist/cjs/types.js.map +7 -0
- package/dist/esm/Select.js +33 -565
- package/dist/esm/Select.js.map +2 -2
- package/dist/esm/SelectContent.js +26 -0
- package/dist/esm/SelectContent.js.map +7 -0
- package/dist/esm/SelectContent.native.js +7 -0
- package/dist/esm/SelectContent.native.js.map +7 -0
- package/dist/esm/SelectImpl.js +378 -0
- package/dist/esm/SelectImpl.js.map +7 -0
- package/dist/esm/SelectScrollButton.js +100 -0
- package/dist/esm/SelectScrollButton.js.map +7 -0
- package/dist/esm/SelectScrollButton.native.js +7 -0
- package/dist/esm/SelectScrollButton.native.js.map +7 -0
- package/dist/esm/SelectViewport.js +68 -0
- package/dist/esm/SelectViewport.js.map +7 -0
- package/dist/esm/SelectViewport.native.js +16 -0
- package/dist/esm/SelectViewport.native.js.map +7 -0
- package/dist/esm/constants.js +17 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/context.js +11 -0
- package/dist/esm/context.js.map +7 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/types.js +1 -0
- package/dist/esm/types.js.map +7 -0
- package/dist/jsx/Select.js +32 -515
- package/dist/jsx/Select.js.map +2 -2
- package/dist/jsx/SelectContent.js +19 -0
- package/dist/jsx/SelectContent.js.map +7 -0
- package/dist/jsx/SelectContent.native.js +7 -0
- package/dist/jsx/SelectContent.native.js.map +7 -0
- package/dist/jsx/SelectImpl.js +366 -0
- package/dist/jsx/SelectImpl.js.map +7 -0
- package/dist/jsx/SelectScrollButton.js +78 -0
- package/dist/jsx/SelectScrollButton.js.map +7 -0
- package/dist/jsx/SelectScrollButton.native.js +7 -0
- package/dist/jsx/SelectScrollButton.native.js.map +7 -0
- package/dist/jsx/SelectViewport.js +57 -0
- package/dist/jsx/SelectViewport.js.map +7 -0
- package/dist/jsx/SelectViewport.native.js +14 -0
- package/dist/jsx/SelectViewport.native.js.map +7 -0
- package/dist/jsx/constants.js +17 -0
- package/dist/jsx/constants.js.map +7 -0
- package/dist/jsx/context.js +11 -0
- package/dist/jsx/context.js.map +7 -0
- package/dist/jsx/index.js +13 -0
- package/dist/jsx/index.js.map +2 -2
- package/dist/jsx/types.js +1 -0
- package/dist/jsx/types.js.map +7 -0
- package/package.json +12 -12
- package/src/Select.tsx +57 -881
- package/src/SelectContent.native.tsx +5 -0
- package/src/SelectContent.tsx +34 -0
- package/src/SelectImpl.tsx +511 -0
- package/src/SelectScrollButton.native.tsx +7 -0
- package/src/SelectScrollButton.tsx +150 -0
- package/src/SelectViewport.native.tsx +17 -0
- package/src/SelectViewport.tsx +86 -0
- package/src/constants.tsx +7 -0
- package/src/context.tsx +9 -0
- package/src/index.tsx +7 -0
- package/src/types.tsx +83 -0
- package/types/Select.d.ts +140 -298
- package/types/Select.d.ts.map +1 -1
- package/types/SelectContent.d.ts +4 -0
- package/types/SelectContent.d.ts.map +1 -0
- package/types/SelectContent.native.d.ts +4 -0
- package/types/SelectContent.native.d.ts.map +1 -0
- package/types/SelectImpl.d.ts +9 -0
- package/types/SelectImpl.d.ts.map +1 -0
- package/types/SelectScrollButton.d.ts +6 -0
- package/types/SelectScrollButton.d.ts.map +1 -0
- package/types/SelectScrollButton.native.d.ts +4 -0
- package/types/SelectScrollButton.native.d.ts.map +1 -0
- package/types/SelectViewport.d.ts +127 -0
- package/types/SelectViewport.d.ts.map +1 -0
- package/types/SelectViewport.native.d.ts +54 -0
- package/types/SelectViewport.native.d.ts.map +1 -0
- package/types/constants.d.ts +8 -0
- package/types/constants.d.ts.map +1 -0
- package/types/context.d.ts +17 -0
- package/types/context.d.ts.map +1 -0
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -1
- package/types/types.d.ts +74 -0
- package/types/types.d.ts.map +1 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/SelectImpl.tsx"],
|
|
4
|
+
"sourcesContent": ["import {\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 { usePrevious } from '@radix-ui/react-use-previous'\nimport * as React from 'react'\n\nimport { FALLBACK_THRESHOLD, MIN_HEIGHT, SCROLL_ARROW_THRESHOLD, WINDOW_PADDING } from './constants'\nimport { SelectProvider, useSelectContext } from './context'\nimport { getVisualOffsetTop, isFirefox } from './Select'\nimport { ScopedProps, SelectProps } from './types'\n\nexport type SelectImplProps = ScopedProps<SelectProps> & {\n activeIndexRef: any\n selectedIndexRef: any\n listContentRef: any\n}\n\n// TODO use id for focusing from label\nexport const SelectInlineImpl = (props: SelectImplProps) => {\n const {\n __scopeSelect,\n children,\n open = false,\n activeIndexRef,\n selectedIndexRef,\n listContentRef,\n } = props\n\n const selectContext = useSelectContext('SelectSheetImpl', __scopeSelect)\n const { setActiveIndex, setOpen, setSelectedIndex, selectedIndex, activeIndex, forceUpdate } =\n selectContext\n const [showArrows, setShowArrows] = React.useState(false)\n const [scrollTop, setScrollTop] = React.useState(0)\n const prevActiveIndex = usePrevious<number | null>(activeIndex)\n\n const listItemsRef = React.useRef<Array<HTMLElement | null>>([])\n\n const [controlledScrolling, setControlledScrolling] = React.useState(false)\n const [middlewareType, setMiddlewareType] = React.useState<'align' | 'fallback'>('align')\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, setActiveIndex])\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 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\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 viewportHeight = visualViewport?.height ?? 0\n const visualMaxHeight = viewportHeight - WINDOW_PADDING * 2\n\n if (\n amount < 0 &&\n selectedIndexRef.current != null &&\n Math.round(rectBottom) < Math.round(viewportHeight + 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, selectedIndexRef]\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 ?? 0) - 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 [forceUpdate, increaseHeight]\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 ?? 0) + getVisualOffsetTop() - referenceRect.bottom <\n 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, setActiveIndex])\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 return (\n <SelectProvider\n scope={__scopeSelect}\n {...(selectContext as Required<typeof selectContext>)}\n increaseHeight={increaseHeight}\n floatingRef={floatingRef}\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 (event.key === 'Enter' || (event.key === ' ' && !context.dataRef.current.typing)) {\n event.preventDefault()\n setOpen(true)\n }\n },\n })\n },\n getFloatingProps(props) {\n return interactions.getFloatingProps({\n ref: floating,\n className: 'Select',\n ...props,\n style: {\n position: strategy,\n top: y ?? '',\n left: x ?? '',\n outline: 0,\n listStyleType: 'none',\n scrollbarWidth: 'none',\n userSelect: 'none',\n ...props?.style,\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 >\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"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA;AACA;AAEA;AACA;AACA;AAUO,MAAM,mBAAmB,CAAC,UAA2B;AAC1D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,MACE;AAEJ,QAAM,gBAAgB,iBAAiB,mBAAmB,aAAa;AACvE,QAAM,EAAE,gBAAgB,SAAS,kBAAkB,eAAe,aAAa,gBAC7E;AACF,QAAM,CAAC,YAAY,iBAAiB,MAAM,SAAS,KAAK;AACxD,QAAM,CAAC,WAAW,gBAAgB,MAAM,SAAS,CAAC;AAClD,QAAM,kBAAkB,YAA2B,WAAW;AAE9D,QAAM,eAAe,MAAM,OAAk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
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { autoUpdate, offset, useFloating } from "@floating-ui/react-dom-interactions";
|
|
2
|
+
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
3
|
+
import { YStack } from "@tamagui/stacks";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { SCROLL_ARROW_THRESHOLD, SCROLL_ARROW_VELOCITY } from "./constants";
|
|
6
|
+
import { useSelectContext } from "./context";
|
|
7
|
+
const SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
8
|
+
const SelectScrollUpButton = React.forwardRef((props, forwardedRef) => {
|
|
9
|
+
return <SelectScrollButtonImpl componentName={SCROLL_UP_BUTTON_NAME} {...props} dir="up" ref={forwardedRef} />;
|
|
10
|
+
});
|
|
11
|
+
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
|
|
12
|
+
const SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
13
|
+
const SelectScrollDownButton = React.forwardRef((props, forwardedRef) => {
|
|
14
|
+
return <SelectScrollButtonImpl componentName={SCROLL_DOWN_BUTTON_NAME} {...props} dir="down" ref={forwardedRef} />;
|
|
15
|
+
});
|
|
16
|
+
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
17
|
+
const SelectScrollButtonImpl = React.memo(React.forwardRef((props, forwardedRef) => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
const { __scopeSelect, dir, componentName, ...scrollIndicatorProps } = props;
|
|
20
|
+
const { floatingRef, increaseHeight, forceUpdate, ...context } = useSelectContext(componentName, __scopeSelect);
|
|
21
|
+
const intervalRef = React.useRef();
|
|
22
|
+
const loopingRef = React.useRef(false);
|
|
23
|
+
const isVisible = context[dir === "down" ? "canScrollDown" : "canScrollUp"];
|
|
24
|
+
const { x, y, reference, floating, strategy, update, refs } = useFloating({
|
|
25
|
+
strategy: "fixed",
|
|
26
|
+
placement: dir === "up" ? "top" : "bottom",
|
|
27
|
+
middleware: [offset(({ rects }) => -rects.floating.height)]
|
|
28
|
+
});
|
|
29
|
+
const composedRefs = useComposedRefs(forwardedRef, floating);
|
|
30
|
+
React.useLayoutEffect(() => {
|
|
31
|
+
if (!floatingRef)
|
|
32
|
+
return;
|
|
33
|
+
reference(floatingRef.current);
|
|
34
|
+
}, [reference, floatingRef == null ? void 0 : floatingRef.current]);
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
if (!refs.reference.current || !refs.floating.current || !isVisible) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const cleanup = autoUpdate(refs.reference.current, refs.floating.current, update, {
|
|
40
|
+
animationFrame: true
|
|
41
|
+
});
|
|
42
|
+
return () => {
|
|
43
|
+
clearInterval(intervalRef.current);
|
|
44
|
+
loopingRef.current = false;
|
|
45
|
+
cleanup();
|
|
46
|
+
};
|
|
47
|
+
}, [isVisible, update, refs.floating, refs.reference]);
|
|
48
|
+
if (!isVisible) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const handleScrollArrowChange = () => {
|
|
52
|
+
if (!floatingRef)
|
|
53
|
+
return;
|
|
54
|
+
const floating2 = floatingRef.current;
|
|
55
|
+
const isUp = dir === "up";
|
|
56
|
+
if (floating2) {
|
|
57
|
+
const value = isUp ? -SCROLL_ARROW_VELOCITY : SCROLL_ARROW_VELOCITY;
|
|
58
|
+
const multi = isUp && floating2.scrollTop <= SCROLL_ARROW_THRESHOLD * 2 || !isUp && floating2.scrollTop >= floating2.scrollHeight - floating2.clientHeight - SCROLL_ARROW_THRESHOLD * 2 ? 2 : 1;
|
|
59
|
+
floating2.scrollTop += multi * (isUp ? -SCROLL_ARROW_VELOCITY : SCROLL_ARROW_VELOCITY);
|
|
60
|
+
increaseHeight == null ? void 0 : increaseHeight(floating2, multi === 2 ? value * 2 : value);
|
|
61
|
+
forceUpdate();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return <YStack ref={composedRefs} componentName={componentName} aria-hidden {...scrollIndicatorProps} zIndex={1e3} position={strategy} left={x || 0} top={y || 0} width={`calc(${((_b = (_a = floatingRef == null ? void 0 : floatingRef.current) == null ? void 0 : _a.offsetWidth) != null ? _b : 0) - 2}px)`} onPointerMove={() => {
|
|
65
|
+
if (!loopingRef.current) {
|
|
66
|
+
intervalRef.current = setInterval(handleScrollArrowChange, 1e3 / 60);
|
|
67
|
+
loopingRef.current = true;
|
|
68
|
+
}
|
|
69
|
+
}} onPointerLeave={() => {
|
|
70
|
+
loopingRef.current = false;
|
|
71
|
+
clearInterval(intervalRef.current);
|
|
72
|
+
}} />;
|
|
73
|
+
}));
|
|
74
|
+
export {
|
|
75
|
+
SelectScrollDownButton,
|
|
76
|
+
SelectScrollUpButton
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=SelectScrollButton.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/SelectScrollButton.tsx"],
|
|
4
|
+
"sourcesContent": ["import { autoUpdate, offset, useFloating } from '@floating-ui/react-dom-interactions'\nimport { useComposedRefs } from '@tamagui/compose-refs'\nimport { TamaguiElement } from '@tamagui/core'\nimport { YStack } from '@tamagui/stacks'\nimport * as React from 'react'\n\nimport { SCROLL_ARROW_THRESHOLD, SCROLL_ARROW_VELOCITY } from './constants'\nimport { useSelectContext } from './context'\nimport { ScopedProps, SelectScrollButtonImplProps, SelectScrollButtonProps } from './types'\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollUpButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_UP_BUTTON_NAME = 'SelectScrollUpButton'\n\nexport const 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\nexport const 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\n\nconst SelectScrollButtonImpl = React.memo(\n React.forwardRef<SelectScrollButtonImplElement, 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 if (!floatingRef) return\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 if (!floatingRef) return\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 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"],
|
|
5
|
+
"mappings": "AAAA;AACA;AAEA;AACA;AAEA;AACA;AAOA,MAAM,wBAAwB;AAEvB,MAAM,uBAAuB,MAAM,WACxC,CAAC,OAA6C,iBAAiB;AAC7D,SACE,CAAC,uBACC,eAAe,2BACX,OACJ,IAAI,KACJ,KAAK,cACP;AAEJ,CACF;AAEA,qBAAqB,cAAc;AAMnC,MAAM,0BAA0B;AAEzB,MAAM,yBAAyB,MAAM,WAC1C,CAAC,OAA6C,iBAAiB;AAC7D,SACE,CAAC,uBACC,eAAe,6BACX,OACJ,IAAI,OACJ,KAAK,cACP;AAEJ,CACF;AAEA,uBAAuB,cAAc;AAIrC,MAAM,yBAAyB,MAAM,KAC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;AAC9C,YAAM,QACH,QAAQ,UAAS,aAAa,yBAAyB,KACvD,CAAC,QACA,UAAS,aACP,UAAS,eAAe,UAAS,eAAe,yBAAyB,IACzE,IACA;AAEN,gBAAS,aAAa,QAAS,QAAO,CAAC,wBAAwB;AAE/D,uDAAiB,WAAU,UAAU,IAAI,QAAQ,IAAI;AAErD,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,SACE,CAAC,OACC,KAAK,cACL,eAAe,eACf,gBACI,sBACJ,QAAQ,KAER,UAAU,UACV,MAAM,KAAK,GACX,KAAK,KAAK,GACV,OAAO,QAAS,wDAAa,YAAb,mBAAsB,gBAAtB,YAAqC,KAAK,QAC1D,eAAe,MAAM;AACnB,QAAI,CAAC,WAAW,SAAS;AACvB,kBAAY,UAAU,YAAY,yBAAyB,MAAO,EAAE;AACpE,iBAAW,UAAU;AAAA,IACvB;AAAA,EACF,GACA,gBAAgB,MAAM;AACpB,eAAW,UAAU;AACrB,kBAAc,YAAY,OAAO;AAAA,EACnC,GACF;AAEJ,CACF,CACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/SelectScrollButton.native.tsx"],
|
|
4
|
+
"sourcesContent": ["import { ScopedProps, SelectScrollButtonProps } from './types'\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const SelectScrollUpButton = (_: ScopedProps<SelectScrollButtonProps>) => null\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const SelectScrollDownButton = (_: ScopedProps<SelectScrollButtonProps>) => null\n"],
|
|
5
|
+
"mappings": "AAGO,MAAM,uBAAuB,CAAC,MAA4C;AAG1E,MAAM,yBAAyB,CAAC,MAA4C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FloatingFocusManager } from "@floating-ui/react-dom-interactions";
|
|
2
|
+
import { isWeb } from "@tamagui/core";
|
|
3
|
+
import { styled } from "@tamagui/core";
|
|
4
|
+
import { PortalItem } from "@tamagui/portal";
|
|
5
|
+
import { ThemeableStack } from "@tamagui/stacks";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { VIEWPORT_NAME } from "./constants";
|
|
8
|
+
import { useSelectContext } from "./context";
|
|
9
|
+
import { useSelectBreakpointActive } from "./Select";
|
|
10
|
+
const SelectViewportFrame = styled(ThemeableStack, {
|
|
11
|
+
name: VIEWPORT_NAME,
|
|
12
|
+
backgroundColor: "$background",
|
|
13
|
+
elevate: true,
|
|
14
|
+
bordered: true,
|
|
15
|
+
overflow: "scroll",
|
|
16
|
+
userSelect: "none",
|
|
17
|
+
variants: {
|
|
18
|
+
size: {
|
|
19
|
+
"...size": (val, { tokens }) => {
|
|
20
|
+
var _a;
|
|
21
|
+
return {
|
|
22
|
+
borderRadius: (_a = tokens.radius[val]) != null ? _a : val
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
size: "$2"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const SelectViewport = React.forwardRef((props, forwardedRef) => {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
const { __scopeSelect, children, ...viewportProps } = props;
|
|
34
|
+
const context = useSelectContext(VIEWPORT_NAME, __scopeSelect);
|
|
35
|
+
const { style, ...floatingProps } = (_b = (_a = context.interactions) == null ? void 0 : _a.getFloatingProps()) != null ? _b : {};
|
|
36
|
+
const breakpointActive = useSelectBreakpointActive(context.sheetBreakpoint);
|
|
37
|
+
if (breakpointActive || !isWeb) {
|
|
38
|
+
return <PortalItem hostName={`${context.scopeKey}SheetContents`}>{children}</PortalItem>;
|
|
39
|
+
}
|
|
40
|
+
if (!context.floatingContext) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
delete style["scrollbarWidth"];
|
|
44
|
+
delete style["listStyleType"];
|
|
45
|
+
return <>
|
|
46
|
+
<style dangerouslySetInnerHTML={{
|
|
47
|
+
__html: `[data-tamagui-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-tamagui-select-viewport]::-webkit-scrollbar{display:none}`
|
|
48
|
+
}} />
|
|
49
|
+
<FloatingFocusManager context={context.floatingContext} preventTabbing><SelectViewportFrame size={context.size} data-tamagui-select-viewport="" role="presentation" {...viewportProps} ref={forwardedRef} {...floatingProps} {...style}>{children}</SelectViewportFrame></FloatingFocusManager>
|
|
50
|
+
</>;
|
|
51
|
+
});
|
|
52
|
+
SelectViewport.displayName = VIEWPORT_NAME;
|
|
53
|
+
export {
|
|
54
|
+
SelectViewport,
|
|
55
|
+
SelectViewportFrame
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=SelectViewport.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/SelectViewport.tsx"],
|
|
4
|
+
"sourcesContent": ["import { FloatingFocusManager } from '@floating-ui/react-dom-interactions'\nimport { TamaguiElement, isWeb } from '@tamagui/core'\nimport { styled } from '@tamagui/core'\nimport { PortalItem } from '@tamagui/portal'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport * as React from 'react'\n\nimport { VIEWPORT_NAME } from './constants'\nimport { useSelectContext } from './context'\nimport { useSelectBreakpointActive } from './Select'\nimport { ScopedProps, SelectViewportProps } from './types'\n\n/* -------------------------------------------------------------------------------------------------\n * SelectViewport\n * -----------------------------------------------------------------------------------------------*/\n\nexport const SelectViewportFrame = styled(ThemeableStack, {\n name: VIEWPORT_NAME,\n backgroundColor: '$background',\n elevate: true,\n bordered: true,\n overflow: 'scroll',\n userSelect: 'none',\n\n variants: {\n size: {\n '...size': (val, { tokens }) => {\n return {\n borderRadius: tokens.radius[val] ?? val,\n }\n },\n },\n },\n\n defaultVariants: {\n size: '$2',\n },\n})\n\nexport 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 { style, ...floatingProps } = context.interactions?.getFloatingProps() ?? {}\n const breakpointActive = useSelectBreakpointActive(context.sheetBreakpoint)\n\n if (breakpointActive || !isWeb) {\n return <PortalItem hostName={`${context.scopeKey}SheetContents`}>{children}</PortalItem>\n }\n\n if (!context.floatingContext) {\n return null\n }\n\n // TODO\n delete style['scrollbarWidth']\n delete style['listStyleType']\n\n return (\n <>\n {/* Hide scrollbars cross-browser and enable momentum scroll for touch devices */}\n <style\n dangerouslySetInnerHTML={{\n __html: `[data-tamagui-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-tamagui-select-viewport]::-webkit-scrollbar{display:none}`,\n }}\n />\n <FloatingFocusManager context={context.floatingContext} preventTabbing>\n <SelectViewportFrame\n size={context.size}\n data-tamagui-select-viewport=\"\"\n // @ts-ignore\n role=\"presentation\"\n {...viewportProps}\n ref={forwardedRef}\n {...floatingProps}\n {...style}\n >\n {children}\n </SelectViewportFrame>\n </FloatingFocusManager>\n </>\n )\n }\n)\n\nSelectViewport.displayName = VIEWPORT_NAME\n"],
|
|
5
|
+
"mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAOO,MAAM,sBAAsB,OAAO,gBAAgB;AAAA,EACxD,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAAA,EAEZ,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,WAAW,CAAC,KAAK,EAAE,aAAa;AA1BtC;AA2BQ,eAAO;AAAA,UACL,cAAc,aAAO,OAAO,SAAd,YAAsB;AAAA,QACtC;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,MAAM;AAAA,EACR;AACF,CAAC;AAEM,MAAM,iBAAiB,MAAM,WAClC,CAAC,OAAyC,iBAAiB;AAxC7D;AAyCI,QAAM,EAAE,eAAe,aAAa,kBAAkB;AACtD,QAAM,UAAU,iBAAiB,eAAe,aAAa;AAC7D,QAAM,EAAE,UAAU,kBAAkB,oBAAQ,iBAAR,mBAAsB,uBAAtB,YAA4C,CAAC;AACjF,QAAM,mBAAmB,0BAA0B,QAAQ,eAAe;AAE1E,MAAI,oBAAoB,CAAC,OAAO;AAC9B,WAAO,CAAC,WAAW,UAAU,GAAG,QAAQ,0BAA0B,SAAS,EAAnE;AAAA,EACV;AAEA,MAAI,CAAC,QAAQ,iBAAiB;AAC5B,WAAO;AAAA,EACT;AAGA,SAAO,MAAM;AACb,SAAO,MAAM;AAEb,SACE;AAAA,IAEE,CAAC,MACC,yBAAyB;AAAA,MACvB,QAAQ;AAAA,IACV,GACF;AAAA,IACA,CAAC,qBAAqB,SAAS,QAAQ,iBAAiB,eACtD,CAAC,oBACC,MAAM,QAAQ,MACd,6BAA6B,GAE7B,KAAK,mBACD,eACJ,KAAK,kBACD,mBACA,QAEH,SACH,EAXC,oBAYH,EAbC;AAAA,EAcH;AAEJ,CACF;AAEA,eAAe,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PortalItem } from "@tamagui/portal";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { VIEWPORT_NAME } from "./constants";
|
|
4
|
+
import { useSelectContext } from "./context";
|
|
5
|
+
const SelectViewport = React.forwardRef((props) => {
|
|
6
|
+
const { __scopeSelect, children } = props;
|
|
7
|
+
const context = useSelectContext(VIEWPORT_NAME, __scopeSelect);
|
|
8
|
+
return <PortalItem hostName={`${context.scopeKey}SheetContents`}>{children}</PortalItem>;
|
|
9
|
+
});
|
|
10
|
+
SelectViewport.displayName = VIEWPORT_NAME;
|
|
11
|
+
export {
|
|
12
|
+
SelectViewport
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=SelectViewport.native.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/SelectViewport.native.tsx"],
|
|
4
|
+
"sourcesContent": ["import { TamaguiElement } from '@tamagui/core'\nimport { PortalItem } from '@tamagui/portal'\nimport * as React from 'react'\n\nimport { VIEWPORT_NAME } from './constants'\nimport { useSelectContext } from './context'\nimport { ScopedProps, SelectViewportProps } from './types'\n\nexport const SelectViewport = React.forwardRef<TamaguiElement, SelectViewportProps>(\n (props: ScopedProps<SelectViewportProps>) => {\n const { __scopeSelect, children } = props\n const context = useSelectContext(VIEWPORT_NAME, __scopeSelect)\n return <PortalItem hostName={`${context.scopeKey}SheetContents`}>{children}</PortalItem>\n }\n)\n\nSelectViewport.displayName = VIEWPORT_NAME\n"],
|
|
5
|
+
"mappings": "AACA;AACA;AAEA;AACA;AAGO,MAAM,iBAAiB,MAAM,WAClC,CAAC,UAA4C;AAC3C,QAAM,EAAE,eAAe,aAAa;AACpC,QAAM,UAAU,iBAAiB,eAAe,aAAa;AAC7D,SAAO,CAAC,WAAW,UAAU,GAAG,QAAQ,0BAA0B,SAAS,EAAnE;AACV,CACF;AAEA,eAAe,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const SELECT_NAME = "Select";
|
|
2
|
+
const WINDOW_PADDING = 8;
|
|
3
|
+
const SCROLL_ARROW_VELOCITY = 8;
|
|
4
|
+
const SCROLL_ARROW_THRESHOLD = 8;
|
|
5
|
+
const MIN_HEIGHT = 80;
|
|
6
|
+
const FALLBACK_THRESHOLD = 16;
|
|
7
|
+
const VIEWPORT_NAME = "SelectViewport";
|
|
8
|
+
export {
|
|
9
|
+
FALLBACK_THRESHOLD,
|
|
10
|
+
MIN_HEIGHT,
|
|
11
|
+
SCROLL_ARROW_THRESHOLD,
|
|
12
|
+
SCROLL_ARROW_VELOCITY,
|
|
13
|
+
SELECT_NAME,
|
|
14
|
+
VIEWPORT_NAME,
|
|
15
|
+
WINDOW_PADDING
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/constants.tsx"],
|
|
4
|
+
"sourcesContent": ["export const SELECT_NAME = 'Select'\nexport const WINDOW_PADDING = 8\nexport const SCROLL_ARROW_VELOCITY = 8\nexport const SCROLL_ARROW_THRESHOLD = 8\nexport const MIN_HEIGHT = 80\nexport const FALLBACK_THRESHOLD = 16\nexport const VIEWPORT_NAME = 'SelectViewport'\n"],
|
|
5
|
+
"mappings": "AAAO,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM,wBAAwB;AAC9B,MAAM,yBAAyB;AAC/B,MAAM,aAAa;AACnB,MAAM,qBAAqB;AAC3B,MAAM,gBAAgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContextScope } from "@tamagui/create-context";
|
|
2
|
+
import { SELECT_NAME } from "./constants";
|
|
3
|
+
const [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME);
|
|
4
|
+
const [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME);
|
|
5
|
+
export {
|
|
6
|
+
SelectProvider,
|
|
7
|
+
createSelectContext,
|
|
8
|
+
createSelectScope,
|
|
9
|
+
useSelectContext
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/context.tsx"],
|
|
4
|
+
"sourcesContent": ["import { createContextScope } from '@tamagui/create-context'\n\nimport { SELECT_NAME } from './constants'\nimport { SelectContextValue } from './types'\n\nexport const [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME)\n\nexport const [SelectProvider, useSelectContext] =\n createSelectContext<SelectContextValue>(SELECT_NAME)\n"],
|
|
5
|
+
"mappings": "AAAA;AAEA;AAGO,MAAM,CAAC,qBAAqB,qBAAqB,mBAAmB,WAAW;AAE/E,MAAM,CAAC,gBAAgB,oBAC5B,oBAAwC,WAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/jsx/index.js
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
export * from "./Select";
|
|
2
|
+
import {
|
|
3
|
+
SelectContentProps,
|
|
4
|
+
SelectProps,
|
|
5
|
+
SelectScrollButtonProps,
|
|
6
|
+
SelectViewportProps
|
|
7
|
+
} from "./types";
|
|
8
|
+
export * from "./context";
|
|
9
|
+
export {
|
|
10
|
+
SelectContentProps,
|
|
11
|
+
SelectProps,
|
|
12
|
+
SelectScrollButtonProps,
|
|
13
|
+
SelectViewportProps
|
|
14
|
+
};
|
|
2
15
|
//# sourceMappingURL=index.js.map
|
package/dist/jsx/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["export * from './Select'\n"],
|
|
5
|
-
"mappings": "AAAA;",
|
|
4
|
+
"sourcesContent": ["export * from './Select'\nexport {\n SelectContentProps,\n SelectProps,\n SelectScrollButtonProps,\n SelectViewportProps,\n} from './types'\nexport * from './context'\n"],
|
|
5
|
+
"mappings": "AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
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.114",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"@floating-ui/react-dom-interactions": "^0.5.0",
|
|
26
26
|
"@floating-ui/react-native": "^0.7.0",
|
|
27
27
|
"@radix-ui/react-use-previous": "^0.1.1",
|
|
28
|
-
"@tamagui/compose-refs": "^1.0.1-beta.
|
|
29
|
-
"@tamagui/core": "^1.0.1-beta.
|
|
30
|
-
"@tamagui/create-context": "^1.0.1-beta.
|
|
31
|
-
"@tamagui/list-item": "^1.0.1-beta.
|
|
32
|
-
"@tamagui/portal": "^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.
|
|
37
|
-
"@tamagui/use-event": "^1.0.1-beta.
|
|
28
|
+
"@tamagui/compose-refs": "^1.0.1-beta.114",
|
|
29
|
+
"@tamagui/core": "^1.0.1-beta.114",
|
|
30
|
+
"@tamagui/create-context": "^1.0.1-beta.114",
|
|
31
|
+
"@tamagui/list-item": "^1.0.1-beta.114",
|
|
32
|
+
"@tamagui/portal": "^1.0.1-beta.114",
|
|
33
|
+
"@tamagui/separator": "^1.0.1-beta.114",
|
|
34
|
+
"@tamagui/stacks": "^1.0.1-beta.114",
|
|
35
|
+
"@tamagui/text": "^1.0.1-beta.114",
|
|
36
|
+
"@tamagui/use-controllable-state": "^1.0.1-beta.114",
|
|
37
|
+
"@tamagui/use-event": "^1.0.1-beta.114"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": "*",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"react-native": "*"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
45
|
+
"@tamagui/build": "^1.0.1-beta.114",
|
|
46
46
|
"@types/react-native": "^0.69.2",
|
|
47
47
|
"react": "*",
|
|
48
48
|
"react-dom": "*",
|