lizaui 9.0.13 → 9.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/button/index.es.js +1 -1
  2. package/dist/calendar/index.es.js +1 -1
  3. package/dist/checkbox/index.es.js +1 -1
  4. package/dist/chunks/{button-CA3Y2GZ1.js → button-B0fpJrMg.js} +2 -2
  5. package/dist/chunks/{button-CA3Y2GZ1.js.map → button-B0fpJrMg.js.map} +1 -1
  6. package/dist/chunks/{checkbox-qzZKMLRN.js → checkbox-C1Sssumg.js} +2 -2
  7. package/dist/chunks/{checkbox-qzZKMLRN.js.map → checkbox-C1Sssumg.js.map} +1 -1
  8. package/dist/chunks/{floating-ui.dom-N5ROFCJy.js → floating-ui.dom-B9hvXzxg.js} +11 -1
  9. package/dist/chunks/{floating-ui.dom-N5ROFCJy.js.map → floating-ui.dom-B9hvXzxg.js.map} +1 -1
  10. package/dist/chunks/{floating-ui.dom-NqZWWqNg.js → floating-ui.dom-DRSBqyFN.js} +14 -4
  11. package/dist/chunks/{floating-ui.dom-NqZWWqNg.js.map → floating-ui.dom-DRSBqyFN.js.map} +1 -1
  12. package/dist/chunks/floating-ui.react-dom-BUZLdP4-.js +294 -0
  13. package/dist/chunks/floating-ui.react-dom-BUZLdP4-.js.map +1 -0
  14. package/dist/chunks/floating-ui.react-dom-CI1b2uK3.js +310 -0
  15. package/dist/chunks/floating-ui.react-dom-CI1b2uK3.js.map +1 -0
  16. package/dist/chunks/{index-DiC9dI6_.js → index-B4RTH1-D.js} +4 -4
  17. package/dist/chunks/{index-DiC9dI6_.js.map → index-B4RTH1-D.js.map} +1 -1
  18. package/dist/chunks/{scroll-area-CgJodNZ_.js → scroll-area-B-5YmafW.js} +27 -27
  19. package/dist/chunks/{scroll-area-CgJodNZ_.js.map → scroll-area-B-5YmafW.js.map} +1 -1
  20. package/dist/chunks/{scroll-area-BcM0NCEM.js → scroll-area-WNAy-5-i.js} +3 -3
  21. package/dist/chunks/{scroll-area-BcM0NCEM.js.map → scroll-area-WNAy-5-i.js.map} +1 -1
  22. package/dist/chunks/{select-DyihZY-4.js → select-C9BYUpJm.js} +439 -83
  23. package/dist/chunks/select-C9BYUpJm.js.map +1 -0
  24. package/dist/chunks/{select-DaKy-WhC.js → select-CLIZOVIj.js} +366 -10
  25. package/dist/chunks/select-CLIZOVIj.js.map +1 -0
  26. package/dist/chunks/{textarea-By2Vv44z.js → textarea-D2_KC-J4.js} +587 -36
  27. package/dist/chunks/textarea-D2_KC-J4.js.map +1 -0
  28. package/dist/chunks/{textarea-ClJsk9Gp.js → textarea-_HQpXiCX.js} +586 -35
  29. package/dist/chunks/textarea-_HQpXiCX.js.map +1 -0
  30. package/dist/chunks/tooltip-DgenLCkC.js +1921 -0
  31. package/dist/chunks/tooltip-DgenLCkC.js.map +1 -0
  32. package/dist/chunks/tooltip-nCIpADfj.js +1937 -0
  33. package/dist/chunks/tooltip-nCIpADfj.js.map +1 -0
  34. package/dist/components/tooltip/tooltip.d.ts +1 -1
  35. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  36. package/dist/divider/index.es.js +1 -1
  37. package/dist/modal/index.es.js +1 -1
  38. package/dist/pagination/index.cjs.js +2 -2
  39. package/dist/pagination/index.es.js +3 -3
  40. package/dist/phone-input/index.cjs.js +2 -2
  41. package/dist/phone-input/index.es.js +3 -3
  42. package/dist/select-input/index.cjs.js +1 -1
  43. package/dist/select-input/index.es.js +2 -2
  44. package/dist/table/index.cjs.js +1 -1
  45. package/dist/table/index.es.js +2 -2
  46. package/dist/time-input/index.cjs.js +1 -1
  47. package/dist/time-input/index.es.js +2 -2
  48. package/dist/tooltip/index.cjs.js +1 -1
  49. package/dist/tooltip/index.es.js +1 -1
  50. package/dist/ui/index.cjs.js +290 -292
  51. package/dist/ui/index.cjs.js.map +1 -1
  52. package/dist/ui/index.es.js +180 -182
  53. package/dist/ui/index.es.js.map +1 -1
  54. package/package.json +2 -2
  55. package/dist/chunks/index-CuySPbdY.js +0 -559
  56. package/dist/chunks/index-CuySPbdY.js.map +0 -1
  57. package/dist/chunks/index-DBDBh58Q.js +0 -575
  58. package/dist/chunks/index-DBDBh58Q.js.map +0 -1
  59. package/dist/chunks/index-DNSql2gU.js +0 -662
  60. package/dist/chunks/index-DNSql2gU.js.map +0 -1
  61. package/dist/chunks/index-DlZi5TkN.js +0 -646
  62. package/dist/chunks/index-DlZi5TkN.js.map +0 -1
  63. package/dist/chunks/select-DaKy-WhC.js.map +0 -1
  64. package/dist/chunks/select-DyihZY-4.js.map +0 -1
  65. package/dist/chunks/textarea-By2Vv44z.js.map +0 -1
  66. package/dist/chunks/textarea-ClJsk9Gp.js.map +0 -1
  67. package/dist/chunks/tooltip-D4UvkD2G.js +0 -525
  68. package/dist/chunks/tooltip-D4UvkD2G.js.map +0 -1
  69. package/dist/chunks/tooltip-WGeoFpGx.js +0 -541
  70. package/dist/chunks/tooltip-WGeoFpGx.js.map +0 -1
@@ -1,646 +0,0 @@
1
- import * as React from "react";
2
- import { useLayoutEffect } from "react";
3
- import { c as computePosition, o as offset$1, s as shift$1, f as flip$1, a as size$1, h as hide$1, l as limitShift$1, b as arrow$2, d as autoUpdate } from "./floating-ui.dom-NqZWWqNg.js";
4
- import * as ReactDOM from "react-dom";
5
- import { P as Primitive, g as useLayoutEffect2, c as createContextScope, f as useCallbackRef } from "./index-CuySPbdY.js";
6
- import { jsx } from "react/jsx-runtime";
7
- import { u as useComposedRefs } from "./index-DiC9dI6_.js";
8
- var isClient = typeof document !== "undefined";
9
- var noop = function noop2() {
10
- };
11
- var index = isClient ? useLayoutEffect : noop;
12
- function deepEqual(a, b) {
13
- if (a === b) {
14
- return true;
15
- }
16
- if (typeof a !== typeof b) {
17
- return false;
18
- }
19
- if (typeof a === "function" && a.toString() === b.toString()) {
20
- return true;
21
- }
22
- let length;
23
- let i;
24
- let keys;
25
- if (a && b && typeof a === "object") {
26
- if (Array.isArray(a)) {
27
- length = a.length;
28
- if (length !== b.length) return false;
29
- for (i = length; i-- !== 0; ) {
30
- if (!deepEqual(a[i], b[i])) {
31
- return false;
32
- }
33
- }
34
- return true;
35
- }
36
- keys = Object.keys(a);
37
- length = keys.length;
38
- if (length !== Object.keys(b).length) {
39
- return false;
40
- }
41
- for (i = length; i-- !== 0; ) {
42
- if (!{}.hasOwnProperty.call(b, keys[i])) {
43
- return false;
44
- }
45
- }
46
- for (i = length; i-- !== 0; ) {
47
- const key = keys[i];
48
- if (key === "_owner" && a.$$typeof) {
49
- continue;
50
- }
51
- if (!deepEqual(a[key], b[key])) {
52
- return false;
53
- }
54
- }
55
- return true;
56
- }
57
- return a !== a && b !== b;
58
- }
59
- function getDPR(element) {
60
- if (typeof window === "undefined") {
61
- return 1;
62
- }
63
- const win = element.ownerDocument.defaultView || window;
64
- return win.devicePixelRatio || 1;
65
- }
66
- function roundByDPR(element, value) {
67
- const dpr = getDPR(element);
68
- return Math.round(value * dpr) / dpr;
69
- }
70
- function useLatestRef(value) {
71
- const ref = React.useRef(value);
72
- index(() => {
73
- ref.current = value;
74
- });
75
- return ref;
76
- }
77
- function useFloating(options) {
78
- if (options === void 0) {
79
- options = {};
80
- }
81
- const {
82
- placement = "bottom",
83
- strategy = "absolute",
84
- middleware = [],
85
- platform,
86
- elements: {
87
- reference: externalReference,
88
- floating: externalFloating
89
- } = {},
90
- transform = true,
91
- whileElementsMounted,
92
- open
93
- } = options;
94
- const [data, setData] = React.useState({
95
- x: 0,
96
- y: 0,
97
- strategy,
98
- placement,
99
- middlewareData: {},
100
- isPositioned: false
101
- });
102
- const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);
103
- if (!deepEqual(latestMiddleware, middleware)) {
104
- setLatestMiddleware(middleware);
105
- }
106
- const [_reference, _setReference] = React.useState(null);
107
- const [_floating, _setFloating] = React.useState(null);
108
- const setReference = React.useCallback((node) => {
109
- if (node !== referenceRef.current) {
110
- referenceRef.current = node;
111
- _setReference(node);
112
- }
113
- }, []);
114
- const setFloating = React.useCallback((node) => {
115
- if (node !== floatingRef.current) {
116
- floatingRef.current = node;
117
- _setFloating(node);
118
- }
119
- }, []);
120
- const referenceEl = externalReference || _reference;
121
- const floatingEl = externalFloating || _floating;
122
- const referenceRef = React.useRef(null);
123
- const floatingRef = React.useRef(null);
124
- const dataRef = React.useRef(data);
125
- const hasWhileElementsMounted = whileElementsMounted != null;
126
- const whileElementsMountedRef = useLatestRef(whileElementsMounted);
127
- const platformRef = useLatestRef(platform);
128
- const openRef = useLatestRef(open);
129
- const update = React.useCallback(() => {
130
- if (!referenceRef.current || !floatingRef.current) {
131
- return;
132
- }
133
- const config = {
134
- placement,
135
- strategy,
136
- middleware: latestMiddleware
137
- };
138
- if (platformRef.current) {
139
- config.platform = platformRef.current;
140
- }
141
- computePosition(referenceRef.current, floatingRef.current, config).then((data2) => {
142
- const fullData = {
143
- ...data2,
144
- // The floating element's position may be recomputed while it's closed
145
- // but still mounted (such as when transitioning out). To ensure
146
- // `isPositioned` will be `false` initially on the next open, avoid
147
- // setting it to `true` when `open === false` (must be specified).
148
- isPositioned: openRef.current !== false
149
- };
150
- if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
151
- dataRef.current = fullData;
152
- ReactDOM.flushSync(() => {
153
- setData(fullData);
154
- });
155
- }
156
- });
157
- }, [latestMiddleware, placement, strategy, platformRef, openRef]);
158
- index(() => {
159
- if (open === false && dataRef.current.isPositioned) {
160
- dataRef.current.isPositioned = false;
161
- setData((data2) => ({
162
- ...data2,
163
- isPositioned: false
164
- }));
165
- }
166
- }, [open]);
167
- const isMountedRef = React.useRef(false);
168
- index(() => {
169
- isMountedRef.current = true;
170
- return () => {
171
- isMountedRef.current = false;
172
- };
173
- }, []);
174
- index(() => {
175
- if (referenceEl) referenceRef.current = referenceEl;
176
- if (floatingEl) floatingRef.current = floatingEl;
177
- if (referenceEl && floatingEl) {
178
- if (whileElementsMountedRef.current) {
179
- return whileElementsMountedRef.current(referenceEl, floatingEl, update);
180
- }
181
- update();
182
- }
183
- }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
184
- const refs = React.useMemo(() => ({
185
- reference: referenceRef,
186
- floating: floatingRef,
187
- setReference,
188
- setFloating
189
- }), [setReference, setFloating]);
190
- const elements = React.useMemo(() => ({
191
- reference: referenceEl,
192
- floating: floatingEl
193
- }), [referenceEl, floatingEl]);
194
- const floatingStyles = React.useMemo(() => {
195
- const initialStyles = {
196
- position: strategy,
197
- left: 0,
198
- top: 0
199
- };
200
- if (!elements.floating) {
201
- return initialStyles;
202
- }
203
- const x = roundByDPR(elements.floating, data.x);
204
- const y = roundByDPR(elements.floating, data.y);
205
- if (transform) {
206
- return {
207
- ...initialStyles,
208
- transform: "translate(" + x + "px, " + y + "px)",
209
- ...getDPR(elements.floating) >= 1.5 && {
210
- willChange: "transform"
211
- }
212
- };
213
- }
214
- return {
215
- position: strategy,
216
- left: x,
217
- top: y
218
- };
219
- }, [strategy, transform, elements.floating, data.x, data.y]);
220
- return React.useMemo(() => ({
221
- ...data,
222
- update,
223
- refs,
224
- elements,
225
- floatingStyles
226
- }), [data, update, refs, elements, floatingStyles]);
227
- }
228
- const arrow$1 = (options) => {
229
- function isRef(value) {
230
- return {}.hasOwnProperty.call(value, "current");
231
- }
232
- return {
233
- name: "arrow",
234
- options,
235
- fn(state) {
236
- const {
237
- element,
238
- padding
239
- } = typeof options === "function" ? options(state) : options;
240
- if (element && isRef(element)) {
241
- if (element.current != null) {
242
- return arrow$2({
243
- element: element.current,
244
- padding
245
- }).fn(state);
246
- }
247
- return {};
248
- }
249
- if (element) {
250
- return arrow$2({
251
- element,
252
- padding
253
- }).fn(state);
254
- }
255
- return {};
256
- }
257
- };
258
- };
259
- const offset = (options, deps) => ({
260
- ...offset$1(options),
261
- options: [options, deps]
262
- });
263
- const shift = (options, deps) => ({
264
- ...shift$1(options),
265
- options: [options, deps]
266
- });
267
- const limitShift = (options, deps) => ({
268
- ...limitShift$1(options),
269
- options: [options, deps]
270
- });
271
- const flip = (options, deps) => ({
272
- ...flip$1(options),
273
- options: [options, deps]
274
- });
275
- const size = (options, deps) => ({
276
- ...size$1(options),
277
- options: [options, deps]
278
- });
279
- const hide = (options, deps) => ({
280
- ...hide$1(options),
281
- options: [options, deps]
282
- });
283
- const arrow = (options, deps) => ({
284
- ...arrow$1(options),
285
- options: [options, deps]
286
- });
287
- var NAME$1 = "Arrow";
288
- var Arrow$1 = React.forwardRef((props, forwardedRef) => {
289
- const { children, width = 10, height = 5, ...arrowProps } = props;
290
- return /* @__PURE__ */ jsx(
291
- Primitive.svg,
292
- {
293
- ...arrowProps,
294
- ref: forwardedRef,
295
- width,
296
- height,
297
- viewBox: "0 0 30 10",
298
- preserveAspectRatio: "none",
299
- children: props.asChild ? children : /* @__PURE__ */ jsx("polygon", { points: "0,0 30,0 15,10" })
300
- }
301
- );
302
- });
303
- Arrow$1.displayName = NAME$1;
304
- var Root$1 = Arrow$1;
305
- function useSize(element) {
306
- const [size2, setSize] = React.useState(void 0);
307
- useLayoutEffect2(() => {
308
- if (element) {
309
- setSize({ width: element.offsetWidth, height: element.offsetHeight });
310
- const resizeObserver = new ResizeObserver((entries) => {
311
- if (!Array.isArray(entries)) {
312
- return;
313
- }
314
- if (!entries.length) {
315
- return;
316
- }
317
- const entry = entries[0];
318
- let width;
319
- let height;
320
- if ("borderBoxSize" in entry) {
321
- const borderSizeEntry = entry["borderBoxSize"];
322
- const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
323
- width = borderSize["inlineSize"];
324
- height = borderSize["blockSize"];
325
- } else {
326
- width = element.offsetWidth;
327
- height = element.offsetHeight;
328
- }
329
- setSize({ width, height });
330
- });
331
- resizeObserver.observe(element, { box: "border-box" });
332
- return () => resizeObserver.unobserve(element);
333
- } else {
334
- setSize(void 0);
335
- }
336
- }, [element]);
337
- return size2;
338
- }
339
- var POPPER_NAME = "Popper";
340
- var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
341
- var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
342
- var Popper = (props) => {
343
- const { __scopePopper, children } = props;
344
- const [anchor, setAnchor] = React.useState(null);
345
- return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
346
- };
347
- Popper.displayName = POPPER_NAME;
348
- var ANCHOR_NAME = "PopperAnchor";
349
- var PopperAnchor = React.forwardRef(
350
- (props, forwardedRef) => {
351
- const { __scopePopper, virtualRef, ...anchorProps } = props;
352
- const context = usePopperContext(ANCHOR_NAME, __scopePopper);
353
- const ref = React.useRef(null);
354
- const composedRefs = useComposedRefs(forwardedRef, ref);
355
- const anchorRef = React.useRef(null);
356
- React.useEffect(() => {
357
- const previousAnchor = anchorRef.current;
358
- anchorRef.current = virtualRef?.current || ref.current;
359
- if (previousAnchor !== anchorRef.current) {
360
- context.onAnchorChange(anchorRef.current);
361
- }
362
- });
363
- return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
364
- }
365
- );
366
- PopperAnchor.displayName = ANCHOR_NAME;
367
- var CONTENT_NAME = "PopperContent";
368
- var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
369
- var PopperContent = React.forwardRef(
370
- (props, forwardedRef) => {
371
- const {
372
- __scopePopper,
373
- side = "bottom",
374
- sideOffset = 0,
375
- align = "center",
376
- alignOffset = 0,
377
- arrowPadding = 0,
378
- avoidCollisions = true,
379
- collisionBoundary = [],
380
- collisionPadding: collisionPaddingProp = 0,
381
- sticky = "partial",
382
- hideWhenDetached = false,
383
- updatePositionStrategy = "optimized",
384
- onPlaced,
385
- ...contentProps
386
- } = props;
387
- const context = usePopperContext(CONTENT_NAME, __scopePopper);
388
- const [content, setContent] = React.useState(null);
389
- const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
390
- const [arrow$12, setArrow] = React.useState(null);
391
- const arrowSize = useSize(arrow$12);
392
- const arrowWidth = arrowSize?.width ?? 0;
393
- const arrowHeight = arrowSize?.height ?? 0;
394
- const desiredPlacement = side + (align !== "center" ? "-" + align : "");
395
- const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
396
- const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
397
- const hasExplicitBoundaries = boundary.length > 0;
398
- const detectOverflowOptions = {
399
- padding: collisionPadding,
400
- boundary: boundary.filter(isNotNull),
401
- // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
402
- altBoundary: hasExplicitBoundaries
403
- };
404
- const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
405
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
406
- strategy: "fixed",
407
- placement: desiredPlacement,
408
- whileElementsMounted: (...args) => {
409
- const cleanup = autoUpdate(...args, {
410
- animationFrame: updatePositionStrategy === "always"
411
- });
412
- return cleanup;
413
- },
414
- elements: {
415
- reference: context.anchor
416
- },
417
- middleware: [
418
- offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
419
- avoidCollisions && shift({
420
- mainAxis: true,
421
- crossAxis: false,
422
- limiter: sticky === "partial" ? limitShift() : void 0,
423
- ...detectOverflowOptions
424
- }),
425
- avoidCollisions && flip({ ...detectOverflowOptions }),
426
- size({
427
- ...detectOverflowOptions,
428
- apply: ({ elements, rects, availableWidth, availableHeight }) => {
429
- const { width: anchorWidth, height: anchorHeight } = rects.reference;
430
- const contentStyle = elements.floating.style;
431
- contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
432
- contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
433
- contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
434
- contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
435
- }
436
- }),
437
- arrow$12 && arrow({ element: arrow$12, padding: arrowPadding }),
438
- transformOrigin({ arrowWidth, arrowHeight }),
439
- hideWhenDetached && hide({ strategy: "referenceHidden", ...detectOverflowOptions })
440
- ]
441
- });
442
- const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
443
- const handlePlaced = useCallbackRef(onPlaced);
444
- useLayoutEffect2(() => {
445
- if (isPositioned) {
446
- handlePlaced?.();
447
- }
448
- }, [isPositioned, handlePlaced]);
449
- const arrowX = middlewareData.arrow?.x;
450
- const arrowY = middlewareData.arrow?.y;
451
- const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
452
- const [contentZIndex, setContentZIndex] = React.useState();
453
- useLayoutEffect2(() => {
454
- if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
455
- }, [content]);
456
- return /* @__PURE__ */ jsx(
457
- "div",
458
- {
459
- ref: refs.setFloating,
460
- "data-radix-popper-content-wrapper": "",
461
- style: {
462
- ...floatingStyles,
463
- transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
464
- // keep off the page when measuring
465
- minWidth: "max-content",
466
- zIndex: contentZIndex,
467
- ["--radix-popper-transform-origin"]: [
468
- middlewareData.transformOrigin?.x,
469
- middlewareData.transformOrigin?.y
470
- ].join(" "),
471
- // hide the content if using the hide middleware and should be hidden
472
- // set visibility to hidden and disable pointer events so the UI behaves
473
- // as if the PopperContent isn't there at all
474
- ...middlewareData.hide?.referenceHidden && {
475
- visibility: "hidden",
476
- pointerEvents: "none"
477
- }
478
- },
479
- dir: props.dir,
480
- children: /* @__PURE__ */ jsx(
481
- PopperContentProvider,
482
- {
483
- scope: __scopePopper,
484
- placedSide,
485
- onArrowChange: setArrow,
486
- arrowX,
487
- arrowY,
488
- shouldHideArrow: cannotCenterArrow,
489
- children: /* @__PURE__ */ jsx(
490
- Primitive.div,
491
- {
492
- "data-side": placedSide,
493
- "data-align": placedAlign,
494
- ...contentProps,
495
- ref: composedRefs,
496
- style: {
497
- ...contentProps.style,
498
- // if the PopperContent hasn't been placed yet (not all measurements done)
499
- // we prevent animations so that users's animation don't kick in too early referring wrong sides
500
- animation: !isPositioned ? "none" : void 0
501
- }
502
- }
503
- )
504
- }
505
- )
506
- }
507
- );
508
- }
509
- );
510
- PopperContent.displayName = CONTENT_NAME;
511
- var ARROW_NAME = "PopperArrow";
512
- var OPPOSITE_SIDE = {
513
- top: "bottom",
514
- right: "left",
515
- bottom: "top",
516
- left: "right"
517
- };
518
- var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
519
- const { __scopePopper, ...arrowProps } = props;
520
- const contentContext = useContentContext(ARROW_NAME, __scopePopper);
521
- const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
522
- return (
523
- // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
524
- // doesn't report size as we'd expect on SVG elements.
525
- // it reports their bounding box which is effectively the largest path inside the SVG.
526
- /* @__PURE__ */ jsx(
527
- "span",
528
- {
529
- ref: contentContext.onArrowChange,
530
- style: {
531
- position: "absolute",
532
- left: contentContext.arrowX,
533
- top: contentContext.arrowY,
534
- [baseSide]: 0,
535
- transformOrigin: {
536
- top: "",
537
- right: "0 0",
538
- bottom: "center 0",
539
- left: "100% 0"
540
- }[contentContext.placedSide],
541
- transform: {
542
- top: "translateY(100%)",
543
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
544
- bottom: `rotate(180deg)`,
545
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
546
- }[contentContext.placedSide],
547
- visibility: contentContext.shouldHideArrow ? "hidden" : void 0
548
- },
549
- children: /* @__PURE__ */ jsx(
550
- Root$1,
551
- {
552
- ...arrowProps,
553
- ref: forwardedRef,
554
- style: {
555
- ...arrowProps.style,
556
- // ensures the element can be measured correctly (mostly for if SVG)
557
- display: "block"
558
- }
559
- }
560
- )
561
- }
562
- )
563
- );
564
- });
565
- PopperArrow.displayName = ARROW_NAME;
566
- function isNotNull(value) {
567
- return value !== null;
568
- }
569
- var transformOrigin = (options) => ({
570
- name: "transformOrigin",
571
- options,
572
- fn(data) {
573
- const { placement, rects, middlewareData } = data;
574
- const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
575
- const isArrowHidden = cannotCenterArrow;
576
- const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
577
- const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
578
- const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
579
- const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
580
- const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
581
- const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
582
- let x = "";
583
- let y = "";
584
- if (placedSide === "bottom") {
585
- x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
586
- y = `${-arrowHeight}px`;
587
- } else if (placedSide === "top") {
588
- x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
589
- y = `${rects.floating.height + arrowHeight}px`;
590
- } else if (placedSide === "right") {
591
- x = `${-arrowHeight}px`;
592
- y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
593
- } else if (placedSide === "left") {
594
- x = `${rects.floating.width + arrowHeight}px`;
595
- y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
596
- }
597
- return { data: { x, y } };
598
- }
599
- });
600
- function getSideAndAlignFromPlacement(placement) {
601
- const [side, align = "center"] = placement.split("-");
602
- return [side, align];
603
- }
604
- var Root2 = Popper;
605
- var Anchor = PopperAnchor;
606
- var Content = PopperContent;
607
- var Arrow = PopperArrow;
608
- var VISUALLY_HIDDEN_STYLES = Object.freeze({
609
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
610
- position: "absolute",
611
- border: 0,
612
- width: 1,
613
- height: 1,
614
- padding: 0,
615
- margin: -1,
616
- overflow: "hidden",
617
- clip: "rect(0, 0, 0, 0)",
618
- whiteSpace: "nowrap",
619
- wordWrap: "normal"
620
- });
621
- var NAME = "VisuallyHidden";
622
- var VisuallyHidden = React.forwardRef(
623
- (props, forwardedRef) => {
624
- return /* @__PURE__ */ jsx(
625
- Primitive.span,
626
- {
627
- ...props,
628
- ref: forwardedRef,
629
- style: { ...VISUALLY_HIDDEN_STYLES, ...props.style }
630
- }
631
- );
632
- }
633
- );
634
- VisuallyHidden.displayName = NAME;
635
- var Root = VisuallyHidden;
636
- export {
637
- Anchor as A,
638
- Content as C,
639
- Root2 as R,
640
- VISUALLY_HIDDEN_STYLES as V,
641
- Arrow as a,
642
- Root as b,
643
- createPopperScope as c,
644
- useSize as u
645
- };
646
- //# sourceMappingURL=index-DlZi5TkN.js.map