@tamagui/select 1.13.3 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BubbleSelect.js +1 -47
- package/dist/cjs/BubbleSelect.js.map +2 -2
- package/dist/cjs/Select.js +1 -494
- package/dist/cjs/Select.js.map +2 -2
- package/dist/cjs/SelectContent.js +1 -54
- package/dist/cjs/SelectContent.js.map +2 -2
- package/dist/cjs/SelectContent.native.js +1 -30
- package/dist/cjs/SelectContent.native.js.map +2 -2
- package/dist/cjs/SelectImpl.js +1 -308
- package/dist/cjs/SelectImpl.js.map +2 -2
- package/dist/cjs/SelectImpl.native.js +1 -34
- package/dist/cjs/SelectImpl.native.js.map +2 -2
- package/dist/cjs/SelectScrollButton.js +1 -175
- package/dist/cjs/SelectScrollButton.js.map +2 -2
- package/dist/cjs/SelectScrollButton.native.js +1 -31
- package/dist/cjs/SelectScrollButton.native.js.map +2 -2
- package/dist/cjs/SelectViewport.js +2 -115
- package/dist/cjs/SelectViewport.js.map +2 -2
- package/dist/cjs/SelectViewport.native.js +1 -52
- package/dist/cjs/SelectViewport.native.js.map +2 -2
- package/dist/cjs/constants.js +1 -46
- package/dist/cjs/constants.js.map +2 -2
- package/dist/cjs/context.js +1 -43
- package/dist/cjs/context.js.map +2 -2
- package/dist/cjs/index.js +1 -19
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/types.js +1 -16
- package/dist/cjs/types.js.map +2 -2
- package/dist/cjs/useSelectBreakpointActive.js +1 -42
- package/dist/cjs/useSelectBreakpointActive.js.map +2 -2
- package/dist/esm/BubbleSelect.js +1 -24
- package/dist/esm/BubbleSelect.js.map +2 -2
- package/dist/esm/BubbleSelect.mjs +1 -24
- package/dist/esm/BubbleSelect.mjs.map +2 -2
- package/dist/esm/Select.js +1 -464
- package/dist/esm/Select.js.map +2 -2
- package/dist/esm/Select.mjs +1 -464
- package/dist/esm/Select.mjs.map +2 -2
- package/dist/esm/SelectContent.js +1 -30
- package/dist/esm/SelectContent.js.map +2 -2
- package/dist/esm/SelectContent.mjs +1 -30
- package/dist/esm/SelectContent.mjs.map +2 -2
- package/dist/esm/SelectContent.native.js +1 -6
- package/dist/esm/SelectContent.native.js.map +2 -2
- package/dist/esm/SelectContent.native.mjs +1 -6
- package/dist/esm/SelectContent.native.mjs.map +2 -2
- package/dist/esm/SelectImpl.js +1 -294
- package/dist/esm/SelectImpl.js.map +2 -2
- package/dist/esm/SelectImpl.mjs +1 -294
- package/dist/esm/SelectImpl.mjs.map +2 -2
- package/dist/esm/SelectImpl.native.js +1 -10
- package/dist/esm/SelectImpl.native.js.map +2 -2
- package/dist/esm/SelectImpl.native.mjs +1 -10
- package/dist/esm/SelectImpl.native.mjs.map +2 -2
- package/dist/esm/SelectScrollButton.js +1 -140
- package/dist/esm/SelectScrollButton.js.map +2 -2
- package/dist/esm/SelectScrollButton.mjs +1 -140
- package/dist/esm/SelectScrollButton.mjs.map +2 -2
- package/dist/esm/SelectScrollButton.native.js +1 -6
- package/dist/esm/SelectScrollButton.native.js.map +2 -2
- package/dist/esm/SelectScrollButton.native.mjs +1 -6
- package/dist/esm/SelectScrollButton.native.mjs.map +2 -2
- package/dist/esm/SelectViewport.js +2 -80
- package/dist/esm/SelectViewport.js.map +2 -2
- package/dist/esm/SelectViewport.mjs +2 -80
- package/dist/esm/SelectViewport.mjs.map +2 -2
- package/dist/esm/SelectViewport.native.js +1 -18
- package/dist/esm/SelectViewport.native.js.map +2 -2
- package/dist/esm/SelectViewport.native.mjs +1 -18
- package/dist/esm/SelectViewport.native.mjs.map +2 -2
- package/dist/esm/constants.js +1 -16
- package/dist/esm/constants.js.map +2 -2
- package/dist/esm/constants.mjs +1 -16
- package/dist/esm/constants.mjs.map +2 -2
- package/dist/esm/context.js +1 -15
- package/dist/esm/context.js.map +2 -2
- package/dist/esm/context.mjs +1 -15
- package/dist/esm/context.mjs.map +2 -2
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/useSelectBreakpointActive.js +1 -17
- package/dist/esm/useSelectBreakpointActive.js.map +2 -2
- package/dist/esm/useSelectBreakpointActive.mjs +1 -17
- package/dist/esm/useSelectBreakpointActive.mjs.map +2 -2
- package/dist/jsx/BubbleSelect.js +1 -24
- package/dist/jsx/BubbleSelect.js.map +2 -2
- package/dist/jsx/BubbleSelect.mjs +1 -24
- package/dist/jsx/BubbleSelect.mjs.map +2 -2
- package/dist/jsx/Select.js +1 -428
- package/dist/jsx/Select.js.map +2 -2
- package/dist/jsx/Select.mjs +1 -428
- package/dist/jsx/Select.mjs.map +2 -2
- package/dist/jsx/SelectContent.js +1 -29
- package/dist/jsx/SelectContent.js.map +2 -2
- package/dist/jsx/SelectContent.mjs +1 -29
- package/dist/jsx/SelectContent.mjs.map +2 -2
- package/dist/jsx/SelectContent.native.js +1 -6
- package/dist/jsx/SelectContent.native.js.map +2 -2
- package/dist/jsx/SelectContent.native.mjs +1 -6
- package/dist/jsx/SelectContent.native.mjs.map +2 -2
- package/dist/jsx/SelectImpl.js +1 -286
- package/dist/jsx/SelectImpl.js.map +2 -2
- package/dist/jsx/SelectImpl.mjs +1 -286
- package/dist/jsx/SelectImpl.mjs.map +2 -2
- package/dist/jsx/SelectImpl.native.js +1 -9
- package/dist/jsx/SelectImpl.native.js.map +2 -2
- package/dist/jsx/SelectImpl.native.mjs +1 -9
- package/dist/jsx/SelectImpl.native.mjs.map +2 -2
- package/dist/jsx/SelectScrollButton.js +1 -126
- package/dist/jsx/SelectScrollButton.js.map +2 -2
- package/dist/jsx/SelectScrollButton.mjs +1 -126
- package/dist/jsx/SelectScrollButton.mjs.map +2 -2
- package/dist/jsx/SelectScrollButton.native.js +1 -6
- package/dist/jsx/SelectScrollButton.native.js.map +2 -2
- package/dist/jsx/SelectScrollButton.native.mjs +1 -6
- package/dist/jsx/SelectScrollButton.native.mjs.map +2 -2
- package/dist/jsx/SelectViewport.js +2 -72
- package/dist/jsx/SelectViewport.js.map +2 -2
- package/dist/jsx/SelectViewport.mjs +2 -72
- package/dist/jsx/SelectViewport.mjs.map +2 -2
- package/dist/jsx/SelectViewport.native.js +1 -17
- package/dist/jsx/SelectViewport.native.js.map +2 -2
- package/dist/jsx/SelectViewport.native.mjs +1 -17
- package/dist/jsx/SelectViewport.native.mjs.map +2 -2
- package/dist/jsx/constants.js +1 -16
- package/dist/jsx/constants.js.map +2 -2
- package/dist/jsx/constants.mjs +1 -16
- package/dist/jsx/constants.mjs.map +2 -2
- package/dist/jsx/context.js +1 -14
- package/dist/jsx/context.js.map +2 -2
- package/dist/jsx/context.mjs +1 -14
- package/dist/jsx/context.mjs.map +2 -2
- package/dist/jsx/index.js +1 -2
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +1 -2
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/useSelectBreakpointActive.js +1 -17
- package/dist/jsx/useSelectBreakpointActive.js.map +2 -2
- package/dist/jsx/useSelectBreakpointActive.mjs +1 -17
- package/dist/jsx/useSelectBreakpointActive.mjs.map +2 -2
- package/package.json +16 -16
|
@@ -1,127 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
3
|
-
import { useIsomorphicLayoutEffect } from "@tamagui/core";
|
|
4
|
-
import { YStack } from "@tamagui/stacks";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
import { flushSync } from "react-dom";
|
|
7
|
-
import { useSelectContext } from "./context";
|
|
8
|
-
const SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
9
|
-
const SelectScrollUpButton = React.forwardRef((props, forwardedRef) => {
|
|
10
|
-
return <SelectScrollButtonImpl
|
|
11
|
-
componentName={SCROLL_UP_BUTTON_NAME}
|
|
12
|
-
{...props}
|
|
13
|
-
dir="up"
|
|
14
|
-
ref={forwardedRef}
|
|
15
|
-
/>;
|
|
16
|
-
});
|
|
17
|
-
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
|
|
18
|
-
const SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
19
|
-
const SelectScrollDownButton = React.forwardRef((props, forwardedRef) => {
|
|
20
|
-
return <SelectScrollButtonImpl
|
|
21
|
-
componentName={SCROLL_DOWN_BUTTON_NAME}
|
|
22
|
-
{...props}
|
|
23
|
-
dir="down"
|
|
24
|
-
ref={forwardedRef}
|
|
25
|
-
/>;
|
|
26
|
-
});
|
|
27
|
-
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
28
|
-
const SelectScrollButtonImpl = React.memo(
|
|
29
|
-
React.forwardRef(
|
|
30
|
-
(props, forwardedRef) => {
|
|
31
|
-
const { __scopeSelect, dir, componentName, ...scrollIndicatorProps } = props;
|
|
32
|
-
const {
|
|
33
|
-
floatingRef,
|
|
34
|
-
forceUpdate,
|
|
35
|
-
open,
|
|
36
|
-
fallback,
|
|
37
|
-
setScrollTop,
|
|
38
|
-
setInnerOffset,
|
|
39
|
-
...context
|
|
40
|
-
} = useSelectContext(componentName, __scopeSelect);
|
|
41
|
-
const [element, setElement] = React.useState(null);
|
|
42
|
-
const statusRef = React.useRef("idle");
|
|
43
|
-
const isVisible = context[dir === "down" ? "canScrollDown" : "canScrollUp"];
|
|
44
|
-
const frameRef = React.useRef();
|
|
45
|
-
const { x, y, reference, floating, strategy, update, refs } = useFloating({
|
|
46
|
-
open: open && isVisible,
|
|
47
|
-
strategy: "fixed",
|
|
48
|
-
placement: dir === "up" ? "top" : "bottom",
|
|
49
|
-
middleware: [offset(({ rects }) => -rects.floating.height)],
|
|
50
|
-
whileElementsMounted: (...args) => autoUpdate(...args, { animationFrame: true })
|
|
51
|
-
});
|
|
52
|
-
const composedRef = useComposedRefs(forwardedRef, floating);
|
|
53
|
-
if (floatingRef) {
|
|
54
|
-
if (open) {
|
|
55
|
-
if (element !== floatingRef.current) {
|
|
56
|
-
setElement(floatingRef.current);
|
|
57
|
-
reference(floatingRef.current);
|
|
58
|
-
requestAnimationFrame(update);
|
|
59
|
-
}
|
|
60
|
-
} else {
|
|
61
|
-
cancelAnimationFrame(frameRef.current);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
useIsomorphicLayoutEffect(() => {
|
|
65
|
-
return () => {
|
|
66
|
-
cancelAnimationFrame(frameRef.current);
|
|
67
|
-
};
|
|
68
|
-
}, []);
|
|
69
|
-
if (!(isVisible && floatingRef)) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
const onScroll = (amount) => {
|
|
73
|
-
console.log("on scroll?");
|
|
74
|
-
if (fallback) {
|
|
75
|
-
if (refs.floating.current) {
|
|
76
|
-
refs.floating.current.scrollTop -= amount;
|
|
77
|
-
flushSync(() => setScrollTop(refs.floating.current?.scrollTop ?? 0));
|
|
78
|
-
}
|
|
79
|
-
} else {
|
|
80
|
-
flushSync(() => setInnerOffset((value) => value - amount));
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
return <YStack
|
|
84
|
-
ref={composedRef}
|
|
85
|
-
componentName={componentName}
|
|
86
|
-
aria-hidden
|
|
87
|
-
{...scrollIndicatorProps}
|
|
88
|
-
zIndex={1e3}
|
|
89
|
-
position={strategy}
|
|
90
|
-
left={x || 0}
|
|
91
|
-
top={y || 0}
|
|
92
|
-
width={`calc(${(floatingRef?.current?.offsetWidth ?? 0) - 2}px)`}
|
|
93
|
-
onPointerEnter={() => {
|
|
94
|
-
statusRef.current = "active";
|
|
95
|
-
let prevNow = Date.now();
|
|
96
|
-
function frame() {
|
|
97
|
-
if (element) {
|
|
98
|
-
const currentNow = Date.now();
|
|
99
|
-
const msElapsed = currentNow - prevNow;
|
|
100
|
-
prevNow = currentNow;
|
|
101
|
-
const pixelsToScroll = msElapsed / 2;
|
|
102
|
-
const remainingPixels = dir === "up" ? element.scrollTop : element.scrollHeight - element.clientHeight - element.scrollTop;
|
|
103
|
-
const scrollRemaining = dir === "up" ? element.scrollTop - pixelsToScroll > 0 : element.scrollTop + pixelsToScroll < element.scrollHeight - element.clientHeight;
|
|
104
|
-
onScroll(
|
|
105
|
-
dir === "up" ? Math.min(pixelsToScroll, remainingPixels) : Math.max(-pixelsToScroll, -remainingPixels)
|
|
106
|
-
);
|
|
107
|
-
if (scrollRemaining) {
|
|
108
|
-
frameRef.current = requestAnimationFrame(frame);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
cancelAnimationFrame(frameRef.current);
|
|
113
|
-
frameRef.current = requestAnimationFrame(frame);
|
|
114
|
-
}}
|
|
115
|
-
onPointerLeave={() => {
|
|
116
|
-
statusRef.current = "idle";
|
|
117
|
-
cancelAnimationFrame(frameRef.current);
|
|
118
|
-
}}
|
|
119
|
-
/>;
|
|
120
|
-
}
|
|
121
|
-
)
|
|
122
|
-
);
|
|
123
|
-
export {
|
|
124
|
-
SelectScrollDownButton,
|
|
125
|
-
SelectScrollUpButton
|
|
126
|
-
};
|
|
1
|
+
import{autoUpdate as q,offset as k,useFloating as W}from"@floating-ui/react";import{useComposedRefs as z}from"@tamagui/compose-refs";import{useIsomorphicLayoutEffect as V}from"@tamagui/core";import{YStack as Y}from"@tamagui/stacks";import*as o from"react";import{flushSync as B}from"react-dom";import{useSelectContext as $}from"./context";const P="SelectScrollUpButton",j=o.forwardRef((l,c)=><E componentName={P}{...l}dir="up"ref={c}/>);j.displayName=P;const T="SelectScrollDownButton",G=o.forwardRef((l,c)=><E componentName={T}{...l}dir="down"ref={c}/>);G.displayName=T;const E=o.memo(o.forwardRef((l,c)=>{const{__scopeSelect:R,dir:s,componentName:p,...N}=l,{floatingRef:r,forceUpdate:J,open:u,fallback:x,setScrollTop:I,setInnerOffset:y,...A}=$(p,R),[e,F]=o.useState(null),f=o.useRef("idle"),S=A[s==="down"?"canScrollDown":"canScrollUp"],n=o.useRef(),{x:U,y:_,reference:L,floating:D,strategy:M,update:O,refs:m}=W({open:u&&S,strategy:"fixed",placement:s==="up"?"top":"bottom",middleware:[k(({rects:t})=>-t.floating.height)],whileElementsMounted:(...t)=>q(...t,{animationFrame:!0})}),H=z(c,D);if(r&&(u?e!==r.current&&(F(r.current),L(r.current),requestAnimationFrame(O)):cancelAnimationFrame(n.current)),V(()=>()=>{cancelAnimationFrame(n.current)},[]),!(S&&r))return null;const b=t=>{console.log("on scroll?"),x?m.floating.current&&(m.floating.current.scrollTop-=t,B(()=>I(m.floating.current?.scrollTop??0))):B(()=>y(i=>i-t))};return<Y ref={H}componentName={p}aria-hidden{...N}zIndex={1e3}position={M}left={U||0}top={_||0}width={`calc(${(r?.current?.offsetWidth??0)-2}px)`}onPointerEnter={()=>{f.current="active";let t=Date.now();function i(){if(e){const d=Date.now(),v=d-t;t=d;const a=v/2,g=s==="up"?e.scrollTop:e.scrollHeight-e.clientHeight-e.scrollTop,C=s==="up"?e.scrollTop-a>0:e.scrollTop+a<e.scrollHeight-e.clientHeight;b(s==="up"?Math.min(a,g):Math.max(-a,-g)),C&&(n.current=requestAnimationFrame(i))}}cancelAnimationFrame(n.current),n.current=requestAnimationFrame(i)}}onPointerLeave={()=>{f.current="idle",cancelAnimationFrame(n.current)}}/>}));export{G as SelectScrollDownButton,j as SelectScrollUpButton};
|
|
127
2
|
//# sourceMappingURL=SelectScrollButton.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SelectScrollButton.tsx"],
|
|
4
4
|
"sourcesContent": ["import { autoUpdate, offset, useFloating } from '@floating-ui/react'\nimport { useComposedRefs } from '@tamagui/compose-refs'\nimport { TamaguiElement, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { flushSync } from 'react-dom'\n\nimport { useSelectContext } from './context'\nimport {\n ScopedProps,\n SelectScrollButtonImplProps,\n SelectScrollButtonProps,\n} from './types'\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollUpButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_UP_BUTTON_NAME = 'SelectScrollUpButton'\n\nexport const SelectScrollUpButton = React.forwardRef<\n TamaguiElement,\n 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\nSelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollDownButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_DOWN_BUTTON_NAME = 'SelectScrollDownButton'\n\nexport const SelectScrollDownButton = React.forwardRef<\n TamaguiElement,\n 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\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 {\n floatingRef,\n forceUpdate,\n open,\n fallback,\n setScrollTop,\n setInnerOffset,\n ...context\n } = useSelectContext(componentName, __scopeSelect)\n\n const [element, setElement] = React.useState<HTMLElement | null>(null)\n const statusRef = React.useRef<'idle' | 'active'>('idle')\n const isVisible = context[dir === 'down' ? 'canScrollDown' : 'canScrollUp']\n const frameRef = React.useRef<any>()\n\n const { x, y, reference, floating, strategy, update, refs } = useFloating({\n open: open && isVisible,\n strategy: 'fixed',\n placement: dir === 'up' ? 'top' : 'bottom',\n middleware: [offset(({ rects }) => -rects.floating.height)],\n whileElementsMounted: (...args) => autoUpdate(...args, { animationFrame: true }),\n })\n\n const composedRef = useComposedRefs(forwardedRef, floating)\n\n if (floatingRef) {\n if (open) {\n if (element !== floatingRef.current) {\n setElement(floatingRef.current)\n reference(floatingRef.current)\n requestAnimationFrame(update)\n }\n } else {\n cancelAnimationFrame(frameRef.current)\n }\n }\n\n useIsomorphicLayoutEffect(() => {\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n cancelAnimationFrame(frameRef.current)\n }\n }, [])\n\n if (!(isVisible && floatingRef)) {\n return null\n }\n\n const onScroll = (amount: number) => {\n console.log('on scroll?')\n if (fallback) {\n if (refs.floating.current) {\n refs.floating.current.scrollTop -= amount\n flushSync(() => setScrollTop!(refs.floating.current?.scrollTop ?? 0))\n }\n } else {\n flushSync(() => setInnerOffset!((value) => value - amount))\n }\n }\n\n return (\n <YStack\n ref={composedRef}\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 onPointerEnter={() => {\n statusRef.current = 'active'\n let prevNow = Date.now()\n\n function frame() {\n if (element) {\n const currentNow = Date.now()\n const msElapsed = currentNow - prevNow\n prevNow = currentNow\n\n const pixelsToScroll = msElapsed / 2\n\n const remainingPixels =\n dir === 'up'\n ? element.scrollTop\n : element.scrollHeight - element.clientHeight - element.scrollTop\n\n const scrollRemaining =\n dir === 'up'\n ? element.scrollTop - pixelsToScroll > 0\n : element.scrollTop + pixelsToScroll <\n element.scrollHeight - element.clientHeight\n\n onScroll(\n dir === 'up'\n ? Math.min(pixelsToScroll, remainingPixels)\n : Math.max(-pixelsToScroll, -remainingPixels)\n )\n\n if (scrollRemaining) {\n frameRef.current = requestAnimationFrame(frame)\n }\n }\n }\n\n cancelAnimationFrame(frameRef.current)\n frameRef.current = requestAnimationFrame(frame)\n }}\n onPointerLeave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EAAQ,UAEtDwB,EACJlC,IAAQ,KACJU,EAAQ,UAAYsB,EAAiB,EACrCtB,EAAQ,UAAYsB,EACpBtB,EAAQ,aAAeA,EAAQ,aAErCe,EACEzB,IAAQ,KACJ,KAAK,IAAIgC,EAAgBC,CAAe,EACxC,KAAK,IAAI,CAACD,EAAgB,CAACC,CAAe,CAChD,EAEIC,IACFpB,EAAS,QAAU,sBAAsBe,CAAK,EAElD,CACF,CAEA,qBAAqBf,EAAS,OAAO,EACrCA,EAAS,QAAU,sBAAsBe,CAAK,CAChD,EACA,gBAAgB,IAAM,CACpBjB,EAAU,QAAU,OACpB,qBAAqBE,EAAS,OAAO,CACvC,EACF,EAEJ,CACF,CACF",
|
|
6
|
+
"names": ["autoUpdate", "offset", "useFloating", "useComposedRefs", "useIsomorphicLayoutEffect", "YStack", "React", "flushSync", "useSelectContext", "SCROLL_UP_BUTTON_NAME", "SelectScrollUpButton", "props", "forwardedRef", "SelectScrollButtonImpl", "SCROLL_DOWN_BUTTON_NAME", "SelectScrollDownButton", "__scopeSelect", "dir", "componentName", "scrollIndicatorProps", "floatingRef", "forceUpdate", "open", "fallback", "setScrollTop", "setInnerOffset", "context", "element", "setElement", "statusRef", "isVisible", "frameRef", "x", "y", "reference", "floating", "strategy", "update", "refs", "rects", "args", "composedRef", "onScroll", "amount", "value", "prevNow", "frame", "currentNow", "msElapsed", "pixelsToScroll", "remainingPixels", "scrollRemaining"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
const
|
|
2
|
-
const SelectScrollDownButton = (_) => null;
|
|
3
|
-
export {
|
|
4
|
-
SelectScrollDownButton,
|
|
5
|
-
SelectScrollUpButton
|
|
6
|
-
};
|
|
1
|
+
const e=o=>null,r=o=>null;export{r as SelectScrollDownButton,e as SelectScrollUpButton};
|
|
7
2
|
//# sourceMappingURL=SelectScrollButton.native.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SelectScrollButton.native.tsx"],
|
|
4
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>) =>\n null\n"],
|
|
5
|
-
"mappings": "AAGO,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAGO,MAAMA,EAAwBC,GAA4C,KAGpEC,EAA0BD,GACrC",
|
|
6
|
+
"names": ["SelectScrollUpButton", "_", "SelectScrollDownButton"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
const
|
|
2
|
-
const SelectScrollDownButton = (_) => null;
|
|
3
|
-
export {
|
|
4
|
-
SelectScrollDownButton,
|
|
5
|
-
SelectScrollUpButton
|
|
6
|
-
};
|
|
1
|
+
const e=o=>null,r=o=>null;export{r as SelectScrollDownButton,e as SelectScrollUpButton};
|
|
7
2
|
//# sourceMappingURL=SelectScrollButton.native.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SelectScrollButton.native.tsx"],
|
|
4
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>) =>\n null\n"],
|
|
5
|
-
"mappings": "AAGO,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAGO,MAAMA,EAAwBC,GAA4C,KAGpEC,EAA0BD,GACrC",
|
|
6
|
+
"names": ["SelectScrollUpButton", "_", "SelectScrollDownButton"]
|
|
7
7
|
}
|
|
@@ -1,70 +1,4 @@
|
|
|
1
|
-
import
|
|
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 { ForwardSelectContext, useSelectContext } from "./context";
|
|
9
|
-
import { useSelectBreakpointActive } from "./useSelectBreakpointActive";
|
|
10
|
-
const SelectViewportFrame = styled(ThemeableStack, {
|
|
11
|
-
name: VIEWPORT_NAME,
|
|
12
|
-
backgroundColor: "$background",
|
|
13
|
-
elevate: true,
|
|
14
|
-
bordered: true,
|
|
15
|
-
userSelect: "none",
|
|
16
|
-
outlineWidth: 0,
|
|
17
|
-
variants: {
|
|
18
|
-
size: {
|
|
19
|
-
"...size": (val, { tokens }) => {
|
|
20
|
-
return {
|
|
21
|
-
borderRadius: tokens.radius[val] ?? val
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
defaultVariants: {
|
|
27
|
-
size: "$2"
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
const SelectViewport = React.forwardRef(
|
|
31
|
-
(props, forwardedRef) => {
|
|
32
|
-
const { __scopeSelect, children, disableScroll, ...viewportProps } = props;
|
|
33
|
-
const context = useSelectContext(VIEWPORT_NAME, __scopeSelect);
|
|
34
|
-
const breakpointActive = useSelectBreakpointActive(context.sheetBreakpoint);
|
|
35
|
-
if (breakpointActive || !isWeb) {
|
|
36
|
-
return <PortalItem hostName={`${context.scopeKey}SheetContents`}><ForwardSelectContext context={context}>{children}</ForwardSelectContext></PortalItem>;
|
|
37
|
-
}
|
|
38
|
-
if (!context.floatingContext) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
if (!context.open) {
|
|
42
|
-
return children;
|
|
43
|
-
}
|
|
44
|
-
const {
|
|
45
|
-
style: { scrollbarWidth, listStyleType, overflow, ...restStyle },
|
|
46
|
-
...floatingProps
|
|
47
|
-
} = context.interactions.getFloatingProps();
|
|
48
|
-
return <>
|
|
49
|
-
{!disableScroll && <style
|
|
50
|
-
dangerouslySetInnerHTML={{
|
|
51
|
-
__html: selectViewportCSS
|
|
52
|
-
}}
|
|
53
|
-
/>}
|
|
54
|
-
<FloatingFocusManager context={context.floatingContext}><SelectViewportFrame
|
|
55
|
-
size={context.size}
|
|
56
|
-
role="presentation"
|
|
57
|
-
{...viewportProps}
|
|
58
|
-
ref={forwardedRef}
|
|
59
|
-
{...floatingProps}
|
|
60
|
-
{...restStyle}
|
|
61
|
-
overflow={disableScroll ? void 0 : overflow ?? "scroll"}
|
|
62
|
-
>{children}</SelectViewportFrame></FloatingFocusManager>
|
|
63
|
-
</>;
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
SelectViewport.displayName = VIEWPORT_NAME;
|
|
67
|
-
const selectViewportCSS = `
|
|
1
|
+
import{FloatingFocusManager as S}from"@floating-ui/react";import{isWeb as w}from"@tamagui/core";import{styled as g}from"@tamagui/core";import{PortalItem as P}from"@tamagui/portal";import{ThemeableStack as V}from"@tamagui/stacks";import*as v from"react";import{VIEWPORT_NAME as i}from"./constants";import{ForwardSelectContext as F,useSelectContext as C}from"./context";import{useSelectBreakpointActive as _}from"./useSelectBreakpointActive";const T=g(V,{name:i,backgroundColor:"$background",elevate:!0,bordered:!0,userSelect:"none",outlineWidth:0,variants:{size:{"...size":(t,{tokens:o})=>({borderRadius:o.radius[t]??t})}},defaultVariants:{size:"$2"}}),z=v.forwardRef((t,o)=>{const{__scopeSelect:l,children:r,disableScroll:n,...s}=t,e=C(i,l);if(_(e.sheetBreakpoint)||!w)return<P hostName={`${e.scopeKey}SheetContents`}><F context={e}>{r}</F></P>;if(!e.floatingContext)return null;if(!e.open)return r;const{style:{scrollbarWidth:I,listStyleType:M,overflow:a,...c},...p}=e.interactions.getFloatingProps();return<>{!n&&<style dangerouslySetInnerHTML={{__html:A}}/>}<S context={e.floatingContext}><T size={e.size}role="presentation"{...s}ref={o}{...p}{...c}overflow={n?void 0:a??"scroll"}>{r}</T></S></>});z.displayName=i;const A=`
|
|
68
2
|
.is_SelectViewport {
|
|
69
3
|
scrollbar-width: none;
|
|
70
4
|
-webkit-overflow-scrolling: touch;
|
|
@@ -74,9 +8,5 @@ const selectViewportCSS = `
|
|
|
74
8
|
.is_SelectViewport::-webkit-scrollbar{
|
|
75
9
|
display:none
|
|
76
10
|
}
|
|
77
|
-
`;
|
|
78
|
-
export {
|
|
79
|
-
SelectViewport,
|
|
80
|
-
SelectViewportFrame
|
|
81
|
-
};
|
|
11
|
+
`;export{z as SelectViewport,T as SelectViewportFrame};
|
|
82
12
|
//# sourceMappingURL=SelectViewport.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SelectViewport.tsx"],
|
|
4
4
|
"sourcesContent": ["import { FloatingFocusManager } from '@floating-ui/react'\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 { ForwardSelectContext, useSelectContext } from './context'\nimport { ScopedProps, SelectViewportProps } from './types'\nimport { useSelectBreakpointActive } from './useSelectBreakpointActive'\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 userSelect: 'none',\n outlineWidth: 0,\n\n variants: {\n size: {\n '...size': (val, { tokens }) => {\n return {\n borderRadius: tokens.radius[val] ?? val,\n }\n },\n },\n } as const,\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, disableScroll, ...viewportProps } = props\n const context = useSelectContext(VIEWPORT_NAME, __scopeSelect)\n const breakpointActive = useSelectBreakpointActive(context.sheetBreakpoint)\n\n if (breakpointActive || !isWeb) {\n return (\n <PortalItem hostName={`${context.scopeKey}SheetContents`}>\n <ForwardSelectContext context={context}>{children}</ForwardSelectContext>\n </PortalItem>\n )\n }\n\n if (!context.floatingContext) {\n return null\n }\n\n if (!context.open) {\n return children\n }\n\n const {\n style: { scrollbarWidth, listStyleType, overflow, ...restStyle },\n ...floatingProps\n } = context.interactions!.getFloatingProps()\n\n return (\n <>\n {!disableScroll && (\n <style\n dangerouslySetInnerHTML={{\n __html: selectViewportCSS,\n }}\n />\n )}\n <FloatingFocusManager context={context.floatingContext}>\n <SelectViewportFrame\n size={context.size}\n // @ts-ignore\n role=\"presentation\"\n {...viewportProps}\n ref={forwardedRef}\n {...floatingProps}\n {...restStyle}\n overflow={disableScroll ? undefined : overflow ?? 'scroll'}\n >\n {children}\n </SelectViewportFrame>\n </FloatingFocusManager>\n </>\n )\n }\n)\n\nSelectViewport.displayName = VIEWPORT_NAME\n\nconst selectViewportCSS = `\n.is_SelectViewport {\n scrollbar-width: none;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior: contain;\n}\n\n.is_SelectViewport::-webkit-scrollbar{\n display:none\n}\n`\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAAS,wBAAAA,MAA4B,qBACrC,OAAyB,SAAAC,MAAa,gBACtC,OAAS,UAAAC,MAAc,gBACvB,OAAS,cAAAC,MAAkB,kBAC3B,OAAS,kBAAAC,MAAsB,kBAC/B,UAAYC,MAAW,QAEvB,OAAS,iBAAAC,MAAqB,cAC9B,OAAS,wBAAAC,EAAsB,oBAAAC,MAAwB,YAEvD,OAAS,6BAAAC,MAAiC,8BAMnC,MA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React", "VIEWPORT_NAME", "ForwardSelectContext", "useSelectContext", "useSelectBreakpointActive", "SelectViewportFrame", "val", "tokens", "SelectViewport", "props", "forwardedRef", "__scopeSelect", "children", "disableScroll", "viewportProps", "context", "scrollbarWidth", "listStyleType", "overflow", "restStyle", "floatingProps", "selectViewportCSS"]
|
|
7
7
|
}
|
|
@@ -1,70 +1,4 @@
|
|
|
1
|
-
import
|
|
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 { ForwardSelectContext, useSelectContext } from "./context";
|
|
9
|
-
import { useSelectBreakpointActive } from "./useSelectBreakpointActive";
|
|
10
|
-
const SelectViewportFrame = styled(ThemeableStack, {
|
|
11
|
-
name: VIEWPORT_NAME,
|
|
12
|
-
backgroundColor: "$background",
|
|
13
|
-
elevate: true,
|
|
14
|
-
bordered: true,
|
|
15
|
-
userSelect: "none",
|
|
16
|
-
outlineWidth: 0,
|
|
17
|
-
variants: {
|
|
18
|
-
size: {
|
|
19
|
-
"...size": (val, { tokens }) => {
|
|
20
|
-
return {
|
|
21
|
-
borderRadius: tokens.radius[val] ?? val
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
defaultVariants: {
|
|
27
|
-
size: "$2"
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
const SelectViewport = React.forwardRef(
|
|
31
|
-
(props, forwardedRef) => {
|
|
32
|
-
const { __scopeSelect, children, disableScroll, ...viewportProps } = props;
|
|
33
|
-
const context = useSelectContext(VIEWPORT_NAME, __scopeSelect);
|
|
34
|
-
const breakpointActive = useSelectBreakpointActive(context.sheetBreakpoint);
|
|
35
|
-
if (breakpointActive || !isWeb) {
|
|
36
|
-
return <PortalItem hostName={`${context.scopeKey}SheetContents`}><ForwardSelectContext context={context}>{children}</ForwardSelectContext></PortalItem>;
|
|
37
|
-
}
|
|
38
|
-
if (!context.floatingContext) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
if (!context.open) {
|
|
42
|
-
return children;
|
|
43
|
-
}
|
|
44
|
-
const {
|
|
45
|
-
style: { scrollbarWidth, listStyleType, overflow, ...restStyle },
|
|
46
|
-
...floatingProps
|
|
47
|
-
} = context.interactions.getFloatingProps();
|
|
48
|
-
return <>
|
|
49
|
-
{!disableScroll && <style
|
|
50
|
-
dangerouslySetInnerHTML={{
|
|
51
|
-
__html: selectViewportCSS
|
|
52
|
-
}}
|
|
53
|
-
/>}
|
|
54
|
-
<FloatingFocusManager context={context.floatingContext}><SelectViewportFrame
|
|
55
|
-
size={context.size}
|
|
56
|
-
role="presentation"
|
|
57
|
-
{...viewportProps}
|
|
58
|
-
ref={forwardedRef}
|
|
59
|
-
{...floatingProps}
|
|
60
|
-
{...restStyle}
|
|
61
|
-
overflow={disableScroll ? void 0 : overflow ?? "scroll"}
|
|
62
|
-
>{children}</SelectViewportFrame></FloatingFocusManager>
|
|
63
|
-
</>;
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
SelectViewport.displayName = VIEWPORT_NAME;
|
|
67
|
-
const selectViewportCSS = `
|
|
1
|
+
import{FloatingFocusManager as S}from"@floating-ui/react";import{isWeb as w}from"@tamagui/core";import{styled as g}from"@tamagui/core";import{PortalItem as P}from"@tamagui/portal";import{ThemeableStack as V}from"@tamagui/stacks";import*as v from"react";import{VIEWPORT_NAME as i}from"./constants";import{ForwardSelectContext as F,useSelectContext as C}from"./context";import{useSelectBreakpointActive as _}from"./useSelectBreakpointActive";const T=g(V,{name:i,backgroundColor:"$background",elevate:!0,bordered:!0,userSelect:"none",outlineWidth:0,variants:{size:{"...size":(t,{tokens:o})=>({borderRadius:o.radius[t]??t})}},defaultVariants:{size:"$2"}}),z=v.forwardRef((t,o)=>{const{__scopeSelect:l,children:r,disableScroll:n,...s}=t,e=C(i,l);if(_(e.sheetBreakpoint)||!w)return<P hostName={`${e.scopeKey}SheetContents`}><F context={e}>{r}</F></P>;if(!e.floatingContext)return null;if(!e.open)return r;const{style:{scrollbarWidth:I,listStyleType:M,overflow:a,...c},...p}=e.interactions.getFloatingProps();return<>{!n&&<style dangerouslySetInnerHTML={{__html:A}}/>}<S context={e.floatingContext}><T size={e.size}role="presentation"{...s}ref={o}{...p}{...c}overflow={n?void 0:a??"scroll"}>{r}</T></S></>});z.displayName=i;const A=`
|
|
68
2
|
.is_SelectViewport {
|
|
69
3
|
scrollbar-width: none;
|
|
70
4
|
-webkit-overflow-scrolling: touch;
|
|
@@ -74,9 +8,5 @@ const selectViewportCSS = `
|
|
|
74
8
|
.is_SelectViewport::-webkit-scrollbar{
|
|
75
9
|
display:none
|
|
76
10
|
}
|
|
77
|
-
`;
|
|
78
|
-
export {
|
|
79
|
-
SelectViewport,
|
|
80
|
-
SelectViewportFrame
|
|
81
|
-
};
|
|
11
|
+
`;export{z as SelectViewport,T as SelectViewportFrame};
|
|
82
12
|
//# sourceMappingURL=SelectViewport.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SelectViewport.tsx"],
|
|
4
4
|
"sourcesContent": ["import { FloatingFocusManager } from '@floating-ui/react'\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 { ForwardSelectContext, useSelectContext } from './context'\nimport { ScopedProps, SelectViewportProps } from './types'\nimport { useSelectBreakpointActive } from './useSelectBreakpointActive'\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 userSelect: 'none',\n outlineWidth: 0,\n\n variants: {\n size: {\n '...size': (val, { tokens }) => {\n return {\n borderRadius: tokens.radius[val] ?? val,\n }\n },\n },\n } as const,\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, disableScroll, ...viewportProps } = props\n const context = useSelectContext(VIEWPORT_NAME, __scopeSelect)\n const breakpointActive = useSelectBreakpointActive(context.sheetBreakpoint)\n\n if (breakpointActive || !isWeb) {\n return (\n <PortalItem hostName={`${context.scopeKey}SheetContents`}>\n <ForwardSelectContext context={context}>{children}</ForwardSelectContext>\n </PortalItem>\n )\n }\n\n if (!context.floatingContext) {\n return null\n }\n\n if (!context.open) {\n return children\n }\n\n const {\n style: { scrollbarWidth, listStyleType, overflow, ...restStyle },\n ...floatingProps\n } = context.interactions!.getFloatingProps()\n\n return (\n <>\n {!disableScroll && (\n <style\n dangerouslySetInnerHTML={{\n __html: selectViewportCSS,\n }}\n />\n )}\n <FloatingFocusManager context={context.floatingContext}>\n <SelectViewportFrame\n size={context.size}\n // @ts-ignore\n role=\"presentation\"\n {...viewportProps}\n ref={forwardedRef}\n {...floatingProps}\n {...restStyle}\n overflow={disableScroll ? undefined : overflow ?? 'scroll'}\n >\n {children}\n </SelectViewportFrame>\n </FloatingFocusManager>\n </>\n )\n }\n)\n\nSelectViewport.displayName = VIEWPORT_NAME\n\nconst selectViewportCSS = `\n.is_SelectViewport {\n scrollbar-width: none;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior: contain;\n}\n\n.is_SelectViewport::-webkit-scrollbar{\n display:none\n}\n`\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAAS,wBAAAA,MAA4B,qBACrC,OAAyB,SAAAC,MAAa,gB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Y,WAEjDN,EACH,EAXCP,EAYH,EAbCV,EAcH,GAEJ,CACF,EAEAa,EAAe,YAAcP,EAE7B,MAAMoB,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": ["FloatingFocusManager", "isWeb", "styled", "PortalItem", "ThemeableStack", "React", "VIEWPORT_NAME", "ForwardSelectContext", "useSelectContext", "useSelectBreakpointActive", "SelectViewportFrame", "val", "tokens", "SelectViewport", "props", "forwardedRef", "__scopeSelect", "children", "disableScroll", "viewportProps", "context", "scrollbarWidth", "listStyleType", "overflow", "restStyle", "floatingProps", "selectViewportCSS"]
|
|
7
7
|
}
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Theme, useThemeName } from "@tamagui/core";
|
|
3
|
-
import { PortalItem } from "@tamagui/portal";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { VIEWPORT_NAME } from "./constants";
|
|
6
|
-
import { SelectProvider, useSelectContext } from "./context";
|
|
7
|
-
const SelectViewport = (props) => {
|
|
8
|
-
const { __scopeSelect, children } = props;
|
|
9
|
-
const context = useSelectContext(VIEWPORT_NAME, __scopeSelect);
|
|
10
|
-
const themeName = useThemeName();
|
|
11
|
-
const adaptContext = React.useContext(AdaptParentContext);
|
|
12
|
-
return <PortalItem hostName={`${context.scopeKey}SheetContents`}><Theme name={themeName}><SelectProvider scope={__scopeSelect} {...context}><AdaptParentContext.Provider value={adaptContext}>{children}</AdaptParentContext.Provider></SelectProvider></Theme></PortalItem>;
|
|
13
|
-
};
|
|
14
|
-
SelectViewport.displayName = VIEWPORT_NAME;
|
|
15
|
-
export {
|
|
16
|
-
SelectViewport
|
|
17
|
-
};
|
|
1
|
+
import{AdaptParentContext as o}from"@tamagui/adapt";import{Theme as P,useThemeName as l}from"@tamagui/core";import{PortalItem as S}from"@tamagui/portal";import*as f from"react";import{VIEWPORT_NAME as r}from"./constants";import{SelectProvider as C,useSelectContext as u}from"./context";const v=m=>{const{__scopeSelect:e,children:p}=m,t=u(r,e),c=l(),s=f.useContext(o);return<S hostName={`${t.scopeKey}SheetContents`}><P name={c}><C scope={e}{...t}><o.Provider value={s}>{p}</o.Provider></C></P></S>};v.displayName=r;export{v as SelectViewport};
|
|
18
2
|
//# sourceMappingURL=SelectViewport.native.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SelectViewport.native.tsx"],
|
|
4
4
|
"sourcesContent": ["import { AdaptParentContext } from '@tamagui/adapt'\nimport { Stack, Theme, useThemeName } from '@tamagui/core'\nimport { PortalItem } from '@tamagui/portal'\nimport * as React from 'react'\n\nimport { VIEWPORT_NAME } from './constants'\nimport { SelectProvider, useSelectContext } from './context'\nimport { ScopedProps, SelectViewportProps } from './types'\n\nexport const SelectViewport = (props: ScopedProps<SelectViewportProps>) => {\n const { __scopeSelect, children } = props\n const context = useSelectContext(VIEWPORT_NAME, __scopeSelect)\n const themeName = useThemeName()\n const adaptContext = React.useContext(AdaptParentContext)\n\n // need to forward context...\n return (\n <PortalItem hostName={`${context.scopeKey}SheetContents`}>\n <Theme name={themeName}>\n <SelectProvider scope={__scopeSelect} {...context}>\n <AdaptParentContext.Provider value={adaptContext}>\n {children}\n </AdaptParentContext.Provider>\n </SelectProvider>\n </Theme>\n </PortalItem>\n )\n}\n\nSelectViewport.displayName = VIEWPORT_NAME\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAAS,sBAAAA,MAA0B,iBACnC,OAAgB,SAAAC,EAAO,gBAAAC,MAAoB,gBAC3C,OAAS,cAAAC,MAAkB,kBAC3B,UAAYC,MAAW,QAEvB,OAAS,iBAAAC,MAAqB,cAC9B,OAAS,kBAAAC,EAAgB,oBAAAC,MAAwB,YAG1C,MAAMC,EAAkBC,GAA4C,CACzE,KAAM,CAAE,cAAAC,EAAe,SAAAC,CAAS,EAAIF,EAC9BG,EAAUL,EAAiBF,EAAeK,CAAa,EACvDG,EAAYX,EAAa,EACzBY,EAAeV,EAAM,WAAWJ,CAAkB,EAGxD,MACE,CAACG,EAAW,UAAU,GAAGS,EAAQ,yBAC/B,CAACX,EAAM,MAAMY,GACX,CAACP,EAAe,OAAOI,MAAmBE,GACxC,CAACZ,EAAmB,SAAS,OAAOc,IACjCH,EACH,EAFCX,EAAmB,SAGtB,EAJCM,EAKH,EANCL,EAOH,EARCE,EAUL,EAEAK,EAAe,YAAcH",
|
|
6
|
+
"names": ["AdaptParentContext", "Theme", "useThemeName", "PortalItem", "React", "VIEWPORT_NAME", "SelectProvider", "useSelectContext", "SelectViewport", "props", "__scopeSelect", "children", "context", "themeName", "adaptContext"]
|
|
7
7
|
}
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Theme, useThemeName } from "@tamagui/core";
|
|
3
|
-
import { PortalItem } from "@tamagui/portal";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { VIEWPORT_NAME } from "./constants";
|
|
6
|
-
import { SelectProvider, useSelectContext } from "./context";
|
|
7
|
-
const SelectViewport = (props) => {
|
|
8
|
-
const { __scopeSelect, children } = props;
|
|
9
|
-
const context = useSelectContext(VIEWPORT_NAME, __scopeSelect);
|
|
10
|
-
const themeName = useThemeName();
|
|
11
|
-
const adaptContext = React.useContext(AdaptParentContext);
|
|
12
|
-
return <PortalItem hostName={`${context.scopeKey}SheetContents`}><Theme name={themeName}><SelectProvider scope={__scopeSelect} {...context}><AdaptParentContext.Provider value={adaptContext}>{children}</AdaptParentContext.Provider></SelectProvider></Theme></PortalItem>;
|
|
13
|
-
};
|
|
14
|
-
SelectViewport.displayName = VIEWPORT_NAME;
|
|
15
|
-
export {
|
|
16
|
-
SelectViewport
|
|
17
|
-
};
|
|
1
|
+
import{AdaptParentContext as o}from"@tamagui/adapt";import{Theme as P,useThemeName as l}from"@tamagui/core";import{PortalItem as S}from"@tamagui/portal";import*as f from"react";import{VIEWPORT_NAME as r}from"./constants";import{SelectProvider as C,useSelectContext as u}from"./context";const v=m=>{const{__scopeSelect:e,children:p}=m,t=u(r,e),c=l(),s=f.useContext(o);return<S hostName={`${t.scopeKey}SheetContents`}><P name={c}><C scope={e}{...t}><o.Provider value={s}>{p}</o.Provider></C></P></S>};v.displayName=r;export{v as SelectViewport};
|
|
18
2
|
//# sourceMappingURL=SelectViewport.native.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SelectViewport.native.tsx"],
|
|
4
4
|
"sourcesContent": ["import { AdaptParentContext } from '@tamagui/adapt'\nimport { Stack, Theme, useThemeName } from '@tamagui/core'\nimport { PortalItem } from '@tamagui/portal'\nimport * as React from 'react'\n\nimport { VIEWPORT_NAME } from './constants'\nimport { SelectProvider, useSelectContext } from './context'\nimport { ScopedProps, SelectViewportProps } from './types'\n\nexport const SelectViewport = (props: ScopedProps<SelectViewportProps>) => {\n const { __scopeSelect, children } = props\n const context = useSelectContext(VIEWPORT_NAME, __scopeSelect)\n const themeName = useThemeName()\n const adaptContext = React.useContext(AdaptParentContext)\n\n // need to forward context...\n return (\n <PortalItem hostName={`${context.scopeKey}SheetContents`}>\n <Theme name={themeName}>\n <SelectProvider scope={__scopeSelect} {...context}>\n <AdaptParentContext.Provider value={adaptContext}>\n {children}\n </AdaptParentContext.Provider>\n </SelectProvider>\n </Theme>\n </PortalItem>\n )\n}\n\nSelectViewport.displayName = VIEWPORT_NAME\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAAS,sBAAAA,MAA0B,iBACnC,OAAgB,SAAAC,EAAO,gBAAAC,MAAoB,gBAC3C,OAAS,cAAAC,MAAkB,kBAC3B,UAAYC,MAAW,QAEvB,OAAS,iBAAAC,MAAqB,cAC9B,OAAS,kBAAAC,EAAgB,oBAAAC,MAAwB,YAG1C,MAAMC,EAAkBC,GAA4C,CACzE,KAAM,CAAE,cAAAC,EAAe,SAAAC,CAAS,EAAIF,EAC9BG,EAAUL,EAAiBF,EAAeK,CAAa,EACvDG,EAAYX,EAAa,EACzBY,EAAeV,EAAM,WAAWJ,CAAkB,EAGxD,MACE,CAACG,EAAW,UAAU,GAAGS,EAAQ,yBAC/B,CAACX,EAAM,MAAMY,GACX,CAACP,EAAe,OAAOI,MAAmBE,GACxC,CAACZ,EAAmB,SAAS,OAAOc,IACjCH,EACH,EAFCX,EAAmB,SAGtB,EAJCM,EAKH,EANCL,EAOH,EARCE,EAUL,EAEAK,EAAe,YAAcH",
|
|
6
|
+
"names": ["AdaptParentContext", "Theme", "useThemeName", "PortalItem", "React", "VIEWPORT_NAME", "SelectProvider", "useSelectContext", "SelectViewport", "props", "__scopeSelect", "children", "context", "themeName", "adaptContext"]
|
|
7
7
|
}
|
package/dist/jsx/constants.js
CHANGED
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
const
|
|
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
|
-
};
|
|
1
|
+
const t="Select",o=8,e=8,L=8,c=80,E=16,O="SelectViewport";export{E as FALLBACK_THRESHOLD,c as MIN_HEIGHT,L as SCROLL_ARROW_THRESHOLD,e as SCROLL_ARROW_VELOCITY,t as SELECT_NAME,O as VIEWPORT_NAME,o as WINDOW_PADDING};
|
|
17
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/constants.tsx"],
|
|
4
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,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAO,MAAMA,EAAc,SACdC,EAAiB,EACjBC,EAAwB,EACxBC,EAAyB,EACzBC,EAAa,GACbC,EAAqB,GACrBC,EAAgB",
|
|
6
|
+
"names": ["SELECT_NAME", "WINDOW_PADDING", "SCROLL_ARROW_VELOCITY", "SCROLL_ARROW_THRESHOLD", "MIN_HEIGHT", "FALLBACK_THRESHOLD", "VIEWPORT_NAME"]
|
|
7
7
|
}
|
package/dist/jsx/constants.mjs
CHANGED
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
const
|
|
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
|
-
};
|
|
1
|
+
const t="Select",o=8,e=8,L=8,c=80,E=16,O="SelectViewport";export{E as FALLBACK_THRESHOLD,c as MIN_HEIGHT,L as SCROLL_ARROW_THRESHOLD,e as SCROLL_ARROW_VELOCITY,t as SELECT_NAME,O as VIEWPORT_NAME,o as WINDOW_PADDING};
|
|
17
2
|
//# sourceMappingURL=constants.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/constants.tsx"],
|
|
4
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,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAO,MAAMA,EAAc,SACdC,EAAiB,EACjBC,EAAwB,EACxBC,EAAyB,EACzBC,EAAa,GACbC,EAAqB,GACrBC,EAAgB",
|
|
6
|
+
"names": ["SELECT_NAME", "WINDOW_PADDING", "SCROLL_ARROW_VELOCITY", "SCROLL_ARROW_THRESHOLD", "MIN_HEIGHT", "FALLBACK_THRESHOLD", "VIEWPORT_NAME"]
|
|
7
7
|
}
|
package/dist/jsx/context.js
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SELECT_NAME } from "./constants";
|
|
3
|
-
const [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME);
|
|
4
|
-
const [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME);
|
|
5
|
-
const ForwardSelectContext = (props) => {
|
|
6
|
-
return <SelectProvider isInSheet scope={props.__scopeSelect} {...props.context}>{props.children}</SelectProvider>;
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
ForwardSelectContext,
|
|
10
|
-
SelectProvider,
|
|
11
|
-
createSelectContext,
|
|
12
|
-
createSelectScope,
|
|
13
|
-
useSelectContext
|
|
14
|
-
};
|
|
1
|
+
import{createContextScope as o}from"@tamagui/create-context";import{SELECT_NAME as t}from"./constants";const[c,C]=o(t),[S,d]=c(t),s=e=><S isInSheet scope={e.__scopeSelect}{...e.context}>{e.children}</S>;export{s as ForwardSelectContext,S as SelectProvider,c as createSelectContext,C as createSelectScope,d as useSelectContext};
|
|
15
2
|
//# sourceMappingURL=context.js.map
|
package/dist/jsx/context.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/context.tsx"],
|
|
4
4
|
"sourcesContent": ["import { createContextScope } from '@tamagui/create-context'\n\nimport { SELECT_NAME } from './constants'\nimport { ScopedProps, SelectContextValue } from './types'\n\nexport const [createSelectContext, createSelectScope] =\n createContextScope(SELECT_NAME)\n\nexport const [SelectProvider, useSelectContext] =\n createSelectContext<SelectContextValue>(SELECT_NAME)\n\nexport const ForwardSelectContext = (\n props: ScopedProps<{ children?: any; context: SelectContextValue }>,\n) => {\n return (\n <SelectProvider isInSheet scope={props.__scopeSelect} {...props.context}>\n {props.children}\n </SelectProvider>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAAS,sBAAAA,MAA0B,0BAEnC,OAAS,eAAAC,MAAmB,cAGrB,KAAM,CAACC,EAAqBC,CAAiB,EAClDH,EAAmBC,CAAW,EAEnB,CAACG,EAAgBC,CAAgB,EAC5CH,EAAwCD,CAAW,EAExCK,EACXC,GAGE,CAACH,EAAe,UAAU,OAAOG,EAAM,kBAAmBA,EAAM,UAC7DA,EAAM,SACT,EAFCH",
|
|
6
|
+
"names": ["createContextScope", "SELECT_NAME", "createSelectContext", "createSelectScope", "SelectProvider", "useSelectContext", "ForwardSelectContext", "props"]
|
|
7
7
|
}
|