@tamagui/select 1.41.0 → 1.42.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/package.json +18 -18
- package/types/Select.d.ts +346 -88
- package/types/Select.d.ts.map +1 -1
- package/types/SelectTrigger.d.ts +25 -3
- package/types/SelectTrigger.d.ts.map +1 -1
- package/types/SelectViewport.d.ts +90 -13
- package/types/SelectViewport.d.ts.map +1 -1
- package/dist/cjs/useSelectItemContext.js +0 -180
- package/dist/cjs/useSelectItemContext.js.map +0 -6
- package/dist/esm/useSelectItemContext.js +0 -146
- package/dist/esm/useSelectItemContext.js.map +0 -6
- package/dist/jsx/useSelectItemContext.js +0 -137
- package/dist/jsx/useSelectItemContext.js.map +0 -6
- package/dist/jsx/useSelectItemContext.mjs +0 -137
- package/dist/jsx/useSelectItemContext.mjs.map +0 -6
- package/types/useSelectItemContext.d.ts +0 -145
- package/types/useSelectItemContext.d.ts.map +0 -1
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/useSelectItemContext.tsx"],
|
|
4
|
-
"mappings": "AAuJU;AAvJV,SAAS,uBAAuB;AAChC,SAAS,OAAO,gBAAgB,iCAAiC;AACjE,SAAS,gBAA+B;AACxC,YAAY,WAAW;AAEvB,SAAS,qBAAqB,wBAAwB;AAMtD,MAAM,YAAY;AAMlB,MAAM,CAAC,2BAA2B,oBAAoB,IACpD,oBAA4C,SAAS;AAShD,MAAM,aAAa,SAAS;AAAA,EACjC,CAAC,OAAqC,iBAAiB;AACrD,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX,WAAW;AAAA,MACX;AAAA,MACA,GAAG;AAAA,IACL,IAAI;AACJ,UAAM,UAAU,iBAAiB,WAAW,aAAa;AACzD,UAAM,aAAa,QAAQ,UAAU;AACrC,UAAM,SAAS,MAAM,MAAM;AAE3B,UAAM;AAAA,MACJ;AA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AA,QACf;AAIA,qBAAa,iBAAkB,OAAO;AACtC,yBAAkB,UAAU,WAAW,MAAM;AAC3C,yBAAgB,UAAU;AAAA,QAC5B,CAAC;AAAA,MACH;AAAA,IACF,CAAC,IACD;AAAA,MACE,SAAS;AAAA,IACX;AAEJ,UAAM,WAAW,gBAAgB;AAEjC,UAAM,UAAU,MAAM;AAzI1B;AA0IM,UAAI,UAAU;AACZ,iDAAS,QAAQ,WAAjB,mBAAyB;AAAA,MAC3B;AAAA,IACF,GAAG,CAAC,QAAQ,CAAC;AAEb,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP;AAAA,QACA,QAAQ,UAAU;AAAA,QAClB;AAAA,QAEC,kBAAQ,wBACP,oBAAC,YAAO,OAAe,gBAAM,UAAS,IAEtC;AAAA,UAAC;AAAA;AAAA,YACC,KAAI;AAAA,YACJ,eAAe;AAAA,YACf,cAAY;AAAA,YACZ,YAAU;AAAA,YACV,YAAU;AAAA,YACV,YAAU;AAAA,YACV,QAAO;AAAA,YACP,cAAc;AAAA,YACd,KAAK;AAAA,YACL,mBAAiB;AAAA,YACjB,iBAAe;AAAA,YACf,cAAY,aAAa,WAAW;AAAA,YACpC,iBAAe,YAAY;AAAA,YAC3B,iBAAe,WAAW,KAAK;AAAA,YAC/B,UAAU,WAAW,SAAY;AAAA,YACjC,MAAM,QAAQ;AAAA,YACb,GAAG;AAAA,YACH,GAAG;AAAA,YACH,GAAI,YAAY;AAAA,cACf,OAAO;AAAA,YACT;AAAA;AAAA,QACF;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AACA,WAAW,cAAc;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
2
|
-
import { isWeb, isWebTouchable, useIsomorphicLayoutEffect } from "@tamagui/core";
|
|
3
|
-
import { ListItem } from "@tamagui/list-item";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { createSelectContext, useSelectContext } from "./context";
|
|
6
|
-
const ITEM_NAME = "SelectItem";
|
|
7
|
-
const [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);
|
|
8
|
-
const SelectItem = ListItem.styleable(
|
|
9
|
-
(props, forwardedRef) => {
|
|
10
|
-
const {
|
|
11
|
-
__scopeSelect,
|
|
12
|
-
value,
|
|
13
|
-
disabled = false,
|
|
14
|
-
textValue: textValueProp,
|
|
15
|
-
index,
|
|
16
|
-
...itemProps
|
|
17
|
-
} = props;
|
|
18
|
-
const context = useSelectContext(ITEM_NAME, __scopeSelect);
|
|
19
|
-
const isSelected = context.value === value;
|
|
20
|
-
const textId = React.useId();
|
|
21
|
-
const {
|
|
22
|
-
selectedIndex,
|
|
23
|
-
setSelectedIndex,
|
|
24
|
-
listRef,
|
|
25
|
-
open,
|
|
26
|
-
setOpen,
|
|
27
|
-
onChange,
|
|
28
|
-
activeIndex,
|
|
29
|
-
allowMouseUpRef,
|
|
30
|
-
allowSelectRef,
|
|
31
|
-
setValueAtIndex,
|
|
32
|
-
selectTimeoutRef,
|
|
33
|
-
dataRef
|
|
34
|
-
} = context;
|
|
35
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => {
|
|
36
|
-
if (!isWeb)
|
|
37
|
-
return;
|
|
38
|
-
if (node instanceof HTMLElement) {
|
|
39
|
-
if (listRef) {
|
|
40
|
-
listRef.current[index] = node;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
useIsomorphicLayoutEffect(() => {
|
|
45
|
-
setValueAtIndex(index, value);
|
|
46
|
-
}, [index, setValueAtIndex, value]);
|
|
47
|
-
function handleSelect() {
|
|
48
|
-
setSelectedIndex(index);
|
|
49
|
-
onChange(value);
|
|
50
|
-
setOpen(false);
|
|
51
|
-
}
|
|
52
|
-
const selectItemProps = context.interactions ? context.interactions.getItemProps({
|
|
53
|
-
...isWebTouchable ? {
|
|
54
|
-
onTouchStart() {
|
|
55
|
-
allowSelectRef.current = true;
|
|
56
|
-
allowMouseUpRef.current = false;
|
|
57
|
-
}
|
|
58
|
-
} : {
|
|
59
|
-
onTouchMove() {
|
|
60
|
-
allowSelectRef.current = true;
|
|
61
|
-
allowMouseUpRef.current = false;
|
|
62
|
-
},
|
|
63
|
-
onTouchEnd() {
|
|
64
|
-
allowSelectRef.current = false;
|
|
65
|
-
allowMouseUpRef.current = true;
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
onKeyDown(event) {
|
|
69
|
-
if (event.key === "Enter" || event.key === " " && !dataRef?.current.typing) {
|
|
70
|
-
event.preventDefault();
|
|
71
|
-
handleSelect();
|
|
72
|
-
} else {
|
|
73
|
-
allowSelectRef.current = true;
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
onClick() {
|
|
77
|
-
if (allowSelectRef.current) {
|
|
78
|
-
setSelectedIndex(index);
|
|
79
|
-
setOpen(false);
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
onMouseUp() {
|
|
83
|
-
if (!allowMouseUpRef.current) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if (allowSelectRef.current) {
|
|
87
|
-
handleSelect();
|
|
88
|
-
}
|
|
89
|
-
clearTimeout(selectTimeoutRef.current);
|
|
90
|
-
selectTimeoutRef.current = setTimeout(() => {
|
|
91
|
-
allowSelectRef.current = true;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}) : {
|
|
95
|
-
onPress: handleSelect
|
|
96
|
-
};
|
|
97
|
-
const isActive = activeIndex === index;
|
|
98
|
-
React.useEffect(() => {
|
|
99
|
-
if (isActive) {
|
|
100
|
-
listRef?.current[index]?.focus();
|
|
101
|
-
}
|
|
102
|
-
}, [isActive]);
|
|
103
|
-
return <SelectItemContextProvider
|
|
104
|
-
scope={__scopeSelect}
|
|
105
|
-
value={value}
|
|
106
|
-
textId={textId || ""}
|
|
107
|
-
isSelected={isSelected}
|
|
108
|
-
>{context.shouldRenderWebNative ? <option value={value}>{props.children}</option> : <ListItem
|
|
109
|
-
tag="div"
|
|
110
|
-
componentName={ITEM_NAME}
|
|
111
|
-
backgrounded
|
|
112
|
-
pressTheme
|
|
113
|
-
hoverTheme
|
|
114
|
-
focusTheme
|
|
115
|
-
cursor="default"
|
|
116
|
-
outlineWidth={0}
|
|
117
|
-
ref={composedRefs}
|
|
118
|
-
aria-labelledby={textId}
|
|
119
|
-
aria-selected={isSelected}
|
|
120
|
-
data-state={isSelected ? "active" : "inactive"}
|
|
121
|
-
aria-disabled={disabled || void 0}
|
|
122
|
-
data-disabled={disabled ? "" : void 0}
|
|
123
|
-
tabIndex={disabled ? void 0 : -1}
|
|
124
|
-
size={context.size}
|
|
125
|
-
{...itemProps}
|
|
126
|
-
{...selectItemProps}
|
|
127
|
-
{...isActive && {
|
|
128
|
-
theme: "active"
|
|
129
|
-
}}
|
|
130
|
-
/>}</SelectItemContextProvider>;
|
|
131
|
-
}
|
|
132
|
-
);
|
|
133
|
-
SelectItem.displayName = ITEM_NAME;
|
|
134
|
-
export {
|
|
135
|
-
SelectItem
|
|
136
|
-
};
|
|
137
|
-
//# sourceMappingURL=useSelectItemContext.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/useSelectItemContext.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,uBAAuB;AAChC,SAAS,OAAO,gBAAgB,iCAAiC;AACjE,SAAS,gBAA+B;AACxC,YAAY,WAAW;AAEvB,SAAS,qBAAqB,wBAAwB;AAMtD,MAAM,YAAY;AAMlB,MAAM,CAAC,2BAA2B,oBAAoB,IACpD,oBAA4C,SAAS;AAShD,MAAM,aAAa,SAAS;AAAA,EACjC,CAAC,OAAqC,iBAAiB;AACrD,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX,WAAW;AAAA,MACX;AAAA,MACA,GAAG;AAAA,IACL,IAAI;A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QACf;AAAA,MACF;AAAA,MAEA,YAAY;AACV,YAAI,CAAC,gBAAiB,SAAS;AAC7B;AAAA,QACF;AAEA,YAAI,eAAgB,SAAS;AAC3B,uBAAa;AAAA,QACf;AAIA,qBAAa,iBAAkB,OAAO;AACtC,yBAAkB,UAAU,WAAW,MAAM;AAC3C,yBAAgB,UAAU;AAAA,QAC5B,CAAC;AAAA,MACH;AAAA,IACF,CAAC,IACD;AAAA,MACE,SAAS;AAAA,IACX;AAEJ,UAAM,WAAW,gBAAgB;AAEjC,UAAM,UAAU,MAAM;AACpB,UAAI,UAAU;AACZ,iBAAS,QAAQ,KAAK,GAAG,MAAM;AAAA,MACjC;AAAA,IACF,GAAG,CAAC,QAAQ,CAAC;AAEb,WACE,CAAC;AAAA,MACC,OAAO;AAAA,MACP,OAAO;AAAA,MACP,QAAQ,UAAU;AAAA,MAClB,YAAY;AAAA,MAEX,QAAQ,wBACP,CAAC,OAAO,OAAO,QAAQ,MAAM,SAAS,EAArC,UAED,CAAC;AAAA,MACC,IAAI;AAAA,MACJ,eAAe;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,cAAc;AAAA,MACd,KAAK;AAAA,MACL,iBAAiB;AAAA,MACjB,eAAe;AAAA,MACf,YAAY,aAAa,WAAW;AAAA,MACpC,eAAe,YAAY;AAAA,MAC3B,eAAe,WAAW,KAAK;AAAA,MAC/B,UAAU,WAAW,SAAY;AAAA,MACjC,MAAM,QAAQ;AAAA,UACV;AAAA,UACA;AAAA,UACC,YAAY;AAAA,QACf,OAAO;AAAA,MACT;AAAA,IACF,GAEJ,EAjCC;AAAA,EAmCL;AACF;AACA,WAAW,cAAc;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
2
|
-
import { isWeb, isWebTouchable, useIsomorphicLayoutEffect } from "@tamagui/core";
|
|
3
|
-
import { ListItem } from "@tamagui/list-item";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { createSelectContext, useSelectContext } from "./context";
|
|
6
|
-
const ITEM_NAME = "SelectItem";
|
|
7
|
-
const [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);
|
|
8
|
-
const SelectItem = ListItem.styleable(
|
|
9
|
-
(props, forwardedRef) => {
|
|
10
|
-
const {
|
|
11
|
-
__scopeSelect,
|
|
12
|
-
value,
|
|
13
|
-
disabled = false,
|
|
14
|
-
textValue: textValueProp,
|
|
15
|
-
index,
|
|
16
|
-
...itemProps
|
|
17
|
-
} = props;
|
|
18
|
-
const context = useSelectContext(ITEM_NAME, __scopeSelect);
|
|
19
|
-
const isSelected = context.value === value;
|
|
20
|
-
const textId = React.useId();
|
|
21
|
-
const {
|
|
22
|
-
selectedIndex,
|
|
23
|
-
setSelectedIndex,
|
|
24
|
-
listRef,
|
|
25
|
-
open,
|
|
26
|
-
setOpen,
|
|
27
|
-
onChange,
|
|
28
|
-
activeIndex,
|
|
29
|
-
allowMouseUpRef,
|
|
30
|
-
allowSelectRef,
|
|
31
|
-
setValueAtIndex,
|
|
32
|
-
selectTimeoutRef,
|
|
33
|
-
dataRef
|
|
34
|
-
} = context;
|
|
35
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => {
|
|
36
|
-
if (!isWeb)
|
|
37
|
-
return;
|
|
38
|
-
if (node instanceof HTMLElement) {
|
|
39
|
-
if (listRef) {
|
|
40
|
-
listRef.current[index] = node;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
useIsomorphicLayoutEffect(() => {
|
|
45
|
-
setValueAtIndex(index, value);
|
|
46
|
-
}, [index, setValueAtIndex, value]);
|
|
47
|
-
function handleSelect() {
|
|
48
|
-
setSelectedIndex(index);
|
|
49
|
-
onChange(value);
|
|
50
|
-
setOpen(false);
|
|
51
|
-
}
|
|
52
|
-
const selectItemProps = context.interactions ? context.interactions.getItemProps({
|
|
53
|
-
...isWebTouchable ? {
|
|
54
|
-
onTouchStart() {
|
|
55
|
-
allowSelectRef.current = true;
|
|
56
|
-
allowMouseUpRef.current = false;
|
|
57
|
-
}
|
|
58
|
-
} : {
|
|
59
|
-
onTouchMove() {
|
|
60
|
-
allowSelectRef.current = true;
|
|
61
|
-
allowMouseUpRef.current = false;
|
|
62
|
-
},
|
|
63
|
-
onTouchEnd() {
|
|
64
|
-
allowSelectRef.current = false;
|
|
65
|
-
allowMouseUpRef.current = true;
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
onKeyDown(event) {
|
|
69
|
-
if (event.key === "Enter" || event.key === " " && !dataRef?.current.typing) {
|
|
70
|
-
event.preventDefault();
|
|
71
|
-
handleSelect();
|
|
72
|
-
} else {
|
|
73
|
-
allowSelectRef.current = true;
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
onClick() {
|
|
77
|
-
if (allowSelectRef.current) {
|
|
78
|
-
setSelectedIndex(index);
|
|
79
|
-
setOpen(false);
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
onMouseUp() {
|
|
83
|
-
if (!allowMouseUpRef.current) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if (allowSelectRef.current) {
|
|
87
|
-
handleSelect();
|
|
88
|
-
}
|
|
89
|
-
clearTimeout(selectTimeoutRef.current);
|
|
90
|
-
selectTimeoutRef.current = setTimeout(() => {
|
|
91
|
-
allowSelectRef.current = true;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}) : {
|
|
95
|
-
onPress: handleSelect
|
|
96
|
-
};
|
|
97
|
-
const isActive = activeIndex === index;
|
|
98
|
-
React.useEffect(() => {
|
|
99
|
-
if (isActive) {
|
|
100
|
-
listRef?.current[index]?.focus();
|
|
101
|
-
}
|
|
102
|
-
}, [isActive]);
|
|
103
|
-
return <SelectItemContextProvider
|
|
104
|
-
scope={__scopeSelect}
|
|
105
|
-
value={value}
|
|
106
|
-
textId={textId || ""}
|
|
107
|
-
isSelected={isSelected}
|
|
108
|
-
>{context.shouldRenderWebNative ? <option value={value}>{props.children}</option> : <ListItem
|
|
109
|
-
tag="div"
|
|
110
|
-
componentName={ITEM_NAME}
|
|
111
|
-
backgrounded
|
|
112
|
-
pressTheme
|
|
113
|
-
hoverTheme
|
|
114
|
-
focusTheme
|
|
115
|
-
cursor="default"
|
|
116
|
-
outlineWidth={0}
|
|
117
|
-
ref={composedRefs}
|
|
118
|
-
aria-labelledby={textId}
|
|
119
|
-
aria-selected={isSelected}
|
|
120
|
-
data-state={isSelected ? "active" : "inactive"}
|
|
121
|
-
aria-disabled={disabled || void 0}
|
|
122
|
-
data-disabled={disabled ? "" : void 0}
|
|
123
|
-
tabIndex={disabled ? void 0 : -1}
|
|
124
|
-
size={context.size}
|
|
125
|
-
{...itemProps}
|
|
126
|
-
{...selectItemProps}
|
|
127
|
-
{...isActive && {
|
|
128
|
-
theme: "active"
|
|
129
|
-
}}
|
|
130
|
-
/>}</SelectItemContextProvider>;
|
|
131
|
-
}
|
|
132
|
-
);
|
|
133
|
-
SelectItem.displayName = ITEM_NAME;
|
|
134
|
-
export {
|
|
135
|
-
SelectItem
|
|
136
|
-
};
|
|
137
|
-
//# sourceMappingURL=useSelectItemContext.mjs.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/useSelectItemContext.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,uBAAuB;AAChC,SAAS,OAAO,gBAAgB,iCAAiC;AACjE,SAAS,gBAA+B;AACxC,YAAY,WAAW;AAEvB,SAAS,qBAAqB,wBAAwB;AAMtD,MAAM,YAAY;AAMlB,MAAM,CAAC,2BAA2B,oBAAoB,IACpD,oBAA4C,SAAS;AAShD,MAAM,aAAa,SAAS;AAAA,EACjC,CAAC,OAAqC,iBAAiB;AACrD,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA,WAAW;AAAA,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 'react';
|
|
3
|
-
export interface SelectItemProps extends ListItemProps {
|
|
4
|
-
value: string;
|
|
5
|
-
index: number;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
textValue?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const SelectItem: import("@tamagui/core").ReactComponentWithRef<SelectItemProps & Omit<Omit<import("react-native").ViewProps, "style" | "children" | "display" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & {
|
|
10
|
-
style?: import("@tamagui/core").StyleProp<React.CSSProperties | import("react-native").ViewStyle | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
11
|
-
} & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{
|
|
12
|
-
readonly fullscreen?: boolean | undefined;
|
|
13
|
-
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
14
|
-
} & {
|
|
15
|
-
readonly backgrounded?: boolean | undefined;
|
|
16
|
-
readonly radiused?: boolean | undefined;
|
|
17
|
-
readonly hoverTheme?: boolean | undefined;
|
|
18
|
-
readonly pressTheme?: boolean | undefined;
|
|
19
|
-
readonly focusTheme?: boolean | undefined;
|
|
20
|
-
readonly circular?: boolean | undefined;
|
|
21
|
-
readonly padded?: boolean | undefined;
|
|
22
|
-
readonly elevate?: boolean | undefined;
|
|
23
|
-
readonly bordered?: number | boolean | undefined;
|
|
24
|
-
readonly transparent?: boolean | undefined;
|
|
25
|
-
readonly chromeless?: boolean | "all" | undefined;
|
|
26
|
-
}, "disabled" | "size" | "active" | "unstyled"> & {
|
|
27
|
-
readonly unstyled?: boolean | undefined;
|
|
28
|
-
readonly size?: import("@tamagui/core").SizeTokens | undefined;
|
|
29
|
-
readonly active?: boolean | undefined;
|
|
30
|
-
readonly disabled?: boolean | undefined;
|
|
31
|
-
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "style" | "children" | "display" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & {
|
|
32
|
-
style?: import("@tamagui/core").StyleProp<React.CSSProperties | import("react-native").ViewStyle | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
33
|
-
} & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{
|
|
34
|
-
readonly fullscreen?: boolean | undefined;
|
|
35
|
-
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
36
|
-
} & {
|
|
37
|
-
readonly backgrounded?: boolean | undefined;
|
|
38
|
-
readonly radiused?: boolean | undefined;
|
|
39
|
-
readonly hoverTheme?: boolean | undefined;
|
|
40
|
-
readonly pressTheme?: boolean | undefined;
|
|
41
|
-
readonly focusTheme?: boolean | undefined;
|
|
42
|
-
readonly circular?: boolean | undefined;
|
|
43
|
-
readonly padded?: boolean | undefined;
|
|
44
|
-
readonly elevate?: boolean | undefined;
|
|
45
|
-
readonly bordered?: number | boolean | undefined;
|
|
46
|
-
readonly transparent?: boolean | undefined;
|
|
47
|
-
readonly chromeless?: boolean | "all" | undefined;
|
|
48
|
-
}, "disabled" | "size" | "active" | "unstyled"> & {
|
|
49
|
-
readonly unstyled?: boolean | undefined;
|
|
50
|
-
readonly size?: import("@tamagui/core").SizeTokens | undefined;
|
|
51
|
-
readonly active?: boolean | undefined;
|
|
52
|
-
readonly disabled?: boolean | undefined;
|
|
53
|
-
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "style" | "children" | "display" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & {
|
|
54
|
-
style?: import("@tamagui/core").StyleProp<React.CSSProperties | import("react-native").ViewStyle | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
55
|
-
} & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{
|
|
56
|
-
readonly fullscreen?: boolean | undefined;
|
|
57
|
-
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
58
|
-
} & {
|
|
59
|
-
readonly backgrounded?: boolean | undefined;
|
|
60
|
-
readonly radiused?: boolean | undefined;
|
|
61
|
-
readonly hoverTheme?: boolean | undefined;
|
|
62
|
-
readonly pressTheme?: boolean | undefined;
|
|
63
|
-
readonly focusTheme?: boolean | undefined;
|
|
64
|
-
readonly circular?: boolean | undefined;
|
|
65
|
-
readonly padded?: boolean | undefined;
|
|
66
|
-
readonly elevate?: boolean | undefined;
|
|
67
|
-
readonly bordered?: number | boolean | undefined;
|
|
68
|
-
readonly transparent?: boolean | undefined;
|
|
69
|
-
readonly chromeless?: boolean | "all" | undefined;
|
|
70
|
-
}, "disabled" | "size" | "active" | "unstyled"> & {
|
|
71
|
-
readonly unstyled?: boolean | undefined;
|
|
72
|
-
readonly size?: import("@tamagui/core").SizeTokens | undefined;
|
|
73
|
-
readonly active?: boolean | undefined;
|
|
74
|
-
readonly disabled?: boolean | undefined;
|
|
75
|
-
}>>, keyof SelectItemProps>, import("@tamagui/core").TamaguiElement> & {
|
|
76
|
-
staticConfig: import("@tamagui/core").StaticConfigParsed;
|
|
77
|
-
styleable: import("@tamagui/core").Styleable<Omit<import("react-native").ViewProps, "style" | "children" | "display" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & {
|
|
78
|
-
style?: import("@tamagui/core").StyleProp<React.CSSProperties | import("react-native").ViewStyle | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
79
|
-
} & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{
|
|
80
|
-
readonly fullscreen?: boolean | undefined;
|
|
81
|
-
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
82
|
-
} & {
|
|
83
|
-
readonly backgrounded?: boolean | undefined;
|
|
84
|
-
readonly radiused?: boolean | undefined;
|
|
85
|
-
readonly hoverTheme?: boolean | undefined;
|
|
86
|
-
readonly pressTheme?: boolean | undefined;
|
|
87
|
-
readonly focusTheme?: boolean | undefined;
|
|
88
|
-
readonly circular?: boolean | undefined;
|
|
89
|
-
readonly padded?: boolean | undefined;
|
|
90
|
-
readonly elevate?: boolean | undefined;
|
|
91
|
-
readonly bordered?: number | boolean | undefined;
|
|
92
|
-
readonly transparent?: boolean | undefined;
|
|
93
|
-
readonly chromeless?: boolean | "all" | undefined;
|
|
94
|
-
}, "disabled" | "size" | "active" | "unstyled"> & {
|
|
95
|
-
readonly unstyled?: boolean | undefined;
|
|
96
|
-
readonly size?: import("@tamagui/core").SizeTokens | undefined;
|
|
97
|
-
readonly active?: boolean | undefined;
|
|
98
|
-
readonly disabled?: boolean | undefined;
|
|
99
|
-
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "style" | "children" | "display" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & {
|
|
100
|
-
style?: import("@tamagui/core").StyleProp<React.CSSProperties | import("react-native").ViewStyle | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
101
|
-
} & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{
|
|
102
|
-
readonly fullscreen?: boolean | undefined;
|
|
103
|
-
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
104
|
-
} & {
|
|
105
|
-
readonly backgrounded?: boolean | undefined;
|
|
106
|
-
readonly radiused?: boolean | undefined;
|
|
107
|
-
readonly hoverTheme?: boolean | undefined;
|
|
108
|
-
readonly pressTheme?: boolean | undefined;
|
|
109
|
-
readonly focusTheme?: boolean | undefined;
|
|
110
|
-
readonly circular?: boolean | undefined;
|
|
111
|
-
readonly padded?: boolean | undefined;
|
|
112
|
-
readonly elevate?: boolean | undefined;
|
|
113
|
-
readonly bordered?: number | boolean | undefined;
|
|
114
|
-
readonly transparent?: boolean | undefined;
|
|
115
|
-
readonly chromeless?: boolean | "all" | undefined;
|
|
116
|
-
}, "disabled" | "size" | "active" | "unstyled"> & {
|
|
117
|
-
readonly unstyled?: boolean | undefined;
|
|
118
|
-
readonly size?: import("@tamagui/core").SizeTokens | undefined;
|
|
119
|
-
readonly active?: boolean | undefined;
|
|
120
|
-
readonly disabled?: boolean | undefined;
|
|
121
|
-
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "style" | "children" | "display" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & {
|
|
122
|
-
style?: import("@tamagui/core").StyleProp<React.CSSProperties | import("react-native").ViewStyle | (React.CSSProperties & import("react-native").ViewStyle)>;
|
|
123
|
-
} & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{
|
|
124
|
-
readonly fullscreen?: boolean | undefined;
|
|
125
|
-
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
126
|
-
} & {
|
|
127
|
-
readonly backgrounded?: boolean | undefined;
|
|
128
|
-
readonly radiused?: boolean | undefined;
|
|
129
|
-
readonly hoverTheme?: boolean | undefined;
|
|
130
|
-
readonly pressTheme?: boolean | undefined;
|
|
131
|
-
readonly focusTheme?: boolean | undefined;
|
|
132
|
-
readonly circular?: boolean | undefined;
|
|
133
|
-
readonly padded?: boolean | undefined;
|
|
134
|
-
readonly elevate?: boolean | undefined;
|
|
135
|
-
readonly bordered?: number | boolean | undefined;
|
|
136
|
-
readonly transparent?: boolean | undefined;
|
|
137
|
-
readonly chromeless?: boolean | "all" | undefined;
|
|
138
|
-
}, "disabled" | "size" | "active" | "unstyled"> & {
|
|
139
|
-
readonly unstyled?: boolean | undefined;
|
|
140
|
-
readonly size?: import("@tamagui/core").SizeTokens | undefined;
|
|
141
|
-
readonly active?: boolean | undefined;
|
|
142
|
-
readonly disabled?: boolean | undefined;
|
|
143
|
-
}>>, import("@tamagui/core").TamaguiElement>;
|
|
144
|
-
};
|
|
145
|
-
//# sourceMappingURL=useSelectItemContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectItemContext.d.ts","sourceRoot":"","sources":["../src/useSelectItemContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAiB9B,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyJtB,CAAA"}
|