@deadragdoll/reactnu 0.1.18 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/IconGrid/IconGrid.types.d.ts +35 -0
- package/dist/components/IconGrid/NuIconGrid.d.ts +7 -0
- package/dist/components/IconGrid/NuIconProvider.d.ts +6 -0
- package/dist/components/IconGrid/iconContext.d.ts +10 -0
- package/dist/components/IconGrid/index.d.ts +4 -0
- package/dist/index.cjs +1091 -677
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1109 -688
- package/dist/styles.css +67 -0
- package/docs/API_REFERENCE.md +4 -0
- package/docs/COMPONENT_INDEX.md +1 -0
- package/docs/Desktop.md +13 -0
- package/docs/IconGrid.md +93 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -41,6 +41,8 @@ __export(index_exports, {
|
|
|
41
41
|
NuCrtGlitch: () => NuCrtGlitch,
|
|
42
42
|
NuDesktop: () => NuDesktop,
|
|
43
43
|
NuGlyph: () => NuGlyph,
|
|
44
|
+
NuIconGrid: () => NuIconGrid,
|
|
45
|
+
NuIconProvider: () => NuIconProvider,
|
|
44
46
|
NuThemeContext: () => NuThemeContext,
|
|
45
47
|
NuThemeProvider: () => NuThemeProvider,
|
|
46
48
|
NuView: () => NuView,
|
|
@@ -83,6 +85,7 @@ __export(index_exports, {
|
|
|
83
85
|
resolveNuTheme: () => resolveNuTheme,
|
|
84
86
|
useAppHostMenu: () => useAppHostMenu,
|
|
85
87
|
useMainMenuState: () => useMainMenuState,
|
|
88
|
+
useNuIconManager: () => useNuIconManager,
|
|
86
89
|
useNuTheme: () => useNuTheme,
|
|
87
90
|
useNuWindowManager: () => useNuWindowManager,
|
|
88
91
|
usePopupMenu: () => usePopupMenu,
|
|
@@ -4318,7 +4321,10 @@ function InfoAccent({
|
|
|
4318
4321
|
);
|
|
4319
4322
|
}
|
|
4320
4323
|
|
|
4321
|
-
// src/components/
|
|
4324
|
+
// src/components/IconGrid/NuIconGrid.tsx
|
|
4325
|
+
var import_react25 = require("react");
|
|
4326
|
+
|
|
4327
|
+
// src/components/PopupMenu/PopupMenu.tsx
|
|
4322
4328
|
var import_react22 = require("react");
|
|
4323
4329
|
var import_react_dom2 = require("react-dom");
|
|
4324
4330
|
|
|
@@ -4345,8 +4351,628 @@ function getThemePortalStyle(anchor) {
|
|
|
4345
4351
|
return style;
|
|
4346
4352
|
}
|
|
4347
4353
|
|
|
4354
|
+
// src/components/PopupMenu/PopupMenu.tsx
|
|
4355
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4356
|
+
function hasVisibleChildren2(item) {
|
|
4357
|
+
return Boolean(item.items?.some((child) => !child.hidden));
|
|
4358
|
+
}
|
|
4359
|
+
function clamp(value, min, max) {
|
|
4360
|
+
return Math.min(max, Math.max(min, value));
|
|
4361
|
+
}
|
|
4362
|
+
function resolveAnchorPosition(anchor) {
|
|
4363
|
+
if (!anchor) {
|
|
4364
|
+
return null;
|
|
4365
|
+
}
|
|
4366
|
+
if (anchor.type === "point") {
|
|
4367
|
+
return {
|
|
4368
|
+
left: anchor.x,
|
|
4369
|
+
top: anchor.y
|
|
4370
|
+
};
|
|
4371
|
+
}
|
|
4372
|
+
const rect = anchor.element.getBoundingClientRect();
|
|
4373
|
+
return {
|
|
4374
|
+
left: rect.left,
|
|
4375
|
+
top: rect.bottom - 1
|
|
4376
|
+
};
|
|
4377
|
+
}
|
|
4378
|
+
function resolvePortalRoot() {
|
|
4379
|
+
if (typeof document === "undefined") {
|
|
4380
|
+
return null;
|
|
4381
|
+
}
|
|
4382
|
+
return document.body;
|
|
4383
|
+
}
|
|
4384
|
+
function PopupMenu({
|
|
4385
|
+
anchor,
|
|
4386
|
+
className,
|
|
4387
|
+
defaultOpen = false,
|
|
4388
|
+
items,
|
|
4389
|
+
onItemSelect,
|
|
4390
|
+
onOpenChange,
|
|
4391
|
+
open,
|
|
4392
|
+
style: styleProp,
|
|
4393
|
+
uncheckedShape = "box",
|
|
4394
|
+
...props
|
|
4395
|
+
}) {
|
|
4396
|
+
const rootRef = (0, import_react22.useRef)(null);
|
|
4397
|
+
const [activePath, setActivePath] = (0, import_react22.useState)([]);
|
|
4398
|
+
const [uncontrolledOpen, setUncontrolledOpen] = (0, import_react22.useState)(defaultOpen);
|
|
4399
|
+
const isControlled = open !== void 0;
|
|
4400
|
+
const resolvedOpen = isControlled ? open : uncontrolledOpen;
|
|
4401
|
+
const portalRoot = resolvePortalRoot();
|
|
4402
|
+
const setResolvedOpen = (0, import_react22.useCallback)(
|
|
4403
|
+
(nextOpen) => {
|
|
4404
|
+
if (!nextOpen) {
|
|
4405
|
+
setActivePath([]);
|
|
4406
|
+
}
|
|
4407
|
+
if (!isControlled) {
|
|
4408
|
+
setUncontrolledOpen(nextOpen);
|
|
4409
|
+
}
|
|
4410
|
+
onOpenChange?.(nextOpen);
|
|
4411
|
+
},
|
|
4412
|
+
[isControlled, onOpenChange]
|
|
4413
|
+
);
|
|
4414
|
+
(0, import_react22.useEffect)(() => {
|
|
4415
|
+
if (!resolvedOpen) {
|
|
4416
|
+
return;
|
|
4417
|
+
}
|
|
4418
|
+
function handlePointerDown(event) {
|
|
4419
|
+
if (!rootRef.current?.contains(event.target)) {
|
|
4420
|
+
setResolvedOpen(false);
|
|
4421
|
+
}
|
|
4422
|
+
}
|
|
4423
|
+
function handleKeyDown(event) {
|
|
4424
|
+
if (event.key === "Escape") {
|
|
4425
|
+
setResolvedOpen(false);
|
|
4426
|
+
}
|
|
4427
|
+
}
|
|
4428
|
+
document.addEventListener("pointerdown", handlePointerDown);
|
|
4429
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
4430
|
+
return () => {
|
|
4431
|
+
document.removeEventListener("pointerdown", handlePointerDown);
|
|
4432
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
4433
|
+
};
|
|
4434
|
+
}, [resolvedOpen, setResolvedOpen]);
|
|
4435
|
+
(0, import_react22.useLayoutEffect)(() => {
|
|
4436
|
+
if (!resolvedOpen || !anchor || !rootRef.current) {
|
|
4437
|
+
return;
|
|
4438
|
+
}
|
|
4439
|
+
const rootNode = rootRef.current;
|
|
4440
|
+
function updatePosition() {
|
|
4441
|
+
const anchorPosition = resolveAnchorPosition(anchor);
|
|
4442
|
+
if (!anchorPosition) {
|
|
4443
|
+
return;
|
|
4444
|
+
}
|
|
4445
|
+
const viewportRect = getPortalViewportRect(portalRoot);
|
|
4446
|
+
const relativePosition = toPortalCoordinates(portalRoot, anchorPosition);
|
|
4447
|
+
const rect = rootNode.getBoundingClientRect();
|
|
4448
|
+
const maxLeft = Math.max(0, viewportRect.width - rect.width);
|
|
4449
|
+
const maxTop = Math.max(0, viewportRect.height - rect.height);
|
|
4450
|
+
rootNode.style.left = `${clamp(relativePosition.left, 0, maxLeft)}px`;
|
|
4451
|
+
rootNode.style.top = `${clamp(relativePosition.top, 0, maxTop)}px`;
|
|
4452
|
+
rootNode.style.visibility = "visible";
|
|
4453
|
+
}
|
|
4454
|
+
rootNode.style.left = "0px";
|
|
4455
|
+
rootNode.style.top = "0px";
|
|
4456
|
+
rootNode.style.visibility = "hidden";
|
|
4457
|
+
updatePosition();
|
|
4458
|
+
window.addEventListener("resize", updatePosition);
|
|
4459
|
+
window.addEventListener("scroll", updatePosition, true);
|
|
4460
|
+
return () => {
|
|
4461
|
+
window.removeEventListener("resize", updatePosition);
|
|
4462
|
+
window.removeEventListener("scroll", updatePosition, true);
|
|
4463
|
+
};
|
|
4464
|
+
}, [anchor, portalRoot, resolvedOpen]);
|
|
4465
|
+
function handleActivateItem(item, level) {
|
|
4466
|
+
if (item.disabled) {
|
|
4467
|
+
return;
|
|
4468
|
+
}
|
|
4469
|
+
if (hasVisibleChildren2(item)) {
|
|
4470
|
+
setActivePath(
|
|
4471
|
+
(currentPath) => currentPath[level] === item.id ? currentPath.slice(0, level) : [...currentPath.slice(0, level), item.id]
|
|
4472
|
+
);
|
|
4473
|
+
return;
|
|
4474
|
+
}
|
|
4475
|
+
item.onSelect?.();
|
|
4476
|
+
onItemSelect?.(item);
|
|
4477
|
+
setResolvedOpen(false);
|
|
4478
|
+
}
|
|
4479
|
+
function handleHoverItem(item, level) {
|
|
4480
|
+
if (item.disabled) {
|
|
4481
|
+
return;
|
|
4482
|
+
}
|
|
4483
|
+
setActivePath((currentPath) => [...currentPath.slice(0, level), item.id]);
|
|
4484
|
+
}
|
|
4485
|
+
if (!resolvedOpen || !anchor || !portalRoot || items.every((item) => item.hidden)) {
|
|
4486
|
+
return null;
|
|
4487
|
+
}
|
|
4488
|
+
return (0, import_react_dom2.createPortal)(
|
|
4489
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4490
|
+
"div",
|
|
4491
|
+
{
|
|
4492
|
+
...props,
|
|
4493
|
+
className: ["nu-popup-menu", className].filter(Boolean).join(" "),
|
|
4494
|
+
onContextMenu: (event) => event.preventDefault(),
|
|
4495
|
+
ref: rootRef,
|
|
4496
|
+
style: {
|
|
4497
|
+
...getThemePortalStyle(
|
|
4498
|
+
anchor?.type === "element" ? anchor.element : null
|
|
4499
|
+
),
|
|
4500
|
+
...styleProp,
|
|
4501
|
+
left: 0,
|
|
4502
|
+
top: 0,
|
|
4503
|
+
visibility: "hidden"
|
|
4504
|
+
},
|
|
4505
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "nu-popup-menu__shell", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4506
|
+
MainMenuList,
|
|
4507
|
+
{
|
|
4508
|
+
activePath,
|
|
4509
|
+
items,
|
|
4510
|
+
level: 0,
|
|
4511
|
+
onActivateItem: handleActivateItem,
|
|
4512
|
+
onHoverItem: handleHoverItem,
|
|
4513
|
+
rootVariant: "popup",
|
|
4514
|
+
uncheckedShape
|
|
4515
|
+
}
|
|
4516
|
+
) })
|
|
4517
|
+
}
|
|
4518
|
+
),
|
|
4519
|
+
portalRoot
|
|
4520
|
+
);
|
|
4521
|
+
}
|
|
4522
|
+
|
|
4523
|
+
// src/components/PopupMenu/usePopupMenu.ts
|
|
4524
|
+
var import_react23 = require("react");
|
|
4525
|
+
function usePopupMenu() {
|
|
4526
|
+
const [anchor, setAnchor] = (0, import_react23.useState)(null);
|
|
4527
|
+
const [open, setOpen] = (0, import_react23.useState)(false);
|
|
4528
|
+
function close() {
|
|
4529
|
+
setOpen(false);
|
|
4530
|
+
}
|
|
4531
|
+
function openAtPoint(x, y) {
|
|
4532
|
+
setAnchor({
|
|
4533
|
+
type: "point",
|
|
4534
|
+
x,
|
|
4535
|
+
y
|
|
4536
|
+
});
|
|
4537
|
+
setOpen(true);
|
|
4538
|
+
}
|
|
4539
|
+
function openAtElement(element) {
|
|
4540
|
+
setAnchor({
|
|
4541
|
+
element,
|
|
4542
|
+
type: "element"
|
|
4543
|
+
});
|
|
4544
|
+
setOpen(true);
|
|
4545
|
+
}
|
|
4546
|
+
function openFromClick(event) {
|
|
4547
|
+
openAtElement(event.currentTarget);
|
|
4548
|
+
}
|
|
4549
|
+
function openFromContextMenu(event) {
|
|
4550
|
+
event.preventDefault();
|
|
4551
|
+
openAtPoint(event.clientX, event.clientY);
|
|
4552
|
+
}
|
|
4553
|
+
return {
|
|
4554
|
+
anchor,
|
|
4555
|
+
close,
|
|
4556
|
+
open,
|
|
4557
|
+
openAtElement,
|
|
4558
|
+
openAtPoint,
|
|
4559
|
+
openFromClick,
|
|
4560
|
+
openFromContextMenu,
|
|
4561
|
+
setOpen
|
|
4562
|
+
};
|
|
4563
|
+
}
|
|
4564
|
+
|
|
4565
|
+
// src/components/IconGrid/iconContext.ts
|
|
4566
|
+
var import_react24 = require("react");
|
|
4567
|
+
var NuIconContext = (0, import_react24.createContext)(null);
|
|
4568
|
+
function useNuIconContext() {
|
|
4569
|
+
const context = (0, import_react24.useContext)(NuIconContext);
|
|
4570
|
+
if (!context) {
|
|
4571
|
+
throw new Error("useNuIconManager must be used within a NuIconProvider.");
|
|
4572
|
+
}
|
|
4573
|
+
return context;
|
|
4574
|
+
}
|
|
4575
|
+
function useNuIconManager() {
|
|
4576
|
+
return useNuIconContext();
|
|
4577
|
+
}
|
|
4578
|
+
function useNuIconGridContext() {
|
|
4579
|
+
return useNuIconContext();
|
|
4580
|
+
}
|
|
4581
|
+
|
|
4582
|
+
// src/components/IconGrid/NuIconGrid.tsx
|
|
4583
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4584
|
+
var DRAG_THRESHOLD = 3;
|
|
4585
|
+
function clamp2(value, minimum, maximum) {
|
|
4586
|
+
return Math.min(Math.max(value, minimum), maximum);
|
|
4587
|
+
}
|
|
4588
|
+
function resolveIconContextMenuItems(source, icon) {
|
|
4589
|
+
return typeof source === "function" ? source(icon) : source ?? [];
|
|
4590
|
+
}
|
|
4591
|
+
function resolveGridContextMenuItems(source, manager) {
|
|
4592
|
+
return typeof source === "function" ? source(manager) : source ?? [];
|
|
4593
|
+
}
|
|
4594
|
+
function NuIconGridItem({ gridElement, icon }) {
|
|
4595
|
+
const manager = useNuIconGridContext();
|
|
4596
|
+
const contextMenu = usePopupMenu();
|
|
4597
|
+
const dragStartRef = (0, import_react25.useRef)(void 0);
|
|
4598
|
+
const isDraggingRef = (0, import_react25.useRef)(false);
|
|
4599
|
+
const [isDragging, setIsDragging] = (0, import_react25.useState)(false);
|
|
4600
|
+
const suppressClickRef = (0, import_react25.useRef)(false);
|
|
4601
|
+
const latestPositionRef = (0, import_react25.useRef)(icon.position);
|
|
4602
|
+
const contextMenuItems = resolveIconContextMenuItems(
|
|
4603
|
+
icon.contextMenuItems,
|
|
4604
|
+
icon
|
|
4605
|
+
);
|
|
4606
|
+
function handlePointerDown(event) {
|
|
4607
|
+
if (event.button !== 0 || icon.disabled) {
|
|
4608
|
+
return;
|
|
4609
|
+
}
|
|
4610
|
+
manager.selectIcon(icon.id);
|
|
4611
|
+
latestPositionRef.current = icon.position;
|
|
4612
|
+
isDraggingRef.current = false;
|
|
4613
|
+
dragStartRef.current = {
|
|
4614
|
+
clientX: event.clientX,
|
|
4615
|
+
clientY: event.clientY,
|
|
4616
|
+
pointerId: event.pointerId,
|
|
4617
|
+
position: icon.position
|
|
4618
|
+
};
|
|
4619
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
4620
|
+
}
|
|
4621
|
+
function handlePointerMove(event) {
|
|
4622
|
+
const dragStart = dragStartRef.current;
|
|
4623
|
+
if (!dragStart || dragStart.pointerId !== event.pointerId || !gridElement) {
|
|
4624
|
+
return;
|
|
4625
|
+
}
|
|
4626
|
+
const deltaX = event.clientX - dragStart.clientX;
|
|
4627
|
+
const deltaY = event.clientY - dragStart.clientY;
|
|
4628
|
+
if (!isDraggingRef.current && Math.max(Math.abs(deltaX), Math.abs(deltaY)) < DRAG_THRESHOLD) {
|
|
4629
|
+
return;
|
|
4630
|
+
}
|
|
4631
|
+
isDraggingRef.current = true;
|
|
4632
|
+
setIsDragging(true);
|
|
4633
|
+
const gridRect = gridElement.getBoundingClientRect();
|
|
4634
|
+
const iconRect = event.currentTarget.getBoundingClientRect();
|
|
4635
|
+
const position = {
|
|
4636
|
+
x: Math.round(
|
|
4637
|
+
clamp2(
|
|
4638
|
+
dragStart.position.x + deltaX,
|
|
4639
|
+
0,
|
|
4640
|
+
Math.max(0, gridRect.width - iconRect.width)
|
|
4641
|
+
)
|
|
4642
|
+
),
|
|
4643
|
+
y: Math.round(
|
|
4644
|
+
clamp2(
|
|
4645
|
+
dragStart.position.y + deltaY,
|
|
4646
|
+
0,
|
|
4647
|
+
Math.max(0, gridRect.height - iconRect.height)
|
|
4648
|
+
)
|
|
4649
|
+
)
|
|
4650
|
+
};
|
|
4651
|
+
latestPositionRef.current = position;
|
|
4652
|
+
manager.moveIcon(icon.id, position);
|
|
4653
|
+
}
|
|
4654
|
+
function finishDragging(event) {
|
|
4655
|
+
const dragStart = dragStartRef.current;
|
|
4656
|
+
if (!dragStart || dragStart.pointerId !== event.pointerId) {
|
|
4657
|
+
return;
|
|
4658
|
+
}
|
|
4659
|
+
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
4660
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
4661
|
+
}
|
|
4662
|
+
dragStartRef.current = void 0;
|
|
4663
|
+
if (!isDraggingRef.current) {
|
|
4664
|
+
return;
|
|
4665
|
+
}
|
|
4666
|
+
suppressClickRef.current = true;
|
|
4667
|
+
isDraggingRef.current = false;
|
|
4668
|
+
setIsDragging(false);
|
|
4669
|
+
icon.onPositionChange?.(latestPositionRef.current, {
|
|
4670
|
+
...icon,
|
|
4671
|
+
position: latestPositionRef.current
|
|
4672
|
+
});
|
|
4673
|
+
}
|
|
4674
|
+
function handleClick(event) {
|
|
4675
|
+
if (suppressClickRef.current) {
|
|
4676
|
+
suppressClickRef.current = false;
|
|
4677
|
+
event.preventDefault();
|
|
4678
|
+
return;
|
|
4679
|
+
}
|
|
4680
|
+
manager.selectIcon(icon.id);
|
|
4681
|
+
icon.onClick?.(event);
|
|
4682
|
+
}
|
|
4683
|
+
function handleContextMenu(event) {
|
|
4684
|
+
event.stopPropagation();
|
|
4685
|
+
manager.selectIcon(icon.id);
|
|
4686
|
+
icon.onContextMenu?.(event);
|
|
4687
|
+
if (event.defaultPrevented || contextMenuItems.length === 0) {
|
|
4688
|
+
return;
|
|
4689
|
+
}
|
|
4690
|
+
event.preventDefault();
|
|
4691
|
+
contextMenu.openAtPoint(event.clientX, event.clientY);
|
|
4692
|
+
}
|
|
4693
|
+
function handleKeyDown(event) {
|
|
4694
|
+
if (event.key !== "ContextMenu" && !(event.key === "F10" && event.shiftKey) || contextMenuItems.length === 0) {
|
|
4695
|
+
return;
|
|
4696
|
+
}
|
|
4697
|
+
event.preventDefault();
|
|
4698
|
+
manager.selectIcon(icon.id);
|
|
4699
|
+
contextMenu.openAtElement(event.currentTarget);
|
|
4700
|
+
}
|
|
4701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
4702
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4703
|
+
"button",
|
|
4704
|
+
{
|
|
4705
|
+
"aria-haspopup": contextMenuItems.length > 0 ? "menu" : void 0,
|
|
4706
|
+
className: "nu-icon-grid__icon",
|
|
4707
|
+
"data-dragging": isDragging || void 0,
|
|
4708
|
+
"data-selected": manager.selectedIconId === icon.id || void 0,
|
|
4709
|
+
disabled: icon.disabled,
|
|
4710
|
+
onClick: handleClick,
|
|
4711
|
+
onContextMenu: handleContextMenu,
|
|
4712
|
+
onDoubleClick: icon.onDoubleClick,
|
|
4713
|
+
onKeyDown: handleKeyDown,
|
|
4714
|
+
onPointerDown: handlePointerDown,
|
|
4715
|
+
onPointerMove: handlePointerMove,
|
|
4716
|
+
onPointerUp: finishDragging,
|
|
4717
|
+
onPointerCancel: finishDragging,
|
|
4718
|
+
style: { left: icon.position.x, top: icon.position.y },
|
|
4719
|
+
type: "button",
|
|
4720
|
+
children: [
|
|
4721
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { "aria-hidden": "true", className: "nu-icon-grid__glyph", children: typeof icon.icon === "string" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("img", { alt: "", draggable: false, src: icon.icon }) : icon.icon }),
|
|
4722
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "nu-icon-grid__label", children: renderMnemonicText(icon.label) })
|
|
4723
|
+
]
|
|
4724
|
+
}
|
|
4725
|
+
),
|
|
4726
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4727
|
+
PopupMenu,
|
|
4728
|
+
{
|
|
4729
|
+
anchor: contextMenu.anchor,
|
|
4730
|
+
items: contextMenuItems,
|
|
4731
|
+
onOpenChange: contextMenu.setOpen,
|
|
4732
|
+
open: contextMenu.open
|
|
4733
|
+
}
|
|
4734
|
+
)
|
|
4735
|
+
] });
|
|
4736
|
+
}
|
|
4737
|
+
function NuIconGrid({
|
|
4738
|
+
className,
|
|
4739
|
+
contextMenuItems: contextMenuItemsSource,
|
|
4740
|
+
defaultArrangeMode,
|
|
4741
|
+
onContextMenu,
|
|
4742
|
+
onPointerDown,
|
|
4743
|
+
...props
|
|
4744
|
+
}) {
|
|
4745
|
+
const [gridElement, setGridElement] = (0, import_react25.useState)(null);
|
|
4746
|
+
const manager = useNuIconGridContext();
|
|
4747
|
+
const hasAppliedDefaultArrangementRef = (0, import_react25.useRef)(false);
|
|
4748
|
+
const arrangeIcons = manager.arrangeIcons;
|
|
4749
|
+
const setGridSize = manager.setGridSize;
|
|
4750
|
+
const contextMenu = usePopupMenu();
|
|
4751
|
+
const contextMenuItems = (0, import_react25.useMemo)(
|
|
4752
|
+
() => resolveGridContextMenuItems(contextMenuItemsSource, manager),
|
|
4753
|
+
[contextMenuItemsSource, manager]
|
|
4754
|
+
);
|
|
4755
|
+
(0, import_react25.useLayoutEffect)(() => {
|
|
4756
|
+
if (!gridElement) {
|
|
4757
|
+
return;
|
|
4758
|
+
}
|
|
4759
|
+
const activeGridElement = gridElement;
|
|
4760
|
+
function updateGridSize() {
|
|
4761
|
+
const size = {
|
|
4762
|
+
height: activeGridElement.clientHeight,
|
|
4763
|
+
width: activeGridElement.clientWidth
|
|
4764
|
+
};
|
|
4765
|
+
setGridSize(size);
|
|
4766
|
+
if (defaultArrangeMode && !hasAppliedDefaultArrangementRef.current && size.height > 0 && size.width > 0) {
|
|
4767
|
+
hasAppliedDefaultArrangementRef.current = true;
|
|
4768
|
+
arrangeIcons(defaultArrangeMode);
|
|
4769
|
+
}
|
|
4770
|
+
}
|
|
4771
|
+
updateGridSize();
|
|
4772
|
+
const resizeObserver = new ResizeObserver(updateGridSize);
|
|
4773
|
+
resizeObserver.observe(gridElement);
|
|
4774
|
+
return () => resizeObserver.disconnect();
|
|
4775
|
+
}, [arrangeIcons, defaultArrangeMode, gridElement, setGridSize]);
|
|
4776
|
+
function handleContextMenu(event) {
|
|
4777
|
+
onContextMenu?.(event);
|
|
4778
|
+
if (event.defaultPrevented || contextMenuItems.length === 0) {
|
|
4779
|
+
return;
|
|
4780
|
+
}
|
|
4781
|
+
event.preventDefault();
|
|
4782
|
+
manager.selectIcon(null);
|
|
4783
|
+
contextMenu.openAtPoint(event.clientX, event.clientY);
|
|
4784
|
+
}
|
|
4785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4786
|
+
"div",
|
|
4787
|
+
{
|
|
4788
|
+
...props,
|
|
4789
|
+
"aria-label": props["aria-label"] ?? "Application icons",
|
|
4790
|
+
className: ["nu-icon-grid", className].filter(Boolean).join(" "),
|
|
4791
|
+
onContextMenu: handleContextMenu,
|
|
4792
|
+
onPointerDown: (event) => {
|
|
4793
|
+
onPointerDown?.(event);
|
|
4794
|
+
if (event.defaultPrevented) {
|
|
4795
|
+
return;
|
|
4796
|
+
}
|
|
4797
|
+
if (event.target === event.currentTarget) {
|
|
4798
|
+
manager.selectIcon(null);
|
|
4799
|
+
}
|
|
4800
|
+
},
|
|
4801
|
+
ref: setGridElement,
|
|
4802
|
+
role: "group",
|
|
4803
|
+
children: [
|
|
4804
|
+
manager.icons.map((icon) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(NuIconGridItem, { gridElement, icon }, icon.id)),
|
|
4805
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4806
|
+
PopupMenu,
|
|
4807
|
+
{
|
|
4808
|
+
anchor: contextMenu.anchor,
|
|
4809
|
+
items: contextMenuItems,
|
|
4810
|
+
onOpenChange: contextMenu.setOpen,
|
|
4811
|
+
open: contextMenu.open
|
|
4812
|
+
}
|
|
4813
|
+
)
|
|
4814
|
+
]
|
|
4815
|
+
}
|
|
4816
|
+
);
|
|
4817
|
+
}
|
|
4818
|
+
|
|
4819
|
+
// src/components/IconGrid/NuIconProvider.tsx
|
|
4820
|
+
var import_react26 = require("react");
|
|
4821
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4822
|
+
var GRID_PADDING = 12;
|
|
4823
|
+
var ICON_CELL_HEIGHT = 104;
|
|
4824
|
+
var ICON_CELL_WIDTH = 104;
|
|
4825
|
+
function getDefaultPosition(index) {
|
|
4826
|
+
return {
|
|
4827
|
+
x: GRID_PADDING + Math.floor(index / 6) * ICON_CELL_WIDTH,
|
|
4828
|
+
y: GRID_PADDING + index % 6 * ICON_CELL_HEIGHT
|
|
4829
|
+
};
|
|
4830
|
+
}
|
|
4831
|
+
function getIconInfo(definition, index, id) {
|
|
4832
|
+
return {
|
|
4833
|
+
...definition,
|
|
4834
|
+
id,
|
|
4835
|
+
position: definition.position ?? getDefaultPosition(index)
|
|
4836
|
+
};
|
|
4837
|
+
}
|
|
4838
|
+
function getInitialIcons(definitions) {
|
|
4839
|
+
const ids = /* @__PURE__ */ new Set();
|
|
4840
|
+
return definitions.map((definition, index) => {
|
|
4841
|
+
const baseId = definition.id ?? `nu-icon-${index + 1}`;
|
|
4842
|
+
let id = baseId;
|
|
4843
|
+
let duplicateIndex = 2;
|
|
4844
|
+
while (ids.has(id)) {
|
|
4845
|
+
id = `${baseId}-${duplicateIndex}`;
|
|
4846
|
+
duplicateIndex += 1;
|
|
4847
|
+
}
|
|
4848
|
+
ids.add(id);
|
|
4849
|
+
return getIconInfo(definition, index, id);
|
|
4850
|
+
});
|
|
4851
|
+
}
|
|
4852
|
+
function getArrangedPositions(icons, mode, gridSize) {
|
|
4853
|
+
const orderedIcons = mode === "name" ? [...icons].sort(
|
|
4854
|
+
(left, right) => left.label.localeCompare(right.label, void 0, {
|
|
4855
|
+
numeric: true,
|
|
4856
|
+
sensitivity: "base"
|
|
4857
|
+
})
|
|
4858
|
+
) : icons;
|
|
4859
|
+
const cellsPerLine = Math.max(
|
|
4860
|
+
1,
|
|
4861
|
+
Math.floor(
|
|
4862
|
+
((mode === "rows" ? gridSize.width : gridSize.height) - GRID_PADDING * 2) / (mode === "rows" ? ICON_CELL_WIDTH : ICON_CELL_HEIGHT)
|
|
4863
|
+
)
|
|
4864
|
+
);
|
|
4865
|
+
return new Map(
|
|
4866
|
+
orderedIcons.map((icon, index) => {
|
|
4867
|
+
const lineIndex = index % cellsPerLine;
|
|
4868
|
+
const crossIndex = Math.floor(index / cellsPerLine);
|
|
4869
|
+
return [
|
|
4870
|
+
icon.id,
|
|
4871
|
+
mode === "rows" ? {
|
|
4872
|
+
x: GRID_PADDING + lineIndex * ICON_CELL_WIDTH,
|
|
4873
|
+
y: GRID_PADDING + crossIndex * ICON_CELL_HEIGHT
|
|
4874
|
+
} : {
|
|
4875
|
+
x: GRID_PADDING + crossIndex * ICON_CELL_WIDTH,
|
|
4876
|
+
y: GRID_PADDING + lineIndex * ICON_CELL_HEIGHT
|
|
4877
|
+
}
|
|
4878
|
+
];
|
|
4879
|
+
})
|
|
4880
|
+
);
|
|
4881
|
+
}
|
|
4882
|
+
function NuIconProvider({
|
|
4883
|
+
children,
|
|
4884
|
+
defaultIcons = []
|
|
4885
|
+
}) {
|
|
4886
|
+
const idRef = (0, import_react26.useRef)(defaultIcons.length);
|
|
4887
|
+
const gridSizeRef = (0, import_react26.useRef)({ height: 0, width: 0 });
|
|
4888
|
+
const [icons, setIcons] = (0, import_react26.useState)(
|
|
4889
|
+
() => getInitialIcons(defaultIcons)
|
|
4890
|
+
);
|
|
4891
|
+
const [selectedIconId, setSelectedIconId] = (0, import_react26.useState)(null);
|
|
4892
|
+
const addIcon = (0, import_react26.useCallback)((definition) => {
|
|
4893
|
+
const id = definition.id ?? `nu-icon-${++idRef.current}`;
|
|
4894
|
+
setIcons((currentIcons) => {
|
|
4895
|
+
if (currentIcons.some((icon) => icon.id === id)) {
|
|
4896
|
+
throw new Error(`An icon with id "${id}" already exists.`);
|
|
4897
|
+
}
|
|
4898
|
+
return [
|
|
4899
|
+
...currentIcons,
|
|
4900
|
+
getIconInfo(definition, currentIcons.length, id)
|
|
4901
|
+
];
|
|
4902
|
+
});
|
|
4903
|
+
return id;
|
|
4904
|
+
}, []);
|
|
4905
|
+
const moveIcon = (0, import_react26.useCallback)((id, position) => {
|
|
4906
|
+
setIcons(
|
|
4907
|
+
(currentIcons) => currentIcons.map(
|
|
4908
|
+
(icon) => icon.id === id ? { ...icon, position } : icon
|
|
4909
|
+
)
|
|
4910
|
+
);
|
|
4911
|
+
}, []);
|
|
4912
|
+
const removeIcon = (0, import_react26.useCallback)((id) => {
|
|
4913
|
+
setIcons((currentIcons) => currentIcons.filter((icon) => icon.id !== id));
|
|
4914
|
+
setSelectedIconId((currentId) => currentId === id ? null : currentId);
|
|
4915
|
+
}, []);
|
|
4916
|
+
const updateIcon = (0, import_react26.useCallback)(
|
|
4917
|
+
(id, patch) => {
|
|
4918
|
+
setIcons(
|
|
4919
|
+
(currentIcons) => currentIcons.map(
|
|
4920
|
+
(icon) => icon.id === id ? {
|
|
4921
|
+
...icon,
|
|
4922
|
+
...patch,
|
|
4923
|
+
position: patch.position ?? icon.position
|
|
4924
|
+
} : icon
|
|
4925
|
+
)
|
|
4926
|
+
);
|
|
4927
|
+
},
|
|
4928
|
+
[]
|
|
4929
|
+
);
|
|
4930
|
+
const arrangeIcons = (0, import_react26.useCallback)((mode = "columns") => {
|
|
4931
|
+
setIcons((currentIcons) => {
|
|
4932
|
+
const positions = getArrangedPositions(
|
|
4933
|
+
currentIcons,
|
|
4934
|
+
mode,
|
|
4935
|
+
gridSizeRef.current
|
|
4936
|
+
);
|
|
4937
|
+
return currentIcons.map((icon) => ({
|
|
4938
|
+
...icon,
|
|
4939
|
+
position: positions.get(icon.id) ?? icon.position
|
|
4940
|
+
}));
|
|
4941
|
+
});
|
|
4942
|
+
}, []);
|
|
4943
|
+
const setGridSize = (0, import_react26.useCallback)((size) => {
|
|
4944
|
+
gridSizeRef.current = size;
|
|
4945
|
+
}, []);
|
|
4946
|
+
const contextValue = (0, import_react26.useMemo)(
|
|
4947
|
+
() => ({
|
|
4948
|
+
addIcon,
|
|
4949
|
+
arrangeIcons,
|
|
4950
|
+
icons,
|
|
4951
|
+
moveIcon,
|
|
4952
|
+
removeIcon,
|
|
4953
|
+
selectedIconId,
|
|
4954
|
+
selectIcon: setSelectedIconId,
|
|
4955
|
+
setGridSize,
|
|
4956
|
+
updateIcon
|
|
4957
|
+
}),
|
|
4958
|
+
[
|
|
4959
|
+
addIcon,
|
|
4960
|
+
arrangeIcons,
|
|
4961
|
+
icons,
|
|
4962
|
+
moveIcon,
|
|
4963
|
+
removeIcon,
|
|
4964
|
+
selectedIconId,
|
|
4965
|
+
setGridSize,
|
|
4966
|
+
updateIcon
|
|
4967
|
+
]
|
|
4968
|
+
);
|
|
4969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(NuIconContext.Provider, { value: contextValue, children });
|
|
4970
|
+
}
|
|
4971
|
+
|
|
4348
4972
|
// src/components/ComboBox/ComboBox.tsx
|
|
4349
|
-
var
|
|
4973
|
+
var import_react27 = require("react");
|
|
4974
|
+
var import_react_dom3 = require("react-dom");
|
|
4975
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4350
4976
|
function flattenComboBoxOptions(data) {
|
|
4351
4977
|
const options = [];
|
|
4352
4978
|
data.forEach((group) => {
|
|
@@ -4387,31 +5013,31 @@ function ComboBox({
|
|
|
4387
5013
|
value,
|
|
4388
5014
|
...props
|
|
4389
5015
|
}) {
|
|
4390
|
-
const rootRef = (0,
|
|
4391
|
-
const inputRef = (0,
|
|
4392
|
-
const fieldRef = (0,
|
|
4393
|
-
const popupRef = (0,
|
|
4394
|
-
const generatedId = (0,
|
|
5016
|
+
const rootRef = (0, import_react27.useRef)(null);
|
|
5017
|
+
const inputRef = (0, import_react27.useRef)(null);
|
|
5018
|
+
const fieldRef = (0, import_react27.useRef)(null);
|
|
5019
|
+
const popupRef = (0, import_react27.useRef)(null);
|
|
5020
|
+
const generatedId = (0, import_react27.useId)();
|
|
4395
5021
|
const fieldId = `${generatedId}-combo-box`;
|
|
4396
5022
|
const labelId = `${fieldId}-label`;
|
|
4397
5023
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
4398
|
-
const [open, setOpen] = (0,
|
|
4399
|
-
const options = (0,
|
|
5024
|
+
const [open, setOpen] = (0, import_react27.useState)(false);
|
|
5025
|
+
const options = (0, import_react27.useMemo)(() => flattenComboBoxOptions(data), [data]);
|
|
4400
5026
|
const isValueControlled = value !== void 0;
|
|
4401
5027
|
const isInputControlled = inputValueProp !== void 0;
|
|
4402
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
5028
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react27.useState)(() => defaultValue);
|
|
4403
5029
|
const initialSelectedOption = findComboBoxOption(options, defaultValue);
|
|
4404
|
-
const [uncontrolledInputValue, setUncontrolledInputValue] = (0,
|
|
5030
|
+
const [uncontrolledInputValue, setUncontrolledInputValue] = (0, import_react27.useState)(
|
|
4405
5031
|
() => defaultInputValue ?? initialSelectedOption?.item.name.text ?? ""
|
|
4406
5032
|
);
|
|
4407
5033
|
const resolvedValue = isValueControlled ? value : uncontrolledValue;
|
|
4408
|
-
const selectedOption = (0,
|
|
5034
|
+
const selectedOption = (0, import_react27.useMemo)(
|
|
4409
5035
|
() => findComboBoxOption(options, resolvedValue),
|
|
4410
5036
|
[options, resolvedValue]
|
|
4411
5037
|
);
|
|
4412
5038
|
const resolvedInputValue = isInputControlled ? inputValueProp ?? "" : uncontrolledInputValue;
|
|
4413
5039
|
const normalizedFilter = resolvedInputValue.trim().toLowerCase();
|
|
4414
|
-
const filteredData = (0,
|
|
5040
|
+
const filteredData = (0, import_react27.useMemo)(() => {
|
|
4415
5041
|
if (!normalizedFilter) {
|
|
4416
5042
|
return data;
|
|
4417
5043
|
}
|
|
@@ -4422,15 +5048,15 @@ function ComboBox({
|
|
|
4422
5048
|
)
|
|
4423
5049
|
})).filter((group) => group.items.length > 0);
|
|
4424
5050
|
}, [data, normalizedFilter]);
|
|
4425
|
-
const filteredOptions = (0,
|
|
5051
|
+
const filteredOptions = (0, import_react27.useMemo)(
|
|
4426
5052
|
() => flattenComboBoxOptions(filteredData).filter(
|
|
4427
5053
|
(option) => !option.item.disabled
|
|
4428
5054
|
),
|
|
4429
5055
|
[filteredData]
|
|
4430
5056
|
);
|
|
4431
5057
|
const popupRoot = typeof document === "undefined" ? null : resolveComboBoxPortalRoot();
|
|
4432
|
-
const [themePortalStyle, setThemePortalStyle] = (0,
|
|
4433
|
-
(0,
|
|
5058
|
+
const [themePortalStyle, setThemePortalStyle] = (0, import_react27.useState)(() => void 0);
|
|
5059
|
+
(0, import_react27.useEffect)(() => {
|
|
4434
5060
|
if (!open) {
|
|
4435
5061
|
return;
|
|
4436
5062
|
}
|
|
@@ -4506,7 +5132,7 @@ function ComboBox({
|
|
|
4506
5132
|
break;
|
|
4507
5133
|
}
|
|
4508
5134
|
}
|
|
4509
|
-
return /* @__PURE__ */ (0,
|
|
5135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
4510
5136
|
"div",
|
|
4511
5137
|
{
|
|
4512
5138
|
...props,
|
|
@@ -4514,7 +5140,7 @@ function ComboBox({
|
|
|
4514
5140
|
ref: rootRef,
|
|
4515
5141
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
4516
5142
|
children: [
|
|
4517
|
-
/* @__PURE__ */ (0,
|
|
5143
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4518
5144
|
"label",
|
|
4519
5145
|
{
|
|
4520
5146
|
className: cx("nu-combo-box__label", slotClassNames?.label),
|
|
@@ -4524,20 +5150,20 @@ function ComboBox({
|
|
|
4524
5150
|
children: renderMnemonicText(label)
|
|
4525
5151
|
}
|
|
4526
5152
|
),
|
|
4527
|
-
/* @__PURE__ */ (0,
|
|
5153
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
4528
5154
|
"span",
|
|
4529
5155
|
{
|
|
4530
5156
|
className: cx("nu-combo-box__slot", slotClassNames?.slot),
|
|
4531
5157
|
style: slotStyles?.slot,
|
|
4532
5158
|
children: [
|
|
4533
|
-
/* @__PURE__ */ (0,
|
|
5159
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
4534
5160
|
"span",
|
|
4535
5161
|
{
|
|
4536
5162
|
className: cx("nu-combo-box__field", slotClassNames?.field),
|
|
4537
5163
|
ref: fieldRef,
|
|
4538
5164
|
style: slotStyles?.field,
|
|
4539
5165
|
children: [
|
|
4540
|
-
/* @__PURE__ */ (0,
|
|
5166
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4541
5167
|
"span",
|
|
4542
5168
|
{
|
|
4543
5169
|
"aria-hidden": "true",
|
|
@@ -4546,7 +5172,7 @@ function ComboBox({
|
|
|
4546
5172
|
children: "["
|
|
4547
5173
|
}
|
|
4548
5174
|
),
|
|
4549
|
-
/* @__PURE__ */ (0,
|
|
5175
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4550
5176
|
"span",
|
|
4551
5177
|
{
|
|
4552
5178
|
className: cx(
|
|
@@ -4554,7 +5180,7 @@ function ComboBox({
|
|
|
4554
5180
|
slotClassNames?.inputShell
|
|
4555
5181
|
),
|
|
4556
5182
|
style: slotStyles?.inputShell,
|
|
4557
|
-
children: /* @__PURE__ */ (0,
|
|
5183
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4558
5184
|
"input",
|
|
4559
5185
|
{
|
|
4560
5186
|
"aria-autocomplete": "list",
|
|
@@ -4581,7 +5207,7 @@ function ComboBox({
|
|
|
4581
5207
|
)
|
|
4582
5208
|
}
|
|
4583
5209
|
),
|
|
4584
|
-
/* @__PURE__ */ (0,
|
|
5210
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4585
5211
|
"span",
|
|
4586
5212
|
{
|
|
4587
5213
|
"aria-hidden": "true",
|
|
@@ -4593,296 +5219,81 @@ function ComboBox({
|
|
|
4593
5219
|
]
|
|
4594
5220
|
}
|
|
4595
5221
|
),
|
|
4596
|
-
/* @__PURE__ */ (0,
|
|
5222
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4597
5223
|
ControlOpener,
|
|
4598
5224
|
{
|
|
4599
|
-
"aria-label": open ? "Collapse list" : "Expand list",
|
|
4600
|
-
as: "button",
|
|
4601
|
-
className: cx(
|
|
4602
|
-
"nu-control-opener",
|
|
4603
|
-
"nu-combo-box__toggle",
|
|
4604
|
-
slotClassNames?.toggle
|
|
4605
|
-
),
|
|
4606
|
-
disabled,
|
|
4607
|
-
onClick: handleToggle,
|
|
4608
|
-
style: slotStyles?.toggle
|
|
4609
|
-
}
|
|
4610
|
-
)
|
|
4611
|
-
]
|
|
4612
|
-
}
|
|
4613
|
-
),
|
|
4614
|
-
hint ? /* @__PURE__ */ (0,
|
|
4615
|
-
"span",
|
|
4616
|
-
{
|
|
4617
|
-
className: cx("nu-combo-box__hint", slotClassNames?.hint),
|
|
4618
|
-
id: hintId,
|
|
4619
|
-
style: slotStyles?.hint,
|
|
4620
|
-
children: hint
|
|
4621
|
-
}
|
|
4622
|
-
) : null,
|
|
4623
|
-
open && popupRoot ? (0, import_react_dom2.createPortal)(
|
|
4624
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4625
|
-
"div",
|
|
4626
|
-
{
|
|
4627
|
-
className: cx("nu-combo-box__popup", slotClassNames?.popup),
|
|
4628
|
-
id: `${fieldId}-popup`,
|
|
4629
|
-
ref: popupRef,
|
|
4630
|
-
style: mergeSlotStyle(
|
|
4631
|
-
themePortalStyle,
|
|
4632
|
-
slotStyles?.popup
|
|
4633
|
-
),
|
|
4634
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4635
|
-
"div",
|
|
4636
|
-
{
|
|
4637
|
-
className: cx("nu-combo-box__listbox", slotClassNames?.listbox),
|
|
4638
|
-
style: slotStyles?.listbox,
|
|
4639
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4640
|
-
ListBox,
|
|
4641
|
-
{
|
|
4642
|
-
data: filteredData,
|
|
4643
|
-
emptyText: "No matches",
|
|
4644
|
-
onItemSelect: (item, group) => {
|
|
4645
|
-
const nextOption = filteredOptions.find(
|
|
4646
|
-
(option) => option.item === item && option.group === group
|
|
4647
|
-
);
|
|
4648
|
-
if (!nextOption) {
|
|
4649
|
-
return;
|
|
4650
|
-
}
|
|
4651
|
-
commitValue(nextOption.value, item, group);
|
|
4652
|
-
},
|
|
4653
|
-
selectedId: selectedOption?.value,
|
|
4654
|
-
style: slotStyles?.listbox
|
|
4655
|
-
}
|
|
4656
|
-
)
|
|
4657
|
-
}
|
|
4658
|
-
)
|
|
4659
|
-
}
|
|
4660
|
-
),
|
|
4661
|
-
popupRoot
|
|
4662
|
-
) : null
|
|
4663
|
-
]
|
|
4664
|
-
}
|
|
4665
|
-
);
|
|
4666
|
-
}
|
|
4667
|
-
|
|
4668
|
-
// src/components/CommandButton/CommandButton.tsx
|
|
4669
|
-
var import_react25 = require("react");
|
|
4670
|
-
|
|
4671
|
-
// src/components/PopupMenu/PopupMenu.tsx
|
|
4672
|
-
var import_react23 = require("react");
|
|
4673
|
-
var import_react_dom3 = require("react-dom");
|
|
4674
|
-
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4675
|
-
function hasVisibleChildren2(item) {
|
|
4676
|
-
return Boolean(item.items?.some((child) => !child.hidden));
|
|
4677
|
-
}
|
|
4678
|
-
function clamp(value, min, max) {
|
|
4679
|
-
return Math.min(max, Math.max(min, value));
|
|
4680
|
-
}
|
|
4681
|
-
function resolveAnchorPosition(anchor) {
|
|
4682
|
-
if (!anchor) {
|
|
4683
|
-
return null;
|
|
4684
|
-
}
|
|
4685
|
-
if (anchor.type === "point") {
|
|
4686
|
-
return {
|
|
4687
|
-
left: anchor.x,
|
|
4688
|
-
top: anchor.y
|
|
4689
|
-
};
|
|
4690
|
-
}
|
|
4691
|
-
const rect = anchor.element.getBoundingClientRect();
|
|
4692
|
-
return {
|
|
4693
|
-
left: rect.left,
|
|
4694
|
-
top: rect.bottom - 1
|
|
4695
|
-
};
|
|
4696
|
-
}
|
|
4697
|
-
function resolvePortalRoot() {
|
|
4698
|
-
if (typeof document === "undefined") {
|
|
4699
|
-
return null;
|
|
4700
|
-
}
|
|
4701
|
-
return document.body;
|
|
4702
|
-
}
|
|
4703
|
-
function PopupMenu({
|
|
4704
|
-
anchor,
|
|
4705
|
-
className,
|
|
4706
|
-
defaultOpen = false,
|
|
4707
|
-
items,
|
|
4708
|
-
onItemSelect,
|
|
4709
|
-
onOpenChange,
|
|
4710
|
-
open,
|
|
4711
|
-
style: styleProp,
|
|
4712
|
-
uncheckedShape = "box",
|
|
4713
|
-
...props
|
|
4714
|
-
}) {
|
|
4715
|
-
const rootRef = (0, import_react23.useRef)(null);
|
|
4716
|
-
const [activePath, setActivePath] = (0, import_react23.useState)([]);
|
|
4717
|
-
const [uncontrolledOpen, setUncontrolledOpen] = (0, import_react23.useState)(defaultOpen);
|
|
4718
|
-
const isControlled = open !== void 0;
|
|
4719
|
-
const resolvedOpen = isControlled ? open : uncontrolledOpen;
|
|
4720
|
-
const portalRoot = resolvePortalRoot();
|
|
4721
|
-
const setResolvedOpen = (0, import_react23.useCallback)(
|
|
4722
|
-
(nextOpen) => {
|
|
4723
|
-
if (!nextOpen) {
|
|
4724
|
-
setActivePath([]);
|
|
4725
|
-
}
|
|
4726
|
-
if (!isControlled) {
|
|
4727
|
-
setUncontrolledOpen(nextOpen);
|
|
4728
|
-
}
|
|
4729
|
-
onOpenChange?.(nextOpen);
|
|
4730
|
-
},
|
|
4731
|
-
[isControlled, onOpenChange]
|
|
4732
|
-
);
|
|
4733
|
-
(0, import_react23.useEffect)(() => {
|
|
4734
|
-
if (!resolvedOpen) {
|
|
4735
|
-
return;
|
|
4736
|
-
}
|
|
4737
|
-
function handlePointerDown(event) {
|
|
4738
|
-
if (!rootRef.current?.contains(event.target)) {
|
|
4739
|
-
setResolvedOpen(false);
|
|
4740
|
-
}
|
|
4741
|
-
}
|
|
4742
|
-
function handleKeyDown(event) {
|
|
4743
|
-
if (event.key === "Escape") {
|
|
4744
|
-
setResolvedOpen(false);
|
|
4745
|
-
}
|
|
4746
|
-
}
|
|
4747
|
-
document.addEventListener("pointerdown", handlePointerDown);
|
|
4748
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
4749
|
-
return () => {
|
|
4750
|
-
document.removeEventListener("pointerdown", handlePointerDown);
|
|
4751
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
4752
|
-
};
|
|
4753
|
-
}, [resolvedOpen, setResolvedOpen]);
|
|
4754
|
-
(0, import_react23.useLayoutEffect)(() => {
|
|
4755
|
-
if (!resolvedOpen || !anchor || !rootRef.current) {
|
|
4756
|
-
return;
|
|
4757
|
-
}
|
|
4758
|
-
const rootNode = rootRef.current;
|
|
4759
|
-
function updatePosition() {
|
|
4760
|
-
const anchorPosition = resolveAnchorPosition(anchor);
|
|
4761
|
-
if (!anchorPosition) {
|
|
4762
|
-
return;
|
|
4763
|
-
}
|
|
4764
|
-
const viewportRect = getPortalViewportRect(portalRoot);
|
|
4765
|
-
const relativePosition = toPortalCoordinates(portalRoot, anchorPosition);
|
|
4766
|
-
const rect = rootNode.getBoundingClientRect();
|
|
4767
|
-
const maxLeft = Math.max(0, viewportRect.width - rect.width);
|
|
4768
|
-
const maxTop = Math.max(0, viewportRect.height - rect.height);
|
|
4769
|
-
rootNode.style.left = `${clamp(relativePosition.left, 0, maxLeft)}px`;
|
|
4770
|
-
rootNode.style.top = `${clamp(relativePosition.top, 0, maxTop)}px`;
|
|
4771
|
-
rootNode.style.visibility = "visible";
|
|
4772
|
-
}
|
|
4773
|
-
rootNode.style.left = "0px";
|
|
4774
|
-
rootNode.style.top = "0px";
|
|
4775
|
-
rootNode.style.visibility = "hidden";
|
|
4776
|
-
updatePosition();
|
|
4777
|
-
window.addEventListener("resize", updatePosition);
|
|
4778
|
-
window.addEventListener("scroll", updatePosition, true);
|
|
4779
|
-
return () => {
|
|
4780
|
-
window.removeEventListener("resize", updatePosition);
|
|
4781
|
-
window.removeEventListener("scroll", updatePosition, true);
|
|
4782
|
-
};
|
|
4783
|
-
}, [anchor, portalRoot, resolvedOpen]);
|
|
4784
|
-
function handleActivateItem(item, level) {
|
|
4785
|
-
if (item.disabled) {
|
|
4786
|
-
return;
|
|
4787
|
-
}
|
|
4788
|
-
if (hasVisibleChildren2(item)) {
|
|
4789
|
-
setActivePath(
|
|
4790
|
-
(currentPath) => currentPath[level] === item.id ? currentPath.slice(0, level) : [...currentPath.slice(0, level), item.id]
|
|
4791
|
-
);
|
|
4792
|
-
return;
|
|
4793
|
-
}
|
|
4794
|
-
item.onSelect?.();
|
|
4795
|
-
onItemSelect?.(item);
|
|
4796
|
-
setResolvedOpen(false);
|
|
4797
|
-
}
|
|
4798
|
-
function handleHoverItem(item, level) {
|
|
4799
|
-
if (item.disabled) {
|
|
4800
|
-
return;
|
|
4801
|
-
}
|
|
4802
|
-
setActivePath((currentPath) => [...currentPath.slice(0, level), item.id]);
|
|
4803
|
-
}
|
|
4804
|
-
if (!resolvedOpen || !anchor || !portalRoot || items.every((item) => item.hidden)) {
|
|
4805
|
-
return null;
|
|
4806
|
-
}
|
|
4807
|
-
return (0, import_react_dom3.createPortal)(
|
|
4808
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4809
|
-
"div",
|
|
4810
|
-
{
|
|
4811
|
-
...props,
|
|
4812
|
-
className: ["nu-popup-menu", className].filter(Boolean).join(" "),
|
|
4813
|
-
onContextMenu: (event) => event.preventDefault(),
|
|
4814
|
-
ref: rootRef,
|
|
4815
|
-
style: {
|
|
4816
|
-
...getThemePortalStyle(
|
|
4817
|
-
anchor?.type === "element" ? anchor.element : null
|
|
4818
|
-
),
|
|
4819
|
-
...styleProp,
|
|
4820
|
-
left: 0,
|
|
4821
|
-
top: 0,
|
|
4822
|
-
visibility: "hidden"
|
|
4823
|
-
},
|
|
4824
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "nu-popup-menu__shell", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4825
|
-
MainMenuList,
|
|
5225
|
+
"aria-label": open ? "Collapse list" : "Expand list",
|
|
5226
|
+
as: "button",
|
|
5227
|
+
className: cx(
|
|
5228
|
+
"nu-control-opener",
|
|
5229
|
+
"nu-combo-box__toggle",
|
|
5230
|
+
slotClassNames?.toggle
|
|
5231
|
+
),
|
|
5232
|
+
disabled,
|
|
5233
|
+
onClick: handleToggle,
|
|
5234
|
+
style: slotStyles?.toggle
|
|
5235
|
+
}
|
|
5236
|
+
)
|
|
5237
|
+
]
|
|
5238
|
+
}
|
|
5239
|
+
),
|
|
5240
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5241
|
+
"span",
|
|
4826
5242
|
{
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
onHoverItem: handleHoverItem,
|
|
4832
|
-
rootVariant: "popup",
|
|
4833
|
-
uncheckedShape
|
|
5243
|
+
className: cx("nu-combo-box__hint", slotClassNames?.hint),
|
|
5244
|
+
id: hintId,
|
|
5245
|
+
style: slotStyles?.hint,
|
|
5246
|
+
children: hint
|
|
4834
5247
|
}
|
|
4835
|
-
)
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
5248
|
+
) : null,
|
|
5249
|
+
open && popupRoot ? (0, import_react_dom3.createPortal)(
|
|
5250
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5251
|
+
"div",
|
|
5252
|
+
{
|
|
5253
|
+
className: cx("nu-combo-box__popup", slotClassNames?.popup),
|
|
5254
|
+
id: `${fieldId}-popup`,
|
|
5255
|
+
ref: popupRef,
|
|
5256
|
+
style: mergeSlotStyle(
|
|
5257
|
+
themePortalStyle,
|
|
5258
|
+
slotStyles?.popup
|
|
5259
|
+
),
|
|
5260
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5261
|
+
"div",
|
|
5262
|
+
{
|
|
5263
|
+
className: cx("nu-combo-box__listbox", slotClassNames?.listbox),
|
|
5264
|
+
style: slotStyles?.listbox,
|
|
5265
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5266
|
+
ListBox,
|
|
5267
|
+
{
|
|
5268
|
+
data: filteredData,
|
|
5269
|
+
emptyText: "No matches",
|
|
5270
|
+
onItemSelect: (item, group) => {
|
|
5271
|
+
const nextOption = filteredOptions.find(
|
|
5272
|
+
(option) => option.item === item && option.group === group
|
|
5273
|
+
);
|
|
5274
|
+
if (!nextOption) {
|
|
5275
|
+
return;
|
|
5276
|
+
}
|
|
5277
|
+
commitValue(nextOption.value, item, group);
|
|
5278
|
+
},
|
|
5279
|
+
selectedId: selectedOption?.value,
|
|
5280
|
+
style: slotStyles?.listbox
|
|
5281
|
+
}
|
|
5282
|
+
)
|
|
5283
|
+
}
|
|
5284
|
+
)
|
|
5285
|
+
}
|
|
5286
|
+
),
|
|
5287
|
+
popupRoot
|
|
5288
|
+
) : null
|
|
5289
|
+
]
|
|
5290
|
+
}
|
|
4839
5291
|
);
|
|
4840
5292
|
}
|
|
4841
5293
|
|
|
4842
|
-
// src/components/PopupMenu/usePopupMenu.ts
|
|
4843
|
-
var import_react24 = require("react");
|
|
4844
|
-
function usePopupMenu() {
|
|
4845
|
-
const [anchor, setAnchor] = (0, import_react24.useState)(null);
|
|
4846
|
-
const [open, setOpen] = (0, import_react24.useState)(false);
|
|
4847
|
-
function close() {
|
|
4848
|
-
setOpen(false);
|
|
4849
|
-
}
|
|
4850
|
-
function openAtPoint(x, y) {
|
|
4851
|
-
setAnchor({
|
|
4852
|
-
type: "point",
|
|
4853
|
-
x,
|
|
4854
|
-
y
|
|
4855
|
-
});
|
|
4856
|
-
setOpen(true);
|
|
4857
|
-
}
|
|
4858
|
-
function openAtElement(element) {
|
|
4859
|
-
setAnchor({
|
|
4860
|
-
element,
|
|
4861
|
-
type: "element"
|
|
4862
|
-
});
|
|
4863
|
-
setOpen(true);
|
|
4864
|
-
}
|
|
4865
|
-
function openFromClick(event) {
|
|
4866
|
-
openAtElement(event.currentTarget);
|
|
4867
|
-
}
|
|
4868
|
-
function openFromContextMenu(event) {
|
|
4869
|
-
event.preventDefault();
|
|
4870
|
-
openAtPoint(event.clientX, event.clientY);
|
|
4871
|
-
}
|
|
4872
|
-
return {
|
|
4873
|
-
anchor,
|
|
4874
|
-
close,
|
|
4875
|
-
open,
|
|
4876
|
-
openAtElement,
|
|
4877
|
-
openAtPoint,
|
|
4878
|
-
openFromClick,
|
|
4879
|
-
openFromContextMenu,
|
|
4880
|
-
setOpen
|
|
4881
|
-
};
|
|
4882
|
-
}
|
|
4883
|
-
|
|
4884
5294
|
// src/components/CommandButton/CommandButton.tsx
|
|
4885
|
-
var
|
|
5295
|
+
var import_react28 = require("react");
|
|
5296
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4886
5297
|
var COMMAND_BUTTON_GLYPH_NAMES = /* @__PURE__ */ new Set([
|
|
4887
5298
|
"check-fill",
|
|
4888
5299
|
"check-mark",
|
|
@@ -4923,7 +5334,7 @@ function CommandButton({
|
|
|
4923
5334
|
const hasMenu = menuItems.length > 0;
|
|
4924
5335
|
const showCaret = dropdown || hasMenu;
|
|
4925
5336
|
const resolvedToggled = toggled ?? pressed;
|
|
4926
|
-
const resolvedIcon = typeof icon === "string" && isCommandButtonGlyphName(icon) ? /* @__PURE__ */ (0,
|
|
5337
|
+
const resolvedIcon = typeof icon === "string" && isCommandButtonGlyphName(icon) ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(NuGlyph, { name: icon }) : icon ?? null;
|
|
4927
5338
|
function handleClick(event) {
|
|
4928
5339
|
onClick?.(event);
|
|
4929
5340
|
if (event.defaultPrevented || !hasMenu) {
|
|
@@ -4931,8 +5342,8 @@ function CommandButton({
|
|
|
4931
5342
|
}
|
|
4932
5343
|
popupMenu.openFromClick(event);
|
|
4933
5344
|
}
|
|
4934
|
-
return /* @__PURE__ */ (0,
|
|
4935
|
-
/* @__PURE__ */ (0,
|
|
5345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react28.Fragment, { children: [
|
|
5346
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
4936
5347
|
"button",
|
|
4937
5348
|
{
|
|
4938
5349
|
...props,
|
|
@@ -4948,7 +5359,7 @@ function CommandButton({
|
|
|
4948
5359
|
type,
|
|
4949
5360
|
onClick: handleClick,
|
|
4950
5361
|
children: [
|
|
4951
|
-
resolvedIcon ? /* @__PURE__ */ (0,
|
|
5362
|
+
resolvedIcon ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4952
5363
|
"span",
|
|
4953
5364
|
{
|
|
4954
5365
|
className: cx(
|
|
@@ -4960,7 +5371,7 @@ function CommandButton({
|
|
|
4960
5371
|
children: resolvedIcon
|
|
4961
5372
|
}
|
|
4962
5373
|
) : null,
|
|
4963
|
-
children ? /* @__PURE__ */ (0,
|
|
5374
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4964
5375
|
"span",
|
|
4965
5376
|
{
|
|
4966
5377
|
className: cx(
|
|
@@ -4972,7 +5383,7 @@ function CommandButton({
|
|
|
4972
5383
|
children: renderMnemonicNode(children)
|
|
4973
5384
|
}
|
|
4974
5385
|
) : null,
|
|
4975
|
-
showCaret ? /* @__PURE__ */ (0,
|
|
5386
|
+
showCaret ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4976
5387
|
"span",
|
|
4977
5388
|
{
|
|
4978
5389
|
className: cx(
|
|
@@ -4981,13 +5392,13 @@ function CommandButton({
|
|
|
4981
5392
|
slotClassNames?.caret
|
|
4982
5393
|
),
|
|
4983
5394
|
style: slotStyles?.caret,
|
|
4984
|
-
children: /* @__PURE__ */ (0,
|
|
5395
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(NuGlyph, { name: "dropdown-arrow" })
|
|
4985
5396
|
}
|
|
4986
5397
|
) : null
|
|
4987
5398
|
]
|
|
4988
5399
|
}
|
|
4989
5400
|
),
|
|
4990
|
-
hasMenu ? /* @__PURE__ */ (0,
|
|
5401
|
+
hasMenu ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4991
5402
|
PopupMenu,
|
|
4992
5403
|
{
|
|
4993
5404
|
anchor: popupMenu.anchor,
|
|
@@ -5002,8 +5413,8 @@ function CommandButton({
|
|
|
5002
5413
|
}
|
|
5003
5414
|
|
|
5004
5415
|
// src/components/CrtGlitch/CrtGlitch.tsx
|
|
5005
|
-
var
|
|
5006
|
-
var
|
|
5416
|
+
var import_react29 = require("react");
|
|
5417
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5007
5418
|
var DEFAULT_INTERVAL_MS = 3e3;
|
|
5008
5419
|
var DEFAULT_DURATION_MS = 2500;
|
|
5009
5420
|
var DEFAULT_TOP_LEVEL_RATIO = 1 / 3;
|
|
@@ -5028,14 +5439,14 @@ function NuCrtGlitch({
|
|
|
5028
5439
|
targetSelector = DEFAULT_TARGET_SELECTOR,
|
|
5029
5440
|
topLevelRatio = DEFAULT_TOP_LEVEL_RATIO
|
|
5030
5441
|
}) {
|
|
5031
|
-
const filterId = (0,
|
|
5032
|
-
const turbulenceRef = (0,
|
|
5033
|
-
const warpRef = (0,
|
|
5034
|
-
const rOffsetRef = (0,
|
|
5035
|
-
const bOffsetRef = (0,
|
|
5036
|
-
const rafRef = (0,
|
|
5037
|
-
const targetElRef = (0,
|
|
5038
|
-
(0,
|
|
5442
|
+
const filterId = (0, import_react29.useId)().replace(/:/g, "");
|
|
5443
|
+
const turbulenceRef = (0, import_react29.useRef)(null);
|
|
5444
|
+
const warpRef = (0, import_react29.useRef)(null);
|
|
5445
|
+
const rOffsetRef = (0, import_react29.useRef)(null);
|
|
5446
|
+
const bOffsetRef = (0, import_react29.useRef)(null);
|
|
5447
|
+
const rafRef = (0, import_react29.useRef)(null);
|
|
5448
|
+
const targetElRef = (0, import_react29.useRef)(null);
|
|
5449
|
+
(0, import_react29.useEffect)(() => {
|
|
5039
5450
|
if (!enabled) {
|
|
5040
5451
|
return;
|
|
5041
5452
|
}
|
|
@@ -5137,7 +5548,7 @@ function NuCrtGlitch({
|
|
|
5137
5548
|
}
|
|
5138
5549
|
};
|
|
5139
5550
|
}, [durationMs, enabled, filterId, intervalMs, targetSelector, topLevelRatio]);
|
|
5140
|
-
return /* @__PURE__ */ (0,
|
|
5551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("svg", { "aria-hidden": "true", height: "0", style: { position: "absolute" }, width: "0", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
5141
5552
|
"filter",
|
|
5142
5553
|
{
|
|
5143
5554
|
"color-interpolation-filters": "sRGB",
|
|
@@ -5147,7 +5558,7 @@ function NuCrtGlitch({
|
|
|
5147
5558
|
x: "-15%",
|
|
5148
5559
|
y: "-5%",
|
|
5149
5560
|
children: [
|
|
5150
|
-
/* @__PURE__ */ (0,
|
|
5561
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5151
5562
|
"feTurbulence",
|
|
5152
5563
|
{
|
|
5153
5564
|
baseFrequency: "0.001 0.045",
|
|
@@ -5158,7 +5569,7 @@ function NuCrtGlitch({
|
|
|
5158
5569
|
type: "turbulence"
|
|
5159
5570
|
}
|
|
5160
5571
|
),
|
|
5161
|
-
/* @__PURE__ */ (0,
|
|
5572
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5162
5573
|
"feDisplacementMap",
|
|
5163
5574
|
{
|
|
5164
5575
|
in: "SourceGraphic",
|
|
@@ -5170,8 +5581,8 @@ function NuCrtGlitch({
|
|
|
5170
5581
|
yChannelSelector: "A"
|
|
5171
5582
|
}
|
|
5172
5583
|
),
|
|
5173
|
-
/* @__PURE__ */ (0,
|
|
5174
|
-
/* @__PURE__ */ (0,
|
|
5584
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("feOffset", { dx: 0, dy: 0, in: "warped", ref: rOffsetRef, result: "rOff" }),
|
|
5585
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5175
5586
|
"feColorMatrix",
|
|
5176
5587
|
{
|
|
5177
5588
|
in: "rOff",
|
|
@@ -5180,7 +5591,7 @@ function NuCrtGlitch({
|
|
|
5180
5591
|
values: "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"
|
|
5181
5592
|
}
|
|
5182
5593
|
),
|
|
5183
|
-
/* @__PURE__ */ (0,
|
|
5594
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5184
5595
|
"feColorMatrix",
|
|
5185
5596
|
{
|
|
5186
5597
|
in: "warped",
|
|
@@ -5189,8 +5600,8 @@ function NuCrtGlitch({
|
|
|
5189
5600
|
values: "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0"
|
|
5190
5601
|
}
|
|
5191
5602
|
),
|
|
5192
|
-
/* @__PURE__ */ (0,
|
|
5193
|
-
/* @__PURE__ */ (0,
|
|
5603
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("feOffset", { dx: 0, dy: 0, in: "warped", ref: bOffsetRef, result: "bOff" }),
|
|
5604
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5194
5605
|
"feColorMatrix",
|
|
5195
5606
|
{
|
|
5196
5607
|
in: "bOff",
|
|
@@ -5199,15 +5610,15 @@ function NuCrtGlitch({
|
|
|
5199
5610
|
values: "0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0"
|
|
5200
5611
|
}
|
|
5201
5612
|
),
|
|
5202
|
-
/* @__PURE__ */ (0,
|
|
5203
|
-
/* @__PURE__ */ (0,
|
|
5613
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("feBlend", { in: "rOnly", in2: "gOnly", mode: "screen", result: "rg" }),
|
|
5614
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("feBlend", { in: "rg", in2: "bOnly", mode: "screen" })
|
|
5204
5615
|
]
|
|
5205
5616
|
}
|
|
5206
5617
|
) }) });
|
|
5207
5618
|
}
|
|
5208
5619
|
|
|
5209
5620
|
// src/components/ListView/ListView.tsx
|
|
5210
|
-
var
|
|
5621
|
+
var import_react31 = require("react");
|
|
5211
5622
|
|
|
5212
5623
|
// src/components/ListView/internals/helpers.ts
|
|
5213
5624
|
function getInitialActiveRowId(rows, selectedId) {
|
|
@@ -5241,17 +5652,17 @@ function renderListViewCellValue(row, column) {
|
|
|
5241
5652
|
}
|
|
5242
5653
|
|
|
5243
5654
|
// src/components/ListView/internals/ListViewRow.tsx
|
|
5244
|
-
var
|
|
5655
|
+
var import_react30 = require("react");
|
|
5245
5656
|
|
|
5246
5657
|
// src/components/ListView/internals/ListViewCheckControl.tsx
|
|
5247
|
-
var
|
|
5658
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
5248
5659
|
function ListViewCheckControl({
|
|
5249
5660
|
isChecked,
|
|
5250
5661
|
onActivate,
|
|
5251
5662
|
onToggleCheck,
|
|
5252
5663
|
uncheckedShape
|
|
5253
5664
|
}) {
|
|
5254
|
-
return /* @__PURE__ */ (0,
|
|
5665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5255
5666
|
"button",
|
|
5256
5667
|
{
|
|
5257
5668
|
"aria-label": isChecked ? "Uncheck row" : "Check row",
|
|
@@ -5264,13 +5675,13 @@ function ListViewCheckControl({
|
|
|
5264
5675
|
onToggleCheck();
|
|
5265
5676
|
},
|
|
5266
5677
|
type: "button",
|
|
5267
|
-
children: /* @__PURE__ */ (0,
|
|
5678
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5268
5679
|
"span",
|
|
5269
5680
|
{
|
|
5270
5681
|
"aria-hidden": "true",
|
|
5271
5682
|
className: "nu-list-view__check-box",
|
|
5272
5683
|
"data-unchecked-shape": uncheckedShape,
|
|
5273
|
-
children: isChecked ? /* @__PURE__ */ (0,
|
|
5684
|
+
children: isChecked ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5274
5685
|
NuGlyph,
|
|
5275
5686
|
{
|
|
5276
5687
|
className: "nu-list-view__check-indicator",
|
|
@@ -5284,7 +5695,7 @@ function ListViewCheckControl({
|
|
|
5284
5695
|
}
|
|
5285
5696
|
|
|
5286
5697
|
// src/components/ListView/internals/ListViewRow.tsx
|
|
5287
|
-
var
|
|
5698
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
5288
5699
|
function ListViewRowInner({
|
|
5289
5700
|
columns,
|
|
5290
5701
|
isActive,
|
|
@@ -5315,7 +5726,7 @@ function ListViewRowInner({
|
|
|
5315
5726
|
function handleToggleCheck() {
|
|
5316
5727
|
onToggleCheck(rowId);
|
|
5317
5728
|
}
|
|
5318
|
-
return /* @__PURE__ */ (0,
|
|
5729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
5319
5730
|
"div",
|
|
5320
5731
|
{
|
|
5321
5732
|
"aria-disabled": row.disabled || void 0,
|
|
@@ -5336,7 +5747,7 @@ function ListViewRowInner({
|
|
|
5336
5747
|
"--nu-list-view-columns": templateColumns
|
|
5337
5748
|
},
|
|
5338
5749
|
children: [
|
|
5339
|
-
showCheckBox ? /* @__PURE__ */ (0,
|
|
5750
|
+
showCheckBox ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "nu-list-view__check-cell", role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
5340
5751
|
ListViewCheckControl,
|
|
5341
5752
|
{
|
|
5342
5753
|
isChecked,
|
|
@@ -5345,7 +5756,7 @@ function ListViewRowInner({
|
|
|
5345
5756
|
uncheckedShape
|
|
5346
5757
|
}
|
|
5347
5758
|
) }) : null,
|
|
5348
|
-
columns.map((column) => /* @__PURE__ */ (0,
|
|
5759
|
+
columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
5349
5760
|
"span",
|
|
5350
5761
|
{
|
|
5351
5762
|
className: [
|
|
@@ -5362,10 +5773,10 @@ function ListViewRowInner({
|
|
|
5362
5773
|
}
|
|
5363
5774
|
);
|
|
5364
5775
|
}
|
|
5365
|
-
var ListViewRow = (0,
|
|
5776
|
+
var ListViewRow = (0, import_react30.memo)(ListViewRowInner);
|
|
5366
5777
|
|
|
5367
5778
|
// src/components/ListView/ListView.tsx
|
|
5368
|
-
var
|
|
5779
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5369
5780
|
function ListViewInner({
|
|
5370
5781
|
activeRowId: activeRowIdProp,
|
|
5371
5782
|
checkedIds,
|
|
@@ -5383,26 +5794,26 @@ function ListViewInner({
|
|
|
5383
5794
|
uncheckedShape = "box",
|
|
5384
5795
|
...props
|
|
5385
5796
|
}, ref) {
|
|
5386
|
-
const rootRef = (0,
|
|
5387
|
-
const rowRefs = (0,
|
|
5388
|
-
const selectableRows = (0,
|
|
5797
|
+
const rootRef = (0, import_react31.useRef)(null);
|
|
5798
|
+
const rowRefs = (0, import_react31.useRef)({});
|
|
5799
|
+
const selectableRows = (0, import_react31.useMemo)(
|
|
5389
5800
|
() => data.filter((row) => !row.disabled),
|
|
5390
5801
|
[data]
|
|
5391
5802
|
);
|
|
5392
5803
|
const isActiveControlled = activeRowIdProp !== void 0;
|
|
5393
|
-
const [uncontrolledActiveRowId, setUncontrolledActiveRowId] = (0,
|
|
5804
|
+
const [uncontrolledActiveRowId, setUncontrolledActiveRowId] = (0, import_react31.useState)(
|
|
5394
5805
|
() => defaultActiveRowId ?? getInitialActiveRowId(selectableRows, selectedId)
|
|
5395
5806
|
);
|
|
5396
5807
|
const activeRowId = activeRowIdProp !== void 0 ? activeRowIdProp : uncontrolledActiveRowId;
|
|
5397
5808
|
const resolvedActiveRowId = activeRowId && selectableRows.some((row) => row.id === activeRowId) ? activeRowId : getInitialActiveRowId(selectableRows, selectedId);
|
|
5398
|
-
const templateColumns = (0,
|
|
5809
|
+
const templateColumns = (0, import_react31.useMemo)(() => {
|
|
5399
5810
|
const checkboxColumn = showCheckBox ? "var(--nu-glyph-cell-size)" : null;
|
|
5400
5811
|
const dataColumns = columns.map(
|
|
5401
5812
|
(column) => column.width ?? "minmax(0, 1fr)"
|
|
5402
5813
|
);
|
|
5403
5814
|
return [checkboxColumn, ...dataColumns].filter(Boolean).join(" ");
|
|
5404
5815
|
}, [columns, showCheckBox]);
|
|
5405
|
-
(0,
|
|
5816
|
+
(0, import_react31.useEffect)(() => {
|
|
5406
5817
|
if (!resolvedActiveRowId) {
|
|
5407
5818
|
return;
|
|
5408
5819
|
}
|
|
@@ -5410,13 +5821,13 @@ function ListViewInner({
|
|
|
5410
5821
|
block: "nearest"
|
|
5411
5822
|
});
|
|
5412
5823
|
}, [resolvedActiveRowId]);
|
|
5413
|
-
const registerRowRef = (0,
|
|
5824
|
+
const registerRowRef = (0, import_react31.useCallback)(
|
|
5414
5825
|
(rowId, node) => {
|
|
5415
5826
|
rowRefs.current[rowId] = node;
|
|
5416
5827
|
},
|
|
5417
5828
|
[]
|
|
5418
5829
|
);
|
|
5419
|
-
const updateActiveRow = (0,
|
|
5830
|
+
const updateActiveRow = (0, import_react31.useCallback)(
|
|
5420
5831
|
(row) => {
|
|
5421
5832
|
if (!isActiveControlled) {
|
|
5422
5833
|
setUncontrolledActiveRowId(row.id);
|
|
@@ -5425,7 +5836,7 @@ function ListViewInner({
|
|
|
5425
5836
|
},
|
|
5426
5837
|
[isActiveControlled, onActiveRowChange]
|
|
5427
5838
|
);
|
|
5428
|
-
const activateRowId = (0,
|
|
5839
|
+
const activateRowId = (0, import_react31.useCallback)(
|
|
5429
5840
|
(rowId) => {
|
|
5430
5841
|
if (!rowId) {
|
|
5431
5842
|
return;
|
|
@@ -5464,7 +5875,7 @@ function ListViewInner({
|
|
|
5464
5875
|
function isRowChecked(row) {
|
|
5465
5876
|
return getListViewRowChecked(row, checkedIds);
|
|
5466
5877
|
}
|
|
5467
|
-
const toggleRowCheck = (0,
|
|
5878
|
+
const toggleRowCheck = (0, import_react31.useCallback)(
|
|
5468
5879
|
(rowId) => {
|
|
5469
5880
|
if (!showCheckBox) {
|
|
5470
5881
|
return;
|
|
@@ -5477,7 +5888,7 @@ function ListViewInner({
|
|
|
5477
5888
|
},
|
|
5478
5889
|
[showCheckBox, data, checkedIds, onRowCheckChange]
|
|
5479
5890
|
);
|
|
5480
|
-
(0,
|
|
5891
|
+
(0, import_react31.useImperativeHandle)(
|
|
5481
5892
|
ref,
|
|
5482
5893
|
() => ({
|
|
5483
5894
|
activateRow(rowId) {
|
|
@@ -5533,7 +5944,7 @@ function ListViewInner({
|
|
|
5533
5944
|
break;
|
|
5534
5945
|
}
|
|
5535
5946
|
}
|
|
5536
|
-
return /* @__PURE__ */ (0,
|
|
5947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
5537
5948
|
"div",
|
|
5538
5949
|
{
|
|
5539
5950
|
...props,
|
|
@@ -5544,7 +5955,7 @@ function ListViewInner({
|
|
|
5544
5955
|
role: "grid",
|
|
5545
5956
|
tabIndex: 0,
|
|
5546
5957
|
children: [
|
|
5547
|
-
/* @__PURE__ */ (0,
|
|
5958
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
5548
5959
|
"div",
|
|
5549
5960
|
{
|
|
5550
5961
|
className: "nu-list-view__header",
|
|
@@ -5553,8 +5964,8 @@ function ListViewInner({
|
|
|
5553
5964
|
"--nu-list-view-columns": templateColumns
|
|
5554
5965
|
},
|
|
5555
5966
|
children: [
|
|
5556
|
-
showCheckBox ? /* @__PURE__ */ (0,
|
|
5557
|
-
columns.map((column) => /* @__PURE__ */ (0,
|
|
5967
|
+
showCheckBox ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "nu-list-view__header-cell", role: "columnheader" }) : null,
|
|
5968
|
+
columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5558
5969
|
"span",
|
|
5559
5970
|
{
|
|
5560
5971
|
className: [
|
|
@@ -5570,7 +5981,7 @@ function ListViewInner({
|
|
|
5570
5981
|
]
|
|
5571
5982
|
}
|
|
5572
5983
|
),
|
|
5573
|
-
/* @__PURE__ */ (0,
|
|
5984
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "nu-list-view__body", children: data.length > 0 ? data.map((row) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5574
5985
|
ListViewRow,
|
|
5575
5986
|
{
|
|
5576
5987
|
columns,
|
|
@@ -5587,15 +5998,15 @@ function ListViewInner({
|
|
|
5587
5998
|
uncheckedShape
|
|
5588
5999
|
},
|
|
5589
6000
|
row.id
|
|
5590
|
-
)) : /* @__PURE__ */ (0,
|
|
6001
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "nu-list-view__empty", children: emptyText }) })
|
|
5591
6002
|
]
|
|
5592
6003
|
}
|
|
5593
6004
|
);
|
|
5594
6005
|
}
|
|
5595
|
-
var ListView = (0,
|
|
6006
|
+
var ListView = (0, import_react31.forwardRef)(ListViewInner);
|
|
5596
6007
|
|
|
5597
6008
|
// src/components/MaskedField/MaskedField.tsx
|
|
5598
|
-
var
|
|
6009
|
+
var import_react32 = require("react");
|
|
5599
6010
|
|
|
5600
6011
|
// src/components/MaskedField/textMask.ts
|
|
5601
6012
|
var INFINITE_MASK_REPEAT = Number.POSITIVE_INFINITY;
|
|
@@ -5759,7 +6170,7 @@ function getMaskedFieldState(mask, rawValue) {
|
|
|
5759
6170
|
}
|
|
5760
6171
|
|
|
5761
6172
|
// src/components/MaskedField/MaskedField.tsx
|
|
5762
|
-
var
|
|
6173
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5763
6174
|
function MaskedField({
|
|
5764
6175
|
"aria-invalid": ariaInvalid,
|
|
5765
6176
|
className,
|
|
@@ -5778,12 +6189,12 @@ function MaskedField({
|
|
|
5778
6189
|
style,
|
|
5779
6190
|
...props
|
|
5780
6191
|
}) {
|
|
5781
|
-
const generatedId = (0,
|
|
6192
|
+
const generatedId = (0, import_react32.useId)();
|
|
5782
6193
|
const fieldId = id ?? generatedId;
|
|
5783
6194
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
5784
6195
|
const isControlled = value !== void 0;
|
|
5785
|
-
const hasMountedRef = (0,
|
|
5786
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
6196
|
+
const hasMountedRef = (0, import_react32.useRef)(false);
|
|
6197
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react32.useState)(
|
|
5787
6198
|
() => defaultValue == null ? "" : getMaskedFieldState(mask, String(defaultValue)).formattedValue
|
|
5788
6199
|
);
|
|
5789
6200
|
const rawResolvedValue = isControlled ? value == null ? "" : String(value) : uncontrolledValue;
|
|
@@ -5792,11 +6203,11 @@ function MaskedField({
|
|
|
5792
6203
|
rawResolvedValue
|
|
5793
6204
|
);
|
|
5794
6205
|
const resolvedAriaInvalid = ariaInvalid ?? (isInvalid ? true : void 0);
|
|
5795
|
-
const maskInputMode = (0,
|
|
6206
|
+
const maskInputMode = (0, import_react32.useMemo)(
|
|
5796
6207
|
() => props.inputMode === void 0 ? getTextMaskInputMode(mask) : void 0,
|
|
5797
6208
|
[mask, props.inputMode]
|
|
5798
6209
|
);
|
|
5799
|
-
(0,
|
|
6210
|
+
(0, import_react32.useEffect)(() => {
|
|
5800
6211
|
if (!onDebouncedChange) {
|
|
5801
6212
|
return;
|
|
5802
6213
|
}
|
|
@@ -5831,7 +6242,7 @@ function MaskedField({
|
|
|
5831
6242
|
}
|
|
5832
6243
|
onChange?.(event);
|
|
5833
6244
|
}
|
|
5834
|
-
return /* @__PURE__ */ (0,
|
|
6245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
5835
6246
|
"label",
|
|
5836
6247
|
{
|
|
5837
6248
|
className: cx(
|
|
@@ -5843,7 +6254,7 @@ function MaskedField({
|
|
|
5843
6254
|
htmlFor: fieldId,
|
|
5844
6255
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
5845
6256
|
children: [
|
|
5846
|
-
/* @__PURE__ */ (0,
|
|
6257
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5847
6258
|
"span",
|
|
5848
6259
|
{
|
|
5849
6260
|
className: cx("nu-masked-field__label", slotClassNames?.label),
|
|
@@ -5851,13 +6262,13 @@ function MaskedField({
|
|
|
5851
6262
|
children: renderMnemonicText(label)
|
|
5852
6263
|
}
|
|
5853
6264
|
),
|
|
5854
|
-
/* @__PURE__ */ (0,
|
|
6265
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
5855
6266
|
"span",
|
|
5856
6267
|
{
|
|
5857
6268
|
className: cx("nu-masked-field__slot", slotClassNames?.slot),
|
|
5858
6269
|
style: slotStyles?.slot,
|
|
5859
6270
|
children: [
|
|
5860
|
-
/* @__PURE__ */ (0,
|
|
6271
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5861
6272
|
"span",
|
|
5862
6273
|
{
|
|
5863
6274
|
"aria-hidden": "true",
|
|
@@ -5866,7 +6277,7 @@ function MaskedField({
|
|
|
5866
6277
|
children: "["
|
|
5867
6278
|
}
|
|
5868
6279
|
),
|
|
5869
|
-
/* @__PURE__ */ (0,
|
|
6280
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5870
6281
|
"span",
|
|
5871
6282
|
{
|
|
5872
6283
|
className: cx(
|
|
@@ -5874,7 +6285,7 @@ function MaskedField({
|
|
|
5874
6285
|
slotClassNames?.inputShell
|
|
5875
6286
|
),
|
|
5876
6287
|
style: slotStyles?.inputShell,
|
|
5877
|
-
children: /* @__PURE__ */ (0,
|
|
6288
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5878
6289
|
"input",
|
|
5879
6290
|
{
|
|
5880
6291
|
...props,
|
|
@@ -5892,7 +6303,7 @@ function MaskedField({
|
|
|
5892
6303
|
)
|
|
5893
6304
|
}
|
|
5894
6305
|
),
|
|
5895
|
-
/* @__PURE__ */ (0,
|
|
6306
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5896
6307
|
"span",
|
|
5897
6308
|
{
|
|
5898
6309
|
"aria-hidden": "true",
|
|
@@ -5904,7 +6315,7 @@ function MaskedField({
|
|
|
5904
6315
|
]
|
|
5905
6316
|
}
|
|
5906
6317
|
),
|
|
5907
|
-
hint ? /* @__PURE__ */ (0,
|
|
6318
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5908
6319
|
"span",
|
|
5909
6320
|
{
|
|
5910
6321
|
className: cx("nu-masked-field__hint", slotClassNames?.hint),
|
|
@@ -5919,8 +6330,8 @@ function MaskedField({
|
|
|
5919
6330
|
}
|
|
5920
6331
|
|
|
5921
6332
|
// src/components/Memo/Memo.tsx
|
|
5922
|
-
var
|
|
5923
|
-
var
|
|
6333
|
+
var import_react33 = require("react");
|
|
6334
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5924
6335
|
function Memo({
|
|
5925
6336
|
background,
|
|
5926
6337
|
className,
|
|
@@ -5940,7 +6351,7 @@ function Memo({
|
|
|
5940
6351
|
const isControlled = value !== void 0;
|
|
5941
6352
|
const resolvedInitialValue = defaultValue == null ? content ?? "" : String(defaultValue);
|
|
5942
6353
|
const resolvedValue = value == null ? "" : Array.isArray(value) ? value.join("\n") : String(value);
|
|
5943
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
6354
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react33.useState)(
|
|
5944
6355
|
() => resolvedInitialValue
|
|
5945
6356
|
);
|
|
5946
6357
|
function handleChange(event) {
|
|
@@ -5950,7 +6361,7 @@ function Memo({
|
|
|
5950
6361
|
onValueChange?.(event.target.value);
|
|
5951
6362
|
onChange?.(event);
|
|
5952
6363
|
}
|
|
5953
|
-
return /* @__PURE__ */ (0,
|
|
6364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5954
6365
|
"div",
|
|
5955
6366
|
{
|
|
5956
6367
|
className: ["nu-memo", className].filter(Boolean).join(" "),
|
|
@@ -5963,7 +6374,7 @@ function Memo({
|
|
|
5963
6374
|
"--nu-memo-focus-text": focusTextColor,
|
|
5964
6375
|
"--nu-memo-text": textColor
|
|
5965
6376
|
},
|
|
5966
|
-
children: /* @__PURE__ */ (0,
|
|
6377
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "nu-memo__viewport", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5967
6378
|
"textarea",
|
|
5968
6379
|
{
|
|
5969
6380
|
...props,
|
|
@@ -5977,8 +6388,8 @@ function Memo({
|
|
|
5977
6388
|
}
|
|
5978
6389
|
|
|
5979
6390
|
// src/components/PageControl/PageControl.tsx
|
|
5980
|
-
var
|
|
5981
|
-
var
|
|
6391
|
+
var import_react34 = require("react");
|
|
6392
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5982
6393
|
function PageControl({
|
|
5983
6394
|
activePageId: activePageIdProp,
|
|
5984
6395
|
className,
|
|
@@ -5990,14 +6401,14 @@ function PageControl({
|
|
|
5990
6401
|
slotStyles,
|
|
5991
6402
|
...props
|
|
5992
6403
|
}) {
|
|
5993
|
-
const generatedId = (0,
|
|
6404
|
+
const generatedId = (0, import_react34.useId)();
|
|
5994
6405
|
const isControlled = activePageIdProp !== void 0;
|
|
5995
|
-
const tabRefs = (0,
|
|
5996
|
-
const [uncontrolledActivePageId, setUncontrolledActivePageId] = (0,
|
|
6406
|
+
const tabRefs = (0, import_react34.useRef)({});
|
|
6407
|
+
const [uncontrolledActivePageId, setUncontrolledActivePageId] = (0, import_react34.useState)(
|
|
5997
6408
|
() => defaultActivePageId ?? pages.find((page) => !page.disabled)?.id ?? pages[0]?.id
|
|
5998
6409
|
);
|
|
5999
6410
|
const activePageId = isControlled ? activePageIdProp : uncontrolledActivePageId;
|
|
6000
|
-
const resolvedActivePage = (0,
|
|
6411
|
+
const resolvedActivePage = (0, import_react34.useMemo)(() => {
|
|
6001
6412
|
const byId = pages.find(
|
|
6002
6413
|
(page) => page.id === activePageId && !page.disabled
|
|
6003
6414
|
);
|
|
@@ -6063,7 +6474,7 @@ function PageControl({
|
|
|
6063
6474
|
break;
|
|
6064
6475
|
}
|
|
6065
6476
|
}
|
|
6066
|
-
return /* @__PURE__ */ (0,
|
|
6477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
6067
6478
|
"div",
|
|
6068
6479
|
{
|
|
6069
6480
|
...props,
|
|
@@ -6074,7 +6485,7 @@ function PageControl({
|
|
|
6074
6485
|
slotStyles?.root
|
|
6075
6486
|
),
|
|
6076
6487
|
children: [
|
|
6077
|
-
/* @__PURE__ */ (0,
|
|
6488
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6078
6489
|
"div",
|
|
6079
6490
|
{
|
|
6080
6491
|
className: cx("nu-page-control__tabs", slotClassNames?.tabs),
|
|
@@ -6085,7 +6496,7 @@ function PageControl({
|
|
|
6085
6496
|
const isActive = page.id === resolvedActivePage?.id;
|
|
6086
6497
|
const panelId = `${generatedId}-panel-${page.id}`;
|
|
6087
6498
|
const tabId = `${generatedId}-tab-${page.id}`;
|
|
6088
|
-
return /* @__PURE__ */ (0,
|
|
6499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6089
6500
|
"button",
|
|
6090
6501
|
{
|
|
6091
6502
|
"aria-controls": panelId,
|
|
@@ -6109,7 +6520,7 @@ function PageControl({
|
|
|
6109
6520
|
})
|
|
6110
6521
|
}
|
|
6111
6522
|
),
|
|
6112
|
-
/* @__PURE__ */ (0,
|
|
6523
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6113
6524
|
"div",
|
|
6114
6525
|
{
|
|
6115
6526
|
"aria-labelledby": resolvedActivePage ? `${generatedId}-tab-${resolvedActivePage.id}` : void 0,
|
|
@@ -6126,7 +6537,7 @@ function PageControl({
|
|
|
6126
6537
|
}
|
|
6127
6538
|
|
|
6128
6539
|
// src/components/Panel/Panel.tsx
|
|
6129
|
-
var
|
|
6540
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
6130
6541
|
function Panel({
|
|
6131
6542
|
children,
|
|
6132
6543
|
className,
|
|
@@ -6137,14 +6548,14 @@ function Panel({
|
|
|
6137
6548
|
title,
|
|
6138
6549
|
...props
|
|
6139
6550
|
}) {
|
|
6140
|
-
return /* @__PURE__ */ (0,
|
|
6551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
6141
6552
|
"section",
|
|
6142
6553
|
{
|
|
6143
6554
|
...props,
|
|
6144
6555
|
className: cx("nu-panel", slotClassNames?.root, className),
|
|
6145
6556
|
style: mergeSlotStyle(props.style, slotStyles?.root),
|
|
6146
6557
|
children: [
|
|
6147
|
-
title ? /* @__PURE__ */ (0,
|
|
6558
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6148
6559
|
"header",
|
|
6149
6560
|
{
|
|
6150
6561
|
className: cx("nu-panel__header", slotClassNames?.header),
|
|
@@ -6152,7 +6563,7 @@ function Panel({
|
|
|
6152
6563
|
children: renderMnemonicText(title)
|
|
6153
6564
|
}
|
|
6154
6565
|
) : null,
|
|
6155
|
-
/* @__PURE__ */ (0,
|
|
6566
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6156
6567
|
"div",
|
|
6157
6568
|
{
|
|
6158
6569
|
className: cx(
|
|
@@ -6164,7 +6575,7 @@ function Panel({
|
|
|
6164
6575
|
children
|
|
6165
6576
|
}
|
|
6166
6577
|
),
|
|
6167
|
-
footer ? /* @__PURE__ */ (0,
|
|
6578
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6168
6579
|
"footer",
|
|
6169
6580
|
{
|
|
6170
6581
|
className: cx("nu-panel__footer", slotClassNames?.footer),
|
|
@@ -6178,8 +6589,8 @@ function Panel({
|
|
|
6178
6589
|
}
|
|
6179
6590
|
|
|
6180
6591
|
// src/components/PropertyGrid/PropertyGrid.tsx
|
|
6181
|
-
var
|
|
6182
|
-
var
|
|
6592
|
+
var import_react35 = require("react");
|
|
6593
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
6183
6594
|
function collectGroupIds(entries) {
|
|
6184
6595
|
const groupIds = /* @__PURE__ */ new Set();
|
|
6185
6596
|
function visit(nextEntries) {
|
|
@@ -6286,25 +6697,25 @@ function PropertyGrid({
|
|
|
6286
6697
|
style,
|
|
6287
6698
|
...props
|
|
6288
6699
|
}) {
|
|
6289
|
-
const editorIdPrefix = (0,
|
|
6290
|
-
const rowButtonRefs = (0,
|
|
6291
|
-
const groupIds = (0,
|
|
6700
|
+
const editorIdPrefix = (0, import_react35.useId)();
|
|
6701
|
+
const rowButtonRefs = (0, import_react35.useRef)({});
|
|
6702
|
+
const groupIds = (0, import_react35.useMemo)(() => collectGroupIds(entries), [entries]);
|
|
6292
6703
|
const isExpandedControlled = expandedIdsProp !== void 0;
|
|
6293
6704
|
const isActiveControlled = activeIdProp !== void 0;
|
|
6294
|
-
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = (0,
|
|
6705
|
+
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = (0, import_react35.useState)(() => getInitialExpandedIds(entries, defaultExpandedIds));
|
|
6295
6706
|
const resolvedExpandedIds = expandedIdsProp ?? uncontrolledExpandedIds;
|
|
6296
|
-
const expandedIdSet = (0,
|
|
6707
|
+
const expandedIdSet = (0, import_react35.useMemo)(
|
|
6297
6708
|
() => new Set(
|
|
6298
6709
|
resolvedExpandedIds.filter((expandedId) => groupIds.has(expandedId))
|
|
6299
6710
|
),
|
|
6300
6711
|
[groupIds, resolvedExpandedIds]
|
|
6301
6712
|
);
|
|
6302
|
-
const rows = (0,
|
|
6713
|
+
const rows = (0, import_react35.useMemo)(
|
|
6303
6714
|
() => collectVisibleRows(entries, expandedIdSet),
|
|
6304
6715
|
[entries, expandedIdSet]
|
|
6305
6716
|
);
|
|
6306
|
-
const interactiveRows = (0,
|
|
6307
|
-
const [uncontrolledActiveId, setUncontrolledActiveId] = (0,
|
|
6717
|
+
const interactiveRows = (0, import_react35.useMemo)(() => collectInteractiveRows(rows), [rows]);
|
|
6718
|
+
const [uncontrolledActiveId, setUncontrolledActiveId] = (0, import_react35.useState)(() => getInitialActiveId2(interactiveRows, defaultActiveId));
|
|
6308
6719
|
const requestedActiveId = isActiveControlled ? activeIdProp : uncontrolledActiveId;
|
|
6309
6720
|
const resolvedActiveId = requestedActiveId && interactiveRows.some((row) => row.id === requestedActiveId) ? requestedActiveId : interactiveRows[0]?.id;
|
|
6310
6721
|
function updateExpandedIds(nextExpandedIds) {
|
|
@@ -6423,7 +6834,7 @@ function PropertyGrid({
|
|
|
6423
6834
|
const nextExpandedIds = expandedIdSet.has(entry.id) ? resolvedExpandedIds.filter((expandedId) => expandedId !== entry.id) : [...resolvedExpandedIds, entry.id];
|
|
6424
6835
|
updateExpandedIds(nextExpandedIds);
|
|
6425
6836
|
}
|
|
6426
|
-
return /* @__PURE__ */ (0,
|
|
6837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6427
6838
|
"div",
|
|
6428
6839
|
{
|
|
6429
6840
|
...props,
|
|
@@ -6434,13 +6845,13 @@ function PropertyGrid({
|
|
|
6434
6845
|
...style,
|
|
6435
6846
|
"--nu-property-grid-label-width": labelWidth
|
|
6436
6847
|
},
|
|
6437
|
-
children: /* @__PURE__ */ (0,
|
|
6848
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "nu-property-grid__body", children: rows.map((row) => {
|
|
6438
6849
|
if (row.type === "section") {
|
|
6439
|
-
return /* @__PURE__ */ (0,
|
|
6850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "nu-property-grid__section", children: renderMnemonicText(row.entry.title) }, row.entry.id);
|
|
6440
6851
|
}
|
|
6441
6852
|
if (row.type === "group") {
|
|
6442
6853
|
const isExpanded = expandedIdSet.has(row.entry.id);
|
|
6443
|
-
return /* @__PURE__ */ (0,
|
|
6854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
6444
6855
|
"div",
|
|
6445
6856
|
{
|
|
6446
6857
|
className: "nu-property-grid__row",
|
|
@@ -6449,7 +6860,7 @@ function PropertyGrid({
|
|
|
6449
6860
|
"data-expanded": isExpanded || void 0,
|
|
6450
6861
|
"data-group": true,
|
|
6451
6862
|
children: [
|
|
6452
|
-
/* @__PURE__ */ (0,
|
|
6863
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6453
6864
|
"button",
|
|
6454
6865
|
{
|
|
6455
6866
|
className: "nu-property-grid__label nu-property-grid__label-button",
|
|
@@ -6469,32 +6880,32 @@ function PropertyGrid({
|
|
|
6469
6880
|
"--nu-property-grid-depth": row.depth
|
|
6470
6881
|
},
|
|
6471
6882
|
type: "button",
|
|
6472
|
-
children: /* @__PURE__ */ (0,
|
|
6473
|
-
/* @__PURE__ */ (0,
|
|
6883
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "nu-property-grid__lead", children: [
|
|
6884
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "nu-property-grid__expander", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6474
6885
|
NuGlyph,
|
|
6475
6886
|
{
|
|
6476
6887
|
name: isExpanded ? "tree-caret-down" : "tree-caret-right"
|
|
6477
6888
|
}
|
|
6478
6889
|
) }),
|
|
6479
|
-
/* @__PURE__ */ (0,
|
|
6890
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "nu-property-grid__label-text", children: renderMnemonicText(row.entry.label) })
|
|
6480
6891
|
] })
|
|
6481
6892
|
}
|
|
6482
6893
|
),
|
|
6483
|
-
/* @__PURE__ */ (0,
|
|
6894
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "nu-property-grid__editor", children: row.entry.summary ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "nu-property-grid__control", children: row.entry.summary }) : null })
|
|
6484
6895
|
]
|
|
6485
6896
|
},
|
|
6486
6897
|
row.entry.id
|
|
6487
6898
|
);
|
|
6488
6899
|
}
|
|
6489
6900
|
const editorId = `${editorIdPrefix}-editor-${row.entry.id}`;
|
|
6490
|
-
return /* @__PURE__ */ (0,
|
|
6901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
6491
6902
|
"div",
|
|
6492
6903
|
{
|
|
6493
6904
|
className: "nu-property-grid__row",
|
|
6494
6905
|
"data-active": resolvedActiveId === row.entry.id || void 0,
|
|
6495
6906
|
"data-disabled": row.entry.disabled || void 0,
|
|
6496
6907
|
children: [
|
|
6497
|
-
/* @__PURE__ */ (0,
|
|
6908
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6498
6909
|
"button",
|
|
6499
6910
|
{
|
|
6500
6911
|
className: "nu-property-grid__label nu-property-grid__label-button",
|
|
@@ -6514,21 +6925,21 @@ function PropertyGrid({
|
|
|
6514
6925
|
"--nu-property-grid-depth": row.depth
|
|
6515
6926
|
},
|
|
6516
6927
|
type: "button",
|
|
6517
|
-
children: /* @__PURE__ */ (0,
|
|
6518
|
-
/* @__PURE__ */ (0,
|
|
6519
|
-
/* @__PURE__ */ (0,
|
|
6928
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "nu-property-grid__lead", children: [
|
|
6929
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "nu-property-grid__expander-placeholder" }),
|
|
6930
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "nu-property-grid__label-text", children: renderMnemonicText(row.entry.label) })
|
|
6520
6931
|
] })
|
|
6521
6932
|
}
|
|
6522
6933
|
),
|
|
6523
|
-
/* @__PURE__ */ (0,
|
|
6934
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
6524
6935
|
"div",
|
|
6525
6936
|
{
|
|
6526
6937
|
className: "nu-property-grid__editor",
|
|
6527
6938
|
id: editorId,
|
|
6528
6939
|
onFocusCapture: () => updateActiveId(row.entry.id),
|
|
6529
6940
|
children: [
|
|
6530
|
-
/* @__PURE__ */ (0,
|
|
6531
|
-
row.entry.hint ? /* @__PURE__ */ (0,
|
|
6941
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "nu-property-grid__control", children: row.entry.content }),
|
|
6942
|
+
row.entry.hint ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "nu-property-grid__hint", children: row.entry.hint }) : null
|
|
6532
6943
|
]
|
|
6533
6944
|
}
|
|
6534
6945
|
)
|
|
@@ -6542,8 +6953,8 @@ function PropertyGrid({
|
|
|
6542
6953
|
}
|
|
6543
6954
|
|
|
6544
6955
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
6545
|
-
var
|
|
6546
|
-
function
|
|
6956
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
6957
|
+
function clamp3(value, min, max) {
|
|
6547
6958
|
return Math.min(max, Math.max(min, value));
|
|
6548
6959
|
}
|
|
6549
6960
|
function ProgressBar({
|
|
@@ -6563,10 +6974,10 @@ function ProgressBar({
|
|
|
6563
6974
|
...props
|
|
6564
6975
|
}) {
|
|
6565
6976
|
const safeMax = max <= min ? min + 1 : max;
|
|
6566
|
-
const clampedValue =
|
|
6977
|
+
const clampedValue = clamp3(value, min, safeMax);
|
|
6567
6978
|
const percent = Math.round((clampedValue - min) / (safeMax - min) * 100);
|
|
6568
6979
|
const renderedValue = valueRenderer ? valueRenderer(percent, clampedValue, min, safeMax) : `${percent}%`;
|
|
6569
|
-
return /* @__PURE__ */ (0,
|
|
6980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
6570
6981
|
"div",
|
|
6571
6982
|
{
|
|
6572
6983
|
...props,
|
|
@@ -6578,7 +6989,7 @@ function ProgressBar({
|
|
|
6578
6989
|
role: "progressbar",
|
|
6579
6990
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
6580
6991
|
children: [
|
|
6581
|
-
label ? /* @__PURE__ */ (0,
|
|
6992
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6582
6993
|
"span",
|
|
6583
6994
|
{
|
|
6584
6995
|
className: cx("nu-progress-bar__label", slotClassNames?.label),
|
|
@@ -6586,7 +6997,7 @@ function ProgressBar({
|
|
|
6586
6997
|
children: renderMnemonicText(label)
|
|
6587
6998
|
}
|
|
6588
6999
|
) : null,
|
|
6589
|
-
/* @__PURE__ */ (0,
|
|
7000
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
6590
7001
|
"div",
|
|
6591
7002
|
{
|
|
6592
7003
|
className: cx("nu-progress-bar__track", slotClassNames?.track),
|
|
@@ -6597,7 +7008,7 @@ function ProgressBar({
|
|
|
6597
7008
|
slotStyles?.track
|
|
6598
7009
|
),
|
|
6599
7010
|
children: [
|
|
6600
|
-
/* @__PURE__ */ (0,
|
|
7011
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6601
7012
|
"div",
|
|
6602
7013
|
{
|
|
6603
7014
|
className: cx("nu-progress-bar__fill", slotClassNames?.fill),
|
|
@@ -6610,7 +7021,7 @@ function ProgressBar({
|
|
|
6610
7021
|
)
|
|
6611
7022
|
}
|
|
6612
7023
|
),
|
|
6613
|
-
showValue ? /* @__PURE__ */ (0,
|
|
7024
|
+
showValue ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6614
7025
|
"span",
|
|
6615
7026
|
{
|
|
6616
7027
|
className: cx("nu-progress-bar__value", slotClassNames?.value),
|
|
@@ -6621,7 +7032,7 @@ function ProgressBar({
|
|
|
6621
7032
|
]
|
|
6622
7033
|
}
|
|
6623
7034
|
),
|
|
6624
|
-
hint ? /* @__PURE__ */ (0,
|
|
7035
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6625
7036
|
"span",
|
|
6626
7037
|
{
|
|
6627
7038
|
className: cx("nu-progress-bar__hint", slotClassNames?.hint),
|
|
@@ -6635,8 +7046,8 @@ function ProgressBar({
|
|
|
6635
7046
|
}
|
|
6636
7047
|
|
|
6637
7048
|
// src/components/RadioGroup/RadioButton.tsx
|
|
6638
|
-
var
|
|
6639
|
-
var
|
|
7049
|
+
var import_react36 = require("react");
|
|
7050
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
6640
7051
|
function RadioButton({
|
|
6641
7052
|
checked,
|
|
6642
7053
|
className,
|
|
@@ -6648,11 +7059,11 @@ function RadioButton({
|
|
|
6648
7059
|
onCheckedChange,
|
|
6649
7060
|
...props
|
|
6650
7061
|
}) {
|
|
6651
|
-
const generatedId = (0,
|
|
7062
|
+
const generatedId = (0, import_react36.useId)();
|
|
6652
7063
|
const inputId = id ?? generatedId;
|
|
6653
7064
|
const hintId = hint ? `${inputId}-hint` : void 0;
|
|
6654
7065
|
const isControlled = checked !== void 0;
|
|
6655
|
-
const [uncontrolledChecked, setUncontrolledChecked] = (0,
|
|
7066
|
+
const [uncontrolledChecked, setUncontrolledChecked] = (0, import_react36.useState)(defaultChecked);
|
|
6656
7067
|
const resolvedChecked = isControlled ? checked : uncontrolledChecked;
|
|
6657
7068
|
function handleChange(event) {
|
|
6658
7069
|
if (!isControlled) {
|
|
@@ -6660,9 +7071,9 @@ function RadioButton({
|
|
|
6660
7071
|
}
|
|
6661
7072
|
onCheckedChange?.(event.target.checked, event);
|
|
6662
7073
|
}
|
|
6663
|
-
return /* @__PURE__ */ (0,
|
|
6664
|
-
/* @__PURE__ */ (0,
|
|
6665
|
-
/* @__PURE__ */ (0,
|
|
7074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: ["nu-radio-button", className].filter(Boolean).join(" "), children: [
|
|
7075
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "nu-radio-button__main", children: [
|
|
7076
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6666
7077
|
"input",
|
|
6667
7078
|
{
|
|
6668
7079
|
...props,
|
|
@@ -6675,19 +7086,19 @@ function RadioButton({
|
|
|
6675
7086
|
type: "radio"
|
|
6676
7087
|
}
|
|
6677
7088
|
),
|
|
6678
|
-
/* @__PURE__ */ (0,
|
|
6679
|
-
/* @__PURE__ */ (0,
|
|
6680
|
-
resolvedChecked ? /* @__PURE__ */ (0,
|
|
7089
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { "aria-hidden": "true", className: "nu-radio-button__control", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "nu-radio-button__disc", children: [
|
|
7090
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(NuGlyph, { className: "nu-radio-button__ring", name: "radio-ring" }),
|
|
7091
|
+
resolvedChecked ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(NuGlyph, { className: "nu-radio-button__fill", name: "radio-fill" }) : null
|
|
6681
7092
|
] }) }),
|
|
6682
|
-
/* @__PURE__ */ (0,
|
|
7093
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "nu-radio-button__label", children: renderMnemonicText(label) })
|
|
6683
7094
|
] }),
|
|
6684
|
-
hint ? /* @__PURE__ */ (0,
|
|
7095
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "nu-radio-button__hint", id: hintId, children: hint }) : null
|
|
6685
7096
|
] });
|
|
6686
7097
|
}
|
|
6687
7098
|
|
|
6688
7099
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
6689
|
-
var
|
|
6690
|
-
var
|
|
7100
|
+
var import_react37 = require("react");
|
|
7101
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
6691
7102
|
function RadioGroup({
|
|
6692
7103
|
className,
|
|
6693
7104
|
defaultValue,
|
|
@@ -6702,11 +7113,11 @@ function RadioGroup({
|
|
|
6702
7113
|
value,
|
|
6703
7114
|
...props
|
|
6704
7115
|
}) {
|
|
6705
|
-
const generatedId = (0,
|
|
7116
|
+
const generatedId = (0, import_react37.useId)();
|
|
6706
7117
|
const groupName = name ?? generatedId;
|
|
6707
7118
|
const hintId = hint ? `${groupName}-hint` : void 0;
|
|
6708
7119
|
const isControlled = value !== void 0;
|
|
6709
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
7120
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react37.useState)(defaultValue ?? options[0]?.value);
|
|
6710
7121
|
const resolvedValue = isControlled ? value : uncontrolledValue;
|
|
6711
7122
|
function commitValue(nextValue) {
|
|
6712
7123
|
if (!isControlled) {
|
|
@@ -6714,7 +7125,7 @@ function RadioGroup({
|
|
|
6714
7125
|
}
|
|
6715
7126
|
onValueChange?.(nextValue);
|
|
6716
7127
|
}
|
|
6717
|
-
return /* @__PURE__ */ (0,
|
|
7128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
6718
7129
|
"fieldset",
|
|
6719
7130
|
{
|
|
6720
7131
|
...props,
|
|
@@ -6722,7 +7133,7 @@ function RadioGroup({
|
|
|
6722
7133
|
className: cx("nu-radio-group", slotClassNames?.root, className),
|
|
6723
7134
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
6724
7135
|
children: [
|
|
6725
|
-
label ? /* @__PURE__ */ (0,
|
|
7136
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6726
7137
|
"legend",
|
|
6727
7138
|
{
|
|
6728
7139
|
className: cx("nu-radio-group__label", slotClassNames?.label),
|
|
@@ -6730,12 +7141,12 @@ function RadioGroup({
|
|
|
6730
7141
|
children: renderMnemonicText(label)
|
|
6731
7142
|
}
|
|
6732
7143
|
) : null,
|
|
6733
|
-
/* @__PURE__ */ (0,
|
|
7144
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6734
7145
|
"div",
|
|
6735
7146
|
{
|
|
6736
7147
|
className: cx("nu-radio-group__options", slotClassNames?.options),
|
|
6737
7148
|
style: slotStyles?.options,
|
|
6738
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
7149
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6739
7150
|
RadioButton,
|
|
6740
7151
|
{
|
|
6741
7152
|
checked: resolvedValue === option.value,
|
|
@@ -6754,7 +7165,7 @@ function RadioGroup({
|
|
|
6754
7165
|
))
|
|
6755
7166
|
}
|
|
6756
7167
|
),
|
|
6757
|
-
hint ? /* @__PURE__ */ (0,
|
|
7168
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6758
7169
|
"span",
|
|
6759
7170
|
{
|
|
6760
7171
|
className: cx("nu-radio-group__hint", slotClassNames?.hint),
|
|
@@ -6769,14 +7180,14 @@ function RadioGroup({
|
|
|
6769
7180
|
}
|
|
6770
7181
|
|
|
6771
7182
|
// src/components/ReportCell/ReportCell.tsx
|
|
6772
|
-
var
|
|
7183
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6773
7184
|
function ReportCell({
|
|
6774
7185
|
align = "start",
|
|
6775
7186
|
className,
|
|
6776
7187
|
tone = "default",
|
|
6777
7188
|
...props
|
|
6778
7189
|
}) {
|
|
6779
|
-
return /* @__PURE__ */ (0,
|
|
7190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6780
7191
|
"span",
|
|
6781
7192
|
{
|
|
6782
7193
|
...props,
|
|
@@ -6791,9 +7202,9 @@ function ReportCell({
|
|
|
6791
7202
|
}
|
|
6792
7203
|
|
|
6793
7204
|
// src/components/SearchBox/SearchBox.tsx
|
|
6794
|
-
var
|
|
7205
|
+
var import_react38 = require("react");
|
|
6795
7206
|
var import_react_dom4 = require("react-dom");
|
|
6796
|
-
var
|
|
7207
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
6797
7208
|
function resolveSearchBoxPortalRoot() {
|
|
6798
7209
|
return document.body;
|
|
6799
7210
|
}
|
|
@@ -6821,24 +7232,24 @@ function SearchBox({
|
|
|
6821
7232
|
style,
|
|
6822
7233
|
...props
|
|
6823
7234
|
}) {
|
|
6824
|
-
const rootRef = (0,
|
|
6825
|
-
const fieldRef = (0,
|
|
6826
|
-
const inputRef = (0,
|
|
6827
|
-
const popupRef = (0,
|
|
6828
|
-
const requestIdRef = (0,
|
|
6829
|
-
const generatedId = (0,
|
|
7235
|
+
const rootRef = (0, import_react38.useRef)(null);
|
|
7236
|
+
const fieldRef = (0, import_react38.useRef)(null);
|
|
7237
|
+
const inputRef = (0, import_react38.useRef)(null);
|
|
7238
|
+
const popupRef = (0, import_react38.useRef)(null);
|
|
7239
|
+
const requestIdRef = (0, import_react38.useRef)(0);
|
|
7240
|
+
const generatedId = (0, import_react38.useId)();
|
|
6830
7241
|
const fieldId = `${generatedId}-search-box`;
|
|
6831
7242
|
const labelId = `${fieldId}-label`;
|
|
6832
7243
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
6833
7244
|
const isQueryControlled = queryProp !== void 0;
|
|
6834
|
-
const [uncontrolledQuery, setUncontrolledQuery] = (0,
|
|
6835
|
-
const [open, setOpen] = (0,
|
|
6836
|
-
const [status, setStatus] = (0,
|
|
6837
|
-
const [results, setResults] = (0,
|
|
6838
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
7245
|
+
const [uncontrolledQuery, setUncontrolledQuery] = (0, import_react38.useState)(defaultQuery);
|
|
7246
|
+
const [open, setOpen] = (0, import_react38.useState)(false);
|
|
7247
|
+
const [status, setStatus] = (0, import_react38.useState)("idle");
|
|
7248
|
+
const [results, setResults] = (0, import_react38.useState)([]);
|
|
7249
|
+
const [selectedValue, setSelectedValue] = (0, import_react38.useState)(null);
|
|
6839
7250
|
const normalizedQuery = (isQueryControlled ? queryProp : uncontrolledQuery) ?? "";
|
|
6840
7251
|
const trimmedQuery = normalizedQuery.trim();
|
|
6841
|
-
const resultOptions = (0,
|
|
7252
|
+
const resultOptions = (0, import_react38.useMemo)(() => {
|
|
6842
7253
|
return results.map((item, index) => ({
|
|
6843
7254
|
item,
|
|
6844
7255
|
listBoxItem: {
|
|
@@ -6852,7 +7263,7 @@ function SearchBox({
|
|
|
6852
7263
|
value: getItemId(item, index)
|
|
6853
7264
|
}));
|
|
6854
7265
|
}, [getItemDetails, getItemDisabled, getItemId, getItemText, results]);
|
|
6855
|
-
const listBoxData = (0,
|
|
7266
|
+
const listBoxData = (0, import_react38.useMemo)(
|
|
6856
7267
|
() => [
|
|
6857
7268
|
{
|
|
6858
7269
|
category: null,
|
|
@@ -6862,8 +7273,8 @@ function SearchBox({
|
|
|
6862
7273
|
[resultOptions]
|
|
6863
7274
|
);
|
|
6864
7275
|
const popupRoot = typeof document === "undefined" ? null : resolveSearchBoxPortalRoot();
|
|
6865
|
-
const [themePortalStyle, setThemePortalStyle] = (0,
|
|
6866
|
-
(0,
|
|
7276
|
+
const [themePortalStyle, setThemePortalStyle] = (0, import_react38.useState)(() => void 0);
|
|
7277
|
+
(0, import_react38.useEffect)(() => {
|
|
6867
7278
|
if (disabled) {
|
|
6868
7279
|
return;
|
|
6869
7280
|
}
|
|
@@ -6895,7 +7306,7 @@ function SearchBox({
|
|
|
6895
7306
|
popupRef,
|
|
6896
7307
|
portalRoot: popupRoot
|
|
6897
7308
|
});
|
|
6898
|
-
(0,
|
|
7309
|
+
(0, import_react38.useEffect)(() => {
|
|
6899
7310
|
if (disabled || !open) {
|
|
6900
7311
|
return;
|
|
6901
7312
|
}
|
|
@@ -6943,15 +7354,15 @@ function SearchBox({
|
|
|
6943
7354
|
}
|
|
6944
7355
|
function renderPopupContent() {
|
|
6945
7356
|
if (status === "loading") {
|
|
6946
|
-
return /* @__PURE__ */ (0,
|
|
7357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "nu-search-box__status", children: loadingText });
|
|
6947
7358
|
}
|
|
6948
7359
|
if (status === "error") {
|
|
6949
|
-
return /* @__PURE__ */ (0,
|
|
7360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "nu-search-box__status", children: errorText });
|
|
6950
7361
|
}
|
|
6951
7362
|
if (trimmedQuery.length < minQueryLength) {
|
|
6952
|
-
return /* @__PURE__ */ (0,
|
|
7363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "nu-search-box__status", children: idleText });
|
|
6953
7364
|
}
|
|
6954
|
-
return /* @__PURE__ */ (0,
|
|
7365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "nu-search-box__listbox", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6955
7366
|
ListBox,
|
|
6956
7367
|
{
|
|
6957
7368
|
data: listBoxData,
|
|
@@ -6988,7 +7399,7 @@ function SearchBox({
|
|
|
6988
7399
|
break;
|
|
6989
7400
|
}
|
|
6990
7401
|
}
|
|
6991
|
-
return /* @__PURE__ */ (0,
|
|
7402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
6992
7403
|
"div",
|
|
6993
7404
|
{
|
|
6994
7405
|
...props,
|
|
@@ -6996,10 +7407,10 @@ function SearchBox({
|
|
|
6996
7407
|
ref: rootRef,
|
|
6997
7408
|
style,
|
|
6998
7409
|
children: [
|
|
6999
|
-
/* @__PURE__ */ (0,
|
|
7000
|
-
/* @__PURE__ */ (0,
|
|
7001
|
-
/* @__PURE__ */ (0,
|
|
7002
|
-
/* @__PURE__ */ (0,
|
|
7410
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("label", { className: "nu-search-box__label", htmlFor: fieldId, id: labelId, children: renderMnemonicText(label) }),
|
|
7411
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "nu-search-box__slot", ref: fieldRef, children: [
|
|
7412
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { "aria-hidden": "true", className: "nu-search-box__bracket", children: "[" }),
|
|
7413
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "nu-search-box__input-shell", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7003
7414
|
"input",
|
|
7004
7415
|
{
|
|
7005
7416
|
"aria-autocomplete": "list",
|
|
@@ -7024,11 +7435,11 @@ function SearchBox({
|
|
|
7024
7435
|
value: normalizedQuery
|
|
7025
7436
|
}
|
|
7026
7437
|
) }),
|
|
7027
|
-
/* @__PURE__ */ (0,
|
|
7438
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { "aria-hidden": "true", className: "nu-search-box__bracket", children: "]" })
|
|
7028
7439
|
] }),
|
|
7029
|
-
hint ? /* @__PURE__ */ (0,
|
|
7440
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "nu-search-box__hint", id: hintId, children: hint }) : null,
|
|
7030
7441
|
open && popupRoot ? (0, import_react_dom4.createPortal)(
|
|
7031
|
-
/* @__PURE__ */ (0,
|
|
7442
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7032
7443
|
"div",
|
|
7033
7444
|
{
|
|
7034
7445
|
className: "nu-search-box__popup",
|
|
@@ -7046,8 +7457,8 @@ function SearchBox({
|
|
|
7046
7457
|
}
|
|
7047
7458
|
|
|
7048
7459
|
// src/components/SpinBox/SpinBox.tsx
|
|
7049
|
-
var
|
|
7050
|
-
var
|
|
7460
|
+
var import_react39 = require("react");
|
|
7461
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
7051
7462
|
function clampSpinValue(value, min, max) {
|
|
7052
7463
|
let nextValue = value;
|
|
7053
7464
|
if (min !== void 0) {
|
|
@@ -7088,7 +7499,7 @@ function SpinBox({
|
|
|
7088
7499
|
value,
|
|
7089
7500
|
...props
|
|
7090
7501
|
}) {
|
|
7091
|
-
const generatedId = (0,
|
|
7502
|
+
const generatedId = (0, import_react39.useId)();
|
|
7092
7503
|
const fieldId = id ?? generatedId;
|
|
7093
7504
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
7094
7505
|
const isControlled = value !== void 0;
|
|
@@ -7097,9 +7508,9 @@ function SpinBox({
|
|
|
7097
7508
|
min,
|
|
7098
7509
|
max
|
|
7099
7510
|
);
|
|
7100
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
7511
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react39.useState)(initialNumericValue);
|
|
7101
7512
|
const numericValue = isControlled ? clampSpinValue(value ?? initialNumericValue, min, max) : uncontrolledValue;
|
|
7102
|
-
const [uncontrolledDraftValue, setUncontrolledDraftValue] = (0,
|
|
7513
|
+
const [uncontrolledDraftValue, setUncontrolledDraftValue] = (0, import_react39.useState)(
|
|
7103
7514
|
() => formatSpinValue(initialNumericValue)
|
|
7104
7515
|
);
|
|
7105
7516
|
const draftValue = isControlled ? formatSpinValue(numericValue) : uncontrolledDraftValue;
|
|
@@ -7152,22 +7563,22 @@ function SpinBox({
|
|
|
7152
7563
|
}
|
|
7153
7564
|
onKeyDown?.(event);
|
|
7154
7565
|
}
|
|
7155
|
-
const decrementDisabled = (0,
|
|
7566
|
+
const decrementDisabled = (0, import_react39.useMemo)(
|
|
7156
7567
|
() => disabled || min !== void 0 && numericValue <= min,
|
|
7157
7568
|
[disabled, min, numericValue]
|
|
7158
7569
|
);
|
|
7159
|
-
const incrementDisabled = (0,
|
|
7570
|
+
const incrementDisabled = (0, import_react39.useMemo)(
|
|
7160
7571
|
() => disabled || max !== void 0 && numericValue >= max,
|
|
7161
7572
|
[disabled, max, numericValue]
|
|
7162
7573
|
);
|
|
7163
|
-
return /* @__PURE__ */ (0,
|
|
7574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
7164
7575
|
"label",
|
|
7165
7576
|
{
|
|
7166
7577
|
className: cx("nu-spin-box", slotClassNames?.root, className),
|
|
7167
7578
|
htmlFor: fieldId,
|
|
7168
7579
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
7169
7580
|
children: [
|
|
7170
|
-
/* @__PURE__ */ (0,
|
|
7581
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7171
7582
|
"span",
|
|
7172
7583
|
{
|
|
7173
7584
|
className: cx("nu-spin-box__label", slotClassNames?.label),
|
|
@@ -7175,13 +7586,13 @@ function SpinBox({
|
|
|
7175
7586
|
children: renderMnemonicText(label)
|
|
7176
7587
|
}
|
|
7177
7588
|
),
|
|
7178
|
-
/* @__PURE__ */ (0,
|
|
7589
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
7179
7590
|
"span",
|
|
7180
7591
|
{
|
|
7181
7592
|
className: cx("nu-spin-box__slot", slotClassNames?.slot),
|
|
7182
7593
|
style: slotStyles?.slot,
|
|
7183
7594
|
children: [
|
|
7184
|
-
/* @__PURE__ */ (0,
|
|
7595
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7185
7596
|
"span",
|
|
7186
7597
|
{
|
|
7187
7598
|
"aria-hidden": "true",
|
|
@@ -7190,12 +7601,12 @@ function SpinBox({
|
|
|
7190
7601
|
children: "["
|
|
7191
7602
|
}
|
|
7192
7603
|
),
|
|
7193
|
-
/* @__PURE__ */ (0,
|
|
7604
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7194
7605
|
"span",
|
|
7195
7606
|
{
|
|
7196
7607
|
className: cx("nu-spin-box__input-shell", slotClassNames?.inputShell),
|
|
7197
7608
|
style: slotStyles?.inputShell,
|
|
7198
|
-
children: /* @__PURE__ */ (0,
|
|
7609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7199
7610
|
"input",
|
|
7200
7611
|
{
|
|
7201
7612
|
...props,
|
|
@@ -7214,7 +7625,7 @@ function SpinBox({
|
|
|
7214
7625
|
)
|
|
7215
7626
|
}
|
|
7216
7627
|
),
|
|
7217
|
-
/* @__PURE__ */ (0,
|
|
7628
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7218
7629
|
"span",
|
|
7219
7630
|
{
|
|
7220
7631
|
"aria-hidden": "true",
|
|
@@ -7223,13 +7634,13 @@ function SpinBox({
|
|
|
7223
7634
|
children: "]"
|
|
7224
7635
|
}
|
|
7225
7636
|
),
|
|
7226
|
-
/* @__PURE__ */ (0,
|
|
7637
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
7227
7638
|
"span",
|
|
7228
7639
|
{
|
|
7229
7640
|
className: cx("nu-spin-box__controls", slotClassNames?.controls),
|
|
7230
7641
|
style: slotStyles?.controls,
|
|
7231
7642
|
children: [
|
|
7232
|
-
/* @__PURE__ */ (0,
|
|
7643
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7233
7644
|
"button",
|
|
7234
7645
|
{
|
|
7235
7646
|
className: cx("nu-spin-box__button", slotClassNames?.button),
|
|
@@ -7240,7 +7651,7 @@ function SpinBox({
|
|
|
7240
7651
|
children: "-"
|
|
7241
7652
|
}
|
|
7242
7653
|
),
|
|
7243
|
-
/* @__PURE__ */ (0,
|
|
7654
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7244
7655
|
"button",
|
|
7245
7656
|
{
|
|
7246
7657
|
className: cx("nu-spin-box__button", slotClassNames?.button),
|
|
@@ -7257,7 +7668,7 @@ function SpinBox({
|
|
|
7257
7668
|
]
|
|
7258
7669
|
}
|
|
7259
7670
|
),
|
|
7260
|
-
hint ? /* @__PURE__ */ (0,
|
|
7671
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7261
7672
|
"span",
|
|
7262
7673
|
{
|
|
7263
7674
|
className: cx("nu-spin-box__hint", slotClassNames?.hint),
|
|
@@ -7272,9 +7683,9 @@ function SpinBox({
|
|
|
7272
7683
|
}
|
|
7273
7684
|
|
|
7274
7685
|
// src/components/Splitter/Splitter.tsx
|
|
7275
|
-
var
|
|
7276
|
-
var
|
|
7277
|
-
function
|
|
7686
|
+
var import_react40 = require("react");
|
|
7687
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
7688
|
+
function clamp4(value, min, max) {
|
|
7278
7689
|
return Math.min(max, Math.max(min, value));
|
|
7279
7690
|
}
|
|
7280
7691
|
function Splitter({
|
|
@@ -7304,26 +7715,26 @@ function Splitter({
|
|
|
7304
7715
|
const parsedValue = Number(rawValue);
|
|
7305
7716
|
return Number.isFinite(parsedValue) ? parsedValue : null;
|
|
7306
7717
|
};
|
|
7307
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
7308
|
-
|
|
7718
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react40.useState)(
|
|
7719
|
+
clamp4(getSavedValue() ?? defaultValue, min, max)
|
|
7309
7720
|
);
|
|
7310
|
-
const rootRef = (0,
|
|
7311
|
-
const dragFrameRef = (0,
|
|
7312
|
-
const dragValueRef = (0,
|
|
7313
|
-
const activeValue =
|
|
7721
|
+
const rootRef = (0, import_react40.useRef)(null);
|
|
7722
|
+
const dragFrameRef = (0, import_react40.useRef)(null);
|
|
7723
|
+
const dragValueRef = (0, import_react40.useRef)(null);
|
|
7724
|
+
const activeValue = clamp4(
|
|
7314
7725
|
(isControlled ? value : uncontrolledValue) ?? defaultValue,
|
|
7315
7726
|
min,
|
|
7316
7727
|
max
|
|
7317
7728
|
);
|
|
7318
|
-
const firstPaneId = (0,
|
|
7319
|
-
const secondPaneId = (0,
|
|
7320
|
-
(0,
|
|
7729
|
+
const firstPaneId = (0, import_react40.useId)();
|
|
7730
|
+
const secondPaneId = (0, import_react40.useId)();
|
|
7731
|
+
(0, import_react40.useEffect)(() => {
|
|
7321
7732
|
if (!storageKey || typeof window === "undefined") {
|
|
7322
7733
|
return;
|
|
7323
7734
|
}
|
|
7324
7735
|
window.localStorage.setItem(storageKey, String(activeValue));
|
|
7325
7736
|
}, [activeValue, storageKey]);
|
|
7326
|
-
(0,
|
|
7737
|
+
(0, import_react40.useEffect)(() => {
|
|
7327
7738
|
return () => {
|
|
7328
7739
|
if (dragFrameRef.current !== null) {
|
|
7329
7740
|
window.cancelAnimationFrame(dragFrameRef.current);
|
|
@@ -7332,7 +7743,7 @@ function Splitter({
|
|
|
7332
7743
|
};
|
|
7333
7744
|
}, []);
|
|
7334
7745
|
function commitValue(nextValue) {
|
|
7335
|
-
const clampedValue =
|
|
7746
|
+
const clampedValue = clamp4(nextValue, min, max);
|
|
7336
7747
|
if (!isControlled) {
|
|
7337
7748
|
setUncontrolledValue(clampedValue);
|
|
7338
7749
|
}
|
|
@@ -7352,7 +7763,7 @@ function Splitter({
|
|
|
7352
7763
|
function computeValue(clientX, clientY) {
|
|
7353
7764
|
const bounds = rootElement.getBoundingClientRect();
|
|
7354
7765
|
const nextValue = orientation === "vertical" ? (clientX - bounds.left) / bounds.width : (clientY - bounds.top) / bounds.height;
|
|
7355
|
-
return
|
|
7766
|
+
return clamp4(nextValue, min, max);
|
|
7356
7767
|
}
|
|
7357
7768
|
function flushDragValue() {
|
|
7358
7769
|
dragFrameRef.current = null;
|
|
@@ -7428,7 +7839,7 @@ function Splitter({
|
|
|
7428
7839
|
commitValue(max);
|
|
7429
7840
|
}
|
|
7430
7841
|
}
|
|
7431
|
-
return /* @__PURE__ */ (0,
|
|
7842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
7432
7843
|
"div",
|
|
7433
7844
|
{
|
|
7434
7845
|
...props,
|
|
@@ -7440,8 +7851,8 @@ function Splitter({
|
|
|
7440
7851
|
"--nu-splitter-value": `${activeValue * 100}%`
|
|
7441
7852
|
},
|
|
7442
7853
|
children: [
|
|
7443
|
-
/* @__PURE__ */ (0,
|
|
7444
|
-
/* @__PURE__ */ (0,
|
|
7854
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "nu-splitter__pane", id: firstPaneId, children: first }),
|
|
7855
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
7445
7856
|
"div",
|
|
7446
7857
|
{
|
|
7447
7858
|
"aria-controls": `${firstPaneId} ${secondPaneId}`,
|
|
@@ -7454,7 +7865,7 @@ function Splitter({
|
|
|
7454
7865
|
onPointerDown: handlePointerDown,
|
|
7455
7866
|
role: "separator",
|
|
7456
7867
|
tabIndex: 0,
|
|
7457
|
-
children: /* @__PURE__ */ (0,
|
|
7868
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
7458
7869
|
"span",
|
|
7459
7870
|
{
|
|
7460
7871
|
"aria-hidden": "true",
|
|
@@ -7464,16 +7875,16 @@ function Splitter({
|
|
|
7464
7875
|
)
|
|
7465
7876
|
}
|
|
7466
7877
|
),
|
|
7467
|
-
/* @__PURE__ */ (0,
|
|
7878
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "nu-splitter__pane", id: secondPaneId, children: second })
|
|
7468
7879
|
]
|
|
7469
7880
|
}
|
|
7470
7881
|
);
|
|
7471
7882
|
}
|
|
7472
7883
|
|
|
7473
7884
|
// src/components/TickBar/TickBar.tsx
|
|
7474
|
-
var
|
|
7475
|
-
var
|
|
7476
|
-
function
|
|
7885
|
+
var import_react41 = require("react");
|
|
7886
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
7887
|
+
function clamp5(value, min, max) {
|
|
7477
7888
|
return Math.min(max, Math.max(min, value));
|
|
7478
7889
|
}
|
|
7479
7890
|
function snapToStep(value, min, step) {
|
|
@@ -7506,23 +7917,23 @@ function TickBar({
|
|
|
7506
7917
|
valueRenderer,
|
|
7507
7918
|
...props
|
|
7508
7919
|
}) {
|
|
7509
|
-
const generatedId = (0,
|
|
7920
|
+
const generatedId = (0, import_react41.useId)();
|
|
7510
7921
|
const sliderId = id ?? generatedId;
|
|
7511
7922
|
const hintId = hint ? `${sliderId}-hint` : void 0;
|
|
7512
7923
|
const safeStep = step > 0 ? step : 1;
|
|
7513
7924
|
const safeMax = max <= min ? min + safeStep : max;
|
|
7514
7925
|
const isControlled = value !== void 0;
|
|
7515
|
-
const initialValue =
|
|
7926
|
+
const initialValue = clamp5(
|
|
7516
7927
|
snapToStep(defaultValue ?? min, min, safeStep),
|
|
7517
7928
|
min,
|
|
7518
7929
|
safeMax
|
|
7519
7930
|
);
|
|
7520
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
7521
|
-
const [dragging, setDragging] = (0,
|
|
7522
|
-
const trackRef = (0,
|
|
7523
|
-
const resolvedValue = isControlled ?
|
|
7931
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react41.useState)(initialValue);
|
|
7932
|
+
const [dragging, setDragging] = (0, import_react41.useState)(false);
|
|
7933
|
+
const trackRef = (0, import_react41.useRef)(null);
|
|
7934
|
+
const resolvedValue = isControlled ? clamp5(snapToStep(value ?? initialValue, min, safeStep), min, safeMax) : uncontrolledValue;
|
|
7524
7935
|
const ratio = safeMax === min ? 0 : (resolvedValue - min) / (safeMax - min);
|
|
7525
|
-
const derivedTickCount = (0,
|
|
7936
|
+
const derivedTickCount = (0, import_react41.useMemo)(() => {
|
|
7526
7937
|
if (tickCount !== void 0) {
|
|
7527
7938
|
return Math.max(2, tickCount);
|
|
7528
7939
|
}
|
|
@@ -7532,7 +7943,7 @@ function TickBar({
|
|
|
7532
7943
|
);
|
|
7533
7944
|
}, [min, safeMax, safeStep, tickCount]);
|
|
7534
7945
|
const renderedValue = valueRenderer ? valueRenderer(resolvedValue, min, safeMax) : String(resolvedValue);
|
|
7535
|
-
(0,
|
|
7946
|
+
(0, import_react41.useEffect)(() => {
|
|
7536
7947
|
if (!dragging) {
|
|
7537
7948
|
return;
|
|
7538
7949
|
}
|
|
@@ -7543,7 +7954,7 @@ function TickBar({
|
|
|
7543
7954
|
return () => window.removeEventListener("pointerup", cancelDrag);
|
|
7544
7955
|
}, [dragging]);
|
|
7545
7956
|
function commitValue(nextValue) {
|
|
7546
|
-
const snappedValue =
|
|
7957
|
+
const snappedValue = clamp5(
|
|
7547
7958
|
snapToStep(nextValue, min, safeStep),
|
|
7548
7959
|
min,
|
|
7549
7960
|
safeMax
|
|
@@ -7559,7 +7970,7 @@ function TickBar({
|
|
|
7559
7970
|
return;
|
|
7560
7971
|
}
|
|
7561
7972
|
const rect = track.getBoundingClientRect();
|
|
7562
|
-
const nextRatio = orientation === "vertical" ?
|
|
7973
|
+
const nextRatio = orientation === "vertical" ? clamp5((rect.bottom - clientY) / rect.height, 0, 1) : clamp5((clientX - rect.left) / rect.width, 0, 1);
|
|
7563
7974
|
commitValue(min + nextRatio * (safeMax - min));
|
|
7564
7975
|
}
|
|
7565
7976
|
function nudge(direction, multiplier = 1) {
|
|
@@ -7608,7 +8019,7 @@ function TickBar({
|
|
|
7608
8019
|
}
|
|
7609
8020
|
onKeyDown?.(event);
|
|
7610
8021
|
}
|
|
7611
|
-
return /* @__PURE__ */ (0,
|
|
8022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
7612
8023
|
"div",
|
|
7613
8024
|
{
|
|
7614
8025
|
...props,
|
|
@@ -7621,7 +8032,7 @@ function TickBar({
|
|
|
7621
8032
|
slotStyles?.root
|
|
7622
8033
|
),
|
|
7623
8034
|
children: [
|
|
7624
|
-
label ? /* @__PURE__ */ (0,
|
|
8035
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7625
8036
|
"span",
|
|
7626
8037
|
{
|
|
7627
8038
|
className: cx("nu-tick-bar__label", slotClassNames?.label),
|
|
@@ -7629,13 +8040,13 @@ function TickBar({
|
|
|
7629
8040
|
children: renderMnemonicText(label)
|
|
7630
8041
|
}
|
|
7631
8042
|
) : null,
|
|
7632
|
-
/* @__PURE__ */ (0,
|
|
8043
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
7633
8044
|
"div",
|
|
7634
8045
|
{
|
|
7635
8046
|
className: cx("nu-tick-bar__slot", slotClassNames?.slot),
|
|
7636
8047
|
style: slotStyles?.slot,
|
|
7637
8048
|
children: [
|
|
7638
|
-
/* @__PURE__ */ (0,
|
|
8049
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
7639
8050
|
"div",
|
|
7640
8051
|
{
|
|
7641
8052
|
"aria-describedby": hintId,
|
|
@@ -7677,19 +8088,19 @@ function TickBar({
|
|
|
7677
8088
|
style: slotStyles?.track,
|
|
7678
8089
|
tabIndex: disabled ? -1 : 0,
|
|
7679
8090
|
children: [
|
|
7680
|
-
/* @__PURE__ */ (0,
|
|
8091
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7681
8092
|
"div",
|
|
7682
8093
|
{
|
|
7683
8094
|
className: cx("nu-tick-bar__rail", slotClassNames?.rail),
|
|
7684
8095
|
style: slotStyles?.rail
|
|
7685
8096
|
}
|
|
7686
8097
|
),
|
|
7687
|
-
/* @__PURE__ */ (0,
|
|
8098
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7688
8099
|
"div",
|
|
7689
8100
|
{
|
|
7690
8101
|
className: cx("nu-tick-bar__ticks", slotClassNames?.ticks),
|
|
7691
8102
|
style: slotStyles?.ticks,
|
|
7692
|
-
children: Array.from({ length: derivedTickCount }, (_, index) => /* @__PURE__ */ (0,
|
|
8103
|
+
children: Array.from({ length: derivedTickCount }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7693
8104
|
"span",
|
|
7694
8105
|
{
|
|
7695
8106
|
"aria-hidden": "true",
|
|
@@ -7700,7 +8111,7 @@ function TickBar({
|
|
|
7700
8111
|
))
|
|
7701
8112
|
}
|
|
7702
8113
|
),
|
|
7703
|
-
/* @__PURE__ */ (0,
|
|
8114
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7704
8115
|
"div",
|
|
7705
8116
|
{
|
|
7706
8117
|
"aria-hidden": "true",
|
|
@@ -7718,7 +8129,7 @@ function TickBar({
|
|
|
7718
8129
|
]
|
|
7719
8130
|
}
|
|
7720
8131
|
),
|
|
7721
|
-
showValue ? /* @__PURE__ */ (0,
|
|
8132
|
+
showValue ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7722
8133
|
"span",
|
|
7723
8134
|
{
|
|
7724
8135
|
className: cx("nu-tick-bar__value", slotClassNames?.value),
|
|
@@ -7729,7 +8140,7 @@ function TickBar({
|
|
|
7729
8140
|
]
|
|
7730
8141
|
}
|
|
7731
8142
|
),
|
|
7732
|
-
hint ? /* @__PURE__ */ (0,
|
|
8143
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7733
8144
|
"span",
|
|
7734
8145
|
{
|
|
7735
8146
|
className: cx("nu-tick-bar__hint", slotClassNames?.hint),
|
|
@@ -7744,7 +8155,7 @@ function TickBar({
|
|
|
7744
8155
|
}
|
|
7745
8156
|
|
|
7746
8157
|
// src/components/ToolBar/ToolBar.tsx
|
|
7747
|
-
var
|
|
8158
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
7748
8159
|
function ToolBar({
|
|
7749
8160
|
children,
|
|
7750
8161
|
className,
|
|
@@ -7754,7 +8165,7 @@ function ToolBar({
|
|
|
7754
8165
|
wrap = false,
|
|
7755
8166
|
...props
|
|
7756
8167
|
}) {
|
|
7757
|
-
return /* @__PURE__ */ (0,
|
|
8168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7758
8169
|
"div",
|
|
7759
8170
|
{
|
|
7760
8171
|
...props,
|
|
@@ -7773,7 +8184,7 @@ function ToolButton({
|
|
|
7773
8184
|
slotStyles,
|
|
7774
8185
|
...props
|
|
7775
8186
|
}) {
|
|
7776
|
-
return /* @__PURE__ */ (0,
|
|
8187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7777
8188
|
CommandButton,
|
|
7778
8189
|
{
|
|
7779
8190
|
...props,
|
|
@@ -7803,7 +8214,7 @@ function ToolDropButton({
|
|
|
7803
8214
|
uncheckedShape,
|
|
7804
8215
|
...props
|
|
7805
8216
|
}) {
|
|
7806
|
-
return /* @__PURE__ */ (0,
|
|
8217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7807
8218
|
CommandButton,
|
|
7808
8219
|
{
|
|
7809
8220
|
...props,
|
|
@@ -7829,7 +8240,7 @@ function ToolDropButton({
|
|
|
7829
8240
|
);
|
|
7830
8241
|
}
|
|
7831
8242
|
function ToolSeparator({ className, ...props }) {
|
|
7832
|
-
return /* @__PURE__ */ (0,
|
|
8243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7833
8244
|
"div",
|
|
7834
8245
|
{
|
|
7835
8246
|
...props,
|
|
@@ -7845,7 +8256,7 @@ function ToolSeparator({ className, ...props }) {
|
|
|
7845
8256
|
}
|
|
7846
8257
|
|
|
7847
8258
|
// src/components/TreeView/TreeView.tsx
|
|
7848
|
-
var
|
|
8259
|
+
var import_react43 = require("react");
|
|
7849
8260
|
|
|
7850
8261
|
// src/components/_shared/treeData.ts
|
|
7851
8262
|
function collectExpandedTreeDataIds(items) {
|
|
@@ -7941,8 +8352,8 @@ function collectVisibleTreeItems(items, expandedIds, depth = 0, guideMask = [],
|
|
|
7941
8352
|
}
|
|
7942
8353
|
|
|
7943
8354
|
// src/components/TreeView/internals/TreeViewItem.tsx
|
|
7944
|
-
var
|
|
7945
|
-
var
|
|
8355
|
+
var import_react42 = require("react");
|
|
8356
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7946
8357
|
function areTreeViewGuideArraysEqual(previousArray, nextArray) {
|
|
7947
8358
|
if (previousArray.length !== nextArray.length) {
|
|
7948
8359
|
return false;
|
|
@@ -8016,8 +8427,8 @@ function TreeViewItemInner({
|
|
|
8016
8427
|
handleActivate();
|
|
8017
8428
|
onToggleItemCheck?.(item, !isChecked);
|
|
8018
8429
|
}
|
|
8019
|
-
return /* @__PURE__ */ (0,
|
|
8020
|
-
/* @__PURE__ */ (0,
|
|
8430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "nu-tree-view__row", role: "none", children: [
|
|
8431
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
8021
8432
|
"div",
|
|
8022
8433
|
{
|
|
8023
8434
|
"aria-checked": isCheckable ? isChecked : void 0,
|
|
@@ -8036,8 +8447,8 @@ function TreeViewItemInner({
|
|
|
8036
8447
|
ref: (node) => registerItemRef(itemId, node),
|
|
8037
8448
|
role: "treeitem",
|
|
8038
8449
|
children: [
|
|
8039
|
-
/* @__PURE__ */ (0,
|
|
8040
|
-
guideMask.map((hasGuide, guideIndex) => /* @__PURE__ */ (0,
|
|
8450
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { "aria-hidden": "true", className: "nu-tree-view__prefix", children: [
|
|
8451
|
+
guideMask.map((hasGuide, guideIndex) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8041
8452
|
"span",
|
|
8042
8453
|
{
|
|
8043
8454
|
className: "nu-tree-view__guide",
|
|
@@ -8048,7 +8459,7 @@ function TreeViewItemInner({
|
|
|
8048
8459
|
},
|
|
8049
8460
|
`${itemId}-guide-${guideIndex}`
|
|
8050
8461
|
)),
|
|
8051
|
-
/* @__PURE__ */ (0,
|
|
8462
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
8052
8463
|
"span",
|
|
8053
8464
|
{
|
|
8054
8465
|
className: "nu-tree-view__lead",
|
|
@@ -8056,19 +8467,19 @@ function TreeViewItemInner({
|
|
|
8056
8467
|
"--nu-tree-view-origin-offset": originOffset
|
|
8057
8468
|
},
|
|
8058
8469
|
children: [
|
|
8059
|
-
depth > 0 ? /* @__PURE__ */ (0,
|
|
8470
|
+
depth > 0 ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8060
8471
|
"span",
|
|
8061
8472
|
{
|
|
8062
8473
|
className: "nu-tree-view__branch",
|
|
8063
8474
|
"data-branch": hasNextSibling ? "tee" : "elbow"
|
|
8064
8475
|
}
|
|
8065
8476
|
) : null,
|
|
8066
|
-
hasChildren ? /* @__PURE__ */ (0,
|
|
8477
|
+
hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8067
8478
|
"span",
|
|
8068
8479
|
{
|
|
8069
8480
|
className: "nu-tree-view__expander",
|
|
8070
8481
|
"data-connector": depth > 0 ? "lead" : void 0,
|
|
8071
|
-
children: /* @__PURE__ */ (0,
|
|
8482
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8072
8483
|
"button",
|
|
8073
8484
|
{
|
|
8074
8485
|
"aria-label": isExpanded ? "Collapse item" : "Expand item",
|
|
@@ -8076,7 +8487,7 @@ function TreeViewItemInner({
|
|
|
8076
8487
|
onClick: handleToggleExpanded,
|
|
8077
8488
|
tabIndex: -1,
|
|
8078
8489
|
type: "button",
|
|
8079
|
-
children: /* @__PURE__ */ (0,
|
|
8490
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8080
8491
|
NuGlyph,
|
|
8081
8492
|
{
|
|
8082
8493
|
name: isExpanded ? "tree-caret-down" : "tree-caret-right"
|
|
@@ -8085,7 +8496,7 @@ function TreeViewItemInner({
|
|
|
8085
8496
|
}
|
|
8086
8497
|
)
|
|
8087
8498
|
}
|
|
8088
|
-
) : depth > 0 ? /* @__PURE__ */ (0,
|
|
8499
|
+
) : depth > 0 ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8089
8500
|
"span",
|
|
8090
8501
|
{
|
|
8091
8502
|
className: "nu-tree-view__expander-placeholder",
|
|
@@ -8096,8 +8507,8 @@ function TreeViewItemInner({
|
|
|
8096
8507
|
}
|
|
8097
8508
|
)
|
|
8098
8509
|
] }),
|
|
8099
|
-
/* @__PURE__ */ (0,
|
|
8100
|
-
isCheckable ? /* @__PURE__ */ (0,
|
|
8510
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "nu-tree-view__content", children: [
|
|
8511
|
+
isCheckable ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "nu-tree-view__check-slot", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8101
8512
|
"button",
|
|
8102
8513
|
{
|
|
8103
8514
|
"aria-label": isChecked ? "Uncheck item" : "Check item",
|
|
@@ -8105,12 +8516,12 @@ function TreeViewItemInner({
|
|
|
8105
8516
|
onClick: handleToggleChecked,
|
|
8106
8517
|
tabIndex: -1,
|
|
8107
8518
|
type: "button",
|
|
8108
|
-
children: /* @__PURE__ */ (0,
|
|
8519
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8109
8520
|
"span",
|
|
8110
8521
|
{
|
|
8111
8522
|
className: "nu-tree-view__check-box",
|
|
8112
8523
|
"data-unchecked-shape": uncheckedShape,
|
|
8113
|
-
children: isChecked ? /* @__PURE__ */ (0,
|
|
8524
|
+
children: isChecked ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8114
8525
|
NuGlyph,
|
|
8115
8526
|
{
|
|
8116
8527
|
className: "nu-tree-view__check-mark",
|
|
@@ -8121,14 +8532,14 @@ function TreeViewItemInner({
|
|
|
8121
8532
|
)
|
|
8122
8533
|
}
|
|
8123
8534
|
) }) : null,
|
|
8124
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
8125
|
-
/* @__PURE__ */ (0,
|
|
8126
|
-
item.hint ? /* @__PURE__ */ (0,
|
|
8535
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "nu-tree-view__icon", children: item.icon }) : null,
|
|
8536
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "nu-tree-view__title", children: item.title }),
|
|
8537
|
+
item.hint ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "nu-tree-view__hint", children: item.hint }) : null
|
|
8127
8538
|
] })
|
|
8128
8539
|
]
|
|
8129
8540
|
}
|
|
8130
8541
|
),
|
|
8131
|
-
hasChildren && isExpanded ? /* @__PURE__ */ (0,
|
|
8542
|
+
hasChildren && isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { role: "group", children: (item.children ?? []).map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8132
8543
|
TreeViewItem,
|
|
8133
8544
|
{
|
|
8134
8545
|
depth: depth + 1,
|
|
@@ -8161,10 +8572,10 @@ function areTreeViewItemPropsEqual(previousProps, nextProps) {
|
|
|
8161
8572
|
nextProps.guideOffsets
|
|
8162
8573
|
) && previousProps.hasNextSibling === nextProps.hasNextSibling && previousProps.item === nextProps.item && previousProps.onActivateItem === nextProps.onActivateItem && previousProps.onDoubleClickItem === nextProps.onDoubleClickItem && previousProps.onToggleItemCheck === nextProps.onToggleItemCheck && previousProps.onToggleItemExpanded === nextProps.onToggleItemExpanded && previousProps.originOffset === nextProps.originOffset && previousProps.registerItemRef === nextProps.registerItemRef && previousProps.treeId === nextProps.treeId && previousProps.uncheckedShape === nextProps.uncheckedShape;
|
|
8163
8574
|
}
|
|
8164
|
-
var TreeViewItem = (0,
|
|
8575
|
+
var TreeViewItem = (0, import_react42.memo)(TreeViewItemInner, areTreeViewItemPropsEqual);
|
|
8165
8576
|
|
|
8166
8577
|
// src/components/TreeView/TreeView.tsx
|
|
8167
|
-
var
|
|
8578
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
8168
8579
|
function TreeViewInner({
|
|
8169
8580
|
className,
|
|
8170
8581
|
data,
|
|
@@ -8179,36 +8590,36 @@ function TreeViewInner({
|
|
|
8179
8590
|
uncheckedShape = "box",
|
|
8180
8591
|
...props
|
|
8181
8592
|
}, ref) {
|
|
8182
|
-
const rootRef = (0,
|
|
8183
|
-
const treeId = (0,
|
|
8184
|
-
const itemRefs = (0,
|
|
8593
|
+
const rootRef = (0, import_react43.useRef)(null);
|
|
8594
|
+
const treeId = (0, import_react43.useId)();
|
|
8595
|
+
const itemRefs = (0, import_react43.useRef)({});
|
|
8185
8596
|
const isExpandedControlled = expandedIds !== void 0;
|
|
8186
|
-
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = (0,
|
|
8597
|
+
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = (0, import_react43.useState)(() => {
|
|
8187
8598
|
const expandedFromData = collectExpandedTreeIds(data);
|
|
8188
8599
|
if (!defaultExpandedIds?.length) {
|
|
8189
8600
|
return expandedFromData;
|
|
8190
8601
|
}
|
|
8191
8602
|
return Array.from(/* @__PURE__ */ new Set([...expandedFromData, ...defaultExpandedIds]));
|
|
8192
8603
|
});
|
|
8193
|
-
const [uncontrolledSelectedId, setUncontrolledSelectedId] = (0,
|
|
8604
|
+
const [uncontrolledSelectedId, setUncontrolledSelectedId] = (0, import_react43.useState)(null);
|
|
8194
8605
|
const resolvedExpandedIds = isExpandedControlled ? expandedIds : uncontrolledExpandedIds;
|
|
8195
|
-
const expandedIdSet = (0,
|
|
8606
|
+
const expandedIdSet = (0, import_react43.useMemo)(
|
|
8196
8607
|
() => new Set(resolvedExpandedIds),
|
|
8197
8608
|
[resolvedExpandedIds]
|
|
8198
8609
|
);
|
|
8199
|
-
const visibleItems = (0,
|
|
8610
|
+
const visibleItems = (0, import_react43.useMemo)(
|
|
8200
8611
|
() => collectVisibleTreeItems(data, expandedIdSet),
|
|
8201
8612
|
[data, expandedIdSet]
|
|
8202
8613
|
);
|
|
8203
|
-
const selectableItems = (0,
|
|
8614
|
+
const selectableItems = (0, import_react43.useMemo)(
|
|
8204
8615
|
() => visibleItems.filter(({ item }) => !item.disabled),
|
|
8205
8616
|
[visibleItems]
|
|
8206
8617
|
);
|
|
8207
8618
|
const derivedSelectedId = selectedId ?? uncontrolledSelectedId ?? findSelectedTreeItemId(data) ?? selectableItems[0]?.itemId ?? null;
|
|
8208
8619
|
const resolvedSelectedId = derivedSelectedId && selectableItems.some((entry) => entry.itemId === derivedSelectedId) ? derivedSelectedId : selectableItems[0]?.itemId ?? null;
|
|
8209
|
-
const [activeId, setActiveId] = (0,
|
|
8620
|
+
const [activeId, setActiveId] = (0, import_react43.useState)(resolvedSelectedId);
|
|
8210
8621
|
const resolvedActiveId = activeId && selectableItems.some((entry) => entry.itemId === activeId) ? activeId : resolvedSelectedId;
|
|
8211
|
-
(0,
|
|
8622
|
+
(0, import_react43.useEffect)(() => {
|
|
8212
8623
|
if (!resolvedActiveId) {
|
|
8213
8624
|
return;
|
|
8214
8625
|
}
|
|
@@ -8216,13 +8627,13 @@ function TreeViewInner({
|
|
|
8216
8627
|
block: "nearest"
|
|
8217
8628
|
});
|
|
8218
8629
|
}, [resolvedActiveId]);
|
|
8219
|
-
const registerItemRef = (0,
|
|
8630
|
+
const registerItemRef = (0, import_react43.useCallback)(
|
|
8220
8631
|
(itemId, node) => {
|
|
8221
8632
|
itemRefs.current[itemId] = node;
|
|
8222
8633
|
},
|
|
8223
8634
|
[]
|
|
8224
8635
|
);
|
|
8225
|
-
const setExpandedState = (0,
|
|
8636
|
+
const setExpandedState = (0, import_react43.useCallback)(
|
|
8226
8637
|
(item, nextExpanded) => {
|
|
8227
8638
|
const nextExpandedIds = nextExpanded ? Array.from(/* @__PURE__ */ new Set([...resolvedExpandedIds, item.id])) : resolvedExpandedIds.filter((expandedId) => expandedId !== item.id);
|
|
8228
8639
|
if (!isExpandedControlled) {
|
|
@@ -8232,7 +8643,7 @@ function TreeViewInner({
|
|
|
8232
8643
|
},
|
|
8233
8644
|
[isExpandedControlled, onExpandedIdsChange, resolvedExpandedIds]
|
|
8234
8645
|
);
|
|
8235
|
-
const activateEntry = (0,
|
|
8646
|
+
const activateEntry = (0, import_react43.useCallback)(
|
|
8236
8647
|
(item, itemId) => {
|
|
8237
8648
|
if (item.disabled) {
|
|
8238
8649
|
return;
|
|
@@ -8245,7 +8656,7 @@ function TreeViewInner({
|
|
|
8245
8656
|
},
|
|
8246
8657
|
[onItemSelect, selectedId]
|
|
8247
8658
|
);
|
|
8248
|
-
const activateResolvedItem = (0,
|
|
8659
|
+
const activateResolvedItem = (0, import_react43.useCallback)(
|
|
8249
8660
|
(itemId) => {
|
|
8250
8661
|
if (!itemId) {
|
|
8251
8662
|
return;
|
|
@@ -8371,7 +8782,7 @@ function TreeViewInner({
|
|
|
8371
8782
|
break;
|
|
8372
8783
|
}
|
|
8373
8784
|
}
|
|
8374
|
-
(0,
|
|
8785
|
+
(0, import_react43.useImperativeHandle)(
|
|
8375
8786
|
ref,
|
|
8376
8787
|
() => ({
|
|
8377
8788
|
activateItem(itemId) {
|
|
@@ -8415,7 +8826,7 @@ function TreeViewInner({
|
|
|
8415
8826
|
setExpandedState
|
|
8416
8827
|
]
|
|
8417
8828
|
);
|
|
8418
|
-
return /* @__PURE__ */ (0,
|
|
8829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8419
8830
|
"div",
|
|
8420
8831
|
{
|
|
8421
8832
|
...props,
|
|
@@ -8425,7 +8836,7 @@ function TreeViewInner({
|
|
|
8425
8836
|
ref: rootRef,
|
|
8426
8837
|
role: "tree",
|
|
8427
8838
|
tabIndex: 0,
|
|
8428
|
-
children: visibleItems.length > 0 ? data.map((item, index) => /* @__PURE__ */ (0,
|
|
8839
|
+
children: visibleItems.length > 0 ? data.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8429
8840
|
TreeViewItem,
|
|
8430
8841
|
{
|
|
8431
8842
|
depth: 0,
|
|
@@ -8445,14 +8856,14 @@ function TreeViewInner({
|
|
|
8445
8856
|
uncheckedShape
|
|
8446
8857
|
},
|
|
8447
8858
|
item.id
|
|
8448
|
-
)) : /* @__PURE__ */ (0,
|
|
8859
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "nu-tree-view__empty", children: emptyText })
|
|
8449
8860
|
}
|
|
8450
8861
|
);
|
|
8451
8862
|
}
|
|
8452
|
-
var TreeView = (0,
|
|
8863
|
+
var TreeView = (0, import_react43.forwardRef)(TreeViewInner);
|
|
8453
8864
|
|
|
8454
8865
|
// src/components/TreeListView/TreeListView.tsx
|
|
8455
|
-
var
|
|
8866
|
+
var import_react45 = require("react");
|
|
8456
8867
|
|
|
8457
8868
|
// src/components/TreeListView/internals/helpers.ts
|
|
8458
8869
|
function normalizeTreeListAlign(align, fallback) {
|
|
@@ -8541,12 +8952,12 @@ function renderTreeListCellValue(item, column) {
|
|
|
8541
8952
|
}
|
|
8542
8953
|
|
|
8543
8954
|
// src/components/TreeListView/internals/TreeListViewRow.tsx
|
|
8544
|
-
var
|
|
8545
|
-
var
|
|
8955
|
+
var import_react44 = require("react");
|
|
8956
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
8546
8957
|
function renderTreeTitleContent(item) {
|
|
8547
|
-
return /* @__PURE__ */ (0,
|
|
8548
|
-
/* @__PURE__ */ (0,
|
|
8549
|
-
item.hint ? /* @__PURE__ */ (0,
|
|
8958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
8959
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "nu-tree-list-view__title", children: item.title }),
|
|
8960
|
+
item.hint ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "nu-tree-list-view__hint", children: item.hint }) : null
|
|
8550
8961
|
] });
|
|
8551
8962
|
}
|
|
8552
8963
|
function renderReportCellContent(item, column, depth, rowIndex, getCellContent) {
|
|
@@ -8646,8 +9057,8 @@ function TreeListViewRowInner({
|
|
|
8646
9057
|
handleActivate();
|
|
8647
9058
|
onToggleItemCheck?.(item, !isChecked);
|
|
8648
9059
|
}
|
|
8649
|
-
return /* @__PURE__ */ (0,
|
|
8650
|
-
/* @__PURE__ */ (0,
|
|
9060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
9061
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8651
9062
|
"div",
|
|
8652
9063
|
{
|
|
8653
9064
|
"aria-disabled": item.disabled || void 0,
|
|
@@ -8670,7 +9081,7 @@ function TreeListViewRowInner({
|
|
|
8670
9081
|
"--nu-tree-list-view-columns": templateColumns
|
|
8671
9082
|
},
|
|
8672
9083
|
children: columns.map(
|
|
8673
|
-
(column, columnIndex) => column.id === treeColumnId ? /* @__PURE__ */ (0,
|
|
9084
|
+
(column, columnIndex) => column.id === treeColumnId ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
8674
9085
|
"span",
|
|
8675
9086
|
{
|
|
8676
9087
|
className: [
|
|
@@ -8682,8 +9093,8 @@ function TreeListViewRowInner({
|
|
|
8682
9093
|
"data-column-id": column.id,
|
|
8683
9094
|
role: "gridcell",
|
|
8684
9095
|
children: [
|
|
8685
|
-
/* @__PURE__ */ (0,
|
|
8686
|
-
guideMask.map((hasGuide, guideIndex) => /* @__PURE__ */ (0,
|
|
9096
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { "aria-hidden": "true", className: "nu-tree-list-view__prefix", children: [
|
|
9097
|
+
guideMask.map((hasGuide, guideIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8687
9098
|
"span",
|
|
8688
9099
|
{
|
|
8689
9100
|
className: "nu-tree-list-view__guide",
|
|
@@ -8694,7 +9105,7 @@ function TreeListViewRowInner({
|
|
|
8694
9105
|
},
|
|
8695
9106
|
`${itemId}-guide-${guideIndex}`
|
|
8696
9107
|
)),
|
|
8697
|
-
/* @__PURE__ */ (0,
|
|
9108
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
8698
9109
|
"span",
|
|
8699
9110
|
{
|
|
8700
9111
|
className: "nu-tree-list-view__lead",
|
|
@@ -8702,19 +9113,19 @@ function TreeListViewRowInner({
|
|
|
8702
9113
|
"--nu-tree-list-view-origin-offset": originOffset
|
|
8703
9114
|
},
|
|
8704
9115
|
children: [
|
|
8705
|
-
depth > 0 ? /* @__PURE__ */ (0,
|
|
9116
|
+
depth > 0 ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8706
9117
|
"span",
|
|
8707
9118
|
{
|
|
8708
9119
|
className: "nu-tree-list-view__branch",
|
|
8709
9120
|
"data-branch": hasNextSibling ? "tee" : "elbow"
|
|
8710
9121
|
}
|
|
8711
9122
|
) : null,
|
|
8712
|
-
hasChildren ? /* @__PURE__ */ (0,
|
|
9123
|
+
hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8713
9124
|
"span",
|
|
8714
9125
|
{
|
|
8715
9126
|
className: "nu-tree-list-view__expander",
|
|
8716
9127
|
"data-connector": depth > 0 ? "lead" : void 0,
|
|
8717
|
-
children: /* @__PURE__ */ (0,
|
|
9128
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8718
9129
|
"button",
|
|
8719
9130
|
{
|
|
8720
9131
|
"aria-label": isExpanded ? "Collapse item" : "Expand item",
|
|
@@ -8722,7 +9133,7 @@ function TreeListViewRowInner({
|
|
|
8722
9133
|
onClick: handleToggleExpanded,
|
|
8723
9134
|
tabIndex: -1,
|
|
8724
9135
|
type: "button",
|
|
8725
|
-
children: /* @__PURE__ */ (0,
|
|
9136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8726
9137
|
NuGlyph,
|
|
8727
9138
|
{
|
|
8728
9139
|
name: isExpanded ? "tree-caret-down" : "tree-caret-right"
|
|
@@ -8731,7 +9142,7 @@ function TreeListViewRowInner({
|
|
|
8731
9142
|
}
|
|
8732
9143
|
)
|
|
8733
9144
|
}
|
|
8734
|
-
) : depth > 0 ? /* @__PURE__ */ (0,
|
|
9145
|
+
) : depth > 0 ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8735
9146
|
"span",
|
|
8736
9147
|
{
|
|
8737
9148
|
className: "nu-tree-list-view__expander-placeholder",
|
|
@@ -8742,8 +9153,8 @@ function TreeListViewRowInner({
|
|
|
8742
9153
|
}
|
|
8743
9154
|
)
|
|
8744
9155
|
] }),
|
|
8745
|
-
/* @__PURE__ */ (0,
|
|
8746
|
-
isCheckable ? /* @__PURE__ */ (0,
|
|
9156
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "nu-tree-list-view__tree-content", children: [
|
|
9157
|
+
isCheckable ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "nu-tree-list-view__check-slot", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8747
9158
|
"button",
|
|
8748
9159
|
{
|
|
8749
9160
|
"aria-label": isChecked ? "Uncheck item" : "Check item",
|
|
@@ -8751,12 +9162,12 @@ function TreeListViewRowInner({
|
|
|
8751
9162
|
onClick: handleToggleChecked,
|
|
8752
9163
|
tabIndex: -1,
|
|
8753
9164
|
type: "button",
|
|
8754
|
-
children: /* @__PURE__ */ (0,
|
|
9165
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8755
9166
|
"span",
|
|
8756
9167
|
{
|
|
8757
9168
|
className: "nu-tree-list-view__check-box",
|
|
8758
9169
|
"data-unchecked-shape": uncheckedShape,
|
|
8759
|
-
children: isChecked ? /* @__PURE__ */ (0,
|
|
9170
|
+
children: isChecked ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8760
9171
|
NuGlyph,
|
|
8761
9172
|
{
|
|
8762
9173
|
className: "nu-tree-list-view__check-mark",
|
|
@@ -8767,13 +9178,13 @@ function TreeListViewRowInner({
|
|
|
8767
9178
|
)
|
|
8768
9179
|
}
|
|
8769
9180
|
) }) : null,
|
|
8770
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
9181
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "nu-tree-list-view__icon", children: item.icon }) : null,
|
|
8771
9182
|
renderTreeTitleContent(item)
|
|
8772
9183
|
] })
|
|
8773
9184
|
]
|
|
8774
9185
|
},
|
|
8775
9186
|
column.id
|
|
8776
|
-
) : /* @__PURE__ */ (0,
|
|
9187
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8777
9188
|
"span",
|
|
8778
9189
|
{
|
|
8779
9190
|
className: [
|
|
@@ -8796,7 +9207,7 @@ function TreeListViewRowInner({
|
|
|
8796
9207
|
)
|
|
8797
9208
|
}
|
|
8798
9209
|
),
|
|
8799
|
-
hasChildren && isExpanded ? /* @__PURE__ */ (0,
|
|
9210
|
+
hasChildren && isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { role: "rowgroup", children: (item.children ?? []).map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8800
9211
|
TreeListViewRow,
|
|
8801
9212
|
{
|
|
8802
9213
|
activeItemId,
|
|
@@ -8834,13 +9245,13 @@ function areTreeListViewRowPropsEqual(previousProps, nextProps) {
|
|
|
8834
9245
|
nextProps.guideOffsets
|
|
8835
9246
|
) && previousProps.hasNextSibling === nextProps.hasNextSibling && previousProps.item === nextProps.item && previousProps.onActivateItem === nextProps.onActivateItem && previousProps.onDoubleClickItem === nextProps.onDoubleClickItem && previousProps.onToggleItemCheck === nextProps.onToggleItemCheck && previousProps.onToggleItemExpanded === nextProps.onToggleItemExpanded && previousProps.originOffset === nextProps.originOffset && previousProps.registerItemRef === nextProps.registerItemRef && previousProps.rowIndexMap === nextProps.rowIndexMap && previousProps.templateColumns === nextProps.templateColumns && previousProps.treeColumnId === nextProps.treeColumnId && previousProps.treeId === nextProps.treeId && previousProps.uncheckedShape === nextProps.uncheckedShape;
|
|
8836
9247
|
}
|
|
8837
|
-
var TreeListViewRow = (0,
|
|
9248
|
+
var TreeListViewRow = (0, import_react44.memo)(
|
|
8838
9249
|
TreeListViewRowInner,
|
|
8839
9250
|
areTreeListViewRowPropsEqual
|
|
8840
9251
|
);
|
|
8841
9252
|
|
|
8842
9253
|
// src/components/TreeListView/TreeListView.tsx
|
|
8843
|
-
var
|
|
9254
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
8844
9255
|
function TreeListViewInner({
|
|
8845
9256
|
activeItemId: activeItemIdProp,
|
|
8846
9257
|
checkedIds,
|
|
@@ -8862,42 +9273,42 @@ function TreeListViewInner({
|
|
|
8862
9273
|
uncheckedShape = "box",
|
|
8863
9274
|
...props
|
|
8864
9275
|
}, ref) {
|
|
8865
|
-
const rootRef = (0,
|
|
8866
|
-
const treeId = (0,
|
|
8867
|
-
const itemRefs = (0,
|
|
8868
|
-
const resizeFrameRef = (0,
|
|
8869
|
-
const resizeStateRef = (0,
|
|
9276
|
+
const rootRef = (0, import_react45.useRef)(null);
|
|
9277
|
+
const treeId = (0, import_react45.useId)();
|
|
9278
|
+
const itemRefs = (0, import_react45.useRef)({});
|
|
9279
|
+
const resizeFrameRef = (0, import_react45.useRef)(null);
|
|
9280
|
+
const resizeStateRef = (0, import_react45.useRef)(null);
|
|
8870
9281
|
const isExpandedControlled = expandedIds !== void 0;
|
|
8871
|
-
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = (0,
|
|
9282
|
+
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = (0, import_react45.useState)(() => {
|
|
8872
9283
|
const expandedFromData = collectExpandedTreeListIds(data);
|
|
8873
9284
|
if (!defaultExpandedIds?.length) {
|
|
8874
9285
|
return expandedFromData;
|
|
8875
9286
|
}
|
|
8876
9287
|
return Array.from(/* @__PURE__ */ new Set([...expandedFromData, ...defaultExpandedIds]));
|
|
8877
9288
|
});
|
|
8878
|
-
const [uncontrolledSelectedId, setUncontrolledSelectedId] = (0,
|
|
8879
|
-
const [autoColumnWidths, setAutoColumnWidths] = (0,
|
|
8880
|
-
const [userColumnWidths, setUserColumnWidths] = (0,
|
|
9289
|
+
const [uncontrolledSelectedId, setUncontrolledSelectedId] = (0, import_react45.useState)(null);
|
|
9290
|
+
const [autoColumnWidths, setAutoColumnWidths] = (0, import_react45.useState)({});
|
|
9291
|
+
const [userColumnWidths, setUserColumnWidths] = (0, import_react45.useState)({});
|
|
8881
9292
|
const isActiveControlled = activeItemIdProp !== void 0;
|
|
8882
9293
|
const resolvedExpandedIds = isExpandedControlled ? expandedIds : uncontrolledExpandedIds;
|
|
8883
|
-
const expandedIdSet = (0,
|
|
9294
|
+
const expandedIdSet = (0, import_react45.useMemo)(
|
|
8884
9295
|
() => new Set(resolvedExpandedIds),
|
|
8885
9296
|
[resolvedExpandedIds]
|
|
8886
9297
|
);
|
|
8887
|
-
const visibleItems = (0,
|
|
9298
|
+
const visibleItems = (0, import_react45.useMemo)(
|
|
8888
9299
|
() => collectVisibleTreeListItems(data, expandedIdSet),
|
|
8889
9300
|
[data, expandedIdSet]
|
|
8890
9301
|
);
|
|
8891
|
-
const selectableItems = (0,
|
|
9302
|
+
const selectableItems = (0, import_react45.useMemo)(
|
|
8892
9303
|
() => visibleItems.filter(({ item }) => !item.disabled),
|
|
8893
9304
|
[visibleItems]
|
|
8894
9305
|
);
|
|
8895
9306
|
const derivedSelectedId = selectedId ?? uncontrolledSelectedId ?? findSelectedTreeListItemId(data) ?? selectableItems[0]?.itemId ?? null;
|
|
8896
9307
|
const resolvedSelectedId = derivedSelectedId && selectableItems.some((entry) => entry.itemId === derivedSelectedId) ? derivedSelectedId : selectableItems[0]?.itemId ?? null;
|
|
8897
|
-
const [uncontrolledActiveItemId, setUncontrolledActiveItemId] = (0,
|
|
9308
|
+
const [uncontrolledActiveItemId, setUncontrolledActiveItemId] = (0, import_react45.useState)(() => defaultActiveItemId ?? resolvedSelectedId);
|
|
8898
9309
|
const activeItemId = activeItemIdProp !== void 0 ? activeItemIdProp : uncontrolledActiveItemId;
|
|
8899
9310
|
const resolvedActiveItemId = activeItemId && selectableItems.some((entry) => entry.itemId === activeItemId) ? activeItemId : resolvedSelectedId;
|
|
8900
|
-
const minColumnWidthById = (0,
|
|
9311
|
+
const minColumnWidthById = (0, import_react45.useMemo)(
|
|
8901
9312
|
() => Object.fromEntries(
|
|
8902
9313
|
columns.map(
|
|
8903
9314
|
(column) => [column.id, column.minWidth ?? 0]
|
|
@@ -8905,24 +9316,24 @@ function TreeListViewInner({
|
|
|
8905
9316
|
),
|
|
8906
9317
|
[columns]
|
|
8907
9318
|
);
|
|
8908
|
-
const templateColumns = (0,
|
|
9319
|
+
const templateColumns = (0, import_react45.useMemo)(
|
|
8909
9320
|
() => getTreeListTemplateColumns(columns, {
|
|
8910
9321
|
autoColumnWidths,
|
|
8911
9322
|
userColumnWidths
|
|
8912
9323
|
}),
|
|
8913
9324
|
[autoColumnWidths, columns, userColumnWidths]
|
|
8914
9325
|
);
|
|
8915
|
-
const treeColumnId = (0,
|
|
9326
|
+
const treeColumnId = (0, import_react45.useMemo)(
|
|
8916
9327
|
() => getTreeListTreeColumnId(columns),
|
|
8917
9328
|
[columns]
|
|
8918
9329
|
);
|
|
8919
|
-
const rowIndexMap = (0,
|
|
9330
|
+
const rowIndexMap = (0, import_react45.useMemo)(
|
|
8920
9331
|
() => new Map(
|
|
8921
9332
|
visibleItems.map((entry, index) => [entry.itemId, index])
|
|
8922
9333
|
),
|
|
8923
9334
|
[visibleItems]
|
|
8924
9335
|
);
|
|
8925
|
-
(0,
|
|
9336
|
+
(0, import_react45.useEffect)(() => {
|
|
8926
9337
|
if (!resolvedActiveItemId) {
|
|
8927
9338
|
return;
|
|
8928
9339
|
}
|
|
@@ -8930,21 +9341,21 @@ function TreeListViewInner({
|
|
|
8930
9341
|
block: "nearest"
|
|
8931
9342
|
});
|
|
8932
9343
|
}, [resolvedActiveItemId]);
|
|
8933
|
-
const registerItemRef = (0,
|
|
9344
|
+
const registerItemRef = (0, import_react45.useCallback)(
|
|
8934
9345
|
(itemId, node) => {
|
|
8935
9346
|
itemRefs.current[itemId] = node;
|
|
8936
9347
|
},
|
|
8937
9348
|
[]
|
|
8938
9349
|
);
|
|
8939
|
-
const resolveCellContent = (0,
|
|
9350
|
+
const resolveCellContent = (0, import_react45.useCallback)(
|
|
8940
9351
|
(...args) => getCellContent?.(...args),
|
|
8941
9352
|
[getCellContent]
|
|
8942
9353
|
);
|
|
8943
|
-
const handleItemDoubleClick = (0,
|
|
9354
|
+
const handleItemDoubleClick = (0, import_react45.useCallback)(
|
|
8944
9355
|
(item) => onItemDoubleClick?.(item),
|
|
8945
9356
|
[onItemDoubleClick]
|
|
8946
9357
|
);
|
|
8947
|
-
(0,
|
|
9358
|
+
(0, import_react45.useLayoutEffect)(() => {
|
|
8948
9359
|
const rootNode = rootRef.current;
|
|
8949
9360
|
if (!rootNode) {
|
|
8950
9361
|
return;
|
|
@@ -8976,14 +9387,14 @@ function TreeListViewInner({
|
|
|
8976
9387
|
return didChange ? nextWidths : currentWidths;
|
|
8977
9388
|
});
|
|
8978
9389
|
}, [columns, userColumnWidths, visibleItems]);
|
|
8979
|
-
(0,
|
|
9390
|
+
(0, import_react45.useEffect)(() => {
|
|
8980
9391
|
return () => {
|
|
8981
9392
|
if (resizeFrameRef.current !== null) {
|
|
8982
9393
|
window.cancelAnimationFrame(resizeFrameRef.current);
|
|
8983
9394
|
}
|
|
8984
9395
|
};
|
|
8985
9396
|
}, []);
|
|
8986
|
-
const setExpandedState = (0,
|
|
9397
|
+
const setExpandedState = (0, import_react45.useCallback)(
|
|
8987
9398
|
(item, nextExpanded) => {
|
|
8988
9399
|
const nextExpandedIds = nextExpanded ? Array.from(/* @__PURE__ */ new Set([...resolvedExpandedIds, item.id])) : resolvedExpandedIds.filter((expandedId) => expandedId !== item.id);
|
|
8989
9400
|
if (!isExpandedControlled) {
|
|
@@ -8993,7 +9404,7 @@ function TreeListViewInner({
|
|
|
8993
9404
|
},
|
|
8994
9405
|
[isExpandedControlled, onExpandedIdsChange, resolvedExpandedIds]
|
|
8995
9406
|
);
|
|
8996
|
-
const updateActiveItem = (0,
|
|
9407
|
+
const updateActiveItem = (0, import_react45.useCallback)(
|
|
8997
9408
|
(item) => {
|
|
8998
9409
|
if (!isActiveControlled) {
|
|
8999
9410
|
setUncontrolledActiveItemId(item.id);
|
|
@@ -9002,7 +9413,7 @@ function TreeListViewInner({
|
|
|
9002
9413
|
},
|
|
9003
9414
|
[isActiveControlled, onActiveItemChange]
|
|
9004
9415
|
);
|
|
9005
|
-
const activateEntry = (0,
|
|
9416
|
+
const activateEntry = (0, import_react45.useCallback)(
|
|
9006
9417
|
(item, itemId) => {
|
|
9007
9418
|
if (item.disabled) {
|
|
9008
9419
|
return;
|
|
@@ -9015,7 +9426,7 @@ function TreeListViewInner({
|
|
|
9015
9426
|
},
|
|
9016
9427
|
[onItemSelect, selectedId, updateActiveItem]
|
|
9017
9428
|
);
|
|
9018
|
-
const activateResolvedItem = (0,
|
|
9429
|
+
const activateResolvedItem = (0, import_react45.useCallback)(
|
|
9019
9430
|
(itemId) => {
|
|
9020
9431
|
if (!itemId) {
|
|
9021
9432
|
return;
|
|
@@ -9029,7 +9440,7 @@ function TreeListViewInner({
|
|
|
9029
9440
|
},
|
|
9030
9441
|
[activateEntry, selectableItems]
|
|
9031
9442
|
);
|
|
9032
|
-
const handleItemCheckChange = (0,
|
|
9443
|
+
const handleItemCheckChange = (0, import_react45.useCallback)(
|
|
9033
9444
|
(item, checked) => {
|
|
9034
9445
|
onItemCheckChange?.(item, checked);
|
|
9035
9446
|
},
|
|
@@ -9099,7 +9510,7 @@ function TreeListViewInner({
|
|
|
9099
9510
|
function isItemChecked(item) {
|
|
9100
9511
|
return checkedIds ? checkedIds.includes(item.id) : item.checked === true;
|
|
9101
9512
|
}
|
|
9102
|
-
const toggleItemCheck = (0,
|
|
9513
|
+
const toggleItemCheck = (0, import_react45.useCallback)(
|
|
9103
9514
|
(itemId) => {
|
|
9104
9515
|
const item = findTreeListItemById(data, itemId);
|
|
9105
9516
|
if (!item || item.disabled || item.checked === void 0 && checkedIds === void 0) {
|
|
@@ -9110,7 +9521,7 @@ function TreeListViewInner({
|
|
|
9110
9521
|
},
|
|
9111
9522
|
[checkedIds, data, onItemCheckChange]
|
|
9112
9523
|
);
|
|
9113
|
-
(0,
|
|
9524
|
+
(0, import_react45.useImperativeHandle)(
|
|
9114
9525
|
ref,
|
|
9115
9526
|
() => ({
|
|
9116
9527
|
activateItem(itemId) {
|
|
@@ -9257,7 +9668,7 @@ function TreeListViewInner({
|
|
|
9257
9668
|
window.addEventListener("pointermove", handleColumnResizeMove);
|
|
9258
9669
|
window.addEventListener("pointerup", handleColumnResizeEnd);
|
|
9259
9670
|
}
|
|
9260
|
-
return /* @__PURE__ */ (0,
|
|
9671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
9261
9672
|
"div",
|
|
9262
9673
|
{
|
|
9263
9674
|
...props,
|
|
@@ -9269,7 +9680,7 @@ function TreeListViewInner({
|
|
|
9269
9680
|
role: "treegrid",
|
|
9270
9681
|
tabIndex: 0,
|
|
9271
9682
|
children: [
|
|
9272
|
-
/* @__PURE__ */ (0,
|
|
9683
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9273
9684
|
"div",
|
|
9274
9685
|
{
|
|
9275
9686
|
className: "nu-tree-list-view__header",
|
|
@@ -9277,7 +9688,7 @@ function TreeListViewInner({
|
|
|
9277
9688
|
style: {
|
|
9278
9689
|
"--nu-tree-list-view-columns": templateColumns
|
|
9279
9690
|
},
|
|
9280
|
-
children: columns.map((column, columnIndex) => /* @__PURE__ */ (0,
|
|
9691
|
+
children: columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
9281
9692
|
"span",
|
|
9282
9693
|
{
|
|
9283
9694
|
className: [
|
|
@@ -9288,8 +9699,8 @@ function TreeListViewInner({
|
|
|
9288
9699
|
"data-column-id": column.id,
|
|
9289
9700
|
role: "columnheader",
|
|
9290
9701
|
children: [
|
|
9291
|
-
/* @__PURE__ */ (0,
|
|
9292
|
-
column.resizable !== false ? /* @__PURE__ */ (0,
|
|
9702
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "nu-tree-list-view__header-label", children: renderMnemonicText(column.title) }),
|
|
9703
|
+
column.resizable !== false ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9293
9704
|
"button",
|
|
9294
9705
|
{
|
|
9295
9706
|
"aria-label": `Resize ${column.title} column`,
|
|
@@ -9305,7 +9716,7 @@ function TreeListViewInner({
|
|
|
9305
9716
|
))
|
|
9306
9717
|
}
|
|
9307
9718
|
),
|
|
9308
|
-
/* @__PURE__ */ (0,
|
|
9719
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "nu-tree-list-view__body", children: visibleItems.length > 0 ? data.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9309
9720
|
TreeListViewRow,
|
|
9310
9721
|
{
|
|
9311
9722
|
activeItemId: resolvedActiveItemId,
|
|
@@ -9332,15 +9743,15 @@ function TreeListViewInner({
|
|
|
9332
9743
|
uncheckedShape
|
|
9333
9744
|
},
|
|
9334
9745
|
item.id
|
|
9335
|
-
)) : /* @__PURE__ */ (0,
|
|
9746
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "nu-tree-list-view__empty", children: emptyText }) })
|
|
9336
9747
|
]
|
|
9337
9748
|
}
|
|
9338
9749
|
);
|
|
9339
9750
|
}
|
|
9340
|
-
var TreeListView = (0,
|
|
9751
|
+
var TreeListView = (0, import_react45.forwardRef)(TreeListViewInner);
|
|
9341
9752
|
|
|
9342
9753
|
// src/theme/NuThemeProvider.tsx
|
|
9343
|
-
var
|
|
9754
|
+
var import_react47 = require("react");
|
|
9344
9755
|
|
|
9345
9756
|
// src/theme/themes.ts
|
|
9346
9757
|
var classicTheme = {
|
|
@@ -9570,10 +9981,10 @@ function getNuDesktopPatternStyle(mode) {
|
|
|
9570
9981
|
}
|
|
9571
9982
|
|
|
9572
9983
|
// src/theme/themeContext.ts
|
|
9573
|
-
var
|
|
9574
|
-
var NuThemeContext = (0,
|
|
9984
|
+
var import_react46 = require("react");
|
|
9985
|
+
var NuThemeContext = (0, import_react46.createContext)(null);
|
|
9575
9986
|
function useNuTheme() {
|
|
9576
|
-
const context = (0,
|
|
9987
|
+
const context = (0, import_react46.useContext)(NuThemeContext);
|
|
9577
9988
|
if (!context) {
|
|
9578
9989
|
throw new Error("useNuTheme must be used within a NuThemeProvider.");
|
|
9579
9990
|
}
|
|
@@ -9581,7 +9992,7 @@ function useNuTheme() {
|
|
|
9581
9992
|
}
|
|
9582
9993
|
|
|
9583
9994
|
// src/theme/NuThemeProvider.tsx
|
|
9584
|
-
var
|
|
9995
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
9585
9996
|
function NuThemeProvider({
|
|
9586
9997
|
children,
|
|
9587
9998
|
className,
|
|
@@ -9599,18 +10010,18 @@ function NuThemeProvider({
|
|
|
9599
10010
|
onThemeChange,
|
|
9600
10011
|
theme
|
|
9601
10012
|
}) {
|
|
9602
|
-
const generatedId = (0,
|
|
9603
|
-
const [internalTheme, setInternalTheme] = (0,
|
|
9604
|
-
const [internalDesktopPatternMode, setInternalDesktopPatternMode] = (0,
|
|
9605
|
-
const [internalFontFamily, setInternalFontFamily] = (0,
|
|
9606
|
-
const [internalFontSize, setInternalFontSize] = (0,
|
|
10013
|
+
const generatedId = (0, import_react47.useId)();
|
|
10014
|
+
const [internalTheme, setInternalTheme] = (0, import_react47.useState)(defaultTheme);
|
|
10015
|
+
const [internalDesktopPatternMode, setInternalDesktopPatternMode] = (0, import_react47.useState)(defaultDesktopPatternMode);
|
|
10016
|
+
const [internalFontFamily, setInternalFontFamily] = (0, import_react47.useState)(defaultFontFamily);
|
|
10017
|
+
const [internalFontSize, setInternalFontSize] = (0, import_react47.useState)(defaultFontSize);
|
|
9607
10018
|
const currentTheme = theme ?? internalTheme;
|
|
9608
10019
|
const resolvedDesktopPatternMode = desktopPatternMode ?? internalDesktopPatternMode;
|
|
9609
10020
|
const resolvedFontFamily = fontFamily ?? internalFontFamily;
|
|
9610
10021
|
const resolvedFontSize = fontSize ?? internalFontSize;
|
|
9611
10022
|
const resolvedTheme = resolveNuTheme(currentTheme);
|
|
9612
10023
|
const themeName = typeof currentTheme === "string" ? currentTheme : currentTheme.name;
|
|
9613
|
-
const handleThemeChange = (0,
|
|
10024
|
+
const handleThemeChange = (0, import_react47.useCallback)(
|
|
9614
10025
|
(nextTheme) => {
|
|
9615
10026
|
if (theme === void 0) {
|
|
9616
10027
|
setInternalTheme(nextTheme);
|
|
@@ -9619,7 +10030,7 @@ function NuThemeProvider({
|
|
|
9619
10030
|
},
|
|
9620
10031
|
[theme, onThemeChange]
|
|
9621
10032
|
);
|
|
9622
|
-
const handleDesktopPatternModeChange = (0,
|
|
10033
|
+
const handleDesktopPatternModeChange = (0, import_react47.useCallback)(
|
|
9623
10034
|
(nextDesktopPatternMode) => {
|
|
9624
10035
|
if (desktopPatternMode === void 0) {
|
|
9625
10036
|
setInternalDesktopPatternMode(nextDesktopPatternMode);
|
|
@@ -9628,7 +10039,7 @@ function NuThemeProvider({
|
|
|
9628
10039
|
},
|
|
9629
10040
|
[desktopPatternMode, onDesktopPatternModeChange]
|
|
9630
10041
|
);
|
|
9631
|
-
const handleFontFamilyChange = (0,
|
|
10042
|
+
const handleFontFamilyChange = (0, import_react47.useCallback)(
|
|
9632
10043
|
(nextFontFamily) => {
|
|
9633
10044
|
if (fontFamily === void 0) {
|
|
9634
10045
|
setInternalFontFamily(nextFontFamily);
|
|
@@ -9637,7 +10048,7 @@ function NuThemeProvider({
|
|
|
9637
10048
|
},
|
|
9638
10049
|
[fontFamily, onFontFamilyChange]
|
|
9639
10050
|
);
|
|
9640
|
-
const handleFontSizeChange = (0,
|
|
10051
|
+
const handleFontSizeChange = (0, import_react47.useCallback)(
|
|
9641
10052
|
(nextFontSize) => {
|
|
9642
10053
|
if (fontSize === void 0) {
|
|
9643
10054
|
setInternalFontSize(nextFontSize);
|
|
@@ -9646,7 +10057,7 @@ function NuThemeProvider({
|
|
|
9646
10057
|
},
|
|
9647
10058
|
[fontSize, onFontSizeChange]
|
|
9648
10059
|
);
|
|
9649
|
-
const contextValue = (0,
|
|
10060
|
+
const contextValue = (0, import_react47.useMemo)(
|
|
9650
10061
|
() => ({
|
|
9651
10062
|
desktopPatternMode: resolvedDesktopPatternMode,
|
|
9652
10063
|
fontFamily: resolvedFontFamily,
|
|
@@ -9671,7 +10082,7 @@ function NuThemeProvider({
|
|
|
9671
10082
|
handleThemeChange
|
|
9672
10083
|
]
|
|
9673
10084
|
);
|
|
9674
|
-
return /* @__PURE__ */ (0,
|
|
10085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(NuThemeContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
9675
10086
|
"div",
|
|
9676
10087
|
{
|
|
9677
10088
|
className: ["nu-theme-root", className].filter(Boolean).join(" "),
|
|
@@ -9685,7 +10096,7 @@ function NuThemeProvider({
|
|
|
9685
10096
|
fontSize: `${resolvedFontSize}px`
|
|
9686
10097
|
},
|
|
9687
10098
|
children: [
|
|
9688
|
-
crtGlitch ? /* @__PURE__ */ (0,
|
|
10099
|
+
crtGlitch ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(NuCrtGlitch, { ...typeof crtGlitch === "object" ? crtGlitch : {} }) : null,
|
|
9689
10100
|
children
|
|
9690
10101
|
]
|
|
9691
10102
|
}
|
|
@@ -9714,6 +10125,8 @@ function NuThemeProvider({
|
|
|
9714
10125
|
NuCrtGlitch,
|
|
9715
10126
|
NuDesktop,
|
|
9716
10127
|
NuGlyph,
|
|
10128
|
+
NuIconGrid,
|
|
10129
|
+
NuIconProvider,
|
|
9717
10130
|
NuThemeContext,
|
|
9718
10131
|
NuThemeProvider,
|
|
9719
10132
|
NuView,
|
|
@@ -9756,6 +10169,7 @@ function NuThemeProvider({
|
|
|
9756
10169
|
resolveNuTheme,
|
|
9757
10170
|
useAppHostMenu,
|
|
9758
10171
|
useMainMenuState,
|
|
10172
|
+
useNuIconManager,
|
|
9759
10173
|
useNuTheme,
|
|
9760
10174
|
useNuWindowManager,
|
|
9761
10175
|
usePopupMenu,
|