shadcn-glass-ui 2.0.12 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +109 -5
- package/README.md +132 -43
- package/context7.json +2 -1
- package/dist/cli/index.cjs +1 -1
- package/dist/components.cjs +4 -4
- package/dist/components.d.ts +103 -29
- package/dist/components.js +1 -1
- package/dist/demo-screenshot-aurora.png +0 -0
- package/dist/demo-screenshot.png +0 -0
- package/dist/demo-screenshot.png.zip +0 -0
- package/dist/hooks.cjs +2 -2
- package/dist/index.cjs +5 -5
- package/dist/index.js +28 -28
- package/dist/index.js.map +1 -1
- package/dist/r/ai-card-glass.json +1 -1
- package/dist/r/avatar-glass.json +1 -1
- package/dist/r/badge-glass.json +1 -1
- package/dist/r/button-glass.json +1 -1
- package/dist/r/combobox-glass.json +1 -1
- package/dist/r/registry.json +2 -2
- package/dist/r/repository-card-glass.json +2 -1
- package/dist/r/slider-glass.json +4 -5
- package/dist/r/toggle-glass.json +2 -2
- package/dist/r/year-card-glass.json +1 -1
- package/dist/shadcn-glass-ui.css +1 -1
- package/dist/{theme-context-DNe_2vWJ.cjs → theme-context-BHXYJ4RE.cjs} +2 -2
- package/dist/{theme-context-DNe_2vWJ.cjs.map → theme-context-BHXYJ4RE.cjs.map} +1 -1
- package/dist/themes.cjs +1 -1
- package/dist/{trust-score-card-glass-Dgu46oWI.cjs → trust-score-card-glass-CGXmOIfq.cjs} +850 -150
- package/dist/trust-score-card-glass-CGXmOIfq.cjs.map +1 -0
- package/dist/{trust-score-card-glass-A7kas5OS.js → trust-score-card-glass-L9g0qamo.js} +1182 -482
- package/dist/trust-score-card-glass-L9g0qamo.js.map +1 -0
- package/dist/{use-focus-BRkQtQCj.cjs → use-focus-CeNHOiBa.cjs} +2 -2
- package/dist/{use-focus-BRkQtQCj.cjs.map → use-focus-CeNHOiBa.cjs.map} +1 -1
- package/dist/{use-wallpaper-tint-CfShPBo2.cjs → use-wallpaper-tint-Bt2G3g1v.cjs} +2 -2
- package/dist/{use-wallpaper-tint-CfShPBo2.cjs.map → use-wallpaper-tint-Bt2G3g1v.cjs.map} +1 -1
- package/dist/{utils-BXN7AcRu.cjs → utils-LYxxWvUn.cjs} +2 -2
- package/dist/{utils-BXN7AcRu.cjs.map → utils-LYxxWvUn.cjs.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/docs/ADVANCED_PATTERNS.md +584 -0
- package/docs/AI_USAGE.md +135 -611
- package/docs/BEST_PRACTICES.md +2 -2
- package/docs/BREAKING_CHANGES.md +239 -0
- package/docs/COMPONENTS_CATALOG.md +8 -8
- package/docs/EXPORTS_STRUCTURE.md +3 -3
- package/docs/GETTING_STARTED.md +13 -8
- package/docs/PUBLISHING.md +1 -1
- package/docs/REGISTRY_SUMMARY.md +2 -2
- package/docs/REGISTRY_USAGE.md +1 -1
- package/docs/api/README.md +11 -11
- package/docs/api/interfaces/BadgeGlassProps.md +21 -14
- package/docs/api/interfaces/ButtonGlassProps.md +37 -30
- package/package.json +4 -3
- package/dist/trust-score-card-glass-A7kas5OS.js.map +0 -1
- package/dist/trust-score-card-glass-Dgu46oWI.cjs.map +0 -1
- package/dist/vite.svg +0 -1
- package/docs/migration/modal-glass-compound-api.md +0 -458
- package/docs/migration/select-to-combobox.md +0 -386
- package/docs/migration/tabs-glass-compound-api.md +0 -579
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as cn } from "./utils-CcyeqpKQ.js";
|
|
2
2
|
import { n as useHover, t as useFocus } from "./use-focus-CX0TJJIj.js";
|
|
3
3
|
import { o as useTheme } from "./theme-context-_T5r1KG4.js";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { Children, PureComponent, cloneElement, createContext, createElement, forwardRef, isValidElement, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import React, { Children, PureComponent, cloneElement, createContext, createElement, forwardRef, isValidElement, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { AlertCircle, AlertTriangle, ArrowDown, ArrowUp, Calendar, Check, CheckCircle, CheckIcon, ChevronDown, ChevronRight, ChevronRightIcon, ChevronUp, ChevronsUpDownIcon, CircleIcon, Clock, Code, ExternalLink, FolderGit2, GitPullRequest, Github, Info, Minus, Moon, Palette, RefreshCw, Search, SearchIcon, Sparkles, Star, Sun, Target, TrendingDown, TrendingUp, User, Users, X, Zap } from "lucide-react";
|
|
7
7
|
import { clsx } from "clsx";
|
|
8
8
|
import { cva } from "class-variance-authority";
|
|
@@ -274,8 +274,8 @@ var getStatusVars$1 = (statusType) => {
|
|
|
274
274
|
}
|
|
275
275
|
}[statusType];
|
|
276
276
|
};
|
|
277
|
-
var AvatarGlassContext = React.createContext({ size: "md" });
|
|
278
|
-
var AvatarGlassRoot = React.forwardRef(({ className, size: size$3 = "md", status, glowing = false, children, ...props }, ref) => {
|
|
277
|
+
var AvatarGlassContext = React$1.createContext({ size: "md" });
|
|
278
|
+
var AvatarGlassRoot = React$1.forwardRef(({ className, size: size$3 = "md", status, glowing = false, children, ...props }, ref) => {
|
|
279
279
|
const { isHovered, hoverProps } = useHover();
|
|
280
280
|
const avatarStyles = {
|
|
281
281
|
background: "var(--avatar-bg)",
|
|
@@ -312,7 +312,7 @@ var AvatarGlassRoot = React.forwardRef(({ className, size: size$3 = "md", status
|
|
|
312
312
|
});
|
|
313
313
|
});
|
|
314
314
|
AvatarGlassRoot.displayName = "AvatarGlass";
|
|
315
|
-
var AvatarGlassImage = React.forwardRef(({ className, ...props }, ref) => {
|
|
315
|
+
var AvatarGlassImage = React$1.forwardRef(({ className, ...props }, ref) => {
|
|
316
316
|
return /* @__PURE__ */ jsx(AvatarPrimitive.Image, {
|
|
317
317
|
ref,
|
|
318
318
|
className: cn("aspect-square h-full w-full object-cover", className),
|
|
@@ -320,7 +320,7 @@ var AvatarGlassImage = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
320
320
|
});
|
|
321
321
|
});
|
|
322
322
|
AvatarGlassImage.displayName = "AvatarGlassImage";
|
|
323
|
-
var AvatarGlassFallback = React.forwardRef(({ className, ...props }, ref) => {
|
|
323
|
+
var AvatarGlassFallback = React$1.forwardRef(({ className, ...props }, ref) => {
|
|
324
324
|
return /* @__PURE__ */ jsx(AvatarPrimitive.Fallback, {
|
|
325
325
|
ref,
|
|
326
326
|
className: cn("flex h-full w-full items-center justify-center font-semibold uppercase", className),
|
|
@@ -412,29 +412,30 @@ BadgeGlass.displayName = "BadgeGlass";
|
|
|
412
412
|
const buttonGlassVariants = cva("relative overflow-hidden font-medium inline-flex items-center justify-center transition-all duration-300 ease-out cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed", {
|
|
413
413
|
variants: {
|
|
414
414
|
variant: {
|
|
415
|
-
|
|
415
|
+
default: "",
|
|
416
416
|
secondary: "",
|
|
417
417
|
ghost: "",
|
|
418
418
|
destructive: "",
|
|
419
|
+
outline: "",
|
|
419
420
|
success: "",
|
|
420
|
-
|
|
421
|
+
link: ""
|
|
421
422
|
},
|
|
422
423
|
size: {
|
|
423
424
|
sm: "px-3 py-1.5 text-sm gap-1.5 min-h-[44px] rounded-xl",
|
|
424
|
-
|
|
425
|
+
default: "px-4 py-2.5 text-sm gap-2 min-h-[44px] rounded-xl",
|
|
425
426
|
lg: "px-6 py-3 text-base gap-2.5 min-h-[48px] rounded-xl",
|
|
426
427
|
xl: "px-8 py-4 text-lg gap-3 min-h-[56px] rounded-xl",
|
|
427
428
|
icon: "p-2.5 min-h-[44px] min-w-[44px] rounded-xl"
|
|
428
429
|
}
|
|
429
430
|
},
|
|
430
431
|
defaultVariants: {
|
|
431
|
-
variant: "
|
|
432
|
-
size: "
|
|
432
|
+
variant: "default",
|
|
433
|
+
size: "default"
|
|
433
434
|
}
|
|
434
435
|
});
|
|
435
436
|
var getVariantStyles = (variant, isHovered, isFocusVisible) => {
|
|
436
437
|
return {
|
|
437
|
-
|
|
438
|
+
default: {
|
|
438
439
|
background: isHovered ? "var(--btn-primary-hover-bg)" : "var(--btn-primary-bg)",
|
|
439
440
|
color: "var(--btn-primary-text)",
|
|
440
441
|
border: "none",
|
|
@@ -458,21 +459,28 @@ var getVariantStyles = (variant, isHovered, isFocusVisible) => {
|
|
|
458
459
|
border: "none",
|
|
459
460
|
boxShadow: isFocusVisible ? "var(--focus-glow)" : isHovered ? "var(--btn-destructive-glow)" : "var(--btn-destructive-shadow)"
|
|
460
461
|
},
|
|
462
|
+
outline: {
|
|
463
|
+
background: isHovered ? "var(--btn-outline-hover-bg)" : "transparent",
|
|
464
|
+
color: "var(--btn-outline-text)",
|
|
465
|
+
border: "1px solid var(--btn-outline-border)",
|
|
466
|
+
boxShadow: isFocusVisible ? "var(--focus-glow)" : isHovered ? "var(--btn-outline-glow)" : "none"
|
|
467
|
+
},
|
|
461
468
|
success: {
|
|
462
469
|
background: "var(--btn-success-bg)",
|
|
463
470
|
color: "var(--btn-success-text)",
|
|
464
471
|
border: "none",
|
|
465
472
|
boxShadow: isFocusVisible ? "var(--focus-glow)" : isHovered ? "var(--btn-success-glow)" : "var(--btn-success-shadow)"
|
|
466
473
|
},
|
|
467
|
-
|
|
474
|
+
link: {
|
|
468
475
|
background: "transparent",
|
|
469
|
-
color: "var(--text
|
|
476
|
+
color: "var(--btn-link-text)",
|
|
470
477
|
border: "none",
|
|
471
|
-
boxShadow: isFocusVisible ? "var(--focus-glow)" : "none"
|
|
478
|
+
boxShadow: isFocusVisible ? "var(--focus-glow)" : "none",
|
|
479
|
+
textDecoration: isHovered ? "underline" : "none"
|
|
472
480
|
}
|
|
473
481
|
}[variant];
|
|
474
482
|
};
|
|
475
|
-
const ButtonGlass = forwardRef(({ asChild = false, className, variant = "
|
|
483
|
+
const ButtonGlass = forwardRef(({ asChild = false, className, variant = "default", size: size$3 = "default", children, loading = false, disabled, icon: Icon, iconPosition = "left", onClick, ...props }, ref) => {
|
|
476
484
|
const { isHovered, hoverProps } = useHover();
|
|
477
485
|
const { isFocusVisible, focusProps } = useFocus({ focusVisible: true });
|
|
478
486
|
const [ripple, setRipple] = useState(null);
|
|
@@ -516,7 +524,7 @@ const ButtonGlass = forwardRef(({ asChild = false, className, variant = "primary
|
|
|
516
524
|
onBlur: focusProps.onBlur,
|
|
517
525
|
...props,
|
|
518
526
|
children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
519
|
-
isHovered && variant === "
|
|
527
|
+
isHovered && variant === "default" && !isDisabled && /* @__PURE__ */ jsx("div", {
|
|
520
528
|
className: "absolute inset-0 overflow-hidden pointer-events-none",
|
|
521
529
|
style: { borderRadius: "inherit" },
|
|
522
530
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -535,7 +543,7 @@ const ButtonGlass = forwardRef(({ asChild = false, className, variant = "primary
|
|
|
535
543
|
animation: "ripple 0.6s ease-out"
|
|
536
544
|
}
|
|
537
545
|
}),
|
|
538
|
-
isHovered && variant === "
|
|
546
|
+
isHovered && variant === "default" && !isDisabled && /* @__PURE__ */ jsx("div", {
|
|
539
547
|
className: "absolute inset-0 rounded-xl animate-glow-pulse pointer-events-none",
|
|
540
548
|
style: { background: "var(--btn-glow-radial)" }
|
|
541
549
|
}),
|
|
@@ -785,18 +793,18 @@ function composeRefs(...refs) {
|
|
|
785
793
|
};
|
|
786
794
|
}
|
|
787
795
|
function useComposedRefs(...refs) {
|
|
788
|
-
return React.useCallback(composeRefs(...refs), refs);
|
|
796
|
+
return React$1.useCallback(composeRefs(...refs), refs);
|
|
789
797
|
}
|
|
790
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
798
|
+
function createContextScope$2(scopeName, createContextScopeDeps = []) {
|
|
791
799
|
let defaultContexts = [];
|
|
792
800
|
function createContext3(rootComponentName, defaultContext) {
|
|
793
|
-
const BaseContext = React.createContext(defaultContext);
|
|
801
|
+
const BaseContext = React$1.createContext(defaultContext);
|
|
794
802
|
const index$1 = defaultContexts.length;
|
|
795
803
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
796
804
|
const Provider$1 = (props) => {
|
|
797
805
|
const { scope, children, ...context } = props;
|
|
798
806
|
const Context = scope?.[scopeName]?.[index$1] || BaseContext;
|
|
799
|
-
const value = React.useMemo(() => context, Object.values(context));
|
|
807
|
+
const value = React$1.useMemo(() => context, Object.values(context));
|
|
800
808
|
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
801
809
|
value,
|
|
802
810
|
children
|
|
@@ -805,7 +813,7 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
805
813
|
Provider$1.displayName = rootComponentName + "Provider";
|
|
806
814
|
function useContext2(consumerName, scope) {
|
|
807
815
|
const Context = scope?.[scopeName]?.[index$1] || BaseContext;
|
|
808
|
-
const context = React.useContext(Context);
|
|
816
|
+
const context = React$1.useContext(Context);
|
|
809
817
|
if (context) return context;
|
|
810
818
|
if (defaultContext !== void 0) return defaultContext;
|
|
811
819
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -814,20 +822,20 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
814
822
|
}
|
|
815
823
|
const createScope$2 = () => {
|
|
816
824
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
817
|
-
return React.createContext(defaultContext);
|
|
825
|
+
return React$1.createContext(defaultContext);
|
|
818
826
|
});
|
|
819
827
|
return function useScope(scope) {
|
|
820
828
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
821
|
-
return React.useMemo(() => ({ [`__scope${scopeName}`]: {
|
|
829
|
+
return React$1.useMemo(() => ({ [`__scope${scopeName}`]: {
|
|
822
830
|
...scope,
|
|
823
831
|
[scopeName]: contexts
|
|
824
832
|
} }), [scope, contexts]);
|
|
825
833
|
};
|
|
826
834
|
};
|
|
827
835
|
createScope$2.scopeName = scopeName;
|
|
828
|
-
return [createContext3, composeContextScopes$
|
|
836
|
+
return [createContext3, composeContextScopes$3(createScope$2, ...createContextScopeDeps)];
|
|
829
837
|
}
|
|
830
|
-
function composeContextScopes$
|
|
838
|
+
function composeContextScopes$3(...scopes) {
|
|
831
839
|
const baseScope = scopes[0];
|
|
832
840
|
if (scopes.length === 1) return baseScope;
|
|
833
841
|
const createScope$2 = () => {
|
|
@@ -843,13 +851,13 @@ function composeContextScopes$1(...scopes) {
|
|
|
843
851
|
...currentScope$2
|
|
844
852
|
};
|
|
845
853
|
}, {});
|
|
846
|
-
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
854
|
+
return React$1.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
847
855
|
};
|
|
848
856
|
};
|
|
849
857
|
createScope$2.scopeName = baseScope.scopeName;
|
|
850
858
|
return createScope$2;
|
|
851
859
|
}
|
|
852
|
-
var Primitive$
|
|
860
|
+
var Primitive$7 = [
|
|
853
861
|
"a",
|
|
854
862
|
"button",
|
|
855
863
|
"div",
|
|
@@ -869,7 +877,7 @@ var Primitive$6 = [
|
|
|
869
877
|
"ul"
|
|
870
878
|
].reduce((primitive, node) => {
|
|
871
879
|
const Slot$2 = createSlot(`Primitive.${node}`);
|
|
872
|
-
const Node$1 = React.forwardRef((props, forwardedRef) => {
|
|
880
|
+
const Node$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
873
881
|
const { asChild, ...primitiveProps } = props;
|
|
874
882
|
const Comp = asChild ? Slot$2 : node;
|
|
875
883
|
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
@@ -888,15 +896,15 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
888
896
|
if (target) ReactDOM$1.flushSync(() => target.dispatchEvent(event));
|
|
889
897
|
}
|
|
890
898
|
function useCallbackRef$1(callback) {
|
|
891
|
-
const callbackRef = React.useRef(callback);
|
|
892
|
-
React.useEffect(() => {
|
|
899
|
+
const callbackRef = React$1.useRef(callback);
|
|
900
|
+
React$1.useEffect(() => {
|
|
893
901
|
callbackRef.current = callback;
|
|
894
902
|
});
|
|
895
|
-
return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
903
|
+
return React$1.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
896
904
|
}
|
|
897
905
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
898
906
|
const onEscapeKeyDown = useCallbackRef$1(onEscapeKeyDownProp);
|
|
899
|
-
React.useEffect(() => {
|
|
907
|
+
React$1.useEffect(() => {
|
|
900
908
|
const handleKeyDown = (event) => {
|
|
901
909
|
if (event.key === "Escape") onEscapeKeyDown(event);
|
|
902
910
|
};
|
|
@@ -909,17 +917,17 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
909
917
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
910
918
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
911
919
|
var originalBodyPointerEvents;
|
|
912
|
-
var DismissableLayerContext = React.createContext({
|
|
920
|
+
var DismissableLayerContext = React$1.createContext({
|
|
913
921
|
layers: /* @__PURE__ */ new Set(),
|
|
914
922
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
915
923
|
branches: /* @__PURE__ */ new Set()
|
|
916
924
|
});
|
|
917
|
-
var DismissableLayer = React.forwardRef((props, forwardedRef) => {
|
|
925
|
+
var DismissableLayer = React$1.forwardRef((props, forwardedRef) => {
|
|
918
926
|
const { disableOutsidePointerEvents = false, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, ...layerProps } = props;
|
|
919
|
-
const context = React.useContext(DismissableLayerContext);
|
|
920
|
-
const [node, setNode] = React.useState(null);
|
|
927
|
+
const context = React$1.useContext(DismissableLayerContext);
|
|
928
|
+
const [node, setNode] = React$1.useState(null);
|
|
921
929
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
922
|
-
const [, force] = React.useState({});
|
|
930
|
+
const [, force] = React$1.useState({});
|
|
923
931
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
924
932
|
const layers = Array.from(context.layers);
|
|
925
933
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -950,7 +958,7 @@ var DismissableLayer = React.forwardRef((props, forwardedRef) => {
|
|
|
950
958
|
onDismiss();
|
|
951
959
|
}
|
|
952
960
|
}, ownerDocument);
|
|
953
|
-
React.useEffect(() => {
|
|
961
|
+
React$1.useEffect(() => {
|
|
954
962
|
if (!node) return;
|
|
955
963
|
if (disableOutsidePointerEvents) {
|
|
956
964
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
@@ -970,7 +978,7 @@ var DismissableLayer = React.forwardRef((props, forwardedRef) => {
|
|
|
970
978
|
disableOutsidePointerEvents,
|
|
971
979
|
context
|
|
972
980
|
]);
|
|
973
|
-
React.useEffect(() => {
|
|
981
|
+
React$1.useEffect(() => {
|
|
974
982
|
return () => {
|
|
975
983
|
if (!node) return;
|
|
976
984
|
context.layers.delete(node);
|
|
@@ -978,12 +986,12 @@ var DismissableLayer = React.forwardRef((props, forwardedRef) => {
|
|
|
978
986
|
dispatchUpdate();
|
|
979
987
|
};
|
|
980
988
|
}, [node, context]);
|
|
981
|
-
React.useEffect(() => {
|
|
989
|
+
React$1.useEffect(() => {
|
|
982
990
|
const handleUpdate = () => force({});
|
|
983
991
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
984
992
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
985
993
|
}, []);
|
|
986
|
-
return /* @__PURE__ */ jsx(Primitive$
|
|
994
|
+
return /* @__PURE__ */ jsx(Primitive$7.div, {
|
|
987
995
|
...layerProps,
|
|
988
996
|
ref: composedRefs,
|
|
989
997
|
style: {
|
|
@@ -997,11 +1005,11 @@ var DismissableLayer = React.forwardRef((props, forwardedRef) => {
|
|
|
997
1005
|
});
|
|
998
1006
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
999
1007
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
1000
|
-
var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
|
|
1001
|
-
const context = React.useContext(DismissableLayerContext);
|
|
1002
|
-
const ref = React.useRef(null);
|
|
1008
|
+
var DismissableLayerBranch = React$1.forwardRef((props, forwardedRef) => {
|
|
1009
|
+
const context = React$1.useContext(DismissableLayerContext);
|
|
1010
|
+
const ref = React$1.useRef(null);
|
|
1003
1011
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
1004
|
-
React.useEffect(() => {
|
|
1012
|
+
React$1.useEffect(() => {
|
|
1005
1013
|
const node = ref.current;
|
|
1006
1014
|
if (node) {
|
|
1007
1015
|
context.branches.add(node);
|
|
@@ -1010,7 +1018,7 @@ var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
|
|
|
1010
1018
|
};
|
|
1011
1019
|
}
|
|
1012
1020
|
}, [context.branches]);
|
|
1013
|
-
return /* @__PURE__ */ jsx(Primitive$
|
|
1021
|
+
return /* @__PURE__ */ jsx(Primitive$7.div, {
|
|
1014
1022
|
...props,
|
|
1015
1023
|
ref: composedRefs
|
|
1016
1024
|
});
|
|
@@ -1018,9 +1026,9 @@ var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
|
|
|
1018
1026
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
1019
1027
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
1020
1028
|
const handlePointerDownOutside = useCallbackRef$1(onPointerDownOutside);
|
|
1021
|
-
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
1022
|
-
const handleClickRef = React.useRef(() => {});
|
|
1023
|
-
React.useEffect(() => {
|
|
1029
|
+
const isPointerInsideReactTreeRef = React$1.useRef(false);
|
|
1030
|
+
const handleClickRef = React$1.useRef(() => {});
|
|
1031
|
+
React$1.useEffect(() => {
|
|
1024
1032
|
const handlePointerDown = (event) => {
|
|
1025
1033
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
1026
1034
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -1048,8 +1056,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
1048
1056
|
}
|
|
1049
1057
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
1050
1058
|
const handleFocusOutside = useCallbackRef$1(onFocusOutside);
|
|
1051
|
-
const isFocusInsideReactTreeRef = React.useRef(false);
|
|
1052
|
-
React.useEffect(() => {
|
|
1059
|
+
const isFocusInsideReactTreeRef = React$1.useRef(false);
|
|
1060
|
+
React$1.useEffect(() => {
|
|
1053
1061
|
const handleFocus = (event) => {
|
|
1054
1062
|
if (event.target && !isFocusInsideReactTreeRef.current) handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, { originalEvent: event }, { discrete: false });
|
|
1055
1063
|
};
|
|
@@ -1078,7 +1086,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
1078
1086
|
}
|
|
1079
1087
|
var count$1 = 0;
|
|
1080
1088
|
function useFocusGuards() {
|
|
1081
|
-
React.useEffect(() => {
|
|
1089
|
+
React$1.useEffect(() => {
|
|
1082
1090
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
1083
1091
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
1084
1092
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
@@ -1099,7 +1107,7 @@ function createFocusGuard() {
|
|
|
1099
1107
|
element.style.pointerEvents = "none";
|
|
1100
1108
|
return element;
|
|
1101
1109
|
}
|
|
1102
|
-
var Primitive$
|
|
1110
|
+
var Primitive$6 = [
|
|
1103
1111
|
"a",
|
|
1104
1112
|
"button",
|
|
1105
1113
|
"div",
|
|
@@ -1119,7 +1127,7 @@ var Primitive$5 = [
|
|
|
1119
1127
|
"ul"
|
|
1120
1128
|
].reduce((primitive, node) => {
|
|
1121
1129
|
const Slot$2 = createSlot(`Primitive.${node}`);
|
|
1122
|
-
const Node$1 = React.forwardRef((props, forwardedRef) => {
|
|
1130
|
+
const Node$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
1123
1131
|
const { asChild, ...primitiveProps } = props;
|
|
1124
1132
|
const Comp = asChild ? Slot$2 : node;
|
|
1125
1133
|
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
@@ -1141,14 +1149,14 @@ var EVENT_OPTIONS = {
|
|
|
1141
1149
|
cancelable: true
|
|
1142
1150
|
};
|
|
1143
1151
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
1144
|
-
var FocusScope = React.forwardRef((props, forwardedRef) => {
|
|
1152
|
+
var FocusScope = React$1.forwardRef((props, forwardedRef) => {
|
|
1145
1153
|
const { loop = false, trapped = false, onMountAutoFocus: onMountAutoFocusProp, onUnmountAutoFocus: onUnmountAutoFocusProp, ...scopeProps } = props;
|
|
1146
|
-
const [container, setContainer] = React.useState(null);
|
|
1154
|
+
const [container, setContainer] = React$1.useState(null);
|
|
1147
1155
|
const onMountAutoFocus = useCallbackRef$1(onMountAutoFocusProp);
|
|
1148
1156
|
const onUnmountAutoFocus = useCallbackRef$1(onUnmountAutoFocusProp);
|
|
1149
|
-
const lastFocusedElementRef = React.useRef(null);
|
|
1157
|
+
const lastFocusedElementRef = React$1.useRef(null);
|
|
1150
1158
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
1151
|
-
const focusScope = React.useRef({
|
|
1159
|
+
const focusScope = React$1.useRef({
|
|
1152
1160
|
paused: false,
|
|
1153
1161
|
pause() {
|
|
1154
1162
|
this.paused = true;
|
|
@@ -1157,7 +1165,7 @@ var FocusScope = React.forwardRef((props, forwardedRef) => {
|
|
|
1157
1165
|
this.paused = false;
|
|
1158
1166
|
}
|
|
1159
1167
|
}).current;
|
|
1160
|
-
React.useEffect(() => {
|
|
1168
|
+
React$1.useEffect(() => {
|
|
1161
1169
|
if (trapped) {
|
|
1162
1170
|
let handleFocusIn2 = function(event) {
|
|
1163
1171
|
if (focusScope.paused || !container) return;
|
|
@@ -1191,7 +1199,7 @@ var FocusScope = React.forwardRef((props, forwardedRef) => {
|
|
|
1191
1199
|
container,
|
|
1192
1200
|
focusScope.paused
|
|
1193
1201
|
]);
|
|
1194
|
-
React.useEffect(() => {
|
|
1202
|
+
React$1.useEffect(() => {
|
|
1195
1203
|
if (container) {
|
|
1196
1204
|
focusScopesStack.add(focusScope);
|
|
1197
1205
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -1222,7 +1230,7 @@ var FocusScope = React.forwardRef((props, forwardedRef) => {
|
|
|
1222
1230
|
onUnmountAutoFocus,
|
|
1223
1231
|
focusScope
|
|
1224
1232
|
]);
|
|
1225
|
-
const handleKeyDown = React.useCallback((event) => {
|
|
1233
|
+
const handleKeyDown = React$1.useCallback((event) => {
|
|
1226
1234
|
if (!loop && !trapped) return;
|
|
1227
1235
|
if (focusScope.paused) return;
|
|
1228
1236
|
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
@@ -1245,7 +1253,7 @@ var FocusScope = React.forwardRef((props, forwardedRef) => {
|
|
|
1245
1253
|
trapped,
|
|
1246
1254
|
focusScope.paused
|
|
1247
1255
|
]);
|
|
1248
|
-
return /* @__PURE__ */ jsx(Primitive$
|
|
1256
|
+
return /* @__PURE__ */ jsx(Primitive$6.div, {
|
|
1249
1257
|
tabIndex: -1,
|
|
1250
1258
|
...scopeProps,
|
|
1251
1259
|
ref: composedRefs,
|
|
@@ -1321,11 +1329,11 @@ function arrayRemove(array, item) {
|
|
|
1321
1329
|
function removeLinks(items) {
|
|
1322
1330
|
return items.filter((item) => item.tagName !== "A");
|
|
1323
1331
|
}
|
|
1324
|
-
var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {};
|
|
1325
|
-
var useReactId = React[" useId ".trim().toString()] || (() => void 0);
|
|
1332
|
+
var useLayoutEffect2 = globalThis?.document ? React$1.useLayoutEffect : () => {};
|
|
1333
|
+
var useReactId = React$1[" useId ".trim().toString()] || (() => void 0);
|
|
1326
1334
|
var count = 0;
|
|
1327
1335
|
function useId$2(deterministicId) {
|
|
1328
|
-
const [id, setId] = React.useState(useReactId());
|
|
1336
|
+
const [id, setId] = React$1.useState(useReactId());
|
|
1329
1337
|
useLayoutEffect2(() => {
|
|
1330
1338
|
if (!deterministicId) setId((reactId) => reactId ?? String(count++));
|
|
1331
1339
|
}, [deterministicId]);
|
|
@@ -1355,7 +1363,7 @@ var oppositeAlignmentMap = {
|
|
|
1355
1363
|
start: "end",
|
|
1356
1364
|
end: "start"
|
|
1357
1365
|
};
|
|
1358
|
-
function clamp(start, value, end) {
|
|
1366
|
+
function clamp$1(start, value, end) {
|
|
1359
1367
|
return max$1(start, min$1(value, end));
|
|
1360
1368
|
}
|
|
1361
1369
|
function evaluate(value, param) {
|
|
@@ -1639,7 +1647,7 @@ var arrow$2 = (options$1) => ({
|
|
|
1639
1647
|
const min$1$1 = minPadding;
|
|
1640
1648
|
const max$2 = clientSize - arrowDimensions[length] - maxPadding;
|
|
1641
1649
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
1642
|
-
const offset$3 = clamp(min$1$1, center, max$2);
|
|
1650
|
+
const offset$3 = clamp$1(min$1$1, center, max$2);
|
|
1643
1651
|
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset$3 && rects.reference[length] / 2 - (center < min$1$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
1644
1652
|
const alignmentOffset = shouldAddOffset ? center < min$1$1 ? center - min$1$1 : center - max$2 : 0;
|
|
1645
1653
|
return {
|
|
@@ -1842,14 +1850,14 @@ var shift$2 = function(options$1) {
|
|
|
1842
1850
|
const maxSide = mainAxis === "y" ? "bottom" : "right";
|
|
1843
1851
|
const min$2 = mainAxisCoord + overflow[minSide];
|
|
1844
1852
|
const max$2 = mainAxisCoord - overflow[maxSide];
|
|
1845
|
-
mainAxisCoord = clamp(min$2, mainAxisCoord, max$2);
|
|
1853
|
+
mainAxisCoord = clamp$1(min$2, mainAxisCoord, max$2);
|
|
1846
1854
|
}
|
|
1847
1855
|
if (checkCrossAxis) {
|
|
1848
1856
|
const minSide = crossAxis === "y" ? "top" : "left";
|
|
1849
1857
|
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
|
1850
1858
|
const min$2 = crossAxisCoord + overflow[minSide];
|
|
1851
1859
|
const max$2 = crossAxisCoord - overflow[maxSide];
|
|
1852
|
-
crossAxisCoord = clamp(min$2, crossAxisCoord, max$2);
|
|
1860
|
+
crossAxisCoord = clamp$1(min$2, crossAxisCoord, max$2);
|
|
1853
1861
|
}
|
|
1854
1862
|
const limitedCoords = limiter.fn({
|
|
1855
1863
|
...state,
|
|
@@ -2622,7 +2630,7 @@ function roundByDPR(element, value) {
|
|
|
2622
2630
|
return Math.round(value * dpr) / dpr;
|
|
2623
2631
|
}
|
|
2624
2632
|
function useLatestRef(value) {
|
|
2625
|
-
const ref = React.useRef(value);
|
|
2633
|
+
const ref = React$1.useRef(value);
|
|
2626
2634
|
index(() => {
|
|
2627
2635
|
ref.current = value;
|
|
2628
2636
|
});
|
|
@@ -2631,7 +2639,7 @@ function useLatestRef(value) {
|
|
|
2631
2639
|
function useFloating(options$1) {
|
|
2632
2640
|
if (options$1 === void 0) options$1 = {};
|
|
2633
2641
|
const { placement = "bottom", strategy = "absolute", middleware = [], platform: platform$1, elements: { reference: externalReference, floating: externalFloating } = {}, transform = true, whileElementsMounted, open } = options$1;
|
|
2634
|
-
const [data, setData] = React.useState({
|
|
2642
|
+
const [data, setData] = React$1.useState({
|
|
2635
2643
|
x: 0,
|
|
2636
2644
|
y: 0,
|
|
2637
2645
|
strategy,
|
|
@@ -2639,17 +2647,17 @@ function useFloating(options$1) {
|
|
|
2639
2647
|
middlewareData: {},
|
|
2640
2648
|
isPositioned: false
|
|
2641
2649
|
});
|
|
2642
|
-
const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);
|
|
2650
|
+
const [latestMiddleware, setLatestMiddleware] = React$1.useState(middleware);
|
|
2643
2651
|
if (!deepEqual(latestMiddleware, middleware)) setLatestMiddleware(middleware);
|
|
2644
|
-
const [_reference, _setReference] = React.useState(null);
|
|
2645
|
-
const [_floating, _setFloating] = React.useState(null);
|
|
2646
|
-
const setReference = React.useCallback((node) => {
|
|
2652
|
+
const [_reference, _setReference] = React$1.useState(null);
|
|
2653
|
+
const [_floating, _setFloating] = React$1.useState(null);
|
|
2654
|
+
const setReference = React$1.useCallback((node) => {
|
|
2647
2655
|
if (node !== referenceRef.current) {
|
|
2648
2656
|
referenceRef.current = node;
|
|
2649
2657
|
_setReference(node);
|
|
2650
2658
|
}
|
|
2651
2659
|
}, []);
|
|
2652
|
-
const setFloating = React.useCallback((node) => {
|
|
2660
|
+
const setFloating = React$1.useCallback((node) => {
|
|
2653
2661
|
if (node !== floatingRef.current) {
|
|
2654
2662
|
floatingRef.current = node;
|
|
2655
2663
|
_setFloating(node);
|
|
@@ -2657,14 +2665,14 @@ function useFloating(options$1) {
|
|
|
2657
2665
|
}, []);
|
|
2658
2666
|
const referenceEl = externalReference || _reference;
|
|
2659
2667
|
const floatingEl = externalFloating || _floating;
|
|
2660
|
-
const referenceRef = React.useRef(null);
|
|
2661
|
-
const floatingRef = React.useRef(null);
|
|
2662
|
-
const dataRef = React.useRef(data);
|
|
2668
|
+
const referenceRef = React$1.useRef(null);
|
|
2669
|
+
const floatingRef = React$1.useRef(null);
|
|
2670
|
+
const dataRef = React$1.useRef(data);
|
|
2663
2671
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
2664
2672
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
2665
2673
|
const platformRef = useLatestRef(platform$1);
|
|
2666
2674
|
const openRef = useLatestRef(open);
|
|
2667
|
-
const update = React.useCallback(() => {
|
|
2675
|
+
const update = React$1.useCallback(() => {
|
|
2668
2676
|
if (!referenceRef.current || !floatingRef.current) return;
|
|
2669
2677
|
const config = {
|
|
2670
2678
|
placement,
|
|
@@ -2700,7 +2708,7 @@ function useFloating(options$1) {
|
|
|
2700
2708
|
}));
|
|
2701
2709
|
}
|
|
2702
2710
|
}, [open]);
|
|
2703
|
-
const isMountedRef = React.useRef(false);
|
|
2711
|
+
const isMountedRef = React$1.useRef(false);
|
|
2704
2712
|
index(() => {
|
|
2705
2713
|
isMountedRef.current = true;
|
|
2706
2714
|
return () => {
|
|
@@ -2721,17 +2729,17 @@ function useFloating(options$1) {
|
|
|
2721
2729
|
whileElementsMountedRef,
|
|
2722
2730
|
hasWhileElementsMounted
|
|
2723
2731
|
]);
|
|
2724
|
-
const refs = React.useMemo(() => ({
|
|
2732
|
+
const refs = React$1.useMemo(() => ({
|
|
2725
2733
|
reference: referenceRef,
|
|
2726
2734
|
floating: floatingRef,
|
|
2727
2735
|
setReference,
|
|
2728
2736
|
setFloating
|
|
2729
2737
|
}), [setReference, setFloating]);
|
|
2730
|
-
const elements = React.useMemo(() => ({
|
|
2738
|
+
const elements = React$1.useMemo(() => ({
|
|
2731
2739
|
reference: referenceEl,
|
|
2732
2740
|
floating: floatingEl
|
|
2733
2741
|
}), [referenceEl, floatingEl]);
|
|
2734
|
-
const floatingStyles = React.useMemo(() => {
|
|
2742
|
+
const floatingStyles = React$1.useMemo(() => {
|
|
2735
2743
|
const initialStyles = {
|
|
2736
2744
|
position: strategy,
|
|
2737
2745
|
left: 0,
|
|
@@ -2757,7 +2765,7 @@ function useFloating(options$1) {
|
|
|
2757
2765
|
data.x,
|
|
2758
2766
|
data.y
|
|
2759
2767
|
]);
|
|
2760
|
-
return React.useMemo(() => ({
|
|
2768
|
+
return React$1.useMemo(() => ({
|
|
2761
2769
|
...data,
|
|
2762
2770
|
update,
|
|
2763
2771
|
refs,
|
|
@@ -2823,7 +2831,7 @@ var arrow = (options$1, deps) => ({
|
|
|
2823
2831
|
...arrow$1$1(options$1),
|
|
2824
2832
|
options: [options$1, deps]
|
|
2825
2833
|
});
|
|
2826
|
-
var Primitive$
|
|
2834
|
+
var Primitive$5 = [
|
|
2827
2835
|
"a",
|
|
2828
2836
|
"button",
|
|
2829
2837
|
"div",
|
|
@@ -2843,7 +2851,7 @@ var Primitive$4 = [
|
|
|
2843
2851
|
"ul"
|
|
2844
2852
|
].reduce((primitive, node) => {
|
|
2845
2853
|
const Slot$2 = createSlot(`Primitive.${node}`);
|
|
2846
|
-
const Node$1 = React.forwardRef((props, forwardedRef) => {
|
|
2854
|
+
const Node$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
2847
2855
|
const { asChild, ...primitiveProps } = props;
|
|
2848
2856
|
const Comp = asChild ? Slot$2 : node;
|
|
2849
2857
|
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
@@ -2859,9 +2867,9 @@ var Primitive$4 = [
|
|
|
2859
2867
|
};
|
|
2860
2868
|
}, {});
|
|
2861
2869
|
var NAME = "Arrow";
|
|
2862
|
-
var Arrow$1 = React.forwardRef((props, forwardedRef) => {
|
|
2870
|
+
var Arrow$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
2863
2871
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
2864
|
-
return /* @__PURE__ */ jsx(Primitive$
|
|
2872
|
+
return /* @__PURE__ */ jsx(Primitive$5.svg, {
|
|
2865
2873
|
...arrowProps,
|
|
2866
2874
|
ref: forwardedRef,
|
|
2867
2875
|
width,
|
|
@@ -2872,17 +2880,17 @@ var Arrow$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
2872
2880
|
});
|
|
2873
2881
|
});
|
|
2874
2882
|
Arrow$1.displayName = NAME;
|
|
2875
|
-
var Root = Arrow$1;
|
|
2876
|
-
function createContextScope$
|
|
2883
|
+
var Root$1 = Arrow$1;
|
|
2884
|
+
function createContextScope$3(scopeName, createContextScopeDeps = []) {
|
|
2877
2885
|
let defaultContexts = [];
|
|
2878
2886
|
function createContext3(rootComponentName, defaultContext) {
|
|
2879
|
-
const BaseContext = React.createContext(defaultContext);
|
|
2887
|
+
const BaseContext = React$1.createContext(defaultContext);
|
|
2880
2888
|
const index$1 = defaultContexts.length;
|
|
2881
2889
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
2882
2890
|
const Provider$1 = (props) => {
|
|
2883
2891
|
const { scope, children, ...context } = props;
|
|
2884
2892
|
const Context = scope?.[scopeName]?.[index$1] || BaseContext;
|
|
2885
|
-
const value = React.useMemo(() => context, Object.values(context));
|
|
2893
|
+
const value = React$1.useMemo(() => context, Object.values(context));
|
|
2886
2894
|
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
2887
2895
|
value,
|
|
2888
2896
|
children
|
|
@@ -2891,7 +2899,7 @@ function createContextScope$1(scopeName, createContextScopeDeps = []) {
|
|
|
2891
2899
|
Provider$1.displayName = rootComponentName + "Provider";
|
|
2892
2900
|
function useContext2(consumerName, scope) {
|
|
2893
2901
|
const Context = scope?.[scopeName]?.[index$1] || BaseContext;
|
|
2894
|
-
const context = React.useContext(Context);
|
|
2902
|
+
const context = React$1.useContext(Context);
|
|
2895
2903
|
if (context) return context;
|
|
2896
2904
|
if (defaultContext !== void 0) return defaultContext;
|
|
2897
2905
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -2900,20 +2908,20 @@ function createContextScope$1(scopeName, createContextScopeDeps = []) {
|
|
|
2900
2908
|
}
|
|
2901
2909
|
const createScope$2 = () => {
|
|
2902
2910
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
2903
|
-
return React.createContext(defaultContext);
|
|
2911
|
+
return React$1.createContext(defaultContext);
|
|
2904
2912
|
});
|
|
2905
2913
|
return function useScope(scope) {
|
|
2906
2914
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
2907
|
-
return React.useMemo(() => ({ [`__scope${scopeName}`]: {
|
|
2915
|
+
return React$1.useMemo(() => ({ [`__scope${scopeName}`]: {
|
|
2908
2916
|
...scope,
|
|
2909
2917
|
[scopeName]: contexts
|
|
2910
2918
|
} }), [scope, contexts]);
|
|
2911
2919
|
};
|
|
2912
2920
|
};
|
|
2913
2921
|
createScope$2.scopeName = scopeName;
|
|
2914
|
-
return [createContext3, composeContextScopes(createScope$2, ...createContextScopeDeps)];
|
|
2922
|
+
return [createContext3, composeContextScopes$2(createScope$2, ...createContextScopeDeps)];
|
|
2915
2923
|
}
|
|
2916
|
-
function composeContextScopes(...scopes) {
|
|
2924
|
+
function composeContextScopes$2(...scopes) {
|
|
2917
2925
|
const baseScope = scopes[0];
|
|
2918
2926
|
if (scopes.length === 1) return baseScope;
|
|
2919
2927
|
const createScope$2 = () => {
|
|
@@ -2929,13 +2937,13 @@ function composeContextScopes(...scopes) {
|
|
|
2929
2937
|
...currentScope$2
|
|
2930
2938
|
};
|
|
2931
2939
|
}, {});
|
|
2932
|
-
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
2940
|
+
return React$1.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
2933
2941
|
};
|
|
2934
2942
|
};
|
|
2935
2943
|
createScope$2.scopeName = baseScope.scopeName;
|
|
2936
2944
|
return createScope$2;
|
|
2937
2945
|
}
|
|
2938
|
-
var Primitive$
|
|
2946
|
+
var Primitive$4 = [
|
|
2939
2947
|
"a",
|
|
2940
2948
|
"button",
|
|
2941
2949
|
"div",
|
|
@@ -2955,7 +2963,7 @@ var Primitive$3 = [
|
|
|
2955
2963
|
"ul"
|
|
2956
2964
|
].reduce((primitive, node) => {
|
|
2957
2965
|
const Slot$2 = createSlot(`Primitive.${node}`);
|
|
2958
|
-
const Node$1 = React.forwardRef((props, forwardedRef) => {
|
|
2966
|
+
const Node$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
2959
2967
|
const { asChild, ...primitiveProps } = props;
|
|
2960
2968
|
const Comp = asChild ? Slot$2 : node;
|
|
2961
2969
|
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
@@ -2971,7 +2979,7 @@ var Primitive$3 = [
|
|
|
2971
2979
|
};
|
|
2972
2980
|
}, {});
|
|
2973
2981
|
function useSize(element) {
|
|
2974
|
-
const [size$3, setSize] = React.useState(void 0);
|
|
2982
|
+
const [size$3, setSize] = React$1.useState(void 0);
|
|
2975
2983
|
useLayoutEffect2(() => {
|
|
2976
2984
|
if (element) {
|
|
2977
2985
|
setSize({
|
|
@@ -3005,11 +3013,11 @@ function useSize(element) {
|
|
|
3005
3013
|
return size$3;
|
|
3006
3014
|
}
|
|
3007
3015
|
var POPPER_NAME = "Popper";
|
|
3008
|
-
var [createPopperContext, createPopperScope] = createContextScope$
|
|
3016
|
+
var [createPopperContext, createPopperScope] = createContextScope$3(POPPER_NAME);
|
|
3009
3017
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
3010
3018
|
var Popper = (props) => {
|
|
3011
3019
|
const { __scopePopper, children } = props;
|
|
3012
|
-
const [anchor, setAnchor] = React.useState(null);
|
|
3020
|
+
const [anchor, setAnchor] = React$1.useState(null);
|
|
3013
3021
|
return /* @__PURE__ */ jsx(PopperProvider, {
|
|
3014
3022
|
scope: __scopePopper,
|
|
3015
3023
|
anchor,
|
|
@@ -3019,18 +3027,18 @@ var Popper = (props) => {
|
|
|
3019
3027
|
};
|
|
3020
3028
|
Popper.displayName = POPPER_NAME;
|
|
3021
3029
|
var ANCHOR_NAME$1 = "PopperAnchor";
|
|
3022
|
-
var PopperAnchor = React.forwardRef((props, forwardedRef) => {
|
|
3030
|
+
var PopperAnchor = React$1.forwardRef((props, forwardedRef) => {
|
|
3023
3031
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
3024
3032
|
const context = usePopperContext(ANCHOR_NAME$1, __scopePopper);
|
|
3025
|
-
const ref = React.useRef(null);
|
|
3033
|
+
const ref = React$1.useRef(null);
|
|
3026
3034
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3027
|
-
const anchorRef = React.useRef(null);
|
|
3028
|
-
React.useEffect(() => {
|
|
3035
|
+
const anchorRef = React$1.useRef(null);
|
|
3036
|
+
React$1.useEffect(() => {
|
|
3029
3037
|
const previousAnchor = anchorRef.current;
|
|
3030
3038
|
anchorRef.current = virtualRef?.current || ref.current;
|
|
3031
3039
|
if (previousAnchor !== anchorRef.current) context.onAnchorChange(anchorRef.current);
|
|
3032
3040
|
});
|
|
3033
|
-
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive$
|
|
3041
|
+
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive$4.div, {
|
|
3034
3042
|
...anchorProps,
|
|
3035
3043
|
ref: composedRefs
|
|
3036
3044
|
});
|
|
@@ -3038,12 +3046,12 @@ var PopperAnchor = React.forwardRef((props, forwardedRef) => {
|
|
|
3038
3046
|
PopperAnchor.displayName = ANCHOR_NAME$1;
|
|
3039
3047
|
var CONTENT_NAME$1 = "PopperContent";
|
|
3040
3048
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$1);
|
|
3041
|
-
var PopperContent = React.forwardRef((props, forwardedRef) => {
|
|
3049
|
+
var PopperContent = React$1.forwardRef((props, forwardedRef) => {
|
|
3042
3050
|
const { __scopePopper, side = "bottom", sideOffset = 0, align = "center", alignOffset = 0, arrowPadding = 0, avoidCollisions = true, collisionBoundary = [], collisionPadding: collisionPaddingProp = 0, sticky = "partial", hideWhenDetached = false, updatePositionStrategy = "optimized", onPlaced, ...contentProps } = props;
|
|
3043
3051
|
const context = usePopperContext(CONTENT_NAME$1, __scopePopper);
|
|
3044
|
-
const [content, setContent] = React.useState(null);
|
|
3052
|
+
const [content, setContent] = React$1.useState(null);
|
|
3045
3053
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
3046
|
-
const [arrow$3, setArrow] = React.useState(null);
|
|
3054
|
+
const [arrow$3, setArrow] = React$1.useState(null);
|
|
3047
3055
|
const arrowSize = useSize(arrow$3);
|
|
3048
3056
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
3049
3057
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
@@ -3114,7 +3122,7 @@ var PopperContent = React.forwardRef((props, forwardedRef) => {
|
|
|
3114
3122
|
const arrowX = middlewareData.arrow?.x;
|
|
3115
3123
|
const arrowY = middlewareData.arrow?.y;
|
|
3116
3124
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
3117
|
-
const [contentZIndex, setContentZIndex] = React.useState();
|
|
3125
|
+
const [contentZIndex, setContentZIndex] = React$1.useState();
|
|
3118
3126
|
useLayoutEffect2(() => {
|
|
3119
3127
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
3120
3128
|
}, [content]);
|
|
@@ -3140,7 +3148,7 @@ var PopperContent = React.forwardRef((props, forwardedRef) => {
|
|
|
3140
3148
|
arrowX,
|
|
3141
3149
|
arrowY,
|
|
3142
3150
|
shouldHideArrow: cannotCenterArrow,
|
|
3143
|
-
children: /* @__PURE__ */ jsx(Primitive$
|
|
3151
|
+
children: /* @__PURE__ */ jsx(Primitive$4.div, {
|
|
3144
3152
|
"data-side": placedSide,
|
|
3145
3153
|
"data-align": placedAlign,
|
|
3146
3154
|
...contentProps,
|
|
@@ -3161,7 +3169,7 @@ var OPPOSITE_SIDE = {
|
|
|
3161
3169
|
bottom: "top",
|
|
3162
3170
|
left: "right"
|
|
3163
3171
|
};
|
|
3164
|
-
var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
3172
|
+
var PopperArrow = React$1.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
3165
3173
|
const { __scopePopper, ...arrowProps } = props;
|
|
3166
3174
|
const contentContext = useContentContext(ARROW_NAME$1, __scopePopper);
|
|
3167
3175
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -3186,7 +3194,7 @@ var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
|
3186
3194
|
}[contentContext.placedSide],
|
|
3187
3195
|
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
3188
3196
|
},
|
|
3189
|
-
children: /* @__PURE__ */ jsx(Root, {
|
|
3197
|
+
children: /* @__PURE__ */ jsx(Root$1, {
|
|
3190
3198
|
...arrowProps,
|
|
3191
3199
|
ref: forwardedRef,
|
|
3192
3200
|
style: {
|
|
@@ -3245,7 +3253,7 @@ var Root2$1 = Popper;
|
|
|
3245
3253
|
var Anchor = PopperAnchor;
|
|
3246
3254
|
var Content = PopperContent;
|
|
3247
3255
|
var Arrow = PopperArrow;
|
|
3248
|
-
var Primitive$
|
|
3256
|
+
var Primitive$3 = [
|
|
3249
3257
|
"a",
|
|
3250
3258
|
"button",
|
|
3251
3259
|
"div",
|
|
@@ -3265,7 +3273,7 @@ var Primitive$2 = [
|
|
|
3265
3273
|
"ul"
|
|
3266
3274
|
].reduce((primitive, node) => {
|
|
3267
3275
|
const Slot$2 = createSlot(`Primitive.${node}`);
|
|
3268
|
-
const Node$1 = React.forwardRef((props, forwardedRef) => {
|
|
3276
|
+
const Node$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
3269
3277
|
const { asChild, ...primitiveProps } = props;
|
|
3270
3278
|
const Comp = asChild ? Slot$2 : node;
|
|
3271
3279
|
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
@@ -3281,35 +3289,35 @@ var Primitive$2 = [
|
|
|
3281
3289
|
};
|
|
3282
3290
|
}, {});
|
|
3283
3291
|
var PORTAL_NAME$1 = "Portal";
|
|
3284
|
-
var Portal = React.forwardRef((props, forwardedRef) => {
|
|
3292
|
+
var Portal = React$1.forwardRef((props, forwardedRef) => {
|
|
3285
3293
|
const { container: containerProp, ...portalProps } = props;
|
|
3286
|
-
const [mounted, setMounted] = React.useState(false);
|
|
3294
|
+
const [mounted, setMounted] = React$1.useState(false);
|
|
3287
3295
|
useLayoutEffect2(() => setMounted(true), []);
|
|
3288
3296
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
3289
|
-
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive$
|
|
3297
|
+
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive$3.div, {
|
|
3290
3298
|
...portalProps,
|
|
3291
3299
|
ref: forwardedRef
|
|
3292
3300
|
}), container) : null;
|
|
3293
3301
|
});
|
|
3294
3302
|
Portal.displayName = PORTAL_NAME$1;
|
|
3295
3303
|
function useStateMachine(initialState$5, machine) {
|
|
3296
|
-
return React.useReducer((state, event) => {
|
|
3304
|
+
return React$1.useReducer((state, event) => {
|
|
3297
3305
|
return machine[state][event] ?? state;
|
|
3298
3306
|
}, initialState$5);
|
|
3299
3307
|
}
|
|
3300
3308
|
var Presence = (props) => {
|
|
3301
3309
|
const { present, children } = props;
|
|
3302
3310
|
const presence = usePresence(present);
|
|
3303
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
|
|
3311
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React$1.Children.only(children);
|
|
3304
3312
|
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
|
3305
|
-
return typeof children === "function" || presence.isPresent ? React.cloneElement(child, { ref }) : null;
|
|
3313
|
+
return typeof children === "function" || presence.isPresent ? React$1.cloneElement(child, { ref }) : null;
|
|
3306
3314
|
};
|
|
3307
3315
|
Presence.displayName = "Presence";
|
|
3308
3316
|
function usePresence(present) {
|
|
3309
|
-
const [node, setNode] = React.useState();
|
|
3310
|
-
const stylesRef = React.useRef(null);
|
|
3311
|
-
const prevPresentRef = React.useRef(present);
|
|
3312
|
-
const prevAnimationNameRef = React.useRef("none");
|
|
3317
|
+
const [node, setNode] = React$1.useState();
|
|
3318
|
+
const stylesRef = React$1.useRef(null);
|
|
3319
|
+
const prevPresentRef = React$1.useRef(present);
|
|
3320
|
+
const prevAnimationNameRef = React$1.useRef("none");
|
|
3313
3321
|
const [state, send] = useStateMachine(present ? "mounted" : "unmounted", {
|
|
3314
3322
|
mounted: {
|
|
3315
3323
|
UNMOUNT: "unmounted",
|
|
@@ -3321,7 +3329,7 @@ function usePresence(present) {
|
|
|
3321
3329
|
},
|
|
3322
3330
|
unmounted: { MOUNT: "mounted" }
|
|
3323
3331
|
});
|
|
3324
|
-
React.useEffect(() => {
|
|
3332
|
+
React$1.useEffect(() => {
|
|
3325
3333
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
3326
3334
|
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
3327
3335
|
}, [state]);
|
|
@@ -3371,7 +3379,7 @@ function usePresence(present) {
|
|
|
3371
3379
|
}, [node, send]);
|
|
3372
3380
|
return {
|
|
3373
3381
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
3374
|
-
ref: React.useCallback((node2) => {
|
|
3382
|
+
ref: React$1.useCallback((node2) => {
|
|
3375
3383
|
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
3376
3384
|
setNode(node2);
|
|
3377
3385
|
}, [])
|
|
@@ -3389,7 +3397,7 @@ function getElementRef(element) {
|
|
|
3389
3397
|
if (mayWarn) return element.props.ref;
|
|
3390
3398
|
return element.props.ref || element.ref;
|
|
3391
3399
|
}
|
|
3392
|
-
var Primitive$
|
|
3400
|
+
var Primitive$2 = [
|
|
3393
3401
|
"a",
|
|
3394
3402
|
"button",
|
|
3395
3403
|
"div",
|
|
@@ -3409,7 +3417,7 @@ var Primitive$1 = [
|
|
|
3409
3417
|
"ul"
|
|
3410
3418
|
].reduce((primitive, node) => {
|
|
3411
3419
|
const Slot$2 = createSlot(`Primitive.${node}`);
|
|
3412
|
-
const Node$1 = React.forwardRef((props, forwardedRef) => {
|
|
3420
|
+
const Node$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
3413
3421
|
const { asChild, ...primitiveProps } = props;
|
|
3414
3422
|
const Comp = asChild ? Slot$2 : node;
|
|
3415
3423
|
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
@@ -3424,7 +3432,7 @@ var Primitive$1 = [
|
|
|
3424
3432
|
[node]: Node$1
|
|
3425
3433
|
};
|
|
3426
3434
|
}, {});
|
|
3427
|
-
var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
3435
|
+
var useInsertionEffect = React$1[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
3428
3436
|
function useControllableState({ prop, defaultProp, onChange = () => {}, caller }) {
|
|
3429
3437
|
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
3430
3438
|
defaultProp,
|
|
@@ -3433,8 +3441,8 @@ function useControllableState({ prop, defaultProp, onChange = () => {}, caller }
|
|
|
3433
3441
|
const isControlled = prop !== void 0;
|
|
3434
3442
|
const value = isControlled ? prop : uncontrolledProp;
|
|
3435
3443
|
{
|
|
3436
|
-
const isControlledRef = React.useRef(prop !== void 0);
|
|
3437
|
-
React.useEffect(() => {
|
|
3444
|
+
const isControlledRef = React$1.useRef(prop !== void 0);
|
|
3445
|
+
React$1.useEffect(() => {
|
|
3438
3446
|
const wasControlled = isControlledRef.current;
|
|
3439
3447
|
if (wasControlled !== isControlled) {
|
|
3440
3448
|
const from$1 = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -3444,7 +3452,7 @@ function useControllableState({ prop, defaultProp, onChange = () => {}, caller }
|
|
|
3444
3452
|
isControlledRef.current = isControlled;
|
|
3445
3453
|
}, [isControlled, caller]);
|
|
3446
3454
|
}
|
|
3447
|
-
return [value, React.useCallback((nextValue) => {
|
|
3455
|
+
return [value, React$1.useCallback((nextValue) => {
|
|
3448
3456
|
if (isControlled) {
|
|
3449
3457
|
const value2 = isFunction$1(nextValue) ? nextValue(prop) : nextValue;
|
|
3450
3458
|
if (value2 !== prop) onChangeRef.current?.(value2);
|
|
@@ -3457,13 +3465,13 @@ function useControllableState({ prop, defaultProp, onChange = () => {}, caller }
|
|
|
3457
3465
|
])];
|
|
3458
3466
|
}
|
|
3459
3467
|
function useUncontrolledState({ defaultProp, onChange }) {
|
|
3460
|
-
const [value, setValue] = React.useState(defaultProp);
|
|
3461
|
-
const prevValueRef = React.useRef(value);
|
|
3462
|
-
const onChangeRef = React.useRef(onChange);
|
|
3468
|
+
const [value, setValue] = React$1.useState(defaultProp);
|
|
3469
|
+
const prevValueRef = React$1.useRef(value);
|
|
3470
|
+
const onChangeRef = React$1.useRef(onChange);
|
|
3463
3471
|
useInsertionEffect(() => {
|
|
3464
3472
|
onChangeRef.current = onChange;
|
|
3465
3473
|
}, [onChange]);
|
|
3466
|
-
React.useEffect(() => {
|
|
3474
|
+
React$1.useEffect(() => {
|
|
3467
3475
|
if (prevValueRef.current !== value) {
|
|
3468
3476
|
onChangeRef.current?.(value);
|
|
3469
3477
|
prevValueRef.current = value;
|
|
@@ -3625,7 +3633,7 @@ function useCallbackRef(initialValue, callback) {
|
|
|
3625
3633
|
ref.callback = callback;
|
|
3626
3634
|
return ref.facade;
|
|
3627
3635
|
}
|
|
3628
|
-
var useIsomorphicLayoutEffect$1 = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
3636
|
+
var useIsomorphicLayoutEffect$1 = typeof window !== "undefined" ? React$1.useLayoutEffect : React$1.useEffect;
|
|
3629
3637
|
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
3630
3638
|
function useMergeRefs(refs, defaultValue) {
|
|
3631
3639
|
var callbackRef = useCallbackRef(defaultValue || null, function(newValue) {
|
|
@@ -3733,7 +3741,7 @@ var SideCar = function(_a) {
|
|
|
3733
3741
|
if (!sideCar) throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
3734
3742
|
var Target$1 = sideCar.read();
|
|
3735
3743
|
if (!Target$1) throw new Error("Sidecar medium not found");
|
|
3736
|
-
return React.createElement(Target$1, __assign({}, rest));
|
|
3744
|
+
return React$1.createElement(Target$1, __assign({}, rest));
|
|
3737
3745
|
};
|
|
3738
3746
|
SideCar.isSideCarExport = true;
|
|
3739
3747
|
function exportSidecar(medium, exported) {
|
|
@@ -3742,9 +3750,9 @@ function exportSidecar(medium, exported) {
|
|
|
3742
3750
|
}
|
|
3743
3751
|
var effectCar = createSidecarMedium();
|
|
3744
3752
|
var nothing = function() {};
|
|
3745
|
-
var RemoveScroll = React.forwardRef(function(props, parentRef) {
|
|
3746
|
-
var ref = React.useRef(null);
|
|
3747
|
-
var _a = React.useState({
|
|
3753
|
+
var RemoveScroll = React$1.forwardRef(function(props, parentRef) {
|
|
3754
|
+
var ref = React$1.useRef(null);
|
|
3755
|
+
var _a = React$1.useState({
|
|
3748
3756
|
onScrollCapture: nothing,
|
|
3749
3757
|
onWheelCapture: nothing,
|
|
3750
3758
|
onTouchMoveCapture: nothing
|
|
@@ -3767,7 +3775,7 @@ var RemoveScroll = React.forwardRef(function(props, parentRef) {
|
|
|
3767
3775
|
var SideCar$1 = sideCar;
|
|
3768
3776
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
3769
3777
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
3770
|
-
return React.createElement(React.Fragment, null, enabled && React.createElement(SideCar$1, {
|
|
3778
|
+
return React$1.createElement(React$1.Fragment, null, enabled && React$1.createElement(SideCar$1, {
|
|
3771
3779
|
sideCar: effectCar,
|
|
3772
3780
|
removeScrollBar,
|
|
3773
3781
|
shards,
|
|
@@ -3778,7 +3786,7 @@ var RemoveScroll = React.forwardRef(function(props, parentRef) {
|
|
|
3778
3786
|
allowPinchZoom: !!allowPinchZoom,
|
|
3779
3787
|
lockRef: ref,
|
|
3780
3788
|
gapMode
|
|
3781
|
-
}), forwardProps ? React.cloneElement(React.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React.createElement(Container, __assign({}, containerProps, {
|
|
3789
|
+
}), forwardProps ? React$1.cloneElement(React$1.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React$1.createElement(Container, __assign({}, containerProps, {
|
|
3782
3790
|
className,
|
|
3783
3791
|
ref: containerRef
|
|
3784
3792
|
}), children));
|
|
@@ -3837,7 +3845,7 @@ var stylesheetSingleton = function() {
|
|
|
3837
3845
|
var styleHookSingleton = function() {
|
|
3838
3846
|
var sheet = stylesheetSingleton();
|
|
3839
3847
|
return function(styles, isDynamic) {
|
|
3840
|
-
React.useEffect(function() {
|
|
3848
|
+
React$1.useEffect(function() {
|
|
3841
3849
|
sheet.add(styles);
|
|
3842
3850
|
return function() {
|
|
3843
3851
|
sheet.remove();
|
|
@@ -3903,7 +3911,7 @@ var getCurrentUseCounter = function() {
|
|
|
3903
3911
|
return isFinite(counter) ? counter : 0;
|
|
3904
3912
|
};
|
|
3905
3913
|
var useLockAttribute = function() {
|
|
3906
|
-
React.useEffect(function() {
|
|
3914
|
+
React$1.useEffect(function() {
|
|
3907
3915
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
3908
3916
|
return function() {
|
|
3909
3917
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -3915,10 +3923,10 @@ var useLockAttribute = function() {
|
|
|
3915
3923
|
var RemoveScrollBar = function(_a) {
|
|
3916
3924
|
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
3917
3925
|
useLockAttribute();
|
|
3918
|
-
var gap = React.useMemo(function() {
|
|
3926
|
+
var gap = React$1.useMemo(function() {
|
|
3919
3927
|
return getGapWidth(gapMode);
|
|
3920
3928
|
}, [gapMode]);
|
|
3921
|
-
return React.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
3929
|
+
return React$1.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
3922
3930
|
};
|
|
3923
3931
|
var passiveSupported = false;
|
|
3924
3932
|
if (typeof window !== "undefined") try {
|
|
@@ -4026,16 +4034,16 @@ var generateStyle = function(id) {
|
|
|
4026
4034
|
var idCounter$1 = 0;
|
|
4027
4035
|
var lockStack = [];
|
|
4028
4036
|
function RemoveScrollSideCar(props) {
|
|
4029
|
-
var shouldPreventQueue = React.useRef([]);
|
|
4030
|
-
var touchStartRef = React.useRef([0, 0]);
|
|
4031
|
-
var activeAxis = React.useRef();
|
|
4032
|
-
var id = React.useState(idCounter$1++)[0];
|
|
4033
|
-
var Style$1 = React.useState(styleSingleton)[0];
|
|
4034
|
-
var lastProps = React.useRef(props);
|
|
4035
|
-
React.useEffect(function() {
|
|
4037
|
+
var shouldPreventQueue = React$1.useRef([]);
|
|
4038
|
+
var touchStartRef = React$1.useRef([0, 0]);
|
|
4039
|
+
var activeAxis = React$1.useRef();
|
|
4040
|
+
var id = React$1.useState(idCounter$1++)[0];
|
|
4041
|
+
var Style$1 = React$1.useState(styleSingleton)[0];
|
|
4042
|
+
var lastProps = React$1.useRef(props);
|
|
4043
|
+
React$1.useEffect(function() {
|
|
4036
4044
|
lastProps.current = props;
|
|
4037
4045
|
}, [props]);
|
|
4038
|
-
React.useEffect(function() {
|
|
4046
|
+
React$1.useEffect(function() {
|
|
4039
4047
|
if (props.inert) {
|
|
4040
4048
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
4041
4049
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
@@ -4054,7 +4062,7 @@ function RemoveScrollSideCar(props) {
|
|
|
4054
4062
|
props.lockRef.current,
|
|
4055
4063
|
props.shards
|
|
4056
4064
|
]);
|
|
4057
|
-
var shouldCancelEvent = React.useCallback(function(event, parent) {
|
|
4065
|
+
var shouldCancelEvent = React$1.useCallback(function(event, parent) {
|
|
4058
4066
|
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) return !lastProps.current.allowPinchZoom;
|
|
4059
4067
|
var touch = getTouchXY(event);
|
|
4060
4068
|
var touchStart = touchStartRef.current;
|
|
@@ -4077,7 +4085,7 @@ function RemoveScrollSideCar(props) {
|
|
|
4077
4085
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
4078
4086
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
4079
4087
|
}, []);
|
|
4080
|
-
var shouldPrevent = React.useCallback(function(_event) {
|
|
4088
|
+
var shouldPrevent = React$1.useCallback(function(_event) {
|
|
4081
4089
|
var event = _event;
|
|
4082
4090
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style$1) return;
|
|
4083
4091
|
var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
|
|
@@ -4097,7 +4105,7 @@ function RemoveScrollSideCar(props) {
|
|
|
4097
4105
|
}
|
|
4098
4106
|
}
|
|
4099
4107
|
}, []);
|
|
4100
|
-
var shouldCancel = React.useCallback(function(name, delta, target, should) {
|
|
4108
|
+
var shouldCancel = React$1.useCallback(function(name, delta, target, should) {
|
|
4101
4109
|
var event = {
|
|
4102
4110
|
name,
|
|
4103
4111
|
delta,
|
|
@@ -4112,17 +4120,17 @@ function RemoveScrollSideCar(props) {
|
|
|
4112
4120
|
});
|
|
4113
4121
|
}, 1);
|
|
4114
4122
|
}, []);
|
|
4115
|
-
var scrollTouchStart = React.useCallback(function(event) {
|
|
4123
|
+
var scrollTouchStart = React$1.useCallback(function(event) {
|
|
4116
4124
|
touchStartRef.current = getTouchXY(event);
|
|
4117
4125
|
activeAxis.current = void 0;
|
|
4118
4126
|
}, []);
|
|
4119
|
-
var scrollWheel = React.useCallback(function(event) {
|
|
4127
|
+
var scrollWheel = React$1.useCallback(function(event) {
|
|
4120
4128
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
4121
4129
|
}, []);
|
|
4122
|
-
var scrollTouchMove = React.useCallback(function(event) {
|
|
4130
|
+
var scrollTouchMove = React$1.useCallback(function(event) {
|
|
4123
4131
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
4124
4132
|
}, []);
|
|
4125
|
-
React.useEffect(function() {
|
|
4133
|
+
React$1.useEffect(function() {
|
|
4126
4134
|
lockStack.push(Style$1);
|
|
4127
4135
|
props.setCallbacks({
|
|
4128
4136
|
onScrollCapture: scrollWheel,
|
|
@@ -4142,7 +4150,7 @@ function RemoveScrollSideCar(props) {
|
|
|
4142
4150
|
};
|
|
4143
4151
|
}, []);
|
|
4144
4152
|
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
4145
|
-
return React.createElement(React.Fragment, null, inert ? React.createElement(Style$1, { styles: generateStyle(id) }) : null, removeScrollBar ? React.createElement(RemoveScrollBar, {
|
|
4153
|
+
return React$1.createElement(React$1.Fragment, null, inert ? React$1.createElement(Style$1, { styles: generateStyle(id) }) : null, removeScrollBar ? React$1.createElement(RemoveScrollBar, {
|
|
4146
4154
|
noRelative: props.noRelative,
|
|
4147
4155
|
gapMode: props.gapMode
|
|
4148
4156
|
}) : null);
|
|
@@ -4159,8 +4167,8 @@ function getOutermostShadowParent(node) {
|
|
|
4159
4167
|
return shadowParent;
|
|
4160
4168
|
}
|
|
4161
4169
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
4162
|
-
var ReactRemoveScroll = React.forwardRef(function(props, ref) {
|
|
4163
|
-
return React.createElement(RemoveScroll, __assign({}, props, {
|
|
4170
|
+
var ReactRemoveScroll = React$1.forwardRef(function(props, ref) {
|
|
4171
|
+
return React$1.createElement(RemoveScroll, __assign({}, props, {
|
|
4164
4172
|
ref,
|
|
4165
4173
|
sideCar: sidecar_default
|
|
4166
4174
|
}));
|
|
@@ -4168,14 +4176,14 @@ var ReactRemoveScroll = React.forwardRef(function(props, ref) {
|
|
|
4168
4176
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
4169
4177
|
var Combination_default = ReactRemoveScroll;
|
|
4170
4178
|
var POPOVER_NAME = "Popover";
|
|
4171
|
-
var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [createPopperScope]);
|
|
4179
|
+
var [createPopoverContext, createPopoverScope] = createContextScope$2(POPOVER_NAME, [createPopperScope]);
|
|
4172
4180
|
var usePopperScope = createPopperScope();
|
|
4173
4181
|
var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
4174
4182
|
var Popover$1 = (props) => {
|
|
4175
4183
|
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
4176
4184
|
const popperScope = usePopperScope(__scopePopover);
|
|
4177
|
-
const triggerRef = React.useRef(null);
|
|
4178
|
-
const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
|
|
4185
|
+
const triggerRef = React$1.useRef(null);
|
|
4186
|
+
const [hasCustomAnchor, setHasCustomAnchor] = React$1.useState(false);
|
|
4179
4187
|
const [open, setOpen] = useControllableState({
|
|
4180
4188
|
prop: openProp,
|
|
4181
4189
|
defaultProp: defaultOpen ?? false,
|
|
@@ -4190,10 +4198,10 @@ var Popover$1 = (props) => {
|
|
|
4190
4198
|
triggerRef,
|
|
4191
4199
|
open,
|
|
4192
4200
|
onOpenChange: setOpen,
|
|
4193
|
-
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
4201
|
+
onOpenToggle: React$1.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
4194
4202
|
hasCustomAnchor,
|
|
4195
|
-
onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),
|
|
4196
|
-
onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),
|
|
4203
|
+
onCustomAnchorAdd: React$1.useCallback(() => setHasCustomAnchor(true), []),
|
|
4204
|
+
onCustomAnchorRemove: React$1.useCallback(() => setHasCustomAnchor(false), []),
|
|
4197
4205
|
modal,
|
|
4198
4206
|
children
|
|
4199
4207
|
})
|
|
@@ -4201,12 +4209,12 @@ var Popover$1 = (props) => {
|
|
|
4201
4209
|
};
|
|
4202
4210
|
Popover$1.displayName = POPOVER_NAME;
|
|
4203
4211
|
var ANCHOR_NAME = "PopoverAnchor";
|
|
4204
|
-
var PopoverAnchor = React.forwardRef((props, forwardedRef) => {
|
|
4212
|
+
var PopoverAnchor = React$1.forwardRef((props, forwardedRef) => {
|
|
4205
4213
|
const { __scopePopover, ...anchorProps } = props;
|
|
4206
4214
|
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
4207
4215
|
const popperScope = usePopperScope(__scopePopover);
|
|
4208
4216
|
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
4209
|
-
React.useEffect(() => {
|
|
4217
|
+
React$1.useEffect(() => {
|
|
4210
4218
|
onCustomAnchorAdd();
|
|
4211
4219
|
return () => onCustomAnchorRemove();
|
|
4212
4220
|
}, [onCustomAnchorAdd, onCustomAnchorRemove]);
|
|
@@ -4218,12 +4226,12 @@ var PopoverAnchor = React.forwardRef((props, forwardedRef) => {
|
|
|
4218
4226
|
});
|
|
4219
4227
|
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
4220
4228
|
var TRIGGER_NAME = "PopoverTrigger";
|
|
4221
|
-
var PopoverTrigger$1 = React.forwardRef((props, forwardedRef) => {
|
|
4229
|
+
var PopoverTrigger$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
4222
4230
|
const { __scopePopover, ...triggerProps } = props;
|
|
4223
4231
|
const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
|
|
4224
4232
|
const popperScope = usePopperScope(__scopePopover);
|
|
4225
4233
|
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
4226
|
-
const trigger = /* @__PURE__ */ jsx(Primitive$
|
|
4234
|
+
const trigger = /* @__PURE__ */ jsx(Primitive$2.button, {
|
|
4227
4235
|
type: "button",
|
|
4228
4236
|
"aria-haspopup": "dialog",
|
|
4229
4237
|
"aria-expanded": context.open,
|
|
@@ -4260,7 +4268,7 @@ var PopoverPortal = (props) => {
|
|
|
4260
4268
|
};
|
|
4261
4269
|
PopoverPortal.displayName = PORTAL_NAME;
|
|
4262
4270
|
var CONTENT_NAME = "PopoverContent";
|
|
4263
|
-
var PopoverContent$1 = React.forwardRef((props, forwardedRef) => {
|
|
4271
|
+
var PopoverContent$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
4264
4272
|
const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);
|
|
4265
4273
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
4266
4274
|
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
@@ -4277,12 +4285,12 @@ var PopoverContent$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
4277
4285
|
});
|
|
4278
4286
|
PopoverContent$1.displayName = CONTENT_NAME;
|
|
4279
4287
|
var Slot$1 = createSlot("PopoverContent.RemoveScroll");
|
|
4280
|
-
var PopoverContentModal = React.forwardRef((props, forwardedRef) => {
|
|
4288
|
+
var PopoverContentModal = React$1.forwardRef((props, forwardedRef) => {
|
|
4281
4289
|
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
4282
|
-
const contentRef = React.useRef(null);
|
|
4290
|
+
const contentRef = React$1.useRef(null);
|
|
4283
4291
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
4284
|
-
const isRightClickOutsideRef = React.useRef(false);
|
|
4285
|
-
React.useEffect(() => {
|
|
4292
|
+
const isRightClickOutsideRef = React$1.useRef(false);
|
|
4293
|
+
React$1.useEffect(() => {
|
|
4286
4294
|
const content = contentRef.current;
|
|
4287
4295
|
if (content) return hideOthers(content);
|
|
4288
4296
|
}, []);
|
|
@@ -4307,10 +4315,10 @@ var PopoverContentModal = React.forwardRef((props, forwardedRef) => {
|
|
|
4307
4315
|
})
|
|
4308
4316
|
});
|
|
4309
4317
|
});
|
|
4310
|
-
var PopoverContentNonModal = React.forwardRef((props, forwardedRef) => {
|
|
4318
|
+
var PopoverContentNonModal = React$1.forwardRef((props, forwardedRef) => {
|
|
4311
4319
|
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
4312
|
-
const hasInteractedOutsideRef = React.useRef(false);
|
|
4313
|
-
const hasPointerDownOutsideRef = React.useRef(false);
|
|
4320
|
+
const hasInteractedOutsideRef = React$1.useRef(false);
|
|
4321
|
+
const hasPointerDownOutsideRef = React$1.useRef(false);
|
|
4314
4322
|
return /* @__PURE__ */ jsx(PopoverContentImpl, {
|
|
4315
4323
|
...props,
|
|
4316
4324
|
ref: forwardedRef,
|
|
@@ -4337,7 +4345,7 @@ var PopoverContentNonModal = React.forwardRef((props, forwardedRef) => {
|
|
|
4337
4345
|
}
|
|
4338
4346
|
});
|
|
4339
4347
|
});
|
|
4340
|
-
var PopoverContentImpl = React.forwardRef((props, forwardedRef) => {
|
|
4348
|
+
var PopoverContentImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
4341
4349
|
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, ...contentProps } = props;
|
|
4342
4350
|
const context = usePopoverContext(CONTENT_NAME, __scopePopover);
|
|
4343
4351
|
const popperScope = usePopperScope(__scopePopover);
|
|
@@ -4376,10 +4384,10 @@ var PopoverContentImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
4376
4384
|
});
|
|
4377
4385
|
});
|
|
4378
4386
|
var CLOSE_NAME = "PopoverClose";
|
|
4379
|
-
var PopoverClose = React.forwardRef((props, forwardedRef) => {
|
|
4387
|
+
var PopoverClose = React$1.forwardRef((props, forwardedRef) => {
|
|
4380
4388
|
const { __scopePopover, ...closeProps } = props;
|
|
4381
4389
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
4382
|
-
return /* @__PURE__ */ jsx(Primitive$
|
|
4390
|
+
return /* @__PURE__ */ jsx(Primitive$2.button, {
|
|
4383
4391
|
type: "button",
|
|
4384
4392
|
...closeProps,
|
|
4385
4393
|
ref: forwardedRef,
|
|
@@ -4388,7 +4396,7 @@ var PopoverClose = React.forwardRef((props, forwardedRef) => {
|
|
|
4388
4396
|
});
|
|
4389
4397
|
PopoverClose.displayName = CLOSE_NAME;
|
|
4390
4398
|
var ARROW_NAME = "PopoverArrow";
|
|
4391
|
-
var PopoverArrow = React.forwardRef((props, forwardedRef) => {
|
|
4399
|
+
var PopoverArrow = React$1.forwardRef((props, forwardedRef) => {
|
|
4392
4400
|
const { __scopePopover, ...arrowProps } = props;
|
|
4393
4401
|
return /* @__PURE__ */ jsx(Arrow, {
|
|
4394
4402
|
...usePopperScope(__scopePopover),
|
|
@@ -4442,7 +4450,7 @@ function D(_) {
|
|
|
4442
4450
|
function W(_, C, h$1) {
|
|
4443
4451
|
return _ = h$1 && h$1.length > 0 ? `${_ + " " + h$1.join(" ")}` : _, G(_, C, D(_), D(C), 0, 0, {});
|
|
4444
4452
|
}
|
|
4445
|
-
var Primitive = [
|
|
4453
|
+
var Primitive$1 = [
|
|
4446
4454
|
"a",
|
|
4447
4455
|
"button",
|
|
4448
4456
|
"div",
|
|
@@ -4462,7 +4470,7 @@ var Primitive = [
|
|
|
4462
4470
|
"ul"
|
|
4463
4471
|
].reduce((primitive, node) => {
|
|
4464
4472
|
const Slot$2 = createSlot(`Primitive.${node}`);
|
|
4465
|
-
const Node$1 = React.forwardRef((props, forwardedRef) => {
|
|
4473
|
+
const Node$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
4466
4474
|
const { asChild, ...primitiveProps } = props;
|
|
4467
4475
|
const Comp = asChild ? Slot$2 : node;
|
|
4468
4476
|
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
@@ -4477,7 +4485,7 @@ var Primitive = [
|
|
|
4477
4485
|
[node]: Node$1
|
|
4478
4486
|
};
|
|
4479
4487
|
}, {});
|
|
4480
|
-
var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-heading=\"\"]", le = "[cmdk-item=\"\"]", ce = `${le}:not([aria-disabled="true"])`, Z = "cmdk-item-select", T = "data-value", Re = (r$1, o, n$1) => W(r$1, o, n$1), ue = React.createContext(void 0), K = () => React.useContext(ue), de = React.createContext(void 0), ee = () => React.useContext(de), fe = React.createContext(void 0), me = React.forwardRef((r$1, o) => {
|
|
4488
|
+
var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-heading=\"\"]", le = "[cmdk-item=\"\"]", ce = `${le}:not([aria-disabled="true"])`, Z = "cmdk-item-select", T = "data-value", Re = (r$1, o, n$1) => W(r$1, o, n$1), ue = React$1.createContext(void 0), K = () => React$1.useContext(ue), de = React$1.createContext(void 0), ee = () => React$1.useContext(de), fe = React$1.createContext(void 0), me = React$1.forwardRef((r$1, o) => {
|
|
4481
4489
|
let n$1 = L(() => {
|
|
4482
4490
|
var e$1, a$1;
|
|
4483
4491
|
return {
|
|
@@ -4490,7 +4498,7 @@ var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-he
|
|
|
4490
4498
|
groups: /* @__PURE__ */ new Set()
|
|
4491
4499
|
}
|
|
4492
4500
|
};
|
|
4493
|
-
}), u$2 = L(() => /* @__PURE__ */ new Set()), c$2 = L(() => /* @__PURE__ */ new Map()), d$1 = L(() => /* @__PURE__ */ new Map()), f$1 = L(() => /* @__PURE__ */ new Set()), p$2 = pe(r$1), { label: b$1, children: m$2, value: R, onValueChange: x$2, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = !1, vimBindings: j = !0, ...O$1 } = r$1, $$1 = useId$2(), q$1 = useId$2(), _ = useId$2(), I = React.useRef(null), v$1 = ke();
|
|
4501
|
+
}), u$2 = L(() => /* @__PURE__ */ new Set()), c$2 = L(() => /* @__PURE__ */ new Map()), d$1 = L(() => /* @__PURE__ */ new Map()), f$1 = L(() => /* @__PURE__ */ new Set()), p$2 = pe(r$1), { label: b$1, children: m$2, value: R, onValueChange: x$2, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = !1, vimBindings: j = !0, ...O$1 } = r$1, $$1 = useId$2(), q$1 = useId$2(), _ = useId$2(), I = React$1.useRef(null), v$1 = ke();
|
|
4494
4502
|
k$2(() => {
|
|
4495
4503
|
if (R !== void 0) {
|
|
4496
4504
|
let e$1 = R.trim();
|
|
@@ -4499,7 +4507,7 @@ var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-he
|
|
|
4499
4507
|
}, [R]), k$2(() => {
|
|
4500
4508
|
v$1(6, ne);
|
|
4501
4509
|
}, []);
|
|
4502
|
-
let E = React.useMemo(() => ({
|
|
4510
|
+
let E = React$1.useMemo(() => ({
|
|
4503
4511
|
subscribe: (e$1) => (f$1.current.add(e$1), () => f$1.current.delete(e$1)),
|
|
4504
4512
|
snapshot: () => n$1.current,
|
|
4505
4513
|
setState: (e$1, a$1, s$1) => {
|
|
@@ -4526,7 +4534,7 @@ var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-he
|
|
|
4526
4534
|
emit: () => {
|
|
4527
4535
|
f$1.current.forEach((e$1) => e$1());
|
|
4528
4536
|
}
|
|
4529
|
-
}), []), U$1 = React.useMemo(() => ({
|
|
4537
|
+
}), []), U$1 = React$1.useMemo(() => ({
|
|
4530
4538
|
value: (e$1, a$1, s$1) => {
|
|
4531
4539
|
var i;
|
|
4532
4540
|
a$1 !== ((i = d$1.current.get(e$1)) == null ? void 0 : i.value) && (d$1.current.set(e$1, {
|
|
@@ -4639,7 +4647,7 @@ var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-he
|
|
|
4639
4647
|
}, se = (e$1) => {
|
|
4640
4648
|
e$1.preventDefault(), e$1.metaKey ? X$2(0) : e$1.altKey ? re$1(-1) : Q(-1);
|
|
4641
4649
|
};
|
|
4642
|
-
return React.createElement(Primitive.div, {
|
|
4650
|
+
return React$1.createElement(Primitive$1.div, {
|
|
4643
4651
|
ref: o,
|
|
4644
4652
|
tabIndex: -1,
|
|
4645
4653
|
...O$1,
|
|
@@ -4679,15 +4687,15 @@ var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-he
|
|
|
4679
4687
|
}
|
|
4680
4688
|
}
|
|
4681
4689
|
}
|
|
4682
|
-
}, React.createElement("label", {
|
|
4690
|
+
}, React$1.createElement("label", {
|
|
4683
4691
|
"cmdk-label": "",
|
|
4684
4692
|
htmlFor: U$1.inputId,
|
|
4685
4693
|
id: U$1.labelId,
|
|
4686
4694
|
style: Te
|
|
4687
|
-
}, b$1), B(r$1, (e$1) => React.createElement(de.Provider, { value: E }, React.createElement(ue.Provider, { value: U$1 }, e$1))));
|
|
4688
|
-
}), he = React.forwardRef((r$1, o) => {
|
|
4695
|
+
}, b$1), B(r$1, (e$1) => React$1.createElement(de.Provider, { value: E }, React$1.createElement(ue.Provider, { value: U$1 }, e$1))));
|
|
4696
|
+
}), he = React$1.forwardRef((r$1, o) => {
|
|
4689
4697
|
var _, I;
|
|
4690
|
-
let n$1 = useId$2(), u$2 = React.useRef(null), c$2 = React.useContext(fe), d$1 = K(), f$1 = pe(r$1), p$2 = (I = (_ = f$1.current) == null ? void 0 : _.forceMount) != null ? I : c$2 == null ? void 0 : c$2.forceMount;
|
|
4698
|
+
let n$1 = useId$2(), u$2 = React$1.useRef(null), c$2 = React$1.useContext(fe), d$1 = K(), f$1 = pe(r$1), p$2 = (I = (_ = f$1.current) == null ? void 0 : _.forceMount) != null ? I : c$2 == null ? void 0 : c$2.forceMount;
|
|
4691
4699
|
k$2(() => {
|
|
4692
4700
|
if (!p$2) return d$1.item(n$1, c$2 == null ? void 0 : c$2.id);
|
|
4693
4701
|
}, [p$2]);
|
|
@@ -4696,7 +4704,7 @@ var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-he
|
|
|
4696
4704
|
r$1.children,
|
|
4697
4705
|
u$2
|
|
4698
4706
|
], r$1.keywords), m$2 = ee(), R = P((v$1) => v$1.value && v$1.value === b$1.current), x$2 = P((v$1) => p$2 || d$1.filter() === !1 ? !0 : v$1.search ? v$1.filtered.items.get(n$1) > 0 : !0);
|
|
4699
|
-
React.useEffect(() => {
|
|
4707
|
+
React$1.useEffect(() => {
|
|
4700
4708
|
let v$1 = u$2.current;
|
|
4701
4709
|
if (!(!v$1 || r$1.disabled)) return v$1.addEventListener(Z, C), () => v$1.removeEventListener(Z, C);
|
|
4702
4710
|
}, [
|
|
@@ -4713,7 +4721,7 @@ var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-he
|
|
|
4713
4721
|
}
|
|
4714
4722
|
if (!x$2) return null;
|
|
4715
4723
|
let { disabled: A, value: ge, onSelect: j, forceMount: O$1, keywords: $$1, ...q$1 } = r$1;
|
|
4716
|
-
return React.createElement(Primitive.div, {
|
|
4724
|
+
return React$1.createElement(Primitive$1.div, {
|
|
4717
4725
|
ref: composeRefs(u$2, o),
|
|
4718
4726
|
...q$1,
|
|
4719
4727
|
id: n$1,
|
|
@@ -4726,46 +4734,46 @@ var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-he
|
|
|
4726
4734
|
onPointerMove: A || d$1.getDisablePointerSelection() ? void 0 : S,
|
|
4727
4735
|
onClick: A ? void 0 : C
|
|
4728
4736
|
}, r$1.children);
|
|
4729
|
-
}), Ee = React.forwardRef((r$1, o) => {
|
|
4730
|
-
let { heading: n$1, children: u$2, forceMount: c$2, ...d$1 } = r$1, f$1 = useId$2(), p$2 = React.useRef(null), b$1 = React.useRef(null), m$2 = useId$2(), R = K(), x$2 = P((S) => c$2 || R.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(f$1) : !0);
|
|
4737
|
+
}), Ee = React$1.forwardRef((r$1, o) => {
|
|
4738
|
+
let { heading: n$1, children: u$2, forceMount: c$2, ...d$1 } = r$1, f$1 = useId$2(), p$2 = React$1.useRef(null), b$1 = React$1.useRef(null), m$2 = useId$2(), R = K(), x$2 = P((S) => c$2 || R.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(f$1) : !0);
|
|
4731
4739
|
k$2(() => R.group(f$1), []), ve(f$1, p$2, [
|
|
4732
4740
|
r$1.value,
|
|
4733
4741
|
r$1.heading,
|
|
4734
4742
|
b$1
|
|
4735
4743
|
]);
|
|
4736
|
-
let C = React.useMemo(() => ({
|
|
4744
|
+
let C = React$1.useMemo(() => ({
|
|
4737
4745
|
id: f$1,
|
|
4738
4746
|
forceMount: c$2
|
|
4739
4747
|
}), [c$2]);
|
|
4740
|
-
return React.createElement(Primitive.div, {
|
|
4748
|
+
return React$1.createElement(Primitive$1.div, {
|
|
4741
4749
|
ref: composeRefs(p$2, o),
|
|
4742
4750
|
...d$1,
|
|
4743
4751
|
"cmdk-group": "",
|
|
4744
4752
|
role: "presentation",
|
|
4745
4753
|
hidden: x$2 ? void 0 : !0
|
|
4746
|
-
}, n$1 && React.createElement("div", {
|
|
4754
|
+
}, n$1 && React$1.createElement("div", {
|
|
4747
4755
|
ref: b$1,
|
|
4748
4756
|
"cmdk-group-heading": "",
|
|
4749
4757
|
"aria-hidden": !0,
|
|
4750
4758
|
id: m$2
|
|
4751
|
-
}, n$1), B(r$1, (S) => React.createElement("div", {
|
|
4759
|
+
}, n$1), B(r$1, (S) => React$1.createElement("div", {
|
|
4752
4760
|
"cmdk-group-items": "",
|
|
4753
4761
|
role: "group",
|
|
4754
4762
|
"aria-labelledby": n$1 ? m$2 : void 0
|
|
4755
|
-
}, React.createElement(fe.Provider, { value: C }, S))));
|
|
4756
|
-
}), ye = React.forwardRef((r$1, o) => {
|
|
4757
|
-
let { alwaysRender: n$1, ...u$2 } = r$1, c$2 = React.useRef(null), d$1 = P((f$1) => !f$1.search);
|
|
4758
|
-
return !n$1 && !d$1 ? null : React.createElement(Primitive.div, {
|
|
4763
|
+
}, React$1.createElement(fe.Provider, { value: C }, S))));
|
|
4764
|
+
}), ye = React$1.forwardRef((r$1, o) => {
|
|
4765
|
+
let { alwaysRender: n$1, ...u$2 } = r$1, c$2 = React$1.useRef(null), d$1 = P((f$1) => !f$1.search);
|
|
4766
|
+
return !n$1 && !d$1 ? null : React$1.createElement(Primitive$1.div, {
|
|
4759
4767
|
ref: composeRefs(c$2, o),
|
|
4760
4768
|
...u$2,
|
|
4761
4769
|
"cmdk-separator": "",
|
|
4762
4770
|
role: "separator"
|
|
4763
4771
|
});
|
|
4764
|
-
}), Se = React.forwardRef((r$1, o) => {
|
|
4772
|
+
}), Se = React$1.forwardRef((r$1, o) => {
|
|
4765
4773
|
let { onValueChange: n$1, ...u$2 } = r$1, c$2 = r$1.value != null, d$1 = ee(), f$1 = P((m$2) => m$2.search), p$2 = P((m$2) => m$2.selectedItemId), b$1 = K();
|
|
4766
|
-
return React.useEffect(() => {
|
|
4774
|
+
return React$1.useEffect(() => {
|
|
4767
4775
|
r$1.value != null && d$1.setState("search", r$1.value);
|
|
4768
|
-
}, [r$1.value]), React.createElement(Primitive.input, {
|
|
4776
|
+
}, [r$1.value]), React$1.createElement(Primitive$1.input, {
|
|
4769
4777
|
ref: o,
|
|
4770
4778
|
...u$2,
|
|
4771
4779
|
"cmdk-input": "",
|
|
@@ -4785,9 +4793,9 @@ var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-he
|
|
|
4785
4793
|
c$2 || d$1.setState("search", m$2.target.value), n$1?.(m$2.target.value);
|
|
4786
4794
|
}
|
|
4787
4795
|
});
|
|
4788
|
-
}), Ce = React.forwardRef((r$1, o) => {
|
|
4789
|
-
let { children: n$1, label: u$2 = "Suggestions", ...c$2 } = r$1, d$1 = React.useRef(null), f$1 = React.useRef(null), p$2 = P((m$2) => m$2.selectedItemId), b$1 = K();
|
|
4790
|
-
return React.useEffect(() => {
|
|
4796
|
+
}), Ce = React$1.forwardRef((r$1, o) => {
|
|
4797
|
+
let { children: n$1, label: u$2 = "Suggestions", ...c$2 } = r$1, d$1 = React$1.useRef(null), f$1 = React$1.useRef(null), p$2 = P((m$2) => m$2.selectedItemId), b$1 = K();
|
|
4798
|
+
return React$1.useEffect(() => {
|
|
4791
4799
|
if (f$1.current && d$1.current) {
|
|
4792
4800
|
let m$2 = f$1.current, R = d$1.current, x$2, C = new ResizeObserver(() => {
|
|
4793
4801
|
x$2 = requestAnimationFrame(() => {
|
|
@@ -4799,7 +4807,7 @@ var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-he
|
|
|
4799
4807
|
cancelAnimationFrame(x$2), C.unobserve(m$2);
|
|
4800
4808
|
};
|
|
4801
4809
|
}
|
|
4802
|
-
}, []), React.createElement(Primitive.div, {
|
|
4810
|
+
}, []), React$1.createElement(Primitive$1.div, {
|
|
4803
4811
|
ref: composeRefs(d$1, o),
|
|
4804
4812
|
...c$2,
|
|
4805
4813
|
"cmdk-list": "",
|
|
@@ -4808,34 +4816,34 @@ var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-he
|
|
|
4808
4816
|
"aria-activedescendant": p$2,
|
|
4809
4817
|
"aria-label": u$2,
|
|
4810
4818
|
id: b$1.listId
|
|
4811
|
-
}, B(r$1, (m$2) => React.createElement("div", {
|
|
4819
|
+
}, B(r$1, (m$2) => React$1.createElement("div", {
|
|
4812
4820
|
ref: composeRefs(f$1, b$1.listInnerRef),
|
|
4813
4821
|
"cmdk-list-sizer": ""
|
|
4814
4822
|
}, m$2)));
|
|
4815
|
-
}), xe = React.forwardRef((r$1, o) => {
|
|
4823
|
+
}), xe = React$1.forwardRef((r$1, o) => {
|
|
4816
4824
|
let { open: n$1, onOpenChange: u$2, overlayClassName: c$2, contentClassName: d$1, container: f$1, ...p$2 } = r$1;
|
|
4817
|
-
return React.createElement(w$1.Root, {
|
|
4825
|
+
return React$1.createElement(w$1.Root, {
|
|
4818
4826
|
open: n$1,
|
|
4819
4827
|
onOpenChange: u$2
|
|
4820
|
-
}, React.createElement(w$1.Portal, { container: f$1 }, React.createElement(w$1.Overlay, {
|
|
4828
|
+
}, React$1.createElement(w$1.Portal, { container: f$1 }, React$1.createElement(w$1.Overlay, {
|
|
4821
4829
|
"cmdk-overlay": "",
|
|
4822
4830
|
className: c$2
|
|
4823
|
-
}), React.createElement(w$1.Content, {
|
|
4831
|
+
}), React$1.createElement(w$1.Content, {
|
|
4824
4832
|
"aria-label": r$1.label,
|
|
4825
4833
|
"cmdk-dialog": "",
|
|
4826
4834
|
className: d$1
|
|
4827
|
-
}, React.createElement(me, {
|
|
4835
|
+
}, React$1.createElement(me, {
|
|
4828
4836
|
ref: o,
|
|
4829
4837
|
...p$2
|
|
4830
4838
|
}))));
|
|
4831
|
-
}), Ie = React.forwardRef((r$1, o) => P((u$2) => u$2.filtered.count === 0) ? React.createElement(Primitive.div, {
|
|
4839
|
+
}), Ie = React$1.forwardRef((r$1, o) => P((u$2) => u$2.filtered.count === 0) ? React$1.createElement(Primitive$1.div, {
|
|
4832
4840
|
ref: o,
|
|
4833
4841
|
...r$1,
|
|
4834
4842
|
"cmdk-empty": "",
|
|
4835
4843
|
role: "presentation"
|
|
4836
|
-
}) : null), Pe = React.forwardRef((r$1, o) => {
|
|
4844
|
+
}) : null), Pe = React$1.forwardRef((r$1, o) => {
|
|
4837
4845
|
let { progress: n$1, children: u$2, label: c$2 = "Loading...", ...d$1 } = r$1;
|
|
4838
|
-
return React.createElement(Primitive.div, {
|
|
4846
|
+
return React$1.createElement(Primitive$1.div, {
|
|
4839
4847
|
ref: o,
|
|
4840
4848
|
...d$1,
|
|
4841
4849
|
"cmdk-loading": "",
|
|
@@ -4844,7 +4852,7 @@ var N = "[cmdk-group=\"\"]", Y = "[cmdk-group-items=\"\"]", be = "[cmdk-group-he
|
|
|
4844
4852
|
"aria-valuemin": 0,
|
|
4845
4853
|
"aria-valuemax": 100,
|
|
4846
4854
|
"aria-label": c$2
|
|
4847
|
-
}, B(r$1, (f$1) => React.createElement("div", { "aria-hidden": !0 }, f$1)));
|
|
4855
|
+
}, B(r$1, (f$1) => React$1.createElement("div", { "aria-hidden": !0 }, f$1)));
|
|
4848
4856
|
}), _e = Object.assign(me, {
|
|
4849
4857
|
List: Ce,
|
|
4850
4858
|
Item: he,
|
|
@@ -4870,22 +4878,22 @@ function De(r$1, o) {
|
|
|
4870
4878
|
}
|
|
4871
4879
|
}
|
|
4872
4880
|
function pe(r$1) {
|
|
4873
|
-
let o = React.useRef(r$1);
|
|
4881
|
+
let o = React$1.useRef(r$1);
|
|
4874
4882
|
return k$2(() => {
|
|
4875
4883
|
o.current = r$1;
|
|
4876
4884
|
}), o;
|
|
4877
4885
|
}
|
|
4878
|
-
var k$2 = typeof window == "undefined" ? React.useEffect : React.useLayoutEffect;
|
|
4886
|
+
var k$2 = typeof window == "undefined" ? React$1.useEffect : React$1.useLayoutEffect;
|
|
4879
4887
|
function L(r$1) {
|
|
4880
|
-
let o = React.useRef();
|
|
4888
|
+
let o = React$1.useRef();
|
|
4881
4889
|
return o.current === void 0 && (o.current = r$1()), o;
|
|
4882
4890
|
}
|
|
4883
4891
|
function P(r$1) {
|
|
4884
4892
|
let o = ee(), n$1 = () => r$1(o.snapshot());
|
|
4885
|
-
return React.useSyncExternalStore(o.subscribe, n$1, n$1);
|
|
4893
|
+
return React$1.useSyncExternalStore(o.subscribe, n$1, n$1);
|
|
4886
4894
|
}
|
|
4887
4895
|
function ve(r$1, o, n$1, u$2 = []) {
|
|
4888
|
-
let c$2 = React.useRef(), d$1 = K();
|
|
4896
|
+
let c$2 = React$1.useRef(), d$1 = K();
|
|
4889
4897
|
return k$2(() => {
|
|
4890
4898
|
var b$1;
|
|
4891
4899
|
let f$1 = (() => {
|
|
@@ -4899,7 +4907,7 @@ function ve(r$1, o, n$1, u$2 = []) {
|
|
|
4899
4907
|
}), c$2;
|
|
4900
4908
|
}
|
|
4901
4909
|
var ke = () => {
|
|
4902
|
-
let [r$1, o] = React.useState(), n$1 = L(() => /* @__PURE__ */ new Map());
|
|
4910
|
+
let [r$1, o] = React$1.useState(), n$1 = L(() => /* @__PURE__ */ new Map());
|
|
4903
4911
|
return k$2(() => {
|
|
4904
4912
|
n$1.current.forEach((u$2) => u$2()), n$1.current = /* @__PURE__ */ new Map();
|
|
4905
4913
|
}, [r$1]), (u$2, c$2) => {
|
|
@@ -4911,7 +4919,7 @@ function Me(r$1) {
|
|
|
4911
4919
|
return typeof o == "function" ? o(r$1.props) : "render" in o ? o.render(r$1.props) : r$1;
|
|
4912
4920
|
}
|
|
4913
4921
|
function B({ asChild: r$1, children: o }, n$1) {
|
|
4914
|
-
return r$1 && React.isValidElement(o) ? React.cloneElement(Me(o), { ref: o.ref }, n$1(o.props.children)) : n$1(o);
|
|
4922
|
+
return r$1 && React$1.isValidElement(o) ? React$1.cloneElement(Me(o), { ref: o.ref }, n$1(o.props.children)) : n$1(o);
|
|
4915
4923
|
}
|
|
4916
4924
|
var Te = {
|
|
4917
4925
|
position: "absolute",
|
|
@@ -4994,7 +5002,7 @@ function getDropdownItemClasses(options$1) {
|
|
|
4994
5002
|
}
|
|
4995
5003
|
const dropdownSeparatorClasses = cn("h-px my-1", "bg-[var(--dropdown-border)]");
|
|
4996
5004
|
const dropdownLabelClasses = cn("px-3 py-1.5 md:px-4 md:py-2", "text-xs font-medium", "text-[var(--text-muted)]");
|
|
4997
|
-
function ComboBoxGlassInner({ options: options$1, value,
|
|
5005
|
+
function ComboBoxGlassInner({ options: options$1, value, onValueChange, placeholder = "Select option...", emptyText = "No results found.", searchPlaceholder = "Search...", glassVariant = "glass", disabled = false, className, popoverClassName, clearable = false, side = "bottom", align = "start", label, error, success, required = false, size: size$3 = "md", searchable = true, icon: TriggerIcon }, ref) {
|
|
4998
5006
|
const [open, setOpen] = useState(false);
|
|
4999
5007
|
const [search, setSearch] = useState("");
|
|
5000
5008
|
const fieldId = useId();
|
|
@@ -5005,13 +5013,13 @@ function ComboBoxGlassInner({ options: options$1, value, onChange, placeholder =
|
|
|
5005
5013
|
return options$1.filter((opt) => opt.label.toLowerCase().includes(searchLower));
|
|
5006
5014
|
}, [options$1, search]);
|
|
5007
5015
|
const handleSelect = useCallback((optionValue) => {
|
|
5008
|
-
if (clearable && value === optionValue)
|
|
5009
|
-
else
|
|
5016
|
+
if (clearable && value === optionValue) onValueChange?.(void 0);
|
|
5017
|
+
else onValueChange?.(optionValue);
|
|
5010
5018
|
setOpen(false);
|
|
5011
5019
|
setSearch("");
|
|
5012
5020
|
}, [
|
|
5013
5021
|
value,
|
|
5014
|
-
|
|
5022
|
+
onValueChange,
|
|
5015
5023
|
clearable
|
|
5016
5024
|
]);
|
|
5017
5025
|
const getGlassClass = () => {
|
|
@@ -5103,21 +5111,21 @@ var DropdownMenuGlassGroup = DropdownMenuPrimitive.Group;
|
|
|
5103
5111
|
var DropdownMenuGlassPortal = DropdownMenuPrimitive.Portal;
|
|
5104
5112
|
var DropdownMenuGlassSub = DropdownMenuPrimitive.Sub;
|
|
5105
5113
|
var DropdownMenuGlassRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
5106
|
-
var DropdownMenuGlassSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenuPrimitive.SubTrigger, {
|
|
5114
|
+
var DropdownMenuGlassSubTrigger = React$1.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenuPrimitive.SubTrigger, {
|
|
5107
5115
|
ref,
|
|
5108
5116
|
className: cn(getDropdownItemClasses(), "data-[state=open]:bg-[var(--dropdown-item-hover)]", inset && "pl-8", className),
|
|
5109
5117
|
...props,
|
|
5110
5118
|
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto h-4 w-4" })]
|
|
5111
5119
|
}));
|
|
5112
5120
|
DropdownMenuGlassSubTrigger.displayName = "DropdownMenuGlassSubTrigger";
|
|
5113
|
-
var DropdownMenuGlassSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.SubContent, {
|
|
5121
|
+
var DropdownMenuGlassSubContent = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.SubContent, {
|
|
5114
5122
|
ref,
|
|
5115
5123
|
className: cn(dropdownContentClasses, "p-1.5", className),
|
|
5116
5124
|
style: getDropdownContentStyles(),
|
|
5117
5125
|
...props
|
|
5118
5126
|
}));
|
|
5119
5127
|
DropdownMenuGlassSubContent.displayName = "DropdownMenuGlassSubContent";
|
|
5120
|
-
var DropdownMenuGlassContent = React.forwardRef(({ className, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Content, {
|
|
5128
|
+
var DropdownMenuGlassContent = React$1.forwardRef(({ className, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Content, {
|
|
5121
5129
|
ref,
|
|
5122
5130
|
sideOffset,
|
|
5123
5131
|
className: cn(dropdownContentClasses, "p-1.5", className),
|
|
@@ -5125,13 +5133,13 @@ var DropdownMenuGlassContent = React.forwardRef(({ className, sideOffset = 8, ..
|
|
|
5125
5133
|
...props
|
|
5126
5134
|
}) }));
|
|
5127
5135
|
DropdownMenuGlassContent.displayName = "DropdownMenuGlassContent";
|
|
5128
|
-
var DropdownMenuGlassItem = React.forwardRef(({ className, inset, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Item, {
|
|
5136
|
+
var DropdownMenuGlassItem = React$1.forwardRef(({ className, inset, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Item, {
|
|
5129
5137
|
ref,
|
|
5130
5138
|
className: cn(getDropdownItemClasses({ danger: variant === "destructive" }), inset && "pl-8", className),
|
|
5131
5139
|
...props
|
|
5132
5140
|
}));
|
|
5133
5141
|
DropdownMenuGlassItem.displayName = "DropdownMenuGlassItem";
|
|
5134
|
-
var DropdownMenuGlassCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenuPrimitive.CheckboxItem, {
|
|
5142
|
+
var DropdownMenuGlassCheckboxItem = React$1.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenuPrimitive.CheckboxItem, {
|
|
5135
5143
|
ref,
|
|
5136
5144
|
className: cn(getDropdownItemClasses(), "pl-8 pr-2", className),
|
|
5137
5145
|
checked,
|
|
@@ -5142,7 +5150,7 @@ var DropdownMenuGlassCheckboxItem = React.forwardRef(({ className, children, che
|
|
|
5142
5150
|
}), children]
|
|
5143
5151
|
}));
|
|
5144
5152
|
DropdownMenuGlassCheckboxItem.displayName = "DropdownMenuGlassCheckboxItem";
|
|
5145
|
-
var DropdownMenuGlassRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenuPrimitive.RadioItem, {
|
|
5153
|
+
var DropdownMenuGlassRadioItem = React$1.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenuPrimitive.RadioItem, {
|
|
5146
5154
|
ref,
|
|
5147
5155
|
className: cn(getDropdownItemClasses(), "pl-8 pr-2", className),
|
|
5148
5156
|
...props,
|
|
@@ -5152,13 +5160,13 @@ var DropdownMenuGlassRadioItem = React.forwardRef(({ className, children, ...pro
|
|
|
5152
5160
|
}), children]
|
|
5153
5161
|
}));
|
|
5154
5162
|
DropdownMenuGlassRadioItem.displayName = "DropdownMenuGlassRadioItem";
|
|
5155
|
-
var DropdownMenuGlassLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Label, {
|
|
5163
|
+
var DropdownMenuGlassLabel = React$1.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Label, {
|
|
5156
5164
|
ref,
|
|
5157
5165
|
className: cn(dropdownLabelClasses, inset && "pl-8", className),
|
|
5158
5166
|
...props
|
|
5159
5167
|
}));
|
|
5160
5168
|
DropdownMenuGlassLabel.displayName = "DropdownMenuGlassLabel";
|
|
5161
|
-
var DropdownMenuGlassSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Separator, {
|
|
5169
|
+
var DropdownMenuGlassSeparator = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Separator, {
|
|
5162
5170
|
ref,
|
|
5163
5171
|
className: cn(dropdownSeparatorClasses, "-mx-1 my-1", className),
|
|
5164
5172
|
...props
|
|
@@ -5171,7 +5179,7 @@ var DropdownMenuGlassShortcut = ({ className, ...props }) => {
|
|
|
5171
5179
|
});
|
|
5172
5180
|
};
|
|
5173
5181
|
DropdownMenuGlassShortcut.displayName = "DropdownMenuGlassShortcut";
|
|
5174
|
-
const DropdownGlass = React.forwardRef(({ trigger, items, align = "left", className }, ref) => {
|
|
5182
|
+
const DropdownGlass = React$1.forwardRef(({ trigger, items, align = "left", className }, ref) => {
|
|
5175
5183
|
return /* @__PURE__ */ jsx("div", {
|
|
5176
5184
|
ref,
|
|
5177
5185
|
className: cn("relative inline-block", className),
|
|
@@ -5609,7 +5617,7 @@ NotificationGlass.displayName = "NotificationGlass";
|
|
|
5609
5617
|
var PopoverGlassRoot = Root2;
|
|
5610
5618
|
var PopoverGlassTrigger = Trigger;
|
|
5611
5619
|
var PopoverGlassAnchor = Anchor2;
|
|
5612
|
-
var PopoverGlassContent = React.forwardRef(({ className, align = "center", sideOffset = 8, showArrow = true, children, ...props }, ref) => {
|
|
5620
|
+
var PopoverGlassContent = React$1.forwardRef(({ className, align = "center", sideOffset = 8, showArrow = true, children, ...props }, ref) => {
|
|
5613
5621
|
const popoverStyles = {
|
|
5614
5622
|
background: "var(--popover-bg)",
|
|
5615
5623
|
border: "1px solid var(--popover-border)",
|
|
@@ -5634,7 +5642,7 @@ var PopoverGlassContent = React.forwardRef(({ className, align = "center", sideO
|
|
|
5634
5642
|
}) });
|
|
5635
5643
|
});
|
|
5636
5644
|
PopoverGlassContent.displayName = "PopoverGlassContent";
|
|
5637
|
-
var PopoverGlassLegacy = React.forwardRef(({ trigger, children, side = "bottom", align = "center", sideOffset = 8, open, onOpenChange, showArrow = true, className }, ref) => {
|
|
5645
|
+
var PopoverGlassLegacy = React$1.forwardRef(({ trigger, children, side = "bottom", align = "center", sideOffset = 8, open, onOpenChange, showArrow = true, className }, ref) => {
|
|
5638
5646
|
return /* @__PURE__ */ jsxs(PopoverGlassRoot, {
|
|
5639
5647
|
open,
|
|
5640
5648
|
onOpenChange,
|
|
@@ -5682,23 +5690,704 @@ const SkeletonGlass = forwardRef(({ className, variant = "text", width, height,
|
|
|
5682
5690
|
});
|
|
5683
5691
|
});
|
|
5684
5692
|
SkeletonGlass.displayName = "SkeletonGlass";
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5693
|
+
function clamp(value, [min$2, max$2]) {
|
|
5694
|
+
return Math.min(max$2, Math.max(min$2, value));
|
|
5695
|
+
}
|
|
5696
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
5697
|
+
let defaultContexts = [];
|
|
5698
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
5699
|
+
const BaseContext = React$1.createContext(defaultContext);
|
|
5700
|
+
const index$1 = defaultContexts.length;
|
|
5701
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
5702
|
+
const Provider$1 = (props) => {
|
|
5703
|
+
const { scope, children, ...context } = props;
|
|
5704
|
+
const Context = scope?.[scopeName]?.[index$1] || BaseContext;
|
|
5705
|
+
const value = React$1.useMemo(() => context, Object.values(context));
|
|
5706
|
+
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
5707
|
+
value,
|
|
5708
|
+
children
|
|
5709
|
+
});
|
|
5710
|
+
};
|
|
5711
|
+
Provider$1.displayName = rootComponentName + "Provider";
|
|
5712
|
+
function useContext2(consumerName, scope) {
|
|
5713
|
+
const Context = scope?.[scopeName]?.[index$1] || BaseContext;
|
|
5714
|
+
const context = React$1.useContext(Context);
|
|
5715
|
+
if (context) return context;
|
|
5716
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
5717
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
5718
|
+
}
|
|
5719
|
+
return [Provider$1, useContext2];
|
|
5720
|
+
}
|
|
5721
|
+
const createScope$2 = () => {
|
|
5722
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
5723
|
+
return React$1.createContext(defaultContext);
|
|
5724
|
+
});
|
|
5725
|
+
return function useScope(scope) {
|
|
5726
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
5727
|
+
return React$1.useMemo(() => ({ [`__scope${scopeName}`]: {
|
|
5728
|
+
...scope,
|
|
5729
|
+
[scopeName]: contexts
|
|
5730
|
+
} }), [scope, contexts]);
|
|
5731
|
+
};
|
|
5732
|
+
};
|
|
5733
|
+
createScope$2.scopeName = scopeName;
|
|
5734
|
+
return [createContext3, composeContextScopes$1(createScope$2, ...createContextScopeDeps)];
|
|
5735
|
+
}
|
|
5736
|
+
function composeContextScopes$1(...scopes) {
|
|
5737
|
+
const baseScope = scopes[0];
|
|
5738
|
+
if (scopes.length === 1) return baseScope;
|
|
5739
|
+
const createScope$2 = () => {
|
|
5740
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
5741
|
+
useScope: createScope2(),
|
|
5742
|
+
scopeName: createScope2.scopeName
|
|
5743
|
+
}));
|
|
5744
|
+
return function useComposedScopes(overrideScopes) {
|
|
5745
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
5746
|
+
const currentScope$2 = useScope(overrideScopes)[`__scope${scopeName}`];
|
|
5747
|
+
return {
|
|
5748
|
+
...nextScopes2,
|
|
5749
|
+
...currentScope$2
|
|
5750
|
+
};
|
|
5751
|
+
}, {});
|
|
5752
|
+
return React$1.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
5753
|
+
};
|
|
5754
|
+
};
|
|
5755
|
+
createScope$2.scopeName = baseScope.scopeName;
|
|
5756
|
+
return createScope$2;
|
|
5757
|
+
}
|
|
5758
|
+
var DirectionContext = React$1.createContext(void 0);
|
|
5759
|
+
function useDirection(localDir) {
|
|
5760
|
+
const globalDir = React$1.useContext(DirectionContext);
|
|
5761
|
+
return localDir || globalDir || "ltr";
|
|
5762
|
+
}
|
|
5763
|
+
function usePrevious(value) {
|
|
5764
|
+
const ref = React$1.useRef({
|
|
5765
|
+
value,
|
|
5766
|
+
previous: value
|
|
5767
|
+
});
|
|
5768
|
+
return React$1.useMemo(() => {
|
|
5769
|
+
if (ref.current.value !== value) {
|
|
5770
|
+
ref.current.previous = ref.current.value;
|
|
5771
|
+
ref.current.value = value;
|
|
5772
|
+
}
|
|
5773
|
+
return ref.current.previous;
|
|
5774
|
+
}, [value]);
|
|
5775
|
+
}
|
|
5776
|
+
var Primitive = [
|
|
5777
|
+
"a",
|
|
5778
|
+
"button",
|
|
5779
|
+
"div",
|
|
5780
|
+
"form",
|
|
5781
|
+
"h2",
|
|
5782
|
+
"h3",
|
|
5783
|
+
"img",
|
|
5784
|
+
"input",
|
|
5785
|
+
"label",
|
|
5786
|
+
"li",
|
|
5787
|
+
"nav",
|
|
5788
|
+
"ol",
|
|
5789
|
+
"p",
|
|
5790
|
+
"select",
|
|
5791
|
+
"span",
|
|
5792
|
+
"svg",
|
|
5793
|
+
"ul"
|
|
5794
|
+
].reduce((primitive, node) => {
|
|
5795
|
+
const Slot$2 = createSlot(`Primitive.${node}`);
|
|
5796
|
+
const Node$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
5797
|
+
const { asChild, ...primitiveProps } = props;
|
|
5798
|
+
const Comp = asChild ? Slot$2 : node;
|
|
5799
|
+
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
5800
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
5801
|
+
...primitiveProps,
|
|
5802
|
+
ref: forwardedRef
|
|
5803
|
+
});
|
|
5804
|
+
});
|
|
5805
|
+
Node$1.displayName = `Primitive.${node}`;
|
|
5806
|
+
return {
|
|
5807
|
+
...primitive,
|
|
5808
|
+
[node]: Node$1
|
|
5809
|
+
};
|
|
5810
|
+
}, {});
|
|
5811
|
+
function createContextScope$1(scopeName, createContextScopeDeps = []) {
|
|
5812
|
+
let defaultContexts = [];
|
|
5813
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
5814
|
+
const BaseContext = React$1.createContext(defaultContext);
|
|
5815
|
+
const index$1 = defaultContexts.length;
|
|
5816
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
5817
|
+
const Provider$1 = (props) => {
|
|
5818
|
+
const { scope, children, ...context } = props;
|
|
5819
|
+
const Context = scope?.[scopeName]?.[index$1] || BaseContext;
|
|
5820
|
+
const value = React$1.useMemo(() => context, Object.values(context));
|
|
5821
|
+
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
5822
|
+
value,
|
|
5823
|
+
children
|
|
5824
|
+
});
|
|
5825
|
+
};
|
|
5826
|
+
Provider$1.displayName = rootComponentName + "Provider";
|
|
5827
|
+
function useContext2(consumerName, scope) {
|
|
5828
|
+
const Context = scope?.[scopeName]?.[index$1] || BaseContext;
|
|
5829
|
+
const context = React$1.useContext(Context);
|
|
5830
|
+
if (context) return context;
|
|
5831
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
5832
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
5833
|
+
}
|
|
5834
|
+
return [Provider$1, useContext2];
|
|
5835
|
+
}
|
|
5836
|
+
const createScope$2 = () => {
|
|
5837
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
5838
|
+
return React$1.createContext(defaultContext);
|
|
5839
|
+
});
|
|
5840
|
+
return function useScope(scope) {
|
|
5841
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
5842
|
+
return React$1.useMemo(() => ({ [`__scope${scopeName}`]: {
|
|
5843
|
+
...scope,
|
|
5844
|
+
[scopeName]: contexts
|
|
5845
|
+
} }), [scope, contexts]);
|
|
5846
|
+
};
|
|
5847
|
+
};
|
|
5848
|
+
createScope$2.scopeName = scopeName;
|
|
5849
|
+
return [createContext3, composeContextScopes(createScope$2, ...createContextScopeDeps)];
|
|
5850
|
+
}
|
|
5851
|
+
function composeContextScopes(...scopes) {
|
|
5852
|
+
const baseScope = scopes[0];
|
|
5853
|
+
if (scopes.length === 1) return baseScope;
|
|
5854
|
+
const createScope$2 = () => {
|
|
5855
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
5856
|
+
useScope: createScope2(),
|
|
5857
|
+
scopeName: createScope2.scopeName
|
|
5858
|
+
}));
|
|
5859
|
+
return function useComposedScopes(overrideScopes) {
|
|
5860
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
5861
|
+
const currentScope$2 = useScope(overrideScopes)[`__scope${scopeName}`];
|
|
5862
|
+
return {
|
|
5863
|
+
...nextScopes2,
|
|
5864
|
+
...currentScope$2
|
|
5865
|
+
};
|
|
5866
|
+
}, {});
|
|
5867
|
+
return React$1.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
5868
|
+
};
|
|
5869
|
+
};
|
|
5870
|
+
createScope$2.scopeName = baseScope.scopeName;
|
|
5871
|
+
return createScope$2;
|
|
5872
|
+
}
|
|
5873
|
+
function createCollection(name) {
|
|
5874
|
+
const PROVIDER_NAME = name + "CollectionProvider";
|
|
5875
|
+
const [createCollectionContext, createCollectionScope$1] = createContextScope$1(PROVIDER_NAME);
|
|
5876
|
+
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
5877
|
+
collectionRef: { current: null },
|
|
5878
|
+
itemMap: /* @__PURE__ */ new Map()
|
|
5879
|
+
});
|
|
5880
|
+
const CollectionProvider = (props) => {
|
|
5881
|
+
const { scope, children } = props;
|
|
5882
|
+
const ref = React.useRef(null);
|
|
5883
|
+
const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
|
|
5884
|
+
return /* @__PURE__ */ jsx(CollectionProviderImpl, {
|
|
5885
|
+
scope,
|
|
5886
|
+
itemMap,
|
|
5887
|
+
collectionRef: ref,
|
|
5888
|
+
children
|
|
5889
|
+
});
|
|
5890
|
+
};
|
|
5891
|
+
CollectionProvider.displayName = PROVIDER_NAME;
|
|
5892
|
+
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
5893
|
+
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
5894
|
+
const CollectionSlot = React.forwardRef((props, forwardedRef) => {
|
|
5895
|
+
const { scope, children } = props;
|
|
5896
|
+
return /* @__PURE__ */ jsx(CollectionSlotImpl, {
|
|
5897
|
+
ref: useComposedRefs(forwardedRef, useCollectionContext(COLLECTION_SLOT_NAME, scope).collectionRef),
|
|
5898
|
+
children
|
|
5899
|
+
});
|
|
5900
|
+
});
|
|
5901
|
+
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
5902
|
+
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
5903
|
+
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
5904
|
+
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
5905
|
+
const CollectionItemSlot = React.forwardRef((props, forwardedRef) => {
|
|
5906
|
+
const { scope, children, ...itemData } = props;
|
|
5907
|
+
const ref = React.useRef(null);
|
|
5908
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
5909
|
+
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
5910
|
+
React.useEffect(() => {
|
|
5911
|
+
context.itemMap.set(ref, {
|
|
5912
|
+
ref,
|
|
5913
|
+
...itemData
|
|
5914
|
+
});
|
|
5915
|
+
return () => void context.itemMap.delete(ref);
|
|
5916
|
+
});
|
|
5917
|
+
return /* @__PURE__ */ jsx(CollectionItemSlotImpl, {
|
|
5918
|
+
[ITEM_DATA_ATTR]: "",
|
|
5919
|
+
ref: composedRefs,
|
|
5920
|
+
children
|
|
5921
|
+
});
|
|
5922
|
+
});
|
|
5923
|
+
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
5924
|
+
function useCollection$1(scope) {
|
|
5925
|
+
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
5926
|
+
return React.useCallback(() => {
|
|
5927
|
+
const collectionNode = context.collectionRef.current;
|
|
5928
|
+
if (!collectionNode) return [];
|
|
5929
|
+
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
5930
|
+
return Array.from(context.itemMap.values()).sort((a$1, b$1) => orderedNodes.indexOf(a$1.ref.current) - orderedNodes.indexOf(b$1.ref.current));
|
|
5931
|
+
}, [context.collectionRef, context.itemMap]);
|
|
5932
|
+
}
|
|
5933
|
+
return [
|
|
5934
|
+
{
|
|
5935
|
+
Provider: CollectionProvider,
|
|
5936
|
+
Slot: CollectionSlot,
|
|
5937
|
+
ItemSlot: CollectionItemSlot
|
|
5938
|
+
},
|
|
5939
|
+
useCollection$1,
|
|
5940
|
+
createCollectionScope$1
|
|
5941
|
+
];
|
|
5942
|
+
}
|
|
5943
|
+
var PAGE_KEYS = ["PageUp", "PageDown"];
|
|
5944
|
+
var ARROW_KEYS = [
|
|
5945
|
+
"ArrowUp",
|
|
5946
|
+
"ArrowDown",
|
|
5947
|
+
"ArrowLeft",
|
|
5948
|
+
"ArrowRight"
|
|
5949
|
+
];
|
|
5950
|
+
var BACK_KEYS = {
|
|
5951
|
+
"from-left": [
|
|
5952
|
+
"Home",
|
|
5953
|
+
"PageDown",
|
|
5954
|
+
"ArrowDown",
|
|
5955
|
+
"ArrowLeft"
|
|
5956
|
+
],
|
|
5957
|
+
"from-right": [
|
|
5958
|
+
"Home",
|
|
5959
|
+
"PageDown",
|
|
5960
|
+
"ArrowDown",
|
|
5961
|
+
"ArrowRight"
|
|
5962
|
+
],
|
|
5963
|
+
"from-bottom": [
|
|
5964
|
+
"Home",
|
|
5965
|
+
"PageDown",
|
|
5966
|
+
"ArrowDown",
|
|
5967
|
+
"ArrowLeft"
|
|
5968
|
+
],
|
|
5969
|
+
"from-top": [
|
|
5970
|
+
"Home",
|
|
5971
|
+
"PageDown",
|
|
5972
|
+
"ArrowUp",
|
|
5973
|
+
"ArrowLeft"
|
|
5974
|
+
]
|
|
5975
|
+
};
|
|
5976
|
+
var SLIDER_NAME = "Slider";
|
|
5977
|
+
var [Collection, useCollection, createCollectionScope] = createCollection(SLIDER_NAME);
|
|
5978
|
+
var [createSliderContext, createSliderScope] = createContextScope(SLIDER_NAME, [createCollectionScope]);
|
|
5979
|
+
var [SliderProvider, useSliderContext] = createSliderContext(SLIDER_NAME);
|
|
5980
|
+
var Slider = React$1.forwardRef((props, forwardedRef) => {
|
|
5981
|
+
const { name, min: min$2 = 0, max: max$2 = 100, step = 1, orientation = "horizontal", disabled = false, minStepsBetweenThumbs = 0, defaultValue = [min$2], value, onValueChange = () => {}, onValueCommit = () => {}, inverted = false, form, ...sliderProps } = props;
|
|
5982
|
+
const thumbRefs = React$1.useRef(/* @__PURE__ */ new Set());
|
|
5983
|
+
const valueIndexToChangeRef = React$1.useRef(0);
|
|
5984
|
+
const SliderOrientation = orientation === "horizontal" ? SliderHorizontal : SliderVertical;
|
|
5985
|
+
const [values = [], setValues] = useControllableState({
|
|
5986
|
+
prop: value,
|
|
5987
|
+
defaultProp: defaultValue,
|
|
5988
|
+
onChange: (value2) => {
|
|
5989
|
+
[...thumbRefs.current][valueIndexToChangeRef.current]?.focus();
|
|
5990
|
+
onValueChange(value2);
|
|
5991
|
+
}
|
|
5992
|
+
});
|
|
5993
|
+
const valuesBeforeSlideStartRef = React$1.useRef(values);
|
|
5994
|
+
function handleSlideStart(value2) {
|
|
5995
|
+
updateValues(value2, getClosestValueIndex(values, value2));
|
|
5996
|
+
}
|
|
5997
|
+
function handleSlideMove(value2) {
|
|
5998
|
+
updateValues(value2, valueIndexToChangeRef.current);
|
|
5999
|
+
}
|
|
6000
|
+
function handleSlideEnd() {
|
|
6001
|
+
const prevValue = valuesBeforeSlideStartRef.current[valueIndexToChangeRef.current];
|
|
6002
|
+
if (values[valueIndexToChangeRef.current] !== prevValue) onValueCommit(values);
|
|
6003
|
+
}
|
|
6004
|
+
function updateValues(value2, atIndex, { commit } = { commit: false }) {
|
|
6005
|
+
const decimalCount = getDecimalCount(step);
|
|
6006
|
+
const nextValue = clamp(roundValue(Math.round((value2 - min$2) / step) * step + min$2, decimalCount), [min$2, max$2]);
|
|
6007
|
+
setValues((prevValues = []) => {
|
|
6008
|
+
const nextValues = getNextSortedValues(prevValues, nextValue, atIndex);
|
|
6009
|
+
if (hasMinStepsBetweenValues(nextValues, minStepsBetweenThumbs * step)) {
|
|
6010
|
+
valueIndexToChangeRef.current = nextValues.indexOf(nextValue);
|
|
6011
|
+
const hasChanged = String(nextValues) !== String(prevValues);
|
|
6012
|
+
if (hasChanged && commit) onValueCommit(nextValues);
|
|
6013
|
+
return hasChanged ? nextValues : prevValues;
|
|
6014
|
+
} else return prevValues;
|
|
6015
|
+
});
|
|
6016
|
+
}
|
|
6017
|
+
return /* @__PURE__ */ jsx(SliderProvider, {
|
|
6018
|
+
scope: props.__scopeSlider,
|
|
6019
|
+
name,
|
|
6020
|
+
disabled,
|
|
6021
|
+
min: min$2,
|
|
6022
|
+
max: max$2,
|
|
6023
|
+
valueIndexToChangeRef,
|
|
6024
|
+
thumbs: thumbRefs.current,
|
|
6025
|
+
values,
|
|
6026
|
+
orientation,
|
|
6027
|
+
form,
|
|
6028
|
+
children: /* @__PURE__ */ jsx(Collection.Provider, {
|
|
6029
|
+
scope: props.__scopeSlider,
|
|
6030
|
+
children: /* @__PURE__ */ jsx(Collection.Slot, {
|
|
6031
|
+
scope: props.__scopeSlider,
|
|
6032
|
+
children: /* @__PURE__ */ jsx(SliderOrientation, {
|
|
6033
|
+
"aria-disabled": disabled,
|
|
6034
|
+
"data-disabled": disabled ? "" : void 0,
|
|
6035
|
+
...sliderProps,
|
|
6036
|
+
ref: forwardedRef,
|
|
6037
|
+
onPointerDown: composeEventHandlers(sliderProps.onPointerDown, () => {
|
|
6038
|
+
if (!disabled) valuesBeforeSlideStartRef.current = values;
|
|
6039
|
+
}),
|
|
6040
|
+
min: min$2,
|
|
6041
|
+
max: max$2,
|
|
6042
|
+
inverted,
|
|
6043
|
+
onSlideStart: disabled ? void 0 : handleSlideStart,
|
|
6044
|
+
onSlideMove: disabled ? void 0 : handleSlideMove,
|
|
6045
|
+
onSlideEnd: disabled ? void 0 : handleSlideEnd,
|
|
6046
|
+
onHomeKeyDown: () => !disabled && updateValues(min$2, 0, { commit: true }),
|
|
6047
|
+
onEndKeyDown: () => !disabled && updateValues(max$2, values.length - 1, { commit: true }),
|
|
6048
|
+
onStepKeyDown: ({ event, direction: stepDirection }) => {
|
|
6049
|
+
if (!disabled) {
|
|
6050
|
+
const multiplier = PAGE_KEYS.includes(event.key) || event.shiftKey && ARROW_KEYS.includes(event.key) ? 10 : 1;
|
|
6051
|
+
const atIndex = valueIndexToChangeRef.current;
|
|
6052
|
+
const value2 = values[atIndex];
|
|
6053
|
+
updateValues(value2 + step * multiplier * stepDirection, atIndex, { commit: true });
|
|
6054
|
+
}
|
|
6055
|
+
}
|
|
6056
|
+
})
|
|
6057
|
+
})
|
|
6058
|
+
})
|
|
6059
|
+
});
|
|
6060
|
+
});
|
|
6061
|
+
Slider.displayName = SLIDER_NAME;
|
|
6062
|
+
var [SliderOrientationProvider, useSliderOrientationContext] = createSliderContext(SLIDER_NAME, {
|
|
6063
|
+
startEdge: "left",
|
|
6064
|
+
endEdge: "right",
|
|
6065
|
+
size: "width",
|
|
6066
|
+
direction: 1
|
|
6067
|
+
});
|
|
6068
|
+
var SliderHorizontal = React$1.forwardRef((props, forwardedRef) => {
|
|
6069
|
+
const { min: min$2, max: max$2, dir, inverted, onSlideStart, onSlideMove, onSlideEnd, onStepKeyDown, ...sliderProps } = props;
|
|
6070
|
+
const [slider, setSlider] = React$1.useState(null);
|
|
6071
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setSlider(node));
|
|
6072
|
+
const rectRef = React$1.useRef(void 0);
|
|
6073
|
+
const direction = useDirection(dir);
|
|
6074
|
+
const isDirectionLTR = direction === "ltr";
|
|
6075
|
+
const isSlidingFromLeft = isDirectionLTR && !inverted || !isDirectionLTR && inverted;
|
|
6076
|
+
function getValueFromPointer(pointerPosition) {
|
|
6077
|
+
const rect = rectRef.current || slider.getBoundingClientRect();
|
|
6078
|
+
const value = linearScale([0, rect.width], isSlidingFromLeft ? [min$2, max$2] : [max$2, min$2]);
|
|
6079
|
+
rectRef.current = rect;
|
|
6080
|
+
return value(pointerPosition - rect.left);
|
|
6081
|
+
}
|
|
6082
|
+
return /* @__PURE__ */ jsx(SliderOrientationProvider, {
|
|
6083
|
+
scope: props.__scopeSlider,
|
|
6084
|
+
startEdge: isSlidingFromLeft ? "left" : "right",
|
|
6085
|
+
endEdge: isSlidingFromLeft ? "right" : "left",
|
|
6086
|
+
direction: isSlidingFromLeft ? 1 : -1,
|
|
6087
|
+
size: "width",
|
|
6088
|
+
children: /* @__PURE__ */ jsx(SliderImpl, {
|
|
6089
|
+
dir: direction,
|
|
6090
|
+
"data-orientation": "horizontal",
|
|
6091
|
+
...sliderProps,
|
|
6092
|
+
ref: composedRefs,
|
|
6093
|
+
style: {
|
|
6094
|
+
...sliderProps.style,
|
|
6095
|
+
["--radix-slider-thumb-transform"]: "translateX(-50%)"
|
|
6096
|
+
},
|
|
6097
|
+
onSlideStart: (event) => {
|
|
6098
|
+
const value = getValueFromPointer(event.clientX);
|
|
6099
|
+
onSlideStart?.(value);
|
|
6100
|
+
},
|
|
6101
|
+
onSlideMove: (event) => {
|
|
6102
|
+
const value = getValueFromPointer(event.clientX);
|
|
6103
|
+
onSlideMove?.(value);
|
|
6104
|
+
},
|
|
6105
|
+
onSlideEnd: () => {
|
|
6106
|
+
rectRef.current = void 0;
|
|
6107
|
+
onSlideEnd?.();
|
|
6108
|
+
},
|
|
6109
|
+
onStepKeyDown: (event) => {
|
|
6110
|
+
const isBackKey = BACK_KEYS[isSlidingFromLeft ? "from-left" : "from-right"].includes(event.key);
|
|
6111
|
+
onStepKeyDown?.({
|
|
6112
|
+
event,
|
|
6113
|
+
direction: isBackKey ? -1 : 1
|
|
6114
|
+
});
|
|
6115
|
+
}
|
|
6116
|
+
})
|
|
6117
|
+
});
|
|
6118
|
+
});
|
|
6119
|
+
var SliderVertical = React$1.forwardRef((props, forwardedRef) => {
|
|
6120
|
+
const { min: min$2, max: max$2, inverted, onSlideStart, onSlideMove, onSlideEnd, onStepKeyDown, ...sliderProps } = props;
|
|
6121
|
+
const sliderRef = React$1.useRef(null);
|
|
6122
|
+
const ref = useComposedRefs(forwardedRef, sliderRef);
|
|
6123
|
+
const rectRef = React$1.useRef(void 0);
|
|
6124
|
+
const isSlidingFromBottom = !inverted;
|
|
6125
|
+
function getValueFromPointer(pointerPosition) {
|
|
6126
|
+
const rect = rectRef.current || sliderRef.current.getBoundingClientRect();
|
|
6127
|
+
const value = linearScale([0, rect.height], isSlidingFromBottom ? [max$2, min$2] : [min$2, max$2]);
|
|
6128
|
+
rectRef.current = rect;
|
|
6129
|
+
return value(pointerPosition - rect.top);
|
|
6130
|
+
}
|
|
6131
|
+
return /* @__PURE__ */ jsx(SliderOrientationProvider, {
|
|
6132
|
+
scope: props.__scopeSlider,
|
|
6133
|
+
startEdge: isSlidingFromBottom ? "bottom" : "top",
|
|
6134
|
+
endEdge: isSlidingFromBottom ? "top" : "bottom",
|
|
6135
|
+
size: "height",
|
|
6136
|
+
direction: isSlidingFromBottom ? 1 : -1,
|
|
6137
|
+
children: /* @__PURE__ */ jsx(SliderImpl, {
|
|
6138
|
+
"data-orientation": "vertical",
|
|
6139
|
+
...sliderProps,
|
|
6140
|
+
ref,
|
|
6141
|
+
style: {
|
|
6142
|
+
...sliderProps.style,
|
|
6143
|
+
["--radix-slider-thumb-transform"]: "translateY(50%)"
|
|
6144
|
+
},
|
|
6145
|
+
onSlideStart: (event) => {
|
|
6146
|
+
const value = getValueFromPointer(event.clientY);
|
|
6147
|
+
onSlideStart?.(value);
|
|
6148
|
+
},
|
|
6149
|
+
onSlideMove: (event) => {
|
|
6150
|
+
const value = getValueFromPointer(event.clientY);
|
|
6151
|
+
onSlideMove?.(value);
|
|
6152
|
+
},
|
|
6153
|
+
onSlideEnd: () => {
|
|
6154
|
+
rectRef.current = void 0;
|
|
6155
|
+
onSlideEnd?.();
|
|
6156
|
+
},
|
|
6157
|
+
onStepKeyDown: (event) => {
|
|
6158
|
+
const isBackKey = BACK_KEYS[isSlidingFromBottom ? "from-bottom" : "from-top"].includes(event.key);
|
|
6159
|
+
onStepKeyDown?.({
|
|
6160
|
+
event,
|
|
6161
|
+
direction: isBackKey ? -1 : 1
|
|
6162
|
+
});
|
|
6163
|
+
}
|
|
6164
|
+
})
|
|
6165
|
+
});
|
|
6166
|
+
});
|
|
6167
|
+
var SliderImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
6168
|
+
const { __scopeSlider, onSlideStart, onSlideMove, onSlideEnd, onHomeKeyDown, onEndKeyDown, onStepKeyDown, ...sliderProps } = props;
|
|
6169
|
+
const context = useSliderContext(SLIDER_NAME, __scopeSlider);
|
|
6170
|
+
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
6171
|
+
...sliderProps,
|
|
6172
|
+
ref: forwardedRef,
|
|
6173
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
6174
|
+
if (event.key === "Home") {
|
|
6175
|
+
onHomeKeyDown(event);
|
|
6176
|
+
event.preventDefault();
|
|
6177
|
+
} else if (event.key === "End") {
|
|
6178
|
+
onEndKeyDown(event);
|
|
6179
|
+
event.preventDefault();
|
|
6180
|
+
} else if (PAGE_KEYS.concat(ARROW_KEYS).includes(event.key)) {
|
|
6181
|
+
onStepKeyDown(event);
|
|
6182
|
+
event.preventDefault();
|
|
6183
|
+
}
|
|
6184
|
+
}),
|
|
6185
|
+
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
|
|
6186
|
+
const target = event.target;
|
|
6187
|
+
target.setPointerCapture(event.pointerId);
|
|
6188
|
+
event.preventDefault();
|
|
6189
|
+
if (context.thumbs.has(target)) target.focus();
|
|
6190
|
+
else onSlideStart(event);
|
|
6191
|
+
}),
|
|
6192
|
+
onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {
|
|
6193
|
+
if (event.target.hasPointerCapture(event.pointerId)) onSlideMove(event);
|
|
6194
|
+
}),
|
|
6195
|
+
onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
|
|
6196
|
+
const target = event.target;
|
|
6197
|
+
if (target.hasPointerCapture(event.pointerId)) {
|
|
6198
|
+
target.releasePointerCapture(event.pointerId);
|
|
6199
|
+
onSlideEnd(event);
|
|
6200
|
+
}
|
|
6201
|
+
})
|
|
6202
|
+
});
|
|
6203
|
+
});
|
|
6204
|
+
var TRACK_NAME = "SliderTrack";
|
|
6205
|
+
var SliderTrack = React$1.forwardRef((props, forwardedRef) => {
|
|
6206
|
+
const { __scopeSlider, ...trackProps } = props;
|
|
6207
|
+
const context = useSliderContext(TRACK_NAME, __scopeSlider);
|
|
6208
|
+
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
6209
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
6210
|
+
"data-orientation": context.orientation,
|
|
6211
|
+
...trackProps,
|
|
6212
|
+
ref: forwardedRef
|
|
6213
|
+
});
|
|
6214
|
+
});
|
|
6215
|
+
SliderTrack.displayName = TRACK_NAME;
|
|
6216
|
+
var RANGE_NAME = "SliderRange";
|
|
6217
|
+
var SliderRange = React$1.forwardRef((props, forwardedRef) => {
|
|
6218
|
+
const { __scopeSlider, ...rangeProps } = props;
|
|
6219
|
+
const context = useSliderContext(RANGE_NAME, __scopeSlider);
|
|
6220
|
+
const orientation = useSliderOrientationContext(RANGE_NAME, __scopeSlider);
|
|
6221
|
+
const composedRefs = useComposedRefs(forwardedRef, React$1.useRef(null));
|
|
6222
|
+
const valuesCount = context.values.length;
|
|
6223
|
+
const percentages = context.values.map((value) => convertValueToPercentage(value, context.min, context.max));
|
|
6224
|
+
const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;
|
|
6225
|
+
const offsetEnd = 100 - Math.max(...percentages);
|
|
6226
|
+
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
6227
|
+
"data-orientation": context.orientation,
|
|
6228
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
6229
|
+
...rangeProps,
|
|
6230
|
+
ref: composedRefs,
|
|
6231
|
+
style: {
|
|
6232
|
+
...props.style,
|
|
6233
|
+
[orientation.startEdge]: offsetStart + "%",
|
|
6234
|
+
[orientation.endEdge]: offsetEnd + "%"
|
|
6235
|
+
}
|
|
6236
|
+
});
|
|
6237
|
+
});
|
|
6238
|
+
SliderRange.displayName = RANGE_NAME;
|
|
6239
|
+
var THUMB_NAME = "SliderThumb";
|
|
6240
|
+
var SliderThumb = React$1.forwardRef((props, forwardedRef) => {
|
|
6241
|
+
const getItems = useCollection(props.__scopeSlider);
|
|
6242
|
+
const [thumb, setThumb] = React$1.useState(null);
|
|
6243
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node));
|
|
6244
|
+
const index$1 = React$1.useMemo(() => thumb ? getItems().findIndex((item) => item.ref.current === thumb) : -1, [getItems, thumb]);
|
|
6245
|
+
return /* @__PURE__ */ jsx(SliderThumbImpl, {
|
|
6246
|
+
...props,
|
|
6247
|
+
ref: composedRefs,
|
|
6248
|
+
index: index$1
|
|
6249
|
+
});
|
|
6250
|
+
});
|
|
6251
|
+
var SliderThumbImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
6252
|
+
const { __scopeSlider, index: index$1, name, ...thumbProps } = props;
|
|
6253
|
+
const context = useSliderContext(THUMB_NAME, __scopeSlider);
|
|
6254
|
+
const orientation = useSliderOrientationContext(THUMB_NAME, __scopeSlider);
|
|
6255
|
+
const [thumb, setThumb] = React$1.useState(null);
|
|
6256
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node));
|
|
6257
|
+
const isFormControl = thumb ? context.form || !!thumb.closest("form") : true;
|
|
6258
|
+
const size$3 = useSize(thumb);
|
|
6259
|
+
const value = context.values[index$1];
|
|
6260
|
+
const percent = value === void 0 ? 0 : convertValueToPercentage(value, context.min, context.max);
|
|
6261
|
+
const label = getLabel$1(index$1, context.values.length);
|
|
6262
|
+
const orientationSize = size$3?.[orientation.size];
|
|
6263
|
+
const thumbInBoundsOffset = orientationSize ? getThumbInBoundsOffset(orientationSize, percent, orientation.direction) : 0;
|
|
6264
|
+
React$1.useEffect(() => {
|
|
6265
|
+
if (thumb) {
|
|
6266
|
+
context.thumbs.add(thumb);
|
|
6267
|
+
return () => {
|
|
6268
|
+
context.thumbs.delete(thumb);
|
|
6269
|
+
};
|
|
6270
|
+
}
|
|
6271
|
+
}, [thumb, context.thumbs]);
|
|
6272
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
6273
|
+
style: {
|
|
6274
|
+
transform: "var(--radix-slider-thumb-transform)",
|
|
6275
|
+
position: "absolute",
|
|
6276
|
+
[orientation.startEdge]: `calc(${percent}% + ${thumbInBoundsOffset}px)`
|
|
6277
|
+
},
|
|
6278
|
+
children: [/* @__PURE__ */ jsx(Collection.ItemSlot, {
|
|
6279
|
+
scope: props.__scopeSlider,
|
|
6280
|
+
children: /* @__PURE__ */ jsx(Primitive.span, {
|
|
6281
|
+
role: "slider",
|
|
6282
|
+
"aria-label": props["aria-label"] || label,
|
|
6283
|
+
"aria-valuemin": context.min,
|
|
6284
|
+
"aria-valuenow": value,
|
|
6285
|
+
"aria-valuemax": context.max,
|
|
6286
|
+
"aria-orientation": context.orientation,
|
|
6287
|
+
"data-orientation": context.orientation,
|
|
6288
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
6289
|
+
tabIndex: context.disabled ? void 0 : 0,
|
|
6290
|
+
...thumbProps,
|
|
6291
|
+
ref: composedRefs,
|
|
6292
|
+
style: value === void 0 ? { display: "none" } : props.style,
|
|
6293
|
+
onFocus: composeEventHandlers(props.onFocus, () => {
|
|
6294
|
+
context.valueIndexToChangeRef.current = index$1;
|
|
6295
|
+
})
|
|
6296
|
+
})
|
|
6297
|
+
}), isFormControl && /* @__PURE__ */ jsx(SliderBubbleInput, {
|
|
6298
|
+
name: name ?? (context.name ? context.name + (context.values.length > 1 ? "[]" : "") : void 0),
|
|
6299
|
+
form: context.form,
|
|
6300
|
+
value
|
|
6301
|
+
}, index$1)]
|
|
6302
|
+
});
|
|
6303
|
+
});
|
|
6304
|
+
SliderThumb.displayName = THUMB_NAME;
|
|
6305
|
+
var BUBBLE_INPUT_NAME = "RadioBubbleInput";
|
|
6306
|
+
var SliderBubbleInput = React$1.forwardRef(({ __scopeSlider, value, ...props }, forwardedRef) => {
|
|
6307
|
+
const ref = React$1.useRef(null);
|
|
6308
|
+
const composedRefs = useComposedRefs(ref, forwardedRef);
|
|
6309
|
+
const prevValue = usePrevious(value);
|
|
6310
|
+
React$1.useEffect(() => {
|
|
6311
|
+
const input = ref.current;
|
|
6312
|
+
if (!input) return;
|
|
6313
|
+
const inputProto = window.HTMLInputElement.prototype;
|
|
6314
|
+
const setValue = Object.getOwnPropertyDescriptor(inputProto, "value").set;
|
|
6315
|
+
if (prevValue !== value && setValue) {
|
|
6316
|
+
const event = new Event("input", { bubbles: true });
|
|
6317
|
+
setValue.call(input, value);
|
|
6318
|
+
input.dispatchEvent(event);
|
|
6319
|
+
}
|
|
6320
|
+
}, [prevValue, value]);
|
|
6321
|
+
return /* @__PURE__ */ jsx(Primitive.input, {
|
|
6322
|
+
style: { display: "none" },
|
|
6323
|
+
...props,
|
|
6324
|
+
ref: composedRefs,
|
|
6325
|
+
defaultValue: value
|
|
6326
|
+
});
|
|
6327
|
+
});
|
|
6328
|
+
SliderBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
|
6329
|
+
function getNextSortedValues(prevValues = [], nextValue, atIndex) {
|
|
6330
|
+
const nextValues = [...prevValues];
|
|
6331
|
+
nextValues[atIndex] = nextValue;
|
|
6332
|
+
return nextValues.sort((a$1, b$1) => a$1 - b$1);
|
|
6333
|
+
}
|
|
6334
|
+
function convertValueToPercentage(value, min$2, max$2) {
|
|
6335
|
+
return clamp(100 / (max$2 - min$2) * (value - min$2), [0, 100]);
|
|
6336
|
+
}
|
|
6337
|
+
function getLabel$1(index$1, totalValues) {
|
|
6338
|
+
if (totalValues > 2) return `Value ${index$1 + 1} of ${totalValues}`;
|
|
6339
|
+
else if (totalValues === 2) return ["Minimum", "Maximum"][index$1];
|
|
6340
|
+
else return;
|
|
6341
|
+
}
|
|
6342
|
+
function getClosestValueIndex(values, nextValue) {
|
|
6343
|
+
if (values.length === 1) return 0;
|
|
6344
|
+
const distances = values.map((value) => Math.abs(value - nextValue));
|
|
6345
|
+
const closestDistance = Math.min(...distances);
|
|
6346
|
+
return distances.indexOf(closestDistance);
|
|
6347
|
+
}
|
|
6348
|
+
function getThumbInBoundsOffset(width, left, direction) {
|
|
6349
|
+
const halfWidth = width / 2;
|
|
6350
|
+
return (halfWidth - linearScale([0, 50], [0, halfWidth])(left) * direction) * direction;
|
|
6351
|
+
}
|
|
6352
|
+
function getStepsBetweenValues(values) {
|
|
6353
|
+
return values.slice(0, -1).map((value, index$1) => values[index$1 + 1] - value);
|
|
6354
|
+
}
|
|
6355
|
+
function hasMinStepsBetweenValues(values, minStepsBetweenValues) {
|
|
6356
|
+
if (minStepsBetweenValues > 0) {
|
|
6357
|
+
const stepsBetweenValues = getStepsBetweenValues(values);
|
|
6358
|
+
return Math.min(...stepsBetweenValues) >= minStepsBetweenValues;
|
|
6359
|
+
}
|
|
6360
|
+
return true;
|
|
6361
|
+
}
|
|
6362
|
+
function linearScale(input, output) {
|
|
6363
|
+
return (value) => {
|
|
6364
|
+
if (input[0] === input[1] || output[0] === output[1]) return output[0];
|
|
6365
|
+
const ratio = (output[1] - output[0]) / (input[1] - input[0]);
|
|
6366
|
+
return output[0] + ratio * (value - input[0]);
|
|
6367
|
+
};
|
|
6368
|
+
}
|
|
6369
|
+
function getDecimalCount(value) {
|
|
6370
|
+
return (String(value).split(".")[1] || "").length;
|
|
6371
|
+
}
|
|
6372
|
+
function roundValue(value, decimalCount) {
|
|
6373
|
+
const rounder = Math.pow(10, decimalCount);
|
|
6374
|
+
return Math.round(value * rounder) / rounder;
|
|
6375
|
+
}
|
|
6376
|
+
var Root = Slider;
|
|
6377
|
+
var Track = SliderTrack;
|
|
6378
|
+
var Range = SliderRange;
|
|
6379
|
+
var Thumb = SliderThumb;
|
|
6380
|
+
const SliderGlass = forwardRef(({ className, value, defaultValue, onValueChange, onValueCommit, min: min$2 = 0, max: max$2 = 100, step = 1, showValue, label, error, success, disabled, orientation = "horizontal", ...props }, ref) => {
|
|
6381
|
+
const currentValue = value ?? defaultValue ?? [min$2];
|
|
6382
|
+
const formatValueDisplay = (values) => {
|
|
6383
|
+
if (values.length === 1) return `${values[0]}`;
|
|
6384
|
+
return `${values[0]} - ${values[values.length - 1]}`;
|
|
5695
6385
|
};
|
|
6386
|
+
const trackStyles = { background: "var(--slider-track)" };
|
|
6387
|
+
const rangeStyles = { background: "var(--slider-fill)" };
|
|
5696
6388
|
const thumbStyles = {
|
|
5697
|
-
left: `calc(${percentage}% - 10px)`,
|
|
5698
6389
|
background: "var(--slider-thumb)",
|
|
5699
|
-
border: "2px solid var(--slider-thumb-border)"
|
|
5700
|
-
boxShadow: isFocusVisible ? "var(--focus-glow)" : isHovered || isDragging ? "var(--slider-thumb-glow)" : "var(--slider-thumb-shadow)",
|
|
5701
|
-
transform: isDragging ? "scale(1.15)" : isHovered ? "scale(1.05)" : "scale(1)"
|
|
6390
|
+
border: "2px solid var(--slider-thumb-border)"
|
|
5702
6391
|
};
|
|
5703
6392
|
const customLabel = label && showValue || !label && showValue ? /* @__PURE__ */ jsxs("div", {
|
|
5704
6393
|
className: "flex justify-between mb-1.5 md:mb-2",
|
|
@@ -5709,7 +6398,7 @@ const SliderGlass = forwardRef(({ className, value, onChange, min: min$2 = 0, ma
|
|
|
5709
6398
|
}), /* @__PURE__ */ jsx("span", {
|
|
5710
6399
|
className: "text-xs md:text-sm font-medium tabular-nums",
|
|
5711
6400
|
style: { color: "var(--text-secondary)" },
|
|
5712
|
-
children:
|
|
6401
|
+
children: formatValueDisplay(currentValue)
|
|
5713
6402
|
})]
|
|
5714
6403
|
}) : void 0;
|
|
5715
6404
|
return /* @__PURE__ */ jsxs(FormFieldWrapper, {
|
|
@@ -5717,48 +6406,31 @@ const SliderGlass = forwardRef(({ className, value, onChange, min: min$2 = 0, ma
|
|
|
5717
6406
|
error,
|
|
5718
6407
|
success,
|
|
5719
6408
|
className: cn("w-full", className),
|
|
5720
|
-
children: [customLabel, /* @__PURE__ */ jsxs(
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
onMouseUp: () => setIsDragging(false),
|
|
5740
|
-
onTouchStart: () => setIsDragging(true),
|
|
5741
|
-
onTouchEnd: () => setIsDragging(false),
|
|
5742
|
-
onFocus: focusProps.onFocus,
|
|
5743
|
-
onBlur: focusProps.onBlur,
|
|
5744
|
-
min: min$2,
|
|
5745
|
-
max: max$2,
|
|
5746
|
-
step,
|
|
5747
|
-
disabled,
|
|
5748
|
-
"aria-label": label || `Slider: ${value} (${min$2}-${max$2})`,
|
|
5749
|
-
"aria-valuemin": min$2,
|
|
5750
|
-
"aria-valuemax": max$2,
|
|
5751
|
-
"aria-valuenow": value,
|
|
5752
|
-
"aria-valuetext": `${value}`,
|
|
5753
|
-
className: "absolute w-full h-8 md:h-6 opacity-0 cursor-pointer disabled:cursor-not-allowed z-10",
|
|
5754
|
-
style: { outline: "none" },
|
|
5755
|
-
...props
|
|
5756
|
-
}),
|
|
5757
|
-
/* @__PURE__ */ jsx("div", {
|
|
5758
|
-
className: "absolute w-6 h-6 md:w-5 md:h-5 rounded-full transition-all duration-150 pointer-events-none",
|
|
5759
|
-
style: thumbStyles
|
|
6409
|
+
children: [customLabel, /* @__PURE__ */ jsxs(Root, {
|
|
6410
|
+
ref,
|
|
6411
|
+
value,
|
|
6412
|
+
defaultValue,
|
|
6413
|
+
onValueChange,
|
|
6414
|
+
onValueCommit,
|
|
6415
|
+
min: min$2,
|
|
6416
|
+
max: max$2,
|
|
6417
|
+
step,
|
|
6418
|
+
disabled,
|
|
6419
|
+
orientation,
|
|
6420
|
+
className: cn("relative flex touch-none select-none", orientation === "horizontal" ? "w-full h-8 md:h-6 items-center" : "flex-col h-full w-8 md:w-6 justify-center", disabled && "opacity-50 cursor-not-allowed", "group"),
|
|
6421
|
+
...props,
|
|
6422
|
+
children: [/* @__PURE__ */ jsx(Track, {
|
|
6423
|
+
className: cn("relative grow rounded-full", orientation === "horizontal" ? "h-2.5 md:h-2 w-full" : "w-2.5 md:w-2 h-full"),
|
|
6424
|
+
style: trackStyles,
|
|
6425
|
+
children: /* @__PURE__ */ jsx(Range, {
|
|
6426
|
+
className: cn("absolute rounded-full transition-shadow duration-150", orientation === "horizontal" ? "h-full" : "w-full", "group-hover:shadow-(--slider-fill-glow)", "group-active:shadow-(--slider-fill-glow)"),
|
|
6427
|
+
style: rangeStyles
|
|
5760
6428
|
})
|
|
5761
|
-
|
|
6429
|
+
}), currentValue.map((_, index$1) => /* @__PURE__ */ jsx(Thumb, {
|
|
6430
|
+
className: cn("block rounded-full shadow-md transition-all duration-150", "w-6 h-6 md:w-5 md:h-5", "hover:scale-105", "focus-visible:outline-none focus-visible:shadow-(--focus-glow)", "active:scale-110", disabled && "pointer-events-none"),
|
|
6431
|
+
style: thumbStyles,
|
|
6432
|
+
"aria-label": label ? currentValue.length > 1 ? `${label} thumb ${index$1 + 1}` : label : `Slider thumb ${index$1 + 1}`
|
|
6433
|
+
}, index$1))]
|
|
5762
6434
|
})]
|
|
5763
6435
|
});
|
|
5764
6436
|
});
|
|
@@ -5875,12 +6547,21 @@ const TabsGlass = {
|
|
|
5875
6547
|
Content: TabsContent
|
|
5876
6548
|
};
|
|
5877
6549
|
const toggleSizes = cva("relative rounded-full transition-all duration-300", {
|
|
5878
|
-
variants: {
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
6550
|
+
variants: {
|
|
6551
|
+
size: {
|
|
6552
|
+
sm: "w-8 h-4",
|
|
6553
|
+
default: "w-11 h-6",
|
|
6554
|
+
lg: "w-14 h-7"
|
|
6555
|
+
},
|
|
6556
|
+
variant: {
|
|
6557
|
+
default: "",
|
|
6558
|
+
outline: "border-2"
|
|
6559
|
+
}
|
|
6560
|
+
},
|
|
6561
|
+
defaultVariants: {
|
|
6562
|
+
size: "default",
|
|
6563
|
+
variant: "default"
|
|
6564
|
+
}
|
|
5884
6565
|
});
|
|
5885
6566
|
var sizesConfig = {
|
|
5886
6567
|
sm: {
|
|
@@ -5888,7 +6569,7 @@ var sizesConfig = {
|
|
|
5888
6569
|
knob: "w-3 h-3",
|
|
5889
6570
|
translate: "translate-x-4"
|
|
5890
6571
|
},
|
|
5891
|
-
|
|
6572
|
+
default: {
|
|
5892
6573
|
track: "w-11 h-6",
|
|
5893
6574
|
knob: "w-5 h-5",
|
|
5894
6575
|
translate: "translate-x-5"
|
|
@@ -5899,12 +6580,28 @@ var sizesConfig = {
|
|
|
5899
6580
|
translate: "translate-x-7"
|
|
5900
6581
|
}
|
|
5901
6582
|
};
|
|
5902
|
-
const ToggleGlass = forwardRef(({ className, size: size$3 = "
|
|
6583
|
+
const ToggleGlass = forwardRef(({ className, size: size$3 = "default", variant = "default", pressed: controlledPressed, defaultPressed = false, onPressedChange, disabled, label, ...props }, ref) => {
|
|
6584
|
+
const [uncontrolledPressed, setUncontrolledPressed] = useState(defaultPressed);
|
|
6585
|
+
const isControlled = controlledPressed !== void 0;
|
|
6586
|
+
const isPressed = isControlled ? controlledPressed : uncontrolledPressed;
|
|
5903
6587
|
const { isFocusVisible, focusProps } = useFocus({ focusVisible: true });
|
|
5904
|
-
const s$1 = sizesConfig[size$3 ?? "
|
|
5905
|
-
const
|
|
5906
|
-
|
|
5907
|
-
|
|
6588
|
+
const s$1 = sizesConfig[size$3 ?? "default"];
|
|
6589
|
+
const handleToggle = () => {
|
|
6590
|
+
if (disabled) return;
|
|
6591
|
+
const newValue = !isPressed;
|
|
6592
|
+
if (!isControlled) setUncontrolledPressed(newValue);
|
|
6593
|
+
onPressedChange?.(newValue);
|
|
6594
|
+
};
|
|
6595
|
+
const getTrackStyles = () => {
|
|
6596
|
+
if (variant === "outline") return {
|
|
6597
|
+
background: isPressed ? "var(--toggle-outline-active-bg)" : "transparent",
|
|
6598
|
+
borderColor: isPressed ? "var(--toggle-outline-active-border)" : "var(--toggle-outline-border)",
|
|
6599
|
+
boxShadow: isFocusVisible && !disabled ? "var(--focus-glow)" : "none"
|
|
6600
|
+
};
|
|
6601
|
+
return {
|
|
6602
|
+
background: isPressed ? "var(--toggle-active-bg)" : "var(--toggle-bg)",
|
|
6603
|
+
boxShadow: isFocusVisible && !disabled ? "var(--focus-glow)" : isPressed ? "var(--toggle-glow)" : "none"
|
|
6604
|
+
};
|
|
5908
6605
|
};
|
|
5909
6606
|
const knobStyles = { background: "var(--toggle-knob)" };
|
|
5910
6607
|
const toggle = /* @__PURE__ */ jsx("span", {
|
|
@@ -5913,17 +6610,20 @@ const ToggleGlass = forwardRef(({ className, size: size$3 = "md", checked, onCha
|
|
|
5913
6610
|
ref,
|
|
5914
6611
|
type: "button",
|
|
5915
6612
|
role: "switch",
|
|
5916
|
-
"aria-
|
|
6613
|
+
"aria-pressed": isPressed,
|
|
5917
6614
|
"aria-label": label || "Toggle switch",
|
|
5918
6615
|
disabled,
|
|
5919
|
-
className: cn(toggleSizes({
|
|
5920
|
-
|
|
5921
|
-
|
|
6616
|
+
className: cn(toggleSizes({
|
|
6617
|
+
size: size$3,
|
|
6618
|
+
variant
|
|
6619
|
+
}), disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer", !label && className),
|
|
6620
|
+
style: getTrackStyles(),
|
|
6621
|
+
onClick: handleToggle,
|
|
5922
6622
|
onFocus: focusProps.onFocus,
|
|
5923
6623
|
onBlur: focusProps.onBlur,
|
|
5924
6624
|
...props,
|
|
5925
6625
|
children: /* @__PURE__ */ jsx("div", {
|
|
5926
|
-
className: cn("absolute top-0.5 left-0.5 rounded-full shadow-md transition-all duration-300", s$1.knob,
|
|
6626
|
+
className: cn("absolute top-0.5 left-0.5 rounded-full shadow-md transition-all duration-300", s$1.knob, isPressed && s$1.translate),
|
|
5927
6627
|
style: knobStyles
|
|
5928
6628
|
})
|
|
5929
6629
|
})
|
|
@@ -5947,7 +6647,7 @@ var TooltipGlassProvider = ({ delayDuration = 0, ...props }) => {
|
|
|
5947
6647
|
};
|
|
5948
6648
|
var TooltipGlassRoot = TooltipPrimitive.Root;
|
|
5949
6649
|
var TooltipGlassTrigger = TooltipPrimitive.Trigger;
|
|
5950
|
-
var TooltipGlassContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
6650
|
+
var TooltipGlassContent = React$1.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
5951
6651
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Content, {
|
|
5952
6652
|
ref,
|
|
5953
6653
|
sideOffset,
|
|
@@ -6247,13 +6947,13 @@ var fieldLabels = {
|
|
|
6247
6947
|
name: "Name",
|
|
6248
6948
|
contribution: "Contribution"
|
|
6249
6949
|
};
|
|
6250
|
-
const SortDropdownGlass = React.forwardRef(({ sortBy: sortBy$5, sortOrder, onSortChange, options: options$1 = [
|
|
6950
|
+
const SortDropdownGlass = React$1.forwardRef(({ sortBy: sortBy$5, sortOrder, onSortChange, options: options$1 = [
|
|
6251
6951
|
"commits",
|
|
6252
6952
|
"stars",
|
|
6253
6953
|
"name",
|
|
6254
6954
|
"contribution"
|
|
6255
6955
|
], compact = false, className, ...props }, ref) => {
|
|
6256
|
-
const handleFieldSelect = React.useCallback((field) => {
|
|
6956
|
+
const handleFieldSelect = React$1.useCallback((field) => {
|
|
6257
6957
|
if (field === sortBy$5) onSortChange(field, sortOrder === "asc" ? "desc" : "asc");
|
|
6258
6958
|
else onSortChange(field, "desc");
|
|
6259
6959
|
}, [
|
|
@@ -7316,14 +8016,14 @@ var Surface = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
|
7316
8016
|
y: 0
|
|
7317
8017
|
};
|
|
7318
8018
|
var layerClass = clsx("recharts-surface", className);
|
|
7319
|
-
return /* @__PURE__ */ React.createElement("svg", _extends$18({}, svgPropertiesAndEvents(others), {
|
|
8019
|
+
return /* @__PURE__ */ React$1.createElement("svg", _extends$18({}, svgPropertiesAndEvents(others), {
|
|
7320
8020
|
className: layerClass,
|
|
7321
8021
|
width,
|
|
7322
8022
|
height,
|
|
7323
8023
|
style,
|
|
7324
8024
|
viewBox: "".concat(svgView.x, " ").concat(svgView.y, " ").concat(svgView.width, " ").concat(svgView.height),
|
|
7325
8025
|
ref
|
|
7326
|
-
}), /* @__PURE__ */ React.createElement("title", null, title), /* @__PURE__ */ React.createElement("desc", null, desc), children);
|
|
8026
|
+
}), /* @__PURE__ */ React$1.createElement("title", null, title), /* @__PURE__ */ React$1.createElement("desc", null, desc), children);
|
|
7327
8027
|
});
|
|
7328
8028
|
var _excluded$13 = ["children", "className"];
|
|
7329
8029
|
function _extends$17() {
|
|
@@ -7353,10 +8053,10 @@ function _objectWithoutPropertiesLoose$13(r$1, e$1) {
|
|
|
7353
8053
|
}
|
|
7354
8054
|
return t;
|
|
7355
8055
|
}
|
|
7356
|
-
var Layer = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
8056
|
+
var Layer = /* @__PURE__ */ React$1.forwardRef((props, ref) => {
|
|
7357
8057
|
var { children, className } = props, others = _objectWithoutProperties$13(props, _excluded$13);
|
|
7358
8058
|
var layerClass = clsx("recharts-layer", className);
|
|
7359
|
-
return /* @__PURE__ */ React.createElement("g", _extends$17({ className: layerClass }, svgPropertiesAndEvents(others), { ref }), children);
|
|
8059
|
+
return /* @__PURE__ */ React$1.createElement("g", _extends$17({ className: layerClass }, svgPropertiesAndEvents(others), { ref }), children);
|
|
7360
8060
|
});
|
|
7361
8061
|
var LegendPortalContext = /* @__PURE__ */ createContext(null);
|
|
7362
8062
|
var useLegendPortal = () => useContext(LegendPortalContext);
|
|
@@ -8510,7 +9210,7 @@ var Symbols = (_ref$1) => {
|
|
|
8510
9210
|
};
|
|
8511
9211
|
var { className, cx, cy } = props;
|
|
8512
9212
|
var filteredProps = svgPropertiesAndEvents(props);
|
|
8513
|
-
if (isNumber(cx) && isNumber(cy) && isNumber(size$3)) return /* @__PURE__ */ React.createElement("path", _extends$16({}, filteredProps, {
|
|
9213
|
+
if (isNumber(cx) && isNumber(cy) && isNumber(size$3)) return /* @__PURE__ */ React$1.createElement("path", _extends$16({}, filteredProps, {
|
|
8514
9214
|
className: clsx("recharts-symbols", className),
|
|
8515
9215
|
transform: "translate(".concat(cx, ", ").concat(cy, ")"),
|
|
8516
9216
|
d: getPath$2()
|
|
@@ -9171,11 +9871,11 @@ function getUniqPayload(payload, option, defaultUniqBy$1) {
|
|
|
9171
9871
|
* LICENSE file in the root directory of this source tree.
|
|
9172
9872
|
*/
|
|
9173
9873
|
var require_use_sync_external_store_shim_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
9174
|
-
var React$
|
|
9874
|
+
var React$4 = __require("react");
|
|
9175
9875
|
function is$5(x$2, y$2) {
|
|
9176
9876
|
return x$2 === y$2 && (0 !== x$2 || 1 / x$2 === 1 / y$2) || x$2 !== x$2 && y$2 !== y$2;
|
|
9177
9877
|
}
|
|
9178
|
-
var objectIs$2 = "function" === typeof Object.is ? Object.is : is$5, useState$1 = React$
|
|
9878
|
+
var objectIs$2 = "function" === typeof Object.is ? Object.is : is$5, useState$1 = React$4.useState, useEffect$3 = React$4.useEffect, useLayoutEffect$1 = React$4.useLayoutEffect, useDebugValue$2 = React$4.useDebugValue;
|
|
9179
9879
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
9180
9880
|
var value = getSnapshot(), _useState = useState$1({ inst: {
|
|
9181
9881
|
value,
|
|
@@ -9213,7 +9913,7 @@ var require_use_sync_external_store_shim_production = /* @__PURE__ */ __commonJS
|
|
|
9213
9913
|
return getSnapshot();
|
|
9214
9914
|
}
|
|
9215
9915
|
var shim$1 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1$1 : useSyncExternalStore$2;
|
|
9216
|
-
exports.useSyncExternalStore = void 0 !== React$
|
|
9916
|
+
exports.useSyncExternalStore = void 0 !== React$4.useSyncExternalStore ? React$4.useSyncExternalStore : shim$1;
|
|
9217
9917
|
}));
|
|
9218
9918
|
/**
|
|
9219
9919
|
* @license React
|
|
@@ -9292,11 +9992,11 @@ var require_shim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9292
9992
|
* LICENSE file in the root directory of this source tree.
|
|
9293
9993
|
*/
|
|
9294
9994
|
var require_with_selector_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
9295
|
-
var React$
|
|
9995
|
+
var React$3 = __require("react"), shim = require_shim();
|
|
9296
9996
|
function is$4(x$2, y$2) {
|
|
9297
9997
|
return x$2 === y$2 && (0 !== x$2 || 1 / x$2 === 1 / y$2) || x$2 !== x$2 && y$2 !== y$2;
|
|
9298
9998
|
}
|
|
9299
|
-
var objectIs$1 = "function" === typeof Object.is ? Object.is : is$4, useSyncExternalStore$1 = shim.useSyncExternalStore, useRef$2 = React$
|
|
9999
|
+
var objectIs$1 = "function" === typeof Object.is ? Object.is : is$4, useSyncExternalStore$1 = shim.useSyncExternalStore, useRef$2 = React$3.useRef, useEffect$2 = React$3.useEffect, useMemo$2 = React$3.useMemo, useDebugValue$1 = React$3.useDebugValue;
|
|
9300
10000
|
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
9301
10001
|
var instRef = useRef$2(null);
|
|
9302
10002
|
if (null === instRef.current) {
|
|
@@ -12333,7 +13033,7 @@ function ResponsiveContainerContextProvider(_ref$1) {
|
|
|
12333
13033
|
height
|
|
12334
13034
|
}), [width, height]);
|
|
12335
13035
|
if (!isAcceptableSize(size$3)) return null;
|
|
12336
|
-
return /* @__PURE__ */ React.createElement(ResponsiveContainerContext.Provider, { value: size$3 }, children);
|
|
13036
|
+
return /* @__PURE__ */ React$1.createElement(ResponsiveContainerContext.Provider, { value: size$3 }, children);
|
|
12337
13037
|
}
|
|
12338
13038
|
var useResponsiveContainerContext = () => useContext(ResponsiveContainerContext);
|
|
12339
13039
|
var SizeDetectorContainer = /* @__PURE__ */ forwardRef((_ref2, ref) => {
|
|
@@ -12389,7 +13089,7 @@ var SizeDetectorContainer = /* @__PURE__ */ forwardRef((_ref2, ref) => {
|
|
|
12389
13089
|
maxHeight
|
|
12390
13090
|
});
|
|
12391
13091
|
warn(calculatedWidth != null && calculatedWidth > 0 || calculatedHeight != null && calculatedHeight > 0, "The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.", calculatedWidth, calculatedHeight, width, height, minWidth, minHeight, aspect);
|
|
12392
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
13092
|
+
return /* @__PURE__ */ React$1.createElement("div", {
|
|
12393
13093
|
id: id ? "".concat(id) : void 0,
|
|
12394
13094
|
className: clsx("recharts-responsive-container", className),
|
|
12395
13095
|
style: _objectSpread$26(_objectSpread$26({}, style), {}, {
|
|
@@ -12400,10 +13100,10 @@ var SizeDetectorContainer = /* @__PURE__ */ forwardRef((_ref2, ref) => {
|
|
|
12400
13100
|
maxHeight
|
|
12401
13101
|
}),
|
|
12402
13102
|
ref: containerRef
|
|
12403
|
-
}, /* @__PURE__ */ React.createElement("div", { style: getInnerDivStyle({
|
|
13103
|
+
}, /* @__PURE__ */ React$1.createElement("div", { style: getInnerDivStyle({
|
|
12404
13104
|
width,
|
|
12405
13105
|
height
|
|
12406
|
-
}) }, /* @__PURE__ */ React.createElement(ResponsiveContainerContextProvider, {
|
|
13106
|
+
}) }, /* @__PURE__ */ React$1.createElement(ResponsiveContainerContextProvider, {
|
|
12407
13107
|
width: calculatedWidth,
|
|
12408
13108
|
height: calculatedHeight
|
|
12409
13109
|
}, children)));
|
|
@@ -12422,11 +13122,11 @@ var ResponsiveContainer = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
|
12422
13122
|
aspect: props.aspect,
|
|
12423
13123
|
maxHeight: props.maxHeight
|
|
12424
13124
|
});
|
|
12425
|
-
if (isNumber(calculatedWidth) && isNumber(calculatedHeight)) return /* @__PURE__ */ React.createElement(ResponsiveContainerContextProvider, {
|
|
13125
|
+
if (isNumber(calculatedWidth) && isNumber(calculatedHeight)) return /* @__PURE__ */ React$1.createElement(ResponsiveContainerContextProvider, {
|
|
12426
13126
|
width: calculatedWidth,
|
|
12427
13127
|
height: calculatedHeight
|
|
12428
13128
|
}, props.children);
|
|
12429
|
-
return /* @__PURE__ */ React.createElement(SizeDetectorContainer, _extends$15({}, props, {
|
|
13129
|
+
return /* @__PURE__ */ React$1.createElement(SizeDetectorContainer, _extends$15({}, props, {
|
|
12430
13130
|
width,
|
|
12431
13131
|
height,
|
|
12432
13132
|
ref
|
|
@@ -13172,13 +13872,13 @@ var DefaultTooltipContent = (props) => {
|
|
|
13172
13872
|
paddingBottom: 4,
|
|
13173
13873
|
color: entry.color || "#000"
|
|
13174
13874
|
}, itemStyle);
|
|
13175
|
-
return /* @__PURE__ */ React.createElement("li", {
|
|
13875
|
+
return /* @__PURE__ */ React$1.createElement("li", {
|
|
13176
13876
|
className: "recharts-tooltip-item",
|
|
13177
13877
|
key: "tooltip-item-".concat(i),
|
|
13178
13878
|
style: finalItemStyle
|
|
13179
|
-
}, isNumOrStr(finalName) ? /* @__PURE__ */ React.createElement("span", { className: "recharts-tooltip-item-name" }, finalName) : null, isNumOrStr(finalName) ? /* @__PURE__ */ React.createElement("span", { className: "recharts-tooltip-item-separator" }, separator) : null, /* @__PURE__ */ React.createElement("span", { className: "recharts-tooltip-item-value" }, finalValue), /* @__PURE__ */ React.createElement("span", { className: "recharts-tooltip-item-unit" }, entry.unit || ""));
|
|
13879
|
+
}, isNumOrStr(finalName) ? /* @__PURE__ */ React$1.createElement("span", { className: "recharts-tooltip-item-name" }, finalName) : null, isNumOrStr(finalName) ? /* @__PURE__ */ React$1.createElement("span", { className: "recharts-tooltip-item-separator" }, separator) : null, /* @__PURE__ */ React$1.createElement("span", { className: "recharts-tooltip-item-value" }, finalValue), /* @__PURE__ */ React$1.createElement("span", { className: "recharts-tooltip-item-unit" }, entry.unit || ""));
|
|
13180
13880
|
});
|
|
13181
|
-
return /* @__PURE__ */ React.createElement("ul", {
|
|
13881
|
+
return /* @__PURE__ */ React$1.createElement("ul", {
|
|
13182
13882
|
className: "recharts-tooltip-item-list",
|
|
13183
13883
|
style: listStyle
|
|
13184
13884
|
}, items);
|
|
@@ -13202,13 +13902,13 @@ var DefaultTooltipContent = (props) => {
|
|
|
13202
13902
|
role: "status",
|
|
13203
13903
|
"aria-live": "assertive"
|
|
13204
13904
|
} : {};
|
|
13205
|
-
return /* @__PURE__ */ React.createElement("div", _extends$14({
|
|
13905
|
+
return /* @__PURE__ */ React$1.createElement("div", _extends$14({
|
|
13206
13906
|
className: wrapperCN,
|
|
13207
13907
|
style: finalStyle
|
|
13208
|
-
}, accessibilityAttributes), /* @__PURE__ */ React.createElement("p", {
|
|
13908
|
+
}, accessibilityAttributes), /* @__PURE__ */ React$1.createElement("p", {
|
|
13209
13909
|
className: labelCN,
|
|
13210
13910
|
style: finalLabelStyle
|
|
13211
|
-
}, /* @__PURE__ */ React.isValidElement(finalLabel) ? finalLabel : "".concat(finalLabel)), renderContent$1());
|
|
13911
|
+
}, /* @__PURE__ */ React$1.isValidElement(finalLabel) ? finalLabel : "".concat(finalLabel)), renderContent$1());
|
|
13212
13912
|
};
|
|
13213
13913
|
var CSS_CLASS_PREFIX = "recharts-tooltip-wrapper";
|
|
13214
13914
|
var TOOLTIP_HIDDEN = { visibility: "hidden" };
|
|
@@ -13381,7 +14081,7 @@ var TooltipBoundingBox = class extends PureComponent {
|
|
|
13381
14081
|
top: 0,
|
|
13382
14082
|
left: 0
|
|
13383
14083
|
})), {}, { visibility: !this.state.dismissed && active && hasPayload ? "visible" : "hidden" }, wrapperStyle);
|
|
13384
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
14084
|
+
return /* @__PURE__ */ React$1.createElement("div", {
|
|
13385
14085
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
13386
14086
|
tabIndex: -1,
|
|
13387
14087
|
className: cssClasses,
|
|
@@ -13491,7 +14191,7 @@ var Curve = (props) => {
|
|
|
13491
14191
|
var { className, points, path: path$1, pathRef } = props;
|
|
13492
14192
|
if ((!points || !points.length) && !path$1) return null;
|
|
13493
14193
|
var realPath = points && points.length ? getPath$1(props) : path$1;
|
|
13494
|
-
return /* @__PURE__ */ React.createElement("path", _extends$13({}, svgPropertiesNoEvents(props), adaptEventHandlers(props), {
|
|
14194
|
+
return /* @__PURE__ */ React$1.createElement("path", _extends$13({}, svgPropertiesNoEvents(props), adaptEventHandlers(props), {
|
|
13495
14195
|
className: clsx("recharts-curve", className),
|
|
13496
14196
|
d: realPath === null ? void 0 : realPath,
|
|
13497
14197
|
ref: pathRef
|
|
@@ -13590,7 +14290,7 @@ var Cross = (_ref$1) => {
|
|
|
13590
14290
|
height
|
|
13591
14291
|
}, rest);
|
|
13592
14292
|
if (!isNumber(x$2) || !isNumber(y$2) || !isNumber(width) || !isNumber(height) || !isNumber(top) || !isNumber(left)) return null;
|
|
13593
|
-
return /* @__PURE__ */ React.createElement("path", _extends$12({}, svgPropertiesAndEvents(props), {
|
|
14293
|
+
return /* @__PURE__ */ React$1.createElement("path", _extends$12({}, svgPropertiesAndEvents(props), {
|
|
13594
14294
|
className: clsx("recharts-cross", className),
|
|
13595
14295
|
d: getPath(x$2, y$2, width, height, top, left)
|
|
13596
14296
|
}));
|
|
@@ -14183,7 +14883,7 @@ var Rectangle = (rectangleProps) => {
|
|
|
14183
14883
|
var layerClass = clsx("recharts-rectangle", className);
|
|
14184
14884
|
if (!isUpdateAnimationActive) {
|
|
14185
14885
|
var _svgPropertiesAndEven = svgPropertiesAndEvents(props), { radius: _ } = _svgPropertiesAndEven, otherPathProps = _objectWithoutProperties$10(_svgPropertiesAndEven, _excluded$10);
|
|
14186
|
-
return /* @__PURE__ */ React.createElement("path", _extends$11({}, otherPathProps, {
|
|
14886
|
+
return /* @__PURE__ */ React$1.createElement("path", _extends$11({}, otherPathProps, {
|
|
14187
14887
|
radius: typeof radius === "number" ? radius : void 0,
|
|
14188
14888
|
className: layerClass,
|
|
14189
14889
|
d: getRectanglePath(x$2, y$2, width, height, radius)
|
|
@@ -14196,7 +14896,7 @@ var Rectangle = (rectangleProps) => {
|
|
|
14196
14896
|
var from$1 = "0px ".concat(totalLength === -1 ? 1 : totalLength, "px");
|
|
14197
14897
|
var to$1 = "".concat(totalLength, "px 0px");
|
|
14198
14898
|
var transition = getTransitionVal(["strokeDasharray"], animationDuration, typeof animationEasing === "string" ? animationEasing : defaultRectangleProps.animationEasing);
|
|
14199
|
-
return /* @__PURE__ */ React.createElement(JavascriptAnimate, {
|
|
14899
|
+
return /* @__PURE__ */ React$1.createElement(JavascriptAnimate, {
|
|
14200
14900
|
animationId,
|
|
14201
14901
|
key: animationId,
|
|
14202
14902
|
canBegin: totalLength > 0,
|
|
@@ -14223,7 +14923,7 @@ var Rectangle = (rectangleProps) => {
|
|
|
14223
14923
|
};
|
|
14224
14924
|
else animationStyle = { strokeDasharray: from$1 };
|
|
14225
14925
|
var _svgPropertiesAndEven2 = svgPropertiesAndEvents(props), { radius: _$1 } = _svgPropertiesAndEven2, otherPathProps$1 = _objectWithoutProperties$10(_svgPropertiesAndEven2, _excluded2$3);
|
|
14226
|
-
return /* @__PURE__ */ React.createElement("path", _extends$11({}, otherPathProps$1, {
|
|
14926
|
+
return /* @__PURE__ */ React$1.createElement("path", _extends$11({}, otherPathProps$1, {
|
|
14227
14927
|
radius: typeof radius === "number" ? radius : void 0,
|
|
14228
14928
|
className: layerClass,
|
|
14229
14929
|
d: getRectanglePath(currX, currY, currWidth, currHeight, radius),
|
|
@@ -14515,7 +15215,7 @@ var Sector = (sectorProps) => {
|
|
|
14515
15215
|
startAngle,
|
|
14516
15216
|
endAngle
|
|
14517
15217
|
});
|
|
14518
|
-
return /* @__PURE__ */ React.createElement("path", _extends$10({}, svgPropertiesAndEvents(props), {
|
|
15218
|
+
return /* @__PURE__ */ React$1.createElement("path", _extends$10({}, svgPropertiesAndEvents(props), {
|
|
14519
15219
|
className: layerClass,
|
|
14520
15220
|
d: path$1
|
|
14521
15221
|
}));
|
|
@@ -15521,19 +16221,19 @@ function copy$1(source, target) {
|
|
|
15521
16221
|
return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
|
|
15522
16222
|
}
|
|
15523
16223
|
function transformer$2() {
|
|
15524
|
-
var domain = unit, range$4 = unit, interpolate$1 = value_default, transform, untransform, unknown, clamp$
|
|
16224
|
+
var domain = unit, range$4 = unit, interpolate$1 = value_default, transform, untransform, unknown, clamp$2 = identity$1, piecewise$1, output, input;
|
|
15525
16225
|
function rescale() {
|
|
15526
16226
|
var n$1 = Math.min(domain.length, range$4.length);
|
|
15527
|
-
if (clamp$
|
|
16227
|
+
if (clamp$2 !== identity$1) clamp$2 = clamper(domain[0], domain[n$1 - 1]);
|
|
15528
16228
|
piecewise$1 = n$1 > 2 ? polymap : bimap;
|
|
15529
16229
|
output = input = null;
|
|
15530
16230
|
return scale;
|
|
15531
16231
|
}
|
|
15532
16232
|
function scale(x$2) {
|
|
15533
|
-
return x$2 == null || isNaN(x$2 = +x$2) ? unknown : (output || (output = piecewise$1(domain.map(transform), range$4, interpolate$1)))(transform(clamp$
|
|
16233
|
+
return x$2 == null || isNaN(x$2 = +x$2) ? unknown : (output || (output = piecewise$1(domain.map(transform), range$4, interpolate$1)))(transform(clamp$2(x$2)));
|
|
15534
16234
|
}
|
|
15535
16235
|
scale.invert = function(y$2) {
|
|
15536
|
-
return clamp$
|
|
16236
|
+
return clamp$2(untransform((input || (input = piecewise$1(range$4, domain.map(transform), number_default)))(y$2)));
|
|
15537
16237
|
};
|
|
15538
16238
|
scale.domain = function(_) {
|
|
15539
16239
|
return arguments.length ? (domain = Array.from(_, number$1), rescale()) : domain.slice();
|
|
@@ -15545,7 +16245,7 @@ function transformer$2() {
|
|
|
15545
16245
|
return range$4 = Array.from(_), interpolate$1 = round_default, rescale();
|
|
15546
16246
|
};
|
|
15547
16247
|
scale.clamp = function(_) {
|
|
15548
|
-
return arguments.length ? (clamp$
|
|
16248
|
+
return arguments.length ? (clamp$2 = _ ? true : identity$1, rescale()) : clamp$2 !== identity$1;
|
|
15549
16249
|
};
|
|
15550
16250
|
scale.interpolate = function(_) {
|
|
15551
16251
|
return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
|
|
@@ -17191,15 +17891,15 @@ function utcTime() {
|
|
|
17191
17891
|
return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, utcFormat).domain([Date.UTC(2e3, 0, 1), Date.UTC(2e3, 0, 2)]), arguments);
|
|
17192
17892
|
}
|
|
17193
17893
|
function transformer$1() {
|
|
17194
|
-
var x0 = 0, x1 = 1, t0$1, t1$1, k10, transform, interpolator = identity$1, clamp$
|
|
17894
|
+
var x0 = 0, x1 = 1, t0$1, t1$1, k10, transform, interpolator = identity$1, clamp$2 = false, unknown;
|
|
17195
17895
|
function scale(x$2) {
|
|
17196
|
-
return x$2 == null || isNaN(x$2 = +x$2) ? unknown : interpolator(k10 === 0 ? .5 : (x$2 = (transform(x$2) - t0$1) * k10, clamp$
|
|
17896
|
+
return x$2 == null || isNaN(x$2 = +x$2) ? unknown : interpolator(k10 === 0 ? .5 : (x$2 = (transform(x$2) - t0$1) * k10, clamp$2 ? Math.max(0, Math.min(1, x$2)) : x$2));
|
|
17197
17897
|
}
|
|
17198
17898
|
scale.domain = function(_) {
|
|
17199
17899
|
return arguments.length ? ([x0, x1] = _, t0$1 = transform(x0 = +x0), t1$1 = transform(x1 = +x1), k10 = t0$1 === t1$1 ? 0 : 1 / (t1$1 - t0$1), scale) : [x0, x1];
|
|
17200
17900
|
};
|
|
17201
17901
|
scale.clamp = function(_) {
|
|
17202
|
-
return arguments.length ? (clamp$
|
|
17902
|
+
return arguments.length ? (clamp$2 = !!_, scale) : clamp$2;
|
|
17203
17903
|
};
|
|
17204
17904
|
scale.interpolator = function(_) {
|
|
17205
17905
|
return arguments.length ? (interpolator = _, scale) : interpolator;
|
|
@@ -17281,9 +17981,9 @@ function sequentialQuantile() {
|
|
|
17281
17981
|
return initInterpolator.apply(scale, arguments);
|
|
17282
17982
|
}
|
|
17283
17983
|
function transformer() {
|
|
17284
|
-
var x0 = 0, x1 = .5, x2 = 1, s$1 = 1, t0$1, t1$1, t2, k10, k21, interpolator = identity$1, transform, clamp$
|
|
17984
|
+
var x0 = 0, x1 = .5, x2 = 1, s$1 = 1, t0$1, t1$1, t2, k10, k21, interpolator = identity$1, transform, clamp$2 = false, unknown;
|
|
17285
17985
|
function scale(x$2) {
|
|
17286
|
-
return isNaN(x$2 = +x$2) ? unknown : (x$2 = .5 + ((x$2 = +transform(x$2)) - t1$1) * (s$1 * x$2 < s$1 * t1$1 ? k10 : k21), interpolator(clamp$
|
|
17986
|
+
return isNaN(x$2 = +x$2) ? unknown : (x$2 = .5 + ((x$2 = +transform(x$2)) - t1$1) * (s$1 * x$2 < s$1 * t1$1 ? k10 : k21), interpolator(clamp$2 ? Math.max(0, Math.min(1, x$2)) : x$2));
|
|
17287
17987
|
}
|
|
17288
17988
|
scale.domain = function(_) {
|
|
17289
17989
|
return arguments.length ? ([x0, x1, x2] = _, t0$1 = transform(x0 = +x0), t1$1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0$1 === t1$1 ? 0 : .5 / (t1$1 - t0$1), k21 = t1$1 === t2 ? 0 : .5 / (t2 - t1$1), s$1 = t1$1 < t0$1 ? -1 : 1, scale) : [
|
|
@@ -17293,7 +17993,7 @@ function transformer() {
|
|
|
17293
17993
|
];
|
|
17294
17994
|
};
|
|
17295
17995
|
scale.clamp = function(_) {
|
|
17296
|
-
return arguments.length ? (clamp$
|
|
17996
|
+
return arguments.length ? (clamp$2 = !!_, scale) : clamp$2;
|
|
17297
17997
|
};
|
|
17298
17998
|
scale.interpolator = function(_) {
|
|
17299
17999
|
return arguments.length ? (interpolator = _, scale) : interpolator;
|
|
@@ -20766,7 +21466,7 @@ function CursorInternal(props) {
|
|
|
20766
21466
|
payloadIndex: activeTooltipIndex,
|
|
20767
21467
|
className: clsx("recharts-tooltip-cursor", extraClassName)
|
|
20768
21468
|
});
|
|
20769
|
-
return /* @__PURE__ */ React.createElement(ZIndexLayer, { zIndex: (_props$zIndex = props.zIndex) !== null && _props$zIndex !== void 0 ? _props$zIndex : preferredZIndex }, /* @__PURE__ */ React.createElement(RenderCursor, {
|
|
21469
|
+
return /* @__PURE__ */ React$1.createElement(ZIndexLayer, { zIndex: (_props$zIndex = props.zIndex) !== null && _props$zIndex !== void 0 ? _props$zIndex : preferredZIndex }, /* @__PURE__ */ React$1.createElement(RenderCursor, {
|
|
20770
21470
|
cursor,
|
|
20771
21471
|
cursorComp,
|
|
20772
21472
|
cursorProps
|
|
@@ -20778,7 +21478,7 @@ function Cursor(props) {
|
|
|
20778
21478
|
var layout = useChartLayout();
|
|
20779
21479
|
var chartName = useChartName();
|
|
20780
21480
|
if (tooltipAxisBandSize == null || offset$3 == null || layout == null || chartName == null) return null;
|
|
20781
|
-
return /* @__PURE__ */ React.createElement(CursorInternal, _extends$9({}, props, {
|
|
21481
|
+
return /* @__PURE__ */ React$1.createElement(CursorInternal, _extends$9({}, props, {
|
|
20782
21482
|
offset: offset$3,
|
|
20783
21483
|
layout,
|
|
20784
21484
|
tooltipAxisBandSize,
|
|
@@ -21226,9 +21926,9 @@ function defaultUniqBy(entry) {
|
|
|
21226
21926
|
return entry.dataKey;
|
|
21227
21927
|
}
|
|
21228
21928
|
function renderContent(content, props) {
|
|
21229
|
-
if (/* @__PURE__ */ React.isValidElement(content)) return /* @__PURE__ */ React.cloneElement(content, props);
|
|
21230
|
-
if (typeof content === "function") return /* @__PURE__ */ React.createElement(content, props);
|
|
21231
|
-
return /* @__PURE__ */ React.createElement(DefaultTooltipContent, props);
|
|
21929
|
+
if (/* @__PURE__ */ React$1.isValidElement(content)) return /* @__PURE__ */ React$1.cloneElement(content, props);
|
|
21930
|
+
if (typeof content === "function") return /* @__PURE__ */ React$1.createElement(content, props);
|
|
21931
|
+
return /* @__PURE__ */ React$1.createElement(DefaultTooltipContent, props);
|
|
21232
21932
|
}
|
|
21233
21933
|
var emptyPayload = [];
|
|
21234
21934
|
var defaultTooltipProps = {
|
|
@@ -21297,7 +21997,7 @@ function Tooltip(outsideProps) {
|
|
|
21297
21997
|
if (!finalIsActive) finalPayload = emptyPayload;
|
|
21298
21998
|
if (filterNull && finalPayload.length) finalPayload = getUniqPayload(finalPayload.filter((entry) => entry.value != null && (entry.hide !== true || props.includeHidden)), payloadUniqBy, defaultUniqBy);
|
|
21299
21999
|
var hasPayload = finalPayload.length > 0;
|
|
21300
|
-
var tooltipElement = /* @__PURE__ */ React.createElement(TooltipBoundingBox, {
|
|
22000
|
+
var tooltipElement = /* @__PURE__ */ React$1.createElement(TooltipBoundingBox, {
|
|
21301
22001
|
allowEscapeViewBox,
|
|
21302
22002
|
animationDuration,
|
|
21303
22003
|
animationEasing,
|
|
@@ -21322,7 +22022,7 @@ function Tooltip(outsideProps) {
|
|
|
21322
22022
|
coordinate,
|
|
21323
22023
|
accessibilityLayer
|
|
21324
22024
|
})));
|
|
21325
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ createPortal(tooltipElement, tooltipPortal), finalIsActive && /* @__PURE__ */ React.createElement(Cursor, {
|
|
22025
|
+
return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ createPortal(tooltipElement, tooltipPortal), finalIsActive && /* @__PURE__ */ React$1.createElement(Cursor, {
|
|
21326
22026
|
cursor,
|
|
21327
22027
|
tooltipEventType,
|
|
21328
22028
|
coordinate,
|
|
@@ -21801,7 +22501,7 @@ var Text = /* @__PURE__ */ forwardRef((outsideProps, ref) => {
|
|
|
21801
22501
|
}
|
|
21802
22502
|
if (angle) transforms.push("rotate(".concat(angle, ", ").concat(x$2, ", ").concat(y$2, ")"));
|
|
21803
22503
|
if (transforms.length) textProps.transform = transforms.join(" ");
|
|
21804
|
-
return /* @__PURE__ */ React.createElement("text", _extends$8({}, svgPropertiesAndEvents(textProps), {
|
|
22504
|
+
return /* @__PURE__ */ React$1.createElement("text", _extends$8({}, svgPropertiesAndEvents(textProps), {
|
|
21805
22505
|
ref,
|
|
21806
22506
|
x: x$2,
|
|
21807
22507
|
y: y$2,
|
|
@@ -21810,7 +22510,7 @@ var Text = /* @__PURE__ */ forwardRef((outsideProps, ref) => {
|
|
|
21810
22510
|
fill: fill.includes("url") ? DEFAULT_FILL : fill
|
|
21811
22511
|
}), wordsByLines.map((line, index$1) => {
|
|
21812
22512
|
var words = line.words.join(breakAll ? "" : " ");
|
|
21813
|
-
return /* @__PURE__ */ React.createElement("tspan", {
|
|
22513
|
+
return /* @__PURE__ */ React$1.createElement("tspan", {
|
|
21814
22514
|
x: x$2,
|
|
21815
22515
|
dy: index$1 === 0 ? startDy : lineHeight,
|
|
21816
22516
|
key: "".concat(words, "-").concat(index$1)
|
|
@@ -21940,13 +22640,13 @@ var renderRadialLabel = (labelProps, position, label, attrs, viewBox) => {
|
|
|
21940
22640
|
var endPoint = polarToCartesian(cx, cy, radius, labelAngle + (direction ? 1 : -1) * 359);
|
|
21941
22641
|
var path$1 = "M".concat(startPoint.x, ",").concat(startPoint.y, "\n A").concat(radius, ",").concat(radius, ",0,1,").concat(direction ? 0 : 1, ",\n ").concat(endPoint.x, ",").concat(endPoint.y);
|
|
21942
22642
|
var id = isNullish(labelProps.id) ? uniqueId("recharts-radial-line-") : labelProps.id;
|
|
21943
|
-
return /* @__PURE__ */ React.createElement("text", _extends$7({}, attrs, {
|
|
22643
|
+
return /* @__PURE__ */ React$1.createElement("text", _extends$7({}, attrs, {
|
|
21944
22644
|
dominantBaseline: "central",
|
|
21945
22645
|
className: clsx("recharts-radial-bar-label", className)
|
|
21946
|
-
}), /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("path", {
|
|
22646
|
+
}), /* @__PURE__ */ React$1.createElement("defs", null, /* @__PURE__ */ React$1.createElement("path", {
|
|
21947
22647
|
id,
|
|
21948
22648
|
d: path$1
|
|
21949
|
-
})), /* @__PURE__ */ React.createElement("textPath", { xlinkHref: "#".concat(id) }, label));
|
|
22649
|
+
})), /* @__PURE__ */ React$1.createElement("textPath", { xlinkHref: "#".concat(id) }, label));
|
|
21950
22650
|
};
|
|
21951
22651
|
var getAttrsOfPolarLabel = (viewBox, offset$3, position) => {
|
|
21952
22652
|
var { cx, cy, innerRadius, outerRadius, startAngle, endAngle } = viewBox;
|
|
@@ -22144,7 +22844,7 @@ function Label(outerProps) {
|
|
|
22144
22844
|
if (position === "insideStart" || position === "insideEnd" || position === "end") return renderRadialLabel(props, position, label, attrs, viewBox);
|
|
22145
22845
|
positionAttrs = getAttrsOfPolarLabel(viewBox, props.offset, props.position);
|
|
22146
22846
|
} else positionAttrs = getAttrsOfCartesianLabel(props, viewBox);
|
|
22147
|
-
return /* @__PURE__ */ React.createElement(ZIndexLayer, { zIndex: props.zIndex }, /* @__PURE__ */ React.createElement(Text, _extends$7({
|
|
22847
|
+
return /* @__PURE__ */ React$1.createElement(ZIndexLayer, { zIndex: props.zIndex }, /* @__PURE__ */ React$1.createElement(Text, _extends$7({
|
|
22148
22848
|
ref: labelRef,
|
|
22149
22849
|
className: clsx("recharts-label", className)
|
|
22150
22850
|
}, attrs, positionAttrs, {
|
|
@@ -22233,11 +22933,11 @@ function LabelList(_ref$1) {
|
|
|
22233
22933
|
var polarData = usePolarLabelListContext();
|
|
22234
22934
|
var data = cartesianData || polarData;
|
|
22235
22935
|
if (!data || !data.length) return null;
|
|
22236
|
-
return /* @__PURE__ */ React.createElement(ZIndexLayer, { zIndex: zIndex !== null && zIndex !== void 0 ? zIndex : DefaultZIndexes.label }, /* @__PURE__ */ React.createElement(Layer, { className: "recharts-label-list" }, data.map((entry, index$1) => {
|
|
22936
|
+
return /* @__PURE__ */ React$1.createElement(ZIndexLayer, { zIndex: zIndex !== null && zIndex !== void 0 ? zIndex : DefaultZIndexes.label }, /* @__PURE__ */ React$1.createElement(Layer, { className: "recharts-label-list" }, data.map((entry, index$1) => {
|
|
22237
22937
|
var _restProps$fill;
|
|
22238
22938
|
var value = isNullish(dataKey) ? valueAccessor(entry, index$1) : getValueByDataKey(entry && entry.payload, dataKey);
|
|
22239
22939
|
var idProps = isNullish(id) ? {} : { id: "".concat(id, "-").concat(index$1) };
|
|
22240
|
-
return /* @__PURE__ */ React.createElement(Label, _extends$6({ key: "label-".concat(index$1) }, svgPropertiesAndEvents(entry), others, idProps, {
|
|
22940
|
+
return /* @__PURE__ */ React$1.createElement(Label, _extends$6({ key: "label-".concat(index$1) }, svgPropertiesAndEvents(entry), others, idProps, {
|
|
22241
22941
|
fill: (_restProps$fill = restProps.fill) !== null && _restProps$fill !== void 0 ? _restProps$fill : entry.fill,
|
|
22242
22942
|
parentViewBox: entry.parentViewBox,
|
|
22243
22943
|
value,
|
|
@@ -22252,12 +22952,12 @@ LabelList.displayName = "LabelList";
|
|
|
22252
22952
|
function LabelListFromLabelProp(_ref2) {
|
|
22253
22953
|
var { label } = _ref2;
|
|
22254
22954
|
if (!label) return null;
|
|
22255
|
-
if (label === true) return /* @__PURE__ */ React.createElement(LabelList, { key: "labelList-implicit" });
|
|
22256
|
-
if (/* @__PURE__ */ React.isValidElement(label) || isLabelContentAFunction(label)) return /* @__PURE__ */ React.createElement(LabelList, {
|
|
22955
|
+
if (label === true) return /* @__PURE__ */ React$1.createElement(LabelList, { key: "labelList-implicit" });
|
|
22956
|
+
if (/* @__PURE__ */ React$1.isValidElement(label) || isLabelContentAFunction(label)) return /* @__PURE__ */ React$1.createElement(LabelList, {
|
|
22257
22957
|
key: "labelList-implicit",
|
|
22258
22958
|
content: label
|
|
22259
22959
|
});
|
|
22260
|
-
if (typeof label === "object") return /* @__PURE__ */ React.createElement(LabelList, _extends$6({ key: "labelList-implicit" }, label, { type: String(label.type) }));
|
|
22960
|
+
if (typeof label === "object") return /* @__PURE__ */ React$1.createElement(LabelList, _extends$6({ key: "labelList-implicit" }, label, { type: String(label.type) }));
|
|
22261
22961
|
return null;
|
|
22262
22962
|
}
|
|
22263
22963
|
var polarAxisSlice = createSlice({
|
|
@@ -22663,7 +23363,7 @@ var Trapezoid = (outsideProps) => {
|
|
|
22663
23363
|
}, []);
|
|
22664
23364
|
if (x$2 !== +x$2 || y$2 !== +y$2 || upperWidth !== +upperWidth || lowerWidth !== +lowerWidth || height !== +height || upperWidth === 0 && lowerWidth === 0 || height === 0) return null;
|
|
22665
23365
|
var layerClass = clsx("recharts-trapezoid", className);
|
|
22666
|
-
if (!isUpdateAnimationActive) return /* @__PURE__ */ React.createElement("g", null, /* @__PURE__ */ React.createElement("path", _extends$5({}, svgPropertiesAndEvents(trapezoidProps), {
|
|
23366
|
+
if (!isUpdateAnimationActive) return /* @__PURE__ */ React$1.createElement("g", null, /* @__PURE__ */ React$1.createElement("path", _extends$5({}, svgPropertiesAndEvents(trapezoidProps), {
|
|
22667
23367
|
className: layerClass,
|
|
22668
23368
|
d: getTrapezoidPath(x$2, y$2, upperWidth, lowerWidth, height)
|
|
22669
23369
|
})));
|
|
@@ -22675,7 +23375,7 @@ var Trapezoid = (outsideProps) => {
|
|
|
22675
23375
|
var from$1 = "0px ".concat(totalLength === -1 ? 1 : totalLength, "px");
|
|
22676
23376
|
var to$1 = "".concat(totalLength, "px 0px");
|
|
22677
23377
|
var transition = getTransitionVal(["strokeDasharray"], animationDuration, animationEasing);
|
|
22678
|
-
return /* @__PURE__ */ React.createElement(JavascriptAnimate, {
|
|
23378
|
+
return /* @__PURE__ */ React$1.createElement(JavascriptAnimate, {
|
|
22679
23379
|
animationId,
|
|
22680
23380
|
key: animationId,
|
|
22681
23381
|
canBegin: totalLength > 0,
|
|
@@ -22700,7 +23400,7 @@ var Trapezoid = (outsideProps) => {
|
|
|
22700
23400
|
transition,
|
|
22701
23401
|
strokeDasharray: to$1
|
|
22702
23402
|
} : { strokeDasharray: from$1 };
|
|
22703
|
-
return /* @__PURE__ */ React.createElement("path", _extends$5({}, svgPropertiesAndEvents(trapezoidProps), {
|
|
23403
|
+
return /* @__PURE__ */ React$1.createElement("path", _extends$5({}, svgPropertiesAndEvents(trapezoidProps), {
|
|
22704
23404
|
className: layerClass,
|
|
22705
23405
|
d: getTrapezoidPath(currX, currY, currUpperWidth, currLowerWidth, currHeight),
|
|
22706
23406
|
ref: pathRef,
|
|
@@ -22785,13 +23485,13 @@ function isSymbolsProps(shapeType, _elementProps) {
|
|
|
22785
23485
|
function ShapeSelector(_ref$1) {
|
|
22786
23486
|
var { shapeType, elementProps } = _ref$1;
|
|
22787
23487
|
switch (shapeType) {
|
|
22788
|
-
case "rectangle": return /* @__PURE__ */ React.createElement(Rectangle, elementProps);
|
|
22789
|
-
case "trapezoid": return /* @__PURE__ */ React.createElement(Trapezoid, elementProps);
|
|
22790
|
-
case "sector": return /* @__PURE__ */ React.createElement(Sector, elementProps);
|
|
23488
|
+
case "rectangle": return /* @__PURE__ */ React$1.createElement(Rectangle, elementProps);
|
|
23489
|
+
case "trapezoid": return /* @__PURE__ */ React$1.createElement(Trapezoid, elementProps);
|
|
23490
|
+
case "sector": return /* @__PURE__ */ React$1.createElement(Sector, elementProps);
|
|
22791
23491
|
case "symbols":
|
|
22792
|
-
if (isSymbolsProps(shapeType, elementProps)) return /* @__PURE__ */ React.createElement(Symbols, elementProps);
|
|
23492
|
+
if (isSymbolsProps(shapeType, elementProps)) return /* @__PURE__ */ React$1.createElement(Symbols, elementProps);
|
|
22793
23493
|
break;
|
|
22794
|
-
case "curve": return /* @__PURE__ */ React.createElement(Curve, elementProps);
|
|
23494
|
+
case "curve": return /* @__PURE__ */ React$1.createElement(Curve, elementProps);
|
|
22795
23495
|
default: return null;
|
|
22796
23496
|
}
|
|
22797
23497
|
}
|
|
@@ -22806,18 +23506,18 @@ function Shape(_ref2) {
|
|
|
22806
23506
|
else if (typeof option === "function") shape = option(props, props.index);
|
|
22807
23507
|
else if ((0, import_isPlainObject.default)(option) && typeof option !== "boolean") {
|
|
22808
23508
|
var nextProps = propTransformer(option, props);
|
|
22809
|
-
shape = /* @__PURE__ */ React.createElement(ShapeSelector, {
|
|
23509
|
+
shape = /* @__PURE__ */ React$1.createElement(ShapeSelector, {
|
|
22810
23510
|
shapeType,
|
|
22811
23511
|
elementProps: nextProps
|
|
22812
23512
|
});
|
|
22813
23513
|
} else {
|
|
22814
23514
|
var elementProps = props;
|
|
22815
|
-
shape = /* @__PURE__ */ React.createElement(ShapeSelector, {
|
|
23515
|
+
shape = /* @__PURE__ */ React$1.createElement(ShapeSelector, {
|
|
22816
23516
|
shapeType,
|
|
22817
23517
|
elementProps
|
|
22818
23518
|
});
|
|
22819
23519
|
}
|
|
22820
|
-
if (props.isActive) return /* @__PURE__ */ React.createElement(Layer, { className: activeClassName }, shape);
|
|
23520
|
+
if (props.isActive) return /* @__PURE__ */ React$1.createElement(Layer, { className: activeClassName }, shape);
|
|
22821
23521
|
return shape;
|
|
22822
23522
|
}
|
|
22823
23523
|
var useMouseEnterItemDispatch = (onMouseEnterFromProps, dataKey, graphicalItemId) => {
|
|
@@ -22909,10 +23609,10 @@ function SetLegendPayload(_ref$1) {
|
|
|
22909
23609
|
}
|
|
22910
23610
|
var _ref;
|
|
22911
23611
|
var useIdFallback = () => {
|
|
22912
|
-
var [id] = React.useState(() => uniqueId("uid-"));
|
|
23612
|
+
var [id] = React$1.useState(() => uniqueId("uid-"));
|
|
22913
23613
|
return id;
|
|
22914
23614
|
};
|
|
22915
|
-
var useId$1 = (_ref = React["useId".toString()]) !== null && _ref !== void 0 ? _ref : useIdFallback;
|
|
23615
|
+
var useId$1 = (_ref = React$1["useId".toString()]) !== null && _ref !== void 0 ? _ref : useIdFallback;
|
|
22916
23616
|
function useUniqueId(prefix$2, customId) {
|
|
22917
23617
|
var generatedId = useId$1();
|
|
22918
23618
|
if (customId) return customId;
|
|
@@ -22922,7 +23622,7 @@ var GraphicalItemIdContext = /* @__PURE__ */ createContext(void 0);
|
|
|
22922
23622
|
var RegisterGraphicalItemId = (_ref$1) => {
|
|
22923
23623
|
var { id, type, children } = _ref$1;
|
|
22924
23624
|
var resolvedId = useUniqueId("recharts-".concat(type), id);
|
|
22925
|
-
return /* @__PURE__ */ React.createElement(GraphicalItemIdContext.Provider, { value: resolvedId }, children(resolvedId));
|
|
23625
|
+
return /* @__PURE__ */ React$1.createElement(GraphicalItemIdContext.Provider, { value: resolvedId }, children(resolvedId));
|
|
22926
23626
|
};
|
|
22927
23627
|
var graphicalItemsSlice = createSlice({
|
|
22928
23628
|
name: "graphicalItems",
|
|
@@ -23246,7 +23946,7 @@ function typeguardBarRectangleProps(_ref$1, props) {
|
|
|
23246
23946
|
});
|
|
23247
23947
|
}
|
|
23248
23948
|
function BarRectangle(props) {
|
|
23249
|
-
return /* @__PURE__ */ React.createElement(Shape, _extends$4({
|
|
23949
|
+
return /* @__PURE__ */ React$1.createElement(Shape, _extends$4({
|
|
23250
23950
|
shapeType: "rectangle",
|
|
23251
23951
|
propTransformer: typeguardBarRectangleProps,
|
|
23252
23952
|
activeClassName: "recharts-active-bar"
|
|
@@ -23315,7 +24015,7 @@ var ErrorBarContext = /* @__PURE__ */ createContext({
|
|
|
23315
24015
|
});
|
|
23316
24016
|
function SetErrorBarContext(props) {
|
|
23317
24017
|
var { children } = props, rest = _objectWithoutProperties$3(props, _excluded$3);
|
|
23318
|
-
return /* @__PURE__ */ React.createElement(ErrorBarContext.Provider, { value: rest }, children);
|
|
24018
|
+
return /* @__PURE__ */ React$1.createElement(ErrorBarContext.Provider, { value: rest }, children);
|
|
23319
24019
|
}
|
|
23320
24020
|
function useNeedsClip(xAxisId, yAxisId) {
|
|
23321
24021
|
var _xAxis$allowDataOverf, _yAxis$allowDataOverf;
|
|
@@ -23335,7 +24035,7 @@ function GraphicalItemClipPath(_ref$1) {
|
|
|
23335
24035
|
var { needClipX, needClipY, needClip } = useNeedsClip(xAxisId, yAxisId);
|
|
23336
24036
|
if (!needClip || !plotArea) return null;
|
|
23337
24037
|
var { x: x$2, y: y$2, width, height } = plotArea;
|
|
23338
|
-
return /* @__PURE__ */ React.createElement("clipPath", { id: "clipPath-".concat(clipPathId) }, /* @__PURE__ */ React.createElement("rect", {
|
|
24038
|
+
return /* @__PURE__ */ React$1.createElement("clipPath", { id: "clipPath-".concat(clipPathId) }, /* @__PURE__ */ React$1.createElement("rect", {
|
|
23339
24039
|
x: needClipX ? x$2 : x$2 - width / 2,
|
|
23340
24040
|
y: needClipY ? y$2 : y$2 - height / 2,
|
|
23341
24041
|
width: needClipX ? width : width * 2,
|
|
@@ -23356,13 +24056,13 @@ function getZIndexFromUnknown(input, defaultZIndex) {
|
|
|
23356
24056
|
* LICENSE file in the root directory of this source tree.
|
|
23357
24057
|
*/
|
|
23358
24058
|
var require_use_sync_external_store_with_selector_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
23359
|
-
var React$
|
|
24059
|
+
var React$2 = __require("react");
|
|
23360
24060
|
"function" === typeof Object.is && Object.is;
|
|
23361
|
-
React$
|
|
23362
|
-
React$
|
|
23363
|
-
React$
|
|
23364
|
-
React$
|
|
23365
|
-
React$
|
|
24061
|
+
React$2.useSyncExternalStore;
|
|
24062
|
+
React$2.useRef;
|
|
24063
|
+
React$2.useEffect;
|
|
24064
|
+
React$2.useMemo;
|
|
24065
|
+
React$2.useDebugValue;
|
|
23366
24066
|
}));
|
|
23367
24067
|
/**
|
|
23368
24068
|
* @license React
|
|
@@ -23557,7 +24257,7 @@ var canUseDOM = () => !!(typeof window !== "undefined" && typeof window.document
|
|
|
23557
24257
|
var isDOM = /* @__PURE__ */ canUseDOM();
|
|
23558
24258
|
var isRunningInReactNative = () => typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
23559
24259
|
var isReactNative = /* @__PURE__ */ isRunningInReactNative();
|
|
23560
|
-
var getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? React.useLayoutEffect : React.useEffect;
|
|
24260
|
+
var getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? React$1.useLayoutEffect : React$1.useEffect;
|
|
23561
24261
|
var useIsomorphicLayoutEffect = /* @__PURE__ */ getUseIsomorphicLayoutEffect();
|
|
23562
24262
|
function is(x$2, y$2) {
|
|
23563
24263
|
if (x$2 === y$2) return x$2 !== 0 || y$2 !== 0 || 1 / x$2 === 1 / y$2;
|
|
@@ -23576,20 +24276,20 @@ Object.prototype;
|
|
|
23576
24276
|
var ContextKey = /* @__PURE__ */ Symbol.for(`react-redux-context`);
|
|
23577
24277
|
var gT = typeof globalThis !== "undefined" ? globalThis : {};
|
|
23578
24278
|
function getContext() {
|
|
23579
|
-
if (!React.createContext) return {};
|
|
24279
|
+
if (!React$1.createContext) return {};
|
|
23580
24280
|
const contextMap = gT[ContextKey] ??= /* @__PURE__ */ new Map();
|
|
23581
|
-
let realContext = contextMap.get(React.createContext);
|
|
24281
|
+
let realContext = contextMap.get(React$1.createContext);
|
|
23582
24282
|
if (!realContext) {
|
|
23583
|
-
realContext = React.createContext(null);
|
|
24283
|
+
realContext = React$1.createContext(null);
|
|
23584
24284
|
if (process.env.NODE_ENV !== "production") realContext.displayName = "ReactRedux";
|
|
23585
|
-
contextMap.set(React.createContext, realContext);
|
|
24285
|
+
contextMap.set(React$1.createContext, realContext);
|
|
23586
24286
|
}
|
|
23587
24287
|
return realContext;
|
|
23588
24288
|
}
|
|
23589
24289
|
var ReactReduxContext = /* @__PURE__ */ getContext();
|
|
23590
24290
|
function Provider(providerProps) {
|
|
23591
24291
|
const { children, context, serverState, store } = providerProps;
|
|
23592
|
-
const contextValue = React.useMemo(() => {
|
|
24292
|
+
const contextValue = React$1.useMemo(() => {
|
|
23593
24293
|
const baseContextValue = {
|
|
23594
24294
|
store,
|
|
23595
24295
|
subscription: createSubscription(store),
|
|
@@ -23604,7 +24304,7 @@ function Provider(providerProps) {
|
|
|
23604
24304
|
});
|
|
23605
24305
|
}
|
|
23606
24306
|
}, [store, serverState]);
|
|
23607
|
-
const previousState = React.useMemo(() => store.getState(), [store]);
|
|
24307
|
+
const previousState = React$1.useMemo(() => store.getState(), [store]);
|
|
23608
24308
|
useIsomorphicLayoutEffect(() => {
|
|
23609
24309
|
const { subscription } = contextValue;
|
|
23610
24310
|
subscription.onStateChange = subscription.notifyNestedSubs;
|
|
@@ -23616,7 +24316,7 @@ function Provider(providerProps) {
|
|
|
23616
24316
|
};
|
|
23617
24317
|
}, [contextValue, previousState]);
|
|
23618
24318
|
const Context = context || ReactReduxContext;
|
|
23619
|
-
return /* @__PURE__ */ React.createElement(Context.Provider, { value: contextValue }, children);
|
|
24319
|
+
return /* @__PURE__ */ React$1.createElement(Context.Provider, { value: contextValue }, children);
|
|
23620
24320
|
}
|
|
23621
24321
|
var Provider_default = Provider;
|
|
23622
24322
|
var propsToShallowCompare = new Set([
|
|
@@ -23746,7 +24446,7 @@ var computeLegendPayloadFromBarData = (props) => {
|
|
|
23746
24446
|
payload: props
|
|
23747
24447
|
}];
|
|
23748
24448
|
};
|
|
23749
|
-
var SetBarTooltipEntrySettings = /* @__PURE__ */ React.memo((_ref$1) => {
|
|
24449
|
+
var SetBarTooltipEntrySettings = /* @__PURE__ */ React$1.memo((_ref$1) => {
|
|
23750
24450
|
var { dataKey, stroke, strokeWidth, fill, name, hide: hide$3, unit: unit$1, tooltipType } = _ref$1;
|
|
23751
24451
|
var tooltipEntrySettings = {
|
|
23752
24452
|
dataDefinedOnItem: void 0,
|
|
@@ -23764,7 +24464,7 @@ var SetBarTooltipEntrySettings = /* @__PURE__ */ React.memo((_ref$1) => {
|
|
|
23764
24464
|
unit: unit$1
|
|
23765
24465
|
}
|
|
23766
24466
|
};
|
|
23767
|
-
return /* @__PURE__ */ React.createElement(SetTooltipEntrySettings, { tooltipEntrySettings });
|
|
24467
|
+
return /* @__PURE__ */ React$1.createElement(SetTooltipEntrySettings, { tooltipEntrySettings });
|
|
23768
24468
|
});
|
|
23769
24469
|
function BarBackground(props) {
|
|
23770
24470
|
var activeIndex = useAppSelector(selectActiveTooltipIndex);
|
|
@@ -23775,7 +24475,7 @@ function BarBackground(props) {
|
|
|
23775
24475
|
var onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, dataKey);
|
|
23776
24476
|
if (!backgroundFromProps || data == null) return null;
|
|
23777
24477
|
var backgroundProps = svgPropertiesNoEventsFromUnknown(backgroundFromProps);
|
|
23778
|
-
return /* @__PURE__ */ React.createElement(ZIndexLayer, { zIndex: getZIndexFromUnknown(backgroundFromProps, DefaultZIndexes.barBackground) }, data.map((entry, i) => {
|
|
24478
|
+
return /* @__PURE__ */ React$1.createElement(ZIndexLayer, { zIndex: getZIndexFromUnknown(backgroundFromProps, DefaultZIndexes.barBackground) }, data.map((entry, i) => {
|
|
23779
24479
|
var { value, background: backgroundFromDataEntry, tooltipPosition } = entry, rest = _objectWithoutProperties$2(entry, _excluded2);
|
|
23780
24480
|
if (!backgroundFromDataEntry) return null;
|
|
23781
24481
|
var onMouseEnter = onMouseEnterFromContext(entry, i);
|
|
@@ -23792,7 +24492,7 @@ function BarBackground(props) {
|
|
|
23792
24492
|
index: i,
|
|
23793
24493
|
className: "recharts-bar-background-rectangle"
|
|
23794
24494
|
});
|
|
23795
|
-
return /* @__PURE__ */ React.createElement(BarRectangle, _extends$3({ key: "background-bar-".concat(i) }, barRectangleProps));
|
|
24495
|
+
return /* @__PURE__ */ React$1.createElement(BarRectangle, _extends$3({ key: "background-bar-".concat(i) }, barRectangleProps));
|
|
23796
24496
|
}));
|
|
23797
24497
|
}
|
|
23798
24498
|
function BarLabelListProvider(_ref2) {
|
|
@@ -23814,7 +24514,7 @@ function BarLabelListProvider(_ref2) {
|
|
|
23814
24514
|
fill: entry.fill
|
|
23815
24515
|
});
|
|
23816
24516
|
});
|
|
23817
|
-
return /* @__PURE__ */ React.createElement(CartesianLabelListContextProvider, { value: showLabels ? labelListEntries : void 0 }, children);
|
|
24517
|
+
return /* @__PURE__ */ React$1.createElement(CartesianLabelListContextProvider, { value: showLabels ? labelListEntries : void 0 }, children);
|
|
23818
24518
|
}
|
|
23819
24519
|
function BarRectangleWithActiveState(props) {
|
|
23820
24520
|
var { shape, activeBar, baseProps, entry, index: index$1, dataKey } = props;
|
|
@@ -23822,13 +24522,13 @@ function BarRectangleWithActiveState(props) {
|
|
|
23822
24522
|
var activeDataKey = useAppSelector(selectActiveTooltipDataKey);
|
|
23823
24523
|
var isActive = activeBar && String(index$1) === activeIndex && (activeDataKey == null || dataKey === activeDataKey);
|
|
23824
24524
|
var option = isActive ? activeBar : shape;
|
|
23825
|
-
if (isActive) return /* @__PURE__ */ React.createElement(ZIndexLayer, { zIndex: DefaultZIndexes.activeBar }, /* @__PURE__ */ React.createElement(BarRectangle, _extends$3({}, baseProps, { name: String(baseProps.name) }, entry, {
|
|
24525
|
+
if (isActive) return /* @__PURE__ */ React$1.createElement(ZIndexLayer, { zIndex: DefaultZIndexes.activeBar }, /* @__PURE__ */ React$1.createElement(BarRectangle, _extends$3({}, baseProps, { name: String(baseProps.name) }, entry, {
|
|
23826
24526
|
isActive,
|
|
23827
24527
|
option,
|
|
23828
24528
|
index: index$1,
|
|
23829
24529
|
dataKey
|
|
23830
24530
|
})));
|
|
23831
|
-
return /* @__PURE__ */ React.createElement(BarRectangle, _extends$3({}, baseProps, { name: String(baseProps.name) }, entry, {
|
|
24531
|
+
return /* @__PURE__ */ React$1.createElement(BarRectangle, _extends$3({}, baseProps, { name: String(baseProps.name) }, entry, {
|
|
23832
24532
|
isActive,
|
|
23833
24533
|
option,
|
|
23834
24534
|
index: index$1,
|
|
@@ -23837,7 +24537,7 @@ function BarRectangleWithActiveState(props) {
|
|
|
23837
24537
|
}
|
|
23838
24538
|
function BarRectangleNeverActive(props) {
|
|
23839
24539
|
var { shape, baseProps, entry, index: index$1, dataKey } = props;
|
|
23840
|
-
return /* @__PURE__ */ React.createElement(BarRectangle, _extends$3({}, baseProps, { name: String(baseProps.name) }, entry, {
|
|
24540
|
+
return /* @__PURE__ */ React$1.createElement(BarRectangle, _extends$3({}, baseProps, { name: String(baseProps.name) }, entry, {
|
|
23841
24541
|
isActive: false,
|
|
23842
24542
|
option: shape,
|
|
23843
24543
|
index: index$1,
|
|
@@ -23854,22 +24554,22 @@ function BarRectangles(_ref3) {
|
|
|
23854
24554
|
var onMouseLeaveFromContext = useMouseLeaveItemDispatch(onMouseLeaveFromProps);
|
|
23855
24555
|
var onClickFromContext = useMouseClickItemDispatch(onItemClickFromProps, dataKey);
|
|
23856
24556
|
if (!data) return null;
|
|
23857
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, data.map((entry, i) => {
|
|
23858
|
-
return /* @__PURE__ */ React.createElement(Layer, _extends$3({
|
|
24557
|
+
return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, data.map((entry, i) => {
|
|
24558
|
+
return /* @__PURE__ */ React$1.createElement(Layer, _extends$3({
|
|
23859
24559
|
key: "rectangle-".concat(entry === null || entry === void 0 ? void 0 : entry.x, "-").concat(entry === null || entry === void 0 ? void 0 : entry.y, "-").concat(entry === null || entry === void 0 ? void 0 : entry.value, "-").concat(i),
|
|
23860
24560
|
className: "recharts-bar-rectangle"
|
|
23861
24561
|
}, adaptEventsOfChild(restOfAllOtherProps, entry, i), {
|
|
23862
24562
|
onMouseEnter: onMouseEnterFromContext(entry, i),
|
|
23863
24563
|
onMouseLeave: onMouseLeaveFromContext(entry, i),
|
|
23864
24564
|
onClick: onClickFromContext(entry, i)
|
|
23865
|
-
}), activeBar ? /* @__PURE__ */ React.createElement(BarRectangleWithActiveState, {
|
|
24565
|
+
}), activeBar ? /* @__PURE__ */ React$1.createElement(BarRectangleWithActiveState, {
|
|
23866
24566
|
shape,
|
|
23867
24567
|
activeBar,
|
|
23868
24568
|
baseProps,
|
|
23869
24569
|
entry,
|
|
23870
24570
|
index: i,
|
|
23871
24571
|
dataKey
|
|
23872
|
-
}) : /* @__PURE__ */ React.createElement(BarRectangleNeverActive, {
|
|
24572
|
+
}) : /* @__PURE__ */ React$1.createElement(BarRectangleNeverActive, {
|
|
23873
24573
|
shape,
|
|
23874
24574
|
baseProps,
|
|
23875
24575
|
entry,
|
|
@@ -23893,10 +24593,10 @@ function RectanglesWithAnimation(_ref5) {
|
|
|
23893
24593
|
if (typeof onAnimationStart === "function") onAnimationStart();
|
|
23894
24594
|
setIsAnimating(true);
|
|
23895
24595
|
}, [onAnimationStart]);
|
|
23896
|
-
return /* @__PURE__ */ React.createElement(BarLabelListProvider, {
|
|
24596
|
+
return /* @__PURE__ */ React$1.createElement(BarLabelListProvider, {
|
|
23897
24597
|
showLabels,
|
|
23898
24598
|
rects: data
|
|
23899
|
-
}, /* @__PURE__ */ React.createElement(JavascriptAnimate, {
|
|
24599
|
+
}, /* @__PURE__ */ React$1.createElement(JavascriptAnimate, {
|
|
23900
24600
|
animationId,
|
|
23901
24601
|
begin: animationBegin,
|
|
23902
24602
|
duration: animationDuration,
|
|
@@ -23931,15 +24631,15 @@ function RectanglesWithAnimation(_ref5) {
|
|
|
23931
24631
|
});
|
|
23932
24632
|
if (t > 0) previousRectanglesRef.current = stepData !== null && stepData !== void 0 ? stepData : null;
|
|
23933
24633
|
if (stepData == null) return null;
|
|
23934
|
-
return /* @__PURE__ */ React.createElement(Layer, null, /* @__PURE__ */ React.createElement(BarRectangles, {
|
|
24634
|
+
return /* @__PURE__ */ React$1.createElement(Layer, null, /* @__PURE__ */ React$1.createElement(BarRectangles, {
|
|
23935
24635
|
props,
|
|
23936
24636
|
data: stepData
|
|
23937
24637
|
}));
|
|
23938
|
-
}), /* @__PURE__ */ React.createElement(LabelListFromLabelProp, { label: props.label }), props.children);
|
|
24638
|
+
}), /* @__PURE__ */ React$1.createElement(LabelListFromLabelProp, { label: props.label }), props.children);
|
|
23939
24639
|
}
|
|
23940
24640
|
function RenderRectangles(props) {
|
|
23941
24641
|
var previousRectanglesRef = useRef(null);
|
|
23942
|
-
return /* @__PURE__ */ React.createElement(RectanglesWithAnimation, {
|
|
24642
|
+
return /* @__PURE__ */ React$1.createElement(RectanglesWithAnimation, {
|
|
23943
24643
|
previousRectanglesRef,
|
|
23944
24644
|
props
|
|
23945
24645
|
});
|
|
@@ -23960,22 +24660,22 @@ var BarWithState = class extends PureComponent {
|
|
|
23960
24660
|
if (hide$3 || data == null) return null;
|
|
23961
24661
|
var layerClass = clsx("recharts-bar", className);
|
|
23962
24662
|
var clipPathId = id;
|
|
23963
|
-
return /* @__PURE__ */ React.createElement(Layer, {
|
|
24663
|
+
return /* @__PURE__ */ React$1.createElement(Layer, {
|
|
23964
24664
|
className: layerClass,
|
|
23965
24665
|
id
|
|
23966
|
-
}, needClip && /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement(GraphicalItemClipPath, {
|
|
24666
|
+
}, needClip && /* @__PURE__ */ React$1.createElement("defs", null, /* @__PURE__ */ React$1.createElement(GraphicalItemClipPath, {
|
|
23967
24667
|
clipPathId,
|
|
23968
24668
|
xAxisId,
|
|
23969
24669
|
yAxisId
|
|
23970
|
-
})), /* @__PURE__ */ React.createElement(Layer, {
|
|
24670
|
+
})), /* @__PURE__ */ React$1.createElement(Layer, {
|
|
23971
24671
|
className: "recharts-bar-rectangles",
|
|
23972
24672
|
clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : void 0
|
|
23973
|
-
}, /* @__PURE__ */ React.createElement(BarBackground, {
|
|
24673
|
+
}, /* @__PURE__ */ React$1.createElement(BarBackground, {
|
|
23974
24674
|
data,
|
|
23975
24675
|
dataKey,
|
|
23976
24676
|
background,
|
|
23977
24677
|
allOtherBarProps: this.props
|
|
23978
|
-
}), /* @__PURE__ */ React.createElement(RenderRectangles, this.props)));
|
|
24678
|
+
}), /* @__PURE__ */ React$1.createElement(RenderRectangles, this.props)));
|
|
23979
24679
|
}
|
|
23980
24680
|
};
|
|
23981
24681
|
var defaultBarProps = {
|
|
@@ -24005,13 +24705,13 @@ function BarImpl(props) {
|
|
|
24005
24705
|
var firstDataPoint = rects === null || rects === void 0 ? void 0 : rects[0];
|
|
24006
24706
|
if (firstDataPoint == null || firstDataPoint.height == null || firstDataPoint.width == null) errorBarOffset = 0;
|
|
24007
24707
|
else errorBarOffset = layout === "vertical" ? firstDataPoint.height / 2 : firstDataPoint.width / 2;
|
|
24008
|
-
return /* @__PURE__ */ React.createElement(SetErrorBarContext, {
|
|
24708
|
+
return /* @__PURE__ */ React$1.createElement(SetErrorBarContext, {
|
|
24009
24709
|
xAxisId,
|
|
24010
24710
|
yAxisId,
|
|
24011
24711
|
data: rects,
|
|
24012
24712
|
dataPointFormatter: errorBarDataPointFormatter,
|
|
24013
24713
|
errorBarOffset
|
|
24014
|
-
}, /* @__PURE__ */ React.createElement(BarWithState, _extends$3({}, props, {
|
|
24714
|
+
}, /* @__PURE__ */ React$1.createElement(BarWithState, _extends$3({}, props, {
|
|
24015
24715
|
layout,
|
|
24016
24716
|
needClip,
|
|
24017
24717
|
data: rects,
|
|
@@ -24112,10 +24812,10 @@ function computeBarRectangles(_ref6) {
|
|
|
24112
24812
|
function BarFn(outsideProps) {
|
|
24113
24813
|
var props = resolveDefaultProps(outsideProps, defaultBarProps);
|
|
24114
24814
|
var isPanorama = useIsPanorama();
|
|
24115
|
-
return /* @__PURE__ */ React.createElement(RegisterGraphicalItemId, {
|
|
24815
|
+
return /* @__PURE__ */ React$1.createElement(RegisterGraphicalItemId, {
|
|
24116
24816
|
id: props.id,
|
|
24117
24817
|
type: "bar"
|
|
24118
|
-
}, (id) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SetLegendPayload, { legendPayload: computeLegendPayloadFromBarData(props) }), /* @__PURE__ */ React.createElement(SetBarTooltipEntrySettings, {
|
|
24818
|
+
}, (id) => /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(SetLegendPayload, { legendPayload: computeLegendPayloadFromBarData(props) }), /* @__PURE__ */ React$1.createElement(SetBarTooltipEntrySettings, {
|
|
24119
24819
|
dataKey: props.dataKey,
|
|
24120
24820
|
stroke: props.stroke,
|
|
24121
24821
|
strokeWidth: props.strokeWidth,
|
|
@@ -24124,7 +24824,7 @@ function BarFn(outsideProps) {
|
|
|
24124
24824
|
hide: props.hide,
|
|
24125
24825
|
unit: props.unit,
|
|
24126
24826
|
tooltipType: props.tooltipType
|
|
24127
|
-
}), /* @__PURE__ */ React.createElement(SetCartesianGraphicalItem, {
|
|
24827
|
+
}), /* @__PURE__ */ React$1.createElement(SetCartesianGraphicalItem, {
|
|
24128
24828
|
type: "bar",
|
|
24129
24829
|
id,
|
|
24130
24830
|
data: void 0,
|
|
@@ -24138,9 +24838,9 @@ function BarFn(outsideProps) {
|
|
|
24138
24838
|
minPointSize: props.minPointSize,
|
|
24139
24839
|
maxBarSize: props.maxBarSize,
|
|
24140
24840
|
isPanorama
|
|
24141
|
-
}), /* @__PURE__ */ React.createElement(ZIndexLayer, { zIndex: props.zIndex }, /* @__PURE__ */ React.createElement(BarImpl, _extends$3({}, props, { id })))));
|
|
24841
|
+
}), /* @__PURE__ */ React$1.createElement(ZIndexLayer, { zIndex: props.zIndex }, /* @__PURE__ */ React$1.createElement(BarImpl, _extends$3({}, props, { id })))));
|
|
24142
24842
|
}
|
|
24143
|
-
var Bar = /* @__PURE__ */ React.memo(BarFn, propsAreEqual);
|
|
24843
|
+
var Bar = /* @__PURE__ */ React$1.memo(BarFn, propsAreEqual);
|
|
24144
24844
|
Bar.displayName = "Bar";
|
|
24145
24845
|
function ownKeys$1(e$1, r$1) {
|
|
24146
24846
|
var t = Object.keys(e$1);
|
|
@@ -24485,7 +25185,7 @@ var ClipPathProvider = (_ref$1) => {
|
|
|
24485
25185
|
var plotArea = usePlotArea();
|
|
24486
25186
|
if (plotArea == null) return null;
|
|
24487
25187
|
var { x: x$2, y: y$2, width, height } = plotArea;
|
|
24488
|
-
return /* @__PURE__ */ React.createElement(ClipPathIdContext.Provider, { value: clipPathId }, /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("clipPath", { id: clipPathId }, /* @__PURE__ */ React.createElement("rect", {
|
|
25188
|
+
return /* @__PURE__ */ React$1.createElement(ClipPathIdContext.Provider, { value: clipPathId }, /* @__PURE__ */ React$1.createElement("defs", null, /* @__PURE__ */ React$1.createElement("clipPath", { id: clipPathId }, /* @__PURE__ */ React$1.createElement("rect", {
|
|
24489
25189
|
x: x$2,
|
|
24490
25190
|
y: y$2,
|
|
24491
25191
|
height,
|
|
@@ -24791,7 +25491,7 @@ function RechartsStoreProvider(_ref$1) {
|
|
|
24791
25491
|
if (isPanorama) return children;
|
|
24792
25492
|
if (storeRef.current == null) storeRef.current = createRechartsStore(preloadedState, reduxStoreName);
|
|
24793
25493
|
var nonNullContext = RechartsReduxContext;
|
|
24794
|
-
return /* @__PURE__ */ React.createElement(Provider_default, {
|
|
25494
|
+
return /* @__PURE__ */ React$1.createElement(Provider_default, {
|
|
24795
25495
|
context: nonNullContext,
|
|
24796
25496
|
store: storeRef.current
|
|
24797
25497
|
}, children);
|
|
@@ -24844,7 +25544,7 @@ function ZIndexSvgPortal(_ref$1) {
|
|
|
24844
25544
|
portalId,
|
|
24845
25545
|
isPanorama
|
|
24846
25546
|
]);
|
|
24847
|
-
return /* @__PURE__ */ React.createElement("g", {
|
|
25547
|
+
return /* @__PURE__ */ React$1.createElement("g", {
|
|
24848
25548
|
tabIndex: -1,
|
|
24849
25549
|
id: portalId
|
|
24850
25550
|
});
|
|
@@ -24855,11 +25555,11 @@ function AllZIndexPortals(_ref2) {
|
|
|
24855
25555
|
if (!allRegisteredZIndexes || allRegisteredZIndexes.length === 0) return children;
|
|
24856
25556
|
var allNegativeZIndexes = allRegisteredZIndexes.filter((zIndex) => zIndex < 0);
|
|
24857
25557
|
var allPositiveZIndexes = allRegisteredZIndexes.filter((zIndex) => zIndex > 0);
|
|
24858
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, allNegativeZIndexes.map((zIndex) => /* @__PURE__ */ React.createElement(ZIndexSvgPortal, {
|
|
25558
|
+
return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, allNegativeZIndexes.map((zIndex) => /* @__PURE__ */ React$1.createElement(ZIndexSvgPortal, {
|
|
24859
25559
|
key: zIndex,
|
|
24860
25560
|
zIndex,
|
|
24861
25561
|
isPanorama
|
|
24862
|
-
})), children, allPositiveZIndexes.map((zIndex) => /* @__PURE__ */ React.createElement(ZIndexSvgPortal, {
|
|
25562
|
+
})), children, allPositiveZIndexes.map((zIndex) => /* @__PURE__ */ React$1.createElement(ZIndexSvgPortal, {
|
|
24863
25563
|
key: zIndex,
|
|
24864
25564
|
zIndex,
|
|
24865
25565
|
isPanorama
|
|
@@ -24911,7 +25611,7 @@ var MainChartSurface = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
|
24911
25611
|
if (typeof otherAttributes.role === "string") role = otherAttributes.role;
|
|
24912
25612
|
else role = hasAccessibilityLayer ? "application" : void 0;
|
|
24913
25613
|
}
|
|
24914
|
-
return /* @__PURE__ */ React.createElement(Surface, _extends$2({}, otherAttributes, {
|
|
25614
|
+
return /* @__PURE__ */ React$1.createElement(Surface, _extends$2({}, otherAttributes, {
|
|
24915
25615
|
title,
|
|
24916
25616
|
desc,
|
|
24917
25617
|
role,
|
|
@@ -24927,7 +25627,7 @@ var BrushPanoramaSurface = (_ref$1) => {
|
|
|
24927
25627
|
var brushDimensions = useAppSelector(selectBrushDimensions);
|
|
24928
25628
|
if (!brushDimensions) return null;
|
|
24929
25629
|
var { width, height, y: y$2, x: x$2 } = brushDimensions;
|
|
24930
|
-
return /* @__PURE__ */ React.createElement(Surface, {
|
|
25630
|
+
return /* @__PURE__ */ React$1.createElement(Surface, {
|
|
24931
25631
|
width,
|
|
24932
25632
|
height,
|
|
24933
25633
|
x: x$2,
|
|
@@ -24936,8 +25636,8 @@ var BrushPanoramaSurface = (_ref$1) => {
|
|
|
24936
25636
|
};
|
|
24937
25637
|
var RootSurface = /* @__PURE__ */ forwardRef((_ref2, ref) => {
|
|
24938
25638
|
var { children } = _ref2, rest = _objectWithoutProperties$1(_ref2, _excluded$1);
|
|
24939
|
-
if (useIsPanorama()) return /* @__PURE__ */ React.createElement(BrushPanoramaSurface, null, /* @__PURE__ */ React.createElement(AllZIndexPortals, { isPanorama: true }, children));
|
|
24940
|
-
return /* @__PURE__ */ React.createElement(MainChartSurface, _extends$2({ ref }, rest), /* @__PURE__ */ React.createElement(AllZIndexPortals, { isPanorama: false }, children));
|
|
25639
|
+
if (useIsPanorama()) return /* @__PURE__ */ React$1.createElement(BrushPanoramaSurface, null, /* @__PURE__ */ React$1.createElement(AllZIndexPortals, { isPanorama: true }, children));
|
|
25640
|
+
return /* @__PURE__ */ React$1.createElement(MainChartSurface, _extends$2({ ref }, rest), /* @__PURE__ */ React$1.createElement(AllZIndexPortals, { isPanorama: false }, children));
|
|
24941
25641
|
});
|
|
24942
25642
|
function useReportScale() {
|
|
24943
25643
|
var dispatch = useAppDispatch();
|
|
@@ -25056,10 +25756,10 @@ var ResponsiveDiv = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
|
25056
25756
|
if (observer != null) observer.disconnect();
|
|
25057
25757
|
};
|
|
25058
25758
|
}, [setContainerSize]);
|
|
25059
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ReportChartSize, {
|
|
25759
|
+
return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(ReportChartSize, {
|
|
25060
25760
|
width: sizes.containerWidth,
|
|
25061
25761
|
height: sizes.containerHeight
|
|
25062
|
-
}), /* @__PURE__ */ React.createElement("div", _extends$1({ ref: innerRef }, props)));
|
|
25762
|
+
}), /* @__PURE__ */ React$1.createElement("div", _extends$1({ ref: innerRef }, props)));
|
|
25063
25763
|
});
|
|
25064
25764
|
var ReadSizeOnceDiv = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
25065
25765
|
var { width, height } = props;
|
|
@@ -25085,22 +25785,22 @@ var ReadSizeOnceDiv = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
|
25085
25785
|
setContainerSize(containerWidth, containerHeight);
|
|
25086
25786
|
}
|
|
25087
25787
|
}, [ref, setContainerSize]);
|
|
25088
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ReportChartSize, {
|
|
25788
|
+
return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(ReportChartSize, {
|
|
25089
25789
|
width: sizes.containerWidth,
|
|
25090
25790
|
height: sizes.containerHeight
|
|
25091
|
-
}), /* @__PURE__ */ React.createElement("div", _extends$1({ ref: innerRef }, props)));
|
|
25791
|
+
}), /* @__PURE__ */ React$1.createElement("div", _extends$1({ ref: innerRef }, props)));
|
|
25092
25792
|
});
|
|
25093
25793
|
var StaticDiv = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
25094
25794
|
var { width, height } = props;
|
|
25095
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ReportChartSize, {
|
|
25795
|
+
return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(ReportChartSize, {
|
|
25096
25796
|
width,
|
|
25097
25797
|
height
|
|
25098
|
-
}), /* @__PURE__ */ React.createElement("div", _extends$1({ ref }, props)));
|
|
25798
|
+
}), /* @__PURE__ */ React$1.createElement("div", _extends$1({ ref }, props)));
|
|
25099
25799
|
});
|
|
25100
25800
|
var NonResponsiveDiv = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
25101
25801
|
var { width, height } = props;
|
|
25102
|
-
if (isPercent(width) || isPercent(height)) return /* @__PURE__ */ React.createElement(ReadSizeOnceDiv, _extends$1({}, props, { ref }));
|
|
25103
|
-
return /* @__PURE__ */ React.createElement(StaticDiv, _extends$1({}, props, { ref }));
|
|
25802
|
+
if (isPercent(width) || isPercent(height)) return /* @__PURE__ */ React$1.createElement(ReadSizeOnceDiv, _extends$1({}, props, { ref }));
|
|
25803
|
+
return /* @__PURE__ */ React$1.createElement(StaticDiv, _extends$1({}, props, { ref }));
|
|
25104
25804
|
});
|
|
25105
25805
|
function getWrapperDivComponent(responsive) {
|
|
25106
25806
|
return responsive === true ? ResponsiveDiv : NonResponsiveDiv;
|
|
@@ -25209,7 +25909,7 @@ var RechartsWrapper = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
|
25209
25909
|
}));
|
|
25210
25910
|
}, [dispatch, onTouchEnd]);
|
|
25211
25911
|
var WrapperDiv = getWrapperDivComponent(responsive);
|
|
25212
|
-
return /* @__PURE__ */ React.createElement(TooltipPortalContext.Provider, { value: tooltipPortal }, /* @__PURE__ */ React.createElement(LegendPortalContext.Provider, { value: legendPortal }, /* @__PURE__ */ React.createElement(WrapperDiv, {
|
|
25912
|
+
return /* @__PURE__ */ React$1.createElement(TooltipPortalContext.Provider, { value: tooltipPortal }, /* @__PURE__ */ React$1.createElement(LegendPortalContext.Provider, { value: legendPortal }, /* @__PURE__ */ React$1.createElement(WrapperDiv, {
|
|
25213
25913
|
width: width !== null && width !== void 0 ? width : style === null || style === void 0 ? void 0 : style.width,
|
|
25214
25914
|
height: height !== null && height !== void 0 ? height : style === null || style === void 0 ? void 0 : style.height,
|
|
25215
25915
|
className: clsx("recharts-wrapper", className),
|
|
@@ -25233,7 +25933,7 @@ var RechartsWrapper = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
|
25233
25933
|
onTouchMove: myOnTouchMove,
|
|
25234
25934
|
onTouchStart: myOnTouchStart,
|
|
25235
25935
|
ref: innerRef
|
|
25236
|
-
}, /* @__PURE__ */ React.createElement(EventSynchronizer, null), children)));
|
|
25936
|
+
}, /* @__PURE__ */ React$1.createElement(EventSynchronizer, null), children)));
|
|
25237
25937
|
});
|
|
25238
25938
|
var _excluded = [
|
|
25239
25939
|
"width",
|
|
@@ -25267,15 +25967,15 @@ function _objectWithoutPropertiesLoose(r$1, e$1) {
|
|
|
25267
25967
|
var CategoricalChart = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
25268
25968
|
var { width, height, responsive, children, className, style, compact, title, desc } = props;
|
|
25269
25969
|
var attrs = svgPropertiesNoEvents(_objectWithoutProperties(props, _excluded));
|
|
25270
|
-
if (compact) return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ReportChartSize, {
|
|
25970
|
+
if (compact) return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(ReportChartSize, {
|
|
25271
25971
|
width,
|
|
25272
25972
|
height
|
|
25273
|
-
}), /* @__PURE__ */ React.createElement(RootSurface, {
|
|
25973
|
+
}), /* @__PURE__ */ React$1.createElement(RootSurface, {
|
|
25274
25974
|
otherAttributes: attrs,
|
|
25275
25975
|
title,
|
|
25276
25976
|
desc
|
|
25277
25977
|
}, children));
|
|
25278
|
-
return /* @__PURE__ */ React.createElement(RechartsWrapper, {
|
|
25978
|
+
return /* @__PURE__ */ React$1.createElement(RechartsWrapper, {
|
|
25279
25979
|
className,
|
|
25280
25980
|
style,
|
|
25281
25981
|
width,
|
|
@@ -25292,12 +25992,12 @@ var CategoricalChart = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
|
25292
25992
|
onTouchStart: props.onTouchStart,
|
|
25293
25993
|
onTouchMove: props.onTouchMove,
|
|
25294
25994
|
onTouchEnd: props.onTouchEnd
|
|
25295
|
-
}, /* @__PURE__ */ React.createElement(RootSurface, {
|
|
25995
|
+
}, /* @__PURE__ */ React$1.createElement(RootSurface, {
|
|
25296
25996
|
otherAttributes: attrs,
|
|
25297
25997
|
title,
|
|
25298
25998
|
desc,
|
|
25299
25999
|
ref
|
|
25300
|
-
}, /* @__PURE__ */ React.createElement(ClipPathProvider, null, children)));
|
|
26000
|
+
}, /* @__PURE__ */ React$1.createElement(ClipPathProvider, null, children)));
|
|
25301
26001
|
});
|
|
25302
26002
|
function _extends() {
|
|
25303
26003
|
return _extends = Object.assign ? Object.assign.bind() : function(n$1) {
|
|
@@ -25335,13 +26035,13 @@ var CartesianChart = /* @__PURE__ */ forwardRef(function CartesianChart$1(props,
|
|
|
25335
26035
|
tooltipPayloadSearcher,
|
|
25336
26036
|
eventEmitter: void 0
|
|
25337
26037
|
};
|
|
25338
|
-
return /* @__PURE__ */ React.createElement(RechartsStoreProvider, {
|
|
26038
|
+
return /* @__PURE__ */ React$1.createElement(RechartsStoreProvider, {
|
|
25339
26039
|
preloadedState: { options: options$1 },
|
|
25340
26040
|
reduxStoreName: (_categoricalChartProp = categoricalChartProps.id) !== null && _categoricalChartProp !== void 0 ? _categoricalChartProp : chartName
|
|
25341
|
-
}, /* @__PURE__ */ React.createElement(ChartDataContextProvider, { chartData: categoricalChartProps.data }), /* @__PURE__ */ React.createElement(ReportMainChartProps, {
|
|
26041
|
+
}, /* @__PURE__ */ React$1.createElement(ChartDataContextProvider, { chartData: categoricalChartProps.data }), /* @__PURE__ */ React$1.createElement(ReportMainChartProps, {
|
|
25342
26042
|
layout: rootChartProps.layout,
|
|
25343
26043
|
margin: rootChartProps.margin
|
|
25344
|
-
}), /* @__PURE__ */ React.createElement(ReportChartProps, {
|
|
26044
|
+
}), /* @__PURE__ */ React$1.createElement(ReportChartProps, {
|
|
25345
26045
|
baseValue: rootChartProps.baseValue,
|
|
25346
26046
|
accessibilityLayer: rootChartProps.accessibilityLayer,
|
|
25347
26047
|
barCategoryGap: rootChartProps.barCategoryGap,
|
|
@@ -25353,11 +26053,11 @@ var CartesianChart = /* @__PURE__ */ forwardRef(function CartesianChart$1(props,
|
|
|
25353
26053
|
syncMethod: rootChartProps.syncMethod,
|
|
25354
26054
|
className: rootChartProps.className,
|
|
25355
26055
|
reverseStackOrder: rootChartProps.reverseStackOrder
|
|
25356
|
-
}), /* @__PURE__ */ React.createElement(CategoricalChart, _extends({}, rootChartProps, { ref })));
|
|
26056
|
+
}), /* @__PURE__ */ React$1.createElement(CategoricalChart, _extends({}, rootChartProps, { ref })));
|
|
25357
26057
|
});
|
|
25358
26058
|
var allowedTooltipTypes = ["axis", "item"];
|
|
25359
26059
|
var BarChart = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
25360
|
-
return /* @__PURE__ */ React.createElement(CartesianChart, {
|
|
26060
|
+
return /* @__PURE__ */ React$1.createElement(CartesianChart, {
|
|
25361
26061
|
chartName: "BarChart",
|
|
25362
26062
|
defaultTooltipEventType: "axis",
|
|
25363
26063
|
validateTooltipEventTypes: allowedTooltipTypes,
|
|
@@ -25570,7 +26270,7 @@ const AICardGlass = forwardRef(({ onGenerate, features = defaultFeatures, estima
|
|
|
25570
26270
|
}, `feature-${i}`))
|
|
25571
26271
|
}),
|
|
25572
26272
|
/* @__PURE__ */ jsx(ButtonGlass, {
|
|
25573
|
-
variant: "
|
|
26273
|
+
variant: "default",
|
|
25574
26274
|
size: "sm",
|
|
25575
26275
|
icon: Zap,
|
|
25576
26276
|
onClick: onGenerate,
|
|
@@ -26100,7 +26800,7 @@ const RepositoryCardGlass = forwardRef(({ name, languages, commits, contribution
|
|
|
26100
26800
|
className: "flex-1",
|
|
26101
26801
|
children: "GitHub"
|
|
26102
26802
|
}), /* @__PURE__ */ jsx(ButtonGlass, {
|
|
26103
|
-
variant: "
|
|
26803
|
+
variant: "default",
|
|
26104
26804
|
size: "sm",
|
|
26105
26805
|
icon: Sparkles,
|
|
26106
26806
|
onClick: (e$1) => {
|
|
@@ -26437,7 +27137,7 @@ const YearCardGlass = forwardRef(({ year, emoji, label, commits, progress, isExp
|
|
|
26437
27137
|
}),
|
|
26438
27138
|
children,
|
|
26439
27139
|
onShowYear && /* @__PURE__ */ jsx(ButtonGlass, {
|
|
26440
|
-
variant: "
|
|
27140
|
+
variant: "default",
|
|
26441
27141
|
size: "sm",
|
|
26442
27142
|
onClick: (e$1) => {
|
|
26443
27143
|
e$1.stopPropagation();
|
|
@@ -26966,4 +27666,4 @@ const TrustScoreCardGlass = forwardRef(({ score = 72, metrics = [], className, .
|
|
|
26966
27666
|
TrustScoreCardGlass.displayName = "TrustScoreCardGlass";
|
|
26967
27667
|
export { BaseProgressGlass as $, buttonGlassVariants as $t, useChartHeight as A, GlassCard as At, adaptEventsOfChild as B, DropdownMenuGlassRadioGroup as Bt, sparklineContainerVariants as C, PopoverGlassLegacy as Ct, Tooltip as D, ModalGlass as Dt, Cell as E, notificationVariants as Et, selectLegendPayload as F, DropdownMenuGlassContent as Ft, SegmentedControlGlass as G, DropdownMenuGlassSubContent as Gt, isNumber as H, DropdownMenuGlassSeparator as Ht, useAppDispatch as I, DropdownMenuGlassGroup as It, progressSizes as J, ComboBoxGlass as Jt, RainbowProgressGlass as K, DropdownMenuGlassSubTrigger as Kt, useAppSelector as L, DropdownMenuGlassItem as Lt, useMargin as M, DropdownGlass as Mt, ResponsiveContainer as N, DropdownMenuGlass as Nt, setLegendSettings as O, modalSizes as Ot, useElementOffset as P, DropdownMenuGlassCheckboxItem as Pt, StatusIndicatorGlass as Q, ButtonGlass as Qt, getUniqPayload as R, DropdownMenuGlassLabel as Rt, sparklineBarVariants as S, PopoverGlassContent as St, Bar as T, NotificationGlass as Tt, useLegendPortal as U, DropdownMenuGlassShortcut as Ut, Symbols as V, DropdownMenuGlassRadioItem as Vt, Surface as W, DropdownMenuGlassSub as Wt, LanguageBarGlass as X, CircularProgressGlass as Xt, ProfileAvatarGlass as Y, inputVariants as Yt, FlagAlertGlass as Z, CheckboxGlass as Zt, ContributionMetricsGlass as _, SliderGlass as _t, HeaderBrandingGlass as a, AvatarGlassSimple as an, insightCardVariants as at, AICardGlass as b, PopoverGlass as bt, YearCardGlass as c, AlertGlass as cn, ExpandableHeaderGlass as ct, TrustScoreDisplayGlass as d, InteractiveCard as dn, TooltipGlassProvider as dt, BadgeGlass as en, ThemeToggleGlass as et, RepositoryMetadataGlass as f, FormFieldWrapper as fn, TooltipGlassSimple as ft, MetricCardGlass as g, TabsGlass as gt, MetricsGridGlass as h, toggleSizes as ht, HeaderNavGlass as i, AvatarGlassImage as in, InsightCardGlass as it, useChartWidth as j, cardIntensity as jt, setLegendSize as k, InputGlass as kt, UserStatsLineGlass as l, AlertGlassDescription as ln, TooltipGlass as lt, RepositoryCardGlass as m, alertVariants as mn, ToggleGlass as mt, ProjectsListGlass as n, AvatarGlass as nn, SortDropdownGlass as nt, FlagsSectionGlass as o, avatarSizes as on, insightVariantConfig as ot, RepositoryHeaderGlass as p, TouchTarget as pn, TooltipGlassTrigger as pt, ProgressGlass as q, DropdownMenuGlassTrigger as qt, ProfileHeaderGlass as r, AvatarGlassFallback as rn, SearchBoxGlass as rt, CareerStatsGlass as s, statusSizes as sn, IconButtonGlass as st, TrustScoreCardGlass as t, badgeVariants as tn, StatItemGlass as tt, UserInfoGlass as u, AlertGlassTitle as un, TooltipGlassContent as ut, CircularMetricGlass as v, SkeletonGlass as vt, BarChart as w, PopoverGlassTrigger as wt, SparklineGlass as x, PopoverGlassAnchor as xt, CareerStatsHeaderGlass as y, skeletonVariants as yt, resolveDefaultProps as z, DropdownMenuGlassPortal as zt };
|
|
26968
27668
|
|
|
26969
|
-
//# sourceMappingURL=trust-score-card-glass-
|
|
27669
|
+
//# sourceMappingURL=trust-score-card-glass-L9g0qamo.js.map
|