lizaui 9.0.12 → 9.0.15
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/button/index.es.js +1 -1
- package/dist/calendar/index.es.js +1 -1
- package/dist/checkbox/index.es.js +1 -1
- package/dist/chunks/{button-CA3Y2GZ1.js → button-B0fpJrMg.js} +2 -2
- package/dist/chunks/{button-CA3Y2GZ1.js.map → button-B0fpJrMg.js.map} +1 -1
- package/dist/chunks/{checkbox-qzZKMLRN.js → checkbox-C1Sssumg.js} +2 -2
- package/dist/chunks/{checkbox-qzZKMLRN.js.map → checkbox-C1Sssumg.js.map} +1 -1
- package/dist/chunks/{floating-ui.dom-N5ROFCJy.js → floating-ui.dom-B9hvXzxg.js} +11 -1
- package/dist/chunks/{floating-ui.dom-N5ROFCJy.js.map → floating-ui.dom-B9hvXzxg.js.map} +1 -1
- package/dist/chunks/{floating-ui.dom-NqZWWqNg.js → floating-ui.dom-DRSBqyFN.js} +14 -4
- package/dist/chunks/{floating-ui.dom-NqZWWqNg.js.map → floating-ui.dom-DRSBqyFN.js.map} +1 -1
- package/dist/chunks/floating-ui.react-dom-BUZLdP4-.js +294 -0
- package/dist/chunks/floating-ui.react-dom-BUZLdP4-.js.map +1 -0
- package/dist/chunks/floating-ui.react-dom-CI1b2uK3.js +310 -0
- package/dist/chunks/floating-ui.react-dom-CI1b2uK3.js.map +1 -0
- package/dist/chunks/{index-DiC9dI6_.js → index-B4RTH1-D.js} +4 -4
- package/dist/chunks/{index-DiC9dI6_.js.map → index-B4RTH1-D.js.map} +1 -1
- package/dist/chunks/{scroll-area-BboZbU1u.js → scroll-area-B-5YmafW.js} +27 -27
- package/dist/chunks/{scroll-area-BboZbU1u.js.map → scroll-area-B-5YmafW.js.map} +1 -1
- package/dist/chunks/{scroll-area-DKkgpH-S.js → scroll-area-WNAy-5-i.js} +4 -4
- package/dist/chunks/{scroll-area-DKkgpH-S.js.map → scroll-area-WNAy-5-i.js.map} +1 -1
- package/dist/chunks/{select-MSYUKpRI.js → select-C9BYUpJm.js} +439 -83
- package/dist/chunks/select-C9BYUpJm.js.map +1 -0
- package/dist/chunks/{select-s-z596Y4.js → select-CLIZOVIj.js} +367 -11
- package/dist/chunks/select-CLIZOVIj.js.map +1 -0
- package/dist/chunks/{textarea-By2Vv44z.js → textarea-D2_KC-J4.js} +587 -36
- package/dist/chunks/textarea-D2_KC-J4.js.map +1 -0
- package/dist/chunks/{textarea-ClJsk9Gp.js → textarea-_HQpXiCX.js} +586 -35
- package/dist/chunks/textarea-_HQpXiCX.js.map +1 -0
- package/dist/chunks/tooltip-CjmRm1rv.js +1937 -0
- package/dist/chunks/tooltip-CjmRm1rv.js.map +1 -0
- package/dist/chunks/tooltip-o938-GAz.js +1921 -0
- package/dist/chunks/tooltip-o938-GAz.js.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/divider/index.es.js +1 -1
- package/dist/modal/index.es.js +1 -1
- package/dist/pagination/index.cjs.js +2 -2
- package/dist/pagination/index.es.js +3 -3
- package/dist/phone-input/index.cjs.js +2 -2
- package/dist/phone-input/index.es.js +3 -3
- package/dist/select-input/index.cjs.js +1 -1
- package/dist/select-input/index.es.js +2 -2
- package/dist/table/index.cjs.js +1 -1
- package/dist/table/index.es.js +2 -2
- package/dist/time-input/index.cjs.js +1 -1
- package/dist/time-input/index.es.js +2 -2
- package/dist/tooltip/index.cjs.js +1 -1
- package/dist/tooltip/index.es.js +1 -1
- package/dist/ui/index.cjs.js +290 -292
- package/dist/ui/index.cjs.js.map +1 -1
- package/dist/ui/index.es.js +190 -192
- package/dist/ui/index.es.js.map +1 -1
- package/package.json +1 -2
- package/dist/chunks/index-CuySPbdY.js +0 -559
- package/dist/chunks/index-CuySPbdY.js.map +0 -1
- package/dist/chunks/index-DBDBh58Q.js +0 -575
- package/dist/chunks/index-DBDBh58Q.js.map +0 -1
- package/dist/chunks/index-DNSql2gU.js +0 -662
- package/dist/chunks/index-DNSql2gU.js.map +0 -1
- package/dist/chunks/index-DlZi5TkN.js +0 -646
- package/dist/chunks/index-DlZi5TkN.js.map +0 -1
- package/dist/chunks/select-MSYUKpRI.js.map +0 -1
- package/dist/chunks/select-s-z596Y4.js.map +0 -1
- package/dist/chunks/textarea-By2Vv44z.js.map +0 -1
- package/dist/chunks/textarea-ClJsk9Gp.js.map +0 -1
- package/dist/chunks/tooltip-BP--5Wj2.js +0 -525
- package/dist/chunks/tooltip-BP--5Wj2.js.map +0 -1
- package/dist/chunks/tooltip-KggPQa5m.js +0 -541
- package/dist/chunks/tooltip-KggPQa5m.js.map +0 -1
- package/dist/components/tooltip/tooltip-nice.d.ts +0 -11
- package/dist/components/tooltip/tooltip-nice.d.ts.map +0 -1
- package/dist/components/ui/tooltip.d.ts +0 -8
- package/dist/components/ui/tooltip.d.ts.map +0 -1
|
@@ -3,10 +3,10 @@ import * as React from "react";
|
|
|
3
3
|
import React__default from "react";
|
|
4
4
|
import * as ReactDOM from "react-dom";
|
|
5
5
|
import { c as createLucideIcon, u as useDirection, b as clamp, a as Check, C as ChevronDown } from "./index-BAHiLt0S.js";
|
|
6
|
-
import { c as createContextScope,
|
|
7
|
-
import { u as useComposedRefs,
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { c as createContextScope, P as Primitive, d as useLayoutEffect2, u as useCallbackRef, e as useControllableState, f as useId, g as Portal$1, b as composeEventHandlers, h as hideOthers, i as useFocusGuards, R as ReactRemoveScroll, F as FocusScope, D as DismissableLayer } from "./textarea-_HQpXiCX.js";
|
|
7
|
+
import { u as useComposedRefs, c as createSlot } from "./index-B4RTH1-D.js";
|
|
8
|
+
import { u as useFloating, o as offset, s as shift, f as flip, b as size, a as arrow, h as hide, l as limitShift } from "./floating-ui.react-dom-BUZLdP4-.js";
|
|
9
|
+
import { r as autoUpdate } from "./floating-ui.dom-DRSBqyFN.js";
|
|
10
10
|
import { c as cn } from "./utils-H80jjgLf.js";
|
|
11
11
|
function createCollection(name) {
|
|
12
12
|
const PROVIDER_NAME = name + "CollectionProvider";
|
|
@@ -70,6 +70,327 @@ function createCollection(name) {
|
|
|
70
70
|
createCollectionScope2
|
|
71
71
|
];
|
|
72
72
|
}
|
|
73
|
+
var NAME$1 = "Arrow";
|
|
74
|
+
var Arrow$1 = React.forwardRef((props, forwardedRef) => {
|
|
75
|
+
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
76
|
+
return /* @__PURE__ */ jsx(
|
|
77
|
+
Primitive.svg,
|
|
78
|
+
{
|
|
79
|
+
...arrowProps,
|
|
80
|
+
ref: forwardedRef,
|
|
81
|
+
width,
|
|
82
|
+
height,
|
|
83
|
+
viewBox: "0 0 30 10",
|
|
84
|
+
preserveAspectRatio: "none",
|
|
85
|
+
children: props.asChild ? children : /* @__PURE__ */ jsx("polygon", { points: "0,0 30,0 15,10" })
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
});
|
|
89
|
+
Arrow$1.displayName = NAME$1;
|
|
90
|
+
var Root$1 = Arrow$1;
|
|
91
|
+
function useSize(element) {
|
|
92
|
+
const [size2, setSize] = React.useState(void 0);
|
|
93
|
+
useLayoutEffect2(() => {
|
|
94
|
+
if (element) {
|
|
95
|
+
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
96
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
97
|
+
if (!Array.isArray(entries)) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (!entries.length) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const entry = entries[0];
|
|
104
|
+
let width;
|
|
105
|
+
let height;
|
|
106
|
+
if ("borderBoxSize" in entry) {
|
|
107
|
+
const borderSizeEntry = entry["borderBoxSize"];
|
|
108
|
+
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
109
|
+
width = borderSize["inlineSize"];
|
|
110
|
+
height = borderSize["blockSize"];
|
|
111
|
+
} else {
|
|
112
|
+
width = element.offsetWidth;
|
|
113
|
+
height = element.offsetHeight;
|
|
114
|
+
}
|
|
115
|
+
setSize({ width, height });
|
|
116
|
+
});
|
|
117
|
+
resizeObserver.observe(element, { box: "border-box" });
|
|
118
|
+
return () => resizeObserver.unobserve(element);
|
|
119
|
+
} else {
|
|
120
|
+
setSize(void 0);
|
|
121
|
+
}
|
|
122
|
+
}, [element]);
|
|
123
|
+
return size2;
|
|
124
|
+
}
|
|
125
|
+
var POPPER_NAME = "Popper";
|
|
126
|
+
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
127
|
+
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
128
|
+
var Popper = (props) => {
|
|
129
|
+
const { __scopePopper, children } = props;
|
|
130
|
+
const [anchor, setAnchor] = React.useState(null);
|
|
131
|
+
return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
132
|
+
};
|
|
133
|
+
Popper.displayName = POPPER_NAME;
|
|
134
|
+
var ANCHOR_NAME = "PopperAnchor";
|
|
135
|
+
var PopperAnchor = React.forwardRef(
|
|
136
|
+
(props, forwardedRef) => {
|
|
137
|
+
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
138
|
+
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
139
|
+
const ref = React.useRef(null);
|
|
140
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
141
|
+
const anchorRef = React.useRef(null);
|
|
142
|
+
React.useEffect(() => {
|
|
143
|
+
const previousAnchor = anchorRef.current;
|
|
144
|
+
anchorRef.current = virtualRef?.current || ref.current;
|
|
145
|
+
if (previousAnchor !== anchorRef.current) {
|
|
146
|
+
context.onAnchorChange(anchorRef.current);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
PopperAnchor.displayName = ANCHOR_NAME;
|
|
153
|
+
var CONTENT_NAME$1 = "PopperContent";
|
|
154
|
+
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$1);
|
|
155
|
+
var PopperContent = React.forwardRef(
|
|
156
|
+
(props, forwardedRef) => {
|
|
157
|
+
const {
|
|
158
|
+
__scopePopper,
|
|
159
|
+
side = "bottom",
|
|
160
|
+
sideOffset = 0,
|
|
161
|
+
align = "center",
|
|
162
|
+
alignOffset = 0,
|
|
163
|
+
arrowPadding = 0,
|
|
164
|
+
avoidCollisions = true,
|
|
165
|
+
collisionBoundary = [],
|
|
166
|
+
collisionPadding: collisionPaddingProp = 0,
|
|
167
|
+
sticky = "partial",
|
|
168
|
+
hideWhenDetached = false,
|
|
169
|
+
updatePositionStrategy = "optimized",
|
|
170
|
+
onPlaced,
|
|
171
|
+
...contentProps
|
|
172
|
+
} = props;
|
|
173
|
+
const context = usePopperContext(CONTENT_NAME$1, __scopePopper);
|
|
174
|
+
const [content, setContent] = React.useState(null);
|
|
175
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
176
|
+
const [arrow$1, setArrow] = React.useState(null);
|
|
177
|
+
const arrowSize = useSize(arrow$1);
|
|
178
|
+
const arrowWidth = arrowSize?.width ?? 0;
|
|
179
|
+
const arrowHeight = arrowSize?.height ?? 0;
|
|
180
|
+
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
|
|
181
|
+
const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
|
|
182
|
+
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
|
|
183
|
+
const hasExplicitBoundaries = boundary.length > 0;
|
|
184
|
+
const detectOverflowOptions = {
|
|
185
|
+
padding: collisionPadding,
|
|
186
|
+
boundary: boundary.filter(isNotNull),
|
|
187
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
188
|
+
altBoundary: hasExplicitBoundaries
|
|
189
|
+
};
|
|
190
|
+
const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
|
|
191
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
192
|
+
strategy: "fixed",
|
|
193
|
+
placement: desiredPlacement,
|
|
194
|
+
whileElementsMounted: (...args) => {
|
|
195
|
+
const cleanup = autoUpdate(...args, {
|
|
196
|
+
animationFrame: updatePositionStrategy === "always"
|
|
197
|
+
});
|
|
198
|
+
return cleanup;
|
|
199
|
+
},
|
|
200
|
+
elements: {
|
|
201
|
+
reference: context.anchor
|
|
202
|
+
},
|
|
203
|
+
middleware: [
|
|
204
|
+
offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
|
|
205
|
+
avoidCollisions && shift({
|
|
206
|
+
mainAxis: true,
|
|
207
|
+
crossAxis: false,
|
|
208
|
+
limiter: sticky === "partial" ? limitShift() : void 0,
|
|
209
|
+
...detectOverflowOptions
|
|
210
|
+
}),
|
|
211
|
+
avoidCollisions && flip({ ...detectOverflowOptions }),
|
|
212
|
+
size({
|
|
213
|
+
...detectOverflowOptions,
|
|
214
|
+
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
|
215
|
+
const { width: anchorWidth, height: anchorHeight } = rects.reference;
|
|
216
|
+
const contentStyle = elements.floating.style;
|
|
217
|
+
contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
|
|
218
|
+
contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
|
|
219
|
+
contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
|
|
220
|
+
contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
|
|
221
|
+
}
|
|
222
|
+
}),
|
|
223
|
+
arrow$1 && arrow({ element: arrow$1, padding: arrowPadding }),
|
|
224
|
+
transformOrigin({ arrowWidth, arrowHeight }),
|
|
225
|
+
hideWhenDetached && hide({ strategy: "referenceHidden", ...detectOverflowOptions })
|
|
226
|
+
]
|
|
227
|
+
});
|
|
228
|
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
229
|
+
const handlePlaced = useCallbackRef(onPlaced);
|
|
230
|
+
useLayoutEffect2(() => {
|
|
231
|
+
if (isPositioned) {
|
|
232
|
+
handlePlaced?.();
|
|
233
|
+
}
|
|
234
|
+
}, [isPositioned, handlePlaced]);
|
|
235
|
+
const arrowX = middlewareData.arrow?.x;
|
|
236
|
+
const arrowY = middlewareData.arrow?.y;
|
|
237
|
+
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
238
|
+
const [contentZIndex, setContentZIndex] = React.useState();
|
|
239
|
+
useLayoutEffect2(() => {
|
|
240
|
+
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
241
|
+
}, [content]);
|
|
242
|
+
return /* @__PURE__ */ jsx(
|
|
243
|
+
"div",
|
|
244
|
+
{
|
|
245
|
+
ref: refs.setFloating,
|
|
246
|
+
"data-radix-popper-content-wrapper": "",
|
|
247
|
+
style: {
|
|
248
|
+
...floatingStyles,
|
|
249
|
+
transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
|
|
250
|
+
// keep off the page when measuring
|
|
251
|
+
minWidth: "max-content",
|
|
252
|
+
zIndex: contentZIndex,
|
|
253
|
+
["--radix-popper-transform-origin"]: [
|
|
254
|
+
middlewareData.transformOrigin?.x,
|
|
255
|
+
middlewareData.transformOrigin?.y
|
|
256
|
+
].join(" "),
|
|
257
|
+
// hide the content if using the hide middleware and should be hidden
|
|
258
|
+
// set visibility to hidden and disable pointer events so the UI behaves
|
|
259
|
+
// as if the PopperContent isn't there at all
|
|
260
|
+
...middlewareData.hide?.referenceHidden && {
|
|
261
|
+
visibility: "hidden",
|
|
262
|
+
pointerEvents: "none"
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
dir: props.dir,
|
|
266
|
+
children: /* @__PURE__ */ jsx(
|
|
267
|
+
PopperContentProvider,
|
|
268
|
+
{
|
|
269
|
+
scope: __scopePopper,
|
|
270
|
+
placedSide,
|
|
271
|
+
onArrowChange: setArrow,
|
|
272
|
+
arrowX,
|
|
273
|
+
arrowY,
|
|
274
|
+
shouldHideArrow: cannotCenterArrow,
|
|
275
|
+
children: /* @__PURE__ */ jsx(
|
|
276
|
+
Primitive.div,
|
|
277
|
+
{
|
|
278
|
+
"data-side": placedSide,
|
|
279
|
+
"data-align": placedAlign,
|
|
280
|
+
...contentProps,
|
|
281
|
+
ref: composedRefs,
|
|
282
|
+
style: {
|
|
283
|
+
...contentProps.style,
|
|
284
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
285
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
286
|
+
animation: !isPositioned ? "none" : void 0
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
)
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
}
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
);
|
|
296
|
+
PopperContent.displayName = CONTENT_NAME$1;
|
|
297
|
+
var ARROW_NAME$1 = "PopperArrow";
|
|
298
|
+
var OPPOSITE_SIDE = {
|
|
299
|
+
top: "bottom",
|
|
300
|
+
right: "left",
|
|
301
|
+
bottom: "top",
|
|
302
|
+
left: "right"
|
|
303
|
+
};
|
|
304
|
+
var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
305
|
+
const { __scopePopper, ...arrowProps } = props;
|
|
306
|
+
const contentContext = useContentContext(ARROW_NAME$1, __scopePopper);
|
|
307
|
+
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
308
|
+
return (
|
|
309
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
310
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
311
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
312
|
+
/* @__PURE__ */ jsx(
|
|
313
|
+
"span",
|
|
314
|
+
{
|
|
315
|
+
ref: contentContext.onArrowChange,
|
|
316
|
+
style: {
|
|
317
|
+
position: "absolute",
|
|
318
|
+
left: contentContext.arrowX,
|
|
319
|
+
top: contentContext.arrowY,
|
|
320
|
+
[baseSide]: 0,
|
|
321
|
+
transformOrigin: {
|
|
322
|
+
top: "",
|
|
323
|
+
right: "0 0",
|
|
324
|
+
bottom: "center 0",
|
|
325
|
+
left: "100% 0"
|
|
326
|
+
}[contentContext.placedSide],
|
|
327
|
+
transform: {
|
|
328
|
+
top: "translateY(100%)",
|
|
329
|
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
330
|
+
bottom: `rotate(180deg)`,
|
|
331
|
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
332
|
+
}[contentContext.placedSide],
|
|
333
|
+
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
334
|
+
},
|
|
335
|
+
children: /* @__PURE__ */ jsx(
|
|
336
|
+
Root$1,
|
|
337
|
+
{
|
|
338
|
+
...arrowProps,
|
|
339
|
+
ref: forwardedRef,
|
|
340
|
+
style: {
|
|
341
|
+
...arrowProps.style,
|
|
342
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
343
|
+
display: "block"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
)
|
|
347
|
+
}
|
|
348
|
+
)
|
|
349
|
+
);
|
|
350
|
+
});
|
|
351
|
+
PopperArrow.displayName = ARROW_NAME$1;
|
|
352
|
+
function isNotNull(value) {
|
|
353
|
+
return value !== null;
|
|
354
|
+
}
|
|
355
|
+
var transformOrigin = (options) => ({
|
|
356
|
+
name: "transformOrigin",
|
|
357
|
+
options,
|
|
358
|
+
fn(data) {
|
|
359
|
+
const { placement, rects, middlewareData } = data;
|
|
360
|
+
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
361
|
+
const isArrowHidden = cannotCenterArrow;
|
|
362
|
+
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
363
|
+
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
364
|
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
365
|
+
const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
|
|
366
|
+
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
|
|
367
|
+
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
|
|
368
|
+
let x = "";
|
|
369
|
+
let y = "";
|
|
370
|
+
if (placedSide === "bottom") {
|
|
371
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
372
|
+
y = `${-arrowHeight}px`;
|
|
373
|
+
} else if (placedSide === "top") {
|
|
374
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
375
|
+
y = `${rects.floating.height + arrowHeight}px`;
|
|
376
|
+
} else if (placedSide === "right") {
|
|
377
|
+
x = `${-arrowHeight}px`;
|
|
378
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
379
|
+
} else if (placedSide === "left") {
|
|
380
|
+
x = `${rects.floating.width + arrowHeight}px`;
|
|
381
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
382
|
+
}
|
|
383
|
+
return { data: { x, y } };
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
function getSideAndAlignFromPlacement(placement) {
|
|
387
|
+
const [side, align = "center"] = placement.split("-");
|
|
388
|
+
return [side, align];
|
|
389
|
+
}
|
|
390
|
+
var Root2$1 = Popper;
|
|
391
|
+
var Anchor = PopperAnchor;
|
|
392
|
+
var Content = PopperContent;
|
|
393
|
+
var Arrow = PopperArrow;
|
|
73
394
|
const __iconNode = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
74
395
|
const ChevronUp = createLucideIcon("chevron-up", __iconNode);
|
|
75
396
|
function usePrevious(value) {
|
|
@@ -82,11 +403,39 @@ function usePrevious(value) {
|
|
|
82
403
|
return ref.current.previous;
|
|
83
404
|
}, [value]);
|
|
84
405
|
}
|
|
406
|
+
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
407
|
+
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
408
|
+
position: "absolute",
|
|
409
|
+
border: 0,
|
|
410
|
+
width: 1,
|
|
411
|
+
height: 1,
|
|
412
|
+
padding: 0,
|
|
413
|
+
margin: -1,
|
|
414
|
+
overflow: "hidden",
|
|
415
|
+
clip: "rect(0, 0, 0, 0)",
|
|
416
|
+
whiteSpace: "nowrap",
|
|
417
|
+
wordWrap: "normal"
|
|
418
|
+
});
|
|
419
|
+
var NAME = "VisuallyHidden";
|
|
420
|
+
var VisuallyHidden = React.forwardRef(
|
|
421
|
+
(props, forwardedRef) => {
|
|
422
|
+
return /* @__PURE__ */ jsx(
|
|
423
|
+
Primitive.span,
|
|
424
|
+
{
|
|
425
|
+
...props,
|
|
426
|
+
ref: forwardedRef,
|
|
427
|
+
style: { ...VISUALLY_HIDDEN_STYLES, ...props.style }
|
|
428
|
+
}
|
|
429
|
+
);
|
|
430
|
+
}
|
|
431
|
+
);
|
|
432
|
+
VisuallyHidden.displayName = NAME;
|
|
433
|
+
var Root = VisuallyHidden;
|
|
85
434
|
var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"];
|
|
86
435
|
var SELECTION_KEYS = [" ", "Enter"];
|
|
87
436
|
var SELECT_NAME = "Select";
|
|
88
437
|
var [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME);
|
|
89
|
-
var [createSelectContext
|
|
438
|
+
var [createSelectContext] = createContextScope(SELECT_NAME, [
|
|
90
439
|
createCollectionScope,
|
|
91
440
|
createPopperScope
|
|
92
441
|
]);
|
|
@@ -1222,7 +1571,7 @@ function SelectValue({ ...props }) {
|
|
|
1222
1571
|
}
|
|
1223
1572
|
function SelectTrigger({
|
|
1224
1573
|
className,
|
|
1225
|
-
size = "default",
|
|
1574
|
+
size: size2 = "default",
|
|
1226
1575
|
children,
|
|
1227
1576
|
...props
|
|
1228
1577
|
}) {
|
|
@@ -1230,7 +1579,7 @@ function SelectTrigger({
|
|
|
1230
1579
|
Trigger,
|
|
1231
1580
|
{
|
|
1232
1581
|
"data-slot": "select-trigger",
|
|
1233
|
-
"data-size":
|
|
1582
|
+
"data-size": size2,
|
|
1234
1583
|
className: cn(
|
|
1235
1584
|
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1236
1585
|
className
|
|
@@ -1325,6 +1674,9 @@ function SelectScrollDownButton({ className, ...props }) {
|
|
|
1325
1674
|
);
|
|
1326
1675
|
}
|
|
1327
1676
|
export {
|
|
1677
|
+
Anchor as A,
|
|
1678
|
+
Content as C,
|
|
1679
|
+
Root2$1 as R,
|
|
1328
1680
|
Select as S,
|
|
1329
1681
|
SelectTrigger as a,
|
|
1330
1682
|
SelectValue as b,
|
|
@@ -1333,9 +1685,13 @@ export {
|
|
|
1333
1685
|
SelectLabel as e,
|
|
1334
1686
|
SelectItem as f,
|
|
1335
1687
|
createCollection as g,
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1688
|
+
createPopperScope as h,
|
|
1689
|
+
Arrow as i,
|
|
1690
|
+
Root as j,
|
|
1691
|
+
useSize as k,
|
|
1692
|
+
SelectScrollDownButton as l,
|
|
1693
|
+
SelectScrollUpButton as m,
|
|
1694
|
+
SelectSeparator as n,
|
|
1339
1695
|
usePrevious as u
|
|
1340
1696
|
};
|
|
1341
|
-
//# sourceMappingURL=select-
|
|
1697
|
+
//# sourceMappingURL=select-CLIZOVIj.js.map
|