lizaui 9.0.10 → 9.0.12

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