@hanzogui/popper 3.0.2 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +40 -19
- package/dist/cjs/Popper.cjs +492 -460
- package/dist/cjs/Popper.native.js +514 -517
- package/dist/cjs/Popper.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.native.js +8 -6
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/Popper.mjs +456 -426
- package/dist/esm/Popper.mjs.map +1 -1
- package/dist/esm/Popper.native.js +489 -495
- package/dist/esm/Popper.native.js.map +1 -1
- package/dist/jsx/Popper.mjs +456 -426
- package/dist/jsx/Popper.mjs.map +1 -1
- package/dist/jsx/Popper.native.js +514 -517
- package/dist/jsx/Popper.native.js.map +1 -1
- package/dist/jsx/index.native.js +7 -5
- package/package.json +18 -15
- package/src/Popper.tsx +8 -8
- package/types/Popper.d.ts +28 -28
- package/types/Popper.d.ts.map +1 -0
- package/types/index.d.ts.map +1 -0
package/dist/cjs/Popper.cjs
CHANGED
|
@@ -2,33 +2,35 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
6
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
32
34
|
var Popper_exports = {};
|
|
33
35
|
__export(Popper_exports, {
|
|
34
36
|
Popper: () => Popper,
|
|
@@ -48,68 +50,68 @@ __export(Popper_exports, {
|
|
|
48
50
|
usePopperContextSlow: () => usePopperContextSlow
|
|
49
51
|
});
|
|
50
52
|
module.exports = __toCommonJS(Popper_exports);
|
|
51
|
-
var import_react_dom = require("react-dom")
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const PopperContextFast = (0,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
53
|
+
var import_react_dom = require("react-dom");
|
|
54
|
+
var import_compose_refs = require("@hanzogui/compose-refs");
|
|
55
|
+
var import_constants = require("@hanzogui/constants");
|
|
56
|
+
var import_core = require("@hanzogui/core");
|
|
57
|
+
var import_floating = require("@hanzogui/floating");
|
|
58
|
+
var import_floating2 = require("@hanzogui/floating");
|
|
59
|
+
var import_get_token = require("@hanzogui/get-token");
|
|
60
|
+
var import_stacks = require("@hanzogui/stacks");
|
|
61
|
+
var import_start_transition = require("@hanzogui/start-transition");
|
|
62
|
+
var React = __toESM(require("react"), 1);
|
|
63
|
+
require("react-native-web");
|
|
64
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
65
|
+
const PopperContextFast = (0, import_core.createStyledContext)(
|
|
66
|
+
// since we always provide this we can avoid setting here
|
|
67
|
+
{}, "Popper__");
|
|
68
|
+
const PopperPositionContext = import_core.createStyledContext;
|
|
69
|
+
const {
|
|
70
|
+
useStyledContext: usePopperContext,
|
|
71
|
+
Provider: PopperProviderFast
|
|
72
|
+
} = PopperContextFast;
|
|
73
|
+
const PopperContextSlow = (0, import_core.createStyledContext)(
|
|
74
|
+
// since we always provide this we can avoid setting here
|
|
75
|
+
{}, "PopperSlow__");
|
|
76
|
+
const {
|
|
77
|
+
useStyledContext: usePopperContextSlow,
|
|
78
|
+
Provider: PopperProviderSlow
|
|
79
|
+
} = PopperContextSlow;
|
|
80
|
+
const PopperProvider = ({
|
|
81
|
+
scope,
|
|
82
|
+
children,
|
|
83
|
+
...context
|
|
84
|
+
}) => {
|
|
85
|
+
const fns = React.useRef(context);
|
|
86
|
+
fns.current = context;
|
|
87
|
+
const [slowContext] = React.useState(() => ({
|
|
88
|
+
refs: context.refs,
|
|
89
|
+
triggerElements: context.triggerElements,
|
|
90
|
+
update(...a) {
|
|
91
|
+
fns.current.update(...a);
|
|
92
|
+
},
|
|
93
|
+
getReferenceProps(p) {
|
|
94
|
+
return fns.current.getReferenceProps?.(p);
|
|
95
|
+
},
|
|
96
|
+
onHoverReference(e) {
|
|
97
|
+
fns.current.onHoverReference?.(e);
|
|
98
|
+
},
|
|
99
|
+
onLeaveReference() {
|
|
100
|
+
fns.current.onLeaveReference?.();
|
|
101
|
+
}
|
|
102
|
+
}));
|
|
103
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperProviderFast, {
|
|
79
104
|
scope,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}) => {
|
|
83
|
-
const fns = React.useRef(context);
|
|
84
|
-
fns.current = context;
|
|
85
|
-
const [slowContext] = React.useState(() => ({
|
|
86
|
-
refs: context.refs,
|
|
87
|
-
triggerElements: context.triggerElements,
|
|
88
|
-
update(...a) {
|
|
89
|
-
fns.current.update(...a);
|
|
90
|
-
},
|
|
91
|
-
getReferenceProps(p) {
|
|
92
|
-
return fns.current.getReferenceProps?.(p);
|
|
93
|
-
},
|
|
94
|
-
onHoverReference(e) {
|
|
95
|
-
fns.current.onHoverReference?.(e);
|
|
96
|
-
},
|
|
97
|
-
onLeaveReference() {
|
|
98
|
-
fns.current.onLeaveReference?.();
|
|
99
|
-
}
|
|
100
|
-
}));
|
|
101
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperProviderFast, {
|
|
105
|
+
...context,
|
|
106
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperProviderSlow, {
|
|
102
107
|
scope,
|
|
103
|
-
...
|
|
104
|
-
children
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
checkFloating = void 0,
|
|
112
|
-
setupOptions = {};
|
|
108
|
+
...slowContext,
|
|
109
|
+
children
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
const checkFloating = void 0;
|
|
114
|
+
const setupOptions = {};
|
|
113
115
|
function setupPopper(options) {
|
|
114
116
|
Object.assign(setupOptions, options);
|
|
115
117
|
}
|
|
@@ -122,24 +124,37 @@ const transformOriginMiddleware = options => ({
|
|
|
122
124
|
options,
|
|
123
125
|
fn(data) {
|
|
124
126
|
const {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
let x = ""
|
|
141
|
-
|
|
142
|
-
|
|
127
|
+
placement,
|
|
128
|
+
rects,
|
|
129
|
+
middlewareData
|
|
130
|
+
} = data;
|
|
131
|
+
const isArrowHidden = middlewareData.arrow?.centerOffset !== 0;
|
|
132
|
+
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
133
|
+
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
134
|
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
135
|
+
const noArrowAlign = {
|
|
136
|
+
start: "0%",
|
|
137
|
+
center: "50%",
|
|
138
|
+
end: "100%"
|
|
139
|
+
}[placedAlign];
|
|
140
|
+
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
|
|
141
|
+
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
|
|
142
|
+
let x = "";
|
|
143
|
+
let y = "";
|
|
144
|
+
if (placedSide === "bottom") {
|
|
145
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
146
|
+
y = `${-arrowHeight}px`;
|
|
147
|
+
} else if (placedSide === "top") {
|
|
148
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
149
|
+
y = `${rects.floating.height + arrowHeight}px`;
|
|
150
|
+
} else if (placedSide === "right") {
|
|
151
|
+
x = `${-arrowHeight}px`;
|
|
152
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
153
|
+
} else if (placedSide === "left") {
|
|
154
|
+
x = `${rects.floating.width + arrowHeight}px`;
|
|
155
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
143
158
|
data: {
|
|
144
159
|
x,
|
|
145
160
|
y
|
|
@@ -147,62 +162,58 @@ const transformOriginMiddleware = options => ({
|
|
|
147
162
|
};
|
|
148
163
|
}
|
|
149
164
|
});
|
|
150
|
-
function
|
|
165
|
+
function guiAutoUpdate(reference, floating, update) {
|
|
151
166
|
update();
|
|
152
167
|
let rafId = requestAnimationFrame(() => {
|
|
153
|
-
update()
|
|
168
|
+
update();
|
|
169
|
+
rafId = 0;
|
|
154
170
|
});
|
|
155
171
|
const cleanups = [() => {
|
|
156
|
-
rafId
|
|
172
|
+
if (rafId) cancelAnimationFrame(rafId);
|
|
157
173
|
}];
|
|
158
|
-
reference instanceof HTMLElement
|
|
159
|
-
const ancestors = [...(reference instanceof Element ? (0,
|
|
160
|
-
|
|
174
|
+
if (reference instanceof HTMLElement) cleanups.push((0, import_core.registerLayoutNode)(reference, update));
|
|
175
|
+
const ancestors = [...(reference instanceof Element ? (0, import_floating2.getOverflowAncestors)(reference) : []), ...(0, import_floating2.getOverflowAncestors)(floating)];
|
|
176
|
+
const uniqueAncestors = [...new Set(ancestors)];
|
|
161
177
|
for (const ancestor of uniqueAncestors) ancestor.addEventListener("scroll", update, {
|
|
162
|
-
passive:
|
|
178
|
+
passive: true
|
|
163
179
|
});
|
|
164
|
-
|
|
180
|
+
window.addEventListener("resize", update);
|
|
181
|
+
cleanups.push(() => {
|
|
165
182
|
for (const ancestor of uniqueAncestors) ancestor.removeEventListener("scroll", update);
|
|
166
183
|
window.removeEventListener("resize", update);
|
|
167
|
-
})
|
|
184
|
+
});
|
|
185
|
+
return () => cleanups.forEach(fn => fn());
|
|
168
186
|
}
|
|
169
187
|
function Popper(props) {
|
|
170
188
|
const {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
isOpen
|
|
191
|
-
// order matters: offset first, then flip, then shift, then arrow
|
|
192
|
-
typeof offsetOptions < "u" ? (0, import_gui_floating2.offset)(offsetOptions) : null, allowFlip ? (0, import_gui_floating2.flip)(typeof allowFlip == "boolean" ? {} : allowFlip) : null,
|
|
193
|
-
// NOTE: shift's axis terminology is reversed vs flip/offset:
|
|
194
|
-
// for top/bottom placements: mainAxis = horizontal, crossAxis = vertical
|
|
195
|
-
// for left/right placements: mainAxis = vertical, crossAxis = horizontal
|
|
196
|
-
// default to horizontal shift only (mainAxis: true, crossAxis: false)
|
|
197
|
-
stayInFrame ? (0, import_gui_floating2.shift)({
|
|
189
|
+
children,
|
|
190
|
+
size,
|
|
191
|
+
strategy = "absolute",
|
|
192
|
+
placement = "bottom",
|
|
193
|
+
stayInFrame,
|
|
194
|
+
allowFlip,
|
|
195
|
+
offset,
|
|
196
|
+
disableRTL,
|
|
197
|
+
resize,
|
|
198
|
+
passThrough,
|
|
199
|
+
open,
|
|
200
|
+
scope
|
|
201
|
+
} = props;
|
|
202
|
+
const [arrowEl, setArrow] = React.useState(null);
|
|
203
|
+
const [arrowSize, setArrowSize] = React.useState(0);
|
|
204
|
+
const offsetOptions = offset ?? arrowSize;
|
|
205
|
+
const floatingStyle = React.useRef({});
|
|
206
|
+
const isOpen = passThrough ? false : open ?? true;
|
|
207
|
+
const middlewareRef = React.useRef([]);
|
|
208
|
+
if (isOpen) middlewareRef.current = [typeof offsetOptions !== "undefined" ? (0, import_floating2.offset)(offsetOptions) : null, allowFlip ? (0, import_floating2.flip)(typeof allowFlip === "boolean" ? {} : allowFlip) : null, stayInFrame ? (0, import_floating2.shift)({
|
|
198
209
|
padding: 10,
|
|
199
|
-
mainAxis:
|
|
200
|
-
crossAxis:
|
|
201
|
-
...(typeof stayInFrame
|
|
202
|
-
}) : null, arrowEl ? (0,
|
|
210
|
+
mainAxis: true,
|
|
211
|
+
crossAxis: false,
|
|
212
|
+
...(typeof stayInFrame === "object" ? stayInFrame : null)
|
|
213
|
+
}) : null, arrowEl ? (0, import_floating2.arrow)({
|
|
203
214
|
element: arrowEl
|
|
204
|
-
}) : null, checkFloating, resize ? (0,
|
|
205
|
-
padding: typeof stayInFrame
|
|
215
|
+
}) : null, checkFloating, resize ? (0, import_floating2.size)({
|
|
216
|
+
padding: typeof stayInFrame === "object" ? stayInFrame.padding : 10,
|
|
206
217
|
apply({
|
|
207
218
|
availableHeight,
|
|
208
219
|
availableWidth
|
|
@@ -213,10 +224,10 @@ function Popper(props) {
|
|
|
213
224
|
maxWidth: `${availableWidth}px`
|
|
214
225
|
});
|
|
215
226
|
const floatingChild = floating.refs.floating.current?.firstChild;
|
|
216
|
-
floatingChild && floatingChild instanceof HTMLElement
|
|
227
|
+
if (floatingChild && floatingChild instanceof HTMLElement) Object.assign(floatingChild.style, floatingStyle.current);
|
|
217
228
|
},
|
|
218
|
-
...(typeof resize
|
|
219
|
-
}) : null, (0,
|
|
229
|
+
...(typeof resize === "object" && resize)
|
|
230
|
+
}) : null, (0, import_floating2.size)({
|
|
220
231
|
apply({
|
|
221
232
|
elements,
|
|
222
233
|
rects,
|
|
@@ -224,45 +235,51 @@ function Popper(props) {
|
|
|
224
235
|
availableHeight
|
|
225
236
|
}) {
|
|
226
237
|
const {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
contentStyle.setProperty("--
|
|
238
|
+
width: anchorWidth,
|
|
239
|
+
height: anchorHeight
|
|
240
|
+
} = rects.reference;
|
|
241
|
+
const contentStyle = elements.floating.style;
|
|
242
|
+
contentStyle.setProperty("--gui-popper-available-width", `${availableWidth}px`);
|
|
243
|
+
contentStyle.setProperty("--gui-popper-available-height", `${availableHeight}px`);
|
|
244
|
+
contentStyle.setProperty("--gui-popper-anchor-width", `${anchorWidth}px`);
|
|
245
|
+
contentStyle.setProperty("--gui-popper-anchor-height", `${anchorHeight}px`);
|
|
232
246
|
}
|
|
233
247
|
}), transformOriginMiddleware({
|
|
234
248
|
arrowHeight: arrowSize,
|
|
235
249
|
arrowWidth: arrowSize
|
|
236
|
-
})].filter(Boolean)
|
|
237
|
-
let floating = (0,
|
|
250
|
+
})].filter(Boolean);
|
|
251
|
+
let floating = (0, import_floating2.useFloating)({
|
|
238
252
|
open: isOpen,
|
|
239
253
|
strategy,
|
|
240
254
|
placement,
|
|
241
|
-
sameScrollView:
|
|
242
|
-
|
|
243
|
-
whileElementsMounted: isOpen ? tamaguiAutoUpdate : void 0,
|
|
255
|
+
sameScrollView: false,
|
|
256
|
+
whileElementsMounted: !isOpen ? void 0 : guiAutoUpdate,
|
|
244
257
|
platform: disableRTL ?? setupOptions.disableRTL ? {
|
|
245
|
-
...
|
|
258
|
+
...import_floating2.platform,
|
|
246
259
|
isRTL(element) {
|
|
247
|
-
return
|
|
260
|
+
return false;
|
|
248
261
|
}
|
|
249
|
-
} :
|
|
262
|
+
} : import_floating2.platform,
|
|
250
263
|
middleware: middlewareRef.current
|
|
251
264
|
});
|
|
252
265
|
floating = React.useMemo(() => {
|
|
253
266
|
const og = floating.getFloatingProps;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
267
|
+
if (resize && og) floating.getFloatingProps = props2 => {
|
|
268
|
+
return og({
|
|
269
|
+
...props2,
|
|
270
|
+
style: {
|
|
271
|
+
...props2.style,
|
|
272
|
+
...floatingStyle.current
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
return floating;
|
|
261
277
|
}, [floating, resize ? JSON.stringify(resize) : null]);
|
|
262
278
|
const {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
279
|
+
middlewareData
|
|
280
|
+
} = floating;
|
|
281
|
+
const popperContext = React.useMemo(() => {
|
|
282
|
+
return {
|
|
266
283
|
size,
|
|
267
284
|
arrowRef: setArrow,
|
|
268
285
|
arrowStyle: middlewareData.arrow,
|
|
@@ -271,323 +288,338 @@ function Popper(props) {
|
|
|
271
288
|
transformOrigin: middlewareData.transformOrigin,
|
|
272
289
|
open: !!open,
|
|
273
290
|
...floating
|
|
274
|
-
}
|
|
291
|
+
};
|
|
292
|
+
}, [open, size, floating, JSON.stringify(middlewareData.arrow || null), JSON.stringify(middlewareData.transformOrigin || null)]);
|
|
275
293
|
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperProvider, {
|
|
276
294
|
scope,
|
|
277
295
|
...popperContext,
|
|
278
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
296
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_floating.FloatingOverrideContext.Provider, {
|
|
279
297
|
value: null,
|
|
280
298
|
children
|
|
281
299
|
})
|
|
282
300
|
});
|
|
283
301
|
}
|
|
284
|
-
const PopperAnchor =
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
// web handles this onMouseEnter below so it can support multiple targets + hovering
|
|
321
|
-
shouldHandleInHover ? void 0 : safeSetReference);
|
|
322
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_core.View, {
|
|
323
|
-
...rest,
|
|
324
|
-
...refProps,
|
|
325
|
-
ref: composedRefs,
|
|
326
|
-
...(shouldHandleInHover && {
|
|
327
|
-
// scoped poppers with multiple triggers: set the reference on
|
|
328
|
-
// mouseEnter so floating-ui positions relative to the hovered
|
|
329
|
-
// trigger, not the last one rendered.
|
|
330
|
-
//
|
|
331
|
-
// flushSync is critical here: without it, setReference batches
|
|
332
|
-
// with React's async state updates and the arrow/content position
|
|
333
|
-
// computes against the OLD reference element. this causes the
|
|
334
|
-
// arrow to flash at x=0 (top-left) during trigger switches.
|
|
335
|
-
// flushSync forces synchronous commit so update() below reads
|
|
336
|
-
// the correct reference element immediately.
|
|
337
|
-
onMouseEnter: e => {
|
|
338
|
-
const el = e.currentTarget ?? ref.current;
|
|
339
|
-
if (el instanceof HTMLElement) {
|
|
340
|
-
if ((0, import_react_dom.flushSync)(() => refs.setReference(el)), update(), !refProps) return;
|
|
341
|
-
refProps.onPointerEnter?.(e), context.onHoverReference?.(e.nativeEvent);
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
onMouseLeave: e => {
|
|
345
|
-
context.onLeaveReference?.(), refProps?.onMouseLeave?.(e);
|
|
346
|
-
}
|
|
347
|
-
})
|
|
302
|
+
const PopperAnchor = import_stacks.YStack.styleable(function PopperAnchor2(props, forwardedRef) {
|
|
303
|
+
const {
|
|
304
|
+
virtualRef,
|
|
305
|
+
scope,
|
|
306
|
+
...rest
|
|
307
|
+
} = props;
|
|
308
|
+
const context = usePopperContextSlow(scope);
|
|
309
|
+
const {
|
|
310
|
+
getReferenceProps,
|
|
311
|
+
refs,
|
|
312
|
+
update
|
|
313
|
+
} = context;
|
|
314
|
+
const ref = React.useRef(null);
|
|
315
|
+
const triggerId = React.useId();
|
|
316
|
+
React.useEffect(() => {
|
|
317
|
+
if (!scope || !context.triggerElements || !ref.current) return;
|
|
318
|
+
if (!(ref.current instanceof Element)) return;
|
|
319
|
+
const el = ref.current;
|
|
320
|
+
context.triggerElements.add(triggerId, el);
|
|
321
|
+
return () => {
|
|
322
|
+
context.triggerElements?.delete(triggerId);
|
|
323
|
+
};
|
|
324
|
+
}, [scope, triggerId, context.triggerElements]);
|
|
325
|
+
React.useEffect(() => {
|
|
326
|
+
if (virtualRef) {
|
|
327
|
+
refs.setReference(virtualRef.current);
|
|
328
|
+
update();
|
|
329
|
+
}
|
|
330
|
+
}, [virtualRef]);
|
|
331
|
+
const refProps = getReferenceProps?.({
|
|
332
|
+
...rest,
|
|
333
|
+
ref
|
|
334
|
+
}) || null;
|
|
335
|
+
const safeSetReference = React.useCallback(node => {
|
|
336
|
+
(0, import_start_transition.startTransition)(() => {
|
|
337
|
+
refs.setReference(node);
|
|
348
338
|
});
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
339
|
+
},
|
|
340
|
+
// it was refs.setRefernce but its stable and refs is undefined on server
|
|
341
|
+
[refs]);
|
|
342
|
+
const shouldHandleInHover = import_constants.isWeb && scope;
|
|
343
|
+
const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref,
|
|
344
|
+
// web handles this onMouseEnter below so it can support multiple targets + hovering
|
|
345
|
+
shouldHandleInHover ? void 0 : safeSetReference);
|
|
346
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
|
|
347
|
+
...rest,
|
|
348
|
+
...refProps,
|
|
349
|
+
ref: composedRefs,
|
|
350
|
+
...(shouldHandleInHover && {
|
|
351
|
+
onMouseEnter: e => {
|
|
352
|
+
const el = e.currentTarget ?? ref.current;
|
|
353
|
+
if (el instanceof HTMLElement) {
|
|
354
|
+
(0, import_react_dom.flushSync)(() => refs.setReference(el));
|
|
355
|
+
update();
|
|
356
|
+
if (!refProps) return;
|
|
357
|
+
refProps.onPointerEnter?.(e);
|
|
358
|
+
context.onHoverReference?.(e.nativeEvent);
|
|
359
|
+
}
|
|
355
360
|
},
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
361
|
+
onMouseLeave: e => {
|
|
362
|
+
context.onLeaveReference?.();
|
|
363
|
+
refProps?.onMouseLeave?.(e);
|
|
364
|
+
}
|
|
365
|
+
})
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
const PopperContentFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
369
|
+
name: "PopperContent",
|
|
370
|
+
variants: {
|
|
371
|
+
unstyled: {
|
|
372
|
+
true: {}
|
|
373
|
+
},
|
|
374
|
+
size: {
|
|
375
|
+
"...size": (val, {
|
|
376
|
+
tokens
|
|
377
|
+
}) => {
|
|
378
|
+
return {
|
|
360
379
|
padding: tokens.space[val],
|
|
361
380
|
borderRadius: tokens.radius[val]
|
|
362
|
-
}
|
|
381
|
+
};
|
|
363
382
|
}
|
|
364
383
|
}
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
const PopperContent = React.forwardRef(function PopperContent2(props, forwardedRef) {
|
|
387
|
+
const {
|
|
388
|
+
scope,
|
|
389
|
+
animatePosition,
|
|
390
|
+
enableAnimationForPositionChange,
|
|
391
|
+
children,
|
|
392
|
+
passThrough,
|
|
393
|
+
unstyled,
|
|
394
|
+
...rest
|
|
395
|
+
} = props;
|
|
396
|
+
const animatePos = animatePosition ?? enableAnimationForPositionChange;
|
|
397
|
+
const context = usePopperContext(scope);
|
|
398
|
+
const {
|
|
399
|
+
strategy,
|
|
400
|
+
placement,
|
|
401
|
+
refs,
|
|
402
|
+
x,
|
|
403
|
+
y,
|
|
404
|
+
getFloatingProps,
|
|
405
|
+
size,
|
|
406
|
+
isPositioned,
|
|
407
|
+
transformOrigin,
|
|
408
|
+
update
|
|
409
|
+
} = context;
|
|
410
|
+
const updateRef = React.useRef(update);
|
|
411
|
+
updateRef.current = update;
|
|
412
|
+
const lastNodeRef = React.useRef(null);
|
|
413
|
+
const safeSetFloating = React.useCallback(node => {
|
|
414
|
+
const isNewNode = node !== lastNodeRef.current;
|
|
415
|
+
if (node) {
|
|
416
|
+
lastNodeRef.current = node;
|
|
417
|
+
refs.setFloating(node);
|
|
418
|
+
if (!isNewNode) updateRef.current?.();
|
|
419
|
+
}
|
|
420
|
+
}, [refs.setFloating]);
|
|
421
|
+
React.useEffect(() => {
|
|
422
|
+
return () => {
|
|
398
423
|
const ourNode = lastNodeRef.current;
|
|
399
|
-
ourNode && refs.floating.current === ourNode
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
424
|
+
if (ourNode && refs.floating.current === ourNode) refs.setFloating(null);
|
|
425
|
+
lastNodeRef.current = null;
|
|
426
|
+
};
|
|
427
|
+
}, []);
|
|
428
|
+
const contentRefs = (0, import_compose_refs.useComposedRefs)(safeSetFloating, forwardedRef);
|
|
429
|
+
const [needsMeasure, setNeedsMeasure] = React.useState(animatePos);
|
|
430
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
431
|
+
if (needsMeasure && x && y) setNeedsMeasure(false);
|
|
432
|
+
}, [needsMeasure, animatePos, x, y]);
|
|
433
|
+
const hasBeenPositioned = React.useRef(false);
|
|
434
|
+
const lastGoodPosition = React.useRef({
|
|
435
|
+
x: 0,
|
|
436
|
+
y: 0
|
|
437
|
+
});
|
|
438
|
+
if (x !== 0 || y !== 0) {
|
|
439
|
+
lastGoodPosition.current = {
|
|
412
440
|
x,
|
|
413
441
|
y
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
442
|
+
};
|
|
443
|
+
if (isPositioned) hasBeenPositioned.current = true;
|
|
444
|
+
}
|
|
445
|
+
const brieflyZero = hasBeenPositioned.current && x === 0 && y === 0;
|
|
446
|
+
const effectiveX = brieflyZero ? lastGoodPosition.current.x : x;
|
|
447
|
+
const effectiveY = brieflyZero ? lastGoodPosition.current.y : y;
|
|
448
|
+
const hide = !hasBeenPositioned.current && effectiveX === 0 && effectiveY === 0;
|
|
449
|
+
const disableAnimationProp = animatePos === "even-when-repositioning" ? needsMeasure : !hasBeenPositioned.current && !isPositioned || needsMeasure;
|
|
450
|
+
const [disableAnimation, setDisableAnimation] = React.useState(disableAnimationProp);
|
|
451
|
+
React.useEffect(() => {
|
|
452
|
+
setDisableAnimation(disableAnimationProp);
|
|
453
|
+
}, [disableAnimationProp]);
|
|
454
|
+
const frameProps = {
|
|
455
|
+
ref: contentRefs,
|
|
456
|
+
...(hide ? {} : {
|
|
457
|
+
x: effectiveX || 0,
|
|
458
|
+
y: effectiveY || 0
|
|
459
|
+
}),
|
|
460
|
+
top: 0,
|
|
461
|
+
left: 0,
|
|
462
|
+
position: strategy,
|
|
463
|
+
opacity: hide ? 0 : 1,
|
|
464
|
+
...(animatePos && {
|
|
465
|
+
transition: rest.transition,
|
|
466
|
+
animateOnly: disableAnimation ? [] : rest.animateOnly,
|
|
467
|
+
animatePresence: false
|
|
468
|
+
})
|
|
469
|
+
};
|
|
470
|
+
const {
|
|
471
|
+
style,
|
|
472
|
+
...floatingProps
|
|
473
|
+
} = getFloatingProps ? getFloatingProps(frameProps) : frameProps;
|
|
474
|
+
const transformOriginStyle = import_constants.isWeb && transformOrigin ? {
|
|
475
|
+
transformOrigin: `${transformOrigin.x} ${transformOrigin.y}`
|
|
476
|
+
} : void 0;
|
|
477
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.LayoutMeasurementController, {
|
|
478
|
+
disable: !context.open,
|
|
479
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
|
|
480
|
+
passThrough,
|
|
481
|
+
ref: contentRefs,
|
|
482
|
+
direction: rest.direction,
|
|
483
|
+
...(passThrough ? null : floatingProps),
|
|
484
|
+
...(!passThrough && animatePos && {
|
|
485
|
+
"data-popper-animate-position": "true"
|
|
486
|
+
}),
|
|
487
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperContentFrame, {
|
|
454
488
|
passThrough,
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
489
|
+
unstyled,
|
|
490
|
+
...(!passThrough && {
|
|
491
|
+
"data-placement": placement,
|
|
492
|
+
"data-strategy": strategy,
|
|
493
|
+
size,
|
|
494
|
+
...style,
|
|
495
|
+
...transformOriginStyle,
|
|
496
|
+
...rest
|
|
460
497
|
}),
|
|
461
|
-
children
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
})
|
|
475
|
-
});
|
|
476
|
-
}),
|
|
477
|
-
PopperArrowFrame = (0, import_gui_core.styled)(import_gui_stacks.YStack, {
|
|
478
|
-
name: "PopperArrow",
|
|
479
|
-
variants: {
|
|
480
|
-
unstyled: {
|
|
481
|
-
false: {
|
|
482
|
-
borderColor: "$borderColor",
|
|
483
|
-
backgroundColor: "$background",
|
|
484
|
-
position: "relative"
|
|
485
|
-
}
|
|
498
|
+
children
|
|
499
|
+
}, "popper-content-frame")
|
|
500
|
+
})
|
|
501
|
+
});
|
|
502
|
+
});
|
|
503
|
+
const PopperArrowFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
504
|
+
name: "PopperArrow",
|
|
505
|
+
variants: {
|
|
506
|
+
unstyled: {
|
|
507
|
+
false: {
|
|
508
|
+
borderColor: "$borderColor",
|
|
509
|
+
backgroundColor: "$background",
|
|
510
|
+
position: "relative"
|
|
486
511
|
}
|
|
487
|
-
},
|
|
488
|
-
defaultVariants: {
|
|
489
|
-
unstyled: process.env.HANZO_GUI_HEADLESS === "1"
|
|
490
512
|
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
513
|
+
},
|
|
514
|
+
defaultVariants: {
|
|
515
|
+
unstyled: process.env.GUI_HEADLESS === "1"
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
const PopperArrowOuterFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
519
|
+
name: "PopperArrowOuter",
|
|
520
|
+
variants: {
|
|
521
|
+
unstyled: {
|
|
522
|
+
false: {
|
|
523
|
+
position: "absolute",
|
|
524
|
+
zIndex: 1e6,
|
|
525
|
+
pointerEvents: "none",
|
|
526
|
+
overflow: "hidden",
|
|
527
|
+
alignItems: "center",
|
|
528
|
+
justifyContent: "center"
|
|
504
529
|
}
|
|
505
|
-
},
|
|
506
|
-
defaultVariants: {
|
|
507
|
-
unstyled: process.env.HANZO_GUI_HEADLESS === "1"
|
|
508
530
|
}
|
|
509
|
-
}),
|
|
510
|
-
opposites = {
|
|
511
|
-
top: "bottom",
|
|
512
|
-
right: "left",
|
|
513
|
-
bottom: "top",
|
|
514
|
-
left: "right"
|
|
515
531
|
},
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
532
|
+
defaultVariants: {
|
|
533
|
+
unstyled: process.env.GUI_HEADLESS === "1"
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
const opposites = {
|
|
537
|
+
top: "bottom",
|
|
538
|
+
right: "left",
|
|
539
|
+
bottom: "top",
|
|
540
|
+
left: "right"
|
|
541
|
+
};
|
|
542
|
+
const PopperArrow = React.forwardRef(function PopperArrow2(propsIn, forwardedRef) {
|
|
543
|
+
const {
|
|
544
|
+
scope,
|
|
545
|
+
animatePosition,
|
|
546
|
+
transition,
|
|
547
|
+
...rest
|
|
548
|
+
} = propsIn;
|
|
549
|
+
const {
|
|
550
|
+
offset,
|
|
551
|
+
size: sizeProp,
|
|
552
|
+
borderWidth = 0,
|
|
553
|
+
...arrowProps
|
|
554
|
+
} = rest;
|
|
555
|
+
const context = usePopperContext(scope);
|
|
556
|
+
const sizeVal = typeof sizeProp === "number" ? sizeProp : (0, import_core.getVariableValue)((0, import_get_token.getSpace)(sizeProp ?? context.size, {
|
|
557
|
+
shift: -2,
|
|
558
|
+
bounds: [2]
|
|
559
|
+
}));
|
|
560
|
+
const size = Math.max(0, +sizeVal);
|
|
561
|
+
const {
|
|
562
|
+
placement
|
|
563
|
+
} = context;
|
|
564
|
+
const refs = (0, import_compose_refs.useComposedRefs)(context.arrowRef, forwardedRef);
|
|
565
|
+
const x = context.arrowStyle?.x || 0;
|
|
566
|
+
const y = context.arrowStyle?.y || 0;
|
|
567
|
+
const arrowPositioned = context.arrowStyle != null;
|
|
568
|
+
const primaryPlacement = placement ? placement.split("-")[0] : "top";
|
|
569
|
+
const arrowStyle = {
|
|
570
|
+
x,
|
|
571
|
+
y,
|
|
572
|
+
width: size,
|
|
573
|
+
height: size
|
|
574
|
+
};
|
|
575
|
+
const innerArrowStyle = {};
|
|
576
|
+
const isVertical = primaryPlacement === "bottom" || primaryPlacement === "top";
|
|
577
|
+
if (primaryPlacement) {
|
|
578
|
+
arrowStyle[isVertical ? "width" : "height"] = size * 2;
|
|
579
|
+
const oppSide = opposites[primaryPlacement];
|
|
580
|
+
if (oppSide) {
|
|
581
|
+
arrowStyle[oppSide] = -size;
|
|
582
|
+
innerArrowStyle[oppSide] = size / 2;
|
|
557
583
|
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
584
|
+
if (oppSide === "top" || oppSide === "bottom") arrowStyle.left = 0;
|
|
585
|
+
if (oppSide === "left" || oppSide === "right") arrowStyle.top = 0;
|
|
586
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
587
|
+
context.onArrowSize?.(size);
|
|
588
|
+
}, [size, context.onArrowSize]);
|
|
589
|
+
}
|
|
590
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperArrowOuterFrame, {
|
|
591
|
+
ref: refs,
|
|
592
|
+
...arrowStyle,
|
|
593
|
+
...(!arrowPositioned && {
|
|
594
|
+
opacity: 0
|
|
595
|
+
}),
|
|
596
|
+
...(animatePosition && {
|
|
597
|
+
transition,
|
|
598
|
+
animateOnly: ["transform"],
|
|
599
|
+
animatePresence: false
|
|
600
|
+
}),
|
|
601
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(PopperArrowFrame, {
|
|
602
|
+
width: size,
|
|
603
|
+
height: size,
|
|
604
|
+
...arrowProps,
|
|
605
|
+
...innerArrowStyle,
|
|
606
|
+
rotate: "45deg",
|
|
607
|
+
...(primaryPlacement === "bottom" && {
|
|
608
|
+
borderLeftWidth: borderWidth,
|
|
609
|
+
borderTopWidth: borderWidth
|
|
563
610
|
}),
|
|
564
|
-
...(
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
animatePresence: !1
|
|
611
|
+
...(primaryPlacement === "top" && {
|
|
612
|
+
borderBottomWidth: borderWidth,
|
|
613
|
+
borderRightWidth: borderWidth
|
|
568
614
|
}),
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
borderLeftWidth: borderWidth,
|
|
577
|
-
borderTopWidth: borderWidth
|
|
578
|
-
}),
|
|
579
|
-
...(primaryPlacement === "top" && {
|
|
580
|
-
borderBottomWidth: borderWidth,
|
|
581
|
-
borderRightWidth: borderWidth
|
|
582
|
-
}),
|
|
583
|
-
...(primaryPlacement === "right" && {
|
|
584
|
-
borderLeftWidth: borderWidth,
|
|
585
|
-
borderBottomWidth: borderWidth
|
|
586
|
-
}),
|
|
587
|
-
...(primaryPlacement === "left" && {
|
|
588
|
-
borderTopWidth: borderWidth,
|
|
589
|
-
borderRightWidth: borderWidth
|
|
590
|
-
})
|
|
615
|
+
...(primaryPlacement === "right" && {
|
|
616
|
+
borderLeftWidth: borderWidth,
|
|
617
|
+
borderBottomWidth: borderWidth
|
|
618
|
+
}),
|
|
619
|
+
...(primaryPlacement === "left" && {
|
|
620
|
+
borderTopWidth: borderWidth,
|
|
621
|
+
borderRightWidth: borderWidth
|
|
591
622
|
})
|
|
592
|
-
})
|
|
593
|
-
});
|
|
623
|
+
})
|
|
624
|
+
});
|
|
625
|
+
});
|