strata-ui-react 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +28 -27
- package/dist/strata-ui-react.cjs.js +1 -1
- package/dist/strata-ui-react.es.js +487 -487
- package/dist/strata-ui-react.umd.js +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React
|
|
2
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { createContext, createElement, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import * as ReactDOM from "react-dom";
|
|
4
4
|
var __commonJSMin = (t, n) => () => (n || t((n = { exports: {} }).exports, n), n.exports), __require = /* @__PURE__ */ ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, { get: (t, n) => (typeof require < "u" ? require : t)[n] }) : t)(function(t) {
|
|
5
5
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
@@ -26,7 +26,7 @@ function formatErrorMessage(t, ...n) {
|
|
|
26
26
|
}
|
|
27
27
|
var UNINITIALIZED = {};
|
|
28
28
|
function useRefWithInit(n, i) {
|
|
29
|
-
let s = React
|
|
29
|
+
let s = React.useRef(UNINITIALIZED);
|
|
30
30
|
return s.current === UNINITIALIZED && (s.current = n(i)), s;
|
|
31
31
|
}
|
|
32
32
|
function useMergedRefs(t, n, i, s) {
|
|
@@ -96,12 +96,12 @@ function update(t, n) {
|
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
var majorVersion = parseInt(React
|
|
99
|
+
var majorVersion = parseInt(React.version, 10);
|
|
100
100
|
function isReactVersionAtLeast(t) {
|
|
101
101
|
return majorVersion >= t;
|
|
102
102
|
}
|
|
103
103
|
function getReactElementRef(n) {
|
|
104
|
-
if (!/* @__PURE__ */ React
|
|
104
|
+
if (!/* @__PURE__ */ React.isValidElement(n)) return null;
|
|
105
105
|
let i = n, s = i.props;
|
|
106
106
|
return (isReactVersionAtLeast(19) ? s?.ref : i.ref) ?? null;
|
|
107
107
|
}
|
|
@@ -219,26 +219,26 @@ function evaluateRenderProp(n, i, s, c) {
|
|
|
219
219
|
if (i) {
|
|
220
220
|
if (typeof i == "function") return i(s, c);
|
|
221
221
|
let n = mergeProps(s, i.props);
|
|
222
|
-
return n.ref = s.ref, /* @__PURE__ */ React
|
|
222
|
+
return n.ref = s.ref, /* @__PURE__ */ React.cloneElement(i, n);
|
|
223
223
|
}
|
|
224
224
|
if (n && typeof n == "string") return renderTag(n, s);
|
|
225
225
|
throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(8) : "Base UI: Render element or function are not defined.");
|
|
226
226
|
}
|
|
227
|
-
function renderTag(n,
|
|
227
|
+
function renderTag(n, s) {
|
|
228
228
|
return n === "button" ? /* @__PURE__ */ createElement("button", {
|
|
229
229
|
type: "button",
|
|
230
|
-
...
|
|
231
|
-
key:
|
|
230
|
+
...s,
|
|
231
|
+
key: s.key
|
|
232
232
|
}) : n === "img" ? /* @__PURE__ */ createElement("img", {
|
|
233
233
|
alt: "",
|
|
234
|
-
...
|
|
235
|
-
key:
|
|
236
|
-
}) : /* @__PURE__ */ React
|
|
234
|
+
...s,
|
|
235
|
+
key: s.key
|
|
236
|
+
}) : /* @__PURE__ */ React.createElement(n, s);
|
|
237
237
|
}
|
|
238
|
-
const AvatarRootContext = /* @__PURE__ */ React
|
|
238
|
+
const AvatarRootContext = /* @__PURE__ */ React.createContext(void 0);
|
|
239
239
|
process.env.NODE_ENV !== "production" && (AvatarRootContext.displayName = "AvatarRootContext");
|
|
240
240
|
function useAvatarRootContext() {
|
|
241
|
-
let n = React
|
|
241
|
+
let n = React.useContext(AvatarRootContext);
|
|
242
242
|
if (n === void 0) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(13) : "Base UI: AvatarRootContext is missing. Avatar parts must be placed within <Avatar.Root>.");
|
|
243
243
|
return n;
|
|
244
244
|
}
|
|
@@ -428,8 +428,8 @@ var require_react_jsx_runtime_production = /* @__PURE__ */ __commonJSMin(((t) =>
|
|
|
428
428
|
})), import_jsx_runtime = (/* @__PURE__ */ __commonJSMin(((t, n) => {
|
|
429
429
|
process.env.NODE_ENV === "production" ? n.exports = require_react_jsx_runtime_production() : n.exports = require_react_jsx_runtime_development();
|
|
430
430
|
})))();
|
|
431
|
-
const AvatarRoot = /* @__PURE__ */ React
|
|
432
|
-
let { className: s, render: c, ...l } = n, [u, d] = React
|
|
431
|
+
const AvatarRoot = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
432
|
+
let { className: s, render: c, ...l } = n, [u, d] = React.useState("idle"), f = React.useMemo(() => ({ imageLoadingStatus: u }), [u]), m = React.useMemo(() => ({
|
|
433
433
|
imageLoadingStatus: u,
|
|
434
434
|
setImageLoadingStatus: d
|
|
435
435
|
}), [u, d]), h = useRenderElement("span", n, {
|
|
@@ -444,7 +444,7 @@ const AvatarRoot = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
444
444
|
});
|
|
445
445
|
});
|
|
446
446
|
process.env.NODE_ENV !== "production" && (AvatarRoot.displayName = "AvatarRoot");
|
|
447
|
-
var useInsertionEffect = React
|
|
447
|
+
var useInsertionEffect = React[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0, -3)], useSafeInsertionEffect = useInsertionEffect && useInsertionEffect !== React.useLayoutEffect ? useInsertionEffect : (t) => t();
|
|
448
448
|
function useStableCallback(t) {
|
|
449
449
|
let n = useRefWithInit(createStableCallback).current;
|
|
450
450
|
return n.next = t, useSafeInsertionEffect(n.effect), n.trampoline;
|
|
@@ -463,9 +463,9 @@ function createStableCallback() {
|
|
|
463
463
|
function assertNotCalled() {
|
|
464
464
|
if (process.env.NODE_ENV !== "production") throw Error("Base UI: Cannot call an event handler while rendering.");
|
|
465
465
|
}
|
|
466
|
-
const useIsoLayoutEffect = typeof document < "u" ? React
|
|
466
|
+
const useIsoLayoutEffect = typeof document < "u" ? React.useLayoutEffect : () => {};
|
|
467
467
|
function useImageLoadingStatus(n, { referrerPolicy: i, crossOrigin: s }) {
|
|
468
|
-
let [c, l] = React
|
|
468
|
+
let [c, l] = React.useState("idle");
|
|
469
469
|
return useIsoLayoutEffect(() => {
|
|
470
470
|
if (!n) return l("error"), NOOP;
|
|
471
471
|
let t = !0, c = new window.Image(), u = (n) => () => {
|
|
@@ -480,7 +480,7 @@ function useImageLoadingStatus(n, { referrerPolicy: i, crossOrigin: s }) {
|
|
|
480
480
|
i
|
|
481
481
|
]), c;
|
|
482
482
|
}
|
|
483
|
-
const AvatarImage$1 = /* @__PURE__ */ React
|
|
483
|
+
const AvatarImage$1 = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
484
484
|
let { className: s, render: c, onLoadingStatusChange: l, referrerPolicy: u, crossOrigin: d, ...f } = n, m = useAvatarRootContext(), h = useImageLoadingStatus(n.src, {
|
|
485
485
|
referrerPolicy: u,
|
|
486
486
|
crossOrigin: d
|
|
@@ -490,7 +490,7 @@ const AvatarImage$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
490
490
|
return useIsoLayoutEffect(() => {
|
|
491
491
|
h !== "idle" && g(h);
|
|
492
492
|
}, [h, g]), useRenderElement("img", n, {
|
|
493
|
-
state: React
|
|
493
|
+
state: React.useMemo(() => ({ imageLoadingStatus: h }), [h]),
|
|
494
494
|
ref: i,
|
|
495
495
|
props: f,
|
|
496
496
|
stateAttributesMapping: avatarStateAttributesMapping,
|
|
@@ -500,7 +500,7 @@ const AvatarImage$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
500
500
|
process.env.NODE_ENV !== "production" && (AvatarImage$1.displayName = "AvatarImage");
|
|
501
501
|
var EMPTY$2 = [];
|
|
502
502
|
function useOnMount(n) {
|
|
503
|
-
React
|
|
503
|
+
React.useEffect(n, EMPTY$2);
|
|
504
504
|
}
|
|
505
505
|
var EMPTY$1 = 0, Timeout = class t {
|
|
506
506
|
static create() {
|
|
@@ -524,10 +524,10 @@ function useTimeout() {
|
|
|
524
524
|
let t = useRefWithInit(Timeout.create).current;
|
|
525
525
|
return useOnMount(t.disposeEffect), t;
|
|
526
526
|
}
|
|
527
|
-
const AvatarFallback$1 = /* @__PURE__ */ React
|
|
528
|
-
let { className: s, render: c, delay: l, ...u } = n, { imageLoadingStatus: d } = useAvatarRootContext(), [f, m] = React
|
|
529
|
-
return React
|
|
530
|
-
state: React
|
|
527
|
+
const AvatarFallback$1 = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
528
|
+
let { className: s, render: c, delay: l, ...u } = n, { imageLoadingStatus: d } = useAvatarRootContext(), [f, m] = React.useState(l === void 0), h = useTimeout();
|
|
529
|
+
return React.useEffect(() => (l !== void 0 && h.start(l, () => m(!0)), h.clear), [h, l]), useRenderElement("span", n, {
|
|
530
|
+
state: React.useMemo(() => ({ imageLoadingStatus: d }), [d]),
|
|
531
531
|
ref: i,
|
|
532
532
|
props: u,
|
|
533
533
|
stateAttributesMapping: avatarStateAttributesMapping,
|
|
@@ -2880,9 +2880,9 @@ function Button(t) {
|
|
|
2880
2880
|
}), n[12] = i, n[13] = c, n[14] = f, n[15] = m) : m = n[15], m;
|
|
2881
2881
|
}
|
|
2882
2882
|
function useControlled({ controlled: n, default: i, name: s, state: c = "value" }) {
|
|
2883
|
-
let { current: l } = React
|
|
2883
|
+
let { current: l } = React.useRef(n !== void 0), [u, d] = React.useState(i), f = l ? n : u;
|
|
2884
2884
|
if (process.env.NODE_ENV !== "production") {
|
|
2885
|
-
React
|
|
2885
|
+
React.useEffect(() => {
|
|
2886
2886
|
l !== (n !== void 0) && console.error([
|
|
2887
2887
|
`Base UI: A component is changing the ${l ? "" : "un"}controlled ${c} state of ${s} to be ${l ? "un" : ""}controlled.`,
|
|
2888
2888
|
"Elements should not switch from uncontrolled to controlled (or vice versa).",
|
|
@@ -2895,12 +2895,12 @@ function useControlled({ controlled: n, default: i, name: s, state: c = "value"
|
|
|
2895
2895
|
s,
|
|
2896
2896
|
n
|
|
2897
2897
|
]);
|
|
2898
|
-
let { current: u } = React
|
|
2899
|
-
React
|
|
2898
|
+
let { current: u } = React.useRef(i);
|
|
2899
|
+
React.useEffect(() => {
|
|
2900
2900
|
!l && JSON.stringify(u) !== JSON.stringify(i) && console.error([`Base UI: A component is changing the default ${c} state of an uncontrolled ${s} after being initialized. To suppress this warning opt to use a controlled ${s}.`].join("\n"));
|
|
2901
2901
|
}, [JSON.stringify(i)]);
|
|
2902
2902
|
}
|
|
2903
|
-
return [f, React
|
|
2903
|
+
return [f, React.useCallback((t) => {
|
|
2904
2904
|
l || d(t);
|
|
2905
2905
|
}, [])];
|
|
2906
2906
|
}
|
|
@@ -2938,18 +2938,18 @@ const DEFAULT_VALIDITY_STATE = {
|
|
|
2938
2938
|
return t === null ? null : t ? { [FieldControlDataAttributes.valid]: "" } : { [FieldControlDataAttributes.invalid]: "" };
|
|
2939
2939
|
} };
|
|
2940
2940
|
function useStateAttributesMapping(n) {
|
|
2941
|
-
return React
|
|
2941
|
+
return React.useMemo(() => ({
|
|
2942
2942
|
checked(t) {
|
|
2943
2943
|
return n.indeterminate ? {} : t ? { [CheckboxRootDataAttributes.checked]: "" } : { [CheckboxRootDataAttributes.unchecked]: "" };
|
|
2944
2944
|
},
|
|
2945
2945
|
...fieldValidityMapping
|
|
2946
2946
|
}), [n.indeterminate]);
|
|
2947
2947
|
}
|
|
2948
|
-
const SafeReact = { ...React
|
|
2948
|
+
const SafeReact = { ...React };
|
|
2949
2949
|
var globalId = 0;
|
|
2950
2950
|
function useGlobalId(n, i = "mui") {
|
|
2951
|
-
let [s, c] = React
|
|
2952
|
-
return React
|
|
2951
|
+
let [s, c] = React.useState(n), l = n || s;
|
|
2952
|
+
return React.useEffect(() => {
|
|
2953
2953
|
s ?? (globalId += 1, c(`${i}-${globalId}`));
|
|
2954
2954
|
}, [s, i]), l;
|
|
2955
2955
|
}
|
|
@@ -3096,16 +3096,16 @@ function error(...t) {
|
|
|
3096
3096
|
set.has(n) || (set.add(n), console.error(`Base UI: ${n}`));
|
|
3097
3097
|
}
|
|
3098
3098
|
}
|
|
3099
|
-
const CompositeRootContext = /* @__PURE__ */ React
|
|
3099
|
+
const CompositeRootContext = /* @__PURE__ */ React.createContext(void 0);
|
|
3100
3100
|
process.env.NODE_ENV !== "production" && (CompositeRootContext.displayName = "CompositeRootContext");
|
|
3101
3101
|
function useCompositeRootContext(n = !1) {
|
|
3102
|
-
let i = React
|
|
3102
|
+
let i = React.useContext(CompositeRootContext);
|
|
3103
3103
|
if (i === void 0 && !n) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(16) : "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");
|
|
3104
3104
|
return i;
|
|
3105
3105
|
}
|
|
3106
3106
|
function useFocusableWhenDisabled(n) {
|
|
3107
3107
|
let { focusableWhenDisabled: i, disabled: s, composite: c = !1, tabIndex: l = 0, isNativeButton: u } = n, d = c && i !== !1, f = c && i === !1;
|
|
3108
|
-
return { props: React
|
|
3108
|
+
return { props: React.useMemo(() => {
|
|
3109
3109
|
let t = { onKeyDown(t) {
|
|
3110
3110
|
s && i && t.key !== "Tab" && t.preventDefault();
|
|
3111
3111
|
} };
|
|
@@ -3121,7 +3121,7 @@ function useFocusableWhenDisabled(n) {
|
|
|
3121
3121
|
]) };
|
|
3122
3122
|
}
|
|
3123
3123
|
function useButton(n = {}) {
|
|
3124
|
-
let { disabled: i = !1, focusableWhenDisabled: s, tabIndex: c = 0, native: l = !0 } = n, u = React
|
|
3124
|
+
let { disabled: i = !1, focusableWhenDisabled: s, tabIndex: c = 0, native: l = !0 } = n, u = React.useRef(null), d = useCompositeRootContext(!0) !== void 0, f = useStableCallback(() => {
|
|
3125
3125
|
let t = u.current;
|
|
3126
3126
|
return !!(t?.tagName === "A" && t?.href);
|
|
3127
3127
|
}), { props: m } = useFocusableWhenDisabled({
|
|
@@ -3131,12 +3131,12 @@ function useButton(n = {}) {
|
|
|
3131
3131
|
tabIndex: c,
|
|
3132
3132
|
isNativeButton: l
|
|
3133
3133
|
});
|
|
3134
|
-
process.env.NODE_ENV !== "production" && React
|
|
3134
|
+
process.env.NODE_ENV !== "production" && React.useEffect(() => {
|
|
3135
3135
|
if (!u.current) return;
|
|
3136
3136
|
let t = u.current.tagName === "BUTTON";
|
|
3137
3137
|
l ? t || error("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`.") : t && error("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.");
|
|
3138
3138
|
}, [l]);
|
|
3139
|
-
let h = React
|
|
3139
|
+
let h = React.useCallback(() => {
|
|
3140
3140
|
let t = u.current;
|
|
3141
3141
|
isButtonElement(t) && d && i && m.disabled === void 0 && t.disabled && (t.disabled = !1);
|
|
3142
3142
|
}, [
|
|
@@ -3145,7 +3145,7 @@ function useButton(n = {}) {
|
|
|
3145
3145
|
d
|
|
3146
3146
|
]);
|
|
3147
3147
|
return useIsoLayoutEffect(h, [h]), {
|
|
3148
|
-
getButtonProps: React
|
|
3148
|
+
getButtonProps: React.useCallback((t = {}) => {
|
|
3149
3149
|
let { onClick: n, onMouseDown: s, onKeyUp: c, onKeyDown: u, onPointerDown: d, ...h } = t;
|
|
3150
3150
|
return mergeProps({
|
|
3151
3151
|
type: l ? "button" : void 0,
|
|
@@ -3189,7 +3189,7 @@ function useButton(n = {}) {
|
|
|
3189
3189
|
function isButtonElement(t) {
|
|
3190
3190
|
return isHTMLElement(t) && t.tagName === "BUTTON";
|
|
3191
3191
|
}
|
|
3192
|
-
const FieldRootContext = /* @__PURE__ */ React
|
|
3192
|
+
const FieldRootContext = /* @__PURE__ */ React.createContext({
|
|
3193
3193
|
invalid: void 0,
|
|
3194
3194
|
name: void 0,
|
|
3195
3195
|
validityData: {
|
|
@@ -3231,14 +3231,14 @@ const FieldRootContext = /* @__PURE__ */ React$1.createContext({
|
|
|
3231
3231
|
});
|
|
3232
3232
|
process.env.NODE_ENV !== "production" && (FieldRootContext.displayName = "FieldRootContext");
|
|
3233
3233
|
function useFieldRootContext(n = !0) {
|
|
3234
|
-
let i = React
|
|
3234
|
+
let i = React.useContext(FieldRootContext);
|
|
3235
3235
|
if (i.setValidityData === NOOP && !n) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(28) : "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.");
|
|
3236
3236
|
return i;
|
|
3237
3237
|
}
|
|
3238
|
-
const FieldItemContext = /* @__PURE__ */ React
|
|
3238
|
+
const FieldItemContext = /* @__PURE__ */ React.createContext({ disabled: !1 });
|
|
3239
3239
|
process.env.NODE_ENV !== "production" && (FieldItemContext.displayName = "FieldItemContext");
|
|
3240
3240
|
function useFieldItemContext() {
|
|
3241
|
-
return React
|
|
3241
|
+
return React.useContext(FieldItemContext);
|
|
3242
3242
|
}
|
|
3243
3243
|
function getCombinedFieldValidityData(t, n) {
|
|
3244
3244
|
return {
|
|
@@ -3249,7 +3249,7 @@ function getCombinedFieldValidityData(t, n) {
|
|
|
3249
3249
|
}
|
|
3250
3250
|
};
|
|
3251
3251
|
}
|
|
3252
|
-
const FormContext = /* @__PURE__ */ React
|
|
3252
|
+
const FormContext = /* @__PURE__ */ React.createContext({
|
|
3253
3253
|
formRef: { current: { fields: /* @__PURE__ */ new Map() } },
|
|
3254
3254
|
errors: {},
|
|
3255
3255
|
clearErrors: NOOP,
|
|
@@ -3258,7 +3258,7 @@ const FormContext = /* @__PURE__ */ React$1.createContext({
|
|
|
3258
3258
|
});
|
|
3259
3259
|
process.env.NODE_ENV !== "production" && (FormContext.displayName = "FormContext");
|
|
3260
3260
|
function useFormContext() {
|
|
3261
|
-
return React
|
|
3261
|
+
return React.useContext(FormContext);
|
|
3262
3262
|
}
|
|
3263
3263
|
function useField(t) {
|
|
3264
3264
|
let { enabled: n = !0, value: i, id: s, name: c, controlRef: l, commit: u } = t, { formRef: d } = useFormContext(), { invalid: f, markedDirtyRef: h, validityData: g, setValidityData: _ } = useFieldRootContext(), v = useStableCallback(t.getValue);
|
|
@@ -3305,7 +3305,7 @@ function useField(t) {
|
|
|
3305
3305
|
};
|
|
3306
3306
|
}, [d, s]);
|
|
3307
3307
|
}
|
|
3308
|
-
const LabelableContext = /* @__PURE__ */ React
|
|
3308
|
+
const LabelableContext = /* @__PURE__ */ React.createContext({
|
|
3309
3309
|
controlId: void 0,
|
|
3310
3310
|
setControlId: NOOP,
|
|
3311
3311
|
labelId: void 0,
|
|
@@ -3316,19 +3316,19 @@ const LabelableContext = /* @__PURE__ */ React$1.createContext({
|
|
|
3316
3316
|
});
|
|
3317
3317
|
process.env.NODE_ENV !== "production" && (LabelableContext.displayName = "LabelableContext");
|
|
3318
3318
|
function useLabelableContext() {
|
|
3319
|
-
return React
|
|
3319
|
+
return React.useContext(LabelableContext);
|
|
3320
3320
|
}
|
|
3321
|
-
const CheckboxGroupContext = /* @__PURE__ */ React
|
|
3321
|
+
const CheckboxGroupContext = /* @__PURE__ */ React.createContext(void 0);
|
|
3322
3322
|
process.env.NODE_ENV !== "production" && (CheckboxGroupContext.displayName = "CheckboxGroupContext");
|
|
3323
3323
|
function useCheckboxGroupContext(n = !0) {
|
|
3324
|
-
let i = React
|
|
3324
|
+
let i = React.useContext(CheckboxGroupContext);
|
|
3325
3325
|
if (i === void 0 && !n) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(3) : "Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.");
|
|
3326
3326
|
return i;
|
|
3327
3327
|
}
|
|
3328
|
-
const CheckboxRootContext = /* @__PURE__ */ React
|
|
3328
|
+
const CheckboxRootContext = /* @__PURE__ */ React.createContext(void 0);
|
|
3329
3329
|
process.env.NODE_ENV !== "production" && (CheckboxRootContext.displayName = "CheckboxRootContext");
|
|
3330
3330
|
function useCheckboxRootContext() {
|
|
3331
|
-
let n = React
|
|
3331
|
+
let n = React.useContext(CheckboxRootContext);
|
|
3332
3332
|
if (n === void 0) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(14) : "Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.");
|
|
3333
3333
|
return n;
|
|
3334
3334
|
}
|
|
@@ -3355,19 +3355,19 @@ function createChangeEventDetails(t, n, i, s) {
|
|
|
3355
3355
|
};
|
|
3356
3356
|
}
|
|
3357
3357
|
function useValueChanged(n, i) {
|
|
3358
|
-
let s = React
|
|
3358
|
+
let s = React.useRef(n), c = useStableCallback(i);
|
|
3359
3359
|
useIsoLayoutEffect(() => {
|
|
3360
3360
|
s.current !== n && c(s.current);
|
|
3361
3361
|
}, [n, c]), useIsoLayoutEffect(() => {
|
|
3362
3362
|
s.current = n;
|
|
3363
3363
|
}, [n]);
|
|
3364
3364
|
}
|
|
3365
|
-
const CheckboxRoot = /* @__PURE__ */ React
|
|
3365
|
+
const CheckboxRoot = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
3366
3366
|
let { checked: s, className: c, defaultChecked: l = !1, disabled: u = !1, id: d, indeterminate: f = !1, inputRef: m, name: h, onCheckedChange: g, parent: _ = !1, readOnly: v = !1, render: y, required: b = !1, uncheckedValue: x, value: S, nativeButton: w = !1, ...T } = n, { clearErrors: E } = useFormContext(), { disabled: D, name: O, setDirty: k, setFilled: A, setFocused: j, setTouched: M, state: N, validationMode: P, validityData: F, shouldValidateOnChange: I, validation: R } = useFieldRootContext(), z = useFieldItemContext(), { labelId: B, controlId: V, setControlId: H, getDescriptionProps: U } = useLabelableContext(), W = useCheckboxGroupContext(), G = W?.parent, K = G && W.allValues, q = D || z.disabled || W?.disabled || u, Y = O ?? h, Z = S ?? Y, Q = useBaseUiId(), fh = useBaseUiId(), $ = V;
|
|
3367
3367
|
K ? $ = _ ? fh : `${G.id}-${Z}` : d && ($ = d);
|
|
3368
3368
|
let mh = {};
|
|
3369
3369
|
K && (_ ? mh = W.parent.getParentProps() : Z && (mh = W.parent.getChildProps(Z)));
|
|
3370
|
-
let hh = useStableCallback(g), { checked: gh = s, indeterminate: _h = f, onCheckedChange: vh, ...yh } = mh, bh = W?.value, Sh = W?.setValue, Ch = W?.defaultValue, wh = React
|
|
3370
|
+
let hh = useStableCallback(g), { checked: gh = s, indeterminate: _h = f, onCheckedChange: vh, ...yh } = mh, bh = W?.value, Sh = W?.setValue, Ch = W?.defaultValue, wh = React.useRef(null), { getButtonProps: Th, buttonRef: Eh } = useButton({
|
|
3371
3371
|
disabled: q,
|
|
3372
3372
|
native: w
|
|
3373
3373
|
}), Dh = W?.validation ?? R, [Oh, kh] = useControlled({
|
|
@@ -3394,7 +3394,7 @@ const CheckboxRoot = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
3394
3394
|
name: Y,
|
|
3395
3395
|
getValue: () => Oh
|
|
3396
3396
|
});
|
|
3397
|
-
let Ah = React
|
|
3397
|
+
let Ah = React.useRef(null), jh = useMergedRefs(m, Ah, Dh.inputRef);
|
|
3398
3398
|
useIsoLayoutEffect(() => {
|
|
3399
3399
|
Ah.current && (Ah.current.indeterminate = _h, Oh && A(!0));
|
|
3400
3400
|
}, [
|
|
@@ -3424,14 +3424,14 @@ const CheckboxRoot = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
3424
3424
|
wh.current?.focus();
|
|
3425
3425
|
}
|
|
3426
3426
|
}, S === void 0 ? EMPTY_OBJECT : { value: (W ? Oh && S : S) || "" }, U, W ? Dh.getValidationProps : Dh.getInputValidationProps), Nh = K ? !!gh : Oh, Ph = K && _h || f;
|
|
3427
|
-
React
|
|
3427
|
+
React.useEffect(() => {
|
|
3428
3428
|
G && Z && G.disabledStatesRef.current.set(Z, q);
|
|
3429
3429
|
}, [
|
|
3430
3430
|
G,
|
|
3431
3431
|
q,
|
|
3432
3432
|
Z
|
|
3433
3433
|
]);
|
|
3434
|
-
let Fh = React
|
|
3434
|
+
let Fh = React.useMemo(() => ({
|
|
3435
3435
|
...N,
|
|
3436
3436
|
checked: Nh,
|
|
3437
3437
|
disabled: q,
|
|
@@ -3580,7 +3580,7 @@ function useAnimationsFinished(t, n = !1, i = !0) {
|
|
|
3580
3580
|
}
|
|
3581
3581
|
function useOpenChangeComplete(n) {
|
|
3582
3582
|
let { enabled: i = !0, open: s, ref: c, onComplete: l } = n, u = useValueAsRef(s), d = useStableCallback(l), f = useAnimationsFinished(c, s);
|
|
3583
|
-
React
|
|
3583
|
+
React.useEffect(() => {
|
|
3584
3584
|
i && f(() => {
|
|
3585
3585
|
s === u.current && d();
|
|
3586
3586
|
});
|
|
@@ -3593,7 +3593,7 @@ function useOpenChangeComplete(n) {
|
|
|
3593
3593
|
]);
|
|
3594
3594
|
}
|
|
3595
3595
|
function useTransitionStatus(n, i = !1, s = !1) {
|
|
3596
|
-
let [c, l] = React
|
|
3596
|
+
let [c, l] = React.useState(n && i ? "idle" : void 0), [u, d] = React.useState(n);
|
|
3597
3597
|
return n && !u && (d(!0), l("starting")), !n && u && c !== "ending" && !s && l("ending"), !n && !u && c === "ending" && l(void 0), useIsoLayoutEffect(() => {
|
|
3598
3598
|
if (!n && u && c !== "ending" && s) {
|
|
3599
3599
|
let t = AnimationFrame.request(() => {
|
|
@@ -3631,7 +3631,7 @@ function useTransitionStatus(n, i = !1, s = !1) {
|
|
|
3631
3631
|
u,
|
|
3632
3632
|
l,
|
|
3633
3633
|
c
|
|
3634
|
-
]), React
|
|
3634
|
+
]), React.useMemo(() => ({
|
|
3635
3635
|
mounted: u,
|
|
3636
3636
|
setMounted: d,
|
|
3637
3637
|
transitionStatus: c
|
|
@@ -3643,8 +3643,8 @@ let TransitionStatusDataAttributes = /* @__PURE__ */ function(t) {
|
|
|
3643
3643
|
var STARTING_HOOK = { [TransitionStatusDataAttributes.startingStyle]: "" }, ENDING_HOOK = { [TransitionStatusDataAttributes.endingStyle]: "" };
|
|
3644
3644
|
const transitionStatusMapping = { transitionStatus(t) {
|
|
3645
3645
|
return t === "starting" ? STARTING_HOOK : t === "ending" ? ENDING_HOOK : null;
|
|
3646
|
-
} }, CheckboxIndicator$1 = /* @__PURE__ */ React
|
|
3647
|
-
let { render: s, className: c, keepMounted: l = !1, ...u } = n, d = useCheckboxRootContext(), f = d.checked || d.indeterminate, { transitionStatus: m, setMounted: h } = useTransitionStatus(f), g = React
|
|
3646
|
+
} }, CheckboxIndicator$1 = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
3647
|
+
let { render: s, className: c, keepMounted: l = !1, ...u } = n, d = useCheckboxRootContext(), f = d.checked || d.indeterminate, { transitionStatus: m, setMounted: h } = useTransitionStatus(f), g = React.useRef(null), _ = React.useMemo(() => ({
|
|
3648
3648
|
...d,
|
|
3649
3649
|
transitionStatus: m
|
|
3650
3650
|
}), [d, m]);
|
|
@@ -3655,7 +3655,7 @@ const transitionStatusMapping = { transitionStatus(t) {
|
|
|
3655
3655
|
f || h(!1);
|
|
3656
3656
|
}
|
|
3657
3657
|
});
|
|
3658
|
-
let v = useStateAttributesMapping(d), y = React
|
|
3658
|
+
let v = useStateAttributesMapping(d), y = React.useMemo(() => ({
|
|
3659
3659
|
...v,
|
|
3660
3660
|
...transitionStatusMapping,
|
|
3661
3661
|
...fieldValidityMapping
|
|
@@ -3682,43 +3682,43 @@ const CheckboxIndicator = (t) => {
|
|
|
3682
3682
|
}), n[5] = s, n[6] = c, n[7] = l) : l = n[7], l;
|
|
3683
3683
|
};
|
|
3684
3684
|
var a$2 = /* @__PURE__ */ new Map([
|
|
3685
|
-
["bold", /* @__PURE__ */ React
|
|
3686
|
-
["duotone", /* @__PURE__ */ React
|
|
3685
|
+
["bold", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z" }))],
|
|
3686
|
+
["duotone", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", {
|
|
3687
3687
|
d: "M208,160H48l80-80Z",
|
|
3688
3688
|
opacity: "0.2"
|
|
3689
|
-
}), /* @__PURE__ */ React
|
|
3690
|
-
["fill", /* @__PURE__ */ React
|
|
3691
|
-
["light", /* @__PURE__ */ React
|
|
3692
|
-
["regular", /* @__PURE__ */ React
|
|
3693
|
-
["thin", /* @__PURE__ */ React
|
|
3689
|
+
}), /* @__PURE__ */ React.createElement("path", { d: "M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z" }))],
|
|
3690
|
+
["fill", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z" }))],
|
|
3691
|
+
["light", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z" }))],
|
|
3692
|
+
["regular", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z" }))],
|
|
3693
|
+
["thin", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z" }))]
|
|
3694
3694
|
]), a$1 = /* @__PURE__ */ new Map([
|
|
3695
|
-
["bold", /* @__PURE__ */ React
|
|
3696
|
-
["duotone", /* @__PURE__ */ React
|
|
3695
|
+
["bold", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z" }))],
|
|
3696
|
+
["duotone", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", {
|
|
3697
3697
|
d: "M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",
|
|
3698
3698
|
opacity: "0.2"
|
|
3699
|
-
}), /* @__PURE__ */ React
|
|
3700
|
-
["fill", /* @__PURE__ */ React
|
|
3701
|
-
["light", /* @__PURE__ */ React
|
|
3702
|
-
["regular", /* @__PURE__ */ React
|
|
3703
|
-
["thin", /* @__PURE__ */ React
|
|
3699
|
+
}), /* @__PURE__ */ React.createElement("path", { d: "M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z" }))],
|
|
3700
|
+
["fill", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z" }))],
|
|
3701
|
+
["light", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z" }))],
|
|
3702
|
+
["regular", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z" }))],
|
|
3703
|
+
["thin", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z" }))]
|
|
3704
3704
|
]), a = /* @__PURE__ */ new Map([
|
|
3705
|
-
["bold", /* @__PURE__ */ React
|
|
3706
|
-
["duotone", /* @__PURE__ */ React
|
|
3705
|
+
["bold", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z" }))],
|
|
3706
|
+
["duotone", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", {
|
|
3707
3707
|
d: "M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",
|
|
3708
3708
|
opacity: "0.2"
|
|
3709
|
-
}), /* @__PURE__ */ React
|
|
3710
|
-
["fill", /* @__PURE__ */ React
|
|
3711
|
-
["light", /* @__PURE__ */ React
|
|
3712
|
-
["regular", /* @__PURE__ */ React
|
|
3713
|
-
["thin", /* @__PURE__ */ React
|
|
3709
|
+
}), /* @__PURE__ */ React.createElement("path", { d: "M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z" }))],
|
|
3710
|
+
["fill", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z" }))],
|
|
3711
|
+
["light", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z" }))],
|
|
3712
|
+
["regular", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z" }))],
|
|
3713
|
+
["thin", /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", { d: "M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z" }))]
|
|
3714
3714
|
]), o$2 = createContext({
|
|
3715
3715
|
color: "currentColor",
|
|
3716
3716
|
size: "1em",
|
|
3717
3717
|
weight: "regular",
|
|
3718
3718
|
mirrored: !1
|
|
3719
|
-
}), p = React
|
|
3720
|
-
let { alt: s, color: c, size: l, weight: u, mirrored: d, children: f, weights: m, ...h } = n, { color: g = "currentColor", size: _, weight: v = "regular", mirrored: y = !1, ...b } = React
|
|
3721
|
-
return /* @__PURE__ */ React
|
|
3719
|
+
}), p = React.forwardRef((n, i) => {
|
|
3720
|
+
let { alt: s, color: c, size: l, weight: u, mirrored: d, children: f, weights: m, ...h } = n, { color: g = "currentColor", size: _, weight: v = "regular", mirrored: y = !1, ...b } = React.useContext(o$2);
|
|
3721
|
+
return /* @__PURE__ */ React.createElement("svg", {
|
|
3722
3722
|
ref: i,
|
|
3723
3723
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3724
3724
|
width: l ?? _,
|
|
@@ -3728,22 +3728,22 @@ var a$2 = /* @__PURE__ */ new Map([
|
|
|
3728
3728
|
transform: d || y ? "scale(-1, 1)" : void 0,
|
|
3729
3729
|
...b,
|
|
3730
3730
|
...h
|
|
3731
|
-
}, !!s && /* @__PURE__ */ React
|
|
3731
|
+
}, !!s && /* @__PURE__ */ React.createElement("title", null, s), f, m.get(u ?? v));
|
|
3732
3732
|
});
|
|
3733
3733
|
p.displayName = "IconBase";
|
|
3734
|
-
var o = React
|
|
3734
|
+
var o = React.forwardRef((n, i) => /* @__PURE__ */ React.createElement(p, {
|
|
3735
3735
|
ref: i,
|
|
3736
3736
|
...n,
|
|
3737
3737
|
weights: a$2
|
|
3738
3738
|
}));
|
|
3739
3739
|
o.displayName = "CaretUpIcon";
|
|
3740
|
-
var o$1 = React
|
|
3740
|
+
var o$1 = React.forwardRef((n, i) => /* @__PURE__ */ React.createElement(p, {
|
|
3741
3741
|
ref: i,
|
|
3742
3742
|
...n,
|
|
3743
3743
|
weights: a$1
|
|
3744
3744
|
}));
|
|
3745
3745
|
o$1.displayName = "CheckIcon";
|
|
3746
|
-
var e = React
|
|
3746
|
+
var e = React.forwardRef((n, i) => /* @__PURE__ */ React.createElement(p, {
|
|
3747
3747
|
ref: i,
|
|
3748
3748
|
...n,
|
|
3749
3749
|
weights: a
|
|
@@ -3777,10 +3777,10 @@ const Checkbox = (t) => {
|
|
|
3777
3777
|
className: "flex items-center gap-2",
|
|
3778
3778
|
children: [h, g]
|
|
3779
3779
|
}), n[20] = h, n[21] = g, n[22] = _) : _ = n[22], _;
|
|
3780
|
-
}, DialogRootContext = /* @__PURE__ */ React
|
|
3780
|
+
}, DialogRootContext = /* @__PURE__ */ React.createContext(void 0);
|
|
3781
3781
|
process.env.NODE_ENV !== "production" && (DialogRootContext.displayName = "DialogRootContext");
|
|
3782
3782
|
function useDialogRootContext(n) {
|
|
3783
|
-
let i = React
|
|
3783
|
+
let i = React.useContext(DialogRootContext);
|
|
3784
3784
|
if (n === !1 && i === void 0) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(27) : "Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.");
|
|
3785
3785
|
return i;
|
|
3786
3786
|
}
|
|
@@ -3806,10 +3806,10 @@ var stateAttributesMapping$5 = {
|
|
|
3806
3806
|
...popupStateMapping,
|
|
3807
3807
|
...transitionStatusMapping
|
|
3808
3808
|
};
|
|
3809
|
-
const DialogBackdrop = /* @__PURE__ */ React
|
|
3809
|
+
const DialogBackdrop = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
3810
3810
|
let { render: s, className: c, forceRender: l = !1, ...u } = n, { store: d } = useDialogRootContext(), f = d.useState("open"), m = d.useState("nested"), h = d.useState("mounted"), g = d.useState("transitionStatus");
|
|
3811
3811
|
return useRenderElement("div", n, {
|
|
3812
|
-
state: React
|
|
3812
|
+
state: React.useMemo(() => ({
|
|
3813
3813
|
open: f,
|
|
3814
3814
|
transitionStatus: g
|
|
3815
3815
|
}), [f, g]),
|
|
@@ -3827,7 +3827,7 @@ const DialogBackdrop = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
3827
3827
|
});
|
|
3828
3828
|
});
|
|
3829
3829
|
process.env.NODE_ENV !== "production" && (DialogBackdrop.displayName = "DialogBackdrop");
|
|
3830
|
-
const DialogClose$1 = /* @__PURE__ */ React
|
|
3830
|
+
const DialogClose$1 = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
3831
3831
|
let { render: s, className: c, disabled: l = !1, nativeButton: u = !0, ...d } = n, { store: f } = useDialogRootContext(), m = f.useState("open");
|
|
3832
3832
|
function h(t) {
|
|
3833
3833
|
m && f.setOpen(!1, createChangeEventDetails("close-press", t.nativeEvent));
|
|
@@ -3837,7 +3837,7 @@ const DialogClose$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
3837
3837
|
native: u
|
|
3838
3838
|
});
|
|
3839
3839
|
return useRenderElement("button", n, {
|
|
3840
|
-
state: React
|
|
3840
|
+
state: React.useMemo(() => ({ disabled: l }), [l]),
|
|
3841
3841
|
ref: [i, _],
|
|
3842
3842
|
props: [
|
|
3843
3843
|
{ onClick: h },
|
|
@@ -3847,7 +3847,7 @@ const DialogClose$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
3847
3847
|
});
|
|
3848
3848
|
});
|
|
3849
3849
|
process.env.NODE_ENV !== "production" && (DialogClose$1.displayName = "DialogClose");
|
|
3850
|
-
const DialogDescription$1 = /* @__PURE__ */ React
|
|
3850
|
+
const DialogDescription$1 = /* @__PURE__ */ React.forwardRef(function(t, n) {
|
|
3851
3851
|
let { render: i, className: s, id: c, ...l } = t, { store: u } = useDialogRootContext(), d = useBaseUiId(c);
|
|
3852
3852
|
return u.useSyncedValueWithCleanup("descriptionElementId", d), useRenderElement("p", t, {
|
|
3853
3853
|
ref: n,
|
|
@@ -4442,12 +4442,12 @@ function createEventEmitter() {
|
|
|
4442
4442
|
}
|
|
4443
4443
|
};
|
|
4444
4444
|
}
|
|
4445
|
-
var FloatingNodeContext = /* @__PURE__ */ React
|
|
4445
|
+
var FloatingNodeContext = /* @__PURE__ */ React.createContext(null);
|
|
4446
4446
|
process.env.NODE_ENV !== "production" && (FloatingNodeContext.displayName = "FloatingNodeContext");
|
|
4447
|
-
var FloatingTreeContext = /* @__PURE__ */ React
|
|
4447
|
+
var FloatingTreeContext = /* @__PURE__ */ React.createContext(null);
|
|
4448
4448
|
process.env.NODE_ENV !== "production" && (FloatingTreeContext.displayName = "FloatingTreeContext");
|
|
4449
|
-
const useFloatingParentNodeId = () => React
|
|
4450
|
-
let i = React
|
|
4449
|
+
const useFloatingParentNodeId = () => React.useContext(FloatingNodeContext)?.id || null, useFloatingTree = (n) => {
|
|
4450
|
+
let i = React.useContext(FloatingTreeContext);
|
|
4451
4451
|
return n ?? i;
|
|
4452
4452
|
};
|
|
4453
4453
|
function createAttribute(t) {
|
|
@@ -4463,7 +4463,7 @@ function getDelay(t, n, i) {
|
|
|
4463
4463
|
}
|
|
4464
4464
|
return t?.[n];
|
|
4465
4465
|
}
|
|
4466
|
-
var FloatingDelayGroupContext = /* @__PURE__ */ React
|
|
4466
|
+
var FloatingDelayGroupContext = /* @__PURE__ */ React.createContext({
|
|
4467
4467
|
hasProvider: !1,
|
|
4468
4468
|
timeoutMs: 0,
|
|
4469
4469
|
delayRef: { current: 0 },
|
|
@@ -4474,9 +4474,9 @@ var FloatingDelayGroupContext = /* @__PURE__ */ React$1.createContext({
|
|
|
4474
4474
|
});
|
|
4475
4475
|
process.env.NODE_ENV !== "production" && (FloatingDelayGroupContext.displayName = "FloatingDelayGroupContext");
|
|
4476
4476
|
function FloatingDelayGroup(n) {
|
|
4477
|
-
let { children: i, delay: s, timeoutMs: c = 0 } = n, l = React
|
|
4477
|
+
let { children: i, delay: s, timeoutMs: c = 0 } = n, l = React.useRef(s), u = React.useRef(s), d = React.useRef(null), f = React.useRef(null), m = useTimeout();
|
|
4478
4478
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingDelayGroupContext.Provider, {
|
|
4479
|
-
value: React
|
|
4479
|
+
value: React.useMemo(() => ({
|
|
4480
4480
|
hasProvider: !0,
|
|
4481
4481
|
delayRef: l,
|
|
4482
4482
|
initialDelayRef: u,
|
|
@@ -4489,7 +4489,7 @@ function FloatingDelayGroup(n) {
|
|
|
4489
4489
|
});
|
|
4490
4490
|
}
|
|
4491
4491
|
function useDelayGroup(n, i = { open: !1 }) {
|
|
4492
|
-
let s = "rootStore" in n ? n.rootStore : n, c = s.useState("floatingId"), { enabled: l = !0, open: u } = i, { currentIdRef: d, delayRef: f, timeoutMs: m, initialDelayRef: h, currentContextRef: g, hasProvider: _, timeout: v } = React
|
|
4492
|
+
let s = "rootStore" in n ? n.rootStore : n, c = s.useState("floatingId"), { enabled: l = !0, open: u } = i, { currentIdRef: d, delayRef: f, timeoutMs: m, initialDelayRef: h, currentContextRef: g, hasProvider: _, timeout: v } = React.useContext(FloatingDelayGroupContext), [y, b] = React.useState(!1);
|
|
4493
4493
|
return useIsoLayoutEffect(() => {
|
|
4494
4494
|
function t() {
|
|
4495
4495
|
b(!1), g.current?.setIsInstantPhase(!1), d.current = null, g.current = null, f.current = h.current;
|
|
@@ -4539,7 +4539,7 @@ function useDelayGroup(n, i = { open: !1 }) {
|
|
|
4539
4539
|
v
|
|
4540
4540
|
]), useIsoLayoutEffect(() => () => {
|
|
4541
4541
|
g.current = null;
|
|
4542
|
-
}, [g]), React
|
|
4542
|
+
}, [g]), React.useMemo(() => ({
|
|
4543
4543
|
hasProvider: _,
|
|
4544
4544
|
delayRef: f,
|
|
4545
4545
|
isInstantPhase: y
|
|
@@ -4552,8 +4552,8 @@ function useDelayGroup(n, i = { open: !1 }) {
|
|
|
4552
4552
|
function ownerDocument(t) {
|
|
4553
4553
|
return t?.ownerDocument || document;
|
|
4554
4554
|
}
|
|
4555
|
-
const FocusGuard = /* @__PURE__ */ React
|
|
4556
|
-
let [s, c] = React
|
|
4555
|
+
const FocusGuard = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
4556
|
+
let [s, c] = React.useState();
|
|
4557
4557
|
useIsoLayoutEffect(() => {
|
|
4558
4558
|
isSafari && c("button");
|
|
4559
4559
|
}, []);
|
|
@@ -4619,12 +4619,12 @@ function markOthers(t, n = !1, i = !1) {
|
|
|
4619
4619
|
let s = getDocument(t[0]).body;
|
|
4620
4620
|
return applyAttributeToOthers(t.concat(Array.from(s.querySelectorAll("[aria-live]"))), s, n, i);
|
|
4621
4621
|
}
|
|
4622
|
-
var PortalContext = /* @__PURE__ */ React
|
|
4622
|
+
var PortalContext = /* @__PURE__ */ React.createContext(null);
|
|
4623
4623
|
process.env.NODE_ENV !== "production" && (PortalContext.displayName = "PortalContext");
|
|
4624
|
-
const usePortalContext = () => React
|
|
4624
|
+
const usePortalContext = () => React.useContext(PortalContext);
|
|
4625
4625
|
var attr = createAttribute("portal");
|
|
4626
4626
|
function useFloatingPortalNode(n = {}) {
|
|
4627
|
-
let { ref: i, container: s, componentProps: c = EMPTY_OBJECT, elementProps: l, elementState: u } = n, d = useId(), f = usePortalContext()?.portalNode, [h, g] = React
|
|
4627
|
+
let { ref: i, container: s, componentProps: c = EMPTY_OBJECT, elementProps: l, elementState: u } = n, d = useId(), f = usePortalContext()?.portalNode, [h, g] = React.useState(null), [_, v] = React.useState(null), y = React.useRef(null);
|
|
4628
4628
|
useIsoLayoutEffect(() => {
|
|
4629
4629
|
if (s === null) {
|
|
4630
4630
|
y.current && (y.current = null, v(null), g(null));
|
|
@@ -4655,14 +4655,14 @@ function useFloatingPortalNode(n = {}) {
|
|
|
4655
4655
|
portalSubtree: h && b ? /* @__PURE__ */ ReactDOM.createPortal(b, h) : null
|
|
4656
4656
|
};
|
|
4657
4657
|
}
|
|
4658
|
-
const FloatingPortal = /* @__PURE__ */ React
|
|
4658
|
+
const FloatingPortal = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
4659
4659
|
let { children: s, container: c, className: l, render: u, renderGuards: d, ...f } = n, { portalNode: h, portalSubtree: g } = useFloatingPortalNode({
|
|
4660
4660
|
container: c,
|
|
4661
4661
|
ref: i,
|
|
4662
4662
|
componentProps: n,
|
|
4663
4663
|
elementProps: f
|
|
4664
|
-
}), _ = React
|
|
4665
|
-
React
|
|
4664
|
+
}), _ = React.useRef(null), v = React.useRef(null), y = React.useRef(null), b = React.useRef(null), [x, S] = React.useState(null), C = x?.modal, w = x?.open, T = typeof d == "boolean" ? d : !!x && !x.modal && x.open && !!h;
|
|
4665
|
+
React.useEffect(() => {
|
|
4666
4666
|
if (!h || C) return;
|
|
4667
4667
|
function t(t) {
|
|
4668
4668
|
h && isOutsideEvent(t) && (t.type === "focusin" ? enableFocusInside : disableFocusInside)(h);
|
|
@@ -4670,10 +4670,10 @@ const FloatingPortal = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
4670
4670
|
return h.addEventListener("focusin", t, !0), h.addEventListener("focusout", t, !0), () => {
|
|
4671
4671
|
h.removeEventListener("focusin", t, !0), h.removeEventListener("focusout", t, !0);
|
|
4672
4672
|
};
|
|
4673
|
-
}, [h, C]), React
|
|
4673
|
+
}, [h, C]), React.useEffect(() => {
|
|
4674
4674
|
!h || w || enableFocusInside(h);
|
|
4675
4675
|
}, [w, h]);
|
|
4676
|
-
let E = React
|
|
4676
|
+
let E = React.useMemo(() => ({
|
|
4677
4677
|
beforeOutsideRef: _,
|
|
4678
4678
|
afterOutsideRef: v,
|
|
4679
4679
|
beforeInsideRef: y,
|
|
@@ -4681,7 +4681,7 @@ const FloatingPortal = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
4681
4681
|
portalNode: h,
|
|
4682
4682
|
setFocusManagerState: S
|
|
4683
4683
|
}), [h]);
|
|
4684
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(React
|
|
4684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(React.Fragment, { children: [g, /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(PortalContext.Provider, {
|
|
4685
4685
|
value: E,
|
|
4686
4686
|
children: [
|
|
4687
4687
|
T && h && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGuard, {
|
|
@@ -4738,11 +4738,11 @@ function handleTabIndex(t, n) {
|
|
|
4738
4738
|
n.current.includes("floating") || s.length === 0 ? c !== "0" && t.setAttribute("tabindex", "0") : (c !== "-1" || t.hasAttribute("data-tabindex") && t.getAttribute("data-tabindex") !== "-1") && (t.setAttribute("tabindex", "-1"), t.setAttribute("data-tabindex", "-1"));
|
|
4739
4739
|
}
|
|
4740
4740
|
function FloatingFocusManager(n) {
|
|
4741
|
-
let { context: i, children: s, disabled: c = !1, order: l = ["content"], initialFocus: u = !0, returnFocus: d = !0, restoreFocus: f = !1, modal: m = !0, closeOnFocusOut: h = !0, openInteractionType: g = "", getInsideElements: _ = () => [], nextFocusableElement: v, previousFocusableElement: y, beforeContentFocusGuardRef: b, externalTree: x } = n, S = "rootStore" in i ? i.rootStore : i, w = S.useState("open"), T = S.useState("domReferenceElement"), E = S.useState("floatingElement"), { events: D, dataRef: O } = S.context, k = useStableCallback(() => O.current.floatingContext?.nodeId), A = useStableCallback(_), j = u === !1, M = isTypeableCombobox(T) && j, N = useValueAsRef(l), P = useValueAsRef(u), F = useValueAsRef(d), I = useValueAsRef(g), L = useFloatingTree(x), R = usePortalContext(), z = React
|
|
4741
|
+
let { context: i, children: s, disabled: c = !1, order: l = ["content"], initialFocus: u = !0, returnFocus: d = !0, restoreFocus: f = !1, modal: m = !0, closeOnFocusOut: h = !0, openInteractionType: g = "", getInsideElements: _ = () => [], nextFocusableElement: v, previousFocusableElement: y, beforeContentFocusGuardRef: b, externalTree: x } = n, S = "rootStore" in i ? i.rootStore : i, w = S.useState("open"), T = S.useState("domReferenceElement"), E = S.useState("floatingElement"), { events: D, dataRef: O } = S.context, k = useStableCallback(() => O.current.floatingContext?.nodeId), A = useStableCallback(_), j = u === !1, M = isTypeableCombobox(T) && j, N = useValueAsRef(l), P = useValueAsRef(u), F = useValueAsRef(d), I = useValueAsRef(g), L = useFloatingTree(x), R = usePortalContext(), z = React.useRef(null), B = React.useRef(null), V = React.useRef(!1), H = React.useRef(!1), U = React.useRef(!1), W = React.useRef(-1), G = React.useRef(""), K = React.useRef(""), q = useTimeout(), J = useTimeout(), Y = useAnimationFrame(), X = R != null, Z = getFloatingFocusElement(E), Q = useStableCallback((t = Z) => t ? tabbable(t, getTabbableOptions()) : []), fh = useStableCallback((t) => {
|
|
4742
4742
|
let n = Q(t);
|
|
4743
4743
|
return N.current.map(() => n).filter(Boolean).flat();
|
|
4744
4744
|
});
|
|
4745
|
-
React
|
|
4745
|
+
React.useEffect(() => {
|
|
4746
4746
|
if (c || !m) return;
|
|
4747
4747
|
function t(t) {
|
|
4748
4748
|
t.key === "Tab" && contains(Z, activeElement(getDocument(Z))) && Q().length === 0 && !M && stopEvent(t);
|
|
@@ -4760,7 +4760,7 @@ function FloatingFocusManager(n) {
|
|
|
4760
4760
|
M,
|
|
4761
4761
|
Q,
|
|
4762
4762
|
fh
|
|
4763
|
-
]), React
|
|
4763
|
+
]), React.useEffect(() => {
|
|
4764
4764
|
if (c || !E) return;
|
|
4765
4765
|
function t(t) {
|
|
4766
4766
|
let n = getTarget(t), i = Q().indexOf(n);
|
|
@@ -4773,7 +4773,7 @@ function FloatingFocusManager(n) {
|
|
|
4773
4773
|
c,
|
|
4774
4774
|
E,
|
|
4775
4775
|
Q
|
|
4776
|
-
]), React
|
|
4776
|
+
]), React.useEffect(() => {
|
|
4777
4777
|
if (c || !w) return;
|
|
4778
4778
|
let t = getDocument(Z);
|
|
4779
4779
|
function n() {
|
|
@@ -4796,7 +4796,7 @@ function FloatingFocusManager(n) {
|
|
|
4796
4796
|
Z,
|
|
4797
4797
|
w,
|
|
4798
4798
|
R
|
|
4799
|
-
]), React
|
|
4799
|
+
]), React.useEffect(() => {
|
|
4800
4800
|
if (c || !h) return;
|
|
4801
4801
|
function t() {
|
|
4802
4802
|
H.current = !0, J.start(0, () => {
|
|
@@ -4861,8 +4861,8 @@ function FloatingFocusManager(n) {
|
|
|
4861
4861
|
J,
|
|
4862
4862
|
Y
|
|
4863
4863
|
]);
|
|
4864
|
-
let ph = React
|
|
4865
|
-
React
|
|
4864
|
+
let ph = React.useRef(null), $ = React.useRef(null), mh = useMergedRefs(ph, b, R?.beforeInsideRef), hh = useMergedRefs($, R?.afterInsideRef);
|
|
4865
|
+
React.useEffect(() => {
|
|
4866
4866
|
if (c || !E || !w) return;
|
|
4867
4867
|
let t = Array.from(R?.portalNode?.querySelectorAll(`[${createAttribute("portal")}]`) || []), n = markOthers([
|
|
4868
4868
|
E,
|
|
@@ -4959,11 +4959,11 @@ function FloatingFocusManager(n) {
|
|
|
4959
4959
|
X,
|
|
4960
4960
|
T,
|
|
4961
4961
|
k
|
|
4962
|
-
]), React
|
|
4962
|
+
]), React.useEffect(() => {
|
|
4963
4963
|
queueMicrotask(() => {
|
|
4964
4964
|
V.current = !1;
|
|
4965
4965
|
});
|
|
4966
|
-
}, [c]), React
|
|
4966
|
+
}, [c]), React.useEffect(() => {
|
|
4967
4967
|
if (c || !w) return;
|
|
4968
4968
|
function t(t) {
|
|
4969
4969
|
getTarget(t)?.closest("[data-base-ui-click-trigger]") && (H.current = !0);
|
|
@@ -5004,7 +5004,7 @@ function FloatingFocusManager(n) {
|
|
|
5004
5004
|
N
|
|
5005
5005
|
]);
|
|
5006
5006
|
let gh = !c && (m ? !M : !0) && (X || m);
|
|
5007
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(React
|
|
5007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(React.Fragment, { children: [
|
|
5008
5008
|
gh && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGuard, {
|
|
5009
5009
|
"data-type": "inside",
|
|
5010
5010
|
ref: mh,
|
|
@@ -5026,7 +5026,7 @@ function FloatingFocusManager(n) {
|
|
|
5026
5026
|
] });
|
|
5027
5027
|
}
|
|
5028
5028
|
function useClick(n, i = {}) {
|
|
5029
|
-
let s = "rootStore" in n ? n.rootStore : n, c = s.context.dataRef, { enabled: l = !0, event: u = "click", toggle: d = !0, ignoreMouse: f = !1, stickIfOpen: m = !0, touchOpenDelay: h = 0 } = i, g = React
|
|
5029
|
+
let s = "rootStore" in n ? n.rootStore : n, c = s.context.dataRef, { enabled: l = !0, event: u = "click", toggle: d = !0, ignoreMouse: f = !1, stickIfOpen: m = !0, touchOpenDelay: h = 0 } = i, g = React.useRef(void 0), _ = useAnimationFrame(), v = useTimeout(), y = React.useMemo(() => ({
|
|
5030
5030
|
onPointerDown(t) {
|
|
5031
5031
|
g.current = t.pointerType;
|
|
5032
5032
|
},
|
|
@@ -5076,7 +5076,7 @@ function useClick(n, i = {}) {
|
|
|
5076
5076
|
v,
|
|
5077
5077
|
h
|
|
5078
5078
|
]);
|
|
5079
|
-
return React
|
|
5079
|
+
return React.useMemo(() => l ? { reference: y } : EMPTY_OBJECT, [l, y]);
|
|
5080
5080
|
}
|
|
5081
5081
|
function createVirtualElement(t, n) {
|
|
5082
5082
|
let i = null, s = null, c = !1;
|
|
@@ -5106,7 +5106,7 @@ function isMouseBasedEvent(t) {
|
|
|
5106
5106
|
return t != null && t.clientX != null;
|
|
5107
5107
|
}
|
|
5108
5108
|
function useClientPoint(n, i = {}) {
|
|
5109
|
-
let s = "rootStore" in n ? n.rootStore : n, c = s.useState("open"), l = s.useState("floatingElement"), u = s.useState("domReferenceElement"), d = s.context.dataRef, { enabled: f = !0, axis: m = "both", x: h = null, y: g = null } = i, _ = React
|
|
5109
|
+
let s = "rootStore" in n ? n.rootStore : n, c = s.useState("open"), l = s.useState("floatingElement"), u = s.useState("domReferenceElement"), d = s.context.dataRef, { enabled: f = !0, axis: m = "both", x: h = null, y: g = null } = i, _ = React.useRef(!1), v = React.useRef(null), [y, b] = React.useState(), [x, S] = React.useState([]), C = useStableCallback((t, n) => {
|
|
5110
5110
|
_.current || d.current.openEvent && !isMouseBasedEvent(d.current.openEvent) || s.set("positionReference", createVirtualElement(u, {
|
|
5111
5111
|
x: t,
|
|
5112
5112
|
y: n,
|
|
@@ -5116,7 +5116,7 @@ function useClientPoint(n, i = {}) {
|
|
|
5116
5116
|
}));
|
|
5117
5117
|
}), w = useStableCallback((t) => {
|
|
5118
5118
|
h != null || g != null || (c ? v.current || S([]) : C(t.clientX, t.clientY));
|
|
5119
|
-
}), T = isMouseLikePointerType(y) ? l : c, E = React
|
|
5119
|
+
}), T = isMouseLikePointerType(y) ? l : c, E = React.useCallback(() => {
|
|
5120
5120
|
if (!T || !f || h != null || g != null) return;
|
|
5121
5121
|
let t = getWindow(l);
|
|
5122
5122
|
function n(i) {
|
|
@@ -5141,9 +5141,9 @@ function useClientPoint(n, i = {}) {
|
|
|
5141
5141
|
s,
|
|
5142
5142
|
C
|
|
5143
5143
|
]);
|
|
5144
|
-
React
|
|
5144
|
+
React.useEffect(() => E(), [E, x]), React.useEffect(() => {
|
|
5145
5145
|
f && !l && (_.current = !1);
|
|
5146
|
-
}, [f, l]), React
|
|
5146
|
+
}, [f, l]), React.useEffect(() => {
|
|
5147
5147
|
!f && c && (_.current = !0);
|
|
5148
5148
|
}, [f, c]), useIsoLayoutEffect(() => {
|
|
5149
5149
|
f && (h != null || g != null) && (_.current = !1, C(h, g));
|
|
@@ -5153,7 +5153,7 @@ function useClientPoint(n, i = {}) {
|
|
|
5153
5153
|
g,
|
|
5154
5154
|
C
|
|
5155
5155
|
]);
|
|
5156
|
-
let D = React
|
|
5156
|
+
let D = React.useMemo(() => {
|
|
5157
5157
|
function t(t) {
|
|
5158
5158
|
b(t.pointerType);
|
|
5159
5159
|
}
|
|
@@ -5164,7 +5164,7 @@ function useClientPoint(n, i = {}) {
|
|
|
5164
5164
|
onMouseEnter: w
|
|
5165
5165
|
};
|
|
5166
5166
|
}, [w]);
|
|
5167
|
-
return React
|
|
5167
|
+
return React.useMemo(() => f ? { reference: D } : {}, [f, D]);
|
|
5168
5168
|
}
|
|
5169
5169
|
function computeCoordsFromPlacement(t, n, i) {
|
|
5170
5170
|
let { reference: s, floating: c } = t, l = getSideAxis(n), u = getAlignmentAxis(n), d = getAxisLength(u), f = getSide(n), m = l === "y", h = s.x + s.width / 2 - c.width / 2, g = s.y + s.height / 2 - c.height / 2, _ = s[d] / 2 - c[d] / 2, v;
|
|
@@ -5849,27 +5849,27 @@ function roundByDPR(t, n) {
|
|
|
5849
5849
|
return Math.round(n * i) / i;
|
|
5850
5850
|
}
|
|
5851
5851
|
function useLatestRef(n) {
|
|
5852
|
-
let i = React
|
|
5852
|
+
let i = React.useRef(n);
|
|
5853
5853
|
return index(() => {
|
|
5854
5854
|
i.current = n;
|
|
5855
5855
|
}), i;
|
|
5856
5856
|
}
|
|
5857
5857
|
function useFloating$1(n) {
|
|
5858
5858
|
n === void 0 && (n = {});
|
|
5859
|
-
let { placement: i = "bottom", strategy: s = "absolute", middleware: c = [], platform: l, elements: { reference: u, floating: d } = {}, transform: f = !0, whileElementsMounted: h, open: g } = n, [_, v] = React
|
|
5859
|
+
let { placement: i = "bottom", strategy: s = "absolute", middleware: c = [], platform: l, elements: { reference: u, floating: d } = {}, transform: f = !0, whileElementsMounted: h, open: g } = n, [_, v] = React.useState({
|
|
5860
5860
|
x: 0,
|
|
5861
5861
|
y: 0,
|
|
5862
5862
|
strategy: s,
|
|
5863
5863
|
placement: i,
|
|
5864
5864
|
middlewareData: {},
|
|
5865
5865
|
isPositioned: !1
|
|
5866
|
-
}), [y, b] = React
|
|
5866
|
+
}), [y, b] = React.useState(c);
|
|
5867
5867
|
deepEqual(y, c) || b(c);
|
|
5868
|
-
let [x, S] = React
|
|
5868
|
+
let [x, S] = React.useState(null), [C, w] = React.useState(null), T = React.useCallback((t) => {
|
|
5869
5869
|
t !== k.current && (k.current = t, S(t));
|
|
5870
|
-
}, []), E = React
|
|
5870
|
+
}, []), E = React.useCallback((t) => {
|
|
5871
5871
|
t !== A.current && (A.current = t, w(t));
|
|
5872
|
-
}, []), D = u || x, O = d || C, k = React
|
|
5872
|
+
}, []), D = u || x, O = d || C, k = React.useRef(null), A = React.useRef(null), j = React.useRef(_), M = h != null, N = useLatestRef(h), P = useLatestRef(l), F = useLatestRef(g), I = React.useCallback(() => {
|
|
5873
5873
|
if (!k.current || !A.current) return;
|
|
5874
5874
|
let t = {
|
|
5875
5875
|
placement: i,
|
|
@@ -5898,7 +5898,7 @@ function useFloating$1(n) {
|
|
|
5898
5898
|
isPositioned: !1
|
|
5899
5899
|
})));
|
|
5900
5900
|
}, [g]);
|
|
5901
|
-
let L = React
|
|
5901
|
+
let L = React.useRef(!1);
|
|
5902
5902
|
index(() => (L.current = !0, () => {
|
|
5903
5903
|
L.current = !1;
|
|
5904
5904
|
}), []), index(() => {
|
|
@@ -5913,15 +5913,15 @@ function useFloating$1(n) {
|
|
|
5913
5913
|
N,
|
|
5914
5914
|
M
|
|
5915
5915
|
]);
|
|
5916
|
-
let R = React
|
|
5916
|
+
let R = React.useMemo(() => ({
|
|
5917
5917
|
reference: k,
|
|
5918
5918
|
floating: A,
|
|
5919
5919
|
setReference: T,
|
|
5920
5920
|
setFloating: E
|
|
5921
|
-
}), [T, E]), z = React
|
|
5921
|
+
}), [T, E]), z = React.useMemo(() => ({
|
|
5922
5922
|
reference: D,
|
|
5923
5923
|
floating: O
|
|
5924
|
-
}), [D, O]), B = React
|
|
5924
|
+
}), [D, O]), B = React.useMemo(() => {
|
|
5925
5925
|
let t = {
|
|
5926
5926
|
position: s,
|
|
5927
5927
|
left: 0,
|
|
@@ -5945,7 +5945,7 @@ function useFloating$1(n) {
|
|
|
5945
5945
|
_.x,
|
|
5946
5946
|
_.y
|
|
5947
5947
|
]);
|
|
5948
|
-
return React
|
|
5948
|
+
return React.useMemo(() => ({
|
|
5949
5949
|
..._,
|
|
5950
5950
|
update: I,
|
|
5951
5951
|
refs: R,
|
|
@@ -5988,9 +5988,9 @@ function normalizeProp(t) {
|
|
|
5988
5988
|
};
|
|
5989
5989
|
}
|
|
5990
5990
|
function useDismiss(n, i = {}) {
|
|
5991
|
-
let s = "rootStore" in n ? n.rootStore : n, c = s.useState("open"), l = s.useState("floatingElement"), u = s.useState("referenceElement"), d = s.useState("domReferenceElement"), { onOpenChange: f, dataRef: m } = s.context, { enabled: h = !0, escapeKey: g = !0, outsidePress: _ = !0, outsidePressEvent: v = "sloppy", referencePress: y = !1, referencePressEvent: b = "sloppy", ancestorScroll: x = !1, bubbles: S, externalTree: C } = i, w = useFloatingTree(C), T = useStableCallback(typeof _ == "function" ? _ : () => !1), E = typeof _ == "function" ? T : _, D = React
|
|
5991
|
+
let s = "rootStore" in n ? n.rootStore : n, c = s.useState("open"), l = s.useState("floatingElement"), u = s.useState("referenceElement"), d = s.useState("domReferenceElement"), { onOpenChange: f, dataRef: m } = s.context, { enabled: h = !0, escapeKey: g = !0, outsidePress: _ = !0, outsidePressEvent: v = "sloppy", referencePress: y = !1, referencePressEvent: b = "sloppy", ancestorScroll: x = !1, bubbles: S, externalTree: C } = i, w = useFloatingTree(C), T = useStableCallback(typeof _ == "function" ? _ : () => !1), E = typeof _ == "function" ? T : _, D = React.useRef(!1), { escapeKey: O, outsidePress: k } = normalizeProp(S), A = React.useRef(null), j = useTimeout(), M = useTimeout(), N = useStableCallback(() => {
|
|
5992
5992
|
M.clear(), m.current.insideReactTree = !1;
|
|
5993
|
-
}), P = React
|
|
5993
|
+
}), P = React.useRef(!1), F = React.useRef(""), I = useStableCallback((t) => {
|
|
5994
5994
|
F.current = t.pointerType;
|
|
5995
5995
|
}), L = useStableCallback(() => {
|
|
5996
5996
|
let t = F.current, n = t === "pen" || !t ? "mouse" : t, i = typeof v == "function" ? v() : v;
|
|
@@ -6093,7 +6093,7 @@ function useDismiss(n, i = {}) {
|
|
|
6093
6093
|
}
|
|
6094
6094
|
n?.addEventListener(t.type, i);
|
|
6095
6095
|
});
|
|
6096
|
-
React
|
|
6096
|
+
React.useEffect(() => {
|
|
6097
6097
|
if (!c || !h) return;
|
|
6098
6098
|
m.current.__escapeKeyBubbles = O, m.current.__outsidePressBubbles = k;
|
|
6099
6099
|
let t = new Timeout();
|
|
@@ -6140,8 +6140,8 @@ function useDismiss(n, i = {}) {
|
|
|
6140
6140
|
Y,
|
|
6141
6141
|
I,
|
|
6142
6142
|
s
|
|
6143
|
-
]), React
|
|
6144
|
-
let X = React
|
|
6143
|
+
]), React.useEffect(N, [E, N]);
|
|
6144
|
+
let X = React.useMemo(() => ({
|
|
6145
6145
|
onKeyDown: R,
|
|
6146
6146
|
...y && {
|
|
6147
6147
|
[bubbleHandlerKeys[b]]: (t) => {
|
|
@@ -6159,7 +6159,7 @@ function useDismiss(n, i = {}) {
|
|
|
6159
6159
|
]), Z = useStableCallback((t) => {
|
|
6160
6160
|
let n = getTarget(t.nativeEvent);
|
|
6161
6161
|
!contains(s.select("floatingElement"), n) || t.button !== 0 || (D.current = !0);
|
|
6162
|
-
}), Q = React
|
|
6162
|
+
}), Q = React.useMemo(() => ({
|
|
6163
6163
|
onKeyDown: R,
|
|
6164
6164
|
onPointerDown: Z,
|
|
6165
6165
|
onMouseDown: Z,
|
|
@@ -6175,7 +6175,7 @@ function useDismiss(n, i = {}) {
|
|
|
6175
6175
|
Z,
|
|
6176
6176
|
B
|
|
6177
6177
|
]);
|
|
6178
|
-
return React
|
|
6178
|
+
return React.useMemo(() => h ? {
|
|
6179
6179
|
reference: X,
|
|
6180
6180
|
floating: Q,
|
|
6181
6181
|
trigger: X
|
|
@@ -6653,7 +6653,7 @@ function useStore$1(t, n, i, s, c) {
|
|
|
6653
6653
|
return useStoreImplementation(t, n, i, s, c);
|
|
6654
6654
|
}
|
|
6655
6655
|
function useStoreR19(n, i, s, c, l) {
|
|
6656
|
-
let u = React
|
|
6656
|
+
let u = React.useCallback(() => i(n.getSnapshot(), s, c, l), [
|
|
6657
6657
|
n,
|
|
6658
6658
|
i,
|
|
6659
6659
|
s,
|
|
@@ -6707,7 +6707,7 @@ var Store$1 = class t {
|
|
|
6707
6707
|
}
|
|
6708
6708
|
controlledValues = /* @__PURE__ */ new Map();
|
|
6709
6709
|
useSyncedValue(n, i) {
|
|
6710
|
-
React
|
|
6710
|
+
React.useDebugValue(n), useIsoLayoutEffect(() => {
|
|
6711
6711
|
this.state[n] !== i && this.set(n, i);
|
|
6712
6712
|
}, [n, i]);
|
|
6713
6713
|
}
|
|
@@ -6718,8 +6718,8 @@ var Store$1 = class t {
|
|
|
6718
6718
|
}
|
|
6719
6719
|
useSyncedValues(n) {
|
|
6720
6720
|
if (process.env.NODE_ENV !== "production") {
|
|
6721
|
-
React
|
|
6722
|
-
let i = React
|
|
6721
|
+
React.useDebugValue(n, (t) => Object.keys(t));
|
|
6722
|
+
let i = React.useRef(Object.keys(n)).current, s = Object.keys(n);
|
|
6723
6723
|
(i.length !== s.length || i.some((t, n) => t !== s[n])) && console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.");
|
|
6724
6724
|
}
|
|
6725
6725
|
useIsoLayoutEffect(() => {
|
|
@@ -6727,7 +6727,7 @@ var Store$1 = class t {
|
|
|
6727
6727
|
}, Object.values(n));
|
|
6728
6728
|
}
|
|
6729
6729
|
useControlledProp(n, i, s) {
|
|
6730
|
-
React
|
|
6730
|
+
React.useDebugValue(n);
|
|
6731
6731
|
let c = i !== void 0;
|
|
6732
6732
|
if (process.env.NODE_ENV !== "production") {
|
|
6733
6733
|
let t = this.controlledValues.get(n);
|
|
@@ -6775,17 +6775,17 @@ var Store$1 = class t {
|
|
|
6775
6775
|
return c(this.state, n, i, s);
|
|
6776
6776
|
};
|
|
6777
6777
|
useState = (n, i, s, c) => {
|
|
6778
|
-
React
|
|
6778
|
+
React.useDebugValue(n);
|
|
6779
6779
|
let l = this.selectors[n];
|
|
6780
6780
|
return useStore$1(this, l, i, s, c);
|
|
6781
6781
|
};
|
|
6782
6782
|
useContextCallback(n, i) {
|
|
6783
|
-
React
|
|
6783
|
+
React.useDebugValue(n);
|
|
6784
6784
|
let s = useStableCallback(i ?? NOOP);
|
|
6785
6785
|
this.context[n] = s;
|
|
6786
6786
|
}
|
|
6787
6787
|
useStateSetter(n) {
|
|
6788
|
-
let i = React
|
|
6788
|
+
let i = React.useRef(void 0);
|
|
6789
6789
|
return i.current === void 0 && (i.current = (t) => {
|
|
6790
6790
|
this.set(n, t);
|
|
6791
6791
|
}), i.current;
|
|
@@ -6804,8 +6804,8 @@ var Store$1 = class t {
|
|
|
6804
6804
|
}
|
|
6805
6805
|
};
|
|
6806
6806
|
function useForcedRerendering() {
|
|
6807
|
-
let [, n] = React
|
|
6808
|
-
return React
|
|
6807
|
+
let [, n] = React.useState({});
|
|
6808
|
+
return React.useCallback(() => {
|
|
6809
6809
|
n({});
|
|
6810
6810
|
}, []);
|
|
6811
6811
|
}
|
|
@@ -6846,8 +6846,8 @@ var selectors$2 = {
|
|
|
6846
6846
|
};
|
|
6847
6847
|
};
|
|
6848
6848
|
function useTriggerRegistration(n, i) {
|
|
6849
|
-
let s = React
|
|
6850
|
-
return React
|
|
6849
|
+
let s = React.useRef(null);
|
|
6850
|
+
return React.useCallback((t) => {
|
|
6851
6851
|
n !== void 0 && (s.current !== null && (i.context.triggerElements.delete(s.current), s.current = null), t !== null && (s.current = n, i.context.triggerElements.add(n, t)));
|
|
6852
6852
|
}, [i, n]);
|
|
6853
6853
|
}
|
|
@@ -7024,7 +7024,7 @@ function useFloating(n = {}) {
|
|
|
7024
7024
|
reference: l.useState("referenceElement"),
|
|
7025
7025
|
floating: l.useState("floatingElement"),
|
|
7026
7026
|
domReference: l.useState("domReferenceElement")
|
|
7027
|
-
}, [d, f] = React
|
|
7027
|
+
}, [d, f] = React.useState(null), m = React.useRef(null), h = useFloatingTree(s);
|
|
7028
7028
|
useIsoLayoutEffect(() => {
|
|
7029
7029
|
u.domReference && (m.current = u.domReference);
|
|
7030
7030
|
}, [u.domReference]);
|
|
@@ -7034,20 +7034,20 @@ function useFloating(n = {}) {
|
|
|
7034
7034
|
...u,
|
|
7035
7035
|
...d && { reference: d }
|
|
7036
7036
|
}
|
|
7037
|
-
}), _ = React
|
|
7037
|
+
}), _ = React.useCallback((t) => {
|
|
7038
7038
|
let n = isElement(t) ? {
|
|
7039
7039
|
getBoundingClientRect: () => t.getBoundingClientRect(),
|
|
7040
7040
|
getClientRects: () => t.getClientRects(),
|
|
7041
7041
|
contextElement: t
|
|
7042
7042
|
} : t;
|
|
7043
7043
|
f(n), g.refs.setReference(n);
|
|
7044
|
-
}, [g.refs]), [v, y] = React
|
|
7044
|
+
}, [g.refs]), [v, y] = React.useState(null), [b, x] = React.useState(null);
|
|
7045
7045
|
l.useSyncedValue("referenceElement", v), l.useSyncedValue("domReferenceElement", isElement(v) ? v : null), l.useSyncedValue("floatingElement", b);
|
|
7046
|
-
let S = React
|
|
7046
|
+
let S = React.useCallback((t) => {
|
|
7047
7047
|
(isElement(t) || t === null) && (m.current = t, y(t)), (isElement(g.refs.reference.current) || g.refs.reference.current === null || t !== null && !isElement(t)) && g.refs.setReference(t);
|
|
7048
|
-
}, [g.refs, y]), C = React
|
|
7048
|
+
}, [g.refs, y]), C = React.useCallback((t) => {
|
|
7049
7049
|
x(t), g.refs.setFloating(t);
|
|
7050
|
-
}, [g.refs]), w = React
|
|
7050
|
+
}, [g.refs]), w = React.useMemo(() => ({
|
|
7051
7051
|
...g.refs,
|
|
7052
7052
|
setReference: S,
|
|
7053
7053
|
setFloating: C,
|
|
@@ -7058,10 +7058,10 @@ function useFloating(n = {}) {
|
|
|
7058
7058
|
S,
|
|
7059
7059
|
C,
|
|
7060
7060
|
_
|
|
7061
|
-
]), T = React
|
|
7061
|
+
]), T = React.useMemo(() => ({
|
|
7062
7062
|
...g.elements,
|
|
7063
7063
|
domReference: u.domReference
|
|
7064
|
-
}), [g.elements, u.domReference]), E = l.useState("open"), D = l.useState("floatingId"), O = React
|
|
7064
|
+
}), [g.elements, u.domReference]), E = l.useState("open"), D = l.useState("floatingId"), O = React.useMemo(() => ({
|
|
7065
7065
|
...g,
|
|
7066
7066
|
dataRef: l.context.dataRef,
|
|
7067
7067
|
open: E,
|
|
@@ -7085,7 +7085,7 @@ function useFloating(n = {}) {
|
|
|
7085
7085
|
l.context.dataRef.current.floatingContext = O;
|
|
7086
7086
|
let t = h?.nodesRef.current.find((t) => t.id === i);
|
|
7087
7087
|
t && (t.context = O);
|
|
7088
|
-
}), React
|
|
7088
|
+
}), React.useMemo(() => ({
|
|
7089
7089
|
...g,
|
|
7090
7090
|
context: O,
|
|
7091
7091
|
refs: w,
|
|
@@ -7128,8 +7128,8 @@ function useSyncedFloatingRootContext(t) {
|
|
|
7128
7128
|
}
|
|
7129
7129
|
var isMacSafari = isMac && isSafari;
|
|
7130
7130
|
function useFocus(n, i = {}) {
|
|
7131
|
-
let s = "rootStore" in n ? n.rootStore : n, { events: c, dataRef: l } = s.context, { enabled: u = !0, visibleOnly: d = !0 } = i, f = React
|
|
7132
|
-
React
|
|
7131
|
+
let s = "rootStore" in n ? n.rootStore : n, { events: c, dataRef: l } = s.context, { enabled: u = !0, visibleOnly: d = !0 } = i, f = React.useRef(!1), m = useTimeout(), h = React.useRef(!0);
|
|
7132
|
+
React.useEffect(() => {
|
|
7133
7133
|
let t = s.select("domReferenceElement");
|
|
7134
7134
|
if (!u) return;
|
|
7135
7135
|
let n = getWindow(t);
|
|
@@ -7145,7 +7145,7 @@ function useFocus(n, i = {}) {
|
|
|
7145
7145
|
return n.addEventListener("blur", i), isMacSafari && (n.addEventListener("keydown", c, !0), n.addEventListener("pointerdown", l, !0)), () => {
|
|
7146
7146
|
n.removeEventListener("blur", i), isMacSafari && (n.removeEventListener("keydown", c, !0), n.removeEventListener("pointerdown", l, !0));
|
|
7147
7147
|
};
|
|
7148
|
-
}, [s, u]), React
|
|
7148
|
+
}, [s, u]), React.useEffect(() => {
|
|
7149
7149
|
if (!u) return;
|
|
7150
7150
|
function t(t) {
|
|
7151
7151
|
(t.reason === "trigger-press" || t.reason === "escape-key") && (f.current = !0);
|
|
@@ -7154,7 +7154,7 @@ function useFocus(n, i = {}) {
|
|
|
7154
7154
|
c.off("openchange", t);
|
|
7155
7155
|
};
|
|
7156
7156
|
}, [c, u]);
|
|
7157
|
-
let g = React
|
|
7157
|
+
let g = React.useMemo(() => ({
|
|
7158
7158
|
onMouseLeave() {
|
|
7159
7159
|
f.current = !1;
|
|
7160
7160
|
},
|
|
@@ -7182,7 +7182,7 @@ function useFocus(n, i = {}) {
|
|
|
7182
7182
|
d,
|
|
7183
7183
|
m
|
|
7184
7184
|
]);
|
|
7185
|
-
return React
|
|
7185
|
+
return React.useMemo(() => u ? {
|
|
7186
7186
|
reference: g,
|
|
7187
7187
|
trigger: g
|
|
7188
7188
|
} : {}, [u, g]);
|
|
@@ -7193,8 +7193,8 @@ function isInteractiveElement(t) {
|
|
|
7193
7193
|
return t ? !!t.closest(interactiveSelector) : !1;
|
|
7194
7194
|
}
|
|
7195
7195
|
function useHoverInteractionSharedState(n) {
|
|
7196
|
-
let i = React
|
|
7197
|
-
return React
|
|
7196
|
+
let i = React.useRef(void 0), s = React.useRef(!1), c = React.useRef(void 0), l = React.useRef(!0), u = React.useRef(!1), d = React.useRef(() => {}), f = React.useRef(!1), m = useTimeout(), h = useTimeout(), g = React.useRef(void 0);
|
|
7197
|
+
return React.useMemo(() => {
|
|
7198
7198
|
let t = n.context.dataRef.current;
|
|
7199
7199
|
return t.hoverInteractionState ||= {
|
|
7200
7200
|
pointerTypeRef: i,
|
|
@@ -7227,7 +7227,7 @@ function useHoverFloatingInteraction(n, i = {}) {
|
|
|
7227
7227
|
let s = "rootStore" in n ? n.rootStore : n, c = s.useState("open"), l = s.useState("floatingElement"), u = s.useState("domReferenceElement"), { dataRef: d } = s.context, { enabled: f = !0, closeDelay: m = 0, externalTree: h } = i, { pointerTypeRef: g, interactedInsideRef: _, handlerRef: v, performedPointerEventsMutationRef: y, unbindMouseMoveRef: b, restTimeoutPendingRef: x, openChangeTimeout: S, handleCloseOptionsRef: C } = useHoverInteractionSharedState(s), w = useFloatingTree(h), T = useFloatingParentNodeId(), E = useStableCallback(() => _.current ? !0 : d.current.openEvent ? clickLikeEvents.has(d.current.openEvent.type) : !1), D = useStableCallback(() => {
|
|
7228
7228
|
let t = d.current.openEvent?.type;
|
|
7229
7229
|
return t?.includes("mouse") && t !== "mousedown";
|
|
7230
|
-
}), O = React
|
|
7230
|
+
}), O = React.useCallback((t, n = !0) => {
|
|
7231
7231
|
let i = getDelay$1(m, g.current);
|
|
7232
7232
|
i && !v.current ? S.start(i, () => s.setOpen(!1, createChangeEventDetails(triggerHover, t))) : n && (S.clear(), s.setOpen(!1, createChangeEventDetails(triggerHover, t)));
|
|
7233
7233
|
}, [
|
|
@@ -7259,9 +7259,9 @@ function useHoverFloatingInteraction(n, i = {}) {
|
|
|
7259
7259
|
_,
|
|
7260
7260
|
k,
|
|
7261
7261
|
A
|
|
7262
|
-
]), React
|
|
7262
|
+
]), React.useEffect(() => () => {
|
|
7263
7263
|
k();
|
|
7264
|
-
}, [k]), React
|
|
7264
|
+
}, [k]), React.useEffect(() => A, [A]), useIsoLayoutEffect(() => {
|
|
7265
7265
|
if (f && c && C.current?.blockPointerEvents && D() && isElement(u) && l) {
|
|
7266
7266
|
y.current = !0;
|
|
7267
7267
|
let t = getDocument(l).body;
|
|
@@ -7281,7 +7281,7 @@ function useHoverFloatingInteraction(n, i = {}) {
|
|
|
7281
7281
|
w,
|
|
7282
7282
|
T,
|
|
7283
7283
|
y
|
|
7284
|
-
]), React
|
|
7284
|
+
]), React.useEffect(() => {
|
|
7285
7285
|
if (!f) return;
|
|
7286
7286
|
function t(t) {
|
|
7287
7287
|
if (E() || !d.current.floatingContext || !s.select("open")) return;
|
|
@@ -7310,7 +7310,7 @@ var EMPTY_REF = { current: null };
|
|
|
7310
7310
|
function useHoverReferenceInteraction(n, i = {}) {
|
|
7311
7311
|
let s = "rootStore" in n ? n.rootStore : n, { dataRef: c, events: l } = s.context, { enabled: u = !0, delay: d = 0, handleClose: f = null, mouseOnly: h = !1, restMs: g = 0, move: _ = !0, triggerElementRef: v = EMPTY_REF, externalTree: y, isActiveTrigger: b = !0 } = i, x = useFloatingTree(y), { pointerTypeRef: S, interactedInsideRef: C, handlerRef: w, blockMouseMoveRef: T, performedPointerEventsMutationRef: E, unbindMouseMoveRef: D, restTimeoutPendingRef: O, openChangeTimeout: k, restTimeout: A, handleCloseOptionsRef: j } = useHoverInteractionSharedState(s), M = useValueAsRef(f), N = useValueAsRef(d), P = useValueAsRef(g);
|
|
7312
7312
|
b && (j.current = M.current?.__options);
|
|
7313
|
-
let F = useStableCallback(() => C.current ? !0 : c.current.openEvent ? ["click", "mousedown"].includes(c.current.openEvent.type) : !1), I = React
|
|
7313
|
+
let F = useStableCallback(() => C.current ? !0 : c.current.openEvent ? ["click", "mousedown"].includes(c.current.openEvent.type) : !1), I = React.useCallback((t, n = !0) => {
|
|
7314
7314
|
let i = getDelay(N.current, "close", S.current);
|
|
7315
7315
|
i && !w.current ? k.start(i, () => s.setOpen(!1, createChangeEventDetails(triggerHover, t))) : n && (k.clear(), s.setOpen(!1, createChangeEventDetails(triggerHover, t)));
|
|
7316
7316
|
}, [
|
|
@@ -7327,7 +7327,7 @@ function useHoverReferenceInteraction(n, i = {}) {
|
|
|
7327
7327
|
t.style.pointerEvents = "", t.removeAttribute(safePolygonIdentifier), E.current = !1;
|
|
7328
7328
|
}
|
|
7329
7329
|
});
|
|
7330
|
-
React
|
|
7330
|
+
React.useEffect(() => {
|
|
7331
7331
|
if (!u) return;
|
|
7332
7332
|
function t(t) {
|
|
7333
7333
|
t.open || (k.clear(), A.clear(), T.current = !0, O.current = !1);
|
|
@@ -7358,7 +7358,7 @@ function useHoverReferenceInteraction(n, i = {}) {
|
|
|
7358
7358
|
}
|
|
7359
7359
|
})(t);
|
|
7360
7360
|
});
|
|
7361
|
-
return React
|
|
7361
|
+
return React.useEffect(() => {
|
|
7362
7362
|
if (!u) return;
|
|
7363
7363
|
let t = v.current ?? (b ? s.select("domReferenceElement") : null);
|
|
7364
7364
|
if (!isElement(t)) return;
|
|
@@ -7430,7 +7430,7 @@ function useHoverReferenceInteraction(n, i = {}) {
|
|
|
7430
7430
|
x,
|
|
7431
7431
|
D,
|
|
7432
7432
|
w
|
|
7433
|
-
]), React
|
|
7433
|
+
]), React.useMemo(() => {
|
|
7434
7434
|
function t(t) {
|
|
7435
7435
|
S.current = t.pointerType;
|
|
7436
7436
|
}
|
|
@@ -7460,8 +7460,8 @@ function useHoverReferenceInteraction(n, i = {}) {
|
|
|
7460
7460
|
]);
|
|
7461
7461
|
}
|
|
7462
7462
|
function useInteractions(n = []) {
|
|
7463
|
-
let i = n.map((t) => t?.reference), s = n.map((t) => t?.floating), c = n.map((t) => t?.item), l = n.map((t) => t?.trigger), u = React
|
|
7464
|
-
return React
|
|
7463
|
+
let i = n.map((t) => t?.reference), s = n.map((t) => t?.floating), c = n.map((t) => t?.item), l = n.map((t) => t?.trigger), u = React.useCallback((t) => mergeProps$1(t, n, "reference"), i), d = React.useCallback((t) => mergeProps$1(t, n, "floating"), s), f = React.useCallback((t) => mergeProps$1(t, n, "item"), c), m = React.useCallback((t) => mergeProps$1(t, n, "trigger"), l);
|
|
7464
|
+
return React.useMemo(() => ({
|
|
7465
7465
|
getReferenceProps: u,
|
|
7466
7466
|
getFloatingProps: d,
|
|
7467
7467
|
getItemProps: f,
|
|
@@ -7494,7 +7494,7 @@ var componentRoleToAriaRoleMap = new Map([
|
|
|
7494
7494
|
["label", !1]
|
|
7495
7495
|
]);
|
|
7496
7496
|
function useRole(n, i = {}) {
|
|
7497
|
-
let s = "rootStore" in n ? n.rootStore : n, c = s.useState("open"), l = s.useState("floatingId"), u = s.useState("domReferenceElement"), d = s.useState("floatingElement"), { enabled: f = !0, role: m = "dialog" } = i, h = useId(), g = u?.id || h, _ = React
|
|
7497
|
+
let s = "rootStore" in n ? n.rootStore : n, c = s.useState("open"), l = s.useState("floatingId"), u = s.useState("domReferenceElement"), d = s.useState("floatingElement"), { enabled: f = !0, role: m = "dialog" } = i, h = useId(), g = u?.id || h, _ = React.useMemo(() => getFloatingFocusElement(d)?.id || l, [d, l]), v = componentRoleToAriaRoleMap.get(m) ?? m, y = useFloatingParentNodeId() != null, b = React.useMemo(() => v === "tooltip" || m === "label" ? EMPTY_OBJECT : {
|
|
7498
7498
|
"aria-haspopup": v === "alertdialog" ? "dialog" : v,
|
|
7499
7499
|
"aria-expanded": "false",
|
|
7500
7500
|
...v === "listbox" && { role: "combobox" },
|
|
@@ -7505,7 +7505,7 @@ function useRole(n, i = {}) {
|
|
|
7505
7505
|
v,
|
|
7506
7506
|
y,
|
|
7507
7507
|
m
|
|
7508
|
-
]), x = React
|
|
7508
|
+
]), x = React.useMemo(() => v === "tooltip" || m === "label" ? { [`aria-${m === "label" ? "labelledby" : "describedby"}`]: c ? _ : void 0 } : {
|
|
7509
7509
|
...b,
|
|
7510
7510
|
"aria-expanded": c ? "true" : "false",
|
|
7511
7511
|
"aria-controls": c ? _ : void 0,
|
|
@@ -7517,7 +7517,7 @@ function useRole(n, i = {}) {
|
|
|
7517
7517
|
g,
|
|
7518
7518
|
m,
|
|
7519
7519
|
b
|
|
7520
|
-
]), S = React
|
|
7520
|
+
]), S = React.useMemo(() => {
|
|
7521
7521
|
let t = {
|
|
7522
7522
|
id: _,
|
|
7523
7523
|
...v && { role: v }
|
|
@@ -7531,7 +7531,7 @@ function useRole(n, i = {}) {
|
|
|
7531
7531
|
_,
|
|
7532
7532
|
g,
|
|
7533
7533
|
m
|
|
7534
|
-
]), C = React
|
|
7534
|
+
]), C = React.useCallback(({ active: t, selected: n }) => {
|
|
7535
7535
|
let i = {
|
|
7536
7536
|
role: "option",
|
|
7537
7537
|
...t && { id: `${_}-fui-option` }
|
|
@@ -7546,7 +7546,7 @@ function useRole(n, i = {}) {
|
|
|
7546
7546
|
}
|
|
7547
7547
|
return {};
|
|
7548
7548
|
}, [_, m]);
|
|
7549
|
-
return React
|
|
7549
|
+
return React.useMemo(() => f ? {
|
|
7550
7550
|
reference: x,
|
|
7551
7551
|
floating: S,
|
|
7552
7552
|
item: C,
|
|
@@ -7671,10 +7671,10 @@ let DialogPopupCssVars = /* @__PURE__ */ function(t) {
|
|
|
7671
7671
|
}({}), DialogPopupDataAttributes = function(t) {
|
|
7672
7672
|
return t[t.open = CommonPopupDataAttributes.open] = "open", t[t.closed = CommonPopupDataAttributes.closed] = "closed", t[t.startingStyle = CommonPopupDataAttributes.startingStyle] = "startingStyle", t[t.endingStyle = CommonPopupDataAttributes.endingStyle] = "endingStyle", t.nested = "data-nested", t.nestedDialogOpen = "data-nested-dialog-open", t;
|
|
7673
7673
|
}({});
|
|
7674
|
-
const DialogPortalContext = /* @__PURE__ */ React
|
|
7674
|
+
const DialogPortalContext = /* @__PURE__ */ React.createContext(void 0);
|
|
7675
7675
|
process.env.NODE_ENV !== "production" && (DialogPortalContext.displayName = "DialogPortalContext");
|
|
7676
7676
|
function useDialogPortalContext() {
|
|
7677
|
-
let n = React
|
|
7677
|
+
let n = React.useContext(DialogPortalContext);
|
|
7678
7678
|
if (n === void 0) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(26) : "Base UI: <Dialog.Portal> is missing.");
|
|
7679
7679
|
return n;
|
|
7680
7680
|
}
|
|
@@ -7753,7 +7753,7 @@ var stateAttributesMapping$4 = {
|
|
|
7753
7753
|
return t ? { [DialogPopupDataAttributes.nestedDialogOpen]: "" } : null;
|
|
7754
7754
|
}
|
|
7755
7755
|
};
|
|
7756
|
-
const DialogPopup$1 = /* @__PURE__ */ React
|
|
7756
|
+
const DialogPopup$1 = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
7757
7757
|
let { className: s, finalFocus: c, initialFocus: l, render: u, ...d } = n, { store: f } = useDialogRootContext(), m = f.useState("descriptionElementId"), h = f.useState("disablePointerDismissal"), g = f.useState("floatingRootContext"), _ = f.useState("popupProps"), v = f.useState("modal"), y = f.useState("mounted"), b = f.useState("nested"), x = f.useState("nestedOpenDialogCount"), S = f.useState("open"), C = f.useState("openMethod"), w = f.useState("titleElementId"), T = f.useState("transitionStatus"), E = f.useState("role");
|
|
7758
7758
|
useDialogPortalContext(), useOpenChangeComplete({
|
|
7759
7759
|
open: S,
|
|
@@ -7766,7 +7766,7 @@ const DialogPopup$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
7766
7766
|
return t === "touch" ? f.context.popupRef.current : !0;
|
|
7767
7767
|
}
|
|
7768
7768
|
let O = l === void 0 ? D : l, k = x > 0, A = useRenderElement("div", n, {
|
|
7769
|
-
state: React
|
|
7769
|
+
state: React.useMemo(() => ({
|
|
7770
7770
|
open: S,
|
|
7771
7771
|
nested: b,
|
|
7772
7772
|
transitionStatus: T,
|
|
@@ -7815,7 +7815,7 @@ process.env.NODE_ENV !== "production" && (DialogPopup$1.displayName = "DialogPop
|
|
|
7815
7815
|
function inertValue(t) {
|
|
7816
7816
|
return isReactVersionAtLeast(19) ? t : t ? "true" : void 0;
|
|
7817
7817
|
}
|
|
7818
|
-
const InternalBackdrop = /* @__PURE__ */ React
|
|
7818
|
+
const InternalBackdrop = /* @__PURE__ */ React.forwardRef(function(t, n) {
|
|
7819
7819
|
let { cutout: i, ...s } = t, c;
|
|
7820
7820
|
if (i) {
|
|
7821
7821
|
let t = i?.getBoundingClientRect();
|
|
@@ -7847,7 +7847,7 @@ const InternalBackdrop = /* @__PURE__ */ React$1.forwardRef(function(t, n) {
|
|
|
7847
7847
|
});
|
|
7848
7848
|
});
|
|
7849
7849
|
process.env.NODE_ENV !== "production" && (InternalBackdrop.displayName = "InternalBackdrop");
|
|
7850
|
-
const DialogPortal = /* @__PURE__ */ React
|
|
7850
|
+
const DialogPortal = /* @__PURE__ */ React.forwardRef(function(t, n) {
|
|
7851
7851
|
let { keepMounted: i = !1, ...s } = t, { store: c } = useDialogRootContext(), l = c.useState("mounted"), u = c.useState("modal");
|
|
7852
7852
|
return l || i ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPortalContext.Provider, {
|
|
7853
7853
|
value: i,
|
|
@@ -7950,11 +7950,11 @@ function useScrollLock(t = !0, n = null) {
|
|
|
7950
7950
|
}, [t, n]);
|
|
7951
7951
|
}
|
|
7952
7952
|
function useEnhancedClickHandler(n) {
|
|
7953
|
-
let i = React
|
|
7953
|
+
let i = React.useRef(""), s = React.useCallback((t) => {
|
|
7954
7954
|
t.defaultPrevented || (i.current = t.pointerType, n(t, t.pointerType));
|
|
7955
7955
|
}, [n]);
|
|
7956
7956
|
return {
|
|
7957
|
-
onClick: React
|
|
7957
|
+
onClick: React.useCallback((t) => {
|
|
7958
7958
|
if (t.detail === 0) {
|
|
7959
7959
|
n(t, "keyboard");
|
|
7960
7960
|
return;
|
|
@@ -7965,12 +7965,12 @@ function useEnhancedClickHandler(n) {
|
|
|
7965
7965
|
};
|
|
7966
7966
|
}
|
|
7967
7967
|
function useOpenInteractionType(n) {
|
|
7968
|
-
let [i, s] = React
|
|
7968
|
+
let [i, s] = React.useState(null), c = useStableCallback((t, i) => {
|
|
7969
7969
|
n || s(i);
|
|
7970
|
-
}), l = React
|
|
7970
|
+
}), l = React.useCallback(() => {
|
|
7971
7971
|
s(null);
|
|
7972
7972
|
}, []), { onClick: u, onPointerDown: d } = useEnhancedClickHandler(c);
|
|
7973
|
-
return React
|
|
7973
|
+
return React.useMemo(() => ({
|
|
7974
7974
|
openMethod: i,
|
|
7975
7975
|
reset: l,
|
|
7976
7976
|
triggerProps: {
|
|
@@ -7994,10 +7994,10 @@ function useDialogRoot(n) {
|
|
|
7994
7994
|
return n.preventUnmountOnClose = () => {
|
|
7995
7995
|
i.set("preventUnmountingOnClose", !0);
|
|
7996
7996
|
}, n;
|
|
7997
|
-
}), y = React
|
|
7997
|
+
}), y = React.useCallback(() => {
|
|
7998
7998
|
i.setOpen(!1, v(imperativeAction));
|
|
7999
7999
|
}, [i, v]);
|
|
8000
|
-
React
|
|
8000
|
+
React.useImperativeHandle(c, () => ({
|
|
8001
8001
|
unmount: _,
|
|
8002
8002
|
close: y
|
|
8003
8003
|
}), [_, y]);
|
|
@@ -8006,7 +8006,7 @@ function useDialogRoot(n) {
|
|
|
8006
8006
|
onOpenChange: i.setOpen,
|
|
8007
8007
|
treatPopupAsFloatingElement: !0,
|
|
8008
8008
|
noEmit: !0
|
|
8009
|
-
}), [x, S] = React
|
|
8009
|
+
}), [x, S] = React.useState(0), C = x === 0, w = useRole(b), T = useDismiss(b, {
|
|
8010
8010
|
outsidePressEvent() {
|
|
8011
8011
|
return i.context.internalBackdropRef.current || i.context.backdropRef.current ? "intentional" : {
|
|
8012
8012
|
mouse: d === "trap-focus" ? "sloppy" : "intentional",
|
|
@@ -8030,14 +8030,14 @@ function useDialogRoot(n) {
|
|
|
8030
8030
|
S(t + 1);
|
|
8031
8031
|
}), i.useContextCallback("onNestedDialogClose", () => {
|
|
8032
8032
|
S(0);
|
|
8033
|
-
}), React
|
|
8033
|
+
}), React.useEffect(() => (s?.onNestedDialogOpen && l && s.onNestedDialogOpen(x), s?.onNestedDialogClose && !l && s.onNestedDialogClose(), () => {
|
|
8034
8034
|
s?.onNestedDialogClose && l && s.onNestedDialogClose();
|
|
8035
8035
|
}), [
|
|
8036
8036
|
l,
|
|
8037
8037
|
s,
|
|
8038
8038
|
x
|
|
8039
8039
|
]);
|
|
8040
|
-
let k = React
|
|
8040
|
+
let k = React.useMemo(() => E(h), [E, h]), A = React.useMemo(() => O(h), [O, h]), j = React.useMemo(() => D(), [D]);
|
|
8041
8041
|
i.useSyncedValues({
|
|
8042
8042
|
openMethod: m,
|
|
8043
8043
|
activeTriggerProps: k,
|
|
@@ -8061,9 +8061,9 @@ var selectors$1 = {
|
|
|
8061
8061
|
}, DialogStore = class extends ReactStore {
|
|
8062
8062
|
constructor(n) {
|
|
8063
8063
|
super(createInitialState$1(n), {
|
|
8064
|
-
popupRef: /* @__PURE__ */ React
|
|
8065
|
-
backdropRef: /* @__PURE__ */ React
|
|
8066
|
-
internalBackdropRef: /* @__PURE__ */ React
|
|
8064
|
+
popupRef: /* @__PURE__ */ React.createRef(),
|
|
8065
|
+
backdropRef: /* @__PURE__ */ React.createRef(),
|
|
8066
|
+
internalBackdropRef: /* @__PURE__ */ React.createRef(),
|
|
8067
8067
|
triggerElements: new PopupTriggerMap(),
|
|
8068
8068
|
onOpenChange: void 0,
|
|
8069
8069
|
onOpenChangeComplete: void 0
|
|
@@ -8121,13 +8121,13 @@ function DialogRoot(n) {
|
|
|
8121
8121
|
onOpenChange: l,
|
|
8122
8122
|
triggerIdProp: g
|
|
8123
8123
|
});
|
|
8124
|
-
let C = React
|
|
8124
|
+
let C = React.useMemo(() => ({ store: b }), [b]);
|
|
8125
8125
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogRootContext.Provider, {
|
|
8126
8126
|
value: C,
|
|
8127
8127
|
children: typeof i == "function" ? i({ payload: x }) : i
|
|
8128
8128
|
});
|
|
8129
8129
|
}
|
|
8130
|
-
const DialogTitle$1 = /* @__PURE__ */ React
|
|
8130
|
+
const DialogTitle$1 = /* @__PURE__ */ React.forwardRef(function(t, n) {
|
|
8131
8131
|
let { render: i, className: s, id: c, ...l } = t, { store: u } = useDialogRootContext(), d = useBaseUiId(c);
|
|
8132
8132
|
return u.useSyncedValueWithCleanup("titleElementId", d), useRenderElement("h2", t, {
|
|
8133
8133
|
ref: n,
|
|
@@ -8135,13 +8135,13 @@ const DialogTitle$1 = /* @__PURE__ */ React$1.forwardRef(function(t, n) {
|
|
|
8135
8135
|
});
|
|
8136
8136
|
});
|
|
8137
8137
|
process.env.NODE_ENV !== "production" && (DialogTitle$1.displayName = "DialogTitle");
|
|
8138
|
-
const DialogTrigger$1 = /* @__PURE__ */ React
|
|
8138
|
+
const DialogTrigger$1 = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
8139
8139
|
let { render: s, className: c, disabled: l = !1, nativeButton: u = !0, id: d, payload: f, handle: m, ...h } = n, g = useDialogRootContext(!0), _ = m?.store ?? g?.store;
|
|
8140
8140
|
if (!_) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(79) : "Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.");
|
|
8141
|
-
let v = useBaseUiId(d), y = _.useState("floatingRootContext"), x = _.useState("isOpenedByTrigger", v), S = React
|
|
8141
|
+
let v = useBaseUiId(d), y = _.useState("floatingRootContext"), x = _.useState("isOpenedByTrigger", v), S = React.useRef(null), { registerTrigger: C, isMountedByThisTrigger: w } = useTriggerDataForwarding(v, S, _, { payload: f }), { getButtonProps: T, buttonRef: E } = useButton({
|
|
8142
8142
|
disabled: l,
|
|
8143
8143
|
native: u
|
|
8144
|
-
}), D = useInteractions([useClick(y, { enabled: y != null })]), O = React
|
|
8144
|
+
}), D = useInteractions([useClick(y, { enabled: y != null })]), O = React.useMemo(() => ({
|
|
8145
8145
|
disabled: l,
|
|
8146
8146
|
open: x
|
|
8147
8147
|
}), [l, x]), k = _.useState("triggerProps", w);
|
|
@@ -9891,7 +9891,7 @@ function useField$1(t) {
|
|
|
9891
9891
|
form: t.form,
|
|
9892
9892
|
name: t.name
|
|
9893
9893
|
}));
|
|
9894
|
-
let l = useStore(s.store, t.mode === "array" ? (t) => Object.keys(t.value ?? []).length : (t) => t.value),
|
|
9894
|
+
let l = useStore(s.store, t.mode === "array" ? (t) => Object.keys(t.value ?? []).length : (t) => t.value), d = useStore(s.store, (t) => t.meta.isTouched), m = useStore(s.store, (t) => t.meta.isBlurred), h = useStore(s.store, (t) => t.meta.isDirty), g = useStore(s.store, (t) => t.meta.errorMap), _ = useStore(s.store, (t) => t.meta.errorSourceMap), v = useStore(s.store, (t) => t.meta.isValidating), y = useMemo(() => {
|
|
9895
9895
|
let n = {
|
|
9896
9896
|
...s,
|
|
9897
9897
|
get state() {
|
|
@@ -9900,7 +9900,7 @@ function useField$1(t) {
|
|
|
9900
9900
|
get meta() {
|
|
9901
9901
|
return {
|
|
9902
9902
|
...s.state.meta,
|
|
9903
|
-
isTouched:
|
|
9903
|
+
isTouched: d,
|
|
9904
9904
|
isBlurred: m,
|
|
9905
9905
|
isDirty: h,
|
|
9906
9906
|
errorMap: g,
|
|
@@ -9916,7 +9916,7 @@ function useField$1(t) {
|
|
|
9916
9916
|
s,
|
|
9917
9917
|
t.mode,
|
|
9918
9918
|
l,
|
|
9919
|
-
|
|
9919
|
+
d,
|
|
9920
9920
|
m,
|
|
9921
9921
|
h,
|
|
9922
9922
|
g,
|
|
@@ -9934,7 +9934,7 @@ var Field = (({ children: t, ...n }) => {
|
|
|
9934
9934
|
function useUUID() {
|
|
9935
9935
|
return useState(() => uuid())[0];
|
|
9936
9936
|
}
|
|
9937
|
-
var useFormId = React
|
|
9937
|
+
var useFormId = React.version.split(".")[0] === "17" ? useUUID : React.useId;
|
|
9938
9938
|
function LocalSubscribe$1({ form: t, selector: n, children: i }) {
|
|
9939
9939
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: functionalUpdate(i, useStore(t.store, n)) });
|
|
9940
9940
|
}
|
|
@@ -9950,7 +9950,7 @@ function useForm(t) {
|
|
|
9950
9950
|
formId: i
|
|
9951
9951
|
})), s(i);
|
|
9952
9952
|
}
|
|
9953
|
-
let
|
|
9953
|
+
let d = useMemo(() => {
|
|
9954
9954
|
let t = {
|
|
9955
9955
|
...c,
|
|
9956
9956
|
handleSubmit: ((...t) => c._handleSubmit(...t)),
|
|
@@ -9976,7 +9976,7 @@ function useForm(t) {
|
|
|
9976
9976
|
}, [c]);
|
|
9977
9977
|
return useIsomorphicLayoutEffect$1(c.mount, []), useIsomorphicLayoutEffect$1(() => {
|
|
9978
9978
|
c.update(t);
|
|
9979
|
-
}),
|
|
9979
|
+
}), d;
|
|
9980
9980
|
}
|
|
9981
9981
|
function LocalSubscribe({ lens: t, selector: n, children: i }) {
|
|
9982
9982
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: functionalUpdate(i, useStore(t.store, n)) });
|
|
@@ -10021,7 +10021,7 @@ function createFormHookContexts() {
|
|
|
10021
10021
|
}
|
|
10022
10022
|
function createFormHook({ fieldComponents: t, fieldContext: n, formContext: i, formComponents: s }) {
|
|
10023
10023
|
function c(c) {
|
|
10024
|
-
let l = useForm(c),
|
|
10024
|
+
let l = useForm(c), d = useMemo(() => ({ children: t }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(i.Provider, {
|
|
10025
10025
|
value: l,
|
|
10026
10026
|
children: t
|
|
10027
10027
|
}), [l]), f = useMemo(() => (({ children: i, ...s }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(l.Field, {
|
|
@@ -10033,12 +10033,12 @@ function createFormHook({ fieldComponents: t, fieldContext: n, formContext: i, f
|
|
|
10033
10033
|
})), [l]);
|
|
10034
10034
|
return useMemo(() => Object.assign(l, {
|
|
10035
10035
|
AppField: f,
|
|
10036
|
-
AppForm:
|
|
10036
|
+
AppForm: d,
|
|
10037
10037
|
...s
|
|
10038
10038
|
}), [
|
|
10039
10039
|
l,
|
|
10040
10040
|
f,
|
|
10041
|
-
|
|
10041
|
+
d
|
|
10042
10042
|
]);
|
|
10043
10043
|
}
|
|
10044
10044
|
function l({ render: t, props: n }) {
|
|
@@ -10047,7 +10047,7 @@ function createFormHook({ fieldComponents: t, fieldContext: n, formContext: i, f
|
|
|
10047
10047
|
...i
|
|
10048
10048
|
});
|
|
10049
10049
|
}
|
|
10050
|
-
function
|
|
10050
|
+
function d({ render: t, props: n, defaultValues: i }) {
|
|
10051
10051
|
return function(c) {
|
|
10052
10052
|
let l = useFieldGroup(useMemo(() => ({
|
|
10053
10053
|
form: c.form,
|
|
@@ -10065,7 +10065,7 @@ function createFormHook({ fieldComponents: t, fieldContext: n, formContext: i, f
|
|
|
10065
10065
|
return {
|
|
10066
10066
|
useAppForm: c,
|
|
10067
10067
|
withForm: l,
|
|
10068
|
-
withFieldGroup:
|
|
10068
|
+
withFieldGroup: d
|
|
10069
10069
|
};
|
|
10070
10070
|
}
|
|
10071
10071
|
const { fieldContext, useFieldContext, formContext, useFormContext: useFormContext$1 } = createFormHookContexts();
|
|
@@ -10115,8 +10115,8 @@ function useLabelableId(t = {}) {
|
|
|
10115
10115
|
u
|
|
10116
10116
|
]), c ?? u;
|
|
10117
10117
|
}
|
|
10118
|
-
const FieldControl = /* @__PURE__ */ React
|
|
10119
|
-
let { render: s, className: c, id: l, name: u, value: d, disabled: f = !1, onValueChange: m, defaultValue: h, ...g } = n, { state: _, name: v, disabled: y } = useFieldRootContext(), b = y || f, x = v ?? u, S = React
|
|
10118
|
+
const FieldControl = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
10119
|
+
let { render: s, className: c, id: l, name: u, value: d, disabled: f = !1, onValueChange: m, defaultValue: h, ...g } = n, { state: _, name: v, disabled: y } = useFieldRootContext(), b = y || f, x = v ?? u, S = React.useMemo(() => ({
|
|
10120
10120
|
..._,
|
|
10121
10121
|
disabled: b
|
|
10122
10122
|
}), [_, b]), { setTouched: C, setDirty: w, validityData: T, setFocused: E, setFilled: D, validationMode: O, validation: k } = useFieldRootContext(), { labelId: A } = useLabelableContext(), j = useLabelableId({ id: l });
|
|
@@ -10175,7 +10175,7 @@ const FieldControl = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
10175
10175
|
});
|
|
10176
10176
|
});
|
|
10177
10177
|
process.env.NODE_ENV !== "production" && (FieldControl.displayName = "FieldControl");
|
|
10178
|
-
const Input$1 = /* @__PURE__ */ React
|
|
10178
|
+
const Input$1 = /* @__PURE__ */ React.forwardRef(function(t, n) {
|
|
10179
10179
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldControl, {
|
|
10180
10180
|
ref: n,
|
|
10181
10181
|
...t
|
|
@@ -10198,33 +10198,33 @@ const Separator = (t) => {
|
|
|
10198
10198
|
};
|
|
10199
10199
|
var import_compiler_runtime$16 = require_compiler_runtime();
|
|
10200
10200
|
const Input = (t) => {
|
|
10201
|
-
let
|
|
10202
|
-
|
|
10201
|
+
let n = (0, import_compiler_runtime$16.c)(20), s, c, l, u, d;
|
|
10202
|
+
n[0] === t ? (s = n[1], c = n[2], l = n[3], u = n[4], d = n[5]) : ({leadingIcon: c, showSeparator: d, className: s, ref: u, ...l} = t, n[0] = t, n[1] = s, n[2] = c, n[3] = l, n[4] = u, n[5] = d);
|
|
10203
10203
|
let f = d === void 0 ? !0 : d, m = l.disabled, h = l.disabled, g;
|
|
10204
|
-
|
|
10204
|
+
n[6] === s ? g = n[7] : (g = cn("flex items-center gap-xs px-md w-full py-sm group h-xl inset-shadow-2-shadow inset-shadow-sm bg-surface-dim rounded-xl data-[disabled=true]:opacity-50 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:hover:outline-transparent outline-2 outline-transparent hover:not-focus-within:outline-outline focus-within:outline-primary focus-within:caret-primary transition-all", s), n[6] = s, n[7] = g);
|
|
10205
10205
|
let _;
|
|
10206
|
-
|
|
10206
|
+
n[8] !== c || n[9] !== f ? (_ = c && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
10207
10207
|
className: cn("flex items-center text-on-surface-variant justify-center [&>svg]:size-s group-focus-within:text-primary transition-all"),
|
|
10208
|
-
children:
|
|
10208
|
+
children: createElement(c, { weight: "bold" })
|
|
10209
10209
|
}), f && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Separator, {
|
|
10210
10210
|
orientation: "vertical",
|
|
10211
10211
|
className: "group-focus-within:bg-primary"
|
|
10212
|
-
})] }),
|
|
10212
|
+
})] }), n[8] = c, n[9] = f, n[10] = _) : _ = n[10];
|
|
10213
10213
|
let v;
|
|
10214
|
-
|
|
10214
|
+
n[11] === Symbol.for("react.memo_cache_sentinel") ? (v = cn("outline-none w-full", "placeholder:opacity-60", "disabled:text-text-neutral-primary-disabled disabled:cursor-not-allowed", "overflow-ellipsis"), n[11] = v) : v = n[11];
|
|
10215
10215
|
let y;
|
|
10216
|
-
|
|
10216
|
+
n[12] !== l || n[13] !== u ? (y = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input$1, {
|
|
10217
10217
|
className: v,
|
|
10218
10218
|
ref: u,
|
|
10219
10219
|
...l
|
|
10220
|
-
}),
|
|
10220
|
+
}), n[12] = l, n[13] = u, n[14] = y) : y = n[14];
|
|
10221
10221
|
let b;
|
|
10222
|
-
return
|
|
10222
|
+
return n[15] !== l.disabled || n[16] !== g || n[17] !== _ || n[18] !== y ? (b = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
10223
10223
|
"aria-disabled": m,
|
|
10224
10224
|
"data-disabled": h,
|
|
10225
10225
|
className: g,
|
|
10226
10226
|
children: [_, y]
|
|
10227
|
-
}),
|
|
10227
|
+
}), n[15] = l.disabled, n[16] = g, n[17] = _, n[18] = y, n[19] = b) : b = n[19], b;
|
|
10228
10228
|
};
|
|
10229
10229
|
var import_compiler_runtime$15 = require_compiler_runtime();
|
|
10230
10230
|
const FieldInput = (t) => {
|
|
@@ -10374,10 +10374,10 @@ const Profile = (t) => {
|
|
|
10374
10374
|
...u,
|
|
10375
10375
|
children: [S, D]
|
|
10376
10376
|
}), n[30] = u, n[31] = d, n[32] = D, n[33] = y, n[34] = S, n[35] = O) : O = n[35], O;
|
|
10377
|
-
}, ScrollAreaRootContext = /* @__PURE__ */ React
|
|
10377
|
+
}, ScrollAreaRootContext = /* @__PURE__ */ React.createContext(void 0);
|
|
10378
10378
|
process.env.NODE_ENV !== "production" && (ScrollAreaRootContext.displayName = "ScrollAreaRootContext");
|
|
10379
10379
|
function useScrollAreaRootContext() {
|
|
10380
|
-
let n = React
|
|
10380
|
+
let n = React.useContext(ScrollAreaRootContext);
|
|
10381
10381
|
if (n === void 0) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(53) : "Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>.");
|
|
10382
10382
|
return n;
|
|
10383
10383
|
}
|
|
@@ -10422,11 +10422,11 @@ var DEFAULT_SIZE = {
|
|
|
10422
10422
|
yStart: !1,
|
|
10423
10423
|
yEnd: !1
|
|
10424
10424
|
};
|
|
10425
|
-
const ScrollAreaRoot = /* @__PURE__ */ React
|
|
10426
|
-
let { render: s, className: c, overflowEdgeThreshold: l, ...u } = n, [d, f] = React
|
|
10425
|
+
const ScrollAreaRoot = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
10426
|
+
let { render: s, className: c, overflowEdgeThreshold: l, ...u } = n, [d, f] = React.useState(!1), [m, h] = React.useState(!1), [g, _] = React.useState(!1), [v, y] = React.useState(DEFAULT_SIZE), [b, x] = React.useState(DEFAULT_SIZE), [S, C] = React.useState(!1), [w, T] = React.useState(DEFAULT_OVERFLOW_EDGES), E = useBaseUiId(), D = React.useRef(null), O = React.useRef(null), k = React.useRef(null), A = React.useRef(null), j = React.useRef(null), M = React.useRef(null), N = React.useRef(null), P = React.useRef(!1), F = React.useRef(0), I = React.useRef(0), L = React.useRef(0), R = React.useRef(0), z = React.useRef("vertical"), B = useTimeout(), V = useTimeout(), H = React.useRef({
|
|
10427
10427
|
x: 0,
|
|
10428
10428
|
y: 0
|
|
10429
|
-
}), [U, W] = React
|
|
10429
|
+
}), [U, W] = React.useState({
|
|
10430
10430
|
scrollbarYHidden: !1,
|
|
10431
10431
|
scrollbarXHidden: !1,
|
|
10432
10432
|
cornerHidden: !1
|
|
@@ -10464,7 +10464,7 @@ const ScrollAreaRoot = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
10464
10464
|
let n = t.pointerType === "touch";
|
|
10465
10465
|
C(n), n || f(contains(D.current, t.target));
|
|
10466
10466
|
}
|
|
10467
|
-
let Z = React
|
|
10467
|
+
let Z = React.useMemo(() => ({
|
|
10468
10468
|
hasOverflowX: !U.scrollbarXHidden,
|
|
10469
10469
|
hasOverflowY: !U.scrollbarYHidden,
|
|
10470
10470
|
overflowXStart: w.xStart,
|
|
@@ -10497,7 +10497,7 @@ const ScrollAreaRoot = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
10497
10497
|
ref: [i, D],
|
|
10498
10498
|
props: [Q, u],
|
|
10499
10499
|
stateAttributesMapping: scrollAreaStateAttributesMapping
|
|
10500
|
-
}), $ = React
|
|
10500
|
+
}), $ = React.useMemo(() => ({
|
|
10501
10501
|
handlePointerDown: q,
|
|
10502
10502
|
handlePointerMove: J,
|
|
10503
10503
|
handlePointerUp: Y,
|
|
@@ -10577,12 +10577,12 @@ function normalizeOverflowEdgeThreshold(t) {
|
|
|
10577
10577
|
yEnd: Math.max(0, t?.yEnd || 0)
|
|
10578
10578
|
};
|
|
10579
10579
|
}
|
|
10580
|
-
const ScrollAreaViewportContext = /* @__PURE__ */ React
|
|
10580
|
+
const ScrollAreaViewportContext = /* @__PURE__ */ React.createContext(void 0);
|
|
10581
10581
|
process.env.NODE_ENV !== "production" && (ScrollAreaViewportContext.displayName = "ScrollAreaViewportContext");
|
|
10582
|
-
const DirectionContext = /* @__PURE__ */ React
|
|
10582
|
+
const DirectionContext = /* @__PURE__ */ React.createContext(void 0);
|
|
10583
10583
|
process.env.NODE_ENV !== "production" && (DirectionContext.displayName = "DirectionContext");
|
|
10584
10584
|
function useDirection() {
|
|
10585
|
-
return React
|
|
10585
|
+
return React.useContext(DirectionContext)?.direction ?? "ltr";
|
|
10586
10586
|
}
|
|
10587
10587
|
function clamp$1(t, n = -(2 ** 53 - 1), i = 2 ** 53 - 1) {
|
|
10588
10588
|
return Math.max(n, Math.min(t, i));
|
|
@@ -10619,8 +10619,8 @@ function removeCSSVariableInheritance() {
|
|
|
10619
10619
|
} catch {}
|
|
10620
10620
|
}), scrollAreaOverflowVarsRegistered = !0);
|
|
10621
10621
|
}
|
|
10622
|
-
const ScrollAreaViewport = /* @__PURE__ */ React
|
|
10623
|
-
let { render: s, className: c, ...l } = n, { viewportRef: u, scrollbarYRef: d, scrollbarXRef: f, thumbYRef: h, thumbXRef: g, cornerRef: _, setCornerSize: v, setThumbSize: y, rootId: b, setHiddenState: x, hiddenState: S, handleScroll: C, setHovering: w, setOverflowEdges: T, overflowEdges: E, overflowEdgeThreshold: D } = useScrollAreaRootContext(), O = useDirection(), k = React
|
|
10622
|
+
const ScrollAreaViewport = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
10623
|
+
let { render: s, className: c, ...l } = n, { viewportRef: u, scrollbarYRef: d, scrollbarXRef: f, thumbYRef: h, thumbXRef: g, cornerRef: _, setCornerSize: v, setThumbSize: y, rootId: b, setHiddenState: x, hiddenState: S, handleScroll: C, setHovering: w, setOverflowEdges: T, overflowEdges: E, overflowEdgeThreshold: D } = useScrollAreaRootContext(), O = useDirection(), k = React.useRef(!0), A = useTimeout(), j = useTimeout();
|
|
10624
10624
|
function M() {
|
|
10625
10625
|
let t = u.current, n = d.current, i = f.current, s = h.current, c = g.current, l = _.current;
|
|
10626
10626
|
if (!t) return;
|
|
@@ -10682,7 +10682,7 @@ const ScrollAreaViewport = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
10682
10682
|
O
|
|
10683
10683
|
]), useIsoLayoutEffect(() => {
|
|
10684
10684
|
u.current?.matches(":hover") && w(!0);
|
|
10685
|
-
}, [u, w]), React
|
|
10685
|
+
}, [u, w]), React.useEffect(() => {
|
|
10686
10686
|
let t = u.current;
|
|
10687
10687
|
if (typeof ResizeObserver > "u" || !t) return;
|
|
10688
10688
|
let n = new ResizeObserver(N);
|
|
@@ -10718,7 +10718,7 @@ const ScrollAreaViewport = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
10718
10718
|
onPointerMove: P,
|
|
10719
10719
|
onPointerEnter: P,
|
|
10720
10720
|
onKeyDown: P
|
|
10721
|
-
}, I = React
|
|
10721
|
+
}, I = React.useMemo(() => ({
|
|
10722
10722
|
hasOverflowX: !S.scrollbarXHidden,
|
|
10723
10723
|
hasOverflowY: !S.scrollbarYHidden,
|
|
10724
10724
|
overflowXStart: E.xStart,
|
|
@@ -10736,25 +10736,25 @@ const ScrollAreaViewport = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
10736
10736
|
state: I,
|
|
10737
10737
|
props: [F, l],
|
|
10738
10738
|
stateAttributesMapping: scrollAreaStateAttributesMapping
|
|
10739
|
-
}), R = React
|
|
10739
|
+
}), R = React.useMemo(() => ({ computeThumbPosition: N }), [N]);
|
|
10740
10740
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaViewportContext.Provider, {
|
|
10741
10741
|
value: R,
|
|
10742
10742
|
children: L
|
|
10743
10743
|
});
|
|
10744
10744
|
});
|
|
10745
10745
|
process.env.NODE_ENV !== "production" && (ScrollAreaViewport.displayName = "ScrollAreaViewport");
|
|
10746
|
-
const ScrollAreaScrollbarContext = /* @__PURE__ */ React
|
|
10746
|
+
const ScrollAreaScrollbarContext = /* @__PURE__ */ React.createContext(void 0);
|
|
10747
10747
|
process.env.NODE_ENV !== "production" && (ScrollAreaScrollbarContext.displayName = "ScrollAreaScrollbarContext");
|
|
10748
10748
|
function useScrollAreaScrollbarContext() {
|
|
10749
|
-
let n = React
|
|
10749
|
+
let n = React.useContext(ScrollAreaScrollbarContext);
|
|
10750
10750
|
if (n === void 0) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(54) : "Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>.");
|
|
10751
10751
|
return n;
|
|
10752
10752
|
}
|
|
10753
10753
|
let ScrollAreaScrollbarCssVars = /* @__PURE__ */ function(t) {
|
|
10754
10754
|
return t.scrollAreaThumbHeight = "--scroll-area-thumb-height", t.scrollAreaThumbWidth = "--scroll-area-thumb-width", t;
|
|
10755
10755
|
}({});
|
|
10756
|
-
const ScrollAreaScrollbar = /* @__PURE__ */ React
|
|
10757
|
-
let { render: s, className: c, orientation: l = "vertical", keepMounted: u = !1, ...d } = n, { hovering: f, scrollingX: m, scrollingY: h, hiddenState: g, overflowEdges: _, scrollbarYRef: v, scrollbarXRef: y, viewportRef: b, thumbYRef: x, thumbXRef: S, handlePointerDown: C, handlePointerUp: w, rootId: T, thumbSize: E } = useScrollAreaRootContext(), D = React
|
|
10756
|
+
const ScrollAreaScrollbar = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
10757
|
+
let { render: s, className: c, orientation: l = "vertical", keepMounted: u = !1, ...d } = n, { hovering: f, scrollingX: m, scrollingY: h, hiddenState: g, overflowEdges: _, scrollbarYRef: v, scrollbarXRef: y, viewportRef: b, thumbYRef: x, thumbXRef: S, handlePointerDown: C, handlePointerUp: w, rootId: T, thumbSize: E } = useScrollAreaRootContext(), D = React.useMemo(() => ({
|
|
10758
10758
|
hovering: f,
|
|
10759
10759
|
scrolling: {
|
|
10760
10760
|
horizontal: m,
|
|
@@ -10776,7 +10776,7 @@ const ScrollAreaScrollbar = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
10776
10776
|
g,
|
|
10777
10777
|
_
|
|
10778
10778
|
]), O = useDirection();
|
|
10779
|
-
React
|
|
10779
|
+
React.useEffect(() => {
|
|
10780
10780
|
let t = b.current, n = l === "vertical" ? v.current : y.current;
|
|
10781
10781
|
if (!n) return;
|
|
10782
10782
|
function i(i) {
|
|
@@ -10838,15 +10838,15 @@ const ScrollAreaScrollbar = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
10838
10838
|
state: D,
|
|
10839
10839
|
props: [k, d],
|
|
10840
10840
|
stateAttributesMapping: scrollAreaStateAttributesMapping
|
|
10841
|
-
}), j = React
|
|
10841
|
+
}), j = React.useMemo(() => ({ orientation: l }), [l]), M = l === "vertical" ? g.scrollbarYHidden : g.scrollbarXHidden;
|
|
10842
10842
|
return u || !M ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaScrollbarContext.Provider, {
|
|
10843
10843
|
value: j,
|
|
10844
10844
|
children: A
|
|
10845
10845
|
}) : null;
|
|
10846
10846
|
});
|
|
10847
10847
|
process.env.NODE_ENV !== "production" && (ScrollAreaScrollbar.displayName = "ScrollAreaScrollbar");
|
|
10848
|
-
const ScrollAreaThumb = /* @__PURE__ */ React
|
|
10849
|
-
let { render: s, className: c, ...l } = n, { thumbYRef: u, thumbXRef: d, handlePointerDown: f, handlePointerMove: m, handlePointerUp: h, setScrollingX: g, setScrollingY: _ } = useScrollAreaRootContext(), { orientation: v } = useScrollAreaScrollbarContext(), y = React
|
|
10848
|
+
const ScrollAreaThumb = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
10849
|
+
let { render: s, className: c, ...l } = n, { thumbYRef: u, thumbXRef: d, handlePointerDown: f, handlePointerMove: m, handlePointerUp: h, setScrollingX: g, setScrollingY: _ } = useScrollAreaRootContext(), { orientation: v } = useScrollAreaScrollbarContext(), y = React.useMemo(() => ({ orientation: v }), [v]);
|
|
10850
10850
|
return useRenderElement("div", n, {
|
|
10851
10851
|
ref: [i, v === "vertical" ? u : d],
|
|
10852
10852
|
state: y,
|
|
@@ -10864,7 +10864,7 @@ const ScrollAreaThumb = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
10864
10864
|
});
|
|
10865
10865
|
});
|
|
10866
10866
|
process.env.NODE_ENV !== "production" && (ScrollAreaThumb.displayName = "ScrollAreaThumb");
|
|
10867
|
-
const ScrollAreaCorner = /* @__PURE__ */ React
|
|
10867
|
+
const ScrollAreaCorner = /* @__PURE__ */ React.forwardRef(function(t, n) {
|
|
10868
10868
|
let { render: i, className: s, ...c } = t, { cornerRef: l, cornerSize: u, hiddenState: d } = useScrollAreaRootContext(), f = useRenderElement("div", t, {
|
|
10869
10869
|
ref: [n, l],
|
|
10870
10870
|
props: [{ style: {
|
|
@@ -10912,10 +10912,10 @@ const ScrollArea = (t) => {
|
|
|
10912
10912
|
x
|
|
10913
10913
|
]
|
|
10914
10914
|
}), n[20] = c, n[21] = l, n[22] = m, n[23] = h, n[24] = b, n[25] = S) : S = n[25], S;
|
|
10915
|
-
}, TooltipRootContext = /* @__PURE__ */ React
|
|
10915
|
+
}, TooltipRootContext = /* @__PURE__ */ React.createContext(void 0);
|
|
10916
10916
|
process.env.NODE_ENV !== "production" && (TooltipRootContext.displayName = "TooltipRootContext");
|
|
10917
10917
|
function useTooltipRootContext(n) {
|
|
10918
|
-
let i = React
|
|
10918
|
+
let i = React.useContext(TooltipRootContext);
|
|
10919
10919
|
if (i === void 0 && !n) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(72) : "Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.");
|
|
10920
10920
|
return i;
|
|
10921
10921
|
}
|
|
@@ -10934,7 +10934,7 @@ var selectors = {
|
|
|
10934
10934
|
...createInitialState(),
|
|
10935
10935
|
...n
|
|
10936
10936
|
}, {
|
|
10937
|
-
popupRef: /* @__PURE__ */ React
|
|
10937
|
+
popupRef: /* @__PURE__ */ React.createRef(),
|
|
10938
10938
|
onOpenChange: void 0,
|
|
10939
10939
|
onOpenChangeComplete: void 0,
|
|
10940
10940
|
triggerElements: new PopupTriggerMap()
|
|
@@ -10995,7 +10995,7 @@ function TooltipRoot(n) {
|
|
|
10995
10995
|
i,
|
|
10996
10996
|
y
|
|
10997
10997
|
]), y.useSyncedValue("disabled", i), useImplicitActiveTrigger(y);
|
|
10998
|
-
let { forceUnmount: w, transitionStatus: T } = useOpenStateTransitions(C, y), E = y.useState("isInstantPhase"), D = y.useState("instantType"), O = y.useState("lastOpenChangeReason"), k = React
|
|
10998
|
+
let { forceUnmount: w, transitionStatus: T } = useOpenStateTransitions(C, y), E = y.useState("isInstantPhase"), D = y.useState("instantType"), O = y.useState("lastOpenChangeReason"), k = React.useRef(null);
|
|
10999
10999
|
useIsoLayoutEffect(() => {
|
|
11000
11000
|
T === "ending" && O === "none" || T !== "ending" && E ? (D !== "delay" && (k.current = D), y.set("instantType", "delay")) : k.current !== null && (y.set("instantType", k.current), k.current = null);
|
|
11001
11001
|
}, [
|
|
@@ -11011,10 +11011,10 @@ function TooltipRoot(n) {
|
|
|
11011
11011
|
x,
|
|
11012
11012
|
C
|
|
11013
11013
|
]);
|
|
11014
|
-
let A = React
|
|
11014
|
+
let A = React.useCallback(() => {
|
|
11015
11015
|
y.setOpen(!1, createTooltipEventDetails(y, imperativeAction));
|
|
11016
11016
|
}, [y]);
|
|
11017
|
-
React
|
|
11017
|
+
React.useImperativeHandle(d, () => ({
|
|
11018
11018
|
unmount: w,
|
|
11019
11019
|
close: A
|
|
11020
11020
|
}), [w, A]);
|
|
@@ -11028,7 +11028,7 @@ function TooltipRoot(n) {
|
|
|
11028
11028
|
enabled: !i && u !== "none",
|
|
11029
11029
|
axis: u === "none" ? void 0 : u
|
|
11030
11030
|
})
|
|
11031
|
-
]), F = React
|
|
11031
|
+
]), F = React.useMemo(() => M(), [M]), I = React.useMemo(() => P(), [P]), L = React.useMemo(() => N(), [N]);
|
|
11032
11032
|
return y.useSyncedValues({
|
|
11033
11033
|
floatingRootContext: j,
|
|
11034
11034
|
activeTriggerProps: F,
|
|
@@ -11045,15 +11045,15 @@ function createTooltipEventDetails(t, n) {
|
|
|
11045
11045
|
t.set("preventUnmountingOnClose", !0);
|
|
11046
11046
|
}, i;
|
|
11047
11047
|
}
|
|
11048
|
-
const TooltipProviderContext = /* @__PURE__ */ React
|
|
11048
|
+
const TooltipProviderContext = /* @__PURE__ */ React.createContext(void 0);
|
|
11049
11049
|
process.env.NODE_ENV !== "production" && (TooltipProviderContext.displayName = "TooltipProviderContext");
|
|
11050
11050
|
function useTooltipProviderContext() {
|
|
11051
|
-
return React
|
|
11051
|
+
return React.useContext(TooltipProviderContext);
|
|
11052
11052
|
}
|
|
11053
|
-
const TooltipTrigger$1 = /* @__PURE__ */ React
|
|
11053
|
+
const TooltipTrigger$1 = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
11054
11054
|
let { className: s, render: c, handle: l, payload: u, disabled: d, delay: f, closeDelay: m, id: h, ...g } = n, _ = useTooltipRootContext(!0), v = l?.store ?? _;
|
|
11055
11055
|
if (!v) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(82) : "Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.");
|
|
11056
|
-
let y = useBaseUiId(h), x = v.useState("isTriggerActive", y), S = v.useState("floatingRootContext"), C = v.useState("isOpenedByTrigger", y), w = React
|
|
11056
|
+
let y = useBaseUiId(h), x = v.useState("isTriggerActive", y), S = v.useState("floatingRootContext"), C = v.useState("isOpenedByTrigger", y), w = React.useRef(null), T = f ?? 600, E = m ?? 0, { registerTrigger: D, isMountedByThisTrigger: O } = useTriggerDataForwarding(y, w, v, {
|
|
11057
11057
|
payload: u,
|
|
11058
11058
|
closeDelay: E
|
|
11059
11059
|
}), k = useTooltipProviderContext(), { delayRef: A, isInstantPhase: j, hasProvider: M } = useDelayGroup(S, { open: C });
|
|
@@ -11073,7 +11073,7 @@ const TooltipTrigger$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
11073
11073
|
},
|
|
11074
11074
|
triggerElementRef: w,
|
|
11075
11075
|
isActiveTrigger: x
|
|
11076
|
-
}), R = React
|
|
11076
|
+
}), R = React.useMemo(() => ({ open: C }), [C]), z = v.useState("triggerProps", O);
|
|
11077
11077
|
return useRenderElement("button", n, {
|
|
11078
11078
|
state: R,
|
|
11079
11079
|
ref: [
|
|
@@ -11091,24 +11091,24 @@ const TooltipTrigger$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
11091
11091
|
});
|
|
11092
11092
|
});
|
|
11093
11093
|
process.env.NODE_ENV !== "production" && (TooltipTrigger$1.displayName = "TooltipTrigger");
|
|
11094
|
-
const TooltipPortalContext = /* @__PURE__ */ React
|
|
11094
|
+
const TooltipPortalContext = /* @__PURE__ */ React.createContext(void 0);
|
|
11095
11095
|
process.env.NODE_ENV !== "production" && (TooltipPortalContext.displayName = "TooltipPortalContext");
|
|
11096
11096
|
function useTooltipPortalContext() {
|
|
11097
|
-
let n = React
|
|
11097
|
+
let n = React.useContext(TooltipPortalContext);
|
|
11098
11098
|
if (n === void 0) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(70) : "Base UI: <Tooltip.Portal> is missing.");
|
|
11099
11099
|
return n;
|
|
11100
11100
|
}
|
|
11101
|
-
const FloatingPortalLite = /* @__PURE__ */ React
|
|
11101
|
+
const FloatingPortalLite = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
11102
11102
|
let { children: s, container: c, className: l, render: u, ...d } = n, { portalNode: f, portalSubtree: h } = useFloatingPortalNode({
|
|
11103
11103
|
container: c,
|
|
11104
11104
|
ref: i,
|
|
11105
11105
|
componentProps: n,
|
|
11106
11106
|
elementProps: d
|
|
11107
11107
|
});
|
|
11108
|
-
return !h && !f ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(React
|
|
11108
|
+
return !h && !f ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(React.Fragment, { children: [h, f && /* @__PURE__ */ ReactDOM.createPortal(s, f)] });
|
|
11109
11109
|
});
|
|
11110
11110
|
process.env.NODE_ENV !== "production" && (FloatingPortalLite.displayName = "FloatingPortalLite");
|
|
11111
|
-
const TooltipPortal = /* @__PURE__ */ React
|
|
11111
|
+
const TooltipPortal = /* @__PURE__ */ React.forwardRef(function(t, n) {
|
|
11112
11112
|
let { keepMounted: i = !1, ...s } = t;
|
|
11113
11113
|
return useTooltipRootContext().useState("mounted") || i ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPortalContext.Provider, {
|
|
11114
11114
|
value: i,
|
|
@@ -11119,10 +11119,10 @@ const TooltipPortal = /* @__PURE__ */ React$1.forwardRef(function(t, n) {
|
|
|
11119
11119
|
}) : null;
|
|
11120
11120
|
});
|
|
11121
11121
|
process.env.NODE_ENV !== "production" && (TooltipPortal.displayName = "TooltipPortal");
|
|
11122
|
-
const TooltipPositionerContext = /* @__PURE__ */ React
|
|
11122
|
+
const TooltipPositionerContext = /* @__PURE__ */ React.createContext(void 0);
|
|
11123
11123
|
process.env.NODE_ENV !== "production" && (TooltipPositionerContext.displayName = "TooltipPositionerContext");
|
|
11124
11124
|
function useTooltipPositionerContext() {
|
|
11125
|
-
let n = React
|
|
11125
|
+
let n = React.useContext(TooltipPositionerContext);
|
|
11126
11126
|
if (n === void 0) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(71) : "Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.");
|
|
11127
11127
|
return n;
|
|
11128
11128
|
}
|
|
@@ -11222,7 +11222,7 @@ function getOffsetData(t, n, i) {
|
|
|
11222
11222
|
};
|
|
11223
11223
|
}
|
|
11224
11224
|
function useAnchorPositioning(n) {
|
|
11225
|
-
let { anchor: i, positionMethod: s = "absolute", side: c = "bottom", sideOffset: l = 0, align: u = "center", alignOffset: d = 0, collisionBoundary: f, collisionPadding: m = 5, sticky: h = !1, arrowPadding: g = 5, disableAnchorTracking: _ = !1, keepMounted: v = !1, floatingRootContext: y, mounted: b, collisionAvoidance: x, shiftCrossAxis: S = !1, nodeId: C, adaptiveOrigin: w, lazyFlip: T = !1, externalTree: E } = n, [D, O] = React
|
|
11225
|
+
let { anchor: i, positionMethod: s = "absolute", side: c = "bottom", sideOffset: l = 0, align: u = "center", alignOffset: d = 0, collisionBoundary: f, collisionPadding: m = 5, sticky: h = !1, arrowPadding: g = 5, disableAnchorTracking: _ = !1, keepMounted: v = !1, floatingRootContext: y, mounted: b, collisionAvoidance: x, shiftCrossAxis: S = !1, nodeId: C, adaptiveOrigin: w, lazyFlip: T = !1, externalTree: E } = n, [D, O] = React.useState(null);
|
|
11226
11226
|
!b && D !== null && O(null);
|
|
11227
11227
|
let k = x.side || "flip", A = x.align || "flip", j = x.fallbackAxisSide || "end", M = typeof i == "function" ? i : void 0, N = useStableCallback(M), P = M ? N : i, F = useValueAsRef(i), I = useDirection() === "rtl", L = D || {
|
|
11228
11228
|
top: "top",
|
|
@@ -11246,7 +11246,7 @@ function useAnchorPositioning(n) {
|
|
|
11246
11246
|
let W = {
|
|
11247
11247
|
boundary: f === "clipping-ancestors" ? "clippingAncestors" : f,
|
|
11248
11248
|
padding: z
|
|
11249
|
-
}, G = React
|
|
11249
|
+
}, G = React.useRef(null), K = useValueAsRef(l), q = useValueAsRef(d), J = [offset((t) => {
|
|
11250
11250
|
let n = getOffsetData(t, c, I), i = typeof K.current == "function" ? K.current(n) : K.current, s = typeof q.current == "function" ? q.current(n) : q.current;
|
|
11251
11251
|
return {
|
|
11252
11252
|
mainAxis: i,
|
|
@@ -11328,7 +11328,7 @@ function useAnchorPositioning(n) {
|
|
|
11328
11328
|
domReferenceElement: null
|
|
11329
11329
|
});
|
|
11330
11330
|
}, [b, y]);
|
|
11331
|
-
let fh = React
|
|
11331
|
+
let fh = React.useMemo(() => ({
|
|
11332
11332
|
elementResize: !_ && typeof ResizeObserver < "u",
|
|
11333
11333
|
layoutShift: !_ && typeof IntersectionObserver < "u"
|
|
11334
11334
|
}), [_]), { refs: ph, elements: $, x: mh, y: hh, middlewareData: gh, update: _h, placement: vh, context: yh, isPositioned: bh, floatingStyles: xh } = useFloating({
|
|
@@ -11339,7 +11339,7 @@ function useAnchorPositioning(n) {
|
|
|
11339
11339
|
whileElementsMounted: v ? void 0 : (...t) => autoUpdate(...t, fh),
|
|
11340
11340
|
nodeId: C,
|
|
11341
11341
|
externalTree: E
|
|
11342
|
-
}), { sideX: Sh, sideY: Ch } = gh.adaptiveOrigin || DEFAULT_SIDES, wh = bh ? s : "fixed", Th = React
|
|
11342
|
+
}), { sideX: Sh, sideY: Ch } = gh.adaptiveOrigin || DEFAULT_SIDES, wh = bh ? s : "fixed", Th = React.useMemo(() => w ? {
|
|
11343
11343
|
position: wh,
|
|
11344
11344
|
[Sh]: mh,
|
|
11345
11345
|
[Ch]: hh
|
|
@@ -11354,7 +11354,7 @@ function useAnchorPositioning(n) {
|
|
|
11354
11354
|
Ch,
|
|
11355
11355
|
hh,
|
|
11356
11356
|
xh
|
|
11357
|
-
]), Eh = React
|
|
11357
|
+
]), Eh = React.useRef(null);
|
|
11358
11358
|
useIsoLayoutEffect(() => {
|
|
11359
11359
|
if (!b) return;
|
|
11360
11360
|
let t = F.current, n = typeof t == "function" ? t() : t, i = (isRef(n) ? n.current : n) || null;
|
|
@@ -11364,7 +11364,7 @@ function useAnchorPositioning(n) {
|
|
|
11364
11364
|
ph,
|
|
11365
11365
|
P,
|
|
11366
11366
|
F
|
|
11367
|
-
]), React
|
|
11367
|
+
]), React.useEffect(() => {
|
|
11368
11368
|
if (!b) return;
|
|
11369
11369
|
let t = F.current;
|
|
11370
11370
|
typeof t != "function" && isRef(t) && t.current !== Eh.current && (ph.setPositionReference(t.current), Eh.current = t.current);
|
|
@@ -11373,7 +11373,7 @@ function useAnchorPositioning(n) {
|
|
|
11373
11373
|
ph,
|
|
11374
11374
|
P,
|
|
11375
11375
|
F
|
|
11376
|
-
]), React
|
|
11376
|
+
]), React.useEffect(() => {
|
|
11377
11377
|
if (v && b && $.domReference && $.floating) return autoUpdate($.domReference, $.floating, _h, fh);
|
|
11378
11378
|
}, [
|
|
11379
11379
|
v,
|
|
@@ -11391,12 +11391,12 @@ function useAnchorPositioning(n) {
|
|
|
11391
11391
|
bh,
|
|
11392
11392
|
Dh
|
|
11393
11393
|
]);
|
|
11394
|
-
let jh = React
|
|
11394
|
+
let jh = React.useMemo(() => ({
|
|
11395
11395
|
position: "absolute",
|
|
11396
11396
|
top: gh.arrow?.y,
|
|
11397
11397
|
left: gh.arrow?.x
|
|
11398
11398
|
}), [gh.arrow]), Mh = gh.arrow?.centerOffset !== 0;
|
|
11399
|
-
return React
|
|
11399
|
+
return React.useMemo(() => ({
|
|
11400
11400
|
positionerStyles: Th,
|
|
11401
11401
|
arrowStyles: jh,
|
|
11402
11402
|
arrowRef: G,
|
|
@@ -11430,7 +11430,7 @@ function isRef(t) {
|
|
|
11430
11430
|
function getDisabledMountTransitionStyles(t) {
|
|
11431
11431
|
return t === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT;
|
|
11432
11432
|
}
|
|
11433
|
-
const TooltipPositioner = /* @__PURE__ */ React
|
|
11433
|
+
const TooltipPositioner = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
11434
11434
|
let { render: s, className: c, anchor: l, positionMethod: u = "absolute", side: d = "top", align: f = "center", sideOffset: m = 0, alignOffset: h = 0, collisionBoundary: g = "clipping-ancestors", collisionPadding: _ = 5, arrowPadding: v = 5, sticky: y = !1, disableAnchorTracking: b = !1, collisionAvoidance: x = POPUP_COLLISION_AVOIDANCE, ...S } = n, C = useTooltipRootContext(), w = useTooltipPortalContext(), T = C.useState("open"), E = C.useState("mounted"), D = C.useState("trackCursorAxis"), O = C.useState("disableHoverablePopup"), k = C.useState("floatingRootContext"), A = C.useState("instantType"), j = C.useState("transitionStatus"), M = useAnchorPositioning({
|
|
11435
11435
|
anchor: l,
|
|
11436
11436
|
positionMethod: u,
|
|
@@ -11448,7 +11448,7 @@ const TooltipPositioner = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
11448
11448
|
keepMounted: w,
|
|
11449
11449
|
collisionAvoidance: x,
|
|
11450
11450
|
adaptiveOrigin
|
|
11451
|
-
}), N = React
|
|
11451
|
+
}), N = React.useMemo(() => {
|
|
11452
11452
|
let t = {};
|
|
11453
11453
|
return (!T || D === "both" || O) && (t.pointerEvents = "none"), {
|
|
11454
11454
|
role: "presentation",
|
|
@@ -11464,7 +11464,7 @@ const TooltipPositioner = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
11464
11464
|
O,
|
|
11465
11465
|
E,
|
|
11466
11466
|
M.positionerStyles
|
|
11467
|
-
]), P = React
|
|
11467
|
+
]), P = React.useMemo(() => ({
|
|
11468
11468
|
open: T,
|
|
11469
11469
|
side: M.side,
|
|
11470
11470
|
align: M.align,
|
|
@@ -11477,7 +11477,7 @@ const TooltipPositioner = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
11477
11477
|
M.anchorHidden,
|
|
11478
11478
|
D,
|
|
11479
11479
|
A
|
|
11480
|
-
]), F = React
|
|
11480
|
+
]), F = React.useMemo(() => ({
|
|
11481
11481
|
...P,
|
|
11482
11482
|
arrowRef: M.arrowRef,
|
|
11483
11483
|
arrowStyles: M.arrowStyles,
|
|
@@ -11512,7 +11512,7 @@ function getCssDimensions(t) {
|
|
|
11512
11512
|
}
|
|
11513
11513
|
var supportsResizeObserver = typeof ResizeObserver < "u", DEFAULT_ENABLED = () => !0;
|
|
11514
11514
|
function usePopupAutoResize(n) {
|
|
11515
|
-
let { popupElement: i, positionerElement: s, content: c, mounted: l, enabled: u = DEFAULT_ENABLED, onMeasureLayout: d, onMeasureLayoutComplete: f, side: m, direction: h } = n, g = React
|
|
11515
|
+
let { popupElement: i, positionerElement: s, content: c, mounted: l, enabled: u = DEFAULT_ENABLED, onMeasureLayout: d, onMeasureLayoutComplete: f, side: m, direction: h } = n, g = React.useRef(!0), _ = useAnimationsFinished(i, !0, !1), v = useAnimationFrame(), y = React.useRef(null), b = useStableCallback(d), x = useStableCallback(f), S = React.useMemo(() => {
|
|
11516
11516
|
let t = m === "top", n = m === "left";
|
|
11517
11517
|
return h === "rtl" ? (t ||= m === "inline-end", n ||= m === "inline-end") : (t ||= m === "inline-start", n ||= m === "inline-start"), t ? {
|
|
11518
11518
|
position: "absolute",
|
|
@@ -11579,7 +11579,7 @@ var stateAttributesMapping$3 = {
|
|
|
11579
11579
|
...popupStateMapping,
|
|
11580
11580
|
...transitionStatusMapping
|
|
11581
11581
|
};
|
|
11582
|
-
const TooltipPopup = /* @__PURE__ */ React
|
|
11582
|
+
const TooltipPopup = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
11583
11583
|
let { className: s, render: c, ...l } = n, u = useTooltipRootContext(), { side: d, align: f } = useTooltipPositionerContext(), m = u.useState("open"), h = u.useState("mounted"), g = u.useState("instantType"), _ = u.useState("transitionStatus"), v = u.useState("popupProps"), y = u.useState("payload"), b = u.useState("popupElement"), x = u.useState("positionerElement"), S = u.useState("floatingRootContext"), C = useDirection();
|
|
11584
11584
|
useOpenChangeComplete({
|
|
11585
11585
|
open: m,
|
|
@@ -11602,7 +11602,7 @@ const TooltipPopup = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
11602
11602
|
positionerElement: x,
|
|
11603
11603
|
mounted: h,
|
|
11604
11604
|
content: y,
|
|
11605
|
-
enabled: React
|
|
11605
|
+
enabled: React.useCallback(() => u.context.triggerElements.size > 1, [u]),
|
|
11606
11606
|
onMeasureLayout: w,
|
|
11607
11607
|
onMeasureLayoutComplete: T,
|
|
11608
11608
|
side: d,
|
|
@@ -11613,7 +11613,7 @@ const TooltipPopup = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
11613
11613
|
enabled: !E,
|
|
11614
11614
|
closeDelay: D
|
|
11615
11615
|
}), useRenderElement("div", n, {
|
|
11616
|
-
state: React
|
|
11616
|
+
state: React.useMemo(() => ({
|
|
11617
11617
|
open: m,
|
|
11618
11618
|
side: d,
|
|
11619
11619
|
align: f,
|
|
@@ -11640,10 +11640,10 @@ const TooltipPopup = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
11640
11640
|
});
|
|
11641
11641
|
});
|
|
11642
11642
|
process.env.NODE_ENV !== "production" && (TooltipPopup.displayName = "TooltipPopup");
|
|
11643
|
-
const TooltipArrow = /* @__PURE__ */ React
|
|
11643
|
+
const TooltipArrow = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
11644
11644
|
let { className: s, render: c, ...l } = n, u = useTooltipRootContext().useState("instantType"), { open: d, arrowRef: f, side: m, align: h, arrowUncentered: g, arrowStyles: _ } = useTooltipPositionerContext();
|
|
11645
11645
|
return useRenderElement("div", n, {
|
|
11646
|
-
state: React
|
|
11646
|
+
state: React.useMemo(() => ({
|
|
11647
11647
|
open: d,
|
|
11648
11648
|
side: m,
|
|
11649
11649
|
align: h,
|
|
@@ -11666,10 +11666,10 @@ const TooltipArrow = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
11666
11666
|
});
|
|
11667
11667
|
process.env.NODE_ENV !== "production" && (TooltipArrow.displayName = "TooltipArrow");
|
|
11668
11668
|
const TooltipProvider = function(n) {
|
|
11669
|
-
let { delay: i, closeDelay: s, timeout: c = 400 } = n, l = React
|
|
11669
|
+
let { delay: i, closeDelay: s, timeout: c = 400 } = n, l = React.useMemo(() => ({
|
|
11670
11670
|
delay: i,
|
|
11671
11671
|
closeDelay: s
|
|
11672
|
-
}), [i, s]), u = React
|
|
11672
|
+
}), [i, s]), u = React.useMemo(() => ({
|
|
11673
11673
|
open: i,
|
|
11674
11674
|
close: s
|
|
11675
11675
|
}), [i, s]);
|
|
@@ -11726,30 +11726,30 @@ const TooltipContent = (t) => {
|
|
|
11726
11726
|
children: [u, i]
|
|
11727
11727
|
})
|
|
11728
11728
|
}) }), n[7] = i, n[8] = c, n[9] = l, n[10] = d) : d = n[10], d;
|
|
11729
|
-
}, SliderHandle = ({ sliderInstance:
|
|
11730
|
-
let [g, _] =
|
|
11729
|
+
}, SliderHandle = ({ sliderInstance: t, isActive: n, onKeyDownHandler: i, onMouseDownHandler: s, onTouchStart: c, value: l, className: u, children: d, ref: m, ...h }) => {
|
|
11730
|
+
let [g, _] = useState(!1);
|
|
11731
11731
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Tooltip, {
|
|
11732
|
-
open:
|
|
11732
|
+
open: n || g,
|
|
11733
11733
|
trackCursorAxis: "x",
|
|
11734
11734
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipTrigger, { render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
11735
|
-
onKeyDown:
|
|
11736
|
-
onMouseDown:
|
|
11737
|
-
onTouchStart:
|
|
11735
|
+
onKeyDown: i,
|
|
11736
|
+
onMouseDown: s,
|
|
11737
|
+
onTouchStart: c,
|
|
11738
11738
|
onMouseEnter: () => _(!0),
|
|
11739
11739
|
onMouseLeave: () => _(!1),
|
|
11740
11740
|
role: "slider",
|
|
11741
|
-
"aria-valuemin":
|
|
11742
|
-
"aria-valuemax":
|
|
11743
|
-
"aria-valuenow":
|
|
11741
|
+
"aria-valuemin": t.options.min,
|
|
11742
|
+
"aria-valuemax": t.options.max,
|
|
11743
|
+
"aria-valuenow": l,
|
|
11744
11744
|
style: {
|
|
11745
|
-
left: `${
|
|
11746
|
-
zIndex:
|
|
11745
|
+
left: `${t.getPercentageForValue(l)}%`,
|
|
11746
|
+
zIndex: n ? "1" : "0"
|
|
11747
11747
|
},
|
|
11748
|
-
className: cn("absolute top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full outline-none border-2 border-primary bg-surface-container hover:cursor-pointer active:border-secondary hover:border-secondary transition-[width,height,border] aspect-square",
|
|
11748
|
+
className: cn("absolute top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full outline-none border-2 border-primary bg-surface-container hover:cursor-pointer active:border-secondary hover:border-secondary transition-[width,height,border] aspect-square", n ? "size-md shadow-4-shadow" : "size-sm shadow-1-shadow", u),
|
|
11749
11749
|
ref: m,
|
|
11750
11750
|
...h,
|
|
11751
|
-
children:
|
|
11752
|
-
}) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children:
|
|
11751
|
+
children: d
|
|
11752
|
+
}) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: l }) })]
|
|
11753
11753
|
});
|
|
11754
11754
|
}, SliderSegment = ({ index: t, steps: n, left: i, width: s, className: c, children: l, ref: u, ...d }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
11755
11755
|
className: cn("absolute bg-primary h-full rounded-full inset-shadow-1-shadow", c),
|
|
@@ -11891,57 +11891,57 @@ var getBoundingClientRect = (t) => {
|
|
|
11891
11891
|
...t
|
|
11892
11892
|
};
|
|
11893
11893
|
}
|
|
11894
|
-
}, useIsomorphicLayoutEffect = typeof window < "u" ? React
|
|
11894
|
+
}, useIsomorphicLayoutEffect = typeof window < "u" ? React.useLayoutEffect : React.useEffect;
|
|
11895
11895
|
function useRanger(n) {
|
|
11896
|
-
let i = React
|
|
11896
|
+
let i = React.useReducer(() => ({}), {})[1], s = {
|
|
11897
11897
|
...n,
|
|
11898
11898
|
rerender: i,
|
|
11899
11899
|
onChange: (t) => {
|
|
11900
11900
|
i(), n.onChange?.(t);
|
|
11901
11901
|
}
|
|
11902
|
-
}, [c] = React
|
|
11902
|
+
}, [c] = React.useState(() => new Ranger(s));
|
|
11903
11903
|
return c.setOptions(s), useIsomorphicLayoutEffect(() => c._willUpdate()), c;
|
|
11904
11904
|
}
|
|
11905
|
-
const Slider = ({ leadingIcon:
|
|
11906
|
-
let
|
|
11907
|
-
getRangerElement: () =>
|
|
11908
|
-
values:
|
|
11909
|
-
min:
|
|
11910
|
-
max:
|
|
11911
|
-
stepSize:
|
|
11905
|
+
const Slider = ({ leadingIcon: t, trailingIcon: n, min: i, max: s, stepSize: c, defaultValues: l, showTickLabels: u, label: m, className: h, ref: g, ..._ }) => {
|
|
11906
|
+
let v = useRef(null), [y, b] = useState(l || [50]), x = useRanger({
|
|
11907
|
+
getRangerElement: () => v.current,
|
|
11908
|
+
values: y,
|
|
11909
|
+
min: i ?? 0,
|
|
11910
|
+
max: s ?? 100,
|
|
11911
|
+
stepSize: c ?? 1,
|
|
11912
11912
|
onChange: (t) => {
|
|
11913
|
-
|
|
11913
|
+
b(t.sortedValues);
|
|
11914
11914
|
}
|
|
11915
11915
|
});
|
|
11916
11916
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
11917
|
-
ref:
|
|
11918
|
-
className: cn("space-y-2xs",
|
|
11919
|
-
...
|
|
11920
|
-
children: [
|
|
11917
|
+
ref: g,
|
|
11918
|
+
className: cn("space-y-2xs", h),
|
|
11919
|
+
..._,
|
|
11920
|
+
children: [m && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
11921
11921
|
className: "style-text-default--1 text-on-surface-variant",
|
|
11922
|
-
children:
|
|
11922
|
+
children: m
|
|
11923
11923
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
11924
11924
|
className: "flex items-center w-full gap-sm",
|
|
11925
11925
|
children: [
|
|
11926
|
-
|
|
11926
|
+
t && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(t, {
|
|
11927
11927
|
className: "size-sm",
|
|
11928
11928
|
weight: "bold"
|
|
11929
11929
|
}),
|
|
11930
11930
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SliderTrack, {
|
|
11931
|
-
sliderRef:
|
|
11931
|
+
sliderRef: v,
|
|
11932
11932
|
children: [
|
|
11933
|
-
|
|
11933
|
+
u && x.getTicks().map(({ value: t, key: n, percentage: i }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderTick, {
|
|
11934
11934
|
percentage: i,
|
|
11935
11935
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderTickLabel, { children: t })
|
|
11936
11936
|
}, n)),
|
|
11937
|
-
|
|
11937
|
+
x.getSteps().map(({ left: t, width: n }, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderSegment, {
|
|
11938
11938
|
index: i,
|
|
11939
|
-
steps:
|
|
11939
|
+
steps: x.getSteps().length,
|
|
11940
11940
|
left: t,
|
|
11941
11941
|
width: n
|
|
11942
11942
|
}, i)),
|
|
11943
|
-
|
|
11944
|
-
sliderInstance:
|
|
11943
|
+
x.handles().map(({ isActive: t, onKeyDownHandler: n, onMouseDownHandler: i, onTouchStart: s, value: c }, l) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderHandle, {
|
|
11944
|
+
sliderInstance: x,
|
|
11945
11945
|
isActive: t,
|
|
11946
11946
|
onKeyDownHandler: n,
|
|
11947
11947
|
onMouseDownHandler: i,
|
|
@@ -11950,17 +11950,17 @@ const Slider = ({ leadingIcon: n, trailingIcon: i, min: s, max: c, stepSize: l,
|
|
|
11950
11950
|
}, l))
|
|
11951
11951
|
]
|
|
11952
11952
|
}),
|
|
11953
|
-
|
|
11953
|
+
n && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(n, {
|
|
11954
11954
|
className: "size-sm",
|
|
11955
11955
|
weight: "bold"
|
|
11956
11956
|
})
|
|
11957
11957
|
]
|
|
11958
11958
|
})]
|
|
11959
11959
|
});
|
|
11960
|
-
}, SwitchRootContext = /* @__PURE__ */ React
|
|
11960
|
+
}, SwitchRootContext = /* @__PURE__ */ React.createContext(void 0);
|
|
11961
11961
|
process.env.NODE_ENV !== "production" && (SwitchRootContext.displayName = "SwitchRootContext");
|
|
11962
11962
|
function useSwitchRootContext() {
|
|
11963
|
-
let n = React
|
|
11963
|
+
let n = React.useContext(SwitchRootContext);
|
|
11964
11964
|
if (n === void 0) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(63) : "Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.");
|
|
11965
11965
|
return n;
|
|
11966
11966
|
}
|
|
@@ -11972,8 +11972,8 @@ const stateAttributesMapping$2 = {
|
|
|
11972
11972
|
checked(t) {
|
|
11973
11973
|
return t ? { [SwitchRootDataAttributes.checked]: "" } : { [SwitchRootDataAttributes.unchecked]: "" };
|
|
11974
11974
|
}
|
|
11975
|
-
}, SwitchRoot = /* @__PURE__ */ React
|
|
11976
|
-
let { checked: s, className: c, defaultChecked: l, id: u, inputRef: d, name: f, nativeButton: m = !1, onCheckedChange: h, readOnly: g = !1, required: _ = !1, disabled: v = !1, render: y, uncheckedValue: b, ...x } = n, { clearErrors: S } = useFormContext(), { state: w, setTouched: T, setDirty: E, validityData: D, setFilled: O, setFocused: k, shouldValidateOnChange: A, validationMode: j, disabled: M, name: N, validation: P } = useFieldRootContext(), { labelId: F } = useLabelableContext(), I = M || v, R = N ?? f, z = useStableCallback(h), B = React
|
|
11975
|
+
}, SwitchRoot = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
11976
|
+
let { checked: s, className: c, defaultChecked: l, id: u, inputRef: d, name: f, nativeButton: m = !1, onCheckedChange: h, readOnly: g = !1, required: _ = !1, disabled: v = !1, render: y, uncheckedValue: b, ...x } = n, { clearErrors: S } = useFormContext(), { state: w, setTouched: T, setDirty: E, validityData: D, setFilled: O, setFocused: k, shouldValidateOnChange: A, validationMode: j, disabled: M, name: N, validation: P } = useFieldRootContext(), { labelId: F } = useLabelableContext(), I = M || v, R = N ?? f, z = useStableCallback(h), B = React.useRef(null), V = useMergedRefs(B, d, P.inputRef), H = React.useRef(null), U = useBaseUiId(), W = useLabelableId({
|
|
11977
11977
|
id: u,
|
|
11978
11978
|
implicit: !1,
|
|
11979
11979
|
controlRef: H
|
|
@@ -12014,7 +12014,7 @@ const stateAttributesMapping$2 = {
|
|
|
12014
12014
|
onClick(t) {
|
|
12015
12015
|
g || I || (t.preventDefault(), B?.current?.click());
|
|
12016
12016
|
}
|
|
12017
|
-
}, X = React
|
|
12017
|
+
}, X = React.useMemo(() => mergeProps({
|
|
12018
12018
|
checked: G,
|
|
12019
12019
|
disabled: I,
|
|
12020
12020
|
id: W,
|
|
@@ -12043,7 +12043,7 @@ const stateAttributesMapping$2 = {
|
|
|
12043
12043
|
_,
|
|
12044
12044
|
K,
|
|
12045
12045
|
P
|
|
12046
|
-
]), Z = React
|
|
12046
|
+
]), Z = React.useMemo(() => ({
|
|
12047
12047
|
...w,
|
|
12048
12048
|
checked: G,
|
|
12049
12049
|
disabled: I,
|
|
@@ -12084,7 +12084,7 @@ const stateAttributesMapping$2 = {
|
|
|
12084
12084
|
});
|
|
12085
12085
|
});
|
|
12086
12086
|
process.env.NODE_ENV !== "production" && (SwitchRoot.displayName = "SwitchRoot");
|
|
12087
|
-
const SwitchThumb = /* @__PURE__ */ React
|
|
12087
|
+
const SwitchThumb = /* @__PURE__ */ React.forwardRef(function(t, n) {
|
|
12088
12088
|
let { render: i, className: s, ...c } = t, { state: l } = useFieldRootContext(), u = useSwitchRootContext();
|
|
12089
12089
|
return useRenderElement("span", t, {
|
|
12090
12090
|
state: {
|
|
@@ -12122,7 +12122,7 @@ const Switch = (t) => {
|
|
|
12122
12122
|
className: "flex items-center gap-xs",
|
|
12123
12123
|
children: [f, m]
|
|
12124
12124
|
}), n[15] = f, n[16] = m, n[17] = h) : h = n[17], h;
|
|
12125
|
-
}, TabsOrientationContext =
|
|
12125
|
+
}, TabsOrientationContext = createContext("vertical"), CompositeListContext = /* @__PURE__ */ React.createContext({
|
|
12126
12126
|
register: () => {},
|
|
12127
12127
|
unregister: () => {},
|
|
12128
12128
|
subscribeMapChange: () => () => {},
|
|
@@ -12131,14 +12131,14 @@ const Switch = (t) => {
|
|
|
12131
12131
|
});
|
|
12132
12132
|
process.env.NODE_ENV !== "production" && (CompositeListContext.displayName = "CompositeListContext");
|
|
12133
12133
|
function useCompositeListContext() {
|
|
12134
|
-
return React
|
|
12134
|
+
return React.useContext(CompositeListContext);
|
|
12135
12135
|
}
|
|
12136
12136
|
function CompositeList(n) {
|
|
12137
|
-
let { children: i, elementsRef: s, labelsRef: c, onMapChange: l } = n, u = useStableCallback(l), d = React
|
|
12137
|
+
let { children: i, elementsRef: s, labelsRef: c, onMapChange: l } = n, u = useStableCallback(l), d = React.useRef(0), f = useRefWithInit(createListeners).current, m = useRefWithInit(createMap).current, [h, g] = React.useState(0), _ = React.useRef(h), v = useStableCallback((t, n) => {
|
|
12138
12138
|
m.set(t, n ?? null), _.current += 1, g(_.current);
|
|
12139
12139
|
}), y = useStableCallback((t) => {
|
|
12140
12140
|
m.delete(t), _.current += 1, g(_.current);
|
|
12141
|
-
}), b = React
|
|
12141
|
+
}), b = React.useMemo(() => {
|
|
12142
12142
|
let t = /* @__PURE__ */ new Map();
|
|
12143
12143
|
return Array.from(m.keys()).filter((t) => t.isConnected).sort(sortByDocumentPosition).forEach((n, i) => {
|
|
12144
12144
|
let s = m.get(n) ?? {};
|
|
@@ -12180,7 +12180,7 @@ function CompositeList(n) {
|
|
|
12180
12180
|
useIsoLayoutEffect(() => {
|
|
12181
12181
|
f.forEach((t) => t(b));
|
|
12182
12182
|
}, [f, b]);
|
|
12183
|
-
let C = React
|
|
12183
|
+
let C = React.useMemo(() => ({
|
|
12184
12184
|
register: v,
|
|
12185
12185
|
unregister: y,
|
|
12186
12186
|
subscribeMapChange: x,
|
|
@@ -12210,23 +12210,23 @@ function sortByDocumentPosition(t, n) {
|
|
|
12210
12210
|
let i = t.compareDocumentPosition(n);
|
|
12211
12211
|
return i & Node.DOCUMENT_POSITION_FOLLOWING || i & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING || i & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
|
|
12212
12212
|
}
|
|
12213
|
-
const TabsRootContext = /* @__PURE__ */ React
|
|
12213
|
+
const TabsRootContext = /* @__PURE__ */ React.createContext(void 0);
|
|
12214
12214
|
process.env.NODE_ENV !== "production" && (TabsRootContext.displayName = "TabsRootContext");
|
|
12215
12215
|
function useTabsRootContext() {
|
|
12216
|
-
let n = React
|
|
12216
|
+
let n = React.useContext(TabsRootContext);
|
|
12217
12217
|
if (n === void 0) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(64) : "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>.");
|
|
12218
12218
|
return n;
|
|
12219
12219
|
}
|
|
12220
12220
|
let TabsRootDataAttributes = /* @__PURE__ */ function(t) {
|
|
12221
12221
|
return t.activationDirection = "data-activation-direction", t.orientation = "data-orientation", t;
|
|
12222
12222
|
}({});
|
|
12223
|
-
const tabsStateAttributesMapping = { tabActivationDirection: (t) => ({ [TabsRootDataAttributes.activationDirection]: t }) }, TabsRoot = /* @__PURE__ */ React
|
|
12224
|
-
let { className: s, defaultValue: c = 0, onValueChange: l, orientation: u = "horizontal", render: d, value: f, ...m } = n, h = useDirection(), g = Object.hasOwn(n, "defaultValue"), _ = React
|
|
12223
|
+
const tabsStateAttributesMapping = { tabActivationDirection: (t) => ({ [TabsRootDataAttributes.activationDirection]: t }) }, TabsRoot = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
12224
|
+
let { className: s, defaultValue: c = 0, onValueChange: l, orientation: u = "horizontal", render: d, value: f, ...m } = n, h = useDirection(), g = Object.hasOwn(n, "defaultValue"), _ = React.useRef([]), [v, y] = React.useState(() => /* @__PURE__ */ new Map()), [b, x] = useControlled({
|
|
12225
12225
|
controlled: f,
|
|
12226
12226
|
default: c,
|
|
12227
12227
|
name: "Tabs",
|
|
12228
12228
|
state: "value"
|
|
12229
|
-
}), S = f !== void 0, [C, w] = React
|
|
12229
|
+
}), S = f !== void 0, [C, w] = React.useState(() => /* @__PURE__ */ new Map()), [T, E] = React.useState("none"), D = useStableCallback((t, n) => {
|
|
12230
12230
|
l?.(t, n), !n.isCanceled && (x(t), E(n.activationDirection));
|
|
12231
12231
|
}), O = useStableCallback((t, n) => {
|
|
12232
12232
|
y((i) => {
|
|
@@ -12240,13 +12240,13 @@ const tabsStateAttributesMapping = { tabActivationDirection: (t) => ({ [TabsRoot
|
|
|
12240
12240
|
let s = new Map(i);
|
|
12241
12241
|
return s.delete(t), s;
|
|
12242
12242
|
});
|
|
12243
|
-
}), A = React
|
|
12243
|
+
}), A = React.useCallback((t) => v.get(t), [v]), j = React.useCallback((t) => {
|
|
12244
12244
|
for (let n of C.values()) if (t === n?.value) return n?.id;
|
|
12245
|
-
}, [C]), M = React
|
|
12245
|
+
}, [C]), M = React.useCallback((t) => {
|
|
12246
12246
|
if (t === void 0) return null;
|
|
12247
12247
|
for (let [n, i] of C.entries()) if (i != null && t === (i.value ?? i.index)) return n;
|
|
12248
12248
|
return null;
|
|
12249
|
-
}, [C]), N = React
|
|
12249
|
+
}, [C]), N = React.useMemo(() => ({
|
|
12250
12250
|
direction: h,
|
|
12251
12251
|
getTabElementBySelectedValue: M,
|
|
12252
12252
|
getTabIdByPanelValue: j,
|
|
@@ -12270,9 +12270,9 @@ const tabsStateAttributesMapping = { tabActivationDirection: (t) => ({ [TabsRoot
|
|
|
12270
12270
|
k,
|
|
12271
12271
|
T,
|
|
12272
12272
|
b
|
|
12273
|
-
]), P = React
|
|
12273
|
+
]), P = React.useMemo(() => {
|
|
12274
12274
|
for (let t of C.values()) if (t != null && t.value === b) return t;
|
|
12275
|
-
}, [C, b]), F = React
|
|
12275
|
+
}, [C, b]), F = React.useMemo(() => {
|
|
12276
12276
|
for (let t of C.values()) if (t != null && !t.disabled) return t.value;
|
|
12277
12277
|
}, [C]);
|
|
12278
12278
|
useIsoLayoutEffect(() => {
|
|
@@ -12314,13 +12314,13 @@ let IndexGuessBehavior = /* @__PURE__ */ function(t) {
|
|
|
12314
12314
|
return t[t.None = 0] = "None", t[t.GuessFromOrder = 1] = "GuessFromOrder", t;
|
|
12315
12315
|
}({});
|
|
12316
12316
|
function useCompositeListItem(n = {}) {
|
|
12317
|
-
let { label: i, metadata: s, textRef: c, indexGuessBehavior: l, index: u } = n, { register: d, unregister: f, subscribeMapChange: m, elementsRef: h, labelsRef: g, nextIndexRef: _ } = useCompositeListContext(), v = React
|
|
12317
|
+
let { label: i, metadata: s, textRef: c, indexGuessBehavior: l, index: u } = n, { register: d, unregister: f, subscribeMapChange: m, elementsRef: h, labelsRef: g, nextIndexRef: _ } = useCompositeListContext(), v = React.useRef(-1), [y, b] = React.useState(u ?? (l === IndexGuessBehavior.GuessFromOrder ? () => {
|
|
12318
12318
|
if (v.current === -1) {
|
|
12319
12319
|
let t = _.current;
|
|
12320
12320
|
_.current += 1, v.current = t;
|
|
12321
12321
|
}
|
|
12322
12322
|
return v.current;
|
|
12323
|
-
} : -1)), x = React
|
|
12323
|
+
} : -1)), x = React.useRef(null), S = React.useCallback((t) => {
|
|
12324
12324
|
if (x.current = t, y !== -1 && t !== null && (h.current[y] = t, g)) {
|
|
12325
12325
|
let n = i !== void 0;
|
|
12326
12326
|
g.current[y] = n ? i : c?.current?.textContent ?? t.textContent;
|
|
@@ -12352,15 +12352,15 @@ function useCompositeListItem(n = {}) {
|
|
|
12352
12352
|
u,
|
|
12353
12353
|
m,
|
|
12354
12354
|
b
|
|
12355
|
-
]), React
|
|
12355
|
+
]), React.useMemo(() => ({
|
|
12356
12356
|
ref: S,
|
|
12357
12357
|
index: y
|
|
12358
12358
|
}), [y, S]);
|
|
12359
12359
|
}
|
|
12360
12360
|
function useCompositeItem(n = {}) {
|
|
12361
|
-
let { highlightItemOnHover: i, highlightedIndex: s, onHighlightedIndexChange: c } = useCompositeRootContext(), { ref: l, index: u } = useCompositeListItem(n), d = s === u, f = React
|
|
12361
|
+
let { highlightItemOnHover: i, highlightedIndex: s, onHighlightedIndexChange: c } = useCompositeRootContext(), { ref: l, index: u } = useCompositeListItem(n), d = s === u, f = React.useRef(null), m = useMergedRefs(l, f);
|
|
12362
12362
|
return {
|
|
12363
|
-
compositeProps: React
|
|
12363
|
+
compositeProps: React.useMemo(() => ({
|
|
12364
12364
|
tabIndex: d ? 0 : -1,
|
|
12365
12365
|
onFocus() {
|
|
12366
12366
|
c(u);
|
|
@@ -12381,15 +12381,15 @@ function useCompositeItem(n = {}) {
|
|
|
12381
12381
|
index: u
|
|
12382
12382
|
};
|
|
12383
12383
|
}
|
|
12384
|
-
const TabsListContext = /* @__PURE__ */ React
|
|
12384
|
+
const TabsListContext = /* @__PURE__ */ React.createContext(void 0);
|
|
12385
12385
|
process.env.NODE_ENV !== "production" && (TabsListContext.displayName = "TabsListContext");
|
|
12386
12386
|
function useTabsListContext() {
|
|
12387
|
-
let n = React
|
|
12387
|
+
let n = React.useContext(TabsListContext);
|
|
12388
12388
|
if (n === void 0) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(65) : "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>.");
|
|
12389
12389
|
return n;
|
|
12390
12390
|
}
|
|
12391
|
-
const TabsTab$1 = /* @__PURE__ */ React
|
|
12392
|
-
let { className: s, disabled: c = !1, render: l, value: u, id: d, nativeButton: f = !0, ...m } = n, { value: h, getTabPanelIdByValue: g, orientation: _ } = useTabsRootContext(), { activateOnFocus: v, highlightedTabIndex: y, onTabActivation: b, setHighlightedTabIndex: x, tabsListElement: S } = useTabsListContext(), C = useBaseUiId(d), { compositeProps: w, compositeRef: T, index: E } = useCompositeItem({ metadata: React
|
|
12391
|
+
const TabsTab$1 = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
12392
|
+
let { className: s, disabled: c = !1, render: l, value: u, id: d, nativeButton: f = !0, ...m } = n, { value: h, getTabPanelIdByValue: g, orientation: _ } = useTabsRootContext(), { activateOnFocus: v, highlightedTabIndex: y, onTabActivation: b, setHighlightedTabIndex: x, tabsListElement: S } = useTabsListContext(), C = useBaseUiId(d), { compositeProps: w, compositeRef: T, index: E } = useCompositeItem({ metadata: React.useMemo(() => ({
|
|
12393
12393
|
disabled: c,
|
|
12394
12394
|
id: C,
|
|
12395
12395
|
value: u
|
|
@@ -12397,7 +12397,7 @@ const TabsTab$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
12397
12397
|
c,
|
|
12398
12398
|
C,
|
|
12399
12399
|
u
|
|
12400
|
-
]) }), D = u === h, O = React
|
|
12400
|
+
]) }), D = u === h, O = React.useRef(!1);
|
|
12401
12401
|
useIsoLayoutEffect(() => {
|
|
12402
12402
|
if (O.current) {
|
|
12403
12403
|
O.current = !1;
|
|
@@ -12422,7 +12422,7 @@ const TabsTab$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
12422
12422
|
disabled: c,
|
|
12423
12423
|
native: f,
|
|
12424
12424
|
focusableWhenDisabled: !0
|
|
12425
|
-
}), j = g(u), M = React
|
|
12425
|
+
}), j = g(u), M = React.useRef(!1), N = React.useRef(!1);
|
|
12426
12426
|
function P(t) {
|
|
12427
12427
|
D || c || b(u, createChangeEventDetails(none, t.nativeEvent, void 0, { activationDirection: "none" }));
|
|
12428
12428
|
}
|
|
@@ -12438,7 +12438,7 @@ const TabsTab$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
12438
12438
|
(!t.button || t.button === 0) && (N.current = !0, ownerDocument(t.currentTarget).addEventListener("pointerup", n, { once: !0 }));
|
|
12439
12439
|
}
|
|
12440
12440
|
return useRenderElement("button", n, {
|
|
12441
|
-
state: React
|
|
12441
|
+
state: React.useMemo(() => ({
|
|
12442
12442
|
disabled: c,
|
|
12443
12443
|
active: D,
|
|
12444
12444
|
orientation: _
|
|
@@ -12481,11 +12481,11 @@ var stateAttributesMapping$1 = {
|
|
|
12481
12481
|
activeTabPosition: () => null,
|
|
12482
12482
|
activeTabSize: () => null
|
|
12483
12483
|
};
|
|
12484
|
-
const TabsIndicator$1 = /* @__PURE__ */ React
|
|
12485
|
-
let { className: s, render: c, renderBeforeHydration: l = !1, ...u } = n, { getTabElementBySelectedValue: d, orientation: f, tabActivationDirection: m, value: h } = useTabsRootContext(), { tabsListElement: g } = useTabsListContext(), [_, v] = React
|
|
12484
|
+
const TabsIndicator$1 = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
12485
|
+
let { className: s, render: c, renderBeforeHydration: l = !1, ...u } = n, { getTabElementBySelectedValue: d, orientation: f, tabActivationDirection: m, value: h } = useTabsRootContext(), { tabsListElement: g } = useTabsListContext(), [_, v] = React.useState(!1), { value: y } = useTabsRootContext();
|
|
12486
12486
|
useOnMount(() => v(!0));
|
|
12487
12487
|
let b = useForcedRerendering();
|
|
12488
|
-
React
|
|
12488
|
+
React.useEffect(() => {
|
|
12489
12489
|
if (h != null && g != null && typeof ResizeObserver < "u") {
|
|
12490
12490
|
let t = new ResizeObserver(b);
|
|
12491
12491
|
return t.observe(g), () => {
|
|
@@ -12509,7 +12509,7 @@ const TabsIndicator$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
12509
12509
|
T = n, E = i, S = g.scrollWidth - x - T, w = g.scrollHeight - C - E;
|
|
12510
12510
|
}
|
|
12511
12511
|
}
|
|
12512
|
-
let O = React
|
|
12512
|
+
let O = React.useMemo(() => D ? {
|
|
12513
12513
|
left: x,
|
|
12514
12514
|
right: S,
|
|
12515
12515
|
top: C,
|
|
@@ -12520,14 +12520,14 @@ const TabsIndicator$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
12520
12520
|
C,
|
|
12521
12521
|
w,
|
|
12522
12522
|
D
|
|
12523
|
-
]), k = React
|
|
12523
|
+
]), k = React.useMemo(() => D ? {
|
|
12524
12524
|
width: T,
|
|
12525
12525
|
height: E
|
|
12526
12526
|
} : null, [
|
|
12527
12527
|
T,
|
|
12528
12528
|
E,
|
|
12529
12529
|
D
|
|
12530
|
-
]), A = React
|
|
12530
|
+
]), A = React.useMemo(() => {
|
|
12531
12531
|
if (D) return {
|
|
12532
12532
|
[TabsIndicatorCssVars.activeTabLeft]: `${x}px`,
|
|
12533
12533
|
[TabsIndicatorCssVars.activeTabRight]: `${S}px`,
|
|
@@ -12545,7 +12545,7 @@ const TabsIndicator$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
12545
12545
|
E,
|
|
12546
12546
|
D
|
|
12547
12547
|
]), j = D && T > 0 && E > 0, M = useRenderElement("span", n, {
|
|
12548
|
-
state: React
|
|
12548
|
+
state: React.useMemo(() => ({
|
|
12549
12549
|
orientation: f,
|
|
12550
12550
|
activeTabPosition: O,
|
|
12551
12551
|
activeTabSize: k,
|
|
@@ -12568,7 +12568,7 @@ const TabsIndicator$1 = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
12568
12568
|
],
|
|
12569
12569
|
stateAttributesMapping: stateAttributesMapping$1
|
|
12570
12570
|
});
|
|
12571
|
-
return y == null ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(React
|
|
12571
|
+
return y == null ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(React.Fragment, { children: [M, !_ && l && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("script", {
|
|
12572
12572
|
dangerouslySetInnerHTML: { __html: "!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest('[role=\"tablist\"]');if(!e)return;const i=e.querySelector(\"[data-active]\");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c(\"left\",o),c(\"right\",n),c(\"top\",h),c(\"bottom\",l),c(\"width\",r),c(\"height\",f),r>0&&f>0&&t.removeAttribute(\"hidden\")}();" },
|
|
12573
12573
|
suppressHydrationWarning: !0
|
|
12574
12574
|
})] });
|
|
@@ -12577,12 +12577,12 @@ process.env.NODE_ENV !== "production" && (TabsIndicator$1.displayName = "TabsInd
|
|
|
12577
12577
|
let TabsPanelDataAttributes = /* @__PURE__ */ function(t) {
|
|
12578
12578
|
return t.index = "data-index", t.activationDirection = "data-activation-direction", t.orientation = "data-orientation", t.hidden = "data-hidden", t;
|
|
12579
12579
|
}({});
|
|
12580
|
-
const TabsPanel$1 = /* @__PURE__ */ React
|
|
12581
|
-
let { className: s, value: c, render: l, keepMounted: u = !1, ...d } = n, { value: f, getTabIdByPanelValue: m, orientation: h, tabActivationDirection: g, registerMountedTabPanel: _, unregisterMountedTabPanel: v } = useTabsRootContext(), y = useBaseUiId(), { ref: b, index: x } = useCompositeListItem({ metadata: React
|
|
12580
|
+
const TabsPanel$1 = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
12581
|
+
let { className: s, value: c, render: l, keepMounted: u = !1, ...d } = n, { value: f, getTabIdByPanelValue: m, orientation: h, tabActivationDirection: g, registerMountedTabPanel: _, unregisterMountedTabPanel: v } = useTabsRootContext(), y = useBaseUiId(), { ref: b, index: x } = useCompositeListItem({ metadata: React.useMemo(() => ({
|
|
12582
12582
|
id: y,
|
|
12583
12583
|
value: c
|
|
12584
12584
|
}), [y, c]) }), S = c !== f, C = m(c), w = useRenderElement("div", n, {
|
|
12585
|
-
state: React
|
|
12585
|
+
state: React.useMemo(() => ({
|
|
12586
12586
|
hidden: S,
|
|
12587
12587
|
orientation: h,
|
|
12588
12588
|
tabActivationDirection: g
|
|
@@ -12621,7 +12621,7 @@ function isElementDisabled(t) {
|
|
|
12621
12621
|
}
|
|
12622
12622
|
var EMPTY_ARRAY$1 = [];
|
|
12623
12623
|
function useCompositeRoot(n) {
|
|
12624
|
-
let { itemSizes: i, cols: s = 1, loopFocus: c = !0, dense: l = !1, orientation: u = "both", direction: d, highlightedIndex: f, onHighlightedIndexChange: m, rootRef: h, enableHomeAndEndKeys: g = !1, stopEventPropagation: _ = !1, disabledIndices: v, modifierKeys: y = EMPTY_ARRAY$1 } = n, [b, x] = React
|
|
12624
|
+
let { itemSizes: i, cols: s = 1, loopFocus: c = !0, dense: l = !1, orientation: u = "both", direction: d, highlightedIndex: f, onHighlightedIndexChange: m, rootRef: h, enableHomeAndEndKeys: g = !1, stopEventPropagation: _ = !1, disabledIndices: v, modifierKeys: y = EMPTY_ARRAY$1 } = n, [b, x] = React.useState(0), S = s > 1, w = React.useRef(null), T = useMergedRefs(w, h), E = React.useRef([]), D = React.useRef(!1), O = f ?? b, k = useStableCallback((t, n = !1) => {
|
|
12625
12625
|
if ((m ?? x)(t), n) {
|
|
12626
12626
|
let n = E.current[t];
|
|
12627
12627
|
scrollIntoViewIfNeeded(w.current, n, d, u);
|
|
@@ -12631,7 +12631,7 @@ function useCompositeRoot(n) {
|
|
|
12631
12631
|
D.current = !0;
|
|
12632
12632
|
let n = Array.from(t.keys()), i = n.find((t) => t?.hasAttribute("data-composite-item-active")) ?? null, s = i ? n.indexOf(i) : -1;
|
|
12633
12633
|
s !== -1 && k(s), scrollIntoViewIfNeeded(w.current, i, d, u);
|
|
12634
|
-
}), j = React
|
|
12634
|
+
}), j = React.useMemo(() => ({
|
|
12635
12635
|
"aria-orientation": u === "both" ? void 0 : u,
|
|
12636
12636
|
ref: T,
|
|
12637
12637
|
onFocus(t) {
|
|
@@ -12709,7 +12709,7 @@ function useCompositeRoot(n) {
|
|
|
12709
12709
|
u,
|
|
12710
12710
|
_
|
|
12711
12711
|
]);
|
|
12712
|
-
return React
|
|
12712
|
+
return React.useMemo(() => ({
|
|
12713
12713
|
props: j,
|
|
12714
12714
|
highlightedIndex: O,
|
|
12715
12715
|
onHighlightedIndexChange: k,
|
|
@@ -12754,7 +12754,7 @@ function CompositeRoot(n) {
|
|
|
12754
12754
|
O
|
|
12755
12755
|
],
|
|
12756
12756
|
stateAttributesMapping: d
|
|
12757
|
-
}), I = React
|
|
12757
|
+
}), I = React.useMemo(() => ({
|
|
12758
12758
|
highlightedIndex: A,
|
|
12759
12759
|
onHighlightedIndexChange: j,
|
|
12760
12760
|
highlightItemOnHover: E,
|
|
@@ -12776,16 +12776,16 @@ function CompositeRoot(n) {
|
|
|
12776
12776
|
})
|
|
12777
12777
|
});
|
|
12778
12778
|
}
|
|
12779
|
-
const TabsList$1 = /* @__PURE__ */ React
|
|
12780
|
-
let { activateOnFocus: s = !1, className: c, loopFocus: l = !0, render: u, ...d } = n, { getTabElementBySelectedValue: f, onValueChange: m, orientation: h, value: g, setTabMap: _, tabActivationDirection: v } = useTabsRootContext(), [y, b] = React
|
|
12779
|
+
const TabsList$1 = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
12780
|
+
let { activateOnFocus: s = !1, className: c, loopFocus: l = !0, render: u, ...d } = n, { getTabElementBySelectedValue: f, onValueChange: m, orientation: h, value: g, setTabMap: _, tabActivationDirection: v } = useTabsRootContext(), [y, b] = React.useState(0), [x, S] = React.useState(null), C = useActivationDirectionDetector(g, h, x, f), w = useStableCallback((t, n) => {
|
|
12781
12781
|
t !== g && (n.activationDirection = C(t), m(t, n));
|
|
12782
|
-
}), T = React
|
|
12782
|
+
}), T = React.useMemo(() => ({
|
|
12783
12783
|
orientation: h,
|
|
12784
12784
|
tabActivationDirection: v
|
|
12785
12785
|
}), [h, v]), E = {
|
|
12786
12786
|
"aria-orientation": h === "vertical" ? "vertical" : void 0,
|
|
12787
12787
|
role: "tablist"
|
|
12788
|
-
}, D = React
|
|
12788
|
+
}, D = React.useMemo(() => ({
|
|
12789
12789
|
activateOnFocus: s,
|
|
12790
12790
|
highlightedTabIndex: y,
|
|
12791
12791
|
onTabActivation: w,
|
|
@@ -12828,7 +12828,7 @@ function getInset(t, n) {
|
|
|
12828
12828
|
};
|
|
12829
12829
|
}
|
|
12830
12830
|
function useActivationDirectionDetector(n, i, s, c) {
|
|
12831
|
-
let [l, u] = React
|
|
12831
|
+
let [l, u] = React.useState(null);
|
|
12832
12832
|
return useIsoLayoutEffect(() => {
|
|
12833
12833
|
if (n == null || s == null) {
|
|
12834
12834
|
u(null);
|
|
@@ -12846,7 +12846,7 @@ function useActivationDirectionDetector(n, i, s, c) {
|
|
|
12846
12846
|
c,
|
|
12847
12847
|
s,
|
|
12848
12848
|
n
|
|
12849
|
-
]), React
|
|
12849
|
+
]), React.useCallback((t) => {
|
|
12850
12850
|
if (t === n) return "none";
|
|
12851
12851
|
if (t == null) return u(null), "none";
|
|
12852
12852
|
if (t != null && s != null) {
|
|
@@ -12871,56 +12871,56 @@ function useActivationDirectionDetector(n, i, s, c) {
|
|
|
12871
12871
|
]);
|
|
12872
12872
|
}
|
|
12873
12873
|
var import_compiler_runtime$5 = require_compiler_runtime();
|
|
12874
|
-
const TabsIndicator = (
|
|
12875
|
-
let
|
|
12876
|
-
if (
|
|
12874
|
+
const TabsIndicator = (t) => {
|
|
12875
|
+
let n = (0, import_compiler_runtime$5.c)(13), i, c;
|
|
12876
|
+
if (n[0] === t ? (i = n[1], c = n[2]) : ({className: i, ...c} = t, n[0] = t, n[1] = i, n[2] = c), useContext(TabsOrientationContext) === "horizontal") {
|
|
12877
12877
|
let t;
|
|
12878
|
-
|
|
12879
|
-
let
|
|
12880
|
-
return
|
|
12878
|
+
n[3] === i ? t = n[4] : (t = cn("absolute left-1/2 h-11 md:h-12 top-0 z-[-1] w-(--active-tab-width) translate-y-(--active-tab-top) -translate-x-1/2 rounded-2xl md:rounded-full bg-surface-brand-primary-default transition-all duration-300 ease-[cubic-bezier(0.68,-0.55,0.27,1.55)]", i), n[3] = i, n[4] = t);
|
|
12879
|
+
let s;
|
|
12880
|
+
return n[5] !== c || n[6] !== t ? (s = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsIndicator$1, {
|
|
12881
12881
|
className: t,
|
|
12882
12882
|
...c
|
|
12883
|
-
}),
|
|
12883
|
+
}), n[5] = c, n[6] = t, n[7] = s) : s = n[7], s;
|
|
12884
12884
|
}
|
|
12885
12885
|
let l;
|
|
12886
|
-
|
|
12886
|
+
n[8] === i ? l = n[9] : (l = cn("absolute top-1/2 h-11 md:h-12 left-0 z-[-1] w-(--active-tab-width) translate-x-(--active-tab-left) -translate-y-1/2 rounded-full bg-surface-brand-primary-default transition-all duration-300 ease-[cubic-bezier(0.68,-0.55,0.27,1.55)]", i), n[8] = i, n[9] = l);
|
|
12887
12887
|
let u;
|
|
12888
|
-
return
|
|
12888
|
+
return n[10] !== c || n[11] !== l ? (u = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsIndicator$1, {
|
|
12889
12889
|
className: l,
|
|
12890
12890
|
...c
|
|
12891
|
-
}),
|
|
12891
|
+
}), n[10] = c, n[11] = l, n[12] = u) : u = n[12], u;
|
|
12892
12892
|
};
|
|
12893
12893
|
var import_compiler_runtime$4 = require_compiler_runtime();
|
|
12894
|
-
const TabsList = (
|
|
12895
|
-
let
|
|
12896
|
-
if (
|
|
12894
|
+
const TabsList = (t) => {
|
|
12895
|
+
let n = (0, import_compiler_runtime$4.c)(13), i, c;
|
|
12896
|
+
if (n[0] === t ? (i = n[1], c = n[2]) : ({className: i, ...c} = t, n[0] = t, n[1] = i, n[2] = c), useContext(TabsOrientationContext) === "horizontal") {
|
|
12897
12897
|
let t;
|
|
12898
|
-
|
|
12899
|
-
let
|
|
12900
|
-
return
|
|
12898
|
+
n[3] === i ? t = n[4] : (t = cn("relative z-0 flex flex-col h-fit grow gap-2 p-2 bg-surface-neutral-primary-default rounded-3xl", i), n[3] = i, n[4] = t);
|
|
12899
|
+
let s;
|
|
12900
|
+
return n[5] !== c || n[6] !== t ? (s = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsList$1, {
|
|
12901
12901
|
className: t,
|
|
12902
12902
|
...c
|
|
12903
|
-
}),
|
|
12903
|
+
}), n[5] = c, n[6] = t, n[7] = s) : s = n[7], s;
|
|
12904
12904
|
}
|
|
12905
12905
|
let l;
|
|
12906
|
-
|
|
12906
|
+
n[8] === i ? l = n[9] : (l = cn("relative z-0 flex gap-1 p-2 bg-surface-neutral-primary-default rounded-full", i), n[8] = i, n[9] = l);
|
|
12907
12907
|
let u;
|
|
12908
|
-
return
|
|
12908
|
+
return n[10] !== c || n[11] !== l ? (u = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsList$1, {
|
|
12909
12909
|
className: l,
|
|
12910
12910
|
...c
|
|
12911
|
-
}),
|
|
12911
|
+
}), n[10] = c, n[11] = l, n[12] = u) : u = n[12], u;
|
|
12912
12912
|
};
|
|
12913
12913
|
var import_compiler_runtime$3 = require_compiler_runtime();
|
|
12914
|
-
const TabsPanel = (
|
|
12915
|
-
let
|
|
12916
|
-
|
|
12917
|
-
let l =
|
|
12918
|
-
|
|
12914
|
+
const TabsPanel = (t) => {
|
|
12915
|
+
let n = (0, import_compiler_runtime$3.c)(9), i, c;
|
|
12916
|
+
n[0] === t ? (i = n[1], c = n[2]) : ({className: i, ...c} = t, n[0] = t, n[1] = i, n[2] = c);
|
|
12917
|
+
let l = useContext(TabsOrientationContext) === "horizontal" ? "flex-1 min-h-0 h-full" : "grow", u;
|
|
12918
|
+
n[3] !== i || n[4] !== l ? (u = cn("relative rounded-xl bg-surface-neutral-primary-default", l, "flex items-center justify-center p-4 overflow-auto", i), n[3] = i, n[4] = l, n[5] = u) : u = n[5];
|
|
12919
12919
|
let d;
|
|
12920
|
-
return
|
|
12920
|
+
return n[6] !== c || n[7] !== u ? (d = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsPanel$1, {
|
|
12921
12921
|
className: u,
|
|
12922
12922
|
...c
|
|
12923
|
-
}),
|
|
12923
|
+
}), n[6] = c, n[7] = u, n[8] = d) : d = n[8], d;
|
|
12924
12924
|
};
|
|
12925
12925
|
var import_compiler_runtime$2 = require_compiler_runtime();
|
|
12926
12926
|
const TabsTab = (t) => {
|
|
@@ -12935,45 +12935,45 @@ const TabsTab = (t) => {
|
|
|
12935
12935
|
}), n[5] = s, n[6] = c, n[7] = l) : l = n[7], l;
|
|
12936
12936
|
};
|
|
12937
12937
|
var import_compiler_runtime$1 = require_compiler_runtime();
|
|
12938
|
-
const Tabs = (
|
|
12939
|
-
let
|
|
12940
|
-
if (
|
|
12938
|
+
const Tabs = (t) => {
|
|
12939
|
+
let n = (0, import_compiler_runtime$1.c)(15), { className: i, ref: s, ...l } = t, [u, d] = useState(l.orientation ?? "vertical");
|
|
12940
|
+
if (useEffect(() => {
|
|
12941
12941
|
let t = () => {
|
|
12942
12942
|
window.innerWidth < 768 ? d("horizontal") : d(l.orientation ?? "vertical");
|
|
12943
12943
|
};
|
|
12944
12944
|
return t(), window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
|
|
12945
12945
|
}, [l.orientation]), l.orientation = u, l.orientation === "horizontal") {
|
|
12946
|
-
let t = l.orientation,
|
|
12947
|
-
|
|
12946
|
+
let t = l.orientation, c;
|
|
12947
|
+
n[0] === i ? c = n[1] : (c = cn("flex flex-wrap gap-4 overflow-auto", i), n[0] = i, n[1] = c);
|
|
12948
12948
|
let u;
|
|
12949
|
-
|
|
12950
|
-
className:
|
|
12951
|
-
ref:
|
|
12949
|
+
n[2] !== l || n[3] !== s || n[4] !== c ? (u = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsRoot, {
|
|
12950
|
+
className: c,
|
|
12951
|
+
ref: s,
|
|
12952
12952
|
...l
|
|
12953
|
-
}),
|
|
12953
|
+
}), n[2] = l, n[3] = s, n[4] = c, n[5] = u) : u = n[5];
|
|
12954
12954
|
let d;
|
|
12955
|
-
return
|
|
12955
|
+
return n[6] !== l.orientation || n[7] !== u ? (d = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsOrientationContext.Provider, {
|
|
12956
12956
|
value: t,
|
|
12957
12957
|
children: u
|
|
12958
|
-
}),
|
|
12958
|
+
}), n[6] = l.orientation, n[7] = u, n[8] = d) : d = n[8], d;
|
|
12959
12959
|
}
|
|
12960
|
-
let f;
|
|
12961
|
-
i[9] === s ? f = i[10] : (f = cn("flex flex-col gap-2 overflow-clip", s), i[9] = s, i[10] = f);
|
|
12962
12960
|
let m;
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
|
|
12961
|
+
n[9] === i ? m = n[10] : (m = cn("flex flex-col gap-2 overflow-clip", i), n[9] = i, n[10] = m);
|
|
12962
|
+
let h;
|
|
12963
|
+
return n[11] !== l || n[12] !== s || n[13] !== m ? (h = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabsRoot, {
|
|
12964
|
+
className: m,
|
|
12965
|
+
ref: s,
|
|
12966
12966
|
...l
|
|
12967
|
-
}),
|
|
12967
|
+
}), n[11] = l, n[12] = s, n[13] = m, n[14] = h) : h = n[14], h;
|
|
12968
12968
|
};
|
|
12969
12969
|
var counter = 0;
|
|
12970
12970
|
function generateId(t) {
|
|
12971
12971
|
return counter += 1, `${t}-${Math.random().toString(36).slice(2, 6)}-${counter}`;
|
|
12972
12972
|
}
|
|
12973
|
-
const ToastContext = /* @__PURE__ */ React
|
|
12973
|
+
const ToastContext = /* @__PURE__ */ React.createContext(void 0);
|
|
12974
12974
|
process.env.NODE_ENV !== "production" && (ToastContext.displayName = "ToastContext");
|
|
12975
12975
|
function useToastContext() {
|
|
12976
|
-
let n = React
|
|
12976
|
+
let n = React.useContext(ToastContext);
|
|
12977
12977
|
if (!n) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(73) : "Base UI: useToastManager must be used within <Toast.Provider>.");
|
|
12978
12978
|
return n;
|
|
12979
12979
|
}
|
|
@@ -12986,9 +12986,9 @@ function resolvePromiseOptions(t, n) {
|
|
|
12986
12986
|
return t;
|
|
12987
12987
|
}
|
|
12988
12988
|
const ToastProvider$1 = function(n) {
|
|
12989
|
-
let { children: i, timeout: s = 5e3, limit: c = 3, toastManager: l } = n, [u, d] = React
|
|
12989
|
+
let { children: i, timeout: s = 5e3, limit: c = 3, toastManager: l } = n, [u, d] = React.useState([]), [f, m] = React.useState(!1), [h, g] = React.useState(!1), [_, v] = React.useState(null);
|
|
12990
12990
|
u.length === 0 && (f && m(!1), h && g(!1));
|
|
12991
|
-
let y = f || h, b = React
|
|
12991
|
+
let y = f || h, b = React.useRef(/* @__PURE__ */ new Map()), x = React.useRef(null), S = React.useRef(!0), C = React.useRef(!1);
|
|
12992
12992
|
function w(t) {
|
|
12993
12993
|
let n = activeElement(ownerDocument(x.current));
|
|
12994
12994
|
if (!x.current || !contains(x.current, n) || !matchesFocusVisible(n)) return;
|
|
@@ -13107,7 +13107,7 @@ const ToastProvider$1 = function(n) {
|
|
|
13107
13107
|
});
|
|
13108
13108
|
return {}.hasOwnProperty.call(n, "setPromise") && n.setPromise(c), c;
|
|
13109
13109
|
});
|
|
13110
|
-
React
|
|
13110
|
+
React.useEffect(function() {
|
|
13111
13111
|
if (l) return l[" subscribe"](({ action: t, options: n }) => {
|
|
13112
13112
|
let i = n.id;
|
|
13113
13113
|
t === "promise" && n.promise ? M(n.promise, n) : t === "update" && i ? j(i, n) : t === "close" && i ? D(i) : A(n);
|
|
@@ -13121,7 +13121,7 @@ const ToastProvider$1 = function(n) {
|
|
|
13121
13121
|
M,
|
|
13122
13122
|
D
|
|
13123
13123
|
]);
|
|
13124
|
-
let N = React
|
|
13124
|
+
let N = React.useMemo(() => ({
|
|
13125
13125
|
toasts: u,
|
|
13126
13126
|
setToasts: d,
|
|
13127
13127
|
hovering: f,
|
|
@@ -13162,14 +13162,14 @@ const ToastProvider$1 = function(n) {
|
|
|
13162
13162
|
});
|
|
13163
13163
|
};
|
|
13164
13164
|
process.env.NODE_ENV !== "production" && (ToastProvider$1.displayName = "ToastProvider");
|
|
13165
|
-
const ToastViewportContext = /* @__PURE__ */ React
|
|
13165
|
+
const ToastViewportContext = /* @__PURE__ */ React.createContext(void 0);
|
|
13166
13166
|
process.env.NODE_ENV !== "production" && (ToastViewportContext.displayName = "ToastViewportContext");
|
|
13167
13167
|
let ToastViewportCssVars = /* @__PURE__ */ function(t) {
|
|
13168
13168
|
return t.frontmostHeight = "--toast-frontmost-height", t;
|
|
13169
13169
|
}({});
|
|
13170
|
-
const ToastViewport = /* @__PURE__ */ React
|
|
13171
|
-
let { render: s, className: c, children: l, ...u } = n, { toasts: d, pauseTimers: f, resumeTimers: m, setHovering: h, setFocused: g, viewportRef: _, windowFocusedRef: v, prevFocusElement: y, setPrevFocusElement: b, expanded: x, focused: S } = useToastContext(), C = React
|
|
13172
|
-
React
|
|
13170
|
+
const ToastViewport = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
13171
|
+
let { render: s, className: c, children: l, ...u } = n, { toasts: d, pauseTimers: f, resumeTimers: m, setHovering: h, setFocused: g, viewportRef: _, windowFocusedRef: v, prevFocusElement: y, setPrevFocusElement: b, expanded: x, focused: S } = useToastContext(), C = React.useRef(!1), w = React.useRef(!1), T = d.length, E = d[0]?.height ?? 0, D = React.useMemo(() => d.some((t) => t.transitionStatus === "ending"), [d]);
|
|
13172
|
+
React.useEffect(() => {
|
|
13173
13173
|
if (!_.current) return;
|
|
13174
13174
|
function t(t) {
|
|
13175
13175
|
T !== 0 && t.key === "F6" && t.target !== _.current && (t.preventDefault(), b(activeElement(ownerDocument(_.current))), _.current?.focus({ preventScroll: !0 }), f(), g(!0));
|
|
@@ -13184,7 +13184,7 @@ const ToastViewport = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13184
13184
|
b,
|
|
13185
13185
|
T,
|
|
13186
13186
|
_
|
|
13187
|
-
]), React
|
|
13187
|
+
]), React.useEffect(() => {
|
|
13188
13188
|
if (!_.current || !T) return;
|
|
13189
13189
|
let t = getWindow(_.current);
|
|
13190
13190
|
function n(n) {
|
|
@@ -13207,7 +13207,7 @@ const ToastViewport = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13207
13207
|
v,
|
|
13208
13208
|
g,
|
|
13209
13209
|
T
|
|
13210
|
-
]), React
|
|
13210
|
+
]), React.useEffect(() => {
|
|
13211
13211
|
let t = _.current;
|
|
13212
13212
|
if (!t || T === 0) return;
|
|
13213
13213
|
let n = ownerDocument(t);
|
|
@@ -13230,7 +13230,7 @@ const ToastViewport = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13230
13230
|
function k(t) {
|
|
13231
13231
|
t.key === "Tab" && t.shiftKey && t.target === _.current && (t.preventDefault(), y?.focus({ preventScroll: !0 }), m());
|
|
13232
13232
|
}
|
|
13233
|
-
React
|
|
13233
|
+
React.useEffect(() => {
|
|
13234
13234
|
!v.current || D || !w.current || (m(), h(!1), w.current = !1);
|
|
13235
13235
|
}, [
|
|
13236
13236
|
D,
|
|
@@ -13268,20 +13268,20 @@ const ToastViewport = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13268
13268
|
onBlur: N,
|
|
13269
13269
|
onKeyDown: k,
|
|
13270
13270
|
onClick: M
|
|
13271
|
-
}, F = React
|
|
13271
|
+
}, F = React.useMemo(() => ({ expanded: x }), [x]), I = useRenderElement("div", n, {
|
|
13272
13272
|
ref: [i, _],
|
|
13273
13273
|
state: F,
|
|
13274
13274
|
props: [
|
|
13275
13275
|
P,
|
|
13276
13276
|
{ style: { [ToastViewportCssVars.frontmostHeight]: E ? `${E}px` : void 0 } },
|
|
13277
13277
|
u,
|
|
13278
|
-
{ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(React
|
|
13278
|
+
{ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(React.Fragment, { children: [
|
|
13279
13279
|
T > 0 && y && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGuard, { onFocus: O }),
|
|
13280
13280
|
l,
|
|
13281
13281
|
T > 0 && y && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGuard, { onFocus: O })
|
|
13282
13282
|
] }) }
|
|
13283
13283
|
]
|
|
13284
|
-
}), L = React
|
|
13284
|
+
}), L = React.useMemo(() => ({ viewportRef: _ }), [_]), R = React.useMemo(() => d.filter((t) => t.priority === "high"), [d]);
|
|
13285
13285
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ToastViewportContext.Provider, {
|
|
13286
13286
|
value: L,
|
|
13287
13287
|
children: [
|
|
@@ -13299,10 +13299,10 @@ const ToastViewport = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13299
13299
|
});
|
|
13300
13300
|
});
|
|
13301
13301
|
process.env.NODE_ENV !== "production" && (ToastViewport.displayName = "ToastViewport");
|
|
13302
|
-
const ToastRootContext = /* @__PURE__ */ React
|
|
13302
|
+
const ToastRootContext = /* @__PURE__ */ React.createContext(void 0);
|
|
13303
13303
|
process.env.NODE_ENV !== "production" && (ToastRootContext.displayName = "ToastRootContext");
|
|
13304
13304
|
function useToastRootContext() {
|
|
13305
|
-
let n = React
|
|
13305
|
+
let n = React.useContext(ToastRootContext);
|
|
13306
13306
|
if (!n) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(66) : "Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.");
|
|
13307
13307
|
return n;
|
|
13308
13308
|
}
|
|
@@ -13339,27 +13339,27 @@ function getElementTransform(t) {
|
|
|
13339
13339
|
scale: c
|
|
13340
13340
|
};
|
|
13341
13341
|
}
|
|
13342
|
-
const ToastRoot = /* @__PURE__ */ React
|
|
13342
|
+
const ToastRoot = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
13343
13343
|
let { toast: s, render: c, className: l, swipeDirection: u = ["down", "right"], ...d } = n, f = s.positionerProps?.anchor !== void 0, h = [];
|
|
13344
13344
|
f || (h = Array.isArray(u) ? u : [u]);
|
|
13345
|
-
let g = h.length > 0, { toasts: _, focused: v, close: y, remove: b, setToasts: x, pauseTimers: S, expanded: C, setHovering: w } = useToastContext(), [T, E] = React
|
|
13345
|
+
let g = h.length > 0, { toasts: _, focused: v, close: y, remove: b, setToasts: x, pauseTimers: S, expanded: C, setHovering: w } = useToastContext(), [T, E] = React.useState(void 0), [D, O] = React.useState(!1), [k, A] = React.useState(!1), [j, M] = React.useState(!1), [N, P] = React.useState({
|
|
13346
13346
|
x: 0,
|
|
13347
13347
|
y: 0
|
|
13348
|
-
}), [F, I] = React
|
|
13348
|
+
}), [F, I] = React.useState({
|
|
13349
13349
|
x: 0,
|
|
13350
13350
|
y: 0,
|
|
13351
13351
|
scale: 1
|
|
13352
|
-
}), [L, R] = React
|
|
13352
|
+
}), [L, R] = React.useState(), [z, B] = React.useState(), [V, H] = React.useState(null), U = React.useRef(null), W = React.useRef({
|
|
13353
13353
|
x: 0,
|
|
13354
13354
|
y: 0
|
|
13355
|
-
}), G = React
|
|
13355
|
+
}), G = React.useRef({
|
|
13356
13356
|
x: 0,
|
|
13357
13357
|
y: 0,
|
|
13358
13358
|
scale: 1
|
|
13359
|
-
}), K = React
|
|
13359
|
+
}), K = React.useRef(void 0), q = React.useRef(0), J = React.useRef(!1), Y = React.useRef({
|
|
13360
13360
|
x: 0,
|
|
13361
13361
|
y: 0
|
|
13362
|
-
}), X = React
|
|
13362
|
+
}), X = React.useRef(!1), Z = React.useMemo(() => _.indexOf(s), [s, _]), Q = React.useMemo(() => _.filter((t) => t.transitionStatus !== "ending").indexOf(s), [s, _]), fh = React.useMemo(() => _.slice(0, _.indexOf(s)).reduce((t, n) => t + (n.height || 0), 0), [_, s]);
|
|
13363
13363
|
useOpenChangeComplete({
|
|
13364
13364
|
open: s.transitionStatus !== "ending",
|
|
13365
13365
|
ref: U,
|
|
@@ -13480,7 +13480,7 @@ const ToastRoot = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13480
13480
|
y(s.id);
|
|
13481
13481
|
}
|
|
13482
13482
|
}
|
|
13483
|
-
React
|
|
13483
|
+
React.useEffect(() => {
|
|
13484
13484
|
if (!g) return;
|
|
13485
13485
|
let t = U.current;
|
|
13486
13486
|
if (!t) return;
|
|
@@ -13522,7 +13522,7 @@ const ToastRoot = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13522
13522
|
[ToastRootCssVars.offsetY]: `${fh}px`,
|
|
13523
13523
|
[ToastRootCssVars.height]: s.height ? `${s.height}px` : void 0
|
|
13524
13524
|
}
|
|
13525
|
-
}, Ch = React
|
|
13525
|
+
}, Ch = React.useMemo(() => ({
|
|
13526
13526
|
rootRef: U,
|
|
13527
13527
|
toast: s,
|
|
13528
13528
|
titleId: L,
|
|
@@ -13545,7 +13545,7 @@ const ToastRoot = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13545
13545
|
Z,
|
|
13546
13546
|
Q,
|
|
13547
13547
|
C
|
|
13548
|
-
]), wh = React
|
|
13548
|
+
]), wh = React.useMemo(() => ({
|
|
13549
13549
|
transitionStatus: s.transitionStatus,
|
|
13550
13550
|
expanded: C,
|
|
13551
13551
|
limited: s.limited || !1,
|
|
@@ -13571,7 +13571,7 @@ const ToastRoot = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13571
13571
|
});
|
|
13572
13572
|
});
|
|
13573
13573
|
process.env.NODE_ENV !== "production" && (ToastRoot.displayName = "ToastRoot");
|
|
13574
|
-
const ToastDescription = /* @__PURE__ */ React
|
|
13574
|
+
const ToastDescription = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
13575
13575
|
let { render: s, className: c, id: l, children: u, ...d } = n, { toast: f } = useToastRootContext(), m = u ?? f.description, h = !!m, g = useId(l), { setDescriptionId: _ } = useToastRootContext();
|
|
13576
13576
|
useIsoLayoutEffect(() => {
|
|
13577
13577
|
if (h) return _(g), () => {
|
|
@@ -13584,7 +13584,7 @@ const ToastDescription = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13584
13584
|
]);
|
|
13585
13585
|
let v = useRenderElement("p", n, {
|
|
13586
13586
|
ref: i,
|
|
13587
|
-
state: React
|
|
13587
|
+
state: React.useMemo(() => ({ type: f.type }), [f.type]),
|
|
13588
13588
|
props: {
|
|
13589
13589
|
...d,
|
|
13590
13590
|
id: g,
|
|
@@ -13594,7 +13594,7 @@ const ToastDescription = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13594
13594
|
return h ? v : null;
|
|
13595
13595
|
});
|
|
13596
13596
|
process.env.NODE_ENV !== "production" && (ToastDescription.displayName = "ToastDescription");
|
|
13597
|
-
const ToastTitle = /* @__PURE__ */ React
|
|
13597
|
+
const ToastTitle = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
13598
13598
|
let { render: s, className: c, id: l, children: u, ...d } = n, { toast: f } = useToastRootContext(), m = u ?? f.title, h = !!m, g = useId(l), { setTitleId: _ } = useToastRootContext();
|
|
13599
13599
|
useIsoLayoutEffect(() => {
|
|
13600
13600
|
if (h) return _(g), () => {
|
|
@@ -13607,7 +13607,7 @@ const ToastTitle = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13607
13607
|
]);
|
|
13608
13608
|
let v = useRenderElement("h2", n, {
|
|
13609
13609
|
ref: i,
|
|
13610
|
-
state: React
|
|
13610
|
+
state: React.useMemo(() => ({ type: f.type }), [f.type]),
|
|
13611
13611
|
props: {
|
|
13612
13612
|
...d,
|
|
13613
13613
|
id: g,
|
|
@@ -13617,11 +13617,11 @@ const ToastTitle = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13617
13617
|
return h ? v : null;
|
|
13618
13618
|
});
|
|
13619
13619
|
process.env.NODE_ENV !== "production" && (ToastTitle.displayName = "ToastTitle");
|
|
13620
|
-
const ToastClose = /* @__PURE__ */ React
|
|
13621
|
-
let { render: s, className: c, disabled: l, nativeButton: u = !0, ...d } = n, { close: f, expanded: m } = useToastContext(), { toast: h } = useToastRootContext(), [g, _] = React
|
|
13620
|
+
const ToastClose = /* @__PURE__ */ React.forwardRef(function(n, i) {
|
|
13621
|
+
let { render: s, className: c, disabled: l, nativeButton: u = !0, ...d } = n, { close: f, expanded: m } = useToastContext(), { toast: h } = useToastRootContext(), [g, _] = React.useState(!1), { getButtonProps: v, buttonRef: y } = useButton({
|
|
13622
13622
|
disabled: l,
|
|
13623
13623
|
native: u
|
|
13624
|
-
}), b = React
|
|
13624
|
+
}), b = React.useMemo(() => ({ type: h.type }), [h.type]);
|
|
13625
13625
|
return useRenderElement("button", n, {
|
|
13626
13626
|
ref: [i, y],
|
|
13627
13627
|
state: b,
|
|
@@ -13646,10 +13646,10 @@ const ToastClose = /* @__PURE__ */ React$1.forwardRef(function(n, i) {
|
|
|
13646
13646
|
process.env.NODE_ENV !== "production" && (ToastClose.displayName = "ToastClose");
|
|
13647
13647
|
const ToastPortal = FloatingPortalLite;
|
|
13648
13648
|
function useToastManager() {
|
|
13649
|
-
let n = React
|
|
13649
|
+
let n = React.useContext(ToastContext);
|
|
13650
13650
|
if (!n) throw Error(process.env.NODE_ENV === "production" ? formatErrorMessage(73) : "Base UI: useToastManager must be used within <Toast.Provider>.");
|
|
13651
13651
|
let { toasts: i, add: s, close: c, update: l, promise: u } = n;
|
|
13652
|
-
return React
|
|
13652
|
+
return React.useMemo(() => ({
|
|
13653
13653
|
toasts: i,
|
|
13654
13654
|
add: s,
|
|
13655
13655
|
close: c,
|