@bug-on/md3-react 3.0.0 → 3.0.2
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/.turbo/turbo-build.log +20 -12
- package/CHANGELOG.md +24 -0
- package/dist/index.css +178 -0
- package/dist/index.d.mts +65 -6
- package/dist/index.d.ts +65 -6
- package/dist/index.js +796 -487
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +742 -436
- package/dist/index.mjs.map +1 -1
- package/dist/plugin.d.mts +1 -0
- package/dist/plugin.d.ts +1 -0
- package/dist/plugin.js +13 -0
- package/dist/plugin.js.map +1 -0
- package/dist/plugin.mjs +3 -0
- package/dist/plugin.mjs.map +1 -0
- package/package.json +8 -2
- package/scripts/copy-assets.js +36 -3
- package/src/index.ts +9 -1
- package/src/lib/theme-utils.ts +19 -4
- package/src/plugin.ts +12 -0
- package/src/ui/button.test.tsx +19 -10
- package/src/ui/button.tsx +2 -6
- package/src/ui/navigation-bar.test.tsx +111 -0
- package/src/ui/navigation-bar.tsx +448 -0
- package/src/ui/navigation-rail.test.tsx +5 -4
- package/src/ui/navigation-rail.tsx +28 -26
- package/src/ui/scroll-area.tsx +4 -0
- package/src/ui/shared/constants.ts +13 -0
- package/src/ui/theme-provider/index.tsx +32 -7
- package/tsup.config.ts +3 -3
- package/test_output.txt +0 -164
- package/test_output_v2.txt +0 -5
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var React39 = require('react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var materialColorUtilities = require('@material/material-color-utilities');
|
|
7
7
|
var clsx = require('clsx');
|
|
@@ -33,7 +33,7 @@ function _interopNamespace(e) {
|
|
|
33
33
|
return Object.freeze(n);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var React39__namespace = /*#__PURE__*/_interopNamespace(React39);
|
|
37
37
|
var RxContextMenu__namespace = /*#__PURE__*/_interopNamespace(RxContextMenu);
|
|
38
38
|
var DropdownMenu__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu);
|
|
39
39
|
var RadixScrollArea__namespace = /*#__PURE__*/_interopNamespace(RadixScrollArea);
|
|
@@ -79,8 +79,8 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
79
79
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
80
80
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
81
81
|
function useMediaQuery(query) {
|
|
82
|
-
const [matches, setMatches] =
|
|
83
|
-
|
|
82
|
+
const [matches, setMatches] = React39.useState(false);
|
|
83
|
+
React39.useEffect(() => {
|
|
84
84
|
const mql = window.matchMedia(query);
|
|
85
85
|
const handler = (e) => setMatches(e.matches);
|
|
86
86
|
setMatches(mql.matches);
|
|
@@ -96,8 +96,8 @@ function useRipple(options = {}) {
|
|
|
96
96
|
opacity = 0.12,
|
|
97
97
|
disabled = false
|
|
98
98
|
} = options;
|
|
99
|
-
const ref =
|
|
100
|
-
const onPointerDown =
|
|
99
|
+
const ref = React39.useRef(null);
|
|
100
|
+
const onPointerDown = React39.useCallback(
|
|
101
101
|
(event) => {
|
|
102
102
|
if (disabled || !ref.current) return;
|
|
103
103
|
const el = ref.current;
|
|
@@ -178,6 +178,11 @@ function MaterialSymbolsPreconnect({
|
|
|
178
178
|
)
|
|
179
179
|
] });
|
|
180
180
|
}
|
|
181
|
+
function resolveMode(mode) {
|
|
182
|
+
if (mode !== "system") return mode;
|
|
183
|
+
if (typeof window === "undefined") return "light";
|
|
184
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
185
|
+
}
|
|
181
186
|
function generateM3Theme(sourceColorHex, mode = "light") {
|
|
182
187
|
const sourceColor = materialColorUtilities.argbFromHex(sourceColorHex);
|
|
183
188
|
const theme = materialColorUtilities.themeFromSourceColor(sourceColor);
|
|
@@ -236,13 +241,14 @@ function generateM3Theme(sourceColorHex, mode = "light") {
|
|
|
236
241
|
};
|
|
237
242
|
}
|
|
238
243
|
function applyTheme(sourceColorHex, mode = "light", root = document.documentElement) {
|
|
239
|
-
const
|
|
244
|
+
const resolved = resolveMode(mode);
|
|
245
|
+
const colors = generateM3Theme(sourceColorHex, resolved);
|
|
240
246
|
for (const [key, value] of Object.entries(colors)) {
|
|
241
|
-
const kebabKey = key.replace(/[A-Z]/g, (
|
|
247
|
+
const kebabKey = key.replace(/[A-Z]/g, (m48) => `-${m48.toLowerCase()}`);
|
|
242
248
|
root.style.setProperty(`--md-sys-color-${kebabKey}`, value);
|
|
243
249
|
root.style.setProperty(`--color-m3-${kebabKey}`, value);
|
|
244
250
|
}
|
|
245
|
-
root.setAttribute("data-theme",
|
|
251
|
+
root.setAttribute("data-theme", resolved);
|
|
246
252
|
}
|
|
247
253
|
function cn(...inputs) {
|
|
248
254
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -499,7 +505,7 @@ var SUBMENU_CONTAINER_VARIANTS = {
|
|
|
499
505
|
transition: FAST_EFFECTS_TRANSITION
|
|
500
506
|
}
|
|
501
507
|
};
|
|
502
|
-
var MenuContext =
|
|
508
|
+
var MenuContext = React39__namespace.createContext({
|
|
503
509
|
variant: "baseline",
|
|
504
510
|
colorVariant: "standard",
|
|
505
511
|
menuPrimitive: "dropdown",
|
|
@@ -515,15 +521,15 @@ function MenuProvider({
|
|
|
515
521
|
onOpenChange,
|
|
516
522
|
children
|
|
517
523
|
}) {
|
|
518
|
-
const value =
|
|
524
|
+
const value = React39__namespace.useMemo(
|
|
519
525
|
() => ({ variant, colorVariant, menuPrimitive, open, onOpenChange }),
|
|
520
526
|
[variant, colorVariant, menuPrimitive, open, onOpenChange]
|
|
521
527
|
);
|
|
522
528
|
return /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value, children });
|
|
523
529
|
}
|
|
524
530
|
function useMenuContext() {
|
|
525
|
-
const ctx =
|
|
526
|
-
return
|
|
531
|
+
const ctx = React39__namespace.useContext(MenuContext);
|
|
532
|
+
return React39__namespace.useMemo(
|
|
527
533
|
() => __spreadProps(__spreadValues({}, ctx), {
|
|
528
534
|
isStatic: ctx.menuPrimitive === "static",
|
|
529
535
|
menuVariant: ctx.variant
|
|
@@ -640,7 +646,7 @@ function ContextMenu({
|
|
|
640
646
|
variant = "baseline",
|
|
641
647
|
colorVariant = "standard"
|
|
642
648
|
}) {
|
|
643
|
-
const [open, setOpen] =
|
|
649
|
+
const [open, setOpen] = React39__namespace.useState(false);
|
|
644
650
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
645
651
|
MenuProvider,
|
|
646
652
|
{
|
|
@@ -654,12 +660,12 @@ function ContextMenu({
|
|
|
654
660
|
);
|
|
655
661
|
}
|
|
656
662
|
ContextMenu.displayName = "ContextMenu";
|
|
657
|
-
var ContextMenuTrigger =
|
|
663
|
+
var ContextMenuTrigger = React39__namespace.forwardRef((_a, ref) => {
|
|
658
664
|
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
659
665
|
return /* @__PURE__ */ jsxRuntime.jsx(RxContextMenu__namespace.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
660
666
|
});
|
|
661
667
|
ContextMenuTrigger.displayName = "ContextMenuTrigger";
|
|
662
|
-
var ContextMenuContent =
|
|
668
|
+
var ContextMenuContent = React39__namespace.forwardRef(
|
|
663
669
|
(_a, ref) => {
|
|
664
670
|
var _b = _a, {
|
|
665
671
|
children,
|
|
@@ -707,10 +713,10 @@ var ContextMenuContent = React38__namespace.forwardRef(
|
|
|
707
713
|
className
|
|
708
714
|
);
|
|
709
715
|
const flattenChildren = (nodes) => {
|
|
710
|
-
return
|
|
716
|
+
return React39__namespace.Children.toArray(nodes).reduce(
|
|
711
717
|
(acc, child) => {
|
|
712
|
-
if (
|
|
713
|
-
if (child.type ===
|
|
718
|
+
if (React39__namespace.isValidElement(child)) {
|
|
719
|
+
if (child.type === React39__namespace.Fragment) {
|
|
714
720
|
return acc.concat(
|
|
715
721
|
flattenChildren(
|
|
716
722
|
child.props.children
|
|
@@ -729,7 +735,7 @@ var ContextMenuContent = React38__namespace.forwardRef(
|
|
|
729
735
|
const validChildren = flattenChildren(children);
|
|
730
736
|
const groupCount = validChildren.length;
|
|
731
737
|
const enhancedChildren = validChildren.map(
|
|
732
|
-
(child, i) =>
|
|
738
|
+
(child, i) => React39__namespace.cloneElement(
|
|
733
739
|
child,
|
|
734
740
|
{
|
|
735
741
|
index: i,
|
|
@@ -793,12 +799,12 @@ function Menu(_a) {
|
|
|
793
799
|
]);
|
|
794
800
|
var _a2;
|
|
795
801
|
const resolvedVariant = (_a2 = variant != null ? variant : menuVariant) != null ? _a2 : "baseline";
|
|
796
|
-
const [internalOpen, setInternalOpen] =
|
|
802
|
+
const [internalOpen, setInternalOpen] = React39__namespace.useState(
|
|
797
803
|
() => defaultOpen != null ? defaultOpen : false
|
|
798
804
|
);
|
|
799
805
|
const isControlled = controlledOpen !== void 0;
|
|
800
806
|
const open = isControlled ? controlledOpen : internalOpen;
|
|
801
|
-
const handleOpenChange =
|
|
807
|
+
const handleOpenChange = React39__namespace.useCallback(
|
|
802
808
|
(next) => {
|
|
803
809
|
if (!isControlled) setInternalOpen(next);
|
|
804
810
|
controlledOnOpenChange == null ? void 0 : controlledOnOpenChange(next);
|
|
@@ -825,12 +831,12 @@ function Menu(_a) {
|
|
|
825
831
|
);
|
|
826
832
|
}
|
|
827
833
|
Menu.displayName = "Menu";
|
|
828
|
-
var MenuTrigger =
|
|
834
|
+
var MenuTrigger = React39__namespace.forwardRef((_a, ref) => {
|
|
829
835
|
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
830
836
|
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
831
837
|
});
|
|
832
838
|
MenuTrigger.displayName = "MenuTrigger";
|
|
833
|
-
var MenuContent =
|
|
839
|
+
var MenuContent = React39__namespace.forwardRef(
|
|
834
840
|
(_a, ref) => {
|
|
835
841
|
var _b = _a, {
|
|
836
842
|
children,
|
|
@@ -884,10 +890,10 @@ var MenuContent = React38__namespace.forwardRef(
|
|
|
884
890
|
className
|
|
885
891
|
);
|
|
886
892
|
const flattenChildren = (nodes) => {
|
|
887
|
-
return
|
|
893
|
+
return React39__namespace.Children.toArray(nodes).reduce(
|
|
888
894
|
(acc, child) => {
|
|
889
|
-
if (
|
|
890
|
-
if (child.type ===
|
|
895
|
+
if (React39__namespace.isValidElement(child)) {
|
|
896
|
+
if (child.type === React39__namespace.Fragment) {
|
|
891
897
|
return acc.concat(
|
|
892
898
|
flattenChildren(
|
|
893
899
|
child.props.children
|
|
@@ -906,7 +912,7 @@ var MenuContent = React38__namespace.forwardRef(
|
|
|
906
912
|
const validChildren = flattenChildren(children);
|
|
907
913
|
const groupCount = validChildren.length;
|
|
908
914
|
const enhancedChildren = validChildren.map(
|
|
909
|
-
(child, i) =>
|
|
915
|
+
(child, i) => React39__namespace.cloneElement(child, {
|
|
910
916
|
index: i,
|
|
911
917
|
count: groupCount,
|
|
912
918
|
isGapVariant: isExpressiveGap
|
|
@@ -961,7 +967,7 @@ var MenuContent = React38__namespace.forwardRef(
|
|
|
961
967
|
}
|
|
962
968
|
);
|
|
963
969
|
MenuContent.displayName = "MenuContent";
|
|
964
|
-
var MenuDivider =
|
|
970
|
+
var MenuDivider = React39__namespace.forwardRef(
|
|
965
971
|
(_a, ref) => {
|
|
966
972
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
967
973
|
const { menuVariant } = useMenuContext();
|
|
@@ -992,7 +998,7 @@ function getGroupPosition(index, count) {
|
|
|
992
998
|
function getGroupActiveShape(position) {
|
|
993
999
|
return GROUP_SHAPES[`${position}Active`];
|
|
994
1000
|
}
|
|
995
|
-
var MenuGroup =
|
|
1001
|
+
var MenuGroup = React39__namespace.forwardRef(
|
|
996
1002
|
(_a, ref) => {
|
|
997
1003
|
var _b = _a, {
|
|
998
1004
|
children,
|
|
@@ -1022,15 +1028,15 @@ var MenuGroup = React38__namespace.forwardRef(
|
|
|
1022
1028
|
const colors = menuVariant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1023
1029
|
const position = getGroupPosition(index, count);
|
|
1024
1030
|
const activeShape = getGroupActiveShape(position);
|
|
1025
|
-
const [isHovered, setIsHovered] =
|
|
1031
|
+
const [isHovered, setIsHovered] = React39__namespace.useState(false);
|
|
1026
1032
|
const currentShape = isStatic || isHovered ? activeShape : GROUP_SHAPES.inactive;
|
|
1027
|
-
const handlePointerEnter =
|
|
1028
|
-
const handlePointerLeave =
|
|
1033
|
+
const handlePointerEnter = React39__namespace.useCallback(() => setIsHovered(true), []);
|
|
1034
|
+
const handlePointerLeave = React39__namespace.useCallback(() => setIsHovered(false), []);
|
|
1029
1035
|
const flattenChildren = (children2) => {
|
|
1030
|
-
return
|
|
1036
|
+
return React39__namespace.Children.toArray(children2).reduce(
|
|
1031
1037
|
(acc, child) => {
|
|
1032
|
-
if (
|
|
1033
|
-
if (child.type ===
|
|
1038
|
+
if (React39__namespace.isValidElement(child)) {
|
|
1039
|
+
if (child.type === React39__namespace.Fragment) {
|
|
1034
1040
|
return acc.concat(
|
|
1035
1041
|
flattenChildren(
|
|
1036
1042
|
child.props.children
|
|
@@ -1048,7 +1054,7 @@ var MenuGroup = React38__namespace.forwardRef(
|
|
|
1048
1054
|
const itemCount = validChildren.length;
|
|
1049
1055
|
const enhancedChildren = validChildren.map((child, i) => {
|
|
1050
1056
|
const itemPosition2 = itemCount === 1 ? "standalone" : i === 0 ? "leading" : i === itemCount - 1 ? "trailing" : "middle";
|
|
1051
|
-
return
|
|
1057
|
+
return React39__namespace.cloneElement(child, {
|
|
1052
1058
|
itemPosition: itemPosition2,
|
|
1053
1059
|
colorVariant
|
|
1054
1060
|
});
|
|
@@ -1111,6 +1117,11 @@ var SPRING_TRANSITION = {
|
|
|
1111
1117
|
bounce: 0,
|
|
1112
1118
|
duration: 0.3
|
|
1113
1119
|
};
|
|
1120
|
+
var SPRING_TRANSITION_EXPRESSIVE = {
|
|
1121
|
+
type: "spring",
|
|
1122
|
+
bounce: 0.45,
|
|
1123
|
+
duration: 0.4
|
|
1124
|
+
};
|
|
1114
1125
|
var ICON_SPAN_VARIANTS = {
|
|
1115
1126
|
initial: { scale: 0.01 },
|
|
1116
1127
|
animate: { scale: 1 },
|
|
@@ -1131,7 +1142,7 @@ var VARIANT_FONT = {
|
|
|
1131
1142
|
rounded: "'Material Symbols Rounded'",
|
|
1132
1143
|
sharp: "'Material Symbols Sharp'"
|
|
1133
1144
|
};
|
|
1134
|
-
var IconComponent =
|
|
1145
|
+
var IconComponent = React39__namespace.forwardRef(
|
|
1135
1146
|
(_a, ref) => {
|
|
1136
1147
|
var _b = _a, {
|
|
1137
1148
|
name,
|
|
@@ -1197,14 +1208,14 @@ var IconComponent = React38__namespace.forwardRef(
|
|
|
1197
1208
|
}
|
|
1198
1209
|
);
|
|
1199
1210
|
IconComponent.displayName = "Icon";
|
|
1200
|
-
var Icon =
|
|
1211
|
+
var Icon = React39__namespace.memo(IconComponent);
|
|
1201
1212
|
function getItemShapeClass(position, selected, isStatic = false, menuVariant = "expressive") {
|
|
1202
1213
|
if (menuVariant === "baseline") return BASELINE_ITEM_SHAPE;
|
|
1203
1214
|
if (selected) return ITEM_SHAPE_CLASSES.selected;
|
|
1204
1215
|
if (isStatic && position === "standalone") return "rounded-[12px]";
|
|
1205
1216
|
return ITEM_SHAPE_CLASSES[position];
|
|
1206
1217
|
}
|
|
1207
|
-
var MenuItem =
|
|
1218
|
+
var MenuItem = React39__namespace.forwardRef(
|
|
1208
1219
|
(_a, ref) => {
|
|
1209
1220
|
var _b = _a, {
|
|
1210
1221
|
children,
|
|
@@ -1406,31 +1417,31 @@ function SubMenu({
|
|
|
1406
1417
|
}) {
|
|
1407
1418
|
const { colorVariant: contextColorVariant, menuPrimitive } = useMenuContext();
|
|
1408
1419
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1409
|
-
const [open, setOpen] =
|
|
1410
|
-
const openTimerRef =
|
|
1411
|
-
const closeTimerRef =
|
|
1420
|
+
const [open, setOpen] = React39__namespace.useState(false);
|
|
1421
|
+
const openTimerRef = React39__namespace.useRef(null);
|
|
1422
|
+
const closeTimerRef = React39__namespace.useRef(
|
|
1412
1423
|
null
|
|
1413
1424
|
);
|
|
1414
|
-
const clearTimers =
|
|
1425
|
+
const clearTimers = React39__namespace.useCallback(() => {
|
|
1415
1426
|
if (openTimerRef.current) clearTimeout(openTimerRef.current);
|
|
1416
1427
|
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
1417
1428
|
}, []);
|
|
1418
|
-
const handleTriggerPointerEnter =
|
|
1429
|
+
const handleTriggerPointerEnter = React39__namespace.useCallback(() => {
|
|
1419
1430
|
clearTimers();
|
|
1420
1431
|
openTimerRef.current = setTimeout(() => setOpen(true), hoverOpenDelay);
|
|
1421
1432
|
}, [hoverOpenDelay, clearTimers]);
|
|
1422
|
-
const handleTriggerPointerLeave =
|
|
1433
|
+
const handleTriggerPointerLeave = React39__namespace.useCallback(() => {
|
|
1423
1434
|
clearTimers();
|
|
1424
1435
|
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1425
1436
|
}, [hoverCloseDelay, clearTimers]);
|
|
1426
|
-
const handleContentPointerEnter =
|
|
1437
|
+
const handleContentPointerEnter = React39__namespace.useCallback(() => {
|
|
1427
1438
|
clearTimers();
|
|
1428
1439
|
}, [clearTimers]);
|
|
1429
|
-
const handleContentPointerLeave =
|
|
1440
|
+
const handleContentPointerLeave = React39__namespace.useCallback(() => {
|
|
1430
1441
|
clearTimers();
|
|
1431
1442
|
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1432
1443
|
}, [hoverCloseDelay, clearTimers]);
|
|
1433
|
-
|
|
1444
|
+
React39__namespace.useEffect(() => () => clearTimers(), [clearTimers]);
|
|
1434
1445
|
const Sub3 = menuPrimitive === "context" ? RxContextMenu__namespace.Sub : DropdownMenu__namespace.Sub;
|
|
1435
1446
|
const SubTrigger3 = menuPrimitive === "context" ? RxContextMenu__namespace.SubTrigger : DropdownMenu__namespace.SubTrigger;
|
|
1436
1447
|
const SubContent3 = menuPrimitive === "context" ? RxContextMenu__namespace.SubContent : DropdownMenu__namespace.SubContent;
|
|
@@ -1442,7 +1453,7 @@ function SubMenu({
|
|
|
1442
1453
|
className: "w-full outline-none",
|
|
1443
1454
|
onPointerEnter: handleTriggerPointerEnter,
|
|
1444
1455
|
onPointerLeave: handleTriggerPointerLeave,
|
|
1445
|
-
children:
|
|
1456
|
+
children: React39__namespace.isValidElement(trigger) ? React39__namespace.cloneElement(trigger, {
|
|
1446
1457
|
isSubTrigger: true,
|
|
1447
1458
|
// Auto-add chevron if missing
|
|
1448
1459
|
trailingIcon: trigger.props.trailingIcon || /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron_right", size: 20 })
|
|
@@ -1519,7 +1530,7 @@ function SubMenuContent({
|
|
|
1519
1530
|
);
|
|
1520
1531
|
}
|
|
1521
1532
|
SubMenuContent.displayName = "SubMenuContent";
|
|
1522
|
-
var VerticalMenuDivider =
|
|
1533
|
+
var VerticalMenuDivider = React39__namespace.forwardRef((_a, ref) => {
|
|
1523
1534
|
var _b = _a, { className, index, count, isGapVariant } = _b, props = __objRest(_b, ["className", "index", "count", "isGapVariant"]);
|
|
1524
1535
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1525
1536
|
"hr",
|
|
@@ -1539,7 +1550,7 @@ var VerticalMenuDivider = React38__namespace.forwardRef((_a, ref) => {
|
|
|
1539
1550
|
});
|
|
1540
1551
|
VerticalMenuDivider.displayName = "VerticalMenuDivider";
|
|
1541
1552
|
var VerticalMenuGroup = MenuGroup;
|
|
1542
|
-
var VerticalMenuContent =
|
|
1553
|
+
var VerticalMenuContent = React39__namespace.forwardRef(
|
|
1543
1554
|
(_a, ref) => {
|
|
1544
1555
|
var _b = _a, {
|
|
1545
1556
|
children,
|
|
@@ -1556,10 +1567,10 @@ var VerticalMenuContent = React38__namespace.forwardRef(
|
|
|
1556
1567
|
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1557
1568
|
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1558
1569
|
const flattenChildren = (children2) => {
|
|
1559
|
-
return
|
|
1570
|
+
return React39__namespace.Children.toArray(children2).reduce(
|
|
1560
1571
|
(acc, child) => {
|
|
1561
|
-
if (
|
|
1562
|
-
if (child.type ===
|
|
1572
|
+
if (React39__namespace.isValidElement(child)) {
|
|
1573
|
+
if (child.type === React39__namespace.Fragment) {
|
|
1563
1574
|
return acc.concat(
|
|
1564
1575
|
flattenChildren(
|
|
1565
1576
|
child.props.children
|
|
@@ -1576,7 +1587,7 @@ var VerticalMenuContent = React38__namespace.forwardRef(
|
|
|
1576
1587
|
const validChildren = flattenChildren(children);
|
|
1577
1588
|
const groupCount = validChildren.length;
|
|
1578
1589
|
const enhancedChildren = validChildren.map(
|
|
1579
|
-
(child, i) =>
|
|
1590
|
+
(child, i) => React39__namespace.cloneElement(child, {
|
|
1580
1591
|
index: i,
|
|
1581
1592
|
count: groupCount,
|
|
1582
1593
|
isGapVariant: separatorStyle === "gap"
|
|
@@ -1613,13 +1624,13 @@ var VerticalMenuContent = React38__namespace.forwardRef(
|
|
|
1613
1624
|
}
|
|
1614
1625
|
);
|
|
1615
1626
|
VerticalMenuContent.displayName = "VerticalMenuContent";
|
|
1616
|
-
var VerticalMenu =
|
|
1627
|
+
var VerticalMenu = React39__namespace.forwardRef((_a, ref) => {
|
|
1617
1628
|
var _b = _a, { children, colorVariant = "standard", className } = _b, props = __objRest(_b, ["children", "colorVariant", "className"]);
|
|
1618
|
-
const noop =
|
|
1629
|
+
const noop = React39__namespace.useCallback(() => {
|
|
1619
1630
|
}, []);
|
|
1620
1631
|
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1621
|
-
const containerRef =
|
|
1622
|
-
const mergedRef =
|
|
1632
|
+
const containerRef = React39__namespace.useRef(null);
|
|
1633
|
+
const mergedRef = React39__namespace.useCallback(
|
|
1623
1634
|
(node) => {
|
|
1624
1635
|
containerRef.current = node;
|
|
1625
1636
|
if (typeof ref === "function") ref(node);
|
|
@@ -1628,7 +1639,7 @@ var VerticalMenu = React38__namespace.forwardRef((_a, ref) => {
|
|
|
1628
1639
|
},
|
|
1629
1640
|
[ref]
|
|
1630
1641
|
);
|
|
1631
|
-
const handleKeyDown =
|
|
1642
|
+
const handleKeyDown = React39__namespace.useCallback(
|
|
1632
1643
|
(e) => {
|
|
1633
1644
|
var _a2;
|
|
1634
1645
|
if (!containerRef.current) return;
|
|
@@ -1711,7 +1722,7 @@ var VerticalMenu = React38__namespace.forwardRef((_a, ref) => {
|
|
|
1711
1722
|
});
|
|
1712
1723
|
VerticalMenu.displayName = "VerticalMenu";
|
|
1713
1724
|
function detectSeparatorStyle(children) {
|
|
1714
|
-
const child =
|
|
1725
|
+
const child = React39__namespace.Children.toArray(children).find(React39__namespace.isValidElement);
|
|
1715
1726
|
if (child) {
|
|
1716
1727
|
const style = child.props.separatorStyle;
|
|
1717
1728
|
if (style) return style;
|
|
@@ -1792,11 +1803,11 @@ function AppBarColumn({
|
|
|
1792
1803
|
maxItemCount,
|
|
1793
1804
|
className
|
|
1794
1805
|
}) {
|
|
1795
|
-
const containerRef =
|
|
1796
|
-
const [visibleCount, setVisibleCount] =
|
|
1806
|
+
const containerRef = React39__namespace.useRef(null);
|
|
1807
|
+
const [visibleCount, setVisibleCount] = React39__namespace.useState(
|
|
1797
1808
|
maxItemCount != null ? maxItemCount : items.length
|
|
1798
1809
|
);
|
|
1799
|
-
|
|
1810
|
+
React39__namespace.useEffect(() => {
|
|
1800
1811
|
if (maxItemCount !== void 0) {
|
|
1801
1812
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
1802
1813
|
return;
|
|
@@ -1844,11 +1855,11 @@ function AppBarColumn({
|
|
|
1844
1855
|
);
|
|
1845
1856
|
}
|
|
1846
1857
|
function AppBarRow({ items, maxItemCount, className }) {
|
|
1847
|
-
const containerRef =
|
|
1848
|
-
const [visibleCount, setVisibleCount] =
|
|
1858
|
+
const containerRef = React39__namespace.useRef(null);
|
|
1859
|
+
const [visibleCount, setVisibleCount] = React39__namespace.useState(
|
|
1849
1860
|
maxItemCount != null ? maxItemCount : items.length
|
|
1850
1861
|
);
|
|
1851
|
-
|
|
1862
|
+
React39__namespace.useEffect(() => {
|
|
1852
1863
|
if (maxItemCount !== void 0) {
|
|
1853
1864
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
1854
1865
|
return;
|
|
@@ -1902,12 +1913,12 @@ function useAppBarScroll({
|
|
|
1902
1913
|
collapsedHeight = 64,
|
|
1903
1914
|
expandedHeight = 112
|
|
1904
1915
|
} = {}) {
|
|
1905
|
-
const [isScrolled, setIsScrolled] =
|
|
1906
|
-
const [collapsedFraction, setCollapsedFraction] =
|
|
1907
|
-
const [isHidden, setIsHidden] =
|
|
1908
|
-
const prevScrollYRef =
|
|
1916
|
+
const [isScrolled, setIsScrolled] = React39__namespace.useState(false);
|
|
1917
|
+
const [collapsedFraction, setCollapsedFraction] = React39__namespace.useState(0);
|
|
1918
|
+
const [isHidden, setIsHidden] = React39__namespace.useState(false);
|
|
1919
|
+
const prevScrollYRef = React39__namespace.useRef(0);
|
|
1909
1920
|
const hideThreshold = 64;
|
|
1910
|
-
|
|
1921
|
+
React39__namespace.useEffect(() => {
|
|
1911
1922
|
var _a;
|
|
1912
1923
|
const scrollDistance = expandedHeight - collapsedHeight;
|
|
1913
1924
|
const getScrollY = () => {
|
|
@@ -2028,7 +2039,7 @@ function useFlexibleAppBar({
|
|
|
2028
2039
|
expandedHeight
|
|
2029
2040
|
});
|
|
2030
2041
|
const scrollProgress = react.useMotionValue(0);
|
|
2031
|
-
|
|
2042
|
+
React39__namespace.useEffect(() => {
|
|
2032
2043
|
scrollProgress.set(
|
|
2033
2044
|
shouldReduceMotion ? collapsedFraction > 0.5 ? 1 : 0 : collapsedFraction
|
|
2034
2045
|
);
|
|
@@ -2369,7 +2380,7 @@ function SearchAppBar({
|
|
|
2369
2380
|
}) {
|
|
2370
2381
|
var _a, _b;
|
|
2371
2382
|
const shouldReduceMotion = react.useReducedMotion();
|
|
2372
|
-
const [isSearchOpen, setIsSearchOpen] =
|
|
2383
|
+
const [isSearchOpen, setIsSearchOpen] = React39__namespace.useState(false);
|
|
2373
2384
|
const { isScrolled } = useAppBarScroll({
|
|
2374
2385
|
scrollElement,
|
|
2375
2386
|
behavior: scrollBehavior === "exitUntilCollapsed" ? "pinned" : scrollBehavior
|
|
@@ -2483,8 +2494,8 @@ function SearchView({
|
|
|
2483
2494
|
className
|
|
2484
2495
|
}) {
|
|
2485
2496
|
const shouldReduceMotion = react.useReducedMotion();
|
|
2486
|
-
const inputRef =
|
|
2487
|
-
|
|
2497
|
+
const inputRef = React39__namespace.useRef(null);
|
|
2498
|
+
React39__namespace.useEffect(() => {
|
|
2488
2499
|
const timer = window.setTimeout(() => {
|
|
2489
2500
|
var _a;
|
|
2490
2501
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -2754,9 +2765,9 @@ function formatBadgeLabel(children, max) {
|
|
|
2754
2765
|
return "";
|
|
2755
2766
|
}
|
|
2756
2767
|
function detectBadgeHasContent(badge) {
|
|
2757
|
-
return
|
|
2768
|
+
return React39__namespace.isValidElement(badge) && badge.props.children != null;
|
|
2758
2769
|
}
|
|
2759
|
-
var BadgeImpl =
|
|
2770
|
+
var BadgeImpl = React39__namespace.forwardRef(
|
|
2760
2771
|
(_a, ref) => {
|
|
2761
2772
|
var _b = _a, {
|
|
2762
2773
|
children,
|
|
@@ -2810,7 +2821,7 @@ var BadgeImpl = React38__namespace.forwardRef(
|
|
|
2810
2821
|
}
|
|
2811
2822
|
);
|
|
2812
2823
|
BadgeImpl.displayName = "Badge";
|
|
2813
|
-
var Badge =
|
|
2824
|
+
var Badge = React39__namespace.memo(BadgeImpl);
|
|
2814
2825
|
function BadgedBox({
|
|
2815
2826
|
badge,
|
|
2816
2827
|
children,
|
|
@@ -2876,11 +2887,11 @@ var ROTATE_KEY_SPLINES = [
|
|
|
2876
2887
|
var ROTATE_VALUES = "0 24 24; 154 24 24; 309 24 24; 463 24 24; 617 24 24; 771 24 24; 926 24 24; 1080 24 24";
|
|
2877
2888
|
var DETERMINATE_CIRCLE = "M24 7 C34.49 7 41 13.51 41 24 C41 34.49 34.49 41 24 41 C13.51 41 7 34.49 7 24 C7 13.51 13.51 7 24 7 Z";
|
|
2878
2889
|
var DETERMINATE_SOFT_BURST = "M20.9 10.4 21.4 9.5 21.9 8.7 22.5 7.8 23.2 7.2 24.2 7 25.1 7.4 25.7 8.1 26.2 9 26.8 9.8 27.3 10.6 28.1 11.2 29 11.3 30 11 30.9 10.6 31.8 10.3 32.8 9.9 33.7 10 34.5 10.6 34.9 11.5 34.8 12.5 34.8 13.5 34.7 14.5 34.7 15.5 35.2 16.3 36 16.8 37 17.1 37.9 17.3 38.9 17.5 39.8 17.9 40.4 18.7 40.5 19.7 40 20.5 39.4 21.3 38.7 22 38.1 22.8 37.6 23.7 37.7 24.6 38.3 25.5 38.9 26.2 39.6 27 40.2 27.7 40.5 28.7 40.3 29.6 39.5 30.3 38.6 30.6 37.6 30.8 36.7 31 35.7 31.3 35 31.9 34.6 32.8 34.7 33.8 34.8 34.8 34.9 35.8 34.8 36.8 34.3 37.6 33.4 38.1 32.4 38 31.5 37.6 30.6 37.2 29.7 36.9 28.7 36.6 27.8 36.9 27.1 37.6 26.6 38.5 26.1 39.3 25.5 40.2 24.8 40.8 23.8 41 22.9 40.6 22.3 39.9 21.8 39 21.2 38.2 20.7 37.4 19.9 36.8 19 36.7 18 37 17.1 37.4 16.2 37.7 15.2 38.1 14.3 38 13.5 37.4 13.1 36.5 13.2 35.5 13.2 34.5 13.3 33.5 13.3 32.5 12.8 31.7 12 31.2 11 31 10.1 30.7 9.1 30.5 8.2 30.1 7.6 29.3 7.5 28.3 8 27.5 8.7 26.7 9.3 26 9.9 25.2 10.4 24.3 10.3 23.4 9.7 22.5 9.1 21.8 8.4 21 7.8 20.3 7.5 19.3 7.7 18.4 8.5 17.7 9.4 17.4 10.4 17.2 11.3 17 12.3 16.7 13 16.1 13.4 15.2 13.3 14.2 13.2 13.2 13.1 12.2 13.2 11.2 13.7 10.4 14.6 9.9 15.6 10 16.5 10.4 17.4 10.8 18.3 11.1 19.3 11.4 20.2 11.1Z";
|
|
2879
|
-
var IndeterminateSvg =
|
|
2890
|
+
var IndeterminateSvg = React39__namespace.memo(function IndeterminateSvg2({
|
|
2880
2891
|
size
|
|
2881
2892
|
}) {
|
|
2882
|
-
const [ready, setReady] =
|
|
2883
|
-
|
|
2893
|
+
const [ready, setReady] = React39__namespace.useState(false);
|
|
2894
|
+
React39__namespace.useEffect(() => {
|
|
2884
2895
|
const raf = requestAnimationFrame(() => setReady(true));
|
|
2885
2896
|
return () => cancelAnimationFrame(raf);
|
|
2886
2897
|
}, []);
|
|
@@ -2925,7 +2936,7 @@ var IndeterminateSvg = React38__namespace.memo(function IndeterminateSvg2({
|
|
|
2925
2936
|
}
|
|
2926
2937
|
);
|
|
2927
2938
|
});
|
|
2928
|
-
var DeterminateSvg =
|
|
2939
|
+
var DeterminateSvg = React39__namespace.memo(function DeterminateSvg2({
|
|
2929
2940
|
size,
|
|
2930
2941
|
progress
|
|
2931
2942
|
}) {
|
|
@@ -2950,7 +2961,7 @@ var DeterminateSvg = React38__namespace.memo(function DeterminateSvg2({
|
|
|
2950
2961
|
}
|
|
2951
2962
|
);
|
|
2952
2963
|
});
|
|
2953
|
-
var LoadingIndicator =
|
|
2964
|
+
var LoadingIndicator = React39__namespace.forwardRef(
|
|
2954
2965
|
(_a, ref) => {
|
|
2955
2966
|
var _b = _a, {
|
|
2956
2967
|
variant = "uncontained",
|
|
@@ -3065,7 +3076,7 @@ function getSinePath(startX, endX, phase, wl, amp) {
|
|
|
3065
3076
|
d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
|
|
3066
3077
|
return d;
|
|
3067
3078
|
}
|
|
3068
|
-
var CircularProgress =
|
|
3079
|
+
var CircularProgress = React39__namespace.forwardRef(
|
|
3069
3080
|
(_a, ref) => {
|
|
3070
3081
|
var _b = _a, {
|
|
3071
3082
|
value,
|
|
@@ -3103,15 +3114,15 @@ var CircularProgress = React38__namespace.forwardRef(
|
|
|
3103
3114
|
const isWavy = shape === "wavy";
|
|
3104
3115
|
const BASELINE_SIZE = 48;
|
|
3105
3116
|
const scaleFactor = size / BASELINE_SIZE;
|
|
3106
|
-
const effectiveAmplitude =
|
|
3117
|
+
const effectiveAmplitude = React39__namespace.useMemo(
|
|
3107
3118
|
() => amplitude != null ? amplitude : 1.6 * scaleFactor,
|
|
3108
3119
|
[amplitude, scaleFactor]
|
|
3109
3120
|
);
|
|
3110
|
-
const effectiveWavelength =
|
|
3121
|
+
const effectiveWavelength = React39__namespace.useMemo(
|
|
3111
3122
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
3112
3123
|
[wavelength, scaleFactor]
|
|
3113
3124
|
);
|
|
3114
|
-
const wavyActivePath =
|
|
3125
|
+
const wavyActivePath = React39__namespace.useMemo(
|
|
3115
3126
|
() => isWavy ? generateWavyCircularPath(
|
|
3116
3127
|
center,
|
|
3117
3128
|
radius,
|
|
@@ -3120,8 +3131,8 @@ var CircularProgress = React38__namespace.forwardRef(
|
|
|
3120
3131
|
) : null,
|
|
3121
3132
|
[isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
|
|
3122
3133
|
);
|
|
3123
|
-
const circumference =
|
|
3124
|
-
const gapForTrack =
|
|
3134
|
+
const circumference = React39__namespace.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
3135
|
+
const gapForTrack = React39__namespace.useMemo(
|
|
3125
3136
|
() => (gapSize + trackHeight) / circumference,
|
|
3126
3137
|
[gapSize, trackHeight, circumference]
|
|
3127
3138
|
);
|
|
@@ -3310,9 +3321,9 @@ var CircularProgress = React38__namespace.forwardRef(
|
|
|
3310
3321
|
);
|
|
3311
3322
|
CircularProgress.displayName = "CircularProgress";
|
|
3312
3323
|
function useContainerWidth() {
|
|
3313
|
-
const [width, setWidth] =
|
|
3314
|
-
const observerRef =
|
|
3315
|
-
const ref =
|
|
3324
|
+
const [width, setWidth] = React39__namespace.useState(0);
|
|
3325
|
+
const observerRef = React39__namespace.useRef(null);
|
|
3326
|
+
const ref = React39__namespace.useCallback((node) => {
|
|
3316
3327
|
if (observerRef.current) {
|
|
3317
3328
|
observerRef.current.disconnect();
|
|
3318
3329
|
observerRef.current = null;
|
|
@@ -3326,7 +3337,7 @@ function useContainerWidth() {
|
|
|
3326
3337
|
observerRef.current = obs;
|
|
3327
3338
|
}
|
|
3328
3339
|
}, []);
|
|
3329
|
-
|
|
3340
|
+
React39__namespace.useEffect(() => {
|
|
3330
3341
|
return () => {
|
|
3331
3342
|
if (observerRef.current) {
|
|
3332
3343
|
observerRef.current.disconnect();
|
|
@@ -3336,7 +3347,7 @@ function useContainerWidth() {
|
|
|
3336
3347
|
return [ref, width];
|
|
3337
3348
|
}
|
|
3338
3349
|
function useMergedRef(...refs) {
|
|
3339
|
-
return
|
|
3350
|
+
return React39__namespace.useCallback(
|
|
3340
3351
|
(node) => {
|
|
3341
3352
|
for (const ref of refs) {
|
|
3342
3353
|
if (typeof ref === "function") {
|
|
@@ -3350,7 +3361,7 @@ function useMergedRef(...refs) {
|
|
|
3350
3361
|
[refs]
|
|
3351
3362
|
);
|
|
3352
3363
|
}
|
|
3353
|
-
var FlatLinearTrack =
|
|
3364
|
+
var FlatLinearTrack = React39__namespace.memo(function FlatLinearTrack2({
|
|
3354
3365
|
trackHeight,
|
|
3355
3366
|
activeColor,
|
|
3356
3367
|
trackColor,
|
|
@@ -3426,7 +3437,7 @@ var FlatLinearTrack = React38__namespace.memo(function FlatLinearTrack2({
|
|
|
3426
3437
|
}
|
|
3427
3438
|
);
|
|
3428
3439
|
});
|
|
3429
|
-
var WavyLinearTrack =
|
|
3440
|
+
var WavyLinearTrack = React39__namespace.memo(function WavyLinearTrack2({
|
|
3430
3441
|
trackHeight,
|
|
3431
3442
|
svgHeight,
|
|
3432
3443
|
amplitude,
|
|
@@ -3445,13 +3456,13 @@ var WavyLinearTrack = React38__namespace.memo(function WavyLinearTrack2({
|
|
|
3445
3456
|
}) {
|
|
3446
3457
|
const isDeterminate = typeof value === "number";
|
|
3447
3458
|
const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
|
|
3448
|
-
const titleId =
|
|
3459
|
+
const titleId = React39__namespace.useId();
|
|
3449
3460
|
const [containerRef, width] = useContainerWidth();
|
|
3450
|
-
const activePathRef =
|
|
3451
|
-
const trackPathRef =
|
|
3461
|
+
const activePathRef = React39__namespace.useRef(null);
|
|
3462
|
+
const trackPathRef = React39__namespace.useRef(null);
|
|
3452
3463
|
const amplitudeMV = react.useMotionValue(amplitude);
|
|
3453
3464
|
const fractionMV = react.useMotionValue(isDeterminate ? clampedValue / 100 : 1);
|
|
3454
|
-
|
|
3465
|
+
React39__namespace.useEffect(() => {
|
|
3455
3466
|
if (isDeterminate) {
|
|
3456
3467
|
const fraction = clampedValue / 100;
|
|
3457
3468
|
let targetAmp = amplitude;
|
|
@@ -3622,7 +3633,7 @@ var WavyLinearTrack = React38__namespace.memo(function WavyLinearTrack2({
|
|
|
3622
3633
|
}
|
|
3623
3634
|
);
|
|
3624
3635
|
});
|
|
3625
|
-
var LinearProgress =
|
|
3636
|
+
var LinearProgress = React39__namespace.forwardRef(
|
|
3626
3637
|
(_a, ref) => {
|
|
3627
3638
|
var _b = _a, {
|
|
3628
3639
|
value,
|
|
@@ -3663,10 +3674,10 @@ var LinearProgress = React38__namespace.forwardRef(
|
|
|
3663
3674
|
]);
|
|
3664
3675
|
const isDeterminate = value !== void 0;
|
|
3665
3676
|
const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
|
|
3666
|
-
const containerRef =
|
|
3677
|
+
const containerRef = React39__namespace.useRef(null);
|
|
3667
3678
|
const mergedRef = useMergedRef(ref, containerRef);
|
|
3668
|
-
const [isRtl, setIsRtl] =
|
|
3669
|
-
|
|
3679
|
+
const [isRtl, setIsRtl] = React39__namespace.useState(false);
|
|
3680
|
+
React39__namespace.useEffect(() => {
|
|
3670
3681
|
if (containerRef.current) {
|
|
3671
3682
|
const dir = getComputedStyle(containerRef.current).direction;
|
|
3672
3683
|
setIsRtl(dir === "rtl");
|
|
@@ -3674,16 +3685,16 @@ var LinearProgress = React38__namespace.forwardRef(
|
|
|
3674
3685
|
}, []);
|
|
3675
3686
|
const isWavy = shape === "wavy";
|
|
3676
3687
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
3677
|
-
const effectiveAmplitude =
|
|
3678
|
-
const svgHeight =
|
|
3688
|
+
const effectiveAmplitude = React39__namespace.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
3689
|
+
const svgHeight = React39__namespace.useMemo(
|
|
3679
3690
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
3680
3691
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
3681
3692
|
);
|
|
3682
|
-
const shouldShowStop =
|
|
3693
|
+
const shouldShowStop = React39__namespace.useMemo(
|
|
3683
3694
|
() => isDeterminate && resolvedTrackShape === "flat" && (showStopIndicator === true || showStopIndicator === "auto" && isDeterminate),
|
|
3684
3695
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
3685
3696
|
);
|
|
3686
|
-
const stopSize =
|
|
3697
|
+
const stopSize = React39__namespace.useMemo(
|
|
3687
3698
|
() => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
|
|
3688
3699
|
[trackHeight]
|
|
3689
3700
|
);
|
|
@@ -3756,14 +3767,14 @@ var LinearProgress = React38__namespace.forwardRef(
|
|
|
3756
3767
|
}
|
|
3757
3768
|
);
|
|
3758
3769
|
LinearProgress.displayName = "LinearProgress";
|
|
3759
|
-
var ProgressIndicator =
|
|
3770
|
+
var ProgressIndicator = React39__namespace.forwardRef((props, ref) => {
|
|
3760
3771
|
if (props.variant === "circular") {
|
|
3761
3772
|
return /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, __spreadValues({ ref }, props));
|
|
3762
3773
|
}
|
|
3763
3774
|
return /* @__PURE__ */ jsxRuntime.jsx(LinearProgress, __spreadValues({ ref }, props));
|
|
3764
3775
|
});
|
|
3765
3776
|
ProgressIndicator.displayName = "ProgressIndicator";
|
|
3766
|
-
var RippleItem =
|
|
3777
|
+
var RippleItem = React39__namespace.memo(function RippleItem2({
|
|
3767
3778
|
ripple,
|
|
3768
3779
|
onDone
|
|
3769
3780
|
}) {
|
|
@@ -3807,8 +3818,8 @@ function Ripple({
|
|
|
3807
3818
|
}
|
|
3808
3819
|
function useRippleState(options = {}) {
|
|
3809
3820
|
const { disabled = false } = options;
|
|
3810
|
-
const [ripples, setRipples] =
|
|
3811
|
-
const onPointerDown =
|
|
3821
|
+
const [ripples, setRipples] = React39__namespace.useState([]);
|
|
3822
|
+
const onPointerDown = React39__namespace.useCallback(
|
|
3812
3823
|
(e) => {
|
|
3813
3824
|
if (disabled) return;
|
|
3814
3825
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -3822,7 +3833,7 @@ function useRippleState(options = {}) {
|
|
|
3822
3833
|
},
|
|
3823
3834
|
[disabled]
|
|
3824
3835
|
);
|
|
3825
|
-
const removeRipple =
|
|
3836
|
+
const removeRipple = React39__namespace.useCallback((id) => {
|
|
3826
3837
|
setRipples((prev) => prev.filter((r) => r.id !== id));
|
|
3827
3838
|
}, []);
|
|
3828
3839
|
return { ripples, onPointerDown, removeRipple };
|
|
@@ -3951,15 +3962,12 @@ var buttonColorVariants = classVarianceAuthority.cva(
|
|
|
3951
3962
|
defaultVariants: { colorStyle: "filled" }
|
|
3952
3963
|
}
|
|
3953
3964
|
);
|
|
3954
|
-
function toSentenceCase(text) {
|
|
3955
|
-
return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();
|
|
3956
|
-
}
|
|
3957
3965
|
function resolveLabel(children, asChild) {
|
|
3958
3966
|
if (asChild) {
|
|
3959
|
-
const child =
|
|
3967
|
+
const child = React39__namespace.Children.only(children);
|
|
3960
3968
|
return child.props.children;
|
|
3961
3969
|
}
|
|
3962
|
-
return
|
|
3970
|
+
return children;
|
|
3963
3971
|
}
|
|
3964
3972
|
var MOTION_PROP_KEYS = [
|
|
3965
3973
|
"animate",
|
|
@@ -4028,7 +4036,7 @@ function AnimatedIconSlot({
|
|
|
4028
4036
|
}
|
|
4029
4037
|
);
|
|
4030
4038
|
}
|
|
4031
|
-
var ButtonComponent =
|
|
4039
|
+
var ButtonComponent = React39__namespace.forwardRef(
|
|
4032
4040
|
(_a, ref) => {
|
|
4033
4041
|
var _b = _a, {
|
|
4034
4042
|
className,
|
|
@@ -4077,15 +4085,15 @@ var ButtonComponent = React38__namespace.forwardRef(
|
|
|
4077
4085
|
const { pressed: pressedRadius } = (_b2 = radiusMap[size]) != null ? _b2 : radiusMap.sm;
|
|
4078
4086
|
const iconClass = (_c = SIZE_ICON_CLASS[size]) != null ? _c : "size-5";
|
|
4079
4087
|
const mergedStyle = __spreadValues(__spreadValues({}, SIZE_STYLES[size]), style);
|
|
4080
|
-
const labelText =
|
|
4088
|
+
const labelText = React39__namespace.useMemo(
|
|
4081
4089
|
() => resolveLabel(children, asChild),
|
|
4082
4090
|
[children, asChild]
|
|
4083
4091
|
);
|
|
4084
4092
|
const computedAriaLabel = ariaLabelProp || (typeof children === "string" ? children : void 0);
|
|
4085
4093
|
const needsTouchTarget = size === "xs" || size === "sm";
|
|
4086
4094
|
const motionRadius = react.useMotionValue(animateRadius);
|
|
4087
|
-
const asChildRef =
|
|
4088
|
-
const mergedRef =
|
|
4095
|
+
const asChildRef = React39__namespace.useRef(null);
|
|
4096
|
+
const mergedRef = React39__namespace.useCallback(
|
|
4089
4097
|
(node) => {
|
|
4090
4098
|
asChildRef.current = node;
|
|
4091
4099
|
if (typeof ref === "function") ref(node);
|
|
@@ -4094,27 +4102,27 @@ var ButtonComponent = React38__namespace.forwardRef(
|
|
|
4094
4102
|
},
|
|
4095
4103
|
[ref]
|
|
4096
4104
|
);
|
|
4097
|
-
|
|
4105
|
+
React39__namespace.useEffect(
|
|
4098
4106
|
() => motionRadius.on("change", (v) => {
|
|
4099
4107
|
if (asChildRef.current)
|
|
4100
4108
|
asChildRef.current.style.borderRadius = `${v}px`;
|
|
4101
4109
|
}),
|
|
4102
4110
|
[motionRadius]
|
|
4103
4111
|
);
|
|
4104
|
-
|
|
4112
|
+
React39__namespace.useEffect(() => {
|
|
4105
4113
|
springAnimate(motionRadius, animateRadius);
|
|
4106
4114
|
}, [animateRadius, motionRadius]);
|
|
4107
4115
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
4108
4116
|
disabled: loading
|
|
4109
4117
|
});
|
|
4110
|
-
const handleClick =
|
|
4118
|
+
const handleClick = React39__namespace.useCallback(
|
|
4111
4119
|
(e) => {
|
|
4112
4120
|
if (loading) return e.preventDefault();
|
|
4113
4121
|
onClick == null ? void 0 : onClick(e);
|
|
4114
4122
|
},
|
|
4115
4123
|
[loading, onClick]
|
|
4116
4124
|
);
|
|
4117
|
-
const handleKeyDown =
|
|
4125
|
+
const handleKeyDown = React39__namespace.useCallback(
|
|
4118
4126
|
(e) => {
|
|
4119
4127
|
if (loading) return;
|
|
4120
4128
|
if (onClick && (e.key === "Enter" || e.key === " ")) {
|
|
@@ -4148,7 +4156,7 @@ var ButtonComponent = React38__namespace.forwardRef(
|
|
|
4148
4156
|
react.m.span,
|
|
4149
4157
|
{
|
|
4150
4158
|
layout: "size",
|
|
4151
|
-
className: "inline-flex items-center gap-[inherit]",
|
|
4159
|
+
className: "inline-flex items-center h-full gap-[inherit]",
|
|
4152
4160
|
transition: SPRING_TRANSITION,
|
|
4153
4161
|
children: labelText
|
|
4154
4162
|
}
|
|
@@ -4157,7 +4165,7 @@ var ButtonComponent = React38__namespace.forwardRef(
|
|
|
4157
4165
|
] });
|
|
4158
4166
|
if (asChild) {
|
|
4159
4167
|
const htmlProps = stripMotionProps(restProps);
|
|
4160
|
-
const child =
|
|
4168
|
+
const child = React39__namespace.Children.only(children);
|
|
4161
4169
|
const handleAsChildPointerDown = (e) => {
|
|
4162
4170
|
springAnimate(motionRadius, pressedRadius);
|
|
4163
4171
|
onPointerDown == null ? void 0 : onPointerDown(e);
|
|
@@ -4181,7 +4189,7 @@ var ButtonComponent = React38__namespace.forwardRef(
|
|
|
4181
4189
|
}),
|
|
4182
4190
|
className: buttonClassName
|
|
4183
4191
|
}, htmlProps), {
|
|
4184
|
-
children:
|
|
4192
|
+
children: React39__namespace.cloneElement(child, { children: innerContent })
|
|
4185
4193
|
})
|
|
4186
4194
|
) });
|
|
4187
4195
|
}
|
|
@@ -4209,7 +4217,7 @@ var ButtonComponent = React38__namespace.forwardRef(
|
|
|
4209
4217
|
}
|
|
4210
4218
|
);
|
|
4211
4219
|
ButtonComponent.displayName = "Button";
|
|
4212
|
-
var Button =
|
|
4220
|
+
var Button = React39__namespace.memo(ButtonComponent);
|
|
4213
4221
|
var SIZE_PADDING_MAP = {
|
|
4214
4222
|
xs: "0.75rem",
|
|
4215
4223
|
sm: "1rem",
|
|
@@ -4238,7 +4246,7 @@ var PRESSED_RADIUS_MAP = {
|
|
|
4238
4246
|
lg: 28,
|
|
4239
4247
|
xl: 40
|
|
4240
4248
|
};
|
|
4241
|
-
var ButtonGroupComponent =
|
|
4249
|
+
var ButtonGroupComponent = React39__namespace.forwardRef(
|
|
4242
4250
|
(_a, ref) => {
|
|
4243
4251
|
var _b = _a, {
|
|
4244
4252
|
className,
|
|
@@ -4259,13 +4267,13 @@ var ButtonGroupComponent = React38__namespace.forwardRef(
|
|
|
4259
4267
|
"showCheck",
|
|
4260
4268
|
"children"
|
|
4261
4269
|
]);
|
|
4262
|
-
const [pressedIndex, setPressedIndex] =
|
|
4263
|
-
const childrenArray =
|
|
4264
|
-
() =>
|
|
4270
|
+
const [pressedIndex, setPressedIndex] = React39__namespace.useState(null);
|
|
4271
|
+
const childrenArray = React39__namespace.useMemo(
|
|
4272
|
+
() => React39__namespace.Children.toArray(children).filter(React39__namespace.isValidElement),
|
|
4265
4273
|
[children]
|
|
4266
4274
|
);
|
|
4267
4275
|
const count = childrenArray.length;
|
|
4268
|
-
const handlePointerLeaveAndUp =
|
|
4276
|
+
const handlePointerLeaveAndUp = React39__namespace.useCallback(() => {
|
|
4269
4277
|
setPressedIndex(null);
|
|
4270
4278
|
}, []);
|
|
4271
4279
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4404,7 +4412,7 @@ var ButtonGroupComponent = React38__namespace.forwardRef(
|
|
|
4404
4412
|
duration: 0.2
|
|
4405
4413
|
};
|
|
4406
4414
|
}
|
|
4407
|
-
return
|
|
4415
|
+
return React39__namespace.cloneElement(element, __spreadValues(__spreadProps(__spreadValues({
|
|
4408
4416
|
key: (_a2 = element.key) != null ? _a2 : index,
|
|
4409
4417
|
tabIndex: isFirst ? 0 : -1,
|
|
4410
4418
|
size: size || element.props.size,
|
|
@@ -4433,7 +4441,7 @@ var ButtonGroupComponent = React38__namespace.forwardRef(
|
|
|
4433
4441
|
}
|
|
4434
4442
|
);
|
|
4435
4443
|
ButtonGroupComponent.displayName = "ButtonGroup";
|
|
4436
|
-
var ButtonGroup =
|
|
4444
|
+
var ButtonGroup = React39__namespace.memo(ButtonGroupComponent);
|
|
4437
4445
|
var SHADOW = {
|
|
4438
4446
|
level0: "none",
|
|
4439
4447
|
level1: "0px 1px 2px 0px rgba(0,0,0,.3), 0px 1px 3px 1px rgba(0,0,0,.15)",
|
|
@@ -4492,7 +4500,7 @@ function useCardElevation(variant, disabled) {
|
|
|
4492
4500
|
}
|
|
4493
4501
|
};
|
|
4494
4502
|
}
|
|
4495
|
-
var CardImpl =
|
|
4503
|
+
var CardImpl = React39__namespace.forwardRef(
|
|
4496
4504
|
(_a, ref) => {
|
|
4497
4505
|
var _b = _a, {
|
|
4498
4506
|
className,
|
|
@@ -4590,7 +4598,7 @@ var CardImpl = React38__namespace.forwardRef(
|
|
|
4590
4598
|
}
|
|
4591
4599
|
);
|
|
4592
4600
|
CardImpl.displayName = "Card";
|
|
4593
|
-
var Card =
|
|
4601
|
+
var Card = React39__namespace.memo(CardImpl);
|
|
4594
4602
|
var MD3_STANDARD = [0.2, 0, 0, 1];
|
|
4595
4603
|
var MD3_FAST_EFFECTS = [0.3, 0, 1, 1];
|
|
4596
4604
|
var CHECKMARK_PATH = "M 4.5 9.5 L 7.5 12.5 L 13.5 5.5";
|
|
@@ -4604,7 +4612,7 @@ var NEXT_STATE = {
|
|
|
4604
4612
|
checked: "indeterminate",
|
|
4605
4613
|
indeterminate: "unchecked"
|
|
4606
4614
|
};
|
|
4607
|
-
var CheckboxVisual =
|
|
4615
|
+
var CheckboxVisual = React39__namespace.memo(function CheckboxVisual2({
|
|
4608
4616
|
isSelected,
|
|
4609
4617
|
isIndeterminate,
|
|
4610
4618
|
containerBg,
|
|
@@ -4675,7 +4683,7 @@ var CheckboxVisual = React38__namespace.memo(function CheckboxVisual2({
|
|
|
4675
4683
|
);
|
|
4676
4684
|
});
|
|
4677
4685
|
function useMergedRef2(externalRef, internalRef) {
|
|
4678
|
-
return
|
|
4686
|
+
return React39__namespace.useCallback(
|
|
4679
4687
|
(node) => {
|
|
4680
4688
|
internalRef.current = node;
|
|
4681
4689
|
if (!externalRef) return;
|
|
@@ -4688,7 +4696,7 @@ function useMergedRef2(externalRef, internalRef) {
|
|
|
4688
4696
|
[externalRef, internalRef]
|
|
4689
4697
|
);
|
|
4690
4698
|
}
|
|
4691
|
-
var CheckboxComponent =
|
|
4699
|
+
var CheckboxComponent = React39__namespace.forwardRef(
|
|
4692
4700
|
({
|
|
4693
4701
|
checked,
|
|
4694
4702
|
defaultChecked = false,
|
|
@@ -4710,20 +4718,20 @@ var CheckboxComponent = React38__namespace.forwardRef(
|
|
|
4710
4718
|
}, ref) => {
|
|
4711
4719
|
var _a;
|
|
4712
4720
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
4713
|
-
const generatedId =
|
|
4721
|
+
const generatedId = React39__namespace.useId();
|
|
4714
4722
|
const inputId = idProp != null ? idProp : label ? `checkbox-${generatedId}` : void 0;
|
|
4715
|
-
const [internalState, setInternalState] =
|
|
4723
|
+
const [internalState, setInternalState] = React39__namespace.useState(
|
|
4716
4724
|
() => defaultChecked ? "checked" : "unchecked"
|
|
4717
4725
|
);
|
|
4718
4726
|
const isControlled = stateProp !== void 0 || checked !== void 0;
|
|
4719
4727
|
const baseState = isControlled ? resolveState(checked, false, stateProp) : internalState;
|
|
4720
4728
|
const effectiveState = indeterminate ? "indeterminate" : baseState;
|
|
4721
|
-
const [ripples, setRipples] =
|
|
4722
|
-
const removeRipple =
|
|
4729
|
+
const [ripples, setRipples] = React39__namespace.useState([]);
|
|
4730
|
+
const removeRipple = React39__namespace.useCallback(
|
|
4723
4731
|
(id) => setRipples((prev) => prev.filter((r) => r.id !== id)),
|
|
4724
4732
|
[]
|
|
4725
4733
|
);
|
|
4726
|
-
const onPointerDown =
|
|
4734
|
+
const onPointerDown = React39__namespace.useCallback(
|
|
4727
4735
|
(e) => {
|
|
4728
4736
|
if (disabled) return;
|
|
4729
4737
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -4737,7 +4745,7 @@ var CheckboxComponent = React38__namespace.forwardRef(
|
|
|
4737
4745
|
},
|
|
4738
4746
|
[disabled]
|
|
4739
4747
|
);
|
|
4740
|
-
const handleChange =
|
|
4748
|
+
const handleChange = React39__namespace.useCallback(
|
|
4741
4749
|
(e) => {
|
|
4742
4750
|
if (disabled) return;
|
|
4743
4751
|
if (stateProp !== void 0) {
|
|
@@ -4763,9 +4771,9 @@ var CheckboxComponent = React38__namespace.forwardRef(
|
|
|
4763
4771
|
onCheckedChange
|
|
4764
4772
|
]
|
|
4765
4773
|
);
|
|
4766
|
-
const inputRef =
|
|
4774
|
+
const inputRef = React39__namespace.useRef(null);
|
|
4767
4775
|
const mergedRef = useMergedRef2(ref, inputRef);
|
|
4768
|
-
|
|
4776
|
+
React39__namespace.useEffect(() => {
|
|
4769
4777
|
if (inputRef.current) {
|
|
4770
4778
|
inputRef.current.indeterminate = effectiveState === "indeterminate";
|
|
4771
4779
|
}
|
|
@@ -4890,13 +4898,13 @@ var CheckboxComponent = React38__namespace.forwardRef(
|
|
|
4890
4898
|
}
|
|
4891
4899
|
);
|
|
4892
4900
|
CheckboxComponent.displayName = "Checkbox";
|
|
4893
|
-
var Checkbox =
|
|
4894
|
-
var TriStateCheckboxComponent =
|
|
4901
|
+
var Checkbox = React39__namespace.memo(CheckboxComponent);
|
|
4902
|
+
var TriStateCheckboxComponent = React39__namespace.forwardRef((_a, ref) => {
|
|
4895
4903
|
var _b = _a, { state, onStateChange } = _b, rest = __objRest(_b, ["state", "onStateChange"]);
|
|
4896
4904
|
return /* @__PURE__ */ jsxRuntime.jsx(Checkbox, __spreadValues({ ref, state, onStateChange }, rest));
|
|
4897
4905
|
});
|
|
4898
4906
|
TriStateCheckboxComponent.displayName = "TriStateCheckbox";
|
|
4899
|
-
var TriStateCheckbox =
|
|
4907
|
+
var TriStateCheckbox = React39__namespace.memo(TriStateCheckboxComponent);
|
|
4900
4908
|
function CheckIcon({ className }) {
|
|
4901
4909
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4902
4910
|
"svg",
|
|
@@ -4990,7 +4998,7 @@ var chipVariants = classVarianceAuthority.cva(
|
|
|
4990
4998
|
defaultVariants: { variant: "assist" }
|
|
4991
4999
|
}
|
|
4992
5000
|
);
|
|
4993
|
-
var ChipImpl =
|
|
5001
|
+
var ChipImpl = React39__namespace.forwardRef(
|
|
4994
5002
|
(_a, ref) => {
|
|
4995
5003
|
var _b = _a, {
|
|
4996
5004
|
variant = "assist",
|
|
@@ -5026,7 +5034,7 @@ var ChipImpl = React38__namespace.forwardRef(
|
|
|
5026
5034
|
const showCheckmark = isFilter && selected;
|
|
5027
5035
|
const hasTrailingContent = !!trailingIcon || !!onRemove;
|
|
5028
5036
|
const hasLeadingContent = isFilter || !!resolvedLeadingIcon;
|
|
5029
|
-
const paddingClass =
|
|
5037
|
+
const paddingClass = React39__namespace.useMemo(
|
|
5030
5038
|
() => cn(
|
|
5031
5039
|
!isInput && !hasLeadingContent && !hasTrailingContent && "px-4",
|
|
5032
5040
|
!isInput && hasLeadingContent && !hasTrailingContent && "pl-2 pr-4",
|
|
@@ -5039,7 +5047,7 @@ var ChipImpl = React38__namespace.forwardRef(
|
|
|
5039
5047
|
),
|
|
5040
5048
|
[isInput, hasLeadingContent, hasTrailingContent]
|
|
5041
5049
|
);
|
|
5042
|
-
const stateClass =
|
|
5050
|
+
const stateClass = React39__namespace.useMemo(
|
|
5043
5051
|
() => cn(
|
|
5044
5052
|
(isFilter || isInput) && selected && "bg-m3-secondary-container text-m3-on-secondary-container border-none before:bg-m3-on-secondary-container",
|
|
5045
5053
|
elevated && !selected && "bg-m3-surface-container-low border-none elevation-1",
|
|
@@ -5050,7 +5058,7 @@ var ChipImpl = React38__namespace.forwardRef(
|
|
|
5050
5058
|
),
|
|
5051
5059
|
[isFilter, isInput, selected, elevated, disabled]
|
|
5052
5060
|
);
|
|
5053
|
-
const leadingIconColorClass =
|
|
5061
|
+
const leadingIconColorClass = React39__namespace.useMemo(
|
|
5054
5062
|
() => cn(
|
|
5055
5063
|
(variant === "assist" || variant === "suggestion") && "text-m3-primary",
|
|
5056
5064
|
isFilter && !selected && "text-m3-primary",
|
|
@@ -5222,8 +5230,8 @@ var ChipImpl = React38__namespace.forwardRef(
|
|
|
5222
5230
|
}
|
|
5223
5231
|
);
|
|
5224
5232
|
ChipImpl.displayName = "Chip";
|
|
5225
|
-
var Chip =
|
|
5226
|
-
var ScrollArea =
|
|
5233
|
+
var Chip = React39__namespace.memo(ChipImpl);
|
|
5234
|
+
var ScrollArea = React39__namespace.forwardRef(
|
|
5227
5235
|
(_a, ref) => {
|
|
5228
5236
|
var _b = _a, {
|
|
5229
5237
|
className,
|
|
@@ -5231,14 +5239,16 @@ var ScrollArea = React38__namespace.forwardRef(
|
|
|
5231
5239
|
children,
|
|
5232
5240
|
type = "hover",
|
|
5233
5241
|
orientation = "vertical",
|
|
5234
|
-
scrollHideDelay = 600
|
|
5242
|
+
scrollHideDelay = 600,
|
|
5243
|
+
viewportRef
|
|
5235
5244
|
} = _b, props = __objRest(_b, [
|
|
5236
5245
|
"className",
|
|
5237
5246
|
"viewportClassName",
|
|
5238
5247
|
"children",
|
|
5239
5248
|
"type",
|
|
5240
5249
|
"orientation",
|
|
5241
|
-
"scrollHideDelay"
|
|
5250
|
+
"scrollHideDelay",
|
|
5251
|
+
"viewportRef"
|
|
5242
5252
|
]);
|
|
5243
5253
|
const radixType = type === "none" ? "always" : type;
|
|
5244
5254
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5253,6 +5263,7 @@ var ScrollArea = React38__namespace.forwardRef(
|
|
|
5253
5263
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5254
5264
|
RadixScrollArea__namespace.Viewport,
|
|
5255
5265
|
{
|
|
5266
|
+
ref: viewportRef,
|
|
5256
5267
|
className: cn(
|
|
5257
5268
|
"h-full w-full flex-1 min-h-0 min-w-0 rounded-[inherit]",
|
|
5258
5269
|
"outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-1",
|
|
@@ -5282,7 +5293,7 @@ var ScrollArea = React38__namespace.forwardRef(
|
|
|
5282
5293
|
}
|
|
5283
5294
|
);
|
|
5284
5295
|
ScrollArea.displayName = "ScrollArea";
|
|
5285
|
-
var ScrollAreaScrollbar =
|
|
5296
|
+
var ScrollAreaScrollbar = React39__namespace.forwardRef((_a, ref) => {
|
|
5286
5297
|
var _b = _a, { className, orientation = "vertical" } = _b, props = __objRest(_b, ["className", "orientation"]);
|
|
5287
5298
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5288
5299
|
RadixScrollArea__namespace.Scrollbar,
|
|
@@ -5312,7 +5323,7 @@ var ScrollAreaScrollbar = React38__namespace.forwardRef((_a, ref) => {
|
|
|
5312
5323
|
);
|
|
5313
5324
|
});
|
|
5314
5325
|
ScrollAreaScrollbar.displayName = RadixScrollArea__namespace.Scrollbar.displayName;
|
|
5315
|
-
var ScrollAreaCorner =
|
|
5326
|
+
var ScrollAreaCorner = React39__namespace.forwardRef((_a, ref) => {
|
|
5316
5327
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5317
5328
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5318
5329
|
RadixScrollArea__namespace.Corner,
|
|
@@ -5407,7 +5418,7 @@ function mapDomToReact(node, key) {
|
|
|
5407
5418
|
props[propName] = attr.value;
|
|
5408
5419
|
}
|
|
5409
5420
|
}
|
|
5410
|
-
return
|
|
5421
|
+
return React39.createElement(
|
|
5411
5422
|
tagName,
|
|
5412
5423
|
props,
|
|
5413
5424
|
Array.from(el.childNodes).map((child, i) => mapDomToReact(child, i))
|
|
@@ -5416,8 +5427,8 @@ function mapDomToReact(node, key) {
|
|
|
5416
5427
|
return null;
|
|
5417
5428
|
}
|
|
5418
5429
|
function CodeContent({ html, code }) {
|
|
5419
|
-
const [parsedContent, setParsedContent] =
|
|
5420
|
-
|
|
5430
|
+
const [parsedContent, setParsedContent] = React39.useState(null);
|
|
5431
|
+
React39.useEffect(() => {
|
|
5421
5432
|
if (html) {
|
|
5422
5433
|
const parser = new DOMParser();
|
|
5423
5434
|
const doc = parser.parseFromString(html, "text/html");
|
|
@@ -5447,8 +5458,8 @@ function CodeBlock({
|
|
|
5447
5458
|
className,
|
|
5448
5459
|
html
|
|
5449
5460
|
}) {
|
|
5450
|
-
const [copied, setCopied] =
|
|
5451
|
-
const handleCopy =
|
|
5461
|
+
const [copied, setCopied] = React39.useState(false);
|
|
5462
|
+
const handleCopy = React39.useCallback(async () => {
|
|
5452
5463
|
try {
|
|
5453
5464
|
await navigator.clipboard.writeText(code);
|
|
5454
5465
|
setCopied(true);
|
|
@@ -5589,7 +5600,7 @@ function resolveDisabledBgClass(colorStyle) {
|
|
|
5589
5600
|
}
|
|
5590
5601
|
return "disabled:text-m3-on-surface/[0.38]";
|
|
5591
5602
|
}
|
|
5592
|
-
var IconButtonComponent =
|
|
5603
|
+
var IconButtonComponent = React39__namespace.forwardRef(
|
|
5593
5604
|
(_a, ref) => {
|
|
5594
5605
|
var _b = _a, {
|
|
5595
5606
|
className,
|
|
@@ -5623,18 +5634,18 @@ var IconButtonComponent = React38__namespace.forwardRef(
|
|
|
5623
5634
|
var _a2, _b2;
|
|
5624
5635
|
const isToggle = variant === "toggle";
|
|
5625
5636
|
const isSelected = isToggle && !!selected;
|
|
5626
|
-
const resolvedColorClass =
|
|
5637
|
+
const resolvedColorClass = React39__namespace.useMemo(
|
|
5627
5638
|
() => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
|
|
5628
5639
|
[isSelected, colorStyle]
|
|
5629
5640
|
);
|
|
5630
|
-
const outlineWidthClass =
|
|
5641
|
+
const outlineWidthClass = React39__namespace.useMemo(
|
|
5631
5642
|
() => {
|
|
5632
5643
|
var _a3;
|
|
5633
5644
|
return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
|
|
5634
5645
|
},
|
|
5635
5646
|
[colorStyle, isSelected, size]
|
|
5636
5647
|
);
|
|
5637
|
-
const disabledBgClass =
|
|
5648
|
+
const disabledBgClass = React39__namespace.useMemo(
|
|
5638
5649
|
() => resolveDisabledBgClass(colorStyle),
|
|
5639
5650
|
[colorStyle]
|
|
5640
5651
|
);
|
|
@@ -5653,7 +5664,7 @@ var IconButtonComponent = React38__namespace.forwardRef(
|
|
|
5653
5664
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
5654
5665
|
disabled: loading
|
|
5655
5666
|
});
|
|
5656
|
-
const handleClick =
|
|
5667
|
+
const handleClick = React39__namespace.useCallback(
|
|
5657
5668
|
(e) => {
|
|
5658
5669
|
if (loading) {
|
|
5659
5670
|
e.preventDefault();
|
|
@@ -5663,7 +5674,7 @@ var IconButtonComponent = React38__namespace.forwardRef(
|
|
|
5663
5674
|
},
|
|
5664
5675
|
[loading, onClick]
|
|
5665
5676
|
);
|
|
5666
|
-
const handleKeyDown =
|
|
5677
|
+
const handleKeyDown = React39__namespace.useCallback(
|
|
5667
5678
|
(e) => {
|
|
5668
5679
|
if (loading) return;
|
|
5669
5680
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -5751,7 +5762,7 @@ var IconButtonComponent = React38__namespace.forwardRef(
|
|
|
5751
5762
|
}
|
|
5752
5763
|
);
|
|
5753
5764
|
IconButtonComponent.displayName = "IconButton";
|
|
5754
|
-
var IconButton =
|
|
5765
|
+
var IconButton = React39__namespace.memo(IconButtonComponent);
|
|
5755
5766
|
var MD3_SPRING = {
|
|
5756
5767
|
type: "spring",
|
|
5757
5768
|
stiffness: 400,
|
|
@@ -5788,9 +5799,9 @@ DialogTrigger.displayName = "DialogTrigger";
|
|
|
5788
5799
|
var DialogPortal = ({
|
|
5789
5800
|
open,
|
|
5790
5801
|
children
|
|
5791
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: open ?
|
|
5802
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: open ? React39__namespace.Children.toArray(children) : null }) });
|
|
5792
5803
|
DialogPortal.displayName = "DialogPortal";
|
|
5793
|
-
var DialogOverlay =
|
|
5804
|
+
var DialogOverlay = React39__namespace.forwardRef((_a, ref) => {
|
|
5794
5805
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5795
5806
|
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5796
5807
|
react.m.div,
|
|
@@ -5801,7 +5812,7 @@ var DialogOverlay = React38__namespace.forwardRef((_a, ref) => {
|
|
|
5801
5812
|
) }));
|
|
5802
5813
|
});
|
|
5803
5814
|
DialogOverlay.displayName = "DialogOverlay";
|
|
5804
|
-
var DialogContent =
|
|
5815
|
+
var DialogContent = React39__namespace.forwardRef((_a, ref) => {
|
|
5805
5816
|
var _b = _a, { className, children, hideCloseButton = false } = _b, props = __objRest(_b, ["className", "children", "hideCloseButton"]);
|
|
5806
5817
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5807
5818
|
RadixDialog__namespace.Content,
|
|
@@ -5841,7 +5852,7 @@ var DialogContent = React38__namespace.forwardRef((_a, ref) => {
|
|
|
5841
5852
|
);
|
|
5842
5853
|
});
|
|
5843
5854
|
DialogContent.displayName = "DialogContent";
|
|
5844
|
-
var DialogIcon =
|
|
5855
|
+
var DialogIcon = React39__namespace.forwardRef((_a, ref) => {
|
|
5845
5856
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
5846
5857
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5847
5858
|
"div",
|
|
@@ -5864,7 +5875,7 @@ var DialogHeader = (_a) => {
|
|
|
5864
5875
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mb-4", className) }, props));
|
|
5865
5876
|
};
|
|
5866
5877
|
DialogHeader.displayName = "DialogHeader";
|
|
5867
|
-
var DialogTitle =
|
|
5878
|
+
var DialogTitle = React39__namespace.forwardRef((_a, ref) => {
|
|
5868
5879
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
5869
5880
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5870
5881
|
RadixDialog__namespace.Title,
|
|
@@ -5879,7 +5890,7 @@ var DialogTitle = React38__namespace.forwardRef((_a, ref) => {
|
|
|
5879
5890
|
);
|
|
5880
5891
|
});
|
|
5881
5892
|
DialogTitle.displayName = "DialogTitle";
|
|
5882
|
-
var DialogDescription =
|
|
5893
|
+
var DialogDescription = React39__namespace.forwardRef((_a, ref) => {
|
|
5883
5894
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
5884
5895
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5885
5896
|
RadixDialog__namespace.Description,
|
|
@@ -5891,7 +5902,7 @@ var DialogDescription = React38__namespace.forwardRef((_a, ref) => {
|
|
|
5891
5902
|
);
|
|
5892
5903
|
});
|
|
5893
5904
|
DialogDescription.displayName = "DialogDescription";
|
|
5894
|
-
var DialogBody =
|
|
5905
|
+
var DialogBody = React39__namespace.forwardRef((_a, ref) => {
|
|
5895
5906
|
var _b = _a, { className, children, dir } = _b, props = __objRest(_b, ["className", "children", "dir"]);
|
|
5896
5907
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5897
5908
|
ScrollArea,
|
|
@@ -5922,7 +5933,7 @@ var DialogFooter = (_a) => {
|
|
|
5922
5933
|
};
|
|
5923
5934
|
DialogFooter.displayName = "DialogFooter";
|
|
5924
5935
|
var DialogClose = RadixDialog__namespace.Close;
|
|
5925
|
-
var DialogFullScreenContent =
|
|
5936
|
+
var DialogFullScreenContent = React39__namespace.forwardRef(
|
|
5926
5937
|
(_a, ref) => {
|
|
5927
5938
|
var _b = _a, {
|
|
5928
5939
|
className,
|
|
@@ -6005,7 +6016,7 @@ function buildWavePath(startX, endX, amplitude = 2, wavelength = 32, yCenter = 4
|
|
|
6005
6016
|
}
|
|
6006
6017
|
return d;
|
|
6007
6018
|
}
|
|
6008
|
-
var DividerImpl =
|
|
6019
|
+
var DividerImpl = React39__namespace.forwardRef(
|
|
6009
6020
|
(_a, ref) => {
|
|
6010
6021
|
var _b = _a, {
|
|
6011
6022
|
variant = "full-bleed",
|
|
@@ -6125,7 +6136,7 @@ var DividerImpl = React38__namespace.forwardRef(
|
|
|
6125
6136
|
}
|
|
6126
6137
|
);
|
|
6127
6138
|
DividerImpl.displayName = "Divider";
|
|
6128
|
-
var Divider =
|
|
6139
|
+
var Divider = React39__namespace.memo(DividerImpl);
|
|
6129
6140
|
var MD3_DRAWER_SPRING = {
|
|
6130
6141
|
type: "spring",
|
|
6131
6142
|
stiffness: 350,
|
|
@@ -6162,7 +6173,7 @@ var DrawerPortal = ({
|
|
|
6162
6173
|
open,
|
|
6163
6174
|
children
|
|
6164
6175
|
}) => /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", children: open && children }) });
|
|
6165
|
-
var DrawerOverlay =
|
|
6176
|
+
var DrawerOverlay = React39__namespace.forwardRef((_a, ref) => {
|
|
6166
6177
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6167
6178
|
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6168
6179
|
react.m.div,
|
|
@@ -6173,7 +6184,7 @@ var DrawerOverlay = React38__namespace.forwardRef((_a, ref) => {
|
|
|
6173
6184
|
) }));
|
|
6174
6185
|
});
|
|
6175
6186
|
DrawerOverlay.displayName = "DrawerOverlay";
|
|
6176
|
-
var DrawerContent =
|
|
6187
|
+
var DrawerContent = React39__namespace.forwardRef(
|
|
6177
6188
|
(_a, ref) => {
|
|
6178
6189
|
var _b = _a, {
|
|
6179
6190
|
className,
|
|
@@ -6252,7 +6263,7 @@ var DrawerFooter = (_a) => {
|
|
|
6252
6263
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mt-4", className) }, props));
|
|
6253
6264
|
};
|
|
6254
6265
|
DrawerFooter.displayName = "DrawerFooter";
|
|
6255
|
-
var DrawerTitle =
|
|
6266
|
+
var DrawerTitle = React39__namespace.forwardRef((_a, ref) => {
|
|
6256
6267
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6257
6268
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6258
6269
|
RadixDialog__namespace.Title,
|
|
@@ -6266,7 +6277,7 @@ var DrawerTitle = React38__namespace.forwardRef((_a, ref) => {
|
|
|
6266
6277
|
);
|
|
6267
6278
|
});
|
|
6268
6279
|
DrawerTitle.displayName = "DrawerTitle";
|
|
6269
|
-
var DrawerDescription =
|
|
6280
|
+
var DrawerDescription = React39__namespace.forwardRef((_a, ref) => {
|
|
6270
6281
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
6271
6282
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6272
6283
|
RadixDialog__namespace.Description,
|
|
@@ -6347,7 +6358,7 @@ function FABPosition({
|
|
|
6347
6358
|
}
|
|
6348
6359
|
);
|
|
6349
6360
|
}
|
|
6350
|
-
var FABComponent =
|
|
6361
|
+
var FABComponent = React39__namespace.forwardRef(
|
|
6351
6362
|
(_a, ref) => {
|
|
6352
6363
|
var _b = _a, {
|
|
6353
6364
|
className,
|
|
@@ -6392,7 +6403,7 @@ var FABComponent = React38__namespace.forwardRef(
|
|
|
6392
6403
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
6393
6404
|
disabled: loading
|
|
6394
6405
|
});
|
|
6395
|
-
const handleClick =
|
|
6406
|
+
const handleClick = React39__namespace.useCallback(
|
|
6396
6407
|
(e) => {
|
|
6397
6408
|
if (loading) {
|
|
6398
6409
|
e.preventDefault();
|
|
@@ -6402,7 +6413,7 @@ var FABComponent = React38__namespace.forwardRef(
|
|
|
6402
6413
|
},
|
|
6403
6414
|
[loading, onClick]
|
|
6404
6415
|
);
|
|
6405
|
-
const handleKeyDown =
|
|
6416
|
+
const handleKeyDown = React39__namespace.useCallback(
|
|
6406
6417
|
(e) => {
|
|
6407
6418
|
if (loading) return;
|
|
6408
6419
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -6511,7 +6522,7 @@ var FABComponent = React38__namespace.forwardRef(
|
|
|
6511
6522
|
}
|
|
6512
6523
|
);
|
|
6513
6524
|
FABComponent.displayName = "FAB";
|
|
6514
|
-
var FAB =
|
|
6525
|
+
var FAB = React39__namespace.memo(FABComponent);
|
|
6515
6526
|
var SPRING_NORMAL = { stiffness: 700, damping: 40 };
|
|
6516
6527
|
var SPRING_REDUCED = { stiffness: 1e4, damping: 100 };
|
|
6517
6528
|
var FOCUS_DELAY_MS = 50;
|
|
@@ -6619,7 +6630,7 @@ function CloseIcon3() {
|
|
|
6619
6630
|
function defaultFabIcon(progress) {
|
|
6620
6631
|
return progress > 0.5 ? /* @__PURE__ */ jsxRuntime.jsx(CloseIcon3, {}) : /* @__PURE__ */ jsxRuntime.jsx(AddIcon, {});
|
|
6621
6632
|
}
|
|
6622
|
-
var ToggleFABComponent =
|
|
6633
|
+
var ToggleFABComponent = React39__namespace.forwardRef(
|
|
6623
6634
|
({
|
|
6624
6635
|
expanded,
|
|
6625
6636
|
onToggle,
|
|
@@ -6637,7 +6648,7 @@ var ToggleFABComponent = React38__namespace.forwardRef(
|
|
|
6637
6648
|
const sizeTokens = (_b = TOGGLE_FAB_SIZES[fabSize]) != null ? _b : TOGGLE_FAB_SIZES.baseline;
|
|
6638
6649
|
const springConfig = prefersReduced ? SPRING_REDUCED : SPRING_NORMAL;
|
|
6639
6650
|
const checkedProgress = react.useSpring(expanded ? 1 : 0, springConfig);
|
|
6640
|
-
|
|
6651
|
+
React39__namespace.useEffect(() => {
|
|
6641
6652
|
checkedProgress.set(expanded ? 1 : 0);
|
|
6642
6653
|
}, [expanded, checkedProgress]);
|
|
6643
6654
|
const borderRadius = react.useTransform(
|
|
@@ -6645,12 +6656,12 @@ var ToggleFABComponent = React38__namespace.forwardRef(
|
|
|
6645
6656
|
[0, 1],
|
|
6646
6657
|
[`${sizeTokens.initialRadius}px`, `${sizeTokens.finalRadius}px`]
|
|
6647
6658
|
);
|
|
6648
|
-
const [iconProgress, setIconProgress] =
|
|
6649
|
-
|
|
6659
|
+
const [iconProgress, setIconProgress] = React39__namespace.useState(expanded ? 1 : 0);
|
|
6660
|
+
React39__namespace.useEffect(() => {
|
|
6650
6661
|
return checkedProgress.on("change", setIconProgress);
|
|
6651
6662
|
}, [checkedProgress]);
|
|
6652
6663
|
const { ripples, onPointerDown, removeRipple } = useRippleState();
|
|
6653
|
-
const handleClick =
|
|
6664
|
+
const handleClick = React39__namespace.useCallback(() => {
|
|
6654
6665
|
onToggle(!expanded);
|
|
6655
6666
|
}, [expanded, onToggle]);
|
|
6656
6667
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -6699,7 +6710,7 @@ var ToggleFABComponent = React38__namespace.forwardRef(
|
|
|
6699
6710
|
}
|
|
6700
6711
|
);
|
|
6701
6712
|
ToggleFABComponent.displayName = "ToggleFAB";
|
|
6702
|
-
var ToggleFAB =
|
|
6713
|
+
var ToggleFAB = React39__namespace.memo(ToggleFABComponent);
|
|
6703
6714
|
function FABMenuItem({
|
|
6704
6715
|
icon,
|
|
6705
6716
|
label,
|
|
@@ -6712,7 +6723,7 @@ function FABMenuItem({
|
|
|
6712
6723
|
var _a;
|
|
6713
6724
|
const colors = (_a = MENU_ITEM_COLORS[colorVariant]) != null ? _a : MENU_ITEM_COLORS.primary;
|
|
6714
6725
|
const { ripples, onPointerDown, removeRipple } = useRippleState({ disabled });
|
|
6715
|
-
const handleClick =
|
|
6726
|
+
const handleClick = React39__namespace.useCallback(
|
|
6716
6727
|
(e) => {
|
|
6717
6728
|
if (disabled) {
|
|
6718
6729
|
e.preventDefault();
|
|
@@ -6722,7 +6733,7 @@ function FABMenuItem({
|
|
|
6722
6733
|
},
|
|
6723
6734
|
[disabled, onClick]
|
|
6724
6735
|
);
|
|
6725
|
-
const handleKeyDown =
|
|
6736
|
+
const handleKeyDown = React39__namespace.useCallback(
|
|
6726
6737
|
(e) => {
|
|
6727
6738
|
if (disabled) return;
|
|
6728
6739
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -6789,13 +6800,13 @@ function FABMenu({
|
|
|
6789
6800
|
focusLast = true,
|
|
6790
6801
|
"aria-label": ariaLabel
|
|
6791
6802
|
}) {
|
|
6792
|
-
const fabId =
|
|
6793
|
-
const menuId =
|
|
6794
|
-
const toggleRef =
|
|
6795
|
-
const itemRefs =
|
|
6796
|
-
const [focusedIndex, setFocusedIndex] =
|
|
6797
|
-
const reversedItems =
|
|
6798
|
-
const focusItem =
|
|
6803
|
+
const fabId = React39__namespace.useId();
|
|
6804
|
+
const menuId = React39__namespace.useId();
|
|
6805
|
+
const toggleRef = React39__namespace.useRef(null);
|
|
6806
|
+
const itemRefs = React39__namespace.useRef([]);
|
|
6807
|
+
const [focusedIndex, setFocusedIndex] = React39__namespace.useState(-1);
|
|
6808
|
+
const reversedItems = React39__namespace.useMemo(() => [...items].reverse(), [items]);
|
|
6809
|
+
const focusItem = React39__namespace.useCallback((index) => {
|
|
6799
6810
|
var _a;
|
|
6800
6811
|
const clampedIndex = Math.max(
|
|
6801
6812
|
0,
|
|
@@ -6804,8 +6815,8 @@ function FABMenu({
|
|
|
6804
6815
|
setFocusedIndex(clampedIndex);
|
|
6805
6816
|
(_a = itemRefs.current[clampedIndex]) == null ? void 0 : _a.focus();
|
|
6806
6817
|
}, []);
|
|
6807
|
-
const wasExpandedRef =
|
|
6808
|
-
|
|
6818
|
+
const wasExpandedRef = React39__namespace.useRef(false);
|
|
6819
|
+
React39__namespace.useEffect(() => {
|
|
6809
6820
|
var _a;
|
|
6810
6821
|
if (expanded) {
|
|
6811
6822
|
wasExpandedRef.current = true;
|
|
@@ -6820,7 +6831,7 @@ function FABMenu({
|
|
|
6820
6831
|
wasExpandedRef.current = false;
|
|
6821
6832
|
setFocusedIndex(-1);
|
|
6822
6833
|
}, [expanded, focusLast, items.length, focusItem]);
|
|
6823
|
-
const handleMenuKeyDown =
|
|
6834
|
+
const handleMenuKeyDown = React39__namespace.useCallback(
|
|
6824
6835
|
(e) => {
|
|
6825
6836
|
if (!expanded) return;
|
|
6826
6837
|
const lastIndex = items.length - 1;
|
|
@@ -6944,7 +6955,296 @@ function FABMenu({
|
|
|
6944
6955
|
)
|
|
6945
6956
|
] });
|
|
6946
6957
|
}
|
|
6947
|
-
var
|
|
6958
|
+
var NavigationBarContext = React39__namespace.createContext({ variant: "flexible" });
|
|
6959
|
+
function cloneIconWithFill(icon, selected) {
|
|
6960
|
+
if (!React39__namespace.isValidElement(icon)) return icon;
|
|
6961
|
+
if (icon.type === Icon) {
|
|
6962
|
+
return React39__namespace.cloneElement(
|
|
6963
|
+
icon,
|
|
6964
|
+
{ fill: selected ? 1 : 0, animateFill: true }
|
|
6965
|
+
);
|
|
6966
|
+
}
|
|
6967
|
+
return icon;
|
|
6968
|
+
}
|
|
6969
|
+
function ActivePill() {
|
|
6970
|
+
const { activeIndicatorTransition } = React39__namespace.useContext(NavigationBarContext);
|
|
6971
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6972
|
+
react.m.div,
|
|
6973
|
+
{
|
|
6974
|
+
className: "absolute inset-0 bg-m3-secondary-container pointer-events-none",
|
|
6975
|
+
style: {
|
|
6976
|
+
borderRadius: 9999,
|
|
6977
|
+
zIndex: 0
|
|
6978
|
+
},
|
|
6979
|
+
initial: { opacity: 0, scale: 0.5 },
|
|
6980
|
+
animate: { opacity: 1, scale: 1 },
|
|
6981
|
+
exit: { opacity: 0, scale: 0.5 },
|
|
6982
|
+
transition: activeIndicatorTransition || SPRING_TRANSITION_EXPRESSIVE
|
|
6983
|
+
}
|
|
6984
|
+
);
|
|
6985
|
+
}
|
|
6986
|
+
function HoverStateLayer() {
|
|
6987
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 rounded-full bg-m3-on-surface opacity-0 group-hover:opacity-[0.08] group-focus-visible:opacity-[0.10] active:opacity-[0.10] transition-opacity duration-200 pointer-events-none z-0" });
|
|
6988
|
+
}
|
|
6989
|
+
function RippleLayer({ ripples, onRippleDone }) {
|
|
6990
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 rounded-full overflow-hidden pointer-events-none z-0", children: /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone }) });
|
|
6991
|
+
}
|
|
6992
|
+
function IconContainer({ selected, badge, children }) {
|
|
6993
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6994
|
+
"div",
|
|
6995
|
+
{
|
|
6996
|
+
"aria-hidden": "true",
|
|
6997
|
+
className: cn(
|
|
6998
|
+
"relative flex items-center justify-center size-6 transition-colors duration-200 shrink-0",
|
|
6999
|
+
selected ? "text-m3-on-secondary-container" : "text-m3-on-surface-variant"
|
|
7000
|
+
),
|
|
7001
|
+
children: [
|
|
7002
|
+
children,
|
|
7003
|
+
badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute -top-1 -right-1 flex min-w-3 h-3 items-center justify-center rounded-full bg-m3-error px-1 text-[10px] font-medium leading-none tracking-normal text-m3-on-error ring-[1.5px] ring-m3-surface", children: badge })
|
|
7004
|
+
]
|
|
7005
|
+
}
|
|
7006
|
+
);
|
|
7007
|
+
}
|
|
7008
|
+
var NavigationBarItemComponent = React39__namespace.forwardRef(
|
|
7009
|
+
({
|
|
7010
|
+
selected,
|
|
7011
|
+
icon,
|
|
7012
|
+
label,
|
|
7013
|
+
onClick,
|
|
7014
|
+
disabled = false,
|
|
7015
|
+
badge,
|
|
7016
|
+
className,
|
|
7017
|
+
"aria-label": ariaLabelProp
|
|
7018
|
+
}, ref) => {
|
|
7019
|
+
const { variant, itemLayout } = React39__namespace.useContext(NavigationBarContext);
|
|
7020
|
+
const isForcedHorizontal = itemLayout === "horizontal";
|
|
7021
|
+
const isResponsiveHorizontal = (variant === "flexible" || variant === "xr") && itemLayout === void 0;
|
|
7022
|
+
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
7023
|
+
disabled
|
|
7024
|
+
});
|
|
7025
|
+
const handleClick = React39__namespace.useCallback(
|
|
7026
|
+
(e) => {
|
|
7027
|
+
if (disabled) {
|
|
7028
|
+
e.preventDefault();
|
|
7029
|
+
return;
|
|
7030
|
+
}
|
|
7031
|
+
if (selected) {
|
|
7032
|
+
if (typeof window !== "undefined" && window.scrollY > 0) {
|
|
7033
|
+
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
7034
|
+
}
|
|
7035
|
+
return;
|
|
7036
|
+
}
|
|
7037
|
+
onClick == null ? void 0 : onClick();
|
|
7038
|
+
},
|
|
7039
|
+
[disabled, selected, onClick]
|
|
7040
|
+
);
|
|
7041
|
+
const filledIcon = cloneIconWithFill(icon, selected);
|
|
7042
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7043
|
+
react.m.button,
|
|
7044
|
+
{
|
|
7045
|
+
ref,
|
|
7046
|
+
type: "button",
|
|
7047
|
+
role: "menuitem",
|
|
7048
|
+
"aria-current": selected ? "page" : void 0,
|
|
7049
|
+
"aria-disabled": disabled ? true : void 0,
|
|
7050
|
+
"aria-label": ariaLabelProp || (typeof label === "string" ? label : void 0),
|
|
7051
|
+
onClick: handleClick,
|
|
7052
|
+
onPointerDown,
|
|
7053
|
+
className: cn(
|
|
7054
|
+
"group relative flex flex-1 cursor-pointer transition-colors duration-200 outline-none select-none h-full",
|
|
7055
|
+
variant === "xr" ? "items-center justify-center max-[599px]:min-w-28 max-[599px]:max-w-28 max-[599px]:items-start max-[599px]:pt-3 max-[599px]:pb-4" : "items-center justify-center",
|
|
7056
|
+
disabled && "pointer-events-none opacity-[0.38]",
|
|
7057
|
+
className
|
|
7058
|
+
),
|
|
7059
|
+
children: [
|
|
7060
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7061
|
+
"div",
|
|
7062
|
+
{
|
|
7063
|
+
className: cn(
|
|
7064
|
+
"relative flex items-center justify-center flex-col gap-y-1 w-full",
|
|
7065
|
+
isResponsiveHorizontal && "min-[600px]:flex-row min-[600px]:gap-y-0 min-[600px]:gap-x-1 min-[600px]:h-10 min-[600px]:px-4 min-[600px]:rounded-full min-[600px]:w-auto min-[600px]:max-w-42",
|
|
7066
|
+
isForcedHorizontal && "flex-row gap-y-0 gap-x-1 h-10 px-4 rounded-full w-auto max-w-42"
|
|
7067
|
+
),
|
|
7068
|
+
children: [
|
|
7069
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7070
|
+
"div",
|
|
7071
|
+
{
|
|
7072
|
+
className: cn(
|
|
7073
|
+
"absolute inset-0 z-0 hidden",
|
|
7074
|
+
isResponsiveHorizontal && "min-[600px]:block",
|
|
7075
|
+
isForcedHorizontal && "block!"
|
|
7076
|
+
),
|
|
7077
|
+
children: [
|
|
7078
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill, {}) }),
|
|
7079
|
+
/* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer, {}),
|
|
7080
|
+
/* @__PURE__ */ jsxRuntime.jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
|
|
7081
|
+
]
|
|
7082
|
+
}
|
|
7083
|
+
),
|
|
7084
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7085
|
+
"div",
|
|
7086
|
+
{
|
|
7087
|
+
className: cn(
|
|
7088
|
+
"relative flex items-center justify-center shrink-0 z-10",
|
|
7089
|
+
"h-8 w-16 mx-auto rounded-full",
|
|
7090
|
+
isResponsiveHorizontal && "min-[600px]:size-6 min-[600px]:w-auto min-[600px]:h-auto",
|
|
7091
|
+
isForcedHorizontal && "size-6 w-auto h-auto"
|
|
7092
|
+
),
|
|
7093
|
+
children: [
|
|
7094
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7095
|
+
"div",
|
|
7096
|
+
{
|
|
7097
|
+
className: cn(
|
|
7098
|
+
"absolute inset-0 z-0",
|
|
7099
|
+
isResponsiveHorizontal && "min-[600px]:hidden",
|
|
7100
|
+
isForcedHorizontal && "hidden"
|
|
7101
|
+
),
|
|
7102
|
+
children: [
|
|
7103
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill, {}) }),
|
|
7104
|
+
/* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer, {}),
|
|
7105
|
+
/* @__PURE__ */ jsxRuntime.jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
|
|
7106
|
+
]
|
|
7107
|
+
}
|
|
7108
|
+
),
|
|
7109
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-10 flex size-6 items-center justify-center text-current", children: /* @__PURE__ */ jsxRuntime.jsx(IconContainer, { selected, badge, children: filledIcon }) })
|
|
7110
|
+
]
|
|
7111
|
+
}
|
|
7112
|
+
),
|
|
7113
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "popLayout", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7114
|
+
"span",
|
|
7115
|
+
{
|
|
7116
|
+
className: cn(
|
|
7117
|
+
"z-10 transition-all duration-200 truncate px-1",
|
|
7118
|
+
selected ? "text-m3-on-surface" : "text-m3-on-surface-variant",
|
|
7119
|
+
"font-medium text-[12px] leading-4 tracking-[0.5px]"
|
|
7120
|
+
),
|
|
7121
|
+
children: label
|
|
7122
|
+
},
|
|
7123
|
+
"nav-label"
|
|
7124
|
+
) })
|
|
7125
|
+
]
|
|
7126
|
+
}
|
|
7127
|
+
),
|
|
7128
|
+
/* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {})
|
|
7129
|
+
]
|
|
7130
|
+
}
|
|
7131
|
+
);
|
|
7132
|
+
}
|
|
7133
|
+
);
|
|
7134
|
+
NavigationBarItemComponent.displayName = "NavigationBarItem";
|
|
7135
|
+
var NavigationBarItem = React39__namespace.memo(NavigationBarItemComponent);
|
|
7136
|
+
var navContainerVariants = classVarianceAuthority.cva(
|
|
7137
|
+
"flex items-center justify-center select-none transition-transform duration-300 z-50",
|
|
7138
|
+
{
|
|
7139
|
+
variants: {
|
|
7140
|
+
variant: {
|
|
7141
|
+
flexible: "bottom-0 left-0 right-0 w-full h-16 pb-safe",
|
|
7142
|
+
baseline: "bottom-0 left-0 right-0 w-full h-20 pb-safe",
|
|
7143
|
+
xr: "bottom-6 left-1/2 -translate-x-1/2 w-auto max-w-fit h-20 min-[600px]:h-16 rounded-[48px] px-2"
|
|
7144
|
+
},
|
|
7145
|
+
position: {
|
|
7146
|
+
fixed: "fixed",
|
|
7147
|
+
absolute: "absolute"
|
|
7148
|
+
},
|
|
7149
|
+
elevated: {
|
|
7150
|
+
true: "shadow-[0_-1px_3px_rgba(0,0,0,0.1)]",
|
|
7151
|
+
false: "shadow-none"
|
|
7152
|
+
}
|
|
7153
|
+
},
|
|
7154
|
+
defaultVariants: {
|
|
7155
|
+
variant: "flexible",
|
|
7156
|
+
position: "fixed",
|
|
7157
|
+
elevated: false
|
|
7158
|
+
}
|
|
7159
|
+
}
|
|
7160
|
+
);
|
|
7161
|
+
var NavigationBarComponent = React39__namespace.forwardRef(
|
|
7162
|
+
({
|
|
7163
|
+
variant = "flexible",
|
|
7164
|
+
itemLayout,
|
|
7165
|
+
hideOnScroll = false,
|
|
7166
|
+
elevated = false,
|
|
7167
|
+
fixed = true,
|
|
7168
|
+
scrollContainerRef,
|
|
7169
|
+
activeIndicatorTransition,
|
|
7170
|
+
children,
|
|
7171
|
+
className,
|
|
7172
|
+
style
|
|
7173
|
+
}, ref) => {
|
|
7174
|
+
const [isVisible, setIsVisible] = React39__namespace.useState(true);
|
|
7175
|
+
const lastScrollY = React39__namespace.useRef(
|
|
7176
|
+
typeof window !== "undefined" ? window.scrollY : 0
|
|
7177
|
+
);
|
|
7178
|
+
React39__namespace.useEffect(() => {
|
|
7179
|
+
if (typeof window === "undefined" || !hideOnScroll) {
|
|
7180
|
+
setIsVisible(true);
|
|
7181
|
+
return;
|
|
7182
|
+
}
|
|
7183
|
+
const prefersReducedMotion = window.matchMedia(
|
|
7184
|
+
"(prefers-reduced-motion: reduce)"
|
|
7185
|
+
).matches;
|
|
7186
|
+
if (prefersReducedMotion) {
|
|
7187
|
+
setIsVisible(true);
|
|
7188
|
+
return;
|
|
7189
|
+
}
|
|
7190
|
+
let ticking = false;
|
|
7191
|
+
const handleScroll = () => {
|
|
7192
|
+
if (ticking) return;
|
|
7193
|
+
ticking = true;
|
|
7194
|
+
window.requestAnimationFrame(() => {
|
|
7195
|
+
const currentScrollY = (scrollContainerRef == null ? void 0 : scrollContainerRef.current) ? scrollContainerRef.current.scrollTop : window.scrollY;
|
|
7196
|
+
if (currentScrollY <= 0 || currentScrollY < lastScrollY.current) {
|
|
7197
|
+
setIsVisible(true);
|
|
7198
|
+
} else if (currentScrollY > lastScrollY.current) {
|
|
7199
|
+
setIsVisible(false);
|
|
7200
|
+
}
|
|
7201
|
+
lastScrollY.current = currentScrollY;
|
|
7202
|
+
ticking = false;
|
|
7203
|
+
});
|
|
7204
|
+
};
|
|
7205
|
+
const target = (scrollContainerRef == null ? void 0 : scrollContainerRef.current) || window;
|
|
7206
|
+
target.addEventListener("scroll", handleScroll, { passive: true });
|
|
7207
|
+
return () => target.removeEventListener("scroll", handleScroll);
|
|
7208
|
+
}, [hideOnScroll, scrollContainerRef]);
|
|
7209
|
+
const navBaseClasses = cn(
|
|
7210
|
+
navContainerVariants({
|
|
7211
|
+
variant,
|
|
7212
|
+
elevated,
|
|
7213
|
+
position: fixed ? "fixed" : "absolute"
|
|
7214
|
+
}),
|
|
7215
|
+
variant === "xr" ? "bg-m3-surface border border-white/5 shadow-xl" : "bg-m3-surface-container",
|
|
7216
|
+
className
|
|
7217
|
+
);
|
|
7218
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(NavigationBarContext.Provider, { value: { variant, itemLayout, activeIndicatorTransition }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7219
|
+
react.m.nav,
|
|
7220
|
+
{
|
|
7221
|
+
ref,
|
|
7222
|
+
role: "navigation",
|
|
7223
|
+
"aria-label": "Main navigation",
|
|
7224
|
+
className: navBaseClasses,
|
|
7225
|
+
style,
|
|
7226
|
+
initial: false,
|
|
7227
|
+
animate: { y: isVisible ? "0%" : "100%" },
|
|
7228
|
+
transition: { type: "tween", duration: 0.3, ease: "easeInOut" },
|
|
7229
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7230
|
+
"div",
|
|
7231
|
+
{
|
|
7232
|
+
role: "menubar",
|
|
7233
|
+
"aria-orientation": "horizontal",
|
|
7234
|
+
className: cn(
|
|
7235
|
+
"flex w-full h-full mx-auto",
|
|
7236
|
+
variant === "xr" ? "gap-0 min-[600px]:gap-1.5" : "max-w-7xl gap-1.5"
|
|
7237
|
+
),
|
|
7238
|
+
children
|
|
7239
|
+
}
|
|
7240
|
+
)
|
|
7241
|
+
}
|
|
7242
|
+
) }) });
|
|
7243
|
+
}
|
|
7244
|
+
);
|
|
7245
|
+
NavigationBarComponent.displayName = "NavigationBar";
|
|
7246
|
+
var NavigationBar = React39__namespace.memo(NavigationBarComponent);
|
|
7247
|
+
var NavigationRailContext = React39__namespace.createContext({ variant: "collapsed", labelVisibility: "labeled" });
|
|
6948
7248
|
var MD3_MODAL_TRANSITION = {
|
|
6949
7249
|
type: "tween",
|
|
6950
7250
|
ease: [0.05, 0.7, 0.1, 1],
|
|
@@ -6955,17 +7255,14 @@ var railContainerVariants = classVarianceAuthority.cva(
|
|
|
6955
7255
|
{
|
|
6956
7256
|
variants: {
|
|
6957
7257
|
variant: {
|
|
6958
|
-
collapsed: "items-center",
|
|
6959
|
-
expanded: "items-start",
|
|
6960
|
-
modal: "bg-m3-surface shadow-lg rounded-r-[var(--m3-shape-corner-large)]"
|
|
7258
|
+
collapsed: "items-center h-full pt-11 pb-4 shadow-none bg-m3-surface rounded-none",
|
|
7259
|
+
expanded: "items-start h-full pt-11 pb-4 shadow-none bg-m3-surface rounded-none",
|
|
7260
|
+
modal: "bg-m3-surface shadow-lg rounded-r-[var(--m3-shape-corner-large)] h-full pt-11 pb-4",
|
|
7261
|
+
xr: "h-fit py-5 rounded-[48px] shadow-xl bg-m3-surface border border-white/5"
|
|
6961
7262
|
},
|
|
6962
7263
|
narrow: {
|
|
6963
7264
|
true: "w-20",
|
|
6964
7265
|
false: "w-24"
|
|
6965
|
-
},
|
|
6966
|
-
xr: {
|
|
6967
|
-
true: "h-fit py-5 rounded-[48px] shadow-xl bg-m3-surface border border-white/5",
|
|
6968
|
-
false: "h-full pt-11 pb-4 shadow-none bg-m3-surface rounded-none"
|
|
6969
7266
|
}
|
|
6970
7267
|
},
|
|
6971
7268
|
compoundVariants: [
|
|
@@ -6974,15 +7271,14 @@ var railContainerVariants = classVarianceAuthority.cva(
|
|
|
6974
7271
|
],
|
|
6975
7272
|
defaultVariants: {
|
|
6976
7273
|
variant: "collapsed",
|
|
6977
|
-
narrow: false
|
|
6978
|
-
xr: false
|
|
7274
|
+
narrow: false
|
|
6979
7275
|
}
|
|
6980
7276
|
}
|
|
6981
7277
|
);
|
|
6982
|
-
function
|
|
6983
|
-
if (!
|
|
7278
|
+
function cloneIconWithFill2(icon, selected) {
|
|
7279
|
+
if (!React39__namespace.isValidElement(icon)) return icon;
|
|
6984
7280
|
if (icon.type === Icon) {
|
|
6985
|
-
return
|
|
7281
|
+
return React39__namespace.cloneElement(
|
|
6986
7282
|
icon,
|
|
6987
7283
|
{ fill: selected ? 1 : 0, animateFill: true }
|
|
6988
7284
|
);
|
|
@@ -7004,27 +7300,28 @@ function setFocusedItem(items, index) {
|
|
|
7004
7300
|
target.focus();
|
|
7005
7301
|
}
|
|
7006
7302
|
}
|
|
7007
|
-
function
|
|
7303
|
+
function ActivePill2({ layoutId, disableInitial = false }) {
|
|
7304
|
+
const { activeIndicatorTransition } = React39__namespace.useContext(NavigationRailContext);
|
|
7008
7305
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7009
7306
|
react.m.div,
|
|
7010
7307
|
{
|
|
7011
7308
|
layoutId,
|
|
7012
7309
|
className: "absolute inset-0 bg-m3-secondary-container pointer-events-none",
|
|
7013
|
-
style: { borderRadius: 9999, zIndex: 0 },
|
|
7014
|
-
initial: disableInitial ? false : { opacity: 0 },
|
|
7015
|
-
animate: { opacity: 1 },
|
|
7016
|
-
exit: { opacity: 0 },
|
|
7017
|
-
transition:
|
|
7310
|
+
style: { borderRadius: 9999, zIndex: 0, originX: 0.5, originY: 0.5 },
|
|
7311
|
+
initial: disableInitial ? false : { opacity: 0, scale: 0.5 },
|
|
7312
|
+
animate: { opacity: 1, scale: 1 },
|
|
7313
|
+
exit: { opacity: 0, scale: 0.5, transition: { duration: 0.15 } },
|
|
7314
|
+
transition: activeIndicatorTransition || SPRING_TRANSITION_EXPRESSIVE
|
|
7018
7315
|
}
|
|
7019
7316
|
);
|
|
7020
7317
|
}
|
|
7021
|
-
function
|
|
7318
|
+
function HoverStateLayer2() {
|
|
7022
7319
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 rounded-full bg-m3-on-surface opacity-0 group-hover:opacity-[0.08] transition-opacity duration-200 pointer-events-none z-0" });
|
|
7023
7320
|
}
|
|
7024
|
-
function
|
|
7321
|
+
function RippleLayer2({ ripples, onRippleDone }) {
|
|
7025
7322
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 rounded-full overflow-hidden pointer-events-none z-0", children: /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone }) });
|
|
7026
7323
|
}
|
|
7027
|
-
function
|
|
7324
|
+
function IconContainer2({ selected, badge, children }) {
|
|
7028
7325
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7029
7326
|
"div",
|
|
7030
7327
|
{
|
|
@@ -7040,7 +7337,7 @@ function IconContainer({ selected, badge, children }) {
|
|
|
7040
7337
|
}
|
|
7041
7338
|
);
|
|
7042
7339
|
}
|
|
7043
|
-
var NavigationRailItemComponent =
|
|
7340
|
+
var NavigationRailItemComponent = React39__namespace.forwardRef(
|
|
7044
7341
|
({
|
|
7045
7342
|
selected,
|
|
7046
7343
|
icon,
|
|
@@ -7051,18 +7348,18 @@ var NavigationRailItemComponent = React38__namespace.forwardRef(
|
|
|
7051
7348
|
className,
|
|
7052
7349
|
"aria-label": ariaLabelProp
|
|
7053
7350
|
}, ref) => {
|
|
7054
|
-
const { variant, labelVisibility } =
|
|
7351
|
+
const { variant, labelVisibility } = React39__namespace.useContext(
|
|
7055
7352
|
NavigationRailContext
|
|
7056
7353
|
);
|
|
7057
7354
|
const isExpanded = variant === "expanded" || variant === "modal";
|
|
7058
7355
|
const isModal = variant === "modal";
|
|
7059
7356
|
const enableLayout = !isModal;
|
|
7060
|
-
const activePillId = `rail-pill-${
|
|
7357
|
+
const activePillId = `rail-pill-${React39__namespace.useId()}`;
|
|
7061
7358
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
7062
7359
|
disabled
|
|
7063
7360
|
});
|
|
7064
7361
|
const showLabel = isExpanded || labelVisibility === "labeled" || labelVisibility === "auto" && selected;
|
|
7065
|
-
const handleClick =
|
|
7362
|
+
const handleClick = React39__namespace.useCallback(
|
|
7066
7363
|
(e) => {
|
|
7067
7364
|
if (disabled) {
|
|
7068
7365
|
e.preventDefault();
|
|
@@ -7072,7 +7369,7 @@ var NavigationRailItemComponent = React38__namespace.forwardRef(
|
|
|
7072
7369
|
},
|
|
7073
7370
|
[disabled, onClick]
|
|
7074
7371
|
);
|
|
7075
|
-
const filledIcon =
|
|
7372
|
+
const filledIcon = cloneIconWithFill2(icon, selected);
|
|
7076
7373
|
const labelInitial = isModal ? false : { opacity: 0, x: isExpanded ? -12 : 0, y: isExpanded ? 0 : -8 };
|
|
7077
7374
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7078
7375
|
react.m.button,
|
|
@@ -7105,14 +7402,14 @@ var NavigationRailItemComponent = React38__namespace.forwardRef(
|
|
|
7105
7402
|
),
|
|
7106
7403
|
children: [
|
|
7107
7404
|
isExpanded && /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7108
|
-
|
|
7405
|
+
ActivePill2,
|
|
7109
7406
|
{
|
|
7110
7407
|
layoutId: activePillId,
|
|
7111
7408
|
disableInitial: isModal
|
|
7112
7409
|
}
|
|
7113
7410
|
) }),
|
|
7114
|
-
isExpanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7115
|
-
isExpanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7411
|
+
isExpanded && /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer2, {}),
|
|
7412
|
+
isExpanded && /* @__PURE__ */ jsxRuntime.jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
|
|
7116
7413
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7117
7414
|
react.m.div,
|
|
7118
7415
|
{
|
|
@@ -7123,15 +7420,15 @@ var NavigationRailItemComponent = React38__namespace.forwardRef(
|
|
|
7123
7420
|
),
|
|
7124
7421
|
style: { borderRadius: 9999 },
|
|
7125
7422
|
children: [
|
|
7126
|
-
!isExpanded && /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7127
|
-
!isExpanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7128
|
-
!isExpanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7423
|
+
!isExpanded && /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsxRuntime.jsx(ActivePill2, { layoutId: activePillId }) }),
|
|
7424
|
+
!isExpanded && /* @__PURE__ */ jsxRuntime.jsx(HoverStateLayer2, {}),
|
|
7425
|
+
!isExpanded && /* @__PURE__ */ jsxRuntime.jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
|
|
7129
7426
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7130
7427
|
react.m.div,
|
|
7131
7428
|
{
|
|
7132
7429
|
layout: enableLayout ? "position" : false,
|
|
7133
7430
|
className: "relative z-10 flex size-6 items-center justify-center text-current",
|
|
7134
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7431
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(IconContainer2, { selected, badge, children: filledIcon })
|
|
7135
7432
|
}
|
|
7136
7433
|
)
|
|
7137
7434
|
]
|
|
@@ -7164,9 +7461,9 @@ var NavigationRailItemComponent = React38__namespace.forwardRef(
|
|
|
7164
7461
|
}
|
|
7165
7462
|
);
|
|
7166
7463
|
NavigationRailItemComponent.displayName = "NavigationRailItem";
|
|
7167
|
-
var NavigationRailItem =
|
|
7464
|
+
var NavigationRailItem = React39__namespace.memo(NavigationRailItemComponent);
|
|
7168
7465
|
function useRoving(navRef) {
|
|
7169
|
-
|
|
7466
|
+
React39__namespace.useEffect(() => {
|
|
7170
7467
|
if (!navRef.current) return;
|
|
7171
7468
|
const items = getMenuItems(navRef.current);
|
|
7172
7469
|
const selected = items.find(
|
|
@@ -7176,7 +7473,7 @@ function useRoving(navRef) {
|
|
|
7176
7473
|
const firstFocusable = selected != null ? selected : items[0];
|
|
7177
7474
|
if (firstFocusable) firstFocusable.tabIndex = 0;
|
|
7178
7475
|
}, [navRef]);
|
|
7179
|
-
return
|
|
7476
|
+
return React39__namespace.useCallback(
|
|
7180
7477
|
(e) => {
|
|
7181
7478
|
if (!navRef.current) return;
|
|
7182
7479
|
const items = getMenuItems(navRef.current);
|
|
@@ -7204,29 +7501,29 @@ function useRoving(navRef) {
|
|
|
7204
7501
|
[navRef]
|
|
7205
7502
|
);
|
|
7206
7503
|
}
|
|
7207
|
-
var NavigationRailComponent =
|
|
7504
|
+
var NavigationRailComponent = React39__namespace.forwardRef(
|
|
7208
7505
|
({
|
|
7209
7506
|
variant = "collapsed",
|
|
7210
7507
|
labelVisibility = "labeled",
|
|
7211
7508
|
header,
|
|
7212
7509
|
fab,
|
|
7510
|
+
fabPlacement = "contained",
|
|
7213
7511
|
footer,
|
|
7214
7512
|
narrow = false,
|
|
7215
7513
|
open = false,
|
|
7216
|
-
xr = false,
|
|
7217
7514
|
onClose,
|
|
7515
|
+
activeIndicatorTransition,
|
|
7218
7516
|
children,
|
|
7219
7517
|
className,
|
|
7220
7518
|
style
|
|
7221
7519
|
}, ref) => {
|
|
7222
7520
|
const isModal = variant === "modal";
|
|
7223
|
-
const isXr =
|
|
7224
|
-
const
|
|
7225
|
-
const isSpatial = isXr && xrMode === "spatialized";
|
|
7521
|
+
const isXr = variant === "xr";
|
|
7522
|
+
const isSpatial = isXr && fabPlacement === "spatialized";
|
|
7226
7523
|
const applyAnimation = !isXr || !isSpatial;
|
|
7227
|
-
const navRef =
|
|
7524
|
+
const navRef = React39__namespace.useRef(null);
|
|
7228
7525
|
const handleKeyDown = useRoving(navRef);
|
|
7229
|
-
const setRefs =
|
|
7526
|
+
const setRefs = React39__namespace.useCallback(
|
|
7230
7527
|
(node) => {
|
|
7231
7528
|
navRef.current = node;
|
|
7232
7529
|
if (typeof ref === "function") ref(node);
|
|
@@ -7235,12 +7532,12 @@ var NavigationRailComponent = React38__namespace.forwardRef(
|
|
|
7235
7532
|
[ref]
|
|
7236
7533
|
);
|
|
7237
7534
|
const navBaseClasses = cn(
|
|
7238
|
-
railContainerVariants({ variant, narrow
|
|
7535
|
+
railContainerVariants({ variant, narrow })
|
|
7239
7536
|
);
|
|
7240
7537
|
const modalPositioning = isModal ? "fixed left-0 top-0 z-[100]" : "";
|
|
7241
7538
|
const navHeaderSpacing = (() => {
|
|
7242
7539
|
if (!isXr) return "mb-6 min-h-10";
|
|
7243
|
-
if (
|
|
7540
|
+
if (fabPlacement === "contained") return fab ? "mb-10" : "mb-5";
|
|
7244
7541
|
return "mb-5";
|
|
7245
7542
|
})();
|
|
7246
7543
|
const navElement = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -7319,7 +7616,7 @@ var NavigationRailComponent = React38__namespace.forwardRef(
|
|
|
7319
7616
|
children: fab
|
|
7320
7617
|
}
|
|
7321
7618
|
),
|
|
7322
|
-
|
|
7619
|
+
React39__namespace.cloneElement(
|
|
7323
7620
|
navElement,
|
|
7324
7621
|
{
|
|
7325
7622
|
className: cn(navBaseClasses, "pointer-events-auto")
|
|
@@ -7330,7 +7627,7 @@ var NavigationRailComponent = React38__namespace.forwardRef(
|
|
|
7330
7627
|
"md3-nav-wrapper"
|
|
7331
7628
|
);
|
|
7332
7629
|
const finalNavElement = isSpatial ? spatialWrapper : navElement;
|
|
7333
|
-
const contextValue = { variant, labelVisibility,
|
|
7630
|
+
const contextValue = { variant, labelVisibility, activeIndicatorTransition };
|
|
7334
7631
|
if (isModal) {
|
|
7335
7632
|
if (typeof document === "undefined") return null;
|
|
7336
7633
|
return reactDom.createPortal(
|
|
@@ -7357,13 +7654,13 @@ var NavigationRailComponent = React38__namespace.forwardRef(
|
|
|
7357
7654
|
}
|
|
7358
7655
|
);
|
|
7359
7656
|
NavigationRailComponent.displayName = "NavigationRail";
|
|
7360
|
-
var NavigationRail =
|
|
7657
|
+
var NavigationRail = React39__namespace.memo(NavigationRailComponent);
|
|
7361
7658
|
var MD3_FAST_EFFECTS2 = [0.3, 0, 1, 1];
|
|
7362
|
-
var RadioGroupContext =
|
|
7659
|
+
var RadioGroupContext = React39__namespace.createContext(
|
|
7363
7660
|
null
|
|
7364
7661
|
);
|
|
7365
7662
|
function useMergedRef3(externalRef, internalRef) {
|
|
7366
|
-
return
|
|
7663
|
+
return React39__namespace.useCallback(
|
|
7367
7664
|
(node) => {
|
|
7368
7665
|
internalRef.current = node;
|
|
7369
7666
|
if (!externalRef) return;
|
|
@@ -7376,7 +7673,7 @@ function useMergedRef3(externalRef, internalRef) {
|
|
|
7376
7673
|
[externalRef, internalRef]
|
|
7377
7674
|
);
|
|
7378
7675
|
}
|
|
7379
|
-
var RadioVisual =
|
|
7676
|
+
var RadioVisual = React39__namespace.memo(function RadioVisual2({
|
|
7380
7677
|
isSelected,
|
|
7381
7678
|
disabled,
|
|
7382
7679
|
error,
|
|
@@ -7429,7 +7726,7 @@ var RadioVisual = React38__namespace.memo(function RadioVisual2({
|
|
|
7429
7726
|
}
|
|
7430
7727
|
);
|
|
7431
7728
|
});
|
|
7432
|
-
var RadioButtonComponent =
|
|
7729
|
+
var RadioButtonComponent = React39__namespace.forwardRef(
|
|
7433
7730
|
({
|
|
7434
7731
|
selected,
|
|
7435
7732
|
defaultSelected = false,
|
|
@@ -7448,23 +7745,23 @@ var RadioButtonComponent = React38__namespace.forwardRef(
|
|
|
7448
7745
|
required: requiredProp
|
|
7449
7746
|
}, ref) => {
|
|
7450
7747
|
var _a, _b;
|
|
7451
|
-
const group =
|
|
7748
|
+
const group = React39__namespace.useContext(RadioGroupContext);
|
|
7452
7749
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
7453
|
-
const generatedId =
|
|
7750
|
+
const generatedId = React39__namespace.useId();
|
|
7454
7751
|
const inputId = idProp != null ? idProp : label ? `radio-${generatedId}` : void 0;
|
|
7455
7752
|
const name = (_b = group == null ? void 0 : group.name) != null ? _b : nameProp;
|
|
7456
7753
|
const disabled = (group == null ? void 0 : group.disabled) || disabledProp;
|
|
7457
7754
|
const error = (group == null ? void 0 : group.error) || errorProp || color === "error";
|
|
7458
7755
|
const required = (group == null ? void 0 : group.required) || requiredProp;
|
|
7459
|
-
const [internalSelected, setInternalSelected] =
|
|
7756
|
+
const [internalSelected, setInternalSelected] = React39__namespace.useState(defaultSelected);
|
|
7460
7757
|
const isControlled = selected !== void 0;
|
|
7461
7758
|
const isSelected = group ? group.selectedValue === value : isControlled ? selected != null ? selected : false : internalSelected;
|
|
7462
|
-
const [ripples, setRipples] =
|
|
7463
|
-
const removeRipple =
|
|
7759
|
+
const [ripples, setRipples] = React39__namespace.useState([]);
|
|
7760
|
+
const removeRipple = React39__namespace.useCallback(
|
|
7464
7761
|
(id) => setRipples((prev) => prev.filter((r) => r.id !== id)),
|
|
7465
7762
|
[]
|
|
7466
7763
|
);
|
|
7467
|
-
const onPointerDown =
|
|
7764
|
+
const onPointerDown = React39__namespace.useCallback(
|
|
7468
7765
|
(e) => {
|
|
7469
7766
|
if (disabled) return;
|
|
7470
7767
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -7478,12 +7775,12 @@ var RadioButtonComponent = React38__namespace.forwardRef(
|
|
|
7478
7775
|
},
|
|
7479
7776
|
[disabled]
|
|
7480
7777
|
);
|
|
7481
|
-
const [isHovered, setIsHovered] =
|
|
7482
|
-
const onPointerEnter =
|
|
7778
|
+
const [isHovered, setIsHovered] = React39__namespace.useState(false);
|
|
7779
|
+
const onPointerEnter = React39__namespace.useCallback(() => {
|
|
7483
7780
|
if (!disabled) setIsHovered(true);
|
|
7484
7781
|
}, [disabled]);
|
|
7485
|
-
const onPointerLeave =
|
|
7486
|
-
const handleChange =
|
|
7782
|
+
const onPointerLeave = React39__namespace.useCallback(() => setIsHovered(false), []);
|
|
7783
|
+
const handleChange = React39__namespace.useCallback(
|
|
7487
7784
|
(_e) => {
|
|
7488
7785
|
if (disabled || onClick === null) return;
|
|
7489
7786
|
if (group) {
|
|
@@ -7497,7 +7794,7 @@ var RadioButtonComponent = React38__namespace.forwardRef(
|
|
|
7497
7794
|
},
|
|
7498
7795
|
[disabled, onClick, group, value, isControlled]
|
|
7499
7796
|
);
|
|
7500
|
-
const inputRef =
|
|
7797
|
+
const inputRef = React39__namespace.useRef(null);
|
|
7501
7798
|
const mergedRef = useMergedRef3(ref, inputRef);
|
|
7502
7799
|
const stateLayerBg = error ? "before:bg-m3-error" : "before:bg-m3-primary";
|
|
7503
7800
|
const stateLayerClass = cn(
|
|
@@ -7608,8 +7905,8 @@ var RadioButtonComponent = React38__namespace.forwardRef(
|
|
|
7608
7905
|
}
|
|
7609
7906
|
);
|
|
7610
7907
|
RadioButtonComponent.displayName = "RadioButton";
|
|
7611
|
-
var RadioButton =
|
|
7612
|
-
var RadioGroupComponent =
|
|
7908
|
+
var RadioButton = React39__namespace.memo(RadioButtonComponent);
|
|
7909
|
+
var RadioGroupComponent = React39__namespace.forwardRef(
|
|
7613
7910
|
({
|
|
7614
7911
|
name,
|
|
7615
7912
|
value: valueProp,
|
|
@@ -7624,19 +7921,19 @@ var RadioGroupComponent = React38__namespace.forwardRef(
|
|
|
7624
7921
|
children,
|
|
7625
7922
|
className
|
|
7626
7923
|
}, ref) => {
|
|
7627
|
-
const [internalValue, setInternalValue] =
|
|
7924
|
+
const [internalValue, setInternalValue] = React39__namespace.useState(defaultValue);
|
|
7628
7925
|
const isControlled = valueProp !== void 0;
|
|
7629
7926
|
const selectedValue = isControlled ? valueProp : internalValue;
|
|
7630
|
-
const handleValueChange =
|
|
7927
|
+
const handleValueChange = React39__namespace.useCallback(
|
|
7631
7928
|
(val) => {
|
|
7632
7929
|
if (!isControlled) setInternalValue(val);
|
|
7633
7930
|
onValueChange == null ? void 0 : onValueChange(val);
|
|
7634
7931
|
},
|
|
7635
7932
|
[isControlled, onValueChange]
|
|
7636
7933
|
);
|
|
7637
|
-
const groupRef =
|
|
7934
|
+
const groupRef = React39__namespace.useRef(null);
|
|
7638
7935
|
const mergedRef = useMergedRef3(ref, groupRef);
|
|
7639
|
-
const onKeyDown =
|
|
7936
|
+
const onKeyDown = React39__namespace.useCallback(
|
|
7640
7937
|
(e) => {
|
|
7641
7938
|
var _a, _b;
|
|
7642
7939
|
if (disabled) return;
|
|
@@ -7660,7 +7957,7 @@ var RadioGroupComponent = React38__namespace.forwardRef(
|
|
|
7660
7957
|
},
|
|
7661
7958
|
[disabled, handleValueChange]
|
|
7662
7959
|
);
|
|
7663
|
-
const contextValue =
|
|
7960
|
+
const contextValue = React39__namespace.useMemo(
|
|
7664
7961
|
() => ({
|
|
7665
7962
|
name,
|
|
7666
7963
|
selectedValue,
|
|
@@ -7695,7 +7992,7 @@ var RadioGroupComponent = React38__namespace.forwardRef(
|
|
|
7695
7992
|
}
|
|
7696
7993
|
);
|
|
7697
7994
|
RadioGroupComponent.displayName = "RadioGroup";
|
|
7698
|
-
var RadioGroup =
|
|
7995
|
+
var RadioGroup = React39__namespace.memo(RadioGroupComponent);
|
|
7699
7996
|
function useSearchKeyboard({
|
|
7700
7997
|
active,
|
|
7701
7998
|
onActiveChange,
|
|
@@ -7704,14 +8001,14 @@ function useSearchKeyboard({
|
|
|
7704
8001
|
itemCount,
|
|
7705
8002
|
onSelectSuggestion
|
|
7706
8003
|
}) {
|
|
7707
|
-
const [activeIndex, setActiveIndex] =
|
|
7708
|
-
const resetKeyRef =
|
|
8004
|
+
const [activeIndex, setActiveIndex] = React39__namespace.useState(-1);
|
|
8005
|
+
const resetKeyRef = React39__namespace.useRef(`${active}:${query}`);
|
|
7709
8006
|
const currentKey = `${active}:${query}`;
|
|
7710
8007
|
if (resetKeyRef.current !== currentKey) {
|
|
7711
8008
|
resetKeyRef.current = currentKey;
|
|
7712
8009
|
setActiveIndex(-1);
|
|
7713
8010
|
}
|
|
7714
|
-
const handleKeyDown =
|
|
8011
|
+
const handleKeyDown = React39__namespace.useCallback(
|
|
7715
8012
|
(e) => {
|
|
7716
8013
|
if (!active) return;
|
|
7717
8014
|
switch (e.key) {
|
|
@@ -7751,7 +8048,7 @@ function useSearchKeyboard({
|
|
|
7751
8048
|
query
|
|
7752
8049
|
]
|
|
7753
8050
|
);
|
|
7754
|
-
const resetActiveIndex =
|
|
8051
|
+
const resetActiveIndex = React39__namespace.useCallback(() => {
|
|
7755
8052
|
setActiveIndex(-1);
|
|
7756
8053
|
}, []);
|
|
7757
8054
|
return { activeIndex, handleKeyDown, resetActiveIndex };
|
|
@@ -7839,10 +8136,10 @@ function AnimatedPlaceholder({
|
|
|
7839
8136
|
className
|
|
7840
8137
|
}) {
|
|
7841
8138
|
const shouldReduceMotion = react.useReducedMotion();
|
|
7842
|
-
const containerRef =
|
|
7843
|
-
const spanRef =
|
|
7844
|
-
const [xOffset, setXOffset] =
|
|
7845
|
-
const recalculate =
|
|
8139
|
+
const containerRef = React39__namespace.useRef(null);
|
|
8140
|
+
const spanRef = React39__namespace.useRef(null);
|
|
8141
|
+
const [xOffset, setXOffset] = React39__namespace.useState(0);
|
|
8142
|
+
const recalculate = React39__namespace.useCallback(() => {
|
|
7846
8143
|
const container = containerRef.current;
|
|
7847
8144
|
const span = spanRef.current;
|
|
7848
8145
|
if (!container || !span || textAlign === "left") {
|
|
@@ -7857,10 +8154,10 @@ function AnimatedPlaceholder({
|
|
|
7857
8154
|
setXOffset(Math.max(0, containerWidth - textWidth));
|
|
7858
8155
|
}
|
|
7859
8156
|
}, [textAlign]);
|
|
7860
|
-
|
|
8157
|
+
React39__namespace.useLayoutEffect(() => {
|
|
7861
8158
|
recalculate();
|
|
7862
8159
|
}, [recalculate]);
|
|
7863
|
-
|
|
8160
|
+
React39__namespace.useEffect(() => {
|
|
7864
8161
|
const container = containerRef.current;
|
|
7865
8162
|
if (!container) return;
|
|
7866
8163
|
const observer = new ResizeObserver(recalculate);
|
|
@@ -7929,10 +8226,10 @@ function SearchBar({
|
|
|
7929
8226
|
activeIndex
|
|
7930
8227
|
}) {
|
|
7931
8228
|
const shouldReduceMotion = react.useReducedMotion();
|
|
7932
|
-
const inputRef =
|
|
7933
|
-
const prevActiveRef =
|
|
7934
|
-
const isRestoringFocusRef =
|
|
7935
|
-
|
|
8229
|
+
const inputRef = React39__namespace.useRef(null);
|
|
8230
|
+
const prevActiveRef = React39__namespace.useRef(active);
|
|
8231
|
+
const isRestoringFocusRef = React39__namespace.useRef(false);
|
|
8232
|
+
React39__namespace.useEffect(() => {
|
|
7936
8233
|
var _a;
|
|
7937
8234
|
let rafId;
|
|
7938
8235
|
if (prevActiveRef.current === true && active === false) {
|
|
@@ -8051,7 +8348,7 @@ function SearchBar({
|
|
|
8051
8348
|
) })
|
|
8052
8349
|
);
|
|
8053
8350
|
}
|
|
8054
|
-
var SearchContext =
|
|
8351
|
+
var SearchContext = React39__namespace.createContext(null);
|
|
8055
8352
|
function SearchProvider({
|
|
8056
8353
|
children,
|
|
8057
8354
|
value
|
|
@@ -8059,15 +8356,15 @@ function SearchProvider({
|
|
|
8059
8356
|
return /* @__PURE__ */ jsxRuntime.jsx(SearchContext.Provider, { value, children });
|
|
8060
8357
|
}
|
|
8061
8358
|
function useSearch() {
|
|
8062
|
-
const context =
|
|
8359
|
+
const context = React39__namespace.useContext(SearchContext);
|
|
8063
8360
|
if (!context) {
|
|
8064
8361
|
return { listboxId: "", activeIndex: -1 };
|
|
8065
8362
|
}
|
|
8066
8363
|
return context;
|
|
8067
8364
|
}
|
|
8068
8365
|
function useClickOutside(handler, enabled = true) {
|
|
8069
|
-
const ref =
|
|
8070
|
-
|
|
8366
|
+
const ref = React39.useRef(null);
|
|
8367
|
+
React39.useEffect(() => {
|
|
8071
8368
|
if (!enabled) return;
|
|
8072
8369
|
const listener = (event) => {
|
|
8073
8370
|
const el = ref.current;
|
|
@@ -8086,7 +8383,7 @@ function useClickOutside(handler, enabled = true) {
|
|
|
8086
8383
|
return ref;
|
|
8087
8384
|
}
|
|
8088
8385
|
function useSearchViewFocus(inputRef, active) {
|
|
8089
|
-
|
|
8386
|
+
React39__namespace.useEffect(() => {
|
|
8090
8387
|
if (!active) return;
|
|
8091
8388
|
let raf2;
|
|
8092
8389
|
const raf1 = requestAnimationFrame(() => {
|
|
@@ -8160,7 +8457,7 @@ function SearchViewDocked({
|
|
|
8160
8457
|
activeIndex
|
|
8161
8458
|
}) {
|
|
8162
8459
|
const shouldReduceMotion = react.useReducedMotion();
|
|
8163
|
-
const inputRef =
|
|
8460
|
+
const inputRef = React39__namespace.useRef(null);
|
|
8164
8461
|
useSearchViewFocus(inputRef, active);
|
|
8165
8462
|
const dropdownRef = useClickOutside(() => {
|
|
8166
8463
|
onActiveChange(false);
|
|
@@ -8306,10 +8603,10 @@ function SearchViewFullScreen({
|
|
|
8306
8603
|
activeIndex
|
|
8307
8604
|
}) {
|
|
8308
8605
|
const shouldReduceMotion = react.useReducedMotion();
|
|
8309
|
-
const inputRef =
|
|
8606
|
+
const inputRef = React39__namespace.useRef(null);
|
|
8310
8607
|
useSearchViewFocus(inputRef, active);
|
|
8311
|
-
const [mounted, setMounted] =
|
|
8312
|
-
|
|
8608
|
+
const [mounted, setMounted] = React39__namespace.useState(false);
|
|
8609
|
+
React39__namespace.useEffect(() => {
|
|
8313
8610
|
setMounted(true);
|
|
8314
8611
|
}, []);
|
|
8315
8612
|
const handleFormSubmit = (e) => {
|
|
@@ -8467,10 +8764,10 @@ function SearchComponent({
|
|
|
8467
8764
|
className,
|
|
8468
8765
|
viewClassName
|
|
8469
8766
|
}) {
|
|
8470
|
-
const generatedId =
|
|
8767
|
+
const generatedId = React39__namespace.useId();
|
|
8471
8768
|
const searchId = id != null ? id : generatedId;
|
|
8472
8769
|
const listboxId = `${searchId}-listbox`;
|
|
8473
|
-
const itemCount =
|
|
8770
|
+
const itemCount = React39__namespace.Children.count(children);
|
|
8474
8771
|
const { activeIndex, handleKeyDown } = useSearchKeyboard({
|
|
8475
8772
|
active,
|
|
8476
8773
|
onActiveChange,
|
|
@@ -8568,7 +8865,7 @@ function useSliderMath({
|
|
|
8568
8865
|
max,
|
|
8569
8866
|
step
|
|
8570
8867
|
}) {
|
|
8571
|
-
return
|
|
8868
|
+
return React39.useMemo(
|
|
8572
8869
|
() => ({
|
|
8573
8870
|
coerce: (v) => coerceValue(v, min, max),
|
|
8574
8871
|
snap: (v) => snapToStep(v, min, step),
|
|
@@ -8706,7 +9003,7 @@ var SLIDER_INDICATOR_TRANSITION = {
|
|
|
8706
9003
|
stiffness: 450,
|
|
8707
9004
|
damping: 32
|
|
8708
9005
|
};
|
|
8709
|
-
var ValueIndicator =
|
|
9006
|
+
var ValueIndicator = React39__namespace.memo(function ValueIndicator2({
|
|
8710
9007
|
value,
|
|
8711
9008
|
visible,
|
|
8712
9009
|
orientation,
|
|
@@ -8753,7 +9050,7 @@ var ValueIndicator = React38__namespace.memo(function ValueIndicator2({
|
|
|
8753
9050
|
"value-indicator"
|
|
8754
9051
|
) });
|
|
8755
9052
|
});
|
|
8756
|
-
var SliderThumb =
|
|
9053
|
+
var SliderThumb = React39__namespace.memo(function SliderThumb2({
|
|
8757
9054
|
value,
|
|
8758
9055
|
percent,
|
|
8759
9056
|
min,
|
|
@@ -8785,11 +9082,11 @@ var SliderThumb = React38__namespace.memo(function SliderThumb2({
|
|
|
8785
9082
|
[posTarget]: `calc(${trackInset}px + ${percent} * (100% - ${trackInset * 2}px))`
|
|
8786
9083
|
};
|
|
8787
9084
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
8788
|
-
const [isDragging, setIsDragging] =
|
|
8789
|
-
const [isHovered, setIsHovered] =
|
|
8790
|
-
const [isFocused, setIsFocused] =
|
|
8791
|
-
const pointerIdRef =
|
|
8792
|
-
const thumbRef =
|
|
9085
|
+
const [isDragging, setIsDragging] = React39__namespace.useState(false);
|
|
9086
|
+
const [isHovered, setIsHovered] = React39__namespace.useState(false);
|
|
9087
|
+
const [isFocused, setIsFocused] = React39__namespace.useState(false);
|
|
9088
|
+
const pointerIdRef = React39__namespace.useRef(null);
|
|
9089
|
+
const thumbRef = React39__namespace.useRef(null);
|
|
8793
9090
|
const showIndicator = showValueIndicator && (isDragging || isHovered || isFocused);
|
|
8794
9091
|
const positionStyle = isHorizontal ? __spreadProps(__spreadValues({
|
|
8795
9092
|
position: "absolute"
|
|
@@ -8804,7 +9101,7 @@ var SliderThumb = React38__namespace.memo(function SliderThumb2({
|
|
|
8804
9101
|
transform: "translate(-50%, 50%)",
|
|
8805
9102
|
zIndex
|
|
8806
9103
|
});
|
|
8807
|
-
const getDeltaFromPointer =
|
|
9104
|
+
const getDeltaFromPointer = React39__namespace.useCallback(
|
|
8808
9105
|
(e) => {
|
|
8809
9106
|
const trackEl = trackRef.current;
|
|
8810
9107
|
if (!trackEl) return percent;
|
|
@@ -8831,7 +9128,7 @@ var SliderThumb = React38__namespace.memo(function SliderThumb2({
|
|
|
8831
9128
|
},
|
|
8832
9129
|
[isHorizontal, max, min, percent, step, trackRef, trackSize]
|
|
8833
9130
|
);
|
|
8834
|
-
const handlePointerDown =
|
|
9131
|
+
const handlePointerDown = React39__namespace.useCallback(
|
|
8835
9132
|
(e) => {
|
|
8836
9133
|
if (disabled) return;
|
|
8837
9134
|
e.preventDefault();
|
|
@@ -8842,7 +9139,7 @@ var SliderThumb = React38__namespace.memo(function SliderThumb2({
|
|
|
8842
9139
|
},
|
|
8843
9140
|
[disabled]
|
|
8844
9141
|
);
|
|
8845
|
-
const handlePointerMove =
|
|
9142
|
+
const handlePointerMove = React39__namespace.useCallback(
|
|
8846
9143
|
(e) => {
|
|
8847
9144
|
if (!isDragging || e.pointerId !== pointerIdRef.current) return;
|
|
8848
9145
|
const newValue = getDeltaFromPointer(e.nativeEvent);
|
|
@@ -8850,7 +9147,7 @@ var SliderThumb = React38__namespace.memo(function SliderThumb2({
|
|
|
8850
9147
|
},
|
|
8851
9148
|
[isDragging, getDeltaFromPointer, onValueChange]
|
|
8852
9149
|
);
|
|
8853
|
-
const handlePointerUp =
|
|
9150
|
+
const handlePointerUp = React39__namespace.useCallback(
|
|
8854
9151
|
(e) => {
|
|
8855
9152
|
if (e.pointerId !== pointerIdRef.current) return;
|
|
8856
9153
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
@@ -8860,7 +9157,7 @@ var SliderThumb = React38__namespace.memo(function SliderThumb2({
|
|
|
8860
9157
|
},
|
|
8861
9158
|
[onValueChangeEnd, value]
|
|
8862
9159
|
);
|
|
8863
|
-
const handleKeyDown =
|
|
9160
|
+
const handleKeyDown = React39__namespace.useCallback(
|
|
8864
9161
|
(e) => {
|
|
8865
9162
|
if (disabled) return;
|
|
8866
9163
|
if (e.key === "Home") {
|
|
@@ -8964,7 +9261,7 @@ var SliderThumb = React38__namespace.memo(function SliderThumb2({
|
|
|
8964
9261
|
}
|
|
8965
9262
|
);
|
|
8966
9263
|
});
|
|
8967
|
-
var RangeTrack =
|
|
9264
|
+
var RangeTrack = React39__namespace.memo(function RangeTrack2({
|
|
8968
9265
|
startPercent,
|
|
8969
9266
|
endPercent,
|
|
8970
9267
|
trackSize,
|
|
@@ -9209,7 +9506,7 @@ var RangeTrack = React38__namespace.memo(function RangeTrack2({
|
|
|
9209
9506
|
}
|
|
9210
9507
|
);
|
|
9211
9508
|
});
|
|
9212
|
-
var RangeSliderComponent =
|
|
9509
|
+
var RangeSliderComponent = React39__namespace.forwardRef(
|
|
9213
9510
|
({
|
|
9214
9511
|
value: controlledValue,
|
|
9215
9512
|
defaultValue,
|
|
@@ -9233,7 +9530,7 @@ var RangeSliderComponent = React38__namespace.forwardRef(
|
|
|
9233
9530
|
const isHorizontal = orientation === "horizontal";
|
|
9234
9531
|
const defaultStart = (_a = defaultValue == null ? void 0 : defaultValue[0]) != null ? _a : min;
|
|
9235
9532
|
const defaultEnd = (_b = defaultValue == null ? void 0 : defaultValue[1]) != null ? _b : max;
|
|
9236
|
-
const [internalValue, setInternalValue] =
|
|
9533
|
+
const [internalValue, setInternalValue] = React39__namespace.useState([
|
|
9237
9534
|
defaultStart,
|
|
9238
9535
|
defaultEnd
|
|
9239
9536
|
]);
|
|
@@ -9247,10 +9544,10 @@ var RangeSliderComponent = React38__namespace.forwardRef(
|
|
|
9247
9544
|
const endValue = snap(coerce(resolvedValue[1]));
|
|
9248
9545
|
const startPercent = toPercent(startValue);
|
|
9249
9546
|
const endPercent = toPercent(endValue);
|
|
9250
|
-
const [topThumb, setTopThumb] =
|
|
9251
|
-
const trackRef =
|
|
9547
|
+
const [topThumb, setTopThumb] = React39__namespace.useState("end");
|
|
9548
|
+
const trackRef = React39__namespace.useRef(null);
|
|
9252
9549
|
const minGap = step > 0 ? step : (max - min) / 1e3;
|
|
9253
|
-
const handleStartChange =
|
|
9550
|
+
const handleStartChange = React39__namespace.useCallback(
|
|
9254
9551
|
(newStart) => {
|
|
9255
9552
|
setTopThumb("start");
|
|
9256
9553
|
const clamped = Math.min(newStart, endValue - minGap);
|
|
@@ -9262,7 +9559,7 @@ var RangeSliderComponent = React38__namespace.forwardRef(
|
|
|
9262
9559
|
},
|
|
9263
9560
|
[controlledValue, coerce, endValue, minGap, onValueChange, snap]
|
|
9264
9561
|
);
|
|
9265
|
-
const handleEndChange =
|
|
9562
|
+
const handleEndChange = React39__namespace.useCallback(
|
|
9266
9563
|
(newEnd) => {
|
|
9267
9564
|
setTopThumb("end");
|
|
9268
9565
|
const clamped = Math.max(newEnd, startValue + minGap);
|
|
@@ -9274,15 +9571,15 @@ var RangeSliderComponent = React38__namespace.forwardRef(
|
|
|
9274
9571
|
},
|
|
9275
9572
|
[controlledValue, coerce, minGap, onValueChange, snap, startValue]
|
|
9276
9573
|
);
|
|
9277
|
-
const handleStartChangeEnd =
|
|
9574
|
+
const handleStartChangeEnd = React39__namespace.useCallback(
|
|
9278
9575
|
(v) => onValueChangeEnd == null ? void 0 : onValueChangeEnd([v, endValue]),
|
|
9279
9576
|
[endValue, onValueChangeEnd]
|
|
9280
9577
|
);
|
|
9281
|
-
const handleEndChangeEnd =
|
|
9578
|
+
const handleEndChangeEnd = React39__namespace.useCallback(
|
|
9282
9579
|
(v) => onValueChangeEnd == null ? void 0 : onValueChangeEnd([startValue, v]),
|
|
9283
9580
|
[onValueChangeEnd, startValue]
|
|
9284
9581
|
);
|
|
9285
|
-
const handleTrackPointerDown =
|
|
9582
|
+
const handleTrackPointerDown = React39__namespace.useCallback(
|
|
9286
9583
|
(e) => {
|
|
9287
9584
|
if (disabled) return;
|
|
9288
9585
|
const trackEl = trackRef.current;
|
|
@@ -9326,7 +9623,7 @@ var RangeSliderComponent = React38__namespace.forwardRef(
|
|
|
9326
9623
|
trackSize
|
|
9327
9624
|
]
|
|
9328
9625
|
);
|
|
9329
|
-
const id =
|
|
9626
|
+
const id = React39__namespace.useId();
|
|
9330
9627
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9331
9628
|
"div",
|
|
9332
9629
|
{
|
|
@@ -9406,7 +9703,7 @@ var RangeSliderComponent = React38__namespace.forwardRef(
|
|
|
9406
9703
|
}
|
|
9407
9704
|
);
|
|
9408
9705
|
RangeSliderComponent.displayName = "RangeSlider";
|
|
9409
|
-
var RangeSlider =
|
|
9706
|
+
var RangeSlider = React39__namespace.memo(RangeSliderComponent);
|
|
9410
9707
|
function getHorizontalRadius(isLeading, innerR, outerR) {
|
|
9411
9708
|
if (isLeading) {
|
|
9412
9709
|
return {
|
|
@@ -9445,7 +9742,7 @@ var allInnerRadius = (innerR) => ({
|
|
|
9445
9742
|
borderTopRightRadius: innerR,
|
|
9446
9743
|
borderBottomRightRadius: innerR
|
|
9447
9744
|
});
|
|
9448
|
-
var InsetIcon =
|
|
9745
|
+
var InsetIcon = React39__namespace.memo(function InsetIcon2({
|
|
9449
9746
|
icon,
|
|
9450
9747
|
isOnActiveSegment,
|
|
9451
9748
|
position,
|
|
@@ -9539,7 +9836,7 @@ function Ticks({
|
|
|
9539
9836
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style, "aria-hidden": "true" }, tick);
|
|
9540
9837
|
}) });
|
|
9541
9838
|
}
|
|
9542
|
-
var SliderTrack =
|
|
9839
|
+
var SliderTrack = React39__namespace.memo(function SliderTrack2({
|
|
9543
9840
|
percent,
|
|
9544
9841
|
trackSize,
|
|
9545
9842
|
orientation,
|
|
@@ -9574,8 +9871,8 @@ var SliderTrack = React38__namespace.memo(function SliderTrack2({
|
|
|
9574
9871
|
const gapWithThumbStr = `${thumbGap + thumbHalfWidth}px`;
|
|
9575
9872
|
const hasAnyInsetIcon = Boolean(insetIcon || insetIconTrailing);
|
|
9576
9873
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
9577
|
-
const [trackWidth, setTrackWidth] =
|
|
9578
|
-
|
|
9874
|
+
const [trackWidth, setTrackWidth] = React39__namespace.useState(0);
|
|
9875
|
+
React39__namespace.useLayoutEffect(() => {
|
|
9579
9876
|
const el = trackRef.current;
|
|
9580
9877
|
if (!el || !hasAnyInsetIcon) return;
|
|
9581
9878
|
setTrackWidth(isHorizontal ? el.clientWidth : el.clientHeight);
|
|
@@ -9592,8 +9889,8 @@ var SliderTrack = React38__namespace.memo(function SliderTrack2({
|
|
|
9592
9889
|
const iconTotalWidth = activeIconSize + SliderTokens.insetIconPadding * 2 + thumbGap + thumbHalfWidth;
|
|
9593
9890
|
const iconThreshold = trackWidth > 0 ? iconTotalWidth / trackWidth : 0.15;
|
|
9594
9891
|
const HYSTERESIS_GAP = 0.04;
|
|
9595
|
-
const trailingActiveRef =
|
|
9596
|
-
const leadingActiveRef =
|
|
9892
|
+
const trailingActiveRef = React39__namespace.useRef(1 - percent <= iconThreshold);
|
|
9893
|
+
const leadingActiveRef = React39__namespace.useRef(percent > iconThreshold);
|
|
9597
9894
|
const trailingPercent = 1 - percent;
|
|
9598
9895
|
if (trailingActiveRef.current) {
|
|
9599
9896
|
if (trailingPercent > iconThreshold + HYSTERESIS_GAP) {
|
|
@@ -10100,7 +10397,7 @@ var SliderTrack = React38__namespace.memo(function SliderTrack2({
|
|
|
10100
10397
|
}
|
|
10101
10398
|
);
|
|
10102
10399
|
});
|
|
10103
|
-
var SliderComponent =
|
|
10400
|
+
var SliderComponent = React39__namespace.forwardRef(
|
|
10104
10401
|
({
|
|
10105
10402
|
value: controlledValue,
|
|
10106
10403
|
defaultValue,
|
|
@@ -10129,7 +10426,7 @@ var SliderComponent = React38__namespace.forwardRef(
|
|
|
10129
10426
|
const isHorizontal = orientation === "horizontal";
|
|
10130
10427
|
const midpoint = min + (max - min) / 2;
|
|
10131
10428
|
const initialValue = defaultValue != null ? defaultValue : midpoint;
|
|
10132
|
-
const [internalValue, setInternalValue] =
|
|
10429
|
+
const [internalValue, setInternalValue] = React39__namespace.useState(initialValue);
|
|
10133
10430
|
const resolvedValue = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
10134
10431
|
const { coerce, snap, toPercent, ticks } = useSliderMath({
|
|
10135
10432
|
min,
|
|
@@ -10138,8 +10435,8 @@ var SliderComponent = React38__namespace.forwardRef(
|
|
|
10138
10435
|
});
|
|
10139
10436
|
const safeValue = snap(coerce(resolvedValue));
|
|
10140
10437
|
const percent = toPercent(safeValue);
|
|
10141
|
-
const trackRef =
|
|
10142
|
-
const handleValueChange =
|
|
10438
|
+
const trackRef = React39__namespace.useRef(null);
|
|
10439
|
+
const handleValueChange = React39__namespace.useCallback(
|
|
10143
10440
|
(newValue) => {
|
|
10144
10441
|
const clamped = snap(coerce(newValue));
|
|
10145
10442
|
if (controlledValue === void 0) {
|
|
@@ -10149,13 +10446,13 @@ var SliderComponent = React38__namespace.forwardRef(
|
|
|
10149
10446
|
},
|
|
10150
10447
|
[coerce, controlledValue, onValueChange, snap]
|
|
10151
10448
|
);
|
|
10152
|
-
const handleValueChangeEnd =
|
|
10449
|
+
const handleValueChangeEnd = React39__namespace.useCallback(
|
|
10153
10450
|
(newValue) => {
|
|
10154
10451
|
onValueChangeEnd == null ? void 0 : onValueChangeEnd(snap(coerce(newValue)));
|
|
10155
10452
|
},
|
|
10156
10453
|
[coerce, onValueChangeEnd, snap]
|
|
10157
10454
|
);
|
|
10158
|
-
const handleTrackPointerDown =
|
|
10455
|
+
const handleTrackPointerDown = React39__namespace.useCallback(
|
|
10159
10456
|
(e) => {
|
|
10160
10457
|
if (disabled) return;
|
|
10161
10458
|
const trackEl = trackRef.current;
|
|
@@ -10190,7 +10487,7 @@ var SliderComponent = React38__namespace.forwardRef(
|
|
|
10190
10487
|
trackSize
|
|
10191
10488
|
]
|
|
10192
10489
|
);
|
|
10193
|
-
const id =
|
|
10490
|
+
const id = React39__namespace.useId();
|
|
10194
10491
|
const thumbId = `slider-thumb-${id}`;
|
|
10195
10492
|
const supportsInsetIcon = !isCentered && SliderTokens.trackSizes[trackSize] >= 40;
|
|
10196
10493
|
const hasAnyInsetIcon = !!(insetIcon || insetIconTrailing);
|
|
@@ -10262,7 +10559,7 @@ var SliderComponent = React38__namespace.forwardRef(
|
|
|
10262
10559
|
}
|
|
10263
10560
|
);
|
|
10264
10561
|
SliderComponent.displayName = "Slider";
|
|
10265
|
-
var Slider =
|
|
10562
|
+
var Slider = React39__namespace.memo(SliderComponent);
|
|
10266
10563
|
var DURATION_MAP = {
|
|
10267
10564
|
short: 4e3,
|
|
10268
10565
|
long: 7e3
|
|
@@ -10308,9 +10605,9 @@ function toSnackbarData(item) {
|
|
|
10308
10605
|
return { id: generateId(), visuals: item.visuals, resolve: item.resolve };
|
|
10309
10606
|
}
|
|
10310
10607
|
function useSnackbarState() {
|
|
10311
|
-
const [current, setCurrent] =
|
|
10312
|
-
const queueRef =
|
|
10313
|
-
const showSnackbar =
|
|
10608
|
+
const [current, setCurrent] = React39__namespace.useState(null);
|
|
10609
|
+
const queueRef = React39__namespace.useRef([]);
|
|
10610
|
+
const showSnackbar = React39__namespace.useCallback(
|
|
10314
10611
|
(visuals) => {
|
|
10315
10612
|
return new Promise((resolve) => {
|
|
10316
10613
|
const item = { visuals, resolve };
|
|
@@ -10323,14 +10620,14 @@ function useSnackbarState() {
|
|
|
10323
10620
|
},
|
|
10324
10621
|
[]
|
|
10325
10622
|
);
|
|
10326
|
-
const _dismiss =
|
|
10623
|
+
const _dismiss = React39__namespace.useCallback((result) => {
|
|
10327
10624
|
setCurrent((prev) => {
|
|
10328
10625
|
if (prev) prev.resolve(result);
|
|
10329
10626
|
const next = queueRef.current.shift();
|
|
10330
10627
|
return next ? toSnackbarData(next) : null;
|
|
10331
10628
|
});
|
|
10332
10629
|
}, []);
|
|
10333
|
-
|
|
10630
|
+
React39__namespace.useEffect(() => {
|
|
10334
10631
|
return () => {
|
|
10335
10632
|
for (const item of queueRef.current) {
|
|
10336
10633
|
item.resolve(RESULT.DISMISSED);
|
|
@@ -10340,7 +10637,7 @@ function useSnackbarState() {
|
|
|
10340
10637
|
}, []);
|
|
10341
10638
|
return { current, showSnackbar, _dismiss };
|
|
10342
10639
|
}
|
|
10343
|
-
var Snackbar =
|
|
10640
|
+
var Snackbar = React39__namespace.memo(function Snackbar2({
|
|
10344
10641
|
data,
|
|
10345
10642
|
className
|
|
10346
10643
|
}) {
|
|
@@ -10354,15 +10651,15 @@ var Snackbar = React38__namespace.memo(function Snackbar2({
|
|
|
10354
10651
|
} = visuals;
|
|
10355
10652
|
const reducedMotion = react.useReducedMotion();
|
|
10356
10653
|
const durationMs = resolveDuration(duration);
|
|
10357
|
-
|
|
10654
|
+
React39__namespace.useEffect(() => {
|
|
10358
10655
|
const timer = setTimeout(() => resolve(RESULT.DISMISSED), durationMs);
|
|
10359
10656
|
return () => clearTimeout(timer);
|
|
10360
10657
|
}, [resolve, durationMs]);
|
|
10361
|
-
const handleAction =
|
|
10658
|
+
const handleAction = React39__namespace.useCallback(
|
|
10362
10659
|
() => resolve(RESULT.ACTION),
|
|
10363
10660
|
[resolve]
|
|
10364
10661
|
);
|
|
10365
|
-
const handleDismiss =
|
|
10662
|
+
const handleDismiss = React39__namespace.useCallback(
|
|
10366
10663
|
() => resolve(RESULT.DISMISSED),
|
|
10367
10664
|
[resolve]
|
|
10368
10665
|
);
|
|
@@ -10430,7 +10727,7 @@ var Snackbar = React38__namespace.memo(function Snackbar2({
|
|
|
10430
10727
|
Snackbar.displayName = "Snackbar";
|
|
10431
10728
|
function SnackbarHost({ state, className }) {
|
|
10432
10729
|
const { current, _dismiss } = state;
|
|
10433
|
-
const wrappedData =
|
|
10730
|
+
const wrappedData = React39__namespace.useMemo(() => {
|
|
10434
10731
|
if (!current) return null;
|
|
10435
10732
|
return __spreadProps(__spreadValues({}, current), { resolve: _dismiss });
|
|
10436
10733
|
}, [current, _dismiss]);
|
|
@@ -10448,12 +10745,12 @@ function SnackbarHost({ state, className }) {
|
|
|
10448
10745
|
) });
|
|
10449
10746
|
}
|
|
10450
10747
|
SnackbarHost.displayName = "SnackbarHost";
|
|
10451
|
-
var SnackbarContext =
|
|
10748
|
+
var SnackbarContext = React39__namespace.createContext(
|
|
10452
10749
|
null
|
|
10453
10750
|
);
|
|
10454
10751
|
function SnackbarProvider({ children }) {
|
|
10455
10752
|
const state = useSnackbarState();
|
|
10456
|
-
const contextValue =
|
|
10753
|
+
const contextValue = React39__namespace.useMemo(
|
|
10457
10754
|
() => ({ showSnackbar: state.showSnackbar }),
|
|
10458
10755
|
[state.showSnackbar]
|
|
10459
10756
|
);
|
|
@@ -10464,7 +10761,7 @@ function SnackbarProvider({ children }) {
|
|
|
10464
10761
|
}
|
|
10465
10762
|
SnackbarProvider.displayName = "SnackbarProvider";
|
|
10466
10763
|
function useSnackbar() {
|
|
10467
|
-
const ctx =
|
|
10764
|
+
const ctx = React39__namespace.useContext(SnackbarContext);
|
|
10468
10765
|
if (!ctx) {
|
|
10469
10766
|
throw new Error("useSnackbar must be used within a <SnackbarProvider>.");
|
|
10470
10767
|
}
|
|
@@ -10568,7 +10865,7 @@ function isIconVisible(thumbContent, icons, showOnlySelectedIcon, checked) {
|
|
|
10568
10865
|
if (icons) return true;
|
|
10569
10866
|
return showOnlySelectedIcon && checked;
|
|
10570
10867
|
}
|
|
10571
|
-
var SwitchVisual =
|
|
10868
|
+
var SwitchVisual = React39__namespace.memo(function SwitchVisual2({
|
|
10572
10869
|
checked,
|
|
10573
10870
|
disabled,
|
|
10574
10871
|
isPressed,
|
|
@@ -10688,7 +10985,7 @@ var SwitchVisual = React38__namespace.memo(function SwitchVisual2({
|
|
|
10688
10985
|
}
|
|
10689
10986
|
);
|
|
10690
10987
|
});
|
|
10691
|
-
var SwitchComponent =
|
|
10988
|
+
var SwitchComponent = React39__namespace.forwardRef(
|
|
10692
10989
|
({
|
|
10693
10990
|
checked,
|
|
10694
10991
|
onCheckedChange,
|
|
@@ -10706,16 +11003,16 @@ var SwitchComponent = React38__namespace.forwardRef(
|
|
|
10706
11003
|
}, ref) => {
|
|
10707
11004
|
var _a;
|
|
10708
11005
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
10709
|
-
const [isPressed, setIsPressed] =
|
|
10710
|
-
const [isHovered, setIsHovered] =
|
|
10711
|
-
const [isFocused, setIsFocused] =
|
|
10712
|
-
const [ripples, setRipples] =
|
|
10713
|
-
const generatedId =
|
|
11006
|
+
const [isPressed, setIsPressed] = React39__namespace.useState(false);
|
|
11007
|
+
const [isHovered, setIsHovered] = React39__namespace.useState(false);
|
|
11008
|
+
const [isFocused, setIsFocused] = React39__namespace.useState(false);
|
|
11009
|
+
const [ripples, setRipples] = React39__namespace.useState([]);
|
|
11010
|
+
const generatedId = React39__namespace.useId();
|
|
10714
11011
|
const switchId = label ? `switch-${generatedId}` : void 0;
|
|
10715
|
-
const handleClick =
|
|
11012
|
+
const handleClick = React39__namespace.useCallback(() => {
|
|
10716
11013
|
if (!disabled) onCheckedChange(!checked);
|
|
10717
11014
|
}, [disabled, checked, onCheckedChange]);
|
|
10718
|
-
const handleKeyDown =
|
|
11015
|
+
const handleKeyDown = React39__namespace.useCallback(
|
|
10719
11016
|
(e) => {
|
|
10720
11017
|
if (disabled) return;
|
|
10721
11018
|
if (e.key === " " || e.key === "Enter") {
|
|
@@ -10725,7 +11022,7 @@ var SwitchComponent = React38__namespace.forwardRef(
|
|
|
10725
11022
|
},
|
|
10726
11023
|
[disabled, checked, onCheckedChange]
|
|
10727
11024
|
);
|
|
10728
|
-
const handlePointerDown =
|
|
11025
|
+
const handlePointerDown = React39__namespace.useCallback(
|
|
10729
11026
|
(e) => {
|
|
10730
11027
|
if (disabled) return;
|
|
10731
11028
|
setIsPressed(true);
|
|
@@ -10740,19 +11037,19 @@ var SwitchComponent = React38__namespace.forwardRef(
|
|
|
10740
11037
|
},
|
|
10741
11038
|
[disabled]
|
|
10742
11039
|
);
|
|
10743
|
-
const handlePointerUp =
|
|
11040
|
+
const handlePointerUp = React39__namespace.useCallback(() => {
|
|
10744
11041
|
setIsPressed(false);
|
|
10745
11042
|
}, []);
|
|
10746
|
-
const handlePointerEnter =
|
|
11043
|
+
const handlePointerEnter = React39__namespace.useCallback(() => {
|
|
10747
11044
|
if (!disabled) setIsHovered(true);
|
|
10748
11045
|
}, [disabled]);
|
|
10749
|
-
const handlePointerLeave =
|
|
11046
|
+
const handlePointerLeave = React39__namespace.useCallback(() => {
|
|
10750
11047
|
setIsHovered(false);
|
|
10751
11048
|
setIsPressed(false);
|
|
10752
11049
|
}, []);
|
|
10753
|
-
const handleFocus =
|
|
10754
|
-
const handleBlur =
|
|
10755
|
-
const removeRipple =
|
|
11050
|
+
const handleFocus = React39__namespace.useCallback(() => setIsFocused(true), []);
|
|
11051
|
+
const handleBlur = React39__namespace.useCallback(() => setIsFocused(false), []);
|
|
11052
|
+
const removeRipple = React39__namespace.useCallback(
|
|
10756
11053
|
(id) => setRipples((prev) => prev.filter((r) => r.id !== id)),
|
|
10757
11054
|
[]
|
|
10758
11055
|
);
|
|
@@ -10837,7 +11134,7 @@ var SwitchComponent = React38__namespace.forwardRef(
|
|
|
10837
11134
|
}
|
|
10838
11135
|
);
|
|
10839
11136
|
SwitchComponent.displayName = "Switch";
|
|
10840
|
-
var Switch =
|
|
11137
|
+
var Switch = React39__namespace.memo(SwitchComponent);
|
|
10841
11138
|
var typographyVariants = classVarianceAuthority.cva("m-0 p-0 text-m3-on-surface", {
|
|
10842
11139
|
variants: {
|
|
10843
11140
|
variant: {
|
|
@@ -10862,10 +11159,10 @@ var typographyVariants = classVarianceAuthority.cva("m-0 p-0 text-m3-on-surface"
|
|
|
10862
11159
|
variant: "body-md"
|
|
10863
11160
|
}
|
|
10864
11161
|
});
|
|
10865
|
-
var Text =
|
|
11162
|
+
var Text = React39__namespace.forwardRef(
|
|
10866
11163
|
(_a, ref) => {
|
|
10867
11164
|
var _b = _a, { className, variant, as: Component } = _b, props = __objRest(_b, ["className", "variant", "as"]);
|
|
10868
|
-
const defaultComponent =
|
|
11165
|
+
const defaultComponent = React39__namespace.useMemo(() => {
|
|
10869
11166
|
if ((variant == null ? void 0 : variant.startsWith("display")) || (variant == null ? void 0 : variant.startsWith("headline")))
|
|
10870
11167
|
return "h1";
|
|
10871
11168
|
if (variant == null ? void 0 : variant.startsWith("title")) return "h2";
|
|
@@ -10882,9 +11179,9 @@ var Text = React38__namespace.forwardRef(
|
|
|
10882
11179
|
}
|
|
10883
11180
|
);
|
|
10884
11181
|
Text.displayName = "Text";
|
|
10885
|
-
var TabsContext =
|
|
11182
|
+
var TabsContext = React39__namespace.createContext(null);
|
|
10886
11183
|
function useTabsContext() {
|
|
10887
|
-
const ctx =
|
|
11184
|
+
const ctx = React39__namespace.useContext(TabsContext);
|
|
10888
11185
|
if (!ctx) {
|
|
10889
11186
|
throw new Error(
|
|
10890
11187
|
"[MD3 Tabs] Component must be used within a <Tabs> root. Ensure <TabsList>, <Tab>, and <TabsContent> are descendants of <Tabs>."
|
|
@@ -10892,7 +11189,7 @@ function useTabsContext() {
|
|
|
10892
11189
|
}
|
|
10893
11190
|
return ctx;
|
|
10894
11191
|
}
|
|
10895
|
-
var TabsComponent =
|
|
11192
|
+
var TabsComponent = React39__namespace.forwardRef(
|
|
10896
11193
|
({
|
|
10897
11194
|
value: controlledValue,
|
|
10898
11195
|
defaultValue = "",
|
|
@@ -10901,35 +11198,35 @@ var TabsComponent = React38__namespace.forwardRef(
|
|
|
10901
11198
|
children,
|
|
10902
11199
|
className
|
|
10903
11200
|
}, ref) => {
|
|
10904
|
-
const [internalValue, setInternalValue] =
|
|
11201
|
+
const [internalValue, setInternalValue] = React39__namespace.useState(defaultValue);
|
|
10905
11202
|
const isControlled = controlledValue !== void 0;
|
|
10906
11203
|
const value = isControlled ? controlledValue : internalValue;
|
|
10907
|
-
const handleValueChange =
|
|
11204
|
+
const handleValueChange = React39__namespace.useCallback(
|
|
10908
11205
|
(newValue) => {
|
|
10909
11206
|
if (!isControlled) setInternalValue(newValue);
|
|
10910
11207
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
10911
11208
|
},
|
|
10912
11209
|
[isControlled, onValueChange]
|
|
10913
11210
|
);
|
|
10914
|
-
const [focusedValue, setFocusedValue] =
|
|
10915
|
-
|
|
11211
|
+
const [focusedValue, setFocusedValue] = React39__namespace.useState(value);
|
|
11212
|
+
React39__namespace.useEffect(() => {
|
|
10916
11213
|
setFocusedValue(value);
|
|
10917
11214
|
}, [value]);
|
|
10918
|
-
const [tabValues, setTabValues] =
|
|
10919
|
-
const registerTab =
|
|
11215
|
+
const [tabValues, setTabValues] = React39__namespace.useState([]);
|
|
11216
|
+
const registerTab = React39__namespace.useCallback((tabValue) => {
|
|
10920
11217
|
setTabValues((prev) => {
|
|
10921
11218
|
if (prev.includes(tabValue)) return prev;
|
|
10922
11219
|
return [...prev, tabValue];
|
|
10923
11220
|
});
|
|
10924
11221
|
}, []);
|
|
10925
|
-
const unregisterTab =
|
|
11222
|
+
const unregisterTab = React39__namespace.useCallback((tabValue) => {
|
|
10926
11223
|
setTabValues((prev) => prev.filter((v) => v !== tabValue));
|
|
10927
11224
|
}, []);
|
|
10928
|
-
const hasAutoSelected =
|
|
10929
|
-
const [disabledValues, setDisabledValues] =
|
|
11225
|
+
const hasAutoSelected = React39__namespace.useRef(false);
|
|
11226
|
+
const [disabledValues, setDisabledValues] = React39__namespace.useState(
|
|
10930
11227
|
/* @__PURE__ */ new Set()
|
|
10931
11228
|
);
|
|
10932
|
-
const markTabDisabled =
|
|
11229
|
+
const markTabDisabled = React39__namespace.useCallback(
|
|
10933
11230
|
(tabValue, disabled) => {
|
|
10934
11231
|
setDisabledValues((prev) => {
|
|
10935
11232
|
const next = new Set(prev);
|
|
@@ -10943,7 +11240,7 @@ var TabsComponent = React38__namespace.forwardRef(
|
|
|
10943
11240
|
},
|
|
10944
11241
|
[]
|
|
10945
11242
|
);
|
|
10946
|
-
|
|
11243
|
+
React39__namespace.useEffect(() => {
|
|
10947
11244
|
if (isControlled || hasAutoSelected.current || tabValues.length === 0) {
|
|
10948
11245
|
return;
|
|
10949
11246
|
}
|
|
@@ -10958,9 +11255,9 @@ var TabsComponent = React38__namespace.forwardRef(
|
|
|
10958
11255
|
setFocusedValue(firstEnabled);
|
|
10959
11256
|
}
|
|
10960
11257
|
}, [tabValues, disabledValues, isControlled, value]);
|
|
10961
|
-
const id =
|
|
11258
|
+
const id = React39__namespace.useId();
|
|
10962
11259
|
const layoutGroupId = `tabs-${id}`;
|
|
10963
|
-
const contextValue =
|
|
11260
|
+
const contextValue = React39__namespace.useMemo(
|
|
10964
11261
|
() => ({
|
|
10965
11262
|
value,
|
|
10966
11263
|
onValueChange: handleValueChange,
|
|
@@ -10991,12 +11288,12 @@ var TabsComponent = React38__namespace.forwardRef(
|
|
|
10991
11288
|
}
|
|
10992
11289
|
);
|
|
10993
11290
|
TabsComponent.displayName = "Tabs";
|
|
10994
|
-
var Tabs =
|
|
10995
|
-
var TabsListContext =
|
|
11291
|
+
var Tabs = React39__namespace.memo(TabsComponent);
|
|
11292
|
+
var TabsListContext = React39__namespace.createContext(
|
|
10996
11293
|
null
|
|
10997
11294
|
);
|
|
10998
11295
|
function useTabsListContext() {
|
|
10999
|
-
const ctx =
|
|
11296
|
+
const ctx = React39__namespace.useContext(TabsListContext);
|
|
11000
11297
|
return ctx != null ? ctx : { variant: "primary", scrollable: false };
|
|
11001
11298
|
}
|
|
11002
11299
|
|
|
@@ -11080,7 +11377,7 @@ var TABS_CONTENT_TRANSITION = {
|
|
|
11080
11377
|
ease: "easeInOut"
|
|
11081
11378
|
};
|
|
11082
11379
|
var INDICATOR_MIN_WIDTH = 24;
|
|
11083
|
-
var TabComponent =
|
|
11380
|
+
var TabComponent = React39__namespace.forwardRef(
|
|
11084
11381
|
({
|
|
11085
11382
|
value,
|
|
11086
11383
|
icon,
|
|
@@ -11110,9 +11407,9 @@ var TabComponent = React38__namespace.forwardRef(
|
|
|
11110
11407
|
const isFocused = focusedValue === value;
|
|
11111
11408
|
const hasIcon = icon != null;
|
|
11112
11409
|
const isStackedIcon = hasIcon && !inlineIcon;
|
|
11113
|
-
const buttonRef =
|
|
11114
|
-
const isFirstMount =
|
|
11115
|
-
const mergedRef =
|
|
11410
|
+
const buttonRef = React39__namespace.useRef(null);
|
|
11411
|
+
const isFirstMount = React39__namespace.useRef(true);
|
|
11412
|
+
const mergedRef = React39__namespace.useCallback(
|
|
11116
11413
|
(node) => {
|
|
11117
11414
|
buttonRef.current = node;
|
|
11118
11415
|
if (typeof ref === "function") ref(node);
|
|
@@ -11120,15 +11417,15 @@ var TabComponent = React38__namespace.forwardRef(
|
|
|
11120
11417
|
},
|
|
11121
11418
|
[ref]
|
|
11122
11419
|
);
|
|
11123
|
-
|
|
11420
|
+
React39__namespace.useEffect(() => {
|
|
11124
11421
|
registerTab(value);
|
|
11125
11422
|
return () => unregisterTab(value);
|
|
11126
11423
|
}, [value, registerTab, unregisterTab]);
|
|
11127
|
-
|
|
11424
|
+
React39__namespace.useEffect(() => {
|
|
11128
11425
|
markTabDisabled(value, disabled);
|
|
11129
11426
|
return () => markTabDisabled(value, false);
|
|
11130
11427
|
}, [value, disabled, markTabDisabled]);
|
|
11131
|
-
const handleKeyDown =
|
|
11428
|
+
const handleKeyDown = React39__namespace.useCallback(
|
|
11132
11429
|
(e) => {
|
|
11133
11430
|
const isRtl = buttonRef.current ? getComputedStyle(buttonRef.current).direction === "rtl" : false;
|
|
11134
11431
|
const enabledValues = tabValues.filter((v) => !disabledValues.has(v));
|
|
@@ -11182,7 +11479,7 @@ var TabComponent = React38__namespace.forwardRef(
|
|
|
11182
11479
|
autoActivate
|
|
11183
11480
|
]
|
|
11184
11481
|
);
|
|
11185
|
-
|
|
11482
|
+
React39__namespace.useEffect(() => {
|
|
11186
11483
|
if (isFirstMount.current) {
|
|
11187
11484
|
isFirstMount.current = false;
|
|
11188
11485
|
return;
|
|
@@ -11191,7 +11488,7 @@ var TabComponent = React38__namespace.forwardRef(
|
|
|
11191
11488
|
buttonRef.current.focus({ preventScroll: true });
|
|
11192
11489
|
}
|
|
11193
11490
|
}, [isFocused]);
|
|
11194
|
-
|
|
11491
|
+
React39__namespace.useEffect(() => {
|
|
11195
11492
|
if (!isActive || !scrollable || !buttonRef.current) return;
|
|
11196
11493
|
const btn = buttonRef.current;
|
|
11197
11494
|
let container = btn.parentElement;
|
|
@@ -11328,8 +11625,8 @@ var TabComponent = React38__namespace.forwardRef(
|
|
|
11328
11625
|
}
|
|
11329
11626
|
);
|
|
11330
11627
|
TabComponent.displayName = "Tab";
|
|
11331
|
-
var Tab =
|
|
11332
|
-
var TabsContentComponent =
|
|
11628
|
+
var Tab = React39__namespace.memo(TabComponent);
|
|
11629
|
+
var TabsContentComponent = React39__namespace.forwardRef(
|
|
11333
11630
|
({ value, className, children }, ref) => {
|
|
11334
11631
|
var _a;
|
|
11335
11632
|
const { value: selectedValue, layoutGroupId } = useTabsContext();
|
|
@@ -11363,8 +11660,8 @@ var TabsContentComponent = React38__namespace.forwardRef(
|
|
|
11363
11660
|
}
|
|
11364
11661
|
);
|
|
11365
11662
|
TabsContentComponent.displayName = "TabsContent";
|
|
11366
|
-
var TabsContent =
|
|
11367
|
-
var TabsListComponent =
|
|
11663
|
+
var TabsContent = React39__namespace.memo(TabsContentComponent);
|
|
11664
|
+
var TabsListComponent = React39__namespace.forwardRef(
|
|
11368
11665
|
({
|
|
11369
11666
|
variant,
|
|
11370
11667
|
scrollable = false,
|
|
@@ -11375,12 +11672,12 @@ var TabsListComponent = React38__namespace.forwardRef(
|
|
|
11375
11672
|
}, ref) => {
|
|
11376
11673
|
const { layoutGroupId, value, setFocusedValue } = useTabsContext();
|
|
11377
11674
|
const listLayoutId = `${layoutGroupId}-list`;
|
|
11378
|
-
const listContextValue =
|
|
11675
|
+
const listContextValue = React39__namespace.useMemo(
|
|
11379
11676
|
() => ({ variant, scrollable }),
|
|
11380
11677
|
[variant, scrollable]
|
|
11381
11678
|
);
|
|
11382
11679
|
const bgColor = backgroundColor != null ? backgroundColor : "var(--md-sys-color-surface)";
|
|
11383
|
-
const handleBlur =
|
|
11680
|
+
const handleBlur = React39__namespace.useCallback(
|
|
11384
11681
|
(e) => {
|
|
11385
11682
|
const listEl = e.currentTarget;
|
|
11386
11683
|
if (listEl.contains(e.relatedTarget)) return;
|
|
@@ -11429,7 +11726,7 @@ var TabsListComponent = React38__namespace.forwardRef(
|
|
|
11429
11726
|
}
|
|
11430
11727
|
);
|
|
11431
11728
|
TabsListComponent.displayName = "TabsList";
|
|
11432
|
-
var TabsList =
|
|
11729
|
+
var TabsList = React39__namespace.memo(TabsListComponent);
|
|
11433
11730
|
|
|
11434
11731
|
// src/ui/text-field/text-field.tokens.ts
|
|
11435
11732
|
var TF_COLORS = {
|
|
@@ -11468,7 +11765,7 @@ var TF_TYPOGRAPHY = {
|
|
|
11468
11765
|
var TF_CLASSES = {
|
|
11469
11766
|
// Prefix / Suffix
|
|
11470
11767
|
prefixSuffix: "text-base text-[var(--color-m3-on-surface-variant)] select-none shrink-0"};
|
|
11471
|
-
var ActiveIndicator =
|
|
11768
|
+
var ActiveIndicator = React39__namespace.memo(function ActiveIndicator2({
|
|
11472
11769
|
isFocused,
|
|
11473
11770
|
isError,
|
|
11474
11771
|
isDisabled,
|
|
@@ -11515,7 +11812,7 @@ function getLabelColor(isFloated, isFocused, isError, isDisabled) {
|
|
|
11515
11812
|
if (isFloated && isFocused) return TF_COLORS.primary;
|
|
11516
11813
|
return TF_COLORS.onSurfaceVariant;
|
|
11517
11814
|
}
|
|
11518
|
-
var FloatingLabel =
|
|
11815
|
+
var FloatingLabel = React39__namespace.memo(function FloatingLabel2({
|
|
11519
11816
|
text,
|
|
11520
11817
|
isFloated,
|
|
11521
11818
|
isFocused,
|
|
@@ -11575,7 +11872,7 @@ var FloatingLabel = React38__namespace.memo(function FloatingLabel2({
|
|
|
11575
11872
|
);
|
|
11576
11873
|
});
|
|
11577
11874
|
FloatingLabel.displayName = "FloatingLabel";
|
|
11578
|
-
var LeadingIcon =
|
|
11875
|
+
var LeadingIcon = React39__namespace.memo(function LeadingIcon2({
|
|
11579
11876
|
children,
|
|
11580
11877
|
isError,
|
|
11581
11878
|
isDisabled
|
|
@@ -11599,7 +11896,7 @@ function getOutlineColor(isFocused, isError, isHovered, isDisabled) {
|
|
|
11599
11896
|
if (isHovered) return TF_COLORS.inputText;
|
|
11600
11897
|
return TF_COLORS.outline;
|
|
11601
11898
|
}
|
|
11602
|
-
var OutlineContainer =
|
|
11899
|
+
var OutlineContainer = React39__namespace.memo(function OutlineContainer2({
|
|
11603
11900
|
isFloated,
|
|
11604
11901
|
isFocused,
|
|
11605
11902
|
isError,
|
|
@@ -11697,7 +11994,7 @@ var OutlineContainer = React38__namespace.memo(function OutlineContainer2({
|
|
|
11697
11994
|
);
|
|
11698
11995
|
});
|
|
11699
11996
|
OutlineContainer.displayName = "OutlineContainer";
|
|
11700
|
-
var PrefixSuffix =
|
|
11997
|
+
var PrefixSuffix = React39__namespace.memo(function PrefixSuffix2({
|
|
11701
11998
|
text,
|
|
11702
11999
|
type,
|
|
11703
12000
|
visible,
|
|
@@ -11739,7 +12036,7 @@ function AnimatedText({
|
|
|
11739
12036
|
motionKey
|
|
11740
12037
|
);
|
|
11741
12038
|
}
|
|
11742
|
-
var SupportingText =
|
|
12039
|
+
var SupportingText = React39__namespace.memo(function SupportingText2({
|
|
11743
12040
|
supportingText,
|
|
11744
12041
|
errorText,
|
|
11745
12042
|
isError,
|
|
@@ -11850,7 +12147,7 @@ function ClearIcon() {
|
|
|
11850
12147
|
}
|
|
11851
12148
|
);
|
|
11852
12149
|
}
|
|
11853
|
-
var TrailingIcon =
|
|
12150
|
+
var TrailingIcon = React39__namespace.memo(function TrailingIcon2({
|
|
11854
12151
|
mode,
|
|
11855
12152
|
children,
|
|
11856
12153
|
value,
|
|
@@ -11916,7 +12213,7 @@ var TrailingIcon = React38__namespace.memo(function TrailingIcon2({
|
|
|
11916
12213
|
});
|
|
11917
12214
|
TrailingIcon.displayName = "TrailingIcon";
|
|
11918
12215
|
var LINE_HEIGHT_PX = 24;
|
|
11919
|
-
var TextFieldComponent =
|
|
12216
|
+
var TextFieldComponent = React39__namespace.forwardRef(
|
|
11920
12217
|
({
|
|
11921
12218
|
// Core
|
|
11922
12219
|
variant = "filled",
|
|
@@ -11980,30 +12277,30 @@ var TextFieldComponent = React38__namespace.forwardRef(
|
|
|
11980
12277
|
}, ref) => {
|
|
11981
12278
|
var _a;
|
|
11982
12279
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
11983
|
-
const generatedId =
|
|
12280
|
+
const generatedId = React39__namespace.useId();
|
|
11984
12281
|
const inputId = idProp != null ? idProp : `tf-${generatedId}`;
|
|
11985
12282
|
const supportingId = `${inputId}-supporting`;
|
|
11986
12283
|
const isControlled = valueProp !== void 0;
|
|
11987
|
-
const [internalValue, setInternalValue] =
|
|
12284
|
+
const [internalValue, setInternalValue] = React39__namespace.useState(defaultValue);
|
|
11988
12285
|
const currentValue = isControlled ? valueProp : internalValue;
|
|
11989
|
-
const [isFocused, setIsFocused] =
|
|
11990
|
-
const [showPassword, setShowPassword] =
|
|
12286
|
+
const [isFocused, setIsFocused] = React39__namespace.useState(false);
|
|
12287
|
+
const [showPassword, setShowPassword] = React39__namespace.useState(false);
|
|
11991
12288
|
const resolvedInputType = type === "password" && showPassword ? "text" : type;
|
|
11992
|
-
const [nativeError, setNativeError] =
|
|
11993
|
-
const [labelWidth, setLabelWidth] =
|
|
12289
|
+
const [nativeError, setNativeError] = React39__namespace.useState("");
|
|
12290
|
+
const [labelWidth, setLabelWidth] = React39__namespace.useState(0);
|
|
11994
12291
|
const hasValue = currentValue.length > 0;
|
|
11995
12292
|
const isFloated = isFocused || hasValue;
|
|
11996
12293
|
const isError = errorProp || !!nativeError || maxLength !== void 0 && currentValue.length > maxLength;
|
|
11997
12294
|
const containerHeight = dense ? TF_SIZE.denseHeight : TF_SIZE.height;
|
|
11998
12295
|
const showAsterisk = required && !noAsterisk;
|
|
11999
|
-
const inputRef =
|
|
12000
|
-
const labelSpanRef =
|
|
12001
|
-
|
|
12296
|
+
const inputRef = React39__namespace.useRef(null);
|
|
12297
|
+
const labelSpanRef = React39__namespace.useRef(null);
|
|
12298
|
+
React39__namespace.useLayoutEffect(() => {
|
|
12002
12299
|
if (labelSpanRef.current) {
|
|
12003
12300
|
setLabelWidth(labelSpanRef.current.offsetWidth);
|
|
12004
12301
|
}
|
|
12005
12302
|
}, []);
|
|
12006
|
-
|
|
12303
|
+
React39__namespace.useLayoutEffect(() => {
|
|
12007
12304
|
if (type !== "textarea" || !inputRef.current) return;
|
|
12008
12305
|
const textarea = inputRef.current;
|
|
12009
12306
|
if (autoResize) {
|
|
@@ -12015,7 +12312,7 @@ var TextFieldComponent = React38__namespace.forwardRef(
|
|
|
12015
12312
|
}
|
|
12016
12313
|
textarea.style.overflowY = "hidden";
|
|
12017
12314
|
}, [type, autoResize, maxRows, currentValue]);
|
|
12018
|
-
const handleValueChange =
|
|
12315
|
+
const handleValueChange = React39__namespace.useCallback(
|
|
12019
12316
|
(newValue) => {
|
|
12020
12317
|
var _a2, _b;
|
|
12021
12318
|
if (!isControlled) setInternalValue(newValue);
|
|
@@ -12024,7 +12321,7 @@ var TextFieldComponent = React38__namespace.forwardRef(
|
|
|
12024
12321
|
},
|
|
12025
12322
|
[isControlled]
|
|
12026
12323
|
);
|
|
12027
|
-
const handleChange =
|
|
12324
|
+
const handleChange = React39__namespace.useCallback(
|
|
12028
12325
|
(e) => {
|
|
12029
12326
|
const newVal = e.target.value;
|
|
12030
12327
|
handleValueChange(newVal);
|
|
@@ -12032,14 +12329,14 @@ var TextFieldComponent = React38__namespace.forwardRef(
|
|
|
12032
12329
|
},
|
|
12033
12330
|
[handleValueChange, onChange]
|
|
12034
12331
|
);
|
|
12035
|
-
const handleFocus =
|
|
12332
|
+
const handleFocus = React39__namespace.useCallback(
|
|
12036
12333
|
(e) => {
|
|
12037
12334
|
setIsFocused(true);
|
|
12038
12335
|
onFocus == null ? void 0 : onFocus(e);
|
|
12039
12336
|
},
|
|
12040
12337
|
[onFocus]
|
|
12041
12338
|
);
|
|
12042
|
-
const handleBlur =
|
|
12339
|
+
const handleBlur = React39__namespace.useCallback(
|
|
12043
12340
|
(e) => {
|
|
12044
12341
|
setIsFocused(false);
|
|
12045
12342
|
const el = inputRef.current;
|
|
@@ -12052,7 +12349,7 @@ var TextFieldComponent = React38__namespace.forwardRef(
|
|
|
12052
12349
|
},
|
|
12053
12350
|
[onBlur]
|
|
12054
12351
|
);
|
|
12055
|
-
const handleClear =
|
|
12352
|
+
const handleClear = React39__namespace.useCallback(() => {
|
|
12056
12353
|
var _a2;
|
|
12057
12354
|
handleValueChange("");
|
|
12058
12355
|
onChange == null ? void 0 : onChange("", {
|
|
@@ -12060,12 +12357,12 @@ var TextFieldComponent = React38__namespace.forwardRef(
|
|
|
12060
12357
|
});
|
|
12061
12358
|
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
12062
12359
|
}, [handleValueChange, onChange]);
|
|
12063
|
-
const handlePasswordToggle =
|
|
12360
|
+
const handlePasswordToggle = React39__namespace.useCallback(() => {
|
|
12064
12361
|
var _a2;
|
|
12065
12362
|
setShowPassword((prev) => !prev);
|
|
12066
12363
|
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
12067
12364
|
}, []);
|
|
12068
|
-
|
|
12365
|
+
React39__namespace.useImperativeHandle(
|
|
12069
12366
|
ref,
|
|
12070
12367
|
() => ({
|
|
12071
12368
|
focus: () => {
|
|
@@ -12310,7 +12607,7 @@ var TextFieldComponent = React38__namespace.forwardRef(
|
|
|
12310
12607
|
}
|
|
12311
12608
|
);
|
|
12312
12609
|
TextFieldComponent.displayName = "TextField";
|
|
12313
|
-
var TextField =
|
|
12610
|
+
var TextField = React39__namespace.memo(TextFieldComponent);
|
|
12314
12611
|
|
|
12315
12612
|
// src/ui/typography/typography-key-tokens.ts
|
|
12316
12613
|
var TypographyKeyTokens = /* @__PURE__ */ ((TypographyKeyTokens2) => {
|
|
@@ -13025,9 +13322,9 @@ var TOKEN_TO_PROP = {
|
|
|
13025
13322
|
};
|
|
13026
13323
|
var defaultTokens = new TypographyTokens();
|
|
13027
13324
|
var defaultTypography = new Typography();
|
|
13028
|
-
var TypographyContext =
|
|
13325
|
+
var TypographyContext = React39.createContext(defaultTypography);
|
|
13029
13326
|
function useTypography() {
|
|
13030
|
-
return
|
|
13327
|
+
return React39.useContext(TypographyContext);
|
|
13031
13328
|
}
|
|
13032
13329
|
function TypographyProvider({
|
|
13033
13330
|
children,
|
|
@@ -13035,7 +13332,7 @@ function TypographyProvider({
|
|
|
13035
13332
|
fontFamily,
|
|
13036
13333
|
fontVariationAxes
|
|
13037
13334
|
}) {
|
|
13038
|
-
const value =
|
|
13335
|
+
const value = React39.useMemo(() => {
|
|
13039
13336
|
if (typography) return typography;
|
|
13040
13337
|
if (fontFamily || fontVariationAxes) {
|
|
13041
13338
|
return new Typography(
|
|
@@ -13046,7 +13343,7 @@ function TypographyProvider({
|
|
|
13046
13343
|
}, [typography, fontFamily, fontVariationAxes]);
|
|
13047
13344
|
return /* @__PURE__ */ jsxRuntime.jsx(TypographyContext.Provider, { value, children });
|
|
13048
13345
|
}
|
|
13049
|
-
var ThemeContext =
|
|
13346
|
+
var ThemeContext = React39.createContext(void 0);
|
|
13050
13347
|
var STORAGE_KEY_COLOR = "md3-source-color";
|
|
13051
13348
|
var STORAGE_KEY_MODE = "md3-theme-mode";
|
|
13052
13349
|
var defaultTokens2 = new TypographyTokens();
|
|
@@ -13061,20 +13358,21 @@ function MD3ThemeProvider({
|
|
|
13061
13358
|
fontVariationAxes,
|
|
13062
13359
|
enableSnackbar = false
|
|
13063
13360
|
}) {
|
|
13064
|
-
const [sourceColor, setSourceColor] =
|
|
13065
|
-
const [mode, setMode] =
|
|
13066
|
-
const [isHydrated, setIsHydrated] =
|
|
13067
|
-
|
|
13361
|
+
const [sourceColor, setSourceColor] = React39.useState(initialSourceColor);
|
|
13362
|
+
const [mode, setMode] = React39.useState(defaultMode);
|
|
13363
|
+
const [isHydrated, setIsHydrated] = React39.useState(!persistToLocalStorage);
|
|
13364
|
+
React39.useEffect(() => {
|
|
13068
13365
|
if (!persistToLocalStorage) return;
|
|
13069
13366
|
const savedColor = localStorage.getItem(STORAGE_KEY_COLOR);
|
|
13070
13367
|
const savedMode = localStorage.getItem(
|
|
13071
13368
|
STORAGE_KEY_MODE
|
|
13072
13369
|
);
|
|
13073
13370
|
if (savedColor) setSourceColor(savedColor);
|
|
13074
|
-
if (savedMode === "light" || savedMode === "dark"
|
|
13371
|
+
if (savedMode === "light" || savedMode === "dark" || savedMode === "system")
|
|
13372
|
+
setMode(savedMode);
|
|
13075
13373
|
setIsHydrated(true);
|
|
13076
13374
|
}, [persistToLocalStorage]);
|
|
13077
|
-
|
|
13375
|
+
React39.useEffect(() => {
|
|
13078
13376
|
if (!isHydrated) return;
|
|
13079
13377
|
applyTheme(sourceColor, mode);
|
|
13080
13378
|
if (persistToLocalStorage) {
|
|
@@ -13082,11 +13380,19 @@ function MD3ThemeProvider({
|
|
|
13082
13380
|
localStorage.setItem(STORAGE_KEY_MODE, mode);
|
|
13083
13381
|
}
|
|
13084
13382
|
}, [sourceColor, mode, persistToLocalStorage, isHydrated]);
|
|
13085
|
-
|
|
13086
|
-
(
|
|
13087
|
-
|
|
13383
|
+
React39.useEffect(() => {
|
|
13384
|
+
if (mode !== "system" || typeof window === "undefined") return;
|
|
13385
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
13386
|
+
const handleChange = () => applyTheme(sourceColor, "system");
|
|
13387
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
13388
|
+
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
13389
|
+
}, [mode, sourceColor]);
|
|
13390
|
+
const effectiveMode = resolveMode(mode);
|
|
13391
|
+
const themeValue = React39.useMemo(
|
|
13392
|
+
() => ({ sourceColor, setSourceColor, mode, setMode, effectiveMode }),
|
|
13393
|
+
[sourceColor, mode, effectiveMode]
|
|
13088
13394
|
);
|
|
13089
|
-
const typographyValue =
|
|
13395
|
+
const typographyValue = React39.useMemo(() => {
|
|
13090
13396
|
if (typographyProp) return typographyProp;
|
|
13091
13397
|
if (fontFamily != null ? fontFamily : fontVariationAxes) {
|
|
13092
13398
|
return new Typography(
|
|
@@ -13099,7 +13405,7 @@ function MD3ThemeProvider({
|
|
|
13099
13405
|
}
|
|
13100
13406
|
function SnackbarMountedProvider({ children }) {
|
|
13101
13407
|
const state = useSnackbarState();
|
|
13102
|
-
const contextValue =
|
|
13408
|
+
const contextValue = React39.useMemo(
|
|
13103
13409
|
() => ({ showSnackbar: state.showSnackbar }),
|
|
13104
13410
|
[state.showSnackbar]
|
|
13105
13411
|
);
|
|
@@ -13109,24 +13415,24 @@ function SnackbarMountedProvider({ children }) {
|
|
|
13109
13415
|
] });
|
|
13110
13416
|
}
|
|
13111
13417
|
function useTheme() {
|
|
13112
|
-
const context =
|
|
13418
|
+
const context = React39.useContext(ThemeContext);
|
|
13113
13419
|
if (!context) {
|
|
13114
13420
|
throw new Error("useTheme must be used within <MD3ThemeProvider>.");
|
|
13115
13421
|
}
|
|
13116
13422
|
return context;
|
|
13117
13423
|
}
|
|
13118
13424
|
function useThemeMode() {
|
|
13119
|
-
const { mode, setMode } = useTheme();
|
|
13120
|
-
return { mode, setMode };
|
|
13425
|
+
const { mode, setMode, effectiveMode } = useTheme();
|
|
13426
|
+
return { mode, setMode, effectiveMode };
|
|
13121
13427
|
}
|
|
13122
13428
|
function TableOfContents({
|
|
13123
13429
|
items,
|
|
13124
13430
|
className,
|
|
13125
13431
|
scrollAreaProps
|
|
13126
13432
|
}) {
|
|
13127
|
-
const [activeId, setActiveId] =
|
|
13128
|
-
const itemIds =
|
|
13129
|
-
|
|
13433
|
+
const [activeId, setActiveId] = React39.useState("");
|
|
13434
|
+
const itemIds = React39.useMemo(() => items.map((i) => i.id), [items]);
|
|
13435
|
+
React39.useEffect(() => {
|
|
13130
13436
|
if (typeof IntersectionObserver === "undefined") return;
|
|
13131
13437
|
const observer = new IntersectionObserver(
|
|
13132
13438
|
(entries) => {
|
|
@@ -13143,7 +13449,7 @@ function TableOfContents({
|
|
|
13143
13449
|
}
|
|
13144
13450
|
return () => observer.disconnect();
|
|
13145
13451
|
}, [itemIds]);
|
|
13146
|
-
const handleClick =
|
|
13452
|
+
const handleClick = React39.useCallback(
|
|
13147
13453
|
(e, id) => {
|
|
13148
13454
|
var _a;
|
|
13149
13455
|
e.preventDefault();
|
|
@@ -13279,7 +13585,7 @@ function TooltipCaretShape({
|
|
|
13279
13585
|
}
|
|
13280
13586
|
);
|
|
13281
13587
|
}
|
|
13282
|
-
var PlainTooltip =
|
|
13588
|
+
var PlainTooltip = React39.forwardRef(
|
|
13283
13589
|
(_a, ref) => {
|
|
13284
13590
|
var _b = _a, {
|
|
13285
13591
|
children,
|
|
@@ -13336,7 +13642,7 @@ var PlainTooltip = React38.forwardRef(
|
|
|
13336
13642
|
}
|
|
13337
13643
|
);
|
|
13338
13644
|
PlainTooltip.displayName = "PlainTooltip";
|
|
13339
|
-
var RichTooltip =
|
|
13645
|
+
var RichTooltip = React39.forwardRef(
|
|
13340
13646
|
(_a, ref) => {
|
|
13341
13647
|
var _b = _a, {
|
|
13342
13648
|
children,
|
|
@@ -13420,7 +13726,7 @@ var RichTooltip = React38.forwardRef(
|
|
|
13420
13726
|
);
|
|
13421
13727
|
RichTooltip.displayName = "RichTooltip";
|
|
13422
13728
|
var VIEWPORT_PADDING = 8;
|
|
13423
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
13729
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React39.useLayoutEffect : React39.useEffect;
|
|
13424
13730
|
function resolveAutoPlacement(spaceTop, spaceBottom, spaceLeft, spaceRight, tooltipWidth, tooltipHeight, spacing) {
|
|
13425
13731
|
if (spaceTop >= tooltipHeight + spacing) return "top";
|
|
13426
13732
|
if (spaceBottom >= tooltipHeight + spacing) return "bottom";
|
|
@@ -13480,7 +13786,7 @@ function clampToViewport(side, top, left, tooltipWidth, tooltipHeight) {
|
|
|
13480
13786
|
return { top, left };
|
|
13481
13787
|
}
|
|
13482
13788
|
function useTooltipPosition(anchorRef, tooltipRef, placement, spacing, isVisible) {
|
|
13483
|
-
const [position, setPosition] =
|
|
13789
|
+
const [position, setPosition] = React39.useState({
|
|
13484
13790
|
top: -9999,
|
|
13485
13791
|
left: -9999,
|
|
13486
13792
|
actualSide: placement === "auto" ? "top" : placement
|
|
@@ -13555,24 +13861,24 @@ function useTooltipState(config) {
|
|
|
13555
13861
|
isPersistent = false,
|
|
13556
13862
|
duration = 1500
|
|
13557
13863
|
} = config != null ? config : {};
|
|
13558
|
-
const [isVisible, setIsVisible] =
|
|
13559
|
-
const dismiss =
|
|
13864
|
+
const [isVisible, setIsVisible] = React39.useState(initialVisible);
|
|
13865
|
+
const dismiss = React39.useCallback(() => {
|
|
13560
13866
|
setIsVisible(false);
|
|
13561
13867
|
activeTooltipDismissals.delete(dismiss);
|
|
13562
13868
|
}, []);
|
|
13563
|
-
const show =
|
|
13869
|
+
const show = React39.useCallback(() => {
|
|
13564
13870
|
for (const otherDismiss of activeTooltipDismissals) {
|
|
13565
13871
|
if (otherDismiss !== dismiss) otherDismiss();
|
|
13566
13872
|
}
|
|
13567
13873
|
setIsVisible(true);
|
|
13568
13874
|
activeTooltipDismissals.add(dismiss);
|
|
13569
13875
|
}, [dismiss]);
|
|
13570
|
-
|
|
13876
|
+
React39.useEffect(() => {
|
|
13571
13877
|
if (!isVisible || isPersistent) return;
|
|
13572
13878
|
const timeoutId = setTimeout(dismiss, duration);
|
|
13573
13879
|
return () => clearTimeout(timeoutId);
|
|
13574
13880
|
}, [isVisible, isPersistent, duration, dismiss]);
|
|
13575
|
-
|
|
13881
|
+
React39.useEffect(() => {
|
|
13576
13882
|
return () => {
|
|
13577
13883
|
activeTooltipDismissals.delete(dismiss);
|
|
13578
13884
|
};
|
|
@@ -13629,20 +13935,20 @@ function TooltipBox({
|
|
|
13629
13935
|
}) {
|
|
13630
13936
|
const internalState = useTooltipState();
|
|
13631
13937
|
const state = controlledState != null ? controlledState : internalState;
|
|
13632
|
-
const anchorRef =
|
|
13633
|
-
const tooltipRef =
|
|
13634
|
-
const hoverTimeoutRef =
|
|
13635
|
-
const hideTimeoutRef =
|
|
13636
|
-
const pressTimeoutRef =
|
|
13938
|
+
const anchorRef = React39.useRef(null);
|
|
13939
|
+
const tooltipRef = React39.useRef(null);
|
|
13940
|
+
const hoverTimeoutRef = React39.useRef(null);
|
|
13941
|
+
const hideTimeoutRef = React39.useRef(null);
|
|
13942
|
+
const pressTimeoutRef = React39.useRef(null);
|
|
13637
13943
|
const triggers = Array.isArray(trigger) ? trigger : [trigger];
|
|
13638
|
-
const [mounted, setMounted] =
|
|
13639
|
-
const [hasHoverSupport, setHasHoverSupport] =
|
|
13640
|
-
const [prefersReducedMotion, setPrefersReducedMotion] =
|
|
13641
|
-
|
|
13944
|
+
const [mounted, setMounted] = React39.useState(false);
|
|
13945
|
+
const [hasHoverSupport, setHasHoverSupport] = React39.useState(true);
|
|
13946
|
+
const [prefersReducedMotion, setPrefersReducedMotion] = React39.useState(false);
|
|
13947
|
+
React39.useEffect(() => {
|
|
13642
13948
|
setMounted(true);
|
|
13643
13949
|
setHasHoverSupport(!window.matchMedia("(hover: none)").matches);
|
|
13644
13950
|
}, []);
|
|
13645
|
-
|
|
13951
|
+
React39.useEffect(() => {
|
|
13646
13952
|
const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
13647
13953
|
setPrefersReducedMotion(mediaQuery.matches);
|
|
13648
13954
|
const onChange = (e) => setPrefersReducedMotion(e.matches);
|
|
@@ -13714,7 +14020,7 @@ function TooltipBox({
|
|
|
13714
14020
|
hideDelay
|
|
13715
14021
|
);
|
|
13716
14022
|
};
|
|
13717
|
-
|
|
14023
|
+
React39.useEffect(() => {
|
|
13718
14024
|
if (!state.isVisible) return;
|
|
13719
14025
|
const onKeyDown = (e) => {
|
|
13720
14026
|
var _a;
|
|
@@ -13726,8 +14032,8 @@ function TooltipBox({
|
|
|
13726
14032
|
document.addEventListener("keydown", onKeyDown);
|
|
13727
14033
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
13728
14034
|
}, [state.isVisible, state]);
|
|
13729
|
-
const tooltipId =
|
|
13730
|
-
const tooltipWithProps =
|
|
14035
|
+
const tooltipId = React39.useId();
|
|
14036
|
+
const tooltipWithProps = React39.cloneElement(
|
|
13731
14037
|
tooltip,
|
|
13732
14038
|
{
|
|
13733
14039
|
"data-side": position.actualSide,
|
|
@@ -13755,7 +14061,7 @@ function TooltipBox({
|
|
|
13755
14061
|
onKeyDown: handleKeyDown,
|
|
13756
14062
|
"aria-label": ariaLabel,
|
|
13757
14063
|
"aria-describedby": state.isVisible ? tooltipId : void 0,
|
|
13758
|
-
children:
|
|
14064
|
+
children: React39__namespace.isValidElement(children) ? children : /* @__PURE__ */ jsxRuntime.jsx("span", { children })
|
|
13759
14065
|
}
|
|
13760
14066
|
),
|
|
13761
14067
|
mounted && reactDom.createPortal(
|
|
@@ -13864,6 +14170,8 @@ exports.MenuGroup = MenuGroup;
|
|
|
13864
14170
|
exports.MenuItem = MenuItem;
|
|
13865
14171
|
exports.MenuProvider = MenuProvider;
|
|
13866
14172
|
exports.MenuTrigger = MenuTrigger;
|
|
14173
|
+
exports.NavigationBar = NavigationBar;
|
|
14174
|
+
exports.NavigationBarItem = NavigationBarItem;
|
|
13867
14175
|
exports.NavigationRail = NavigationRail;
|
|
13868
14176
|
exports.NavigationRailItem = NavigationRailItem;
|
|
13869
14177
|
exports.PlainTooltip = PlainTooltip;
|
|
@@ -13932,6 +14240,7 @@ exports.applyTheme = applyTheme;
|
|
|
13932
14240
|
exports.buildWavePath = buildWavePath;
|
|
13933
14241
|
exports.cn = cn;
|
|
13934
14242
|
exports.generateM3Theme = generateM3Theme;
|
|
14243
|
+
exports.resolveMode = resolveMode;
|
|
13935
14244
|
exports.useAppBarScroll = useAppBarScroll;
|
|
13936
14245
|
exports.useDOMRipple = useRipple;
|
|
13937
14246
|
exports.useMediaQuery = useMediaQuery;
|