@tamagui/linear-gradient 1.0.11 → 1.0.13

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.
Files changed (85) hide show
  1. package/package.json +4 -4
  2. package/dist/cjs/BubbleSelect.js +0 -44
  3. package/dist/cjs/BubbleSelect.js.map +0 -7
  4. package/dist/cjs/Select.js +0 -480
  5. package/dist/cjs/Select.js.map +0 -7
  6. package/dist/cjs/SelectContent.js +0 -76
  7. package/dist/cjs/SelectContent.js.map +0 -7
  8. package/dist/cjs/SelectContent.native.js +0 -31
  9. package/dist/cjs/SelectContent.native.js.map +0 -7
  10. package/dist/cjs/SelectImpl.js +0 -301
  11. package/dist/cjs/SelectImpl.js.map +0 -7
  12. package/dist/cjs/SelectImpl.native.js +0 -37
  13. package/dist/cjs/SelectImpl.native.js.map +0 -7
  14. package/dist/cjs/SelectScrollButton.js +0 -161
  15. package/dist/cjs/SelectScrollButton.js.map +0 -7
  16. package/dist/cjs/SelectScrollButton.native.js +0 -32
  17. package/dist/cjs/SelectScrollButton.native.js.map +0 -7
  18. package/dist/cjs/SelectViewport.js +0 -126
  19. package/dist/cjs/SelectViewport.js.map +0 -7
  20. package/dist/cjs/SelectViewport.native.js +0 -62
  21. package/dist/cjs/SelectViewport.native.js.map +0 -7
  22. package/dist/cjs/constants.js +0 -47
  23. package/dist/cjs/constants.js.map +0 -7
  24. package/dist/cjs/context.js +0 -49
  25. package/dist/cjs/context.js.map +0 -7
  26. package/dist/cjs/types.js +0 -17
  27. package/dist/cjs/types.js.map +0 -7
  28. package/dist/cjs/useSelectBreakpointActive.js +0 -39
  29. package/dist/cjs/useSelectBreakpointActive.js.map +0 -7
  30. package/dist/esm/BubbleSelect.js +0 -25
  31. package/dist/esm/BubbleSelect.js.map +0 -7
  32. package/dist/esm/Select.js +0 -452
  33. package/dist/esm/Select.js.map +0 -7
  34. package/dist/esm/SelectContent.js +0 -52
  35. package/dist/esm/SelectContent.js.map +0 -7
  36. package/dist/esm/SelectContent.native.js +0 -7
  37. package/dist/esm/SelectContent.native.js.map +0 -7
  38. package/dist/esm/SelectImpl.js +0 -286
  39. package/dist/esm/SelectImpl.js.map +0 -7
  40. package/dist/esm/SelectImpl.native.js +0 -13
  41. package/dist/esm/SelectImpl.native.js.map +0 -7
  42. package/dist/esm/SelectScrollButton.js +0 -130
  43. package/dist/esm/SelectScrollButton.js.map +0 -7
  44. package/dist/esm/SelectScrollButton.native.js +0 -7
  45. package/dist/esm/SelectScrollButton.native.js.map +0 -7
  46. package/dist/esm/SelectViewport.js +0 -95
  47. package/dist/esm/SelectViewport.js.map +0 -7
  48. package/dist/esm/SelectViewport.native.js +0 -32
  49. package/dist/esm/SelectViewport.native.js.map +0 -7
  50. package/dist/esm/constants.js +0 -17
  51. package/dist/esm/constants.js.map +0 -7
  52. package/dist/esm/context.js +0 -21
  53. package/dist/esm/context.js.map +0 -7
  54. package/dist/esm/types.js +0 -1
  55. package/dist/esm/types.js.map +0 -7
  56. package/dist/esm/useSelectBreakpointActive.js +0 -14
  57. package/dist/esm/useSelectBreakpointActive.js.map +0 -7
  58. package/dist/jsx/BubbleSelect.js +0 -25
  59. package/dist/jsx/BubbleSelect.js.map +0 -7
  60. package/dist/jsx/Select.js +0 -326
  61. package/dist/jsx/Select.js.map +0 -7
  62. package/dist/jsx/SelectContent.js +0 -30
  63. package/dist/jsx/SelectContent.js.map +0 -7
  64. package/dist/jsx/SelectContent.native.js +0 -7
  65. package/dist/jsx/SelectContent.native.js.map +0 -7
  66. package/dist/jsx/SelectImpl.js +0 -259
  67. package/dist/jsx/SelectImpl.js.map +0 -7
  68. package/dist/jsx/SelectImpl.native.js +0 -10
  69. package/dist/jsx/SelectImpl.native.js.map +0 -7
  70. package/dist/jsx/SelectScrollButton.js +0 -103
  71. package/dist/jsx/SelectScrollButton.js.map +0 -7
  72. package/dist/jsx/SelectScrollButton.native.js +0 -7
  73. package/dist/jsx/SelectScrollButton.native.js.map +0 -7
  74. package/dist/jsx/SelectViewport.js +0 -73
  75. package/dist/jsx/SelectViewport.js.map +0 -7
  76. package/dist/jsx/SelectViewport.native.js +0 -18
  77. package/dist/jsx/SelectViewport.native.js.map +0 -7
  78. package/dist/jsx/constants.js +0 -17
  79. package/dist/jsx/constants.js.map +0 -7
  80. package/dist/jsx/context.js +0 -15
  81. package/dist/jsx/context.js.map +0 -7
  82. package/dist/jsx/types.js +0 -1
  83. package/dist/jsx/types.js.map +0 -7
  84. package/dist/jsx/useSelectBreakpointActive.js +0 -14
  85. package/dist/jsx/useSelectBreakpointActive.js.map +0 -7
@@ -1,161 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
- var SelectScrollButton_exports = {};
26
- __export(SelectScrollButton_exports, {
27
- SelectScrollDownButton: () => SelectScrollDownButton,
28
- SelectScrollUpButton: () => SelectScrollUpButton
29
- });
30
- module.exports = __toCommonJS(SelectScrollButton_exports);
31
- var import_jsx_runtime = require("react/jsx-runtime");
32
- var import_react_dom_interactions = require("@floating-ui/react-dom-interactions");
33
- var import_compose_refs = require("@tamagui/compose-refs");
34
- var import_core = require("@tamagui/core");
35
- var import_stacks = require("@tamagui/stacks");
36
- var React = __toESM(require("react"));
37
- var import_react_dom = require("react-dom");
38
- var import_context = require("./context");
39
- const SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
40
- const SelectScrollUpButton = React.forwardRef((props, forwardedRef) => {
41
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollButtonImpl, {
42
- componentName: SCROLL_UP_BUTTON_NAME,
43
- ...props,
44
- dir: "up",
45
- ref: forwardedRef
46
- });
47
- });
48
- SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
49
- const SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
50
- const SelectScrollDownButton = React.forwardRef((props, forwardedRef) => {
51
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollButtonImpl, {
52
- componentName: SCROLL_DOWN_BUTTON_NAME,
53
- ...props,
54
- dir: "down",
55
- ref: forwardedRef
56
- });
57
- });
58
- SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
59
- const SelectScrollButtonImpl = React.memo(
60
- React.forwardRef(
61
- (props, forwardedRef) => {
62
- var _a;
63
- const { __scopeSelect, dir, componentName, ...scrollIndicatorProps } = props;
64
- const {
65
- floatingRef,
66
- forceUpdate,
67
- open,
68
- fallback,
69
- setScrollTop,
70
- setInnerOffset,
71
- ...context
72
- } = (0, import_context.useSelectContext)(componentName, __scopeSelect);
73
- const [element, setElement] = React.useState(null);
74
- const statusRef = React.useRef("idle");
75
- const isVisible = context[dir === "down" ? "canScrollDown" : "canScrollUp"];
76
- const frameRef = React.useRef();
77
- const { x, y, reference, floating, strategy, update, refs } = (0, import_react_dom_interactions.useFloating)({
78
- strategy: "fixed",
79
- placement: dir === "up" ? "top" : "bottom",
80
- middleware: [(0, import_react_dom_interactions.offset)(({ rects }) => -rects.floating.height)],
81
- whileElementsMounted: (...args) => (0, import_react_dom_interactions.autoUpdate)(...args, { animationFrame: true })
82
- });
83
- const composedRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, floating);
84
- if (floatingRef) {
85
- if (open) {
86
- if (element !== floatingRef.current) {
87
- setElement(floatingRef.current);
88
- reference(floatingRef.current);
89
- requestAnimationFrame(update);
90
- }
91
- } else {
92
- cancelAnimationFrame(frameRef.current);
93
- }
94
- }
95
- (0, import_core.useIsomorphicLayoutEffect)(() => {
96
- return () => {
97
- cancelAnimationFrame(frameRef.current);
98
- };
99
- }, []);
100
- if (!(isVisible && floatingRef)) {
101
- return null;
102
- }
103
- const onScroll = (amount) => {
104
- if (fallback) {
105
- if (refs.floating.current) {
106
- refs.floating.current.scrollTop -= amount;
107
- (0, import_react_dom.flushSync)(() => {
108
- var _a2;
109
- return setScrollTop(((_a2 = refs.floating.current) == null ? void 0 : _a2.scrollTop) ?? 0);
110
- });
111
- }
112
- } else {
113
- (0, import_react_dom.flushSync)(() => setInnerOffset((value) => value - amount));
114
- }
115
- };
116
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, {
117
- ref: composedRef,
118
- componentName,
119
- "aria-hidden": true,
120
- ...scrollIndicatorProps,
121
- zIndex: 1e3,
122
- position: strategy,
123
- left: x || 0,
124
- top: y || 0,
125
- width: `calc(${(((_a = floatingRef == null ? void 0 : floatingRef.current) == null ? void 0 : _a.offsetWidth) ?? 0) - 2}px)`,
126
- onPointerEnter: () => {
127
- statusRef.current = "active";
128
- let prevNow = Date.now();
129
- function frame() {
130
- if (element) {
131
- const currentNow = Date.now();
132
- const msElapsed = currentNow - prevNow;
133
- prevNow = currentNow;
134
- const pixelsToScroll = msElapsed / 2;
135
- const remainingPixels = dir === "up" ? element.scrollTop : element.scrollHeight - element.clientHeight - element.scrollTop;
136
- const scrollRemaining = dir === "up" ? element.scrollTop - pixelsToScroll > 0 : element.scrollTop + pixelsToScroll < element.scrollHeight - element.clientHeight;
137
- onScroll(
138
- dir === "up" ? Math.min(pixelsToScroll, remainingPixels) : Math.max(-pixelsToScroll, -remainingPixels)
139
- );
140
- if (scrollRemaining) {
141
- frameRef.current = requestAnimationFrame(frame);
142
- }
143
- }
144
- }
145
- cancelAnimationFrame(frameRef.current);
146
- frameRef.current = requestAnimationFrame(frame);
147
- },
148
- onPointerLeave: () => {
149
- statusRef.current = "idle";
150
- cancelAnimationFrame(frameRef.current);
151
- }
152
- });
153
- }
154
- )
155
- );
156
- // Annotate the CommonJS export names for ESM import in node:
157
- 0 && (module.exports = {
158
- SelectScrollDownButton,
159
- SelectScrollUpButton
160
- });
161
- //# sourceMappingURL=SelectScrollButton.js.map
@@ -1,7 +0,0 @@
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, 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 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 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={() => {\n statusRef.current = 'idle'\n cancelAnimationFrame(frameRef.current)\n }}\n />\n )\n }\n )\n)\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBI;AAzBJ,oCAAgD;AAChD,0BAAgC;AAChC,kBAA0D;AAC1D,oBAAuB;AACvB,YAAuB;AACvB,uBAA0B;AAE1B,qBAAiC;AAWjC,MAAM,wBAAwB;AAEvB,MAAM,uBAAuB,MAAM,WAGxC,CAAC,OAA6C,iBAAiB;AAC/D,SACE,4CAAC;AAAA,IACC,eAAe;AAAA,IACd,GAAG;AAAA,IACJ,KAAI;AAAA,IACJ,KAAK;AAAA,GACP;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AC,eAAe;AAAA,cAChD;AAEA,kBAAI,iBAAiB;AACnB,yBAAS,UAAU,sBAAsB,KAAK;AAAA,cAChD;AAAA,YACF;AAAA,UACF;AAEA,+BAAqB,SAAS,OAAO;AACrC,mBAAS,UAAU,sBAAsB,KAAK;AAAA,QAChD;AAAA,QACA,gBAAgB,MAAM;AACpB,oBAAU,UAAU;AACpB,+BAAqB,SAAS,OAAO;AAAA,QACvC;AAAA,OACF;AAAA,IAEJ;AAAA,EACF;AACF;",
6
- "names": ["_a"]
7
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var SelectScrollButton_native_exports = {};
20
- __export(SelectScrollButton_native_exports, {
21
- SelectScrollDownButton: () => SelectScrollDownButton,
22
- SelectScrollUpButton: () => SelectScrollUpButton
23
- });
24
- module.exports = __toCommonJS(SelectScrollButton_native_exports);
25
- const SelectScrollUpButton = (_) => null;
26
- const SelectScrollDownButton = (_) => null;
27
- // Annotate the CommonJS export names for ESM import in node:
28
- 0 && (module.exports = {
29
- SelectScrollDownButton,
30
- SelectScrollUpButton
31
- });
32
- //# sourceMappingURL=SelectScrollButton.native.js.map
@@ -1,7 +0,0 @@
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>) =>\n null\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,uBAAuB,CAAC,MAA4C;AAG1E,MAAM,yBAAyB,CAAC,MACrC;",
6
- "names": []
7
- }
@@ -1,126 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
- var SelectViewport_exports = {};
26
- __export(SelectViewport_exports, {
27
- SelectViewport: () => SelectViewport,
28
- SelectViewportFrame: () => SelectViewportFrame
29
- });
30
- module.exports = __toCommonJS(SelectViewport_exports);
31
- var import_jsx_runtime = require("react/jsx-runtime");
32
- var import_react_dom_interactions = require("@floating-ui/react-dom-interactions");
33
- var import_core = require("@tamagui/core");
34
- var import_core2 = require("@tamagui/core");
35
- var import_portal = require("@tamagui/portal");
36
- var import_stacks = require("@tamagui/stacks");
37
- var React = __toESM(require("react"));
38
- var import_constants = require("./constants");
39
- var import_context = require("./context");
40
- var import_useSelectBreakpointActive = require("./useSelectBreakpointActive");
41
- const SelectViewportFrame = (0, import_core2.styled)(import_stacks.ThemeableStack, {
42
- name: import_constants.VIEWPORT_NAME,
43
- backgroundColor: "$background",
44
- elevate: true,
45
- bordered: true,
46
- overflow: "scroll",
47
- userSelect: "none",
48
- outlineWidth: 0,
49
- variants: {
50
- size: {
51
- "...size": (val, { tokens }) => {
52
- return {
53
- borderRadius: tokens.radius[val] ?? val
54
- };
55
- }
56
- }
57
- },
58
- defaultVariants: {
59
- size: "$2"
60
- }
61
- });
62
- const SelectViewport = React.forwardRef(
63
- (props, forwardedRef) => {
64
- const { __scopeSelect, children, ...viewportProps } = props;
65
- const context = (0, import_context.useSelectContext)(import_constants.VIEWPORT_NAME, __scopeSelect);
66
- const breakpointActive = (0, import_useSelectBreakpointActive.useSelectBreakpointActive)(context.sheetBreakpoint);
67
- if (breakpointActive || !import_core.isWeb) {
68
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.PortalItem, {
69
- hostName: `${context.scopeKey}SheetContents`,
70
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.ForwardSelectContext, {
71
- context,
72
- children
73
- })
74
- });
75
- }
76
- if (!context.floatingContext) {
77
- return null;
78
- }
79
- if (!context.open) {
80
- return children;
81
- }
82
- const {
83
- style: { scrollbarWidth, listStyleType, ...restStyle },
84
- ...floatingProps
85
- } = context.interactions.getFloatingProps();
86
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
87
- children: [
88
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
89
- dangerouslySetInnerHTML: {
90
- __html: selectViewportCSS
91
- }
92
- }),
93
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_dom_interactions.FloatingFocusManager, {
94
- context: context.floatingContext,
95
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportFrame, {
96
- size: context.size,
97
- role: "presentation",
98
- ...viewportProps,
99
- ref: forwardedRef,
100
- ...floatingProps,
101
- ...restStyle,
102
- children
103
- })
104
- })
105
- ]
106
- });
107
- }
108
- );
109
- SelectViewport.displayName = import_constants.VIEWPORT_NAME;
110
- const selectViewportCSS = `
111
- .is_SelectViewport {
112
- scrollbar-width: none;
113
- -webkit-overflow-scrolling: touch;
114
- overscroll-behavior: contain;
115
- }
116
-
117
- .is_SelectViewport::-webkit-scrollbar{
118
- display:none
119
- }
120
- `;
121
- // Annotate the CommonJS export names for ESM import in node:
122
- 0 && (module.exports = {
123
- SelectViewport,
124
- SelectViewportFrame
125
- });
126
- //# sourceMappingURL=SelectViewport.js.map
@@ -1,7 +0,0 @@
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 { 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 overflow: 'scroll',\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, ...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, ...restStyle },\n ...floatingProps\n } = context.interactions!.getFloatingProps()\n\n return (\n <>\n <style\n dangerouslySetInnerHTML={{\n __html: selectViewportCSS,\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 >\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAiDU;AAjDV,oCAAqC;AACrC,kBAAsC;AACtC,IAAAA,eAAuB;AACvB,oBAA2B;AAC3B,oBAA+B;AAC/B,YAAuB;AAEvB,uBAA8B;AAC9B,qBAAuD;AAEvD,uCAA0C;AAMnC,MAAM,0BAAsB,qBAAO,8BAAgB;AAAA,EACxD,MAAM;AAAA,EACN,iBAAiB;AAAA,EACj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AEA,eAAe,cAAc;AAE7B,MAAM,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
- "names": ["import_core"]
7
- }
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
- var SelectViewport_native_exports = {};
26
- __export(SelectViewport_native_exports, {
27
- SelectViewport: () => SelectViewport
28
- });
29
- module.exports = __toCommonJS(SelectViewport_native_exports);
30
- var import_jsx_runtime = require("react/jsx-runtime");
31
- var import_adapt = require("@tamagui/adapt");
32
- var import_core = require("@tamagui/core");
33
- var import_portal = require("@tamagui/portal");
34
- var React = __toESM(require("react"));
35
- var import_constants = require("./constants");
36
- var import_context = require("./context");
37
- const SelectViewport = (props) => {
38
- const { __scopeSelect, children } = props;
39
- const context = (0, import_context.useSelectContext)(import_constants.VIEWPORT_NAME, __scopeSelect);
40
- const themeName = (0, import_core.useThemeName)();
41
- const adaptContext = React.useContext(import_adapt.AdaptParentContext);
42
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.PortalItem, {
43
- hostName: `${context.scopeKey}SheetContents`,
44
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Theme, {
45
- name: themeName,
46
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.SelectProvider, {
47
- scope: __scopeSelect,
48
- ...context,
49
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptParentContext.Provider, {
50
- value: adaptContext,
51
- children
52
- })
53
- })
54
- })
55
- });
56
- };
57
- SelectViewport.displayName = import_constants.VIEWPORT_NAME;
58
- // Annotate the CommonJS export names for ESM import in node:
59
- 0 && (module.exports = {
60
- SelectViewport
61
- });
62
- //# sourceMappingURL=SelectViewport.native.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/SelectViewport.native.tsx"],
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;AAAA;AAAA;AAAA;AAAA;AAoBU;AApBV,mBAAmC;AACnC,kBAA2C;AAC3C,oBAA2B;AAC3B,YAAuB;AAEvB,uBAA8B;AAC9B,qBAAiD;AAG1C,MAAM,iBAAiB,CAAC,UAA4C;AACzE,QAAM,EAAE,eAAe,SAAS,IAAI;AACpC,QAAM,cAAU,iCAAiB,gCAAe,aAAa;AAC7D,QAAM,gBAAY,0BAAa;AAC/B,QAAM,eAAe,MAAM,WAAW,+BAAkB;AAGxD,SACE,4CAAC;AAAA,IAAW,UAAU,GAAG,QAAQ;AAAA,IAC/B,sDAAC;AAAA,MAAM,MAAM;AAAA,MACX,sDAAC;AAAA,QAAe,OAAO;AAAA,QAAgB,GAAG;AAAA,QACxC,sDAAC,gCAAmB,UAAnB;AAAA,UAA4B,OAAO;AAAA,UACjC;AAAA,SACH;AAAA,OACF;AAAA,KACF;AAAA,GACF;AAEJ;AAEA,eAAe,cAAc;",
6
- "names": []
7
- }
@@ -1,47 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var constants_exports = {};
20
- __export(constants_exports, {
21
- FALLBACK_THRESHOLD: () => FALLBACK_THRESHOLD,
22
- MIN_HEIGHT: () => MIN_HEIGHT,
23
- SCROLL_ARROW_THRESHOLD: () => SCROLL_ARROW_THRESHOLD,
24
- SCROLL_ARROW_VELOCITY: () => SCROLL_ARROW_VELOCITY,
25
- SELECT_NAME: () => SELECT_NAME,
26
- VIEWPORT_NAME: () => VIEWPORT_NAME,
27
- WINDOW_PADDING: () => WINDOW_PADDING
28
- });
29
- module.exports = __toCommonJS(constants_exports);
30
- const SELECT_NAME = "Select";
31
- const WINDOW_PADDING = 8;
32
- const SCROLL_ARROW_VELOCITY = 8;
33
- const SCROLL_ARROW_THRESHOLD = 8;
34
- const MIN_HEIGHT = 80;
35
- const FALLBACK_THRESHOLD = 16;
36
- const VIEWPORT_NAME = "SelectViewport";
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- FALLBACK_THRESHOLD,
40
- MIN_HEIGHT,
41
- SCROLL_ARROW_THRESHOLD,
42
- SCROLL_ARROW_VELOCITY,
43
- SELECT_NAME,
44
- VIEWPORT_NAME,
45
- WINDOW_PADDING
46
- });
47
- //# sourceMappingURL=constants.js.map
@@ -1,7 +0,0 @@
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": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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
- }
@@ -1,49 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var context_exports = {};
20
- __export(context_exports, {
21
- ForwardSelectContext: () => ForwardSelectContext,
22
- SelectProvider: () => SelectProvider,
23
- createSelectContext: () => createSelectContext,
24
- createSelectScope: () => createSelectScope,
25
- useSelectContext: () => useSelectContext
26
- });
27
- module.exports = __toCommonJS(context_exports);
28
- var import_jsx_runtime = require("react/jsx-runtime");
29
- var import_create_context = require("@tamagui/create-context");
30
- var import_constants = require("./constants");
31
- const [createSelectContext, createSelectScope] = (0, import_create_context.createContextScope)(import_constants.SELECT_NAME);
32
- const [SelectProvider, useSelectContext] = createSelectContext(import_constants.SELECT_NAME);
33
- const ForwardSelectContext = (props) => {
34
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectProvider, {
35
- isInSheet: true,
36
- scope: props.__scopeSelect,
37
- ...props.context,
38
- children: props.children
39
- });
40
- };
41
- // Annotate the CommonJS export names for ESM import in node:
42
- 0 && (module.exports = {
43
- ForwardSelectContext,
44
- SelectProvider,
45
- createSelectContext,
46
- createSelectScope,
47
- useSelectContext
48
- });
49
- //# sourceMappingURL=context.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/context.tsx"],
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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeI;AAfJ,4BAAmC;AAEnC,uBAA4B;AAGrB,MAAM,CAAC,qBAAqB,iBAAiB,QAClD,0CAAmB,4BAAW;AAEzB,MAAM,CAAC,gBAAgB,gBAAgB,IAC5C,oBAAwC,4BAAW;AAE9C,MAAM,uBAAuB,CAClC,UACG;AACH,SACE,4CAAC;AAAA,IAAe,WAAS;AAAA,IAAC,OAAO,MAAM;AAAA,IAAgB,GAAG,MAAM;AAAA,IAC7D,gBAAM;AAAA,GACT;AAEJ;",
6
- "names": []
7
- }
package/dist/cjs/types.js DELETED
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var types_exports = {};
16
- module.exports = __toCommonJS(types_exports);
17
- //# sourceMappingURL=types.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/types.tsx"],
4
- "sourcesContent": ["import type {\n ContextData,\n FloatingContext,\n ReferenceType,\n} from '@floating-ui/react-dom-interactions'\nimport type { SizeTokens } from '@tamagui/core'\nimport type { Scope } from '@tamagui/create-context'\nimport type { ThemeableStackProps, YStackProps } from '@tamagui/stacks'\nimport type {\n DispatchWithoutAction,\n HTMLProps,\n MutableRefObject,\n ReactNode,\n} from 'react'\n\nexport type Direction = 'ltr' | 'rtl'\n\nexport type ScopedProps<P> = P & { __scopeSelect?: Scope }\n\nexport type SelectImplProps = ScopedProps<SelectProps> & {\n activeIndexRef: any\n selectedIndexRef: any\n listContentRef: any\n}\n\nexport interface SelectProps {\n id?: string\n children?: ReactNode\n value?: string\n defaultValue?: string\n onValueChange?(value: string): void\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?(open: boolean): void\n dir?: Direction\n name?: string\n autoComplete?: string\n size?: SizeTokens\n}\n\nexport interface SelectContextValue {\n dir?: Direction\n scopeKey: string\n sheetBreakpoint: any\n size?: SizeTokens\n value: any\n selectedItem: ReactNode\n setSelectedItem: (item: ReactNode) => void\n selectedIndex: number\n setSelectedIndex: (index: number) => void\n activeIndex: number | null\n setActiveIndex: (index: number | null) => void\n setValueAtIndex: (index: number, value: string) => void\n open: boolean\n setOpen: (open: boolean) => void\n onChange: (value: string) => void\n valueNode: Element | null\n onValueNodeChange(node: HTMLElement): void\n valueNodeHasChildren: boolean\n onValueNodeHasChildrenChange(hasChildren: boolean): void\n forceUpdate: DispatchWithoutAction\n\n // SheetImpl only:\n isInSheet?: boolean\n\n // InlineImpl only:\n fallback: boolean\n blockSelection: boolean\n allowSelectRef?: MutableRefObject<boolean>\n allowMouseUpRef?: MutableRefObject<boolean>\n upArrowRef?: MutableRefObject<HTMLDivElement | null>\n downArrowRef?: MutableRefObject<HTMLDivElement | null>\n selectTimeoutRef?: MutableRefObject<any>\n setScrollTop?: Function\n setInnerOffset?: Function\n dataRef?: MutableRefObject<ContextData>\n controlledScrolling?: boolean\n listRef?: MutableRefObject<Array<HTMLElement | null>>\n floatingRef?: MutableRefObject<HTMLElement | null>\n canScrollUp?: boolean\n canScrollDown?: boolean\n floatingContext?: FloatingContext<ReferenceType>\n interactions?: {\n getReferenceProps: (userProps?: HTMLProps<Element> | undefined) => any\n getFloatingProps: (userProps?: HTMLProps<HTMLElement> | undefined) => any\n getItemProps: (userProps?: HTMLProps<HTMLElement> | undefined) => any\n }\n}\n\nexport type SelectViewportProps = ThemeableStackProps & {\n size?: SizeTokens\n}\n\nexport type SelectContentProps = ScopedProps<{\n children?: React.ReactNode\n zIndex?: number\n}>\n\nexport interface SelectScrollButtonImplProps extends YStackProps {\n dir: 'up' | 'down'\n componentName: string\n}\n\nexport interface SelectScrollButtonProps\n extends Omit<SelectScrollButtonImplProps, 'dir' | 'componentName'> {}\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var useSelectBreakpointActive_exports = {};
20
- __export(useSelectBreakpointActive_exports, {
21
- useSelectBreakpointActive: () => useSelectBreakpointActive,
22
- useShowSelectSheet: () => useShowSelectSheet
23
- });
24
- module.exports = __toCommonJS(useSelectBreakpointActive_exports);
25
- var import_core = require("@tamagui/core");
26
- const useSelectBreakpointActive = (sheetBreakpoint) => {
27
- const media = (0, import_core.useMedia)();
28
- return sheetBreakpoint ? media[sheetBreakpoint] : false;
29
- };
30
- const useShowSelectSheet = (context) => {
31
- const breakpointActive = useSelectBreakpointActive(context.sheetBreakpoint);
32
- return context.open === false ? false : breakpointActive;
33
- };
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- useSelectBreakpointActive,
37
- useShowSelectSheet
38
- });
39
- //# sourceMappingURL=useSelectBreakpointActive.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/useSelectBreakpointActive.tsx"],
4
- "sourcesContent": ["import { useMedia } from '@tamagui/core'\n\nimport { SelectContextValue } from './types'\n\nexport const useSelectBreakpointActive = (\n sheetBreakpoint: SelectContextValue['sheetBreakpoint'],\n) => {\n const media = useMedia()\n return sheetBreakpoint ? media[sheetBreakpoint] : false\n}\n\nexport const useShowSelectSheet = (context: SelectContextValue) => {\n const breakpointActive = useSelectBreakpointActive(context.sheetBreakpoint)\n return context.open === false ? false : breakpointActive\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAyB;AAIlB,MAAM,4BAA4B,CACvC,oBACG;AACH,QAAM,YAAQ,sBAAS;AACvB,SAAO,kBAAkB,MAAM,mBAAmB;AACpD;AAEO,MAAM,qBAAqB,CAAC,YAAgC;AACjE,QAAM,mBAAmB,0BAA0B,QAAQ,eAAe;AAC1E,SAAO,QAAQ,SAAS,QAAQ,QAAQ;AAC1C;",
6
- "names": []
7
- }