@radix-ui/react-popper 0.1.5-rc.2 → 0.1.5-rc.20
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/index.d.ts.map +1 -1
- package/dist/index.js +220 -1
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +201 -1
- package/dist/index.module.js.map +1 -1
- package/package.json +9 -8
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;AAqBA,OAAA,wFAAgF,CAAC;AAQjF;IACE,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;CAC5B;AACD,OAAA,MAAM,QAAQ,MAAM,EAAE,CAAC,WAAW,CAQjC,CAAC;AAWF,yBAAyB,MAAM,wBAAwB,CAAC,OAAO,UAAU,GAAG,CAAC,CAAC;AAC9E,kCAA4B,SAAQ,iBAAiB;IACnD,UAAU,CAAC,EAAE,MAAM,SAAS,CAAC,UAAU,CAAC,CAAC;CAC1C;AAED,OAAA,MAAM,sGAgBL,CAAC;AAoBF,mCAA6B,SAAQ,iBAAiB;IACpD,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,OAAA,MAAM,wGAqEL,CAAC;AAWF,kBAAkB,MAAM,wBAAwB,CAAC,OAAO,eAAe,IAAI,CAAC,CAAC;AAC7E,iCAA2B,SAAQ,UAAU;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,OAAA,MAAM,mGAoCJ,CAAC;AAiCH,OAAA,MAAM,2BAAa,CAAC;AACpB,OAAA,MAAM,gGAAqB,CAAC;AAC5B,OAAA,MAAM,kGAAuB,CAAC;AAC9B,OAAA,MAAM,6FAAmB,CAAC","sources":["packages/react/popper/src/packages/react/popper/src/Popper.tsx","packages/react/popper/src/packages/react/popper/src/index.ts","packages/react/popper/src/index.ts"],"sourcesContent":[null,null,"export * from './Popper';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,221 @@
|
|
|
1
|
-
var
|
|
1
|
+
var $50Iv9$babelruntimehelpersextends = require("@babel/runtime/helpers/extends");
|
|
2
|
+
var $50Iv9$react = require("react");
|
|
3
|
+
var $50Iv9$radixuipopper = require("@radix-ui/popper");
|
|
4
|
+
var $50Iv9$radixuireactcomposerefs = require("@radix-ui/react-compose-refs");
|
|
5
|
+
var $50Iv9$radixuireactcontext = require("@radix-ui/react-context");
|
|
6
|
+
var $50Iv9$radixuireactuserect = require("@radix-ui/react-use-rect");
|
|
7
|
+
var $50Iv9$radixuireactusesize = require("@radix-ui/react-use-size");
|
|
8
|
+
var $50Iv9$radixuireactprimitive = require("@radix-ui/react-primitive");
|
|
9
|
+
var $50Iv9$radixuireactarrow = require("@radix-ui/react-arrow");
|
|
10
|
+
|
|
11
|
+
function $parcel$exportWildcard(dest, source) {
|
|
12
|
+
Object.keys(source).forEach(function(key) {
|
|
13
|
+
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
Object.defineProperty(dest, key, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function get() {
|
|
20
|
+
return source[key];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return dest;
|
|
26
|
+
}
|
|
27
|
+
function $parcel$interopDefault(a) {
|
|
28
|
+
return a && a.__esModule ? a.default : a;
|
|
29
|
+
}
|
|
30
|
+
function $parcel$export(e, n, v, s) {
|
|
31
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
32
|
+
}
|
|
33
|
+
var $34310caa050a8d63$exports = {};
|
|
34
|
+
|
|
35
|
+
$parcel$export($34310caa050a8d63$exports, "createPopperScope", () => $34310caa050a8d63$export$722aac194ae923);
|
|
36
|
+
$parcel$export($34310caa050a8d63$exports, "Popper", () => $34310caa050a8d63$export$badac9ada3a0bdf9);
|
|
37
|
+
$parcel$export($34310caa050a8d63$exports, "PopperAnchor", () => $34310caa050a8d63$export$ecd4e1ccab6ed6d);
|
|
38
|
+
$parcel$export($34310caa050a8d63$exports, "PopperContent", () => $34310caa050a8d63$export$bc4ae5855d3c4fc);
|
|
39
|
+
$parcel$export($34310caa050a8d63$exports, "PopperArrow", () => $34310caa050a8d63$export$79d62cd4e10a3fd0);
|
|
40
|
+
$parcel$export($34310caa050a8d63$exports, "Root", () => $34310caa050a8d63$export$be92b6f5f03c0fe9);
|
|
41
|
+
$parcel$export($34310caa050a8d63$exports, "Anchor", () => $34310caa050a8d63$export$b688253958b8dfe7);
|
|
42
|
+
$parcel$export($34310caa050a8d63$exports, "Content", () => $34310caa050a8d63$export$7c6e2c02157bb7d2);
|
|
43
|
+
$parcel$export($34310caa050a8d63$exports, "Arrow", () => $34310caa050a8d63$export$21b07c8f274aebd5);
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
/* -------------------------------------------------------------------------------------------------
|
|
54
|
+
* Popper
|
|
55
|
+
* -----------------------------------------------------------------------------------------------*/ const $34310caa050a8d63$var$POPPER_NAME = 'Popper';
|
|
56
|
+
const [$34310caa050a8d63$var$createPopperContext, $34310caa050a8d63$export$722aac194ae923] = $50Iv9$radixuireactcontext.createContextScope($34310caa050a8d63$var$POPPER_NAME);
|
|
57
|
+
const [$34310caa050a8d63$var$PopperProvider, $34310caa050a8d63$var$usePopperContext] = $34310caa050a8d63$var$createPopperContext($34310caa050a8d63$var$POPPER_NAME);
|
|
58
|
+
const $34310caa050a8d63$export$badac9ada3a0bdf9 = (props)=>{
|
|
59
|
+
const { __scopePopper: __scopePopper , children: children } = props;
|
|
60
|
+
const [anchor, setAnchor] = $50Iv9$react.useState(null);
|
|
61
|
+
return /*#__PURE__*/ $50Iv9$react.createElement($34310caa050a8d63$var$PopperProvider, {
|
|
62
|
+
scope: __scopePopper,
|
|
63
|
+
anchor: anchor,
|
|
64
|
+
onAnchorChange: setAnchor
|
|
65
|
+
}, children);
|
|
66
|
+
};
|
|
67
|
+
/*#__PURE__*/ Object.assign($34310caa050a8d63$export$badac9ada3a0bdf9, {
|
|
68
|
+
displayName: $34310caa050a8d63$var$POPPER_NAME
|
|
69
|
+
});
|
|
70
|
+
/* -------------------------------------------------------------------------------------------------
|
|
71
|
+
* PopperAnchor
|
|
72
|
+
* -----------------------------------------------------------------------------------------------*/ const $34310caa050a8d63$var$ANCHOR_NAME = 'PopperAnchor';
|
|
73
|
+
const $34310caa050a8d63$export$ecd4e1ccab6ed6d = /*#__PURE__*/ $50Iv9$react.forwardRef((props, forwardedRef)=>{
|
|
74
|
+
const { __scopePopper: __scopePopper , virtualRef: virtualRef , ...anchorProps } = props;
|
|
75
|
+
const context = $34310caa050a8d63$var$usePopperContext($34310caa050a8d63$var$ANCHOR_NAME, __scopePopper);
|
|
76
|
+
const ref = $50Iv9$react.useRef(null);
|
|
77
|
+
const composedRefs = $50Iv9$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref);
|
|
78
|
+
$50Iv9$react.useEffect(()=>{
|
|
79
|
+
// Consumer can anchor the popper to something that isn't
|
|
80
|
+
// a DOM node e.g. pointer position, so we override the
|
|
81
|
+
// `anchorRef` with their virtual ref in this case.
|
|
82
|
+
context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
|
|
83
|
+
});
|
|
84
|
+
return virtualRef ? null : /*#__PURE__*/ $50Iv9$react.createElement($50Iv9$radixuireactprimitive.Primitive.div, ($parcel$interopDefault($50Iv9$babelruntimehelpersextends))({}, anchorProps, {
|
|
85
|
+
ref: composedRefs
|
|
86
|
+
}));
|
|
87
|
+
});
|
|
88
|
+
/*#__PURE__*/ Object.assign($34310caa050a8d63$export$ecd4e1ccab6ed6d, {
|
|
89
|
+
displayName: $34310caa050a8d63$var$ANCHOR_NAME
|
|
90
|
+
});
|
|
91
|
+
/* -------------------------------------------------------------------------------------------------
|
|
92
|
+
* PopperContent
|
|
93
|
+
* -----------------------------------------------------------------------------------------------*/ const $34310caa050a8d63$var$CONTENT_NAME = 'PopperContent';
|
|
94
|
+
const [$34310caa050a8d63$var$PopperContentProvider, $34310caa050a8d63$var$useContentContext] = $34310caa050a8d63$var$createPopperContext($34310caa050a8d63$var$CONTENT_NAME);
|
|
95
|
+
const $34310caa050a8d63$export$bc4ae5855d3c4fc = /*#__PURE__*/ $50Iv9$react.forwardRef((props, forwardedRef)=>{
|
|
96
|
+
const { __scopePopper: __scopePopper , side: side = 'bottom' , sideOffset: sideOffset , align: align = 'center' , alignOffset: alignOffset , collisionTolerance: collisionTolerance , avoidCollisions: avoidCollisions = true , ...contentProps } = props;
|
|
97
|
+
const context = $34310caa050a8d63$var$usePopperContext($34310caa050a8d63$var$CONTENT_NAME, __scopePopper);
|
|
98
|
+
const [arrowOffset, setArrowOffset] = $50Iv9$react.useState();
|
|
99
|
+
const anchorRect = $50Iv9$radixuireactuserect.useRect(context.anchor);
|
|
100
|
+
const [content, setContent] = $50Iv9$react.useState(null);
|
|
101
|
+
const contentSize = $50Iv9$radixuireactusesize.useSize(content);
|
|
102
|
+
const [arrow, setArrow] = $50Iv9$react.useState(null);
|
|
103
|
+
const arrowSize = $50Iv9$radixuireactusesize.useSize(arrow);
|
|
104
|
+
const composedRefs = $50Iv9$radixuireactcomposerefs.useComposedRefs(forwardedRef, (node)=>setContent(node)
|
|
105
|
+
);
|
|
106
|
+
const windowSize = $34310caa050a8d63$var$useWindowSize();
|
|
107
|
+
const collisionBoundariesRect = windowSize ? DOMRect.fromRect({
|
|
108
|
+
...windowSize,
|
|
109
|
+
x: 0,
|
|
110
|
+
y: 0
|
|
111
|
+
}) : undefined;
|
|
112
|
+
const { popperStyles: popperStyles , arrowStyles: arrowStyles , placedSide: placedSide , placedAlign: placedAlign } = $50Iv9$radixuipopper.getPlacementData({
|
|
113
|
+
anchorRect: anchorRect,
|
|
114
|
+
popperSize: contentSize,
|
|
115
|
+
arrowSize: arrowSize,
|
|
116
|
+
arrowOffset: // config
|
|
117
|
+
arrowOffset,
|
|
118
|
+
side: side,
|
|
119
|
+
sideOffset: sideOffset,
|
|
120
|
+
align: align,
|
|
121
|
+
alignOffset: alignOffset,
|
|
122
|
+
shouldAvoidCollisions: avoidCollisions,
|
|
123
|
+
collisionBoundariesRect: collisionBoundariesRect,
|
|
124
|
+
collisionTolerance: collisionTolerance
|
|
125
|
+
});
|
|
126
|
+
const isPlaced = placedSide !== undefined;
|
|
127
|
+
return /*#__PURE__*/ $50Iv9$react.createElement("div", {
|
|
128
|
+
style: popperStyles,
|
|
129
|
+
"data-radix-popper-content-wrapper": ""
|
|
130
|
+
}, /*#__PURE__*/ $50Iv9$react.createElement($34310caa050a8d63$var$PopperContentProvider, {
|
|
131
|
+
scope: __scopePopper,
|
|
132
|
+
arrowStyles: arrowStyles,
|
|
133
|
+
onArrowChange: setArrow,
|
|
134
|
+
onArrowOffsetChange: setArrowOffset
|
|
135
|
+
}, /*#__PURE__*/ $50Iv9$react.createElement($50Iv9$radixuireactprimitive.Primitive.div, ($parcel$interopDefault($50Iv9$babelruntimehelpersextends))({
|
|
136
|
+
"data-side": placedSide,
|
|
137
|
+
"data-align": placedAlign
|
|
138
|
+
}, contentProps, {
|
|
139
|
+
style: {
|
|
140
|
+
...contentProps.style,
|
|
141
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
142
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
143
|
+
animation: !isPlaced ? 'none' : undefined
|
|
144
|
+
},
|
|
145
|
+
ref: composedRefs
|
|
146
|
+
}))));
|
|
147
|
+
});
|
|
148
|
+
/*#__PURE__*/ Object.assign($34310caa050a8d63$export$bc4ae5855d3c4fc, {
|
|
149
|
+
displayName: $34310caa050a8d63$var$CONTENT_NAME
|
|
150
|
+
});
|
|
151
|
+
/* -------------------------------------------------------------------------------------------------
|
|
152
|
+
* PopperArrow
|
|
153
|
+
* -----------------------------------------------------------------------------------------------*/ const $34310caa050a8d63$var$ARROW_NAME = 'PopperArrow';
|
|
154
|
+
const $34310caa050a8d63$export$79d62cd4e10a3fd0 = /*#__PURE__*/ $50Iv9$react.forwardRef(function $34310caa050a8d63$export$79d62cd4e10a3fd0(props, forwardedRef) {
|
|
155
|
+
const { __scopePopper: __scopePopper , offset: offset , ...arrowProps } = props;
|
|
156
|
+
const context = $34310caa050a8d63$var$useContentContext($34310caa050a8d63$var$ARROW_NAME, __scopePopper);
|
|
157
|
+
const { onArrowOffsetChange: onArrowOffsetChange } = context; // send the Arrow's offset up to Popper
|
|
158
|
+
$50Iv9$react.useEffect(()=>onArrowOffsetChange(offset)
|
|
159
|
+
, [
|
|
160
|
+
onArrowOffsetChange,
|
|
161
|
+
offset
|
|
162
|
+
]);
|
|
163
|
+
return /*#__PURE__*/ $50Iv9$react.createElement("span", {
|
|
164
|
+
style: {
|
|
165
|
+
...context.arrowStyles,
|
|
166
|
+
pointerEvents: 'none'
|
|
167
|
+
}
|
|
168
|
+
}, /*#__PURE__*/ $50Iv9$react.createElement("span", {
|
|
169
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
170
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
171
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
172
|
+
ref: context.onArrowChange,
|
|
173
|
+
style: {
|
|
174
|
+
display: 'inline-block',
|
|
175
|
+
verticalAlign: 'top',
|
|
176
|
+
pointerEvents: 'auto'
|
|
177
|
+
}
|
|
178
|
+
}, /*#__PURE__*/ $50Iv9$react.createElement($50Iv9$radixuireactarrow.Root, ($parcel$interopDefault($50Iv9$babelruntimehelpersextends))({}, arrowProps, {
|
|
179
|
+
ref: forwardedRef,
|
|
180
|
+
style: {
|
|
181
|
+
...arrowProps.style,
|
|
182
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
183
|
+
display: 'block'
|
|
184
|
+
}
|
|
185
|
+
}))));
|
|
186
|
+
});
|
|
187
|
+
/*#__PURE__*/ Object.assign($34310caa050a8d63$export$79d62cd4e10a3fd0, {
|
|
188
|
+
displayName: $34310caa050a8d63$var$ARROW_NAME
|
|
189
|
+
});
|
|
190
|
+
/* -----------------------------------------------------------------------------------------------*/ const $34310caa050a8d63$var$WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS = 100;
|
|
191
|
+
function $34310caa050a8d63$var$useWindowSize() {
|
|
192
|
+
const [windowSize, setWindowSize] = $50Iv9$react.useState(undefined);
|
|
193
|
+
$50Iv9$react.useEffect(()=>{
|
|
194
|
+
let debounceTimerId;
|
|
195
|
+
function updateWindowSize() {
|
|
196
|
+
setWindowSize({
|
|
197
|
+
width: window.innerWidth,
|
|
198
|
+
height: window.innerHeight
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function handleResize() {
|
|
202
|
+
window.clearTimeout(debounceTimerId);
|
|
203
|
+
debounceTimerId = window.setTimeout(updateWindowSize, $34310caa050a8d63$var$WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS);
|
|
204
|
+
}
|
|
205
|
+
updateWindowSize();
|
|
206
|
+
window.addEventListener('resize', handleResize);
|
|
207
|
+
return ()=>window.removeEventListener('resize', handleResize)
|
|
208
|
+
;
|
|
209
|
+
}, []);
|
|
210
|
+
return windowSize;
|
|
211
|
+
}
|
|
212
|
+
const $34310caa050a8d63$export$be92b6f5f03c0fe9 = $34310caa050a8d63$export$badac9ada3a0bdf9;
|
|
213
|
+
const $34310caa050a8d63$export$b688253958b8dfe7 = $34310caa050a8d63$export$ecd4e1ccab6ed6d;
|
|
214
|
+
const $34310caa050a8d63$export$7c6e2c02157bb7d2 = $34310caa050a8d63$export$bc4ae5855d3c4fc;
|
|
215
|
+
const $34310caa050a8d63$export$21b07c8f274aebd5 = $34310caa050a8d63$export$79d62cd4e10a3fd0;
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
$parcel$exportWildcard(module.exports, $34310caa050a8d63$exports);
|
|
219
|
+
|
|
220
|
+
|
|
2
221
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"IAAgCA,qXAAAA,8CAClBA,EAAEC,WAAaD,EAAEE,QAAUF,EAWzC,SAASG,EAAuBC,EAAMC,GAcpC,OAbAC,OAAOC,KAAKF,GAAQG,SAAQ,SAASC,GACvB,YAARA,GAA6B,eAARA,GAIzBH,OAAOI,eAAeN,EAAMK,EAAK,CAC/BE,YAAY,EACZC,IAAK,WACH,OAAOP,EAAOI,SAKbL,ECRT,MAGOS,EAAqBC,GAAqBC,EAH7B,sCASpB,MAAOC,EAAgBC,GAAoBJ,EATvB,UAcdK,EAAiCC,IACrC,MAAMC,cAAEA,EAAFC,SAAiBA,GAAaF,GAC7BG,EAAQC,GAAaC,EAAMC,SAA4B,mBAC9D,OACEC,EAAAC,cAACC,EAAD,CAAgBC,MAAOT,EAAeE,OAAQA,EAAQQ,eAAgBP,GACnEF,qBAWP,MAQMU,eAAeP,EAAMQ,YACzB,CAACb,EAAuCc,KACtC,MAAMb,cAAEA,EAAFc,WAAiBA,KAAeC,GAAgBhB,EAChDiB,EAAUnB,EAXA,eAW8BG,GACxCiB,EAAMb,EAAMc,OAA4B,MACxCC,EAAeC,EAAgBP,EAAcI,GASnD,OAPAb,EAAMiB,WAAU,KAIdL,EAAQN,gBAAeI,MAAAA,OAAA,EAAAA,EAAYQ,UAAWL,EAAIK,YAG7CR,EAAa,kBAAOR,EAAAC,cAACgB,EAAUC,IAAXC,EAAA,GAAmBV,EAAnB,CAAgCE,IAAKE,+BAUpE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AKsE,MAAOR,EAAc,oCAAkC,iBAC1D/D,EAAAC,cAACuE,EAAD,CACErE,MAAOT,EACPsE,YAAaA,EACbS,cAAelC,EACfmC,oBAAqB3C,gBAErB/B,EAAAC,cAACgB,EAAUC,IAAXC,EAAA,CACE,YAAW8C,EACX,aAAYC,GACRrC,EAHN,CAIE0C,MAAO,IACF1C,EAAa0C,MAGhBI,UAAYL,OAAoB1B,EAAT,QAEzBjC,IAAKE,kCAcjB,MAQM+D,eAAc9E,EAAMQ,YAAiD,SACzEb,EACAc,GAEA,MAAMb,cAAEA,EAAFmF,OAAiBA,KAAWC,GAAerF,EAC3CiB,EAAUW,EAbC,cAa6B3B,IACxCgF,oBAAEA,GAAwBhE,EAKhC,OAFAZ,EAAMiB,WAAU,IAAM2D,EAAoBG,IAAS,CAACH,EAAqBG,iBAGvE7E,EAAAC,cAAA,OAAA,CAAMsE,MAAO,IAAK7D,EAAQsD,YAAae,cAAe,sBACpD/E,EAAAC,cAAA,OAAA,CAIEU,IAAKD,EAAQ+D,cACbF,MAAO,CACLS,QAAS,eACTC,cAAe,MACfF,cAAe,sBAGjB/E,EAAAC,cAACiF,EAAeC,KAAhBhE,EAAA,GACM2D,EADN,CAEEnE,IAAKJ,EACLgE,MAAO,IACFO,EAAWP,MAEdS,QAAS,uCAuCrB,MAAMG,EAAO3F,iBACb,MAAM4F,EAAS/E,mBACf,MAAMgF,EAAU/D,oBAChB,MAAMgE,EAAQV","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/react/popper/src/Popper.tsx"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$reexport(e, n, v) {\n Object.defineProperty(e, n, {get: v, enumerable: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n","import * as React from 'react';\nimport { getPlacementData } from '@radix-ui/popper';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useRect } from '@radix-ui/react-use-rect';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as ArrowPrimitive from '@radix-ui/react-arrow';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\nimport type { Side, Align } from '@radix-ui/popper';\nimport type { Measurable } from '@radix-ui/rect';\n\n/* -------------------------------------------------------------------------------------------------\n * Popper\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_NAME = 'Popper';\n\ntype ScopedProps<P> = P & { __scopePopper?: Scope };\nconst [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\n\ntype PopperContextValue = {\n anchor: Measurable | null;\n onAnchorChange(anchor: Measurable | null): void;\n};\nconst [PopperProvider, usePopperContext] = createPopperContext<PopperContextValue>(POPPER_NAME);\n\ninterface PopperProps {\n children?: React.ReactNode;\n}\nconst Popper: React.FC<PopperProps> = (props: ScopedProps<PopperProps>) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState<Measurable | null>(null);\n return (\n <PopperProvider scope={__scopePopper} anchor={anchor} onAnchorChange={setAnchor}>\n {children}\n </PopperProvider>\n );\n};\n\nPopper.displayName = POPPER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopperAnchor';\n\ntype PopperAnchorElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PopperAnchorProps extends PrimitiveDivProps {\n virtualRef?: React.RefObject<Measurable>;\n}\n\nconst PopperAnchor = React.forwardRef<PopperAnchorElement, PopperAnchorProps>(\n (props: ScopedProps<PopperAnchorProps>, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef<PopperAnchorElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n React.useEffect(() => {\n // Consumer can anchor the popper to something that isn't\n // a DOM node e.g. pointer position, so we override the\n // `anchorRef` with their virtual ref in this case.\n context.onAnchorChange(virtualRef?.current || ref.current);\n });\n\n return virtualRef ? null : <Primitive.div {...anchorProps} ref={composedRefs} />;\n }\n);\n\nPopperAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopperContent';\n\ntype PopperContentContextValue = {\n arrowStyles: React.CSSProperties;\n onArrowChange(arrow: HTMLSpanElement | null): void;\n onArrowOffsetChange(offset?: number): void;\n};\n\nconst [PopperContentProvider, useContentContext] =\n createPopperContext<PopperContentContextValue>(CONTENT_NAME);\n\ntype PopperContentElement = React.ElementRef<typeof Primitive.div>;\ninterface PopperContentProps extends PrimitiveDivProps {\n side?: Side;\n sideOffset?: number;\n align?: Align;\n alignOffset?: number;\n collisionTolerance?: number;\n avoidCollisions?: boolean;\n}\n\nconst PopperContent = React.forwardRef<PopperContentElement, PopperContentProps>(\n (props: ScopedProps<PopperContentProps>, forwardedRef) => {\n const {\n __scopePopper,\n side = 'bottom',\n sideOffset,\n align = 'center',\n alignOffset,\n collisionTolerance,\n avoidCollisions = true,\n ...contentProps\n } = props;\n\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n const [arrowOffset, setArrowOffset] = React.useState<number>();\n const anchorRect = useRect(context.anchor);\n const [content, setContent] = React.useState<HTMLDivElement | null>(null);\n const contentSize = useSize(content);\n const [arrow, setArrow] = React.useState<HTMLSpanElement | null>(null);\n const arrowSize = useSize(arrow);\n\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n\n const windowSize = useWindowSize();\n const collisionBoundariesRect = windowSize\n ? DOMRect.fromRect({ ...windowSize, x: 0, y: 0 })\n : undefined;\n\n const { popperStyles, arrowStyles, placedSide, placedAlign } = getPlacementData({\n anchorRect,\n popperSize: contentSize,\n arrowSize,\n\n // config\n arrowOffset,\n side,\n sideOffset,\n align,\n alignOffset,\n shouldAvoidCollisions: avoidCollisions,\n collisionBoundariesRect,\n collisionTolerance,\n });\n const isPlaced = placedSide !== undefined;\n\n return (\n <div style={popperStyles} data-radix-popper-content-wrapper=\"\">\n <PopperContentProvider\n scope={__scopePopper}\n arrowStyles={arrowStyles}\n onArrowChange={setArrow}\n onArrowOffsetChange={setArrowOffset}\n >\n <Primitive.div\n data-side={placedSide}\n data-align={placedAlign}\n {...contentProps}\n style={{\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPlaced ? 'none' : undefined,\n }}\n ref={composedRefs}\n />\n </PopperContentProvider>\n </div>\n );\n }\n);\n\nPopperContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'PopperArrow';\n\ntype PopperArrowElement = React.ElementRef<typeof ArrowPrimitive.Root>;\ntype ArrowProps = Radix.ComponentPropsWithoutRef<typeof ArrowPrimitive.Root>;\ninterface PopperArrowProps extends ArrowProps {\n offset?: number;\n}\n\nconst PopperArrow = React.forwardRef<PopperArrowElement, PopperArrowProps>(function PopperArrow(\n props: ScopedProps<PopperArrowProps>,\n forwardedRef\n) {\n const { __scopePopper, offset, ...arrowProps } = props;\n const context = useContentContext(ARROW_NAME, __scopePopper);\n const { onArrowOffsetChange } = context;\n\n // send the Arrow's offset up to Popper\n React.useEffect(() => onArrowOffsetChange(offset), [onArrowOffsetChange, offset]);\n\n return (\n <span style={{ ...context.arrowStyles, pointerEvents: 'none' }}>\n <span\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n ref={context.onArrowChange}\n style={{\n display: 'inline-block',\n verticalAlign: 'top',\n pointerEvents: 'auto',\n }}\n >\n <ArrowPrimitive.Root\n {...arrowProps}\n ref={forwardedRef}\n style={{\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: 'block',\n }}\n />\n </span>\n </span>\n );\n});\n\nPopperArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS = 100;\n\nfunction useWindowSize() {\n const [windowSize, setWindowSize] = React.useState<{ width: number; height: number } | undefined>(\n undefined\n );\n\n React.useEffect(() => {\n let debounceTimerId: number;\n\n function updateWindowSize() {\n setWindowSize({ width: window.innerWidth, height: window.innerHeight });\n }\n\n function handleResize() {\n window.clearTimeout(debounceTimerId);\n debounceTimerId = window.setTimeout(updateWindowSize, WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS);\n }\n\n updateWindowSize();\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n\n return windowSize;\n}\n\nconst Root = Popper;\nconst Anchor = PopperAnchor;\nconst Content = PopperContent;\nconst Arrow = PopperArrow;\n\nexport {\n createPopperScope,\n //\n Popper,\n PopperAnchor,\n PopperContent,\n PopperArrow,\n //\n Root,\n Anchor,\n Content,\n Arrow,\n};\nexport type { PopperProps, PopperAnchorProps, PopperContentProps, PopperArrowProps };\n"],"names":["a","__esModule","default","$parcel$exportWildcard","dest","source","Object","keys","forEach","key","defineProperty","enumerable","get","createPopperContext","createPopperScope","createContextScope","PopperProvider","usePopperContext","Popper","props","__scopePopper","children","anchor","setAnchor","React","useState","_react","createElement","$be5d7b5e9bdca855ae0500ff2a345d73$var$PopperProvider","scope","onAnchorChange","PopperAnchor","forwardRef","forwardedRef","virtualRef","anchorProps","context","ref","useRef","composedRefs","useComposedRefs","useEffect","current","Primitive","div","_babelRuntimeHelpersExtends","PopperContentProvider","useContentContext","PopperContent","side","sideOffset","align","alignOffset","collisionTolerance","avoidCollisions","contentProps","arrowOffset","setArrowOffset","anchorRect","useRect","content","setContent","contentSize","useSize","arrow","setArrow","arrowSize","node","windowSize","setWindowSize","undefined","debounceTimerId","updateWindowSize","width","window","innerWidth","height","innerHeight","handleResize","clearTimeout","setTimeout","addEventListener","removeEventListener","useWindowSize","collisionBoundariesRect","DOMRect","fromRect","x","y","popperStyles","arrowStyles","placedSide","placedAlign","getPlacementData","popperSize","shouldAvoidCollisions","isPlaced","style","$be5d7b5e9bdca855ae0500ff2a345d73$var$PopperContentProvider","onArrowChange","onArrowOffsetChange","animation","PopperArrow","offset","arrowProps","pointerEvents","display","verticalAlign","_radixUiReactArrow","Root","Anchor","Content","Arrow"],"version":3,"file":"index.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;ACcA;;oGAEA,CAEA,MAAMQ,iCAAW,GAAG,QAApB,AAAA;AAGA,MAAM,CAACC,yCAAD,EAAsBC,uCAAtB,CAAA,GAA2CP,6CAAkB,CAACK,iCAAD,CAAnE,AAAA;AAMA,MAAM,CAACG,oCAAD,EAAiBC,sCAAjB,CAAA,GAAqCH,yCAAmB,CAAqBD,iCAArB,CAA9D,AAAA;AAKA,MAAMK,yCAA6B,GAAIC,CAAAA,KAAD,GAAqC;IACzE,MAAM,E,eAAEC,aAAF,CAAA,E,UAAiBC,QAAAA,CA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GzB,yCAAd,AAAA;;ADlQA","sources":["packages/react/popper/src/index.ts","packages/react/popper/src/Popper.tsx"],"sourcesContent":["export * from './Popper';\n","import * as React from 'react';\nimport { getPlacementData } from '@radix-ui/popper';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useRect } from '@radix-ui/react-use-rect';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as ArrowPrimitive from '@radix-ui/react-arrow';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\nimport type { Side, Align } from '@radix-ui/popper';\nimport type { Measurable } from '@radix-ui/rect';\n\n/* -------------------------------------------------------------------------------------------------\n * Popper\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_NAME = 'Popper';\n\ntype ScopedProps<P> = P & { __scopePopper?: Scope };\nconst [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\n\ntype PopperContextValue = {\n anchor: Measurable | null;\n onAnchorChange(anchor: Measurable | null): void;\n};\nconst [PopperProvider, usePopperContext] = createPopperContext<PopperContextValue>(POPPER_NAME);\n\ninterface PopperProps {\n children?: React.ReactNode;\n}\nconst Popper: React.FC<PopperProps> = (props: ScopedProps<PopperProps>) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState<Measurable | null>(null);\n return (\n <PopperProvider scope={__scopePopper} anchor={anchor} onAnchorChange={setAnchor}>\n {children}\n </PopperProvider>\n );\n};\n\nPopper.displayName = POPPER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopperAnchor';\n\ntype PopperAnchorElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PopperAnchorProps extends PrimitiveDivProps {\n virtualRef?: React.RefObject<Measurable>;\n}\n\nconst PopperAnchor = React.forwardRef<PopperAnchorElement, PopperAnchorProps>(\n (props: ScopedProps<PopperAnchorProps>, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef<PopperAnchorElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n React.useEffect(() => {\n // Consumer can anchor the popper to something that isn't\n // a DOM node e.g. pointer position, so we override the\n // `anchorRef` with their virtual ref in this case.\n context.onAnchorChange(virtualRef?.current || ref.current);\n });\n\n return virtualRef ? null : <Primitive.div {...anchorProps} ref={composedRefs} />;\n }\n);\n\nPopperAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopperContent';\n\ntype PopperContentContextValue = {\n arrowStyles: React.CSSProperties;\n onArrowChange(arrow: HTMLSpanElement | null): void;\n onArrowOffsetChange(offset?: number): void;\n};\n\nconst [PopperContentProvider, useContentContext] =\n createPopperContext<PopperContentContextValue>(CONTENT_NAME);\n\ntype PopperContentElement = React.ElementRef<typeof Primitive.div>;\ninterface PopperContentProps extends PrimitiveDivProps {\n side?: Side;\n sideOffset?: number;\n align?: Align;\n alignOffset?: number;\n collisionTolerance?: number;\n avoidCollisions?: boolean;\n}\n\nconst PopperContent = React.forwardRef<PopperContentElement, PopperContentProps>(\n (props: ScopedProps<PopperContentProps>, forwardedRef) => {\n const {\n __scopePopper,\n side = 'bottom',\n sideOffset,\n align = 'center',\n alignOffset,\n collisionTolerance,\n avoidCollisions = true,\n ...contentProps\n } = props;\n\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n const [arrowOffset, setArrowOffset] = React.useState<number>();\n const anchorRect = useRect(context.anchor);\n const [content, setContent] = React.useState<HTMLDivElement | null>(null);\n const contentSize = useSize(content);\n const [arrow, setArrow] = React.useState<HTMLSpanElement | null>(null);\n const arrowSize = useSize(arrow);\n\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n\n const windowSize = useWindowSize();\n const collisionBoundariesRect = windowSize\n ? DOMRect.fromRect({ ...windowSize, x: 0, y: 0 })\n : undefined;\n\n const { popperStyles, arrowStyles, placedSide, placedAlign } = getPlacementData({\n anchorRect,\n popperSize: contentSize,\n arrowSize,\n\n // config\n arrowOffset,\n side,\n sideOffset,\n align,\n alignOffset,\n shouldAvoidCollisions: avoidCollisions,\n collisionBoundariesRect,\n collisionTolerance,\n });\n const isPlaced = placedSide !== undefined;\n\n return (\n <div style={popperStyles} data-radix-popper-content-wrapper=\"\">\n <PopperContentProvider\n scope={__scopePopper}\n arrowStyles={arrowStyles}\n onArrowChange={setArrow}\n onArrowOffsetChange={setArrowOffset}\n >\n <Primitive.div\n data-side={placedSide}\n data-align={placedAlign}\n {...contentProps}\n style={{\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPlaced ? 'none' : undefined,\n }}\n ref={composedRefs}\n />\n </PopperContentProvider>\n </div>\n );\n }\n);\n\nPopperContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'PopperArrow';\n\ntype PopperArrowElement = React.ElementRef<typeof ArrowPrimitive.Root>;\ntype ArrowProps = Radix.ComponentPropsWithoutRef<typeof ArrowPrimitive.Root>;\ninterface PopperArrowProps extends ArrowProps {\n offset?: number;\n}\n\nconst PopperArrow = React.forwardRef<PopperArrowElement, PopperArrowProps>(function PopperArrow(\n props: ScopedProps<PopperArrowProps>,\n forwardedRef\n) {\n const { __scopePopper, offset, ...arrowProps } = props;\n const context = useContentContext(ARROW_NAME, __scopePopper);\n const { onArrowOffsetChange } = context;\n\n // send the Arrow's offset up to Popper\n React.useEffect(() => onArrowOffsetChange(offset), [onArrowOffsetChange, offset]);\n\n return (\n <span style={{ ...context.arrowStyles, pointerEvents: 'none' }}>\n <span\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n ref={context.onArrowChange}\n style={{\n display: 'inline-block',\n verticalAlign: 'top',\n pointerEvents: 'auto',\n }}\n >\n <ArrowPrimitive.Root\n {...arrowProps}\n ref={forwardedRef}\n style={{\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: 'block',\n }}\n />\n </span>\n </span>\n );\n});\n\nPopperArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS = 100;\n\nfunction useWindowSize() {\n const [windowSize, setWindowSize] = React.useState<{ width: number; height: number } | undefined>(\n undefined\n );\n\n React.useEffect(() => {\n let debounceTimerId: number;\n\n function updateWindowSize() {\n setWindowSize({ width: window.innerWidth, height: window.innerHeight });\n }\n\n function handleResize() {\n window.clearTimeout(debounceTimerId);\n debounceTimerId = window.setTimeout(updateWindowSize, WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS);\n }\n\n updateWindowSize();\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n\n return windowSize;\n}\n\nconst Root = Popper;\nconst Anchor = PopperAnchor;\nconst Content = PopperContent;\nconst Arrow = PopperArrow;\n\nexport {\n createPopperScope,\n //\n Popper,\n PopperAnchor,\n PopperContent,\n PopperArrow,\n //\n Root,\n Anchor,\n Content,\n Arrow,\n};\nexport type { PopperProps, PopperAnchorProps, PopperContentProps, PopperArrowProps };\n"],"names":["React","getPlacementData","useComposedRefs","createContextScope","useRect","useSize","Primitive","ArrowPrimitive","POPPER_NAME","createPopperContext","createPopperScope","PopperProvider","usePopperContext","Popper","props","__scopePopper","children","anchor","setAnchor","useState","ANCHOR_NAME","PopperAnchor","forwardRef","forwardedRef","virtualRef","anchorProps","context","ref","useRef","composedRefs","useEffect","onAnchorChange","current","CONTENT_NAME","PopperContentProvider","useContentContext","PopperContent","side","sideOffset","align","alignOffset","collisionTolerance","avoidCollisions","contentProps","arrowOffset","setArrowOffset","anchorRect","content","setContent","contentSize","arrow","setArrow","arrowSize","node","windowSize","useWindowSize","collisionBoundariesRect","DOMRect","fromRect","x","y","undefined","popperStyles","arrowStyles","placedSide","placedAlign","popperSize","shouldAvoidCollisions","isPlaced","style","animation","ARROW_NAME","PopperArrow","offset","arrowProps","onArrowOffsetChange","pointerEvents","onArrowChange","display","verticalAlign","WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS","setWindowSize","debounceTimerId","updateWindowSize","width","window","innerWidth","height","innerHeight","handleResize","clearTimeout","setTimeout","addEventListener","removeEventListener","Root","Anchor","Content","Arrow"],"version":3,"file":"index.js.map"}
|
package/dist/index.module.js
CHANGED
|
@@ -1,2 +1,202 @@
|
|
|
1
|
-
import
|
|
1
|
+
import $kY93V$babelruntimehelpersesmextends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import {useState as $kY93V$useState, createElement as $kY93V$createElement, forwardRef as $kY93V$forwardRef, useRef as $kY93V$useRef, useEffect as $kY93V$useEffect} from "react";
|
|
3
|
+
import {getPlacementData as $kY93V$getPlacementData} from "@radix-ui/popper";
|
|
4
|
+
import {useComposedRefs as $kY93V$useComposedRefs} from "@radix-ui/react-compose-refs";
|
|
5
|
+
import {createContextScope as $kY93V$createContextScope} from "@radix-ui/react-context";
|
|
6
|
+
import {useRect as $kY93V$useRect} from "@radix-ui/react-use-rect";
|
|
7
|
+
import {useSize as $kY93V$useSize} from "@radix-ui/react-use-size";
|
|
8
|
+
import {Primitive as $kY93V$Primitive} from "@radix-ui/react-primitive";
|
|
9
|
+
import {Root as $kY93V$Root} from "@radix-ui/react-arrow";
|
|
10
|
+
|
|
11
|
+
function $parcel$export(e, n, v, s) {
|
|
12
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
13
|
+
}
|
|
14
|
+
var $cf1ac5d9fe0e8206$exports = {};
|
|
15
|
+
|
|
16
|
+
$parcel$export($cf1ac5d9fe0e8206$exports, "createPopperScope", () => $cf1ac5d9fe0e8206$export$722aac194ae923);
|
|
17
|
+
$parcel$export($cf1ac5d9fe0e8206$exports, "Popper", () => $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9);
|
|
18
|
+
$parcel$export($cf1ac5d9fe0e8206$exports, "PopperAnchor", () => $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d);
|
|
19
|
+
$parcel$export($cf1ac5d9fe0e8206$exports, "PopperContent", () => $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc);
|
|
20
|
+
$parcel$export($cf1ac5d9fe0e8206$exports, "PopperArrow", () => $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0);
|
|
21
|
+
$parcel$export($cf1ac5d9fe0e8206$exports, "Root", () => $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9);
|
|
22
|
+
$parcel$export($cf1ac5d9fe0e8206$exports, "Anchor", () => $cf1ac5d9fe0e8206$export$b688253958b8dfe7);
|
|
23
|
+
$parcel$export($cf1ac5d9fe0e8206$exports, "Content", () => $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2);
|
|
24
|
+
$parcel$export($cf1ac5d9fe0e8206$exports, "Arrow", () => $cf1ac5d9fe0e8206$export$21b07c8f274aebd5);
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
/* -------------------------------------------------------------------------------------------------
|
|
35
|
+
* Popper
|
|
36
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME = 'Popper';
|
|
37
|
+
const [$cf1ac5d9fe0e8206$var$createPopperContext, $cf1ac5d9fe0e8206$export$722aac194ae923] = $kY93V$createContextScope($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
38
|
+
const [$cf1ac5d9fe0e8206$var$PopperProvider, $cf1ac5d9fe0e8206$var$usePopperContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
39
|
+
const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props)=>{
|
|
40
|
+
const { __scopePopper: __scopePopper , children: children } = props;
|
|
41
|
+
const [anchor, setAnchor] = $kY93V$useState(null);
|
|
42
|
+
return /*#__PURE__*/ $kY93V$createElement($cf1ac5d9fe0e8206$var$PopperProvider, {
|
|
43
|
+
scope: __scopePopper,
|
|
44
|
+
anchor: anchor,
|
|
45
|
+
onAnchorChange: setAnchor
|
|
46
|
+
}, children);
|
|
47
|
+
};
|
|
48
|
+
/*#__PURE__*/ Object.assign($cf1ac5d9fe0e8206$export$badac9ada3a0bdf9, {
|
|
49
|
+
displayName: $cf1ac5d9fe0e8206$var$POPPER_NAME
|
|
50
|
+
});
|
|
51
|
+
/* -------------------------------------------------------------------------------------------------
|
|
52
|
+
* PopperAnchor
|
|
53
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME = 'PopperAnchor';
|
|
54
|
+
const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /*#__PURE__*/ $kY93V$forwardRef((props, forwardedRef)=>{
|
|
55
|
+
const { __scopePopper: __scopePopper , virtualRef: virtualRef , ...anchorProps } = props;
|
|
56
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper);
|
|
57
|
+
const ref = $kY93V$useRef(null);
|
|
58
|
+
const composedRefs = $kY93V$useComposedRefs(forwardedRef, ref);
|
|
59
|
+
$kY93V$useEffect(()=>{
|
|
60
|
+
// Consumer can anchor the popper to something that isn't
|
|
61
|
+
// a DOM node e.g. pointer position, so we override the
|
|
62
|
+
// `anchorRef` with their virtual ref in this case.
|
|
63
|
+
context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
|
|
64
|
+
});
|
|
65
|
+
return virtualRef ? null : /*#__PURE__*/ $kY93V$createElement($kY93V$Primitive.div, $kY93V$babelruntimehelpersesmextends({}, anchorProps, {
|
|
66
|
+
ref: composedRefs
|
|
67
|
+
}));
|
|
68
|
+
});
|
|
69
|
+
/*#__PURE__*/ Object.assign($cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d, {
|
|
70
|
+
displayName: $cf1ac5d9fe0e8206$var$ANCHOR_NAME
|
|
71
|
+
});
|
|
72
|
+
/* -------------------------------------------------------------------------------------------------
|
|
73
|
+
* PopperContent
|
|
74
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME = 'PopperContent';
|
|
75
|
+
const [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME);
|
|
76
|
+
const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ $kY93V$forwardRef((props, forwardedRef)=>{
|
|
77
|
+
const { __scopePopper: __scopePopper , side: side = 'bottom' , sideOffset: sideOffset , align: align = 'center' , alignOffset: alignOffset , collisionTolerance: collisionTolerance , avoidCollisions: avoidCollisions = true , ...contentProps } = props;
|
|
78
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
|
|
79
|
+
const [arrowOffset, setArrowOffset] = $kY93V$useState();
|
|
80
|
+
const anchorRect = $kY93V$useRect(context.anchor);
|
|
81
|
+
const [content, setContent] = $kY93V$useState(null);
|
|
82
|
+
const contentSize = $kY93V$useSize(content);
|
|
83
|
+
const [arrow, setArrow] = $kY93V$useState(null);
|
|
84
|
+
const arrowSize = $kY93V$useSize(arrow);
|
|
85
|
+
const composedRefs = $kY93V$useComposedRefs(forwardedRef, (node)=>setContent(node)
|
|
86
|
+
);
|
|
87
|
+
const windowSize = $cf1ac5d9fe0e8206$var$useWindowSize();
|
|
88
|
+
const collisionBoundariesRect = windowSize ? DOMRect.fromRect({
|
|
89
|
+
...windowSize,
|
|
90
|
+
x: 0,
|
|
91
|
+
y: 0
|
|
92
|
+
}) : undefined;
|
|
93
|
+
const { popperStyles: popperStyles , arrowStyles: arrowStyles , placedSide: placedSide , placedAlign: placedAlign } = $kY93V$getPlacementData({
|
|
94
|
+
anchorRect: anchorRect,
|
|
95
|
+
popperSize: contentSize,
|
|
96
|
+
arrowSize: arrowSize,
|
|
97
|
+
arrowOffset: // config
|
|
98
|
+
arrowOffset,
|
|
99
|
+
side: side,
|
|
100
|
+
sideOffset: sideOffset,
|
|
101
|
+
align: align,
|
|
102
|
+
alignOffset: alignOffset,
|
|
103
|
+
shouldAvoidCollisions: avoidCollisions,
|
|
104
|
+
collisionBoundariesRect: collisionBoundariesRect,
|
|
105
|
+
collisionTolerance: collisionTolerance
|
|
106
|
+
});
|
|
107
|
+
const isPlaced = placedSide !== undefined;
|
|
108
|
+
return /*#__PURE__*/ $kY93V$createElement("div", {
|
|
109
|
+
style: popperStyles,
|
|
110
|
+
"data-radix-popper-content-wrapper": ""
|
|
111
|
+
}, /*#__PURE__*/ $kY93V$createElement($cf1ac5d9fe0e8206$var$PopperContentProvider, {
|
|
112
|
+
scope: __scopePopper,
|
|
113
|
+
arrowStyles: arrowStyles,
|
|
114
|
+
onArrowChange: setArrow,
|
|
115
|
+
onArrowOffsetChange: setArrowOffset
|
|
116
|
+
}, /*#__PURE__*/ $kY93V$createElement($kY93V$Primitive.div, $kY93V$babelruntimehelpersesmextends({
|
|
117
|
+
"data-side": placedSide,
|
|
118
|
+
"data-align": placedAlign
|
|
119
|
+
}, contentProps, {
|
|
120
|
+
style: {
|
|
121
|
+
...contentProps.style,
|
|
122
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
123
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
124
|
+
animation: !isPlaced ? 'none' : undefined
|
|
125
|
+
},
|
|
126
|
+
ref: composedRefs
|
|
127
|
+
}))));
|
|
128
|
+
});
|
|
129
|
+
/*#__PURE__*/ Object.assign($cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc, {
|
|
130
|
+
displayName: $cf1ac5d9fe0e8206$var$CONTENT_NAME
|
|
131
|
+
});
|
|
132
|
+
/* -------------------------------------------------------------------------------------------------
|
|
133
|
+
* PopperArrow
|
|
134
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ARROW_NAME = 'PopperArrow';
|
|
135
|
+
const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 = /*#__PURE__*/ $kY93V$forwardRef(function $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0(props, forwardedRef) {
|
|
136
|
+
const { __scopePopper: __scopePopper , offset: offset , ...arrowProps } = props;
|
|
137
|
+
const context = $cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME, __scopePopper);
|
|
138
|
+
const { onArrowOffsetChange: onArrowOffsetChange } = context; // send the Arrow's offset up to Popper
|
|
139
|
+
$kY93V$useEffect(()=>onArrowOffsetChange(offset)
|
|
140
|
+
, [
|
|
141
|
+
onArrowOffsetChange,
|
|
142
|
+
offset
|
|
143
|
+
]);
|
|
144
|
+
return /*#__PURE__*/ $kY93V$createElement("span", {
|
|
145
|
+
style: {
|
|
146
|
+
...context.arrowStyles,
|
|
147
|
+
pointerEvents: 'none'
|
|
148
|
+
}
|
|
149
|
+
}, /*#__PURE__*/ $kY93V$createElement("span", {
|
|
150
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
151
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
152
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
153
|
+
ref: context.onArrowChange,
|
|
154
|
+
style: {
|
|
155
|
+
display: 'inline-block',
|
|
156
|
+
verticalAlign: 'top',
|
|
157
|
+
pointerEvents: 'auto'
|
|
158
|
+
}
|
|
159
|
+
}, /*#__PURE__*/ $kY93V$createElement($kY93V$Root, $kY93V$babelruntimehelpersesmextends({}, arrowProps, {
|
|
160
|
+
ref: forwardedRef,
|
|
161
|
+
style: {
|
|
162
|
+
...arrowProps.style,
|
|
163
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
164
|
+
display: 'block'
|
|
165
|
+
}
|
|
166
|
+
}))));
|
|
167
|
+
});
|
|
168
|
+
/*#__PURE__*/ Object.assign($cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0, {
|
|
169
|
+
displayName: $cf1ac5d9fe0e8206$var$ARROW_NAME
|
|
170
|
+
});
|
|
171
|
+
/* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS = 100;
|
|
172
|
+
function $cf1ac5d9fe0e8206$var$useWindowSize() {
|
|
173
|
+
const [windowSize, setWindowSize] = $kY93V$useState(undefined);
|
|
174
|
+
$kY93V$useEffect(()=>{
|
|
175
|
+
let debounceTimerId;
|
|
176
|
+
function updateWindowSize() {
|
|
177
|
+
setWindowSize({
|
|
178
|
+
width: window.innerWidth,
|
|
179
|
+
height: window.innerHeight
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function handleResize() {
|
|
183
|
+
window.clearTimeout(debounceTimerId);
|
|
184
|
+
debounceTimerId = window.setTimeout(updateWindowSize, $cf1ac5d9fe0e8206$var$WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS);
|
|
185
|
+
}
|
|
186
|
+
updateWindowSize();
|
|
187
|
+
window.addEventListener('resize', handleResize);
|
|
188
|
+
return ()=>window.removeEventListener('resize', handleResize)
|
|
189
|
+
;
|
|
190
|
+
}, []);
|
|
191
|
+
return windowSize;
|
|
192
|
+
}
|
|
193
|
+
const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9;
|
|
194
|
+
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
|
|
195
|
+
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
|
196
|
+
const $cf1ac5d9fe0e8206$export$21b07c8f274aebd5 = $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0;
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
export {$cf1ac5d9fe0e8206$export$722aac194ae923 as createPopperScope, $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 as Popper, $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d as PopperAnchor, $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc as PopperContent, $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 as PopperArrow, $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 as Root, $cf1ac5d9fe0e8206$export$b688253958b8dfe7 as Anchor, $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 as Content, $cf1ac5d9fe0e8206$export$21b07c8f274aebd5 as Arrow};
|
|
2
202
|
//# sourceMappingURL=index.module.js.map
|
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"8bAkBA,MAGOA,EAAqBC,GAAqBC,EAH7B,yCASpB,MAAOC,EAAgBC,GAAoBJ,EATvB,iBAcpB,MAAMK,OAAiCC,IACrC,MAAMC,cAAEA,EAAFC,SAAiBA,GAAaF,GAC7BG,EAAQC,GAAaC,EAAMC,SAA4B,mBAC9D,OACEC,EAAAC,cAACC,EAAD,CAAgBC,MAAOT,EAAeE,OAAQA,EAAQQ,eAAgBP,GACnEF,wBAmBP,MAAMU,0BAAeP,EAAMQ,YACzB,CAACb,EAAuCc,KACtC,MAAMb,cAAEA,EAAFc,WAAiBA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"],"sourcesContent":["import * as React from 'react';\nimport { getPlacementData } from '@radix-ui/popper';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useRect } from '@radix-ui/react-use-rect';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as ArrowPrimitive from '@radix-ui/react-arrow';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\nimport type { Side, Align } from '@radix-ui/popper';\nimport type { Measurable } from '@radix-ui/rect';\n\n/* -------------------------------------------------------------------------------------------------\n * Popper\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_NAME = 'Popper';\n\ntype ScopedProps<P> = P & { __scopePopper?: Scope };\nconst [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\n\ntype PopperContextValue = {\n anchor: Measurable | null;\n onAnchorChange(anchor: Measurable | null): void;\n};\nconst [PopperProvider, usePopperContext] = createPopperContext<PopperContextValue>(POPPER_NAME);\n\ninterface PopperProps {\n children?: React.ReactNode;\n}\nconst Popper: React.FC<PopperProps> = (props: ScopedProps<PopperProps>) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState<Measurable | null>(null);\n return (\n <PopperProvider scope={__scopePopper} anchor={anchor} onAnchorChange={setAnchor}>\n {children}\n </PopperProvider>\n );\n};\n\nPopper.displayName = POPPER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopperAnchor';\n\ntype PopperAnchorElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PopperAnchorProps extends PrimitiveDivProps {\n virtualRef?: React.RefObject<Measurable>;\n}\n\nconst PopperAnchor = React.forwardRef<PopperAnchorElement, PopperAnchorProps>(\n (props: ScopedProps<PopperAnchorProps>, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef<PopperAnchorElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n React.useEffect(() => {\n // Consumer can anchor the popper to something that isn't\n // a DOM node e.g. pointer position, so we override the\n // `anchorRef` with their virtual ref in this case.\n context.onAnchorChange(virtualRef?.current || ref.current);\n });\n\n return virtualRef ? null : <Primitive.div {...anchorProps} ref={composedRefs} />;\n }\n);\n\nPopperAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopperContent';\n\ntype PopperContentContextValue = {\n arrowStyles: React.CSSProperties;\n onArrowChange(arrow: HTMLSpanElement | null): void;\n onArrowOffsetChange(offset?: number): void;\n};\n\nconst [PopperContentProvider, useContentContext] =\n createPopperContext<PopperContentContextValue>(CONTENT_NAME);\n\ntype PopperContentElement = React.ElementRef<typeof Primitive.div>;\ninterface PopperContentProps extends PrimitiveDivProps {\n side?: Side;\n sideOffset?: number;\n align?: Align;\n alignOffset?: number;\n collisionTolerance?: number;\n avoidCollisions?: boolean;\n}\n\nconst PopperContent = React.forwardRef<PopperContentElement, PopperContentProps>(\n (props: ScopedProps<PopperContentProps>, forwardedRef) => {\n const {\n __scopePopper,\n side = 'bottom',\n sideOffset,\n align = 'center',\n alignOffset,\n collisionTolerance,\n avoidCollisions = true,\n ...contentProps\n } = props;\n\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n const [arrowOffset, setArrowOffset] = React.useState<number>();\n const anchorRect = useRect(context.anchor);\n const [content, setContent] = React.useState<HTMLDivElement | null>(null);\n const contentSize = useSize(content);\n const [arrow, setArrow] = React.useState<HTMLSpanElement | null>(null);\n const arrowSize = useSize(arrow);\n\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n\n const windowSize = useWindowSize();\n const collisionBoundariesRect = windowSize\n ? DOMRect.fromRect({ ...windowSize, x: 0, y: 0 })\n : undefined;\n\n const { popperStyles, arrowStyles, placedSide, placedAlign } = getPlacementData({\n anchorRect,\n popperSize: contentSize,\n arrowSize,\n\n // config\n arrowOffset,\n side,\n sideOffset,\n align,\n alignOffset,\n shouldAvoidCollisions: avoidCollisions,\n collisionBoundariesRect,\n collisionTolerance,\n });\n const isPlaced = placedSide !== undefined;\n\n return (\n <div style={popperStyles} data-radix-popper-content-wrapper=\"\">\n <PopperContentProvider\n scope={__scopePopper}\n arrowStyles={arrowStyles}\n onArrowChange={setArrow}\n onArrowOffsetChange={setArrowOffset}\n >\n <Primitive.div\n data-side={placedSide}\n data-align={placedAlign}\n {...contentProps}\n style={{\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPlaced ? 'none' : undefined,\n }}\n ref={composedRefs}\n />\n </PopperContentProvider>\n </div>\n );\n }\n);\n\nPopperContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'PopperArrow';\n\ntype PopperArrowElement = React.ElementRef<typeof ArrowPrimitive.Root>;\ntype ArrowProps = Radix.ComponentPropsWithoutRef<typeof ArrowPrimitive.Root>;\ninterface PopperArrowProps extends ArrowProps {\n offset?: number;\n}\n\nconst PopperArrow = React.forwardRef<PopperArrowElement, PopperArrowProps>(function PopperArrow(\n props: ScopedProps<PopperArrowProps>,\n forwardedRef\n) {\n const { __scopePopper, offset, ...arrowProps } = props;\n const context = useContentContext(ARROW_NAME, __scopePopper);\n const { onArrowOffsetChange } = context;\n\n // send the Arrow's offset up to Popper\n React.useEffect(() => onArrowOffsetChange(offset), [onArrowOffsetChange, offset]);\n\n return (\n <span style={{ ...context.arrowStyles, pointerEvents: 'none' }}>\n <span\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n ref={context.onArrowChange}\n style={{\n display: 'inline-block',\n verticalAlign: 'top',\n pointerEvents: 'auto',\n }}\n >\n <ArrowPrimitive.Root\n {...arrowProps}\n ref={forwardedRef}\n style={{\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: 'block',\n }}\n />\n </span>\n </span>\n );\n});\n\nPopperArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS = 100;\n\nfunction useWindowSize() {\n const [windowSize, setWindowSize] = React.useState<{ width: number; height: number } | undefined>(\n undefined\n );\n\n React.useEffect(() => {\n let debounceTimerId: number;\n\n function updateWindowSize() {\n setWindowSize({ width: window.innerWidth, height: window.innerHeight });\n }\n\n function handleResize() {\n window.clearTimeout(debounceTimerId);\n debounceTimerId = window.setTimeout(updateWindowSize, WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS);\n }\n\n updateWindowSize();\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n\n return windowSize;\n}\n\nconst Root = Popper;\nconst Anchor = PopperAnchor;\nconst Content = PopperContent;\nconst Arrow = PopperArrow;\n\nexport {\n createPopperScope,\n //\n Popper,\n PopperAnchor,\n PopperContent,\n PopperArrow,\n //\n Root,\n Anchor,\n Content,\n Arrow,\n};\nexport type { PopperProps, PopperAnchorProps, PopperContentProps, PopperArrowProps };\n"],"names":["createPopperContext","createPopperScope","createContextScope","PopperProvider","usePopperContext","Popper","props","__scopePopper","children","anchor","setAnchor","React","useState","_react","createElement","$d4fb2a15a6483a4f85af0f96fd68687d$var$PopperProvider","scope","onAnchorChange","PopperAnchor","forwardRef","forwardedRef","virtualRef","anchorProps","context","ref","useRef","composedRefs","useComposedRefs","useEffect","current","Primitive","div","_babelRuntimeHelpersEsmExtends","PopperContentProvider","useContentContext","PopperContent","side","sideOffset","align","alignOffset","collisionTolerance","avoidCollisions","contentProps","arrowOffset","setArrowOffset","anchorRect","useRect","content","setContent","contentSize","useSize","arrow","setArrow","arrowSize","node","windowSize","setWindowSize","undefined","debounceTimerId","updateWindowSize","width","window","innerWidth","height","innerHeight","handleResize","clearTimeout","setTimeout","addEventListener","removeEventListener","useWindowSize","collisionBoundariesRect","DOMRect","fromRect","x","y","popperStyles","arrowStyles","placedSide","placedAlign","getPlacementData","popperSize","shouldAvoidCollisions","isPlaced","style","$d4fb2a15a6483a4f85af0f96fd68687d$var$PopperContentProvider","onArrowChange","onArrowOffsetChange","animation","PopperArrow","offset","arrowProps","pointerEvents","display","verticalAlign","_radixUiReactArrow","Root","Anchor","Content","Arrow"],"version":3,"file":"index.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;ACcA;;oGAEA,CAEA,MAAMQ,iCAAW,GAAG,QAApB,AAAA;AAGA,MAAM,CAACC,yCAAD,EAAsBC,uCAAtB,CAAA,GAA2CP,yBAAkB,CAACK,iCAAD,CAAnE,AAAA;AAMA,MAAM,CAACG,oCAAD,EAAiBC,sCAAjB,CAAA,GAAqCH,yCAAmB,CAAqBD,iCAArB,CAA9D,AAAA;AAKA,MAAMK,yCAA6B,GAAIC,CAAAA,KAAD,GAAqC;IACzE,MAAM,E,eAAEC,aAAF,CAAA,E,UAAiBC,QAAAA,CAAAA,EAAjB,GAA8BF,KAApC,AAAM;IACN,MAAM,CAACG,MAAD,EAASC,SAAT,CAAA,GAAsBlB,eAAA,CAAkC,IAAlC,CAA5B,AAAA;IACA,OAAA,aACE,CAAA,oBAAA,CAAC,oCAAD,EADF;QACkB,KAAK,EAAEe,aAAvB;QAAsC,MAAM,EAAEE,MAA9C;QAAsD,cAAc,EAAEC,SAAhB;KAAtD,EACGF,QADH,CADF,CACE;CAJJ,AAQC;AAED,aAAA,CAAA,MAAA,CAAA,MAAA,CAAA,yCAAA,EAAA;IAAA,WAAA,EAA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vB,MAAM,CAACD,UAAD,EAAa2B,aAAb,CAAA,GAA8BjF,eAAA,CAClC6D,SADkC,CAApC,AAAA;IAIA7D,gBAAA,CAAgB,IAAM;QACpB,IAAIkF,eAAJ,AAAA;QAEA,SAASC,gBAAT,GAA4B;YAC1BF,aAAa,CAAC;gBAAEG,KAAK,EAAEC,MAAM,CAACC,UAAhB;gBAA4BC,MAAM,EAAEF,MAAM,CAACG,WAAfD;aAA7B,CAAb,CAAc;SACf;QAED,SAASE,YAAT,GAAwB;YACtBJ,MAAM,CAACK,YAAP,CAAoBR,eAApB,CAAAG,CAAAA;YACAH,eAAe,GAAGG,MAAM,CAACM,UAAP,CAAkBR,gBAAlB,EAAoCH,uDAApC,CAAlB,CAAAE;SACD;QAEDC,gBAAgB,EAAhBA,CAAAA;QACAE,MAAM,CAACO,gBAAP,CAAwB,QAAxB,EAAkCH,YAAlC,CAAAJ,CAAAA;QACA,OAAO,IAAMA,MAAM,CAACQ,mBAAP,CAA2B,QAA3B,EAAqCJ,YAArC,CAAb;QAAA,CAAA;KAdF,EAeG,EAfH,CAeC,CAAA;IAED,OAAOnC,UAAP,CAAA;CACD;AAED,MAAMwC,yCAAI,GAAGjF,yCAAb,AAAA;AACA,MAAMkF,yCAAM,GAAG1E,wCAAf,AAAA;AACA,MAAM2E,yCAAO,GAAG5D,wCAAhB,AAAA;AACA,MAAM6D,yCAAK,GAAGzB,yCAAd,AAAA;;ADlQA","sources":["packages/react/popper/src/index.ts","packages/react/popper/src/Popper.tsx"],"sourcesContent":["export * from './Popper';\n","import * as React from 'react';\nimport { getPlacementData } from '@radix-ui/popper';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useRect } from '@radix-ui/react-use-rect';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as ArrowPrimitive from '@radix-ui/react-arrow';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\nimport type { Side, Align } from '@radix-ui/popper';\nimport type { Measurable } from '@radix-ui/rect';\n\n/* -------------------------------------------------------------------------------------------------\n * Popper\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_NAME = 'Popper';\n\ntype ScopedProps<P> = P & { __scopePopper?: Scope };\nconst [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\n\ntype PopperContextValue = {\n anchor: Measurable | null;\n onAnchorChange(anchor: Measurable | null): void;\n};\nconst [PopperProvider, usePopperContext] = createPopperContext<PopperContextValue>(POPPER_NAME);\n\ninterface PopperProps {\n children?: React.ReactNode;\n}\nconst Popper: React.FC<PopperProps> = (props: ScopedProps<PopperProps>) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState<Measurable | null>(null);\n return (\n <PopperProvider scope={__scopePopper} anchor={anchor} onAnchorChange={setAnchor}>\n {children}\n </PopperProvider>\n );\n};\n\nPopper.displayName = POPPER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopperAnchor';\n\ntype PopperAnchorElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PopperAnchorProps extends PrimitiveDivProps {\n virtualRef?: React.RefObject<Measurable>;\n}\n\nconst PopperAnchor = React.forwardRef<PopperAnchorElement, PopperAnchorProps>(\n (props: ScopedProps<PopperAnchorProps>, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef<PopperAnchorElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n React.useEffect(() => {\n // Consumer can anchor the popper to something that isn't\n // a DOM node e.g. pointer position, so we override the\n // `anchorRef` with their virtual ref in this case.\n context.onAnchorChange(virtualRef?.current || ref.current);\n });\n\n return virtualRef ? null : <Primitive.div {...anchorProps} ref={composedRefs} />;\n }\n);\n\nPopperAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopperContent';\n\ntype PopperContentContextValue = {\n arrowStyles: React.CSSProperties;\n onArrowChange(arrow: HTMLSpanElement | null): void;\n onArrowOffsetChange(offset?: number): void;\n};\n\nconst [PopperContentProvider, useContentContext] =\n createPopperContext<PopperContentContextValue>(CONTENT_NAME);\n\ntype PopperContentElement = React.ElementRef<typeof Primitive.div>;\ninterface PopperContentProps extends PrimitiveDivProps {\n side?: Side;\n sideOffset?: number;\n align?: Align;\n alignOffset?: number;\n collisionTolerance?: number;\n avoidCollisions?: boolean;\n}\n\nconst PopperContent = React.forwardRef<PopperContentElement, PopperContentProps>(\n (props: ScopedProps<PopperContentProps>, forwardedRef) => {\n const {\n __scopePopper,\n side = 'bottom',\n sideOffset,\n align = 'center',\n alignOffset,\n collisionTolerance,\n avoidCollisions = true,\n ...contentProps\n } = props;\n\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n const [arrowOffset, setArrowOffset] = React.useState<number>();\n const anchorRect = useRect(context.anchor);\n const [content, setContent] = React.useState<HTMLDivElement | null>(null);\n const contentSize = useSize(content);\n const [arrow, setArrow] = React.useState<HTMLSpanElement | null>(null);\n const arrowSize = useSize(arrow);\n\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n\n const windowSize = useWindowSize();\n const collisionBoundariesRect = windowSize\n ? DOMRect.fromRect({ ...windowSize, x: 0, y: 0 })\n : undefined;\n\n const { popperStyles, arrowStyles, placedSide, placedAlign } = getPlacementData({\n anchorRect,\n popperSize: contentSize,\n arrowSize,\n\n // config\n arrowOffset,\n side,\n sideOffset,\n align,\n alignOffset,\n shouldAvoidCollisions: avoidCollisions,\n collisionBoundariesRect,\n collisionTolerance,\n });\n const isPlaced = placedSide !== undefined;\n\n return (\n <div style={popperStyles} data-radix-popper-content-wrapper=\"\">\n <PopperContentProvider\n scope={__scopePopper}\n arrowStyles={arrowStyles}\n onArrowChange={setArrow}\n onArrowOffsetChange={setArrowOffset}\n >\n <Primitive.div\n data-side={placedSide}\n data-align={placedAlign}\n {...contentProps}\n style={{\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPlaced ? 'none' : undefined,\n }}\n ref={composedRefs}\n />\n </PopperContentProvider>\n </div>\n );\n }\n);\n\nPopperContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'PopperArrow';\n\ntype PopperArrowElement = React.ElementRef<typeof ArrowPrimitive.Root>;\ntype ArrowProps = Radix.ComponentPropsWithoutRef<typeof ArrowPrimitive.Root>;\ninterface PopperArrowProps extends ArrowProps {\n offset?: number;\n}\n\nconst PopperArrow = React.forwardRef<PopperArrowElement, PopperArrowProps>(function PopperArrow(\n props: ScopedProps<PopperArrowProps>,\n forwardedRef\n) {\n const { __scopePopper, offset, ...arrowProps } = props;\n const context = useContentContext(ARROW_NAME, __scopePopper);\n const { onArrowOffsetChange } = context;\n\n // send the Arrow's offset up to Popper\n React.useEffect(() => onArrowOffsetChange(offset), [onArrowOffsetChange, offset]);\n\n return (\n <span style={{ ...context.arrowStyles, pointerEvents: 'none' }}>\n <span\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n ref={context.onArrowChange}\n style={{\n display: 'inline-block',\n verticalAlign: 'top',\n pointerEvents: 'auto',\n }}\n >\n <ArrowPrimitive.Root\n {...arrowProps}\n ref={forwardedRef}\n style={{\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: 'block',\n }}\n />\n </span>\n </span>\n );\n});\n\nPopperArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS = 100;\n\nfunction useWindowSize() {\n const [windowSize, setWindowSize] = React.useState<{ width: number; height: number } | undefined>(\n undefined\n );\n\n React.useEffect(() => {\n let debounceTimerId: number;\n\n function updateWindowSize() {\n setWindowSize({ width: window.innerWidth, height: window.innerHeight });\n }\n\n function handleResize() {\n window.clearTimeout(debounceTimerId);\n debounceTimerId = window.setTimeout(updateWindowSize, WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS);\n }\n\n updateWindowSize();\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n\n return windowSize;\n}\n\nconst Root = Popper;\nconst Anchor = PopperAnchor;\nconst Content = PopperContent;\nconst Arrow = PopperArrow;\n\nexport {\n createPopperScope,\n //\n Popper,\n PopperAnchor,\n PopperContent,\n PopperArrow,\n //\n Root,\n Anchor,\n Content,\n Arrow,\n};\nexport type { PopperProps, PopperAnchorProps, PopperContentProps, PopperArrowProps };\n"],"names":["React","getPlacementData","useComposedRefs","createContextScope","useRect","useSize","Primitive","ArrowPrimitive","POPPER_NAME","createPopperContext","createPopperScope","PopperProvider","usePopperContext","Popper","props","__scopePopper","children","anchor","setAnchor","useState","ANCHOR_NAME","PopperAnchor","forwardRef","forwardedRef","virtualRef","anchorProps","context","ref","useRef","composedRefs","useEffect","onAnchorChange","current","CONTENT_NAME","PopperContentProvider","useContentContext","PopperContent","side","sideOffset","align","alignOffset","collisionTolerance","avoidCollisions","contentProps","arrowOffset","setArrowOffset","anchorRect","content","setContent","contentSize","arrow","setArrow","arrowSize","node","windowSize","useWindowSize","collisionBoundariesRect","DOMRect","fromRect","x","y","undefined","popperStyles","arrowStyles","placedSide","placedAlign","popperSize","shouldAvoidCollisions","isPlaced","style","animation","ARROW_NAME","PopperArrow","offset","arrowProps","onArrowOffsetChange","pointerEvents","onArrowChange","display","verticalAlign","WINDOW_RESIZE_DEBOUNCE_WAIT_IN_MS","setWindowSize","debounceTimerId","updateWindowSize","width","window","innerWidth","height","innerHeight","handleResize","clearTimeout","setTimeout","addEventListener","removeEventListener","Root","Anchor","Content","Arrow"],"version":3,"file":"index.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-popper",
|
|
3
|
-
"version": "0.1.5-rc.
|
|
3
|
+
"version": "0.1.5-rc.20",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,16 +18,17 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/runtime": "^7.13.10",
|
|
20
20
|
"@radix-ui/popper": "0.1.0",
|
|
21
|
-
"@radix-ui/react-arrow": "0.1.5-rc.
|
|
22
|
-
"@radix-ui/react-compose-refs": "0.1.1-rc.
|
|
23
|
-
"@radix-ui/react-context": "0.1.2-rc.
|
|
24
|
-
"@radix-ui/react-primitive": "0.1.5-rc.
|
|
25
|
-
"@radix-ui/react-use-rect": "0.1.2-rc.
|
|
26
|
-
"@radix-ui/react-use-size": "0.1.2-rc.
|
|
21
|
+
"@radix-ui/react-arrow": "0.1.5-rc.20",
|
|
22
|
+
"@radix-ui/react-compose-refs": "0.1.1-rc.20",
|
|
23
|
+
"@radix-ui/react-context": "0.1.2-rc.20",
|
|
24
|
+
"@radix-ui/react-primitive": "0.1.5-rc.20",
|
|
25
|
+
"@radix-ui/react-use-rect": "0.1.2-rc.20",
|
|
26
|
+
"@radix-ui/react-use-size": "0.1.2-rc.20",
|
|
27
27
|
"@radix-ui/rect": "0.1.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"react": "^16.8 || ^17.0 || ^18.0"
|
|
30
|
+
"react": "^16.8 || ^17.0 || ^18.0",
|
|
31
|
+
"react-dom": "^16.8 || ^17.0 || ^18.0"
|
|
31
32
|
},
|
|
32
33
|
"homepage": "https://radix-ui.com/primitives",
|
|
33
34
|
"repository": {
|