@deadragdoll/reactnu 0.1.52 → 0.1.73
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/MainMenu/MainMenu.types.d.ts +11 -1
- package/dist/components/MainMenu/internals/MainMenuSubmenuShell.d.ts +7 -0
- package/dist/components/Spacer/Spacer.d.ts +7 -0
- package/dist/components/Spacer/index.d.ts +1 -0
- package/dist/components/ToolBar/ToolBar.d.ts +6 -2
- package/dist/components/Window/Window.d.ts +8 -2
- package/dist/components/Window/internals/WindowTitleBar.d.ts +3 -2
- package/dist/index.cjs +976 -846
- package/dist/index.d.ts +1 -0
- package/dist/index.js +777 -649
- package/dist/styles.css +119 -10
- package/dist/windowing/AppBarItem.d.ts +1 -1
- package/dist/windowing/WindowBar.d.ts +2 -0
- package/dist/windowing/windowing.types.d.ts +10 -0
- package/docs/API_REFERENCE.md +2 -0
- package/docs/COMPONENT_INDEX.md +1 -0
- package/docs/MainMenu.md +12 -1
- package/docs/NuWindowProvider.md +72 -0
- package/docs/PopupMenu.md +2 -0
- package/docs/Spacer.md +41 -0
- package/docs/StatusBarItem.md +1 -0
- package/docs/TOKEN_CHECKLIST.md +9 -0
- package/docs/ToolBar.md +15 -2
- package/docs/Window.md +19 -0
- package/docs/WindowBar.md +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Fragment as Fragment4,
|
|
4
4
|
useContext as useContext8,
|
|
5
|
-
useState as
|
|
5
|
+
useState as useState11
|
|
6
6
|
} from "react";
|
|
7
7
|
|
|
8
8
|
// src/components/MainMenu/MainMenu.tsx
|
|
9
|
-
import { useEffect, useRef, useState } from "react";
|
|
9
|
+
import { useEffect, useRef as useRef2, useState as useState2 } from "react";
|
|
10
10
|
|
|
11
11
|
// src/components/MainMenu/MainMenu.types.ts
|
|
12
12
|
function isMainMenuDivider(item) {
|
|
13
13
|
return item.type === "divider";
|
|
14
14
|
}
|
|
15
|
+
function isMainMenuSpacer(item) {
|
|
16
|
+
return item.type === "spacer";
|
|
17
|
+
}
|
|
15
18
|
function isMainMenuItem(item) {
|
|
16
|
-
return item.type
|
|
19
|
+
return item.type === void 0 || item.type === "item";
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
// src/components/Glyph/NuGlyph.tsx
|
|
@@ -239,8 +242,66 @@ function NuGlyph({ className, name, ...props }) {
|
|
|
239
242
|
);
|
|
240
243
|
}
|
|
241
244
|
|
|
245
|
+
// src/components/Spacer/Spacer.tsx
|
|
246
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
247
|
+
function Spacer({ className, ...props }) {
|
|
248
|
+
return /* @__PURE__ */ jsx2(
|
|
249
|
+
"span",
|
|
250
|
+
{
|
|
251
|
+
...props,
|
|
252
|
+
"aria-hidden": props["aria-hidden"] ?? true,
|
|
253
|
+
className: ["nu-spacer", className].filter(Boolean).join(" ")
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// src/components/MainMenu/internals/MainMenuSubmenuShell.tsx
|
|
259
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
260
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
261
|
+
function MainMenuSubmenuShell({
|
|
262
|
+
children,
|
|
263
|
+
placement
|
|
264
|
+
}) {
|
|
265
|
+
const shellRef = useRef(null);
|
|
266
|
+
const [opensLeft, setOpensLeft] = useState(false);
|
|
267
|
+
useLayoutEffect(() => {
|
|
268
|
+
const shellNode = shellRef.current;
|
|
269
|
+
if (!shellNode) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
const parentNode = shellNode.parentElement;
|
|
273
|
+
if (!parentNode) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
const submenuNode = shellNode;
|
|
277
|
+
const ownerNode = parentNode;
|
|
278
|
+
function updateDirection() {
|
|
279
|
+
const parentBounds = ownerNode.getBoundingClientRect();
|
|
280
|
+
const viewportWidth = document.documentElement.clientWidth;
|
|
281
|
+
const shouldOpenLeft = parentBounds.right + submenuNode.offsetWidth > viewportWidth;
|
|
282
|
+
setOpensLeft(
|
|
283
|
+
(currentValue) => currentValue === shouldOpenLeft ? currentValue : shouldOpenLeft
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
updateDirection();
|
|
287
|
+
window.addEventListener("resize", updateDirection);
|
|
288
|
+
return () => {
|
|
289
|
+
window.removeEventListener("resize", updateDirection);
|
|
290
|
+
};
|
|
291
|
+
}, []);
|
|
292
|
+
return /* @__PURE__ */ jsx3(
|
|
293
|
+
"div",
|
|
294
|
+
{
|
|
295
|
+
className: `nu-main-menu__submenu-shell nu-main-menu__submenu-shell--${placement}`,
|
|
296
|
+
"data-open-left": opensLeft || void 0,
|
|
297
|
+
ref: shellRef,
|
|
298
|
+
children
|
|
299
|
+
}
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
242
303
|
// src/utils/renderMnemonicText.tsx
|
|
243
|
-
import { Fragment as Fragment2, jsx as
|
|
304
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
244
305
|
function parseMnemonicText(inputText) {
|
|
245
306
|
const outputChars = [];
|
|
246
307
|
let mnemonicIndex = null;
|
|
@@ -277,7 +338,7 @@ function renderMnemonicText(text, keyClassName = "nu-mnemonic__key") {
|
|
|
277
338
|
}
|
|
278
339
|
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
279
340
|
parsedText.slice(0, mnemonicIndex),
|
|
280
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ jsx4("span", { className: keyClassName, children: parsedText.slice(mnemonicIndex, mnemonicIndex + 1) }),
|
|
281
342
|
parsedText.slice(mnemonicIndex + 1)
|
|
282
343
|
] });
|
|
283
344
|
}
|
|
@@ -286,7 +347,7 @@ function renderMnemonicNode(value, keyClassName = "nu-mnemonic__key") {
|
|
|
286
347
|
}
|
|
287
348
|
|
|
288
349
|
// src/components/MainMenu/internals/MainMenuList.tsx
|
|
289
|
-
import { jsx as
|
|
350
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
290
351
|
function getVisibleItems(items) {
|
|
291
352
|
return items.filter((item) => !item.hidden);
|
|
292
353
|
}
|
|
@@ -315,14 +376,14 @@ function MainMenuList({
|
|
|
315
376
|
const visibleItems = getVisibleItems(items);
|
|
316
377
|
const isRootBar = level === 0 && rootVariant === "bar";
|
|
317
378
|
const isPopupRow = !isRootBar;
|
|
318
|
-
return /* @__PURE__ */
|
|
379
|
+
return /* @__PURE__ */ jsx5(
|
|
319
380
|
"div",
|
|
320
381
|
{
|
|
321
382
|
className: isRootBar ? "nu-main-menu__bar" : "nu-main-menu__popup nu-main-menu__popup--submenu",
|
|
322
383
|
role: "menu",
|
|
323
384
|
children: visibleItems.map((item) => {
|
|
324
385
|
if (isMainMenuDivider(item)) {
|
|
325
|
-
return /* @__PURE__ */
|
|
386
|
+
return /* @__PURE__ */ jsx5(
|
|
326
387
|
"div",
|
|
327
388
|
{
|
|
328
389
|
className: "nu-main-menu__divider",
|
|
@@ -331,10 +392,18 @@ function MainMenuList({
|
|
|
331
392
|
item.id
|
|
332
393
|
);
|
|
333
394
|
}
|
|
334
|
-
|
|
395
|
+
if (isMainMenuSpacer(item)) {
|
|
396
|
+
return isRootBar ? /* @__PURE__ */ jsx5(Spacer, { className: "nu-main-menu__spacer" }, item.id) : null;
|
|
397
|
+
}
|
|
398
|
+
const hasChildren = Boolean(
|
|
399
|
+
item.items?.some((child) => isMainMenuItem(child) && !child.hidden)
|
|
400
|
+
);
|
|
335
401
|
const isCheckable = item.checkable === true;
|
|
336
402
|
const isOpen = activePath[level] === item.id;
|
|
337
403
|
const isChecked = item.checked === true;
|
|
404
|
+
const hasCheckMark = isCheckable || isChecked;
|
|
405
|
+
const hasLeadingAdornment = isPopupRow && (hasCheckMark || Boolean(item.icon));
|
|
406
|
+
const shortcut = isPopupRow && !hasChildren ? resolveItemShortcut(item) : null;
|
|
338
407
|
return /* @__PURE__ */ jsxs3(
|
|
339
408
|
"div",
|
|
340
409
|
{
|
|
@@ -353,41 +422,42 @@ function MainMenuList({
|
|
|
353
422
|
"aria-expanded": hasChildren ? isOpen : void 0,
|
|
354
423
|
"aria-haspopup": hasChildren || void 0,
|
|
355
424
|
className: "nu-main-menu__item-button",
|
|
425
|
+
"data-has-leading": hasLeadingAdornment || void 0,
|
|
356
426
|
disabled: item.disabled,
|
|
357
427
|
onClick: () => onActivateItem(item, level),
|
|
358
428
|
type: "button",
|
|
359
429
|
children: [
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
430
|
+
hasLeadingAdornment ? /* @__PURE__ */ jsxs3("span", { "aria-hidden": "true", className: "nu-main-menu__leading", children: [
|
|
431
|
+
hasCheckMark ? /* @__PURE__ */ jsx5(
|
|
432
|
+
"span",
|
|
433
|
+
{
|
|
434
|
+
className: [
|
|
435
|
+
"nu-main-menu__check",
|
|
436
|
+
isChecked ? "nu-main-menu__check--active" : null
|
|
437
|
+
].filter(Boolean).join(" "),
|
|
438
|
+
children: isCheckable ? /* @__PURE__ */ jsx5(
|
|
439
|
+
"span",
|
|
440
|
+
{
|
|
441
|
+
className: "nu-main-menu__check-box",
|
|
442
|
+
"data-unchecked-shape": uncheckedShape,
|
|
443
|
+
children: isChecked ? /* @__PURE__ */ jsx5(NuGlyph, { name: "check-mark" }) : null
|
|
444
|
+
}
|
|
445
|
+
) : /* @__PURE__ */ jsx5(NuGlyph, { name: "check-mark" })
|
|
446
|
+
}
|
|
447
|
+
) : null,
|
|
448
|
+
item.icon ? /* @__PURE__ */ jsx5("span", { className: "nu-main-menu__icon", children: item.icon }) : null
|
|
449
|
+
] }) : null,
|
|
450
|
+
/* @__PURE__ */ jsx5("span", { className: "nu-main-menu__label", children: renderItemLabel(item) }),
|
|
451
|
+
shortcut ? /* @__PURE__ */ jsx5("span", { className: "nu-main-menu__shortcut", children: shortcut }) : null,
|
|
452
|
+
isPopupRow && hasChildren ? /* @__PURE__ */ jsx5("span", { className: "nu-main-menu__submenu-arrow", children: "\u25B6" }) : null
|
|
381
453
|
]
|
|
382
454
|
}
|
|
383
455
|
),
|
|
384
|
-
hasChildren && isOpen && item.items ? /* @__PURE__ */
|
|
385
|
-
|
|
456
|
+
hasChildren && isOpen && item.items ? /* @__PURE__ */ jsx5(
|
|
457
|
+
MainMenuSubmenuShell,
|
|
386
458
|
{
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
].join(" "),
|
|
390
|
-
children: /* @__PURE__ */ jsx3(
|
|
459
|
+
placement: isRootBar ? "root" : "submenu",
|
|
460
|
+
children: /* @__PURE__ */ jsx5(
|
|
391
461
|
MainMenuList,
|
|
392
462
|
{
|
|
393
463
|
activePath,
|
|
@@ -410,9 +480,11 @@ function MainMenuList({
|
|
|
410
480
|
}
|
|
411
481
|
|
|
412
482
|
// src/components/MainMenu/MainMenu.tsx
|
|
413
|
-
import { jsx as
|
|
483
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
414
484
|
function hasVisibleChildren(item) {
|
|
415
|
-
return Boolean(
|
|
485
|
+
return Boolean(
|
|
486
|
+
item.items?.some((child) => isMainMenuItem(child) && !child.hidden)
|
|
487
|
+
);
|
|
416
488
|
}
|
|
417
489
|
function MainMenu({
|
|
418
490
|
className,
|
|
@@ -421,8 +493,8 @@ function MainMenu({
|
|
|
421
493
|
uncheckedShape = "box",
|
|
422
494
|
...props
|
|
423
495
|
}) {
|
|
424
|
-
const rootRef =
|
|
425
|
-
const [activePath, setActivePath] =
|
|
496
|
+
const rootRef = useRef2(null);
|
|
497
|
+
const [activePath, setActivePath] = useState2([]);
|
|
426
498
|
useEffect(() => {
|
|
427
499
|
function handlePointerDown(event) {
|
|
428
500
|
if (!rootRef.current?.contains(event.target)) {
|
|
@@ -466,13 +538,13 @@ function MainMenu({
|
|
|
466
538
|
return [...currentPath.slice(0, level), item.id];
|
|
467
539
|
});
|
|
468
540
|
}
|
|
469
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ jsx6(
|
|
470
542
|
"div",
|
|
471
543
|
{
|
|
472
544
|
...props,
|
|
473
545
|
className: ["nu-main-menu", className].filter(Boolean).join(" "),
|
|
474
546
|
ref: rootRef,
|
|
475
|
-
children: /* @__PURE__ */
|
|
547
|
+
children: /* @__PURE__ */ jsx6(
|
|
476
548
|
MainMenuList,
|
|
477
549
|
{
|
|
478
550
|
activePath,
|
|
@@ -488,10 +560,10 @@ function MainMenu({
|
|
|
488
560
|
}
|
|
489
561
|
|
|
490
562
|
// src/components/MainMenu/menuState.ts
|
|
491
|
-
import { useCallback, useMemo, useState as
|
|
563
|
+
import { useCallback, useMemo, useState as useState3 } from "react";
|
|
492
564
|
function patchMenuItem(items, id, patch) {
|
|
493
565
|
return items.map((item) => {
|
|
494
|
-
if (item.id === id &&
|
|
566
|
+
if (item.id === id && isMainMenuItem(item)) {
|
|
495
567
|
return {
|
|
496
568
|
...item,
|
|
497
569
|
...patch
|
|
@@ -507,10 +579,10 @@ function patchMenuItem(items, id, patch) {
|
|
|
507
579
|
});
|
|
508
580
|
}
|
|
509
581
|
function hasVisibleMainMenuItems(items) {
|
|
510
|
-
return items.some((item) => !item.hidden);
|
|
582
|
+
return items.some((item) => isMainMenuItem(item) && !item.hidden);
|
|
511
583
|
}
|
|
512
584
|
function useMainMenuState(initialMainMenu = []) {
|
|
513
|
-
const [mainMenu, setMainMenu] =
|
|
585
|
+
const [mainMenu, setMainMenu] = useState3(initialMainMenu);
|
|
514
586
|
const setMenuItem = useCallback((id, patch) => {
|
|
515
587
|
setMainMenu((currentMenu) => patchMenuItem(currentMenu, id, patch));
|
|
516
588
|
}, []);
|
|
@@ -577,7 +649,7 @@ function useMainMenuState(initialMainMenu = []) {
|
|
|
577
649
|
const toggleMenuChecked = useCallback((id) => {
|
|
578
650
|
setMainMenu(
|
|
579
651
|
(currentMenu) => currentMenu.map((item) => {
|
|
580
|
-
if (item.id === id &&
|
|
652
|
+
if (item.id === id && isMainMenuItem(item)) {
|
|
581
653
|
return {
|
|
582
654
|
...item,
|
|
583
655
|
checked: !item.checked
|
|
@@ -645,7 +717,7 @@ function useMainMenuState(initialMainMenu = []) {
|
|
|
645
717
|
}
|
|
646
718
|
function toggleMenuCheckedInTree(items, id) {
|
|
647
719
|
return items.map((item) => {
|
|
648
|
-
if (item.id === id &&
|
|
720
|
+
if (item.id === id && isMainMenuItem(item)) {
|
|
649
721
|
return {
|
|
650
722
|
...item,
|
|
651
723
|
checked: !item.checked
|
|
@@ -662,16 +734,16 @@ function toggleMenuCheckedInTree(items, id) {
|
|
|
662
734
|
}
|
|
663
735
|
|
|
664
736
|
// src/appHost/NuAppHostProvider.tsx
|
|
665
|
-
import { useMemo as useMemo5, useState as
|
|
737
|
+
import { useMemo as useMemo5, useState as useState7 } from "react";
|
|
666
738
|
|
|
667
739
|
// src/windowing/internals/MdiWindowPickerDialog.tsx
|
|
668
|
-
import { useMemo as useMemo4, useState as
|
|
740
|
+
import { useMemo as useMemo4, useState as useState6 } from "react";
|
|
669
741
|
|
|
670
742
|
// src/components/Button/Button.tsx
|
|
671
743
|
import {
|
|
672
744
|
useEffect as useEffect2,
|
|
673
|
-
useRef as
|
|
674
|
-
useState as
|
|
745
|
+
useRef as useRef3,
|
|
746
|
+
useState as useState4
|
|
675
747
|
} from "react";
|
|
676
748
|
|
|
677
749
|
// src/components/_shared/slotProps.ts
|
|
@@ -689,7 +761,7 @@ function mergeSlotStyle(baseStyle, slotStyle) {
|
|
|
689
761
|
}
|
|
690
762
|
|
|
691
763
|
// src/components/Button/Button.tsx
|
|
692
|
-
import { jsx as
|
|
764
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
693
765
|
function Button({
|
|
694
766
|
children,
|
|
695
767
|
className,
|
|
@@ -705,8 +777,8 @@ function Button({
|
|
|
705
777
|
variant = "primary",
|
|
706
778
|
...props
|
|
707
779
|
}) {
|
|
708
|
-
const buttonRef =
|
|
709
|
-
const [uncontrolledFocused, setUncontrolledFocused] =
|
|
780
|
+
const buttonRef = useRef3(null);
|
|
781
|
+
const [uncontrolledFocused, setUncontrolledFocused] = useState4(defaultFocused);
|
|
710
782
|
const isControlled = focused !== void 0;
|
|
711
783
|
const resolvedFocused = isControlled ? focused : uncontrolledFocused;
|
|
712
784
|
useEffect2(() => {
|
|
@@ -758,7 +830,7 @@ function Button({
|
|
|
758
830
|
className: cx("nu-button__face", slotClassNames?.face),
|
|
759
831
|
style: slotStyles?.face,
|
|
760
832
|
children: [
|
|
761
|
-
/* @__PURE__ */
|
|
833
|
+
/* @__PURE__ */ jsx7(
|
|
762
834
|
"span",
|
|
763
835
|
{
|
|
764
836
|
"aria-hidden": "true",
|
|
@@ -770,7 +842,7 @@ function Button({
|
|
|
770
842
|
style: slotStyles?.focusIndicatorLeft
|
|
771
843
|
}
|
|
772
844
|
),
|
|
773
|
-
/* @__PURE__ */
|
|
845
|
+
/* @__PURE__ */ jsx7(
|
|
774
846
|
"span",
|
|
775
847
|
{
|
|
776
848
|
className: cx("nu-button__label", slotClassNames?.label),
|
|
@@ -778,7 +850,7 @@ function Button({
|
|
|
778
850
|
children: renderMnemonicNode(children)
|
|
779
851
|
}
|
|
780
852
|
),
|
|
781
|
-
/* @__PURE__ */
|
|
853
|
+
/* @__PURE__ */ jsx7(
|
|
782
854
|
"span",
|
|
783
855
|
{
|
|
784
856
|
"aria-hidden": "true",
|
|
@@ -793,7 +865,7 @@ function Button({
|
|
|
793
865
|
]
|
|
794
866
|
}
|
|
795
867
|
),
|
|
796
|
-
/* @__PURE__ */
|
|
868
|
+
/* @__PURE__ */ jsx7(
|
|
797
869
|
"span",
|
|
798
870
|
{
|
|
799
871
|
"aria-hidden": "true",
|
|
@@ -805,7 +877,7 @@ function Button({
|
|
|
805
877
|
style: slotStyles?.shadowRight
|
|
806
878
|
}
|
|
807
879
|
),
|
|
808
|
-
/* @__PURE__ */
|
|
880
|
+
/* @__PURE__ */ jsx7(
|
|
809
881
|
"span",
|
|
810
882
|
{
|
|
811
883
|
"aria-hidden": "true",
|
|
@@ -830,8 +902,8 @@ import {
|
|
|
830
902
|
useId,
|
|
831
903
|
useImperativeHandle,
|
|
832
904
|
useMemo as useMemo3,
|
|
833
|
-
useRef as
|
|
834
|
-
useState as
|
|
905
|
+
useRef as useRef5,
|
|
906
|
+
useState as useState5
|
|
835
907
|
} from "react";
|
|
836
908
|
|
|
837
909
|
// src/components/ListBox/internals/helpers.ts
|
|
@@ -879,18 +951,18 @@ function getListBoxItemChecked(item, checkedIds) {
|
|
|
879
951
|
}
|
|
880
952
|
|
|
881
953
|
// src/components/ListBox/internals/renderLabel.tsx
|
|
882
|
-
import { jsx as
|
|
954
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
883
955
|
function renderLabel(label, className) {
|
|
884
956
|
return /* @__PURE__ */ jsxs5("span", { className, children: [
|
|
885
|
-
label.icon ? /* @__PURE__ */
|
|
886
|
-
/* @__PURE__ */
|
|
957
|
+
label.icon ? /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", className: `${className}-icon`, children: label.icon }) : null,
|
|
958
|
+
/* @__PURE__ */ jsx8("span", { className: `${className}-text`, children: label.text })
|
|
887
959
|
] });
|
|
888
960
|
}
|
|
889
961
|
|
|
890
962
|
// src/components/ListBox/internals/ListBoxCategoryView.tsx
|
|
891
|
-
import { jsx as
|
|
963
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
892
964
|
function ListBoxCategoryView({ category }) {
|
|
893
|
-
return /* @__PURE__ */
|
|
965
|
+
return /* @__PURE__ */ jsx9(
|
|
894
966
|
"div",
|
|
895
967
|
{
|
|
896
968
|
className: ["nu-listbox__category", category.className].filter(Boolean).join(" "),
|
|
@@ -908,7 +980,7 @@ import {
|
|
|
908
980
|
useContext,
|
|
909
981
|
useEffect as useEffect3,
|
|
910
982
|
useMemo as useMemo2,
|
|
911
|
-
useRef as
|
|
983
|
+
useRef as useRef4
|
|
912
984
|
} from "react";
|
|
913
985
|
|
|
914
986
|
// src/components/_shared/themePortal.ts
|
|
@@ -935,7 +1007,7 @@ function getThemePortalStyle(anchor) {
|
|
|
935
1007
|
}
|
|
936
1008
|
|
|
937
1009
|
// src/components/DragDrop/NuDragDropProvider.tsx
|
|
938
|
-
import { jsx as
|
|
1010
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
939
1011
|
var DRAG_THRESHOLD = 3;
|
|
940
1012
|
function createDragPreview(sourceElement) {
|
|
941
1013
|
const rect = sourceElement.getBoundingClientRect();
|
|
@@ -1037,7 +1109,7 @@ var fallbackController = createController();
|
|
|
1037
1109
|
var NuDragDropContext = createContext(null);
|
|
1038
1110
|
function NuDragDropProvider({ children }) {
|
|
1039
1111
|
const controller = useMemo2(() => createController(), []);
|
|
1040
|
-
return /* @__PURE__ */
|
|
1112
|
+
return /* @__PURE__ */ jsx10(NuDragDropContext.Provider, { value: controller, children });
|
|
1041
1113
|
}
|
|
1042
1114
|
function useNuDragDrop() {
|
|
1043
1115
|
return useContext(NuDragDropContext) ?? fallbackController;
|
|
@@ -1058,7 +1130,7 @@ function useNuDragSource({
|
|
|
1058
1130
|
sourceType
|
|
1059
1131
|
}) {
|
|
1060
1132
|
const controller = useNuDragDrop();
|
|
1061
|
-
const stateRef =
|
|
1133
|
+
const stateRef = useRef4({
|
|
1062
1134
|
dragging: false,
|
|
1063
1135
|
pointerId: -1,
|
|
1064
1136
|
sourceElement: null,
|
|
@@ -1133,14 +1205,14 @@ function useNuDragSource({
|
|
|
1133
1205
|
}
|
|
1134
1206
|
|
|
1135
1207
|
// src/components/ListBox/internals/ListBoxCheckControl.tsx
|
|
1136
|
-
import { jsx as
|
|
1208
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1137
1209
|
function ListBoxCheckControl({
|
|
1138
1210
|
isChecked,
|
|
1139
1211
|
onActivate,
|
|
1140
1212
|
onToggleCheck,
|
|
1141
1213
|
uncheckedShape
|
|
1142
1214
|
}) {
|
|
1143
|
-
return /* @__PURE__ */
|
|
1215
|
+
return /* @__PURE__ */ jsx11(
|
|
1144
1216
|
"button",
|
|
1145
1217
|
{
|
|
1146
1218
|
"aria-label": isChecked ? "Uncheck item" : "Check item",
|
|
@@ -1152,13 +1224,13 @@ function ListBoxCheckControl({
|
|
|
1152
1224
|
onToggleCheck();
|
|
1153
1225
|
},
|
|
1154
1226
|
type: "button",
|
|
1155
|
-
children: /* @__PURE__ */
|
|
1227
|
+
children: /* @__PURE__ */ jsx11(
|
|
1156
1228
|
"span",
|
|
1157
1229
|
{
|
|
1158
1230
|
"aria-hidden": "true",
|
|
1159
1231
|
className: "nu-listbox__check-box",
|
|
1160
1232
|
"data-unchecked-shape": uncheckedShape,
|
|
1161
|
-
children: isChecked ? /* @__PURE__ */
|
|
1233
|
+
children: isChecked ? /* @__PURE__ */ jsx11(NuGlyph, { className: "nu-listbox__check-indicator", name: "check-mark" }) : null
|
|
1162
1234
|
}
|
|
1163
1235
|
)
|
|
1164
1236
|
}
|
|
@@ -1166,7 +1238,7 @@ function ListBoxCheckControl({
|
|
|
1166
1238
|
}
|
|
1167
1239
|
|
|
1168
1240
|
// src/components/ListBox/internals/ListBoxItemView.tsx
|
|
1169
|
-
import { jsx as
|
|
1241
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1170
1242
|
function ListBoxItemViewInner({
|
|
1171
1243
|
group,
|
|
1172
1244
|
getDragItem,
|
|
@@ -1208,7 +1280,7 @@ function ListBoxItemViewInner({
|
|
|
1208
1280
|
function handleToggleCheck() {
|
|
1209
1281
|
onToggleCheck(itemId);
|
|
1210
1282
|
}
|
|
1211
|
-
const checkControl = item.checkable ? /* @__PURE__ */
|
|
1283
|
+
const checkControl = item.checkable ? /* @__PURE__ */ jsx12(
|
|
1212
1284
|
ListBoxCheckControl,
|
|
1213
1285
|
{
|
|
1214
1286
|
isChecked,
|
|
@@ -1246,7 +1318,7 @@ function ListBoxItemViewInner({
|
|
|
1246
1318
|
rightCheckBox ? null : checkControl,
|
|
1247
1319
|
renderLabel(item.name, "nu-listbox__item-label")
|
|
1248
1320
|
] }),
|
|
1249
|
-
item.details ? /* @__PURE__ */
|
|
1321
|
+
item.details ? /* @__PURE__ */ jsx12("span", { className: "nu-listbox__item-details", children: item.details }) : null,
|
|
1250
1322
|
rightCheckBox ? checkControl : null
|
|
1251
1323
|
]
|
|
1252
1324
|
}
|
|
@@ -1255,7 +1327,7 @@ function ListBoxItemViewInner({
|
|
|
1255
1327
|
var ListBoxItemView = memo(ListBoxItemViewInner);
|
|
1256
1328
|
|
|
1257
1329
|
// src/components/ListBox/internals/ListBoxGroupView.tsx
|
|
1258
|
-
import { jsx as
|
|
1330
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1259
1331
|
function ListBoxGroupView({
|
|
1260
1332
|
group,
|
|
1261
1333
|
groupIndex,
|
|
@@ -1274,7 +1346,7 @@ function ListBoxGroupView({
|
|
|
1274
1346
|
uncheckedShape
|
|
1275
1347
|
}) {
|
|
1276
1348
|
return /* @__PURE__ */ jsxs7("div", { className: "nu-listbox__group", role: "group", children: [
|
|
1277
|
-
group.category ? /* @__PURE__ */
|
|
1349
|
+
group.category ? /* @__PURE__ */ jsx13(ListBoxCategoryView, { category: group.category }) : null,
|
|
1278
1350
|
group.items.map((item, itemIndex) => {
|
|
1279
1351
|
const itemId = buildListBoxItemId(
|
|
1280
1352
|
listboxId,
|
|
@@ -1286,7 +1358,7 @@ function ListBoxGroupView({
|
|
|
1286
1358
|
const isSelected = selectedId ? item.id === selectedId : item.selected;
|
|
1287
1359
|
const isActive = resolvedActiveId === itemId;
|
|
1288
1360
|
const isChecked = isItemChecked(item);
|
|
1289
|
-
return /* @__PURE__ */
|
|
1361
|
+
return /* @__PURE__ */ jsx13(
|
|
1290
1362
|
ListBoxItemView,
|
|
1291
1363
|
{
|
|
1292
1364
|
group,
|
|
@@ -1312,7 +1384,7 @@ function ListBoxGroupView({
|
|
|
1312
1384
|
}
|
|
1313
1385
|
|
|
1314
1386
|
// src/components/ListBox/ListBox.tsx
|
|
1315
|
-
import { jsx as
|
|
1387
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1316
1388
|
function ListBoxInner({
|
|
1317
1389
|
acceptsDrop,
|
|
1318
1390
|
className,
|
|
@@ -1332,10 +1404,10 @@ function ListBoxInner({
|
|
|
1332
1404
|
...props
|
|
1333
1405
|
}, ref) {
|
|
1334
1406
|
const hasItems = data.some((group) => group.items.length > 0);
|
|
1335
|
-
const rootRef =
|
|
1336
|
-
const [rootElement, setRootElement] =
|
|
1407
|
+
const rootRef = useRef5(null);
|
|
1408
|
+
const [rootElement, setRootElement] = useState5(null);
|
|
1337
1409
|
const listboxId = useId();
|
|
1338
|
-
const itemRefs =
|
|
1410
|
+
const itemRefs = useRef5({});
|
|
1339
1411
|
const flattenedItems = useMemo3(
|
|
1340
1412
|
() => flattenListBoxData(data, listboxId),
|
|
1341
1413
|
[data, listboxId]
|
|
@@ -1344,7 +1416,7 @@ function ListBoxInner({
|
|
|
1344
1416
|
() => flattenedItems.filter(({ item }) => !item.disabled),
|
|
1345
1417
|
[flattenedItems]
|
|
1346
1418
|
);
|
|
1347
|
-
const [activeId, setActiveId] =
|
|
1419
|
+
const [activeId, setActiveId] = useState5(
|
|
1348
1420
|
() => getInitialActiveId(selectableItems, selectedId)
|
|
1349
1421
|
);
|
|
1350
1422
|
const dropTargetOptions = useMemo3(
|
|
@@ -1504,7 +1576,7 @@ function ListBoxInner({
|
|
|
1504
1576
|
break;
|
|
1505
1577
|
}
|
|
1506
1578
|
}
|
|
1507
|
-
return /* @__PURE__ */
|
|
1579
|
+
return /* @__PURE__ */ jsx14(
|
|
1508
1580
|
"div",
|
|
1509
1581
|
{
|
|
1510
1582
|
...props,
|
|
@@ -1515,7 +1587,7 @@ function ListBoxInner({
|
|
|
1515
1587
|
ref: setRootRef,
|
|
1516
1588
|
role: "listbox",
|
|
1517
1589
|
tabIndex: 0,
|
|
1518
|
-
children: hasItems ? data.map((group, groupIndex) => /* @__PURE__ */
|
|
1590
|
+
children: hasItems ? data.map((group, groupIndex) => /* @__PURE__ */ jsx14(
|
|
1519
1591
|
ListBoxGroupView,
|
|
1520
1592
|
{
|
|
1521
1593
|
group,
|
|
@@ -1535,14 +1607,14 @@ function ListBoxInner({
|
|
|
1535
1607
|
uncheckedShape
|
|
1536
1608
|
},
|
|
1537
1609
|
`${group.category?.text ?? "group"}-${groupIndex}`
|
|
1538
|
-
)) : /* @__PURE__ */
|
|
1610
|
+
)) : /* @__PURE__ */ jsx14("div", { className: "nu-listbox__empty", children: emptyText })
|
|
1539
1611
|
}
|
|
1540
1612
|
);
|
|
1541
1613
|
}
|
|
1542
1614
|
var ListBox = forwardRef(ListBoxInner);
|
|
1543
1615
|
|
|
1544
1616
|
// src/components/Stack/Stack.tsx
|
|
1545
|
-
import { jsx as
|
|
1617
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1546
1618
|
function resolveFlexAlign(align) {
|
|
1547
1619
|
if (align === "start") {
|
|
1548
1620
|
return "flex-start";
|
|
@@ -1571,7 +1643,7 @@ function Stack({
|
|
|
1571
1643
|
style,
|
|
1572
1644
|
...props
|
|
1573
1645
|
}) {
|
|
1574
|
-
return /* @__PURE__ */
|
|
1646
|
+
return /* @__PURE__ */ jsx15(
|
|
1575
1647
|
"div",
|
|
1576
1648
|
{
|
|
1577
1649
|
...props,
|
|
@@ -1591,7 +1663,7 @@ function Stack({
|
|
|
1591
1663
|
}
|
|
1592
1664
|
|
|
1593
1665
|
// src/windowing/internals/MdiWindowPickerDialog.tsx
|
|
1594
|
-
import { jsx as
|
|
1666
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1595
1667
|
function isPickerEligibleWindow(windowEntry) {
|
|
1596
1668
|
if (windowEntry.mode === "window") {
|
|
1597
1669
|
return true;
|
|
@@ -1631,7 +1703,7 @@ function MdiWindowPickerDialog({
|
|
|
1631
1703
|
),
|
|
1632
1704
|
[domain, windows]
|
|
1633
1705
|
);
|
|
1634
|
-
const [selectedId, setSelectedId] =
|
|
1706
|
+
const [selectedId, setSelectedId] = useState6(
|
|
1635
1707
|
activeWindowId ?? resolvedWindows[0]?.id ?? ""
|
|
1636
1708
|
);
|
|
1637
1709
|
const resolvedSelectedId = resolvedWindows.some(
|
|
@@ -1645,7 +1717,7 @@ function MdiWindowPickerDialog({
|
|
|
1645
1717
|
onClose();
|
|
1646
1718
|
}
|
|
1647
1719
|
return /* @__PURE__ */ jsxs8(Stack, { gap: "md", children: [
|
|
1648
|
-
/* @__PURE__ */
|
|
1720
|
+
/* @__PURE__ */ jsx16(
|
|
1649
1721
|
ListBox,
|
|
1650
1722
|
{
|
|
1651
1723
|
data: [
|
|
@@ -1654,6 +1726,7 @@ function MdiWindowPickerDialog({
|
|
|
1654
1726
|
items: resolvedWindows.map((windowEntry, index) => ({
|
|
1655
1727
|
id: windowEntry.id,
|
|
1656
1728
|
name: {
|
|
1729
|
+
icon: windowEntry.icon,
|
|
1657
1730
|
text: `${index + 1} ${formatPickerWindowTitle(windows, windowEntry)}`
|
|
1658
1731
|
},
|
|
1659
1732
|
selected: windowEntry.id === activeWindowId
|
|
@@ -1680,14 +1753,14 @@ function MdiWindowPickerDialog({
|
|
|
1680
1753
|
}
|
|
1681
1754
|
),
|
|
1682
1755
|
/* @__PURE__ */ jsxs8(Stack, { direction: "row", gap: "sm", children: [
|
|
1683
|
-
/* @__PURE__ */
|
|
1684
|
-
/* @__PURE__ */
|
|
1756
|
+
/* @__PURE__ */ jsx16(Button, { defaultFocused: true, onClick: handleActivate, children: "Activate" }),
|
|
1757
|
+
/* @__PURE__ */ jsx16(Button, { onClick: onClose, variant: "secondary", children: "Cancel" })
|
|
1685
1758
|
] })
|
|
1686
1759
|
] });
|
|
1687
1760
|
}
|
|
1688
1761
|
|
|
1689
1762
|
// src/windowing/mdiMenu.tsx
|
|
1690
|
-
import { jsx as
|
|
1763
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1691
1764
|
var MDI_HOST_ID = "mdi.host";
|
|
1692
1765
|
function createMdiDivider(id) {
|
|
1693
1766
|
return {
|
|
@@ -1726,7 +1799,7 @@ function openMdiWindowPicker(bridge) {
|
|
|
1726
1799
|
bridge.openDialog({
|
|
1727
1800
|
appModal: true,
|
|
1728
1801
|
border: "double",
|
|
1729
|
-
content: ({ close }) => /* @__PURE__ */
|
|
1802
|
+
content: ({ close }) => /* @__PURE__ */ jsx17(
|
|
1730
1803
|
MdiWindowPickerDialog,
|
|
1731
1804
|
{
|
|
1732
1805
|
activeWindowId,
|
|
@@ -1769,6 +1842,7 @@ function buildStandardMdiMenuItems(bridge) {
|
|
|
1769
1842
|
...mdiWindows.map((windowEntry, index) => ({
|
|
1770
1843
|
checked: windowEntry.id === activeWindowId,
|
|
1771
1844
|
id: `mdi.window.${windowEntry.id}`,
|
|
1845
|
+
icon: windowEntry.icon,
|
|
1772
1846
|
onSelect: () => bridge?.activateWindow(windowEntry.id),
|
|
1773
1847
|
text: `${index + 1} ${windowEntry.title}`
|
|
1774
1848
|
})),
|
|
@@ -1796,7 +1870,7 @@ function resolveMdiMainMenuItems(items, bridge) {
|
|
|
1796
1870
|
if (isMainMenuDivider(item)) {
|
|
1797
1871
|
return item;
|
|
1798
1872
|
}
|
|
1799
|
-
if (item.id === MDI_HOST_ID) {
|
|
1873
|
+
if (isMainMenuItem(item) && item.id === MDI_HOST_ID) {
|
|
1800
1874
|
return {
|
|
1801
1875
|
...item,
|
|
1802
1876
|
items: mergeMdiMenuItems(item.items, bridge)
|
|
@@ -1843,13 +1917,13 @@ function useAppHostMenu() {
|
|
|
1843
1917
|
}
|
|
1844
1918
|
|
|
1845
1919
|
// src/appHost/NuAppHostProvider.tsx
|
|
1846
|
-
import { jsx as
|
|
1920
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1847
1921
|
function NuAppHostProvider({
|
|
1848
1922
|
children,
|
|
1849
1923
|
renderMenu = true
|
|
1850
1924
|
}) {
|
|
1851
1925
|
const menuState = useMainMenuState();
|
|
1852
|
-
const [windowBridge, setWindowBridge] =
|
|
1926
|
+
const [windowBridge, setWindowBridge] = useState7(
|
|
1853
1927
|
null
|
|
1854
1928
|
);
|
|
1855
1929
|
const resolvedMainMenu = useMemo5(
|
|
@@ -1865,7 +1939,7 @@ function NuAppHostProvider({
|
|
|
1865
1939
|
[menuState, windowBridge]
|
|
1866
1940
|
);
|
|
1867
1941
|
return /* @__PURE__ */ jsxs9(AppHostMenuContext.Provider, { value: contextValue, children: [
|
|
1868
|
-
renderMenu && hasVisibleMainMenuItems(resolvedMainMenu) ? /* @__PURE__ */
|
|
1942
|
+
renderMenu && hasVisibleMainMenuItems(resolvedMainMenu) ? /* @__PURE__ */ jsx18(MainMenu, { items: resolvedMainMenu }) : null,
|
|
1869
1943
|
children
|
|
1870
1944
|
] });
|
|
1871
1945
|
}
|
|
@@ -1877,24 +1951,24 @@ import {
|
|
|
1877
1951
|
useContext as useContext7,
|
|
1878
1952
|
useEffect as useEffect6,
|
|
1879
1953
|
useMemo as useMemo7,
|
|
1880
|
-
useRef as
|
|
1881
|
-
useState as
|
|
1954
|
+
useRef as useRef8,
|
|
1955
|
+
useState as useState10
|
|
1882
1956
|
} from "react";
|
|
1883
1957
|
|
|
1884
1958
|
// src/components/Window/Window.tsx
|
|
1885
1959
|
import {
|
|
1886
1960
|
memo as memo2,
|
|
1887
1961
|
useContext as useContext5,
|
|
1888
|
-
useLayoutEffect,
|
|
1962
|
+
useLayoutEffect as useLayoutEffect2,
|
|
1889
1963
|
useMemo as useMemo6,
|
|
1890
|
-
useRef as
|
|
1964
|
+
useRef as useRef6
|
|
1891
1965
|
} from "react";
|
|
1892
1966
|
|
|
1893
1967
|
// src/components/Window/internals/WindowStatusBar.tsx
|
|
1894
1968
|
import { Children } from "react";
|
|
1895
1969
|
|
|
1896
1970
|
// src/components/Window/StatusBarItem.tsx
|
|
1897
|
-
import { jsx as
|
|
1971
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1898
1972
|
function StatusBarItem({
|
|
1899
1973
|
align = "start",
|
|
1900
1974
|
children,
|
|
@@ -1902,7 +1976,7 @@ function StatusBarItem({
|
|
|
1902
1976
|
grow = false,
|
|
1903
1977
|
...props
|
|
1904
1978
|
}) {
|
|
1905
|
-
return /* @__PURE__ */
|
|
1979
|
+
return /* @__PURE__ */ jsx19(
|
|
1906
1980
|
"span",
|
|
1907
1981
|
{
|
|
1908
1982
|
...props,
|
|
@@ -1918,7 +1992,7 @@ function StatusBarItem({
|
|
|
1918
1992
|
}
|
|
1919
1993
|
|
|
1920
1994
|
// src/components/Window/internals/WindowStatusBar.tsx
|
|
1921
|
-
import { jsx as
|
|
1995
|
+
import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1922
1996
|
function WindowStatusBar({
|
|
1923
1997
|
children,
|
|
1924
1998
|
onResizeStart,
|
|
@@ -1934,15 +2008,15 @@ function WindowStatusBar({
|
|
|
1934
2008
|
{
|
|
1935
2009
|
className: ["nu-window__status-bar", statusBarClassName].filter(Boolean).join(" "),
|
|
1936
2010
|
children: [
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
resizable ? /* @__PURE__ */
|
|
2011
|
+
/* @__PURE__ */ jsx20("span", { className: "nu-window__status-bar-items", children: hasCustomItems ? resolvedChildren : resolvedChildren.map((child, index) => /* @__PURE__ */ jsx20(StatusBarItem, { grow: index === 0, children: child }, `status-item-${index}`)) }),
|
|
2012
|
+
resizable ? /* @__PURE__ */ jsx20(
|
|
1939
2013
|
"button",
|
|
1940
2014
|
{
|
|
1941
2015
|
"aria-label": "Resize window",
|
|
1942
2016
|
className: "nu-window__resize-handle",
|
|
1943
2017
|
onPointerDown: onResizeStart,
|
|
1944
2018
|
type: "button",
|
|
1945
|
-
children: /* @__PURE__ */
|
|
2019
|
+
children: /* @__PURE__ */ jsx20(NuGlyph, { name: "window-resize" })
|
|
1946
2020
|
}
|
|
1947
2021
|
) : null
|
|
1948
2022
|
]
|
|
@@ -1951,18 +2025,18 @@ function WindowStatusBar({
|
|
|
1951
2025
|
}
|
|
1952
2026
|
|
|
1953
2027
|
// src/components/Window/WindowTitleButton.tsx
|
|
1954
|
-
import { jsx as
|
|
2028
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1955
2029
|
function renderWindowTriangleGlyph(icon) {
|
|
1956
2030
|
const glyphNameByIcon = {
|
|
1957
2031
|
maximize: "window-maximize",
|
|
1958
2032
|
minimize: "window-minimize",
|
|
1959
2033
|
restore: "window-restore"
|
|
1960
2034
|
};
|
|
1961
|
-
return /* @__PURE__ */
|
|
2035
|
+
return /* @__PURE__ */ jsx21(NuGlyph, { className: "nu-window__title-glyph", name: glyphNameByIcon[icon] });
|
|
1962
2036
|
}
|
|
1963
2037
|
function renderTitleButtonIcon(icon) {
|
|
1964
2038
|
if (icon === "close") {
|
|
1965
|
-
return /* @__PURE__ */
|
|
2039
|
+
return /* @__PURE__ */ jsx21(NuGlyph, { className: "nu-window__title-glyph", name: "window-close" });
|
|
1966
2040
|
}
|
|
1967
2041
|
if (icon === "minimize" || icon === "maximize" || icon === "restore") {
|
|
1968
2042
|
return renderWindowTriangleGlyph(
|
|
@@ -1981,7 +2055,7 @@ function WindowTitleButton({
|
|
|
1981
2055
|
variant = icon === "close" ? "close" : "default",
|
|
1982
2056
|
...props
|
|
1983
2057
|
}) {
|
|
1984
|
-
return /* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ jsx21(
|
|
1985
2059
|
"button",
|
|
1986
2060
|
{
|
|
1987
2061
|
...props,
|
|
@@ -2003,9 +2077,10 @@ function WindowTitleButton({
|
|
|
2003
2077
|
}
|
|
2004
2078
|
|
|
2005
2079
|
// src/components/Window/internals/WindowTitleBar.tsx
|
|
2006
|
-
import { jsx as
|
|
2080
|
+
import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2007
2081
|
function WindowTitleBar({
|
|
2008
2082
|
draggable,
|
|
2083
|
+
icon,
|
|
2009
2084
|
onDragStart,
|
|
2010
2085
|
titleButtons,
|
|
2011
2086
|
title
|
|
@@ -2021,8 +2096,9 @@ function WindowTitleBar({
|
|
|
2021
2096
|
"--nu-window-title-controls-width": controlsWidth
|
|
2022
2097
|
},
|
|
2023
2098
|
children: [
|
|
2024
|
-
/* @__PURE__ */
|
|
2025
|
-
|
|
2099
|
+
/* @__PURE__ */ jsx22("span", { "aria-hidden": true, className: "nu-window__title-icon", children: icon }),
|
|
2100
|
+
/* @__PURE__ */ jsx22("span", { className: "nu-window__title", children: renderMnemonicText(title) }),
|
|
2101
|
+
titleButtons.length > 0 ? /* @__PURE__ */ jsx22("span", { className: "nu-window__title-controls", children: titleButtons.map((button, index) => /* @__PURE__ */ jsx22(
|
|
2026
2102
|
WindowTitleButton,
|
|
2027
2103
|
{
|
|
2028
2104
|
ariaLabel: button.ariaLabel,
|
|
@@ -2103,7 +2179,7 @@ function useWindowMenu() {
|
|
|
2103
2179
|
}
|
|
2104
2180
|
|
|
2105
2181
|
// src/components/Window/Window.tsx
|
|
2106
|
-
import { jsx as
|
|
2182
|
+
import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2107
2183
|
function getWindowLayerBounds(node) {
|
|
2108
2184
|
const parentNode = node.parentElement;
|
|
2109
2185
|
if (!parentNode) {
|
|
@@ -2121,16 +2197,23 @@ function getWindowGeometry(node) {
|
|
|
2121
2197
|
width: rect.width
|
|
2122
2198
|
};
|
|
2123
2199
|
}
|
|
2200
|
+
function getValidAspectRatio(value) {
|
|
2201
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
|
|
2202
|
+
}
|
|
2124
2203
|
function WindowInner({
|
|
2125
2204
|
active = true,
|
|
2205
|
+
aspectRatio,
|
|
2126
2206
|
bodyClassName,
|
|
2127
2207
|
border = "single",
|
|
2128
2208
|
children,
|
|
2129
2209
|
className,
|
|
2130
2210
|
closeable = true,
|
|
2131
2211
|
draggable,
|
|
2212
|
+
icon,
|
|
2132
2213
|
maximizable,
|
|
2133
2214
|
maximized = false,
|
|
2215
|
+
minHeight,
|
|
2216
|
+
minWidth,
|
|
2134
2217
|
minimizable,
|
|
2135
2218
|
minimized = false,
|
|
2136
2219
|
mode = "dialog",
|
|
@@ -2151,15 +2234,16 @@ function WindowInner({
|
|
|
2151
2234
|
title,
|
|
2152
2235
|
...props
|
|
2153
2236
|
}) {
|
|
2154
|
-
const windowRef =
|
|
2155
|
-
const dragFrameRef =
|
|
2156
|
-
const dragPositionRef =
|
|
2157
|
-
const resizeFrameRef =
|
|
2158
|
-
const resizeSizeRef =
|
|
2237
|
+
const windowRef = useRef6(null);
|
|
2238
|
+
const dragFrameRef = useRef6(null);
|
|
2239
|
+
const dragPositionRef = useRef6(null);
|
|
2240
|
+
const resizeFrameRef = useRef6(null);
|
|
2241
|
+
const resizeSizeRef = useRef6(null);
|
|
2159
2242
|
const menuState = useMainMenuState();
|
|
2160
2243
|
const windowManager = useContext5(NuWindowContext);
|
|
2161
2244
|
const isDraggable = draggable ?? mode === "window";
|
|
2162
|
-
const
|
|
2245
|
+
const resolvedAspectRatio = getValidAspectRatio(aspectRatio);
|
|
2246
|
+
const isMaximizable = resolvedAspectRatio === void 0 && (maximizable ?? mode === "window");
|
|
2163
2247
|
const isMinimizable = minimizable ?? mode === "window";
|
|
2164
2248
|
const isResizable = resizable ?? mode === "window";
|
|
2165
2249
|
const mdiBridge = useMemo6(
|
|
@@ -2185,7 +2269,7 @@ function WindowInner({
|
|
|
2185
2269
|
onToggleMinimized
|
|
2186
2270
|
});
|
|
2187
2271
|
const resolvedTitleButtons = titleButtons ?? systemTitleButtons;
|
|
2188
|
-
|
|
2272
|
+
useLayoutEffect2(() => {
|
|
2189
2273
|
if (!onBoundsChange || !windowRef.current || minimized) {
|
|
2190
2274
|
return;
|
|
2191
2275
|
}
|
|
@@ -2309,22 +2393,16 @@ function WindowInner({
|
|
|
2309
2393
|
} = getWindowGeometry(windowNode);
|
|
2310
2394
|
const layerBounds = getWindowLayerBounds(windowNode);
|
|
2311
2395
|
const computedStyle = window.getComputedStyle(windowNode);
|
|
2312
|
-
const
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
);
|
|
2316
|
-
const
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
(layerBounds?.width ?? window.innerWidth) - left
|
|
2323
|
-
);
|
|
2324
|
-
const maxHeight = Math.max(
|
|
2325
|
-
minHeight,
|
|
2326
|
-
(layerBounds?.height ?? window.innerHeight) - top
|
|
2327
|
-
);
|
|
2396
|
+
const minWidth2 = Number.parseFloat(computedStyle.minWidth || "0") || 0;
|
|
2397
|
+
const minHeight2 = Number.parseFloat(computedStyle.minHeight || "0") || 0;
|
|
2398
|
+
const availableWidth = (layerBounds?.width ?? window.innerWidth) - left;
|
|
2399
|
+
const availableHeight = (layerBounds?.height ?? window.innerHeight) - top;
|
|
2400
|
+
const ratioMinWidth = resolvedAspectRatio ? Math.max(minWidth2, minHeight2 * resolvedAspectRatio) : minWidth2;
|
|
2401
|
+
const maxWidth = resolvedAspectRatio ? Math.max(
|
|
2402
|
+
ratioMinWidth,
|
|
2403
|
+
Math.min(availableWidth, availableHeight * resolvedAspectRatio)
|
|
2404
|
+
) : Math.max(minWidth2, availableWidth);
|
|
2405
|
+
const maxHeight = resolvedAspectRatio ? maxWidth / resolvedAspectRatio : Math.max(minHeight2, availableHeight);
|
|
2328
2406
|
const hadTransform = computedStyle.transform !== "none";
|
|
2329
2407
|
let didResize = false;
|
|
2330
2408
|
if (hadTransform) {
|
|
@@ -2349,14 +2427,16 @@ function WindowInner({
|
|
|
2349
2427
|
resizeFrameRef.current = window.requestAnimationFrame(flushResize);
|
|
2350
2428
|
}
|
|
2351
2429
|
function handlePointerMove(moveEvent) {
|
|
2352
|
-
const
|
|
2430
|
+
const widthDelta = moveEvent.clientX - startClientX;
|
|
2431
|
+
const heightDelta = moveEvent.clientY - startClientY;
|
|
2432
|
+
const nextWidth = resolvedAspectRatio ? Math.min(
|
|
2353
2433
|
maxWidth,
|
|
2354
|
-
Math.max(
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
);
|
|
2434
|
+
Math.max(
|
|
2435
|
+
ratioMinWidth,
|
|
2436
|
+
startWidth + (Math.abs(widthDelta) >= Math.abs(heightDelta * resolvedAspectRatio) ? widthDelta : heightDelta * resolvedAspectRatio)
|
|
2437
|
+
)
|
|
2438
|
+
) : Math.min(maxWidth, Math.max(minWidth2, startWidth + widthDelta));
|
|
2439
|
+
const nextHeight = resolvedAspectRatio ? nextWidth / resolvedAspectRatio : Math.min(maxHeight, Math.max(minHeight2, startHeight + heightDelta));
|
|
2360
2440
|
didResize = true;
|
|
2361
2441
|
scheduleResize({
|
|
2362
2442
|
height: nextHeight,
|
|
@@ -2396,16 +2476,20 @@ function WindowInner({
|
|
|
2396
2476
|
"data-mode": mode,
|
|
2397
2477
|
onPointerDownCapture: handleRootPointerDownCapture,
|
|
2398
2478
|
ref: windowRef,
|
|
2399
|
-
style
|
|
2479
|
+
style: {
|
|
2480
|
+
...style,
|
|
2481
|
+
minHeight: minHeight ?? style?.minHeight ?? 120,
|
|
2482
|
+
minWidth: minWidth ?? style?.minWidth ?? 240
|
|
2483
|
+
},
|
|
2400
2484
|
children: [
|
|
2401
|
-
/* @__PURE__ */
|
|
2485
|
+
/* @__PURE__ */ jsx23(
|
|
2402
2486
|
"span",
|
|
2403
2487
|
{
|
|
2404
2488
|
"aria-hidden": true,
|
|
2405
2489
|
className: "nu-window__shadow nu-window__shadow--right"
|
|
2406
2490
|
}
|
|
2407
2491
|
),
|
|
2408
|
-
/* @__PURE__ */
|
|
2492
|
+
/* @__PURE__ */ jsx23(
|
|
2409
2493
|
"span",
|
|
2410
2494
|
{
|
|
2411
2495
|
"aria-hidden": true,
|
|
@@ -2413,17 +2497,18 @@ function WindowInner({
|
|
|
2413
2497
|
}
|
|
2414
2498
|
),
|
|
2415
2499
|
/* @__PURE__ */ jsxs12(WindowMenuContext.Provider, { value: menuState, children: [
|
|
2416
|
-
/* @__PURE__ */
|
|
2500
|
+
/* @__PURE__ */ jsx23(
|
|
2417
2501
|
WindowTitleBar,
|
|
2418
2502
|
{
|
|
2419
2503
|
draggable: isDraggable,
|
|
2504
|
+
icon,
|
|
2420
2505
|
onDragStart: handleTitlePointerDown,
|
|
2421
2506
|
title,
|
|
2422
2507
|
titleButtons: resolvedTitleButtons
|
|
2423
2508
|
}
|
|
2424
2509
|
),
|
|
2425
|
-
hasVisibleMainMenuItems(resolvedMainMenu) ? /* @__PURE__ */
|
|
2426
|
-
/* @__PURE__ */
|
|
2510
|
+
hasVisibleMainMenuItems(resolvedMainMenu) ? /* @__PURE__ */ jsx23(MainMenu, { items: resolvedMainMenu }) : null,
|
|
2511
|
+
/* @__PURE__ */ jsx23(
|
|
2427
2512
|
"div",
|
|
2428
2513
|
{
|
|
2429
2514
|
className: [
|
|
@@ -2434,7 +2519,7 @@ function WindowInner({
|
|
|
2434
2519
|
children
|
|
2435
2520
|
}
|
|
2436
2521
|
),
|
|
2437
|
-
mode === "window" && (statusBar || isResizable) ? /* @__PURE__ */
|
|
2522
|
+
mode === "window" && (statusBar || isResizable) ? /* @__PURE__ */ jsx23(
|
|
2438
2523
|
WindowStatusBar,
|
|
2439
2524
|
{
|
|
2440
2525
|
onResizeStart: handleResizePointerDown,
|
|
@@ -2451,9 +2536,9 @@ function WindowInner({
|
|
|
2451
2536
|
var Window = memo2(WindowInner);
|
|
2452
2537
|
|
|
2453
2538
|
// src/windowing/AppBarHost.tsx
|
|
2454
|
-
import { jsx as
|
|
2539
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2455
2540
|
function AppBarHost({ children, inline = false }) {
|
|
2456
|
-
return /* @__PURE__ */
|
|
2541
|
+
return /* @__PURE__ */ jsx24(
|
|
2457
2542
|
"aside",
|
|
2458
2543
|
{
|
|
2459
2544
|
className: [
|
|
@@ -2543,7 +2628,7 @@ function AppBarItem(props) {
|
|
|
2543
2628
|
}
|
|
2544
2629
|
|
|
2545
2630
|
// src/windowing/WindowBar.tsx
|
|
2546
|
-
import { jsx as
|
|
2631
|
+
import { jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2547
2632
|
function buildWindowBarGroups(items) {
|
|
2548
2633
|
const groups = [];
|
|
2549
2634
|
const groupsByDomain = /* @__PURE__ */ new Map();
|
|
@@ -2552,6 +2637,7 @@ function buildWindowBarGroups(items) {
|
|
|
2552
2637
|
groups.push({
|
|
2553
2638
|
active: Boolean(item.active),
|
|
2554
2639
|
id: item.id,
|
|
2640
|
+
icon: item.icon,
|
|
2555
2641
|
items: [item],
|
|
2556
2642
|
label: item.title
|
|
2557
2643
|
});
|
|
@@ -2563,6 +2649,7 @@ function buildWindowBarGroups(items) {
|
|
|
2563
2649
|
active: Boolean(item.active),
|
|
2564
2650
|
domain: item.domain,
|
|
2565
2651
|
id: item.id,
|
|
2652
|
+
icon: item.icon,
|
|
2566
2653
|
items: [item],
|
|
2567
2654
|
label: item.title
|
|
2568
2655
|
};
|
|
@@ -2572,10 +2659,16 @@ function buildWindowBarGroups(items) {
|
|
|
2572
2659
|
}
|
|
2573
2660
|
existingGroup.items.push(item);
|
|
2574
2661
|
existingGroup.active = existingGroup.active || Boolean(item.active);
|
|
2662
|
+
if (item.active) {
|
|
2663
|
+
existingGroup.icon = item.icon;
|
|
2664
|
+
}
|
|
2575
2665
|
existingGroup.label = `${item.domain} (${existingGroup.items.length})`;
|
|
2576
2666
|
});
|
|
2577
2667
|
return groups;
|
|
2578
2668
|
}
|
|
2669
|
+
function getGroupIcon(group) {
|
|
2670
|
+
return group.items.find((item) => item.active)?.icon ?? group.icon;
|
|
2671
|
+
}
|
|
2579
2672
|
function WindowBar({ items, onActivateWindow }) {
|
|
2580
2673
|
const windowManager = useContext6(NuWindowContext);
|
|
2581
2674
|
const groups = buildWindowBarGroups(items);
|
|
@@ -2595,7 +2688,7 @@ function WindowBar({ items, onActivateWindow }) {
|
|
|
2595
2688
|
const dialogDefinition = {
|
|
2596
2689
|
appModal: true,
|
|
2597
2690
|
border: "double",
|
|
2598
|
-
content: ({ close }) => /* @__PURE__ */
|
|
2691
|
+
content: ({ close }) => /* @__PURE__ */ jsx25(
|
|
2599
2692
|
MdiWindowPickerDialog,
|
|
2600
2693
|
{
|
|
2601
2694
|
activeWindowId: activeGroupWindowId,
|
|
@@ -2616,30 +2709,36 @@ function WindowBar({ items, onActivateWindow }) {
|
|
|
2616
2709
|
};
|
|
2617
2710
|
windowManager.openDialog(dialogDefinition);
|
|
2618
2711
|
}
|
|
2619
|
-
return /* @__PURE__ */
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2712
|
+
return /* @__PURE__ */ jsx25("div", { className: "nu-window-bar", role: "group", "aria-label": "Open windows", children: groups.map((group) => {
|
|
2713
|
+
const icon = getGroupIcon(group);
|
|
2714
|
+
return /* @__PURE__ */ jsxs13(
|
|
2715
|
+
AppBarItem,
|
|
2716
|
+
{
|
|
2717
|
+
active: group.active,
|
|
2718
|
+
className: "nu-window-bar__item",
|
|
2719
|
+
interactive: true,
|
|
2720
|
+
onClick: () => activateGroup(group),
|
|
2721
|
+
children: [
|
|
2722
|
+
icon ? /* @__PURE__ */ jsx25("span", { "aria-hidden": true, className: "nu-window-bar__icon", children: icon }) : null,
|
|
2723
|
+
group.label
|
|
2724
|
+
]
|
|
2725
|
+
},
|
|
2726
|
+
group.id
|
|
2727
|
+
);
|
|
2728
|
+
}) });
|
|
2630
2729
|
}
|
|
2631
2730
|
|
|
2632
2731
|
// src/windowing/dialogHelpers.tsx
|
|
2633
|
-
import { useState as
|
|
2732
|
+
import { useState as useState9 } from "react";
|
|
2634
2733
|
|
|
2635
2734
|
// src/components/TextField/TextField.tsx
|
|
2636
2735
|
import {
|
|
2637
2736
|
useEffect as useEffect5,
|
|
2638
2737
|
useId as useId2,
|
|
2639
|
-
useRef as
|
|
2640
|
-
useState as
|
|
2738
|
+
useRef as useRef7,
|
|
2739
|
+
useState as useState8
|
|
2641
2740
|
} from "react";
|
|
2642
|
-
import { jsx as
|
|
2741
|
+
import { jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2643
2742
|
function TextField({
|
|
2644
2743
|
className,
|
|
2645
2744
|
debounceMs = 0,
|
|
@@ -2660,8 +2759,8 @@ function TextField({
|
|
|
2660
2759
|
const fieldId = id ?? generatedId;
|
|
2661
2760
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
2662
2761
|
const isControlled = value !== void 0;
|
|
2663
|
-
const hasMountedRef =
|
|
2664
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
2762
|
+
const hasMountedRef = useRef7(false);
|
|
2763
|
+
const [uncontrolledValue, setUncontrolledValue] = useState8(
|
|
2665
2764
|
() => defaultValue == null ? "" : String(defaultValue)
|
|
2666
2765
|
);
|
|
2667
2766
|
const resolvedValue = isControlled ? value == null ? "" : String(value) : uncontrolledValue;
|
|
@@ -2690,14 +2789,14 @@ function TextField({
|
|
|
2690
2789
|
}
|
|
2691
2790
|
onChange?.(event);
|
|
2692
2791
|
}
|
|
2693
|
-
return /* @__PURE__ */
|
|
2792
|
+
return /* @__PURE__ */ jsxs14(
|
|
2694
2793
|
"label",
|
|
2695
2794
|
{
|
|
2696
2795
|
className: cx("nu-text-field", slotClassNames?.root, className),
|
|
2697
2796
|
htmlFor: fieldId,
|
|
2698
2797
|
style: slotStyles?.root,
|
|
2699
2798
|
children: [
|
|
2700
|
-
/* @__PURE__ */
|
|
2799
|
+
/* @__PURE__ */ jsx26(
|
|
2701
2800
|
"span",
|
|
2702
2801
|
{
|
|
2703
2802
|
className: cx("nu-text-field__label", slotClassNames?.label),
|
|
@@ -2705,13 +2804,13 @@ function TextField({
|
|
|
2705
2804
|
children: renderMnemonicText(label)
|
|
2706
2805
|
}
|
|
2707
2806
|
),
|
|
2708
|
-
/* @__PURE__ */
|
|
2807
|
+
/* @__PURE__ */ jsxs14(
|
|
2709
2808
|
"span",
|
|
2710
2809
|
{
|
|
2711
2810
|
className: cx("nu-text-field__slot", slotClassNames?.slot),
|
|
2712
2811
|
style: slotStyles?.slot,
|
|
2713
2812
|
children: [
|
|
2714
|
-
/* @__PURE__ */
|
|
2813
|
+
/* @__PURE__ */ jsx26(
|
|
2715
2814
|
"span",
|
|
2716
2815
|
{
|
|
2717
2816
|
"aria-hidden": "true",
|
|
@@ -2720,7 +2819,7 @@ function TextField({
|
|
|
2720
2819
|
children: "["
|
|
2721
2820
|
}
|
|
2722
2821
|
),
|
|
2723
|
-
/* @__PURE__ */
|
|
2822
|
+
/* @__PURE__ */ jsx26(
|
|
2724
2823
|
"span",
|
|
2725
2824
|
{
|
|
2726
2825
|
className: cx(
|
|
@@ -2728,7 +2827,7 @@ function TextField({
|
|
|
2728
2827
|
slotClassNames?.inputShell
|
|
2729
2828
|
),
|
|
2730
2829
|
style: slotStyles?.inputShell,
|
|
2731
|
-
children: /* @__PURE__ */
|
|
2830
|
+
children: /* @__PURE__ */ jsx26(
|
|
2732
2831
|
"input",
|
|
2733
2832
|
{
|
|
2734
2833
|
...props,
|
|
@@ -2747,7 +2846,7 @@ function TextField({
|
|
|
2747
2846
|
)
|
|
2748
2847
|
}
|
|
2749
2848
|
),
|
|
2750
|
-
/* @__PURE__ */
|
|
2849
|
+
/* @__PURE__ */ jsx26(
|
|
2751
2850
|
"span",
|
|
2752
2851
|
{
|
|
2753
2852
|
"aria-hidden": "true",
|
|
@@ -2759,7 +2858,7 @@ function TextField({
|
|
|
2759
2858
|
]
|
|
2760
2859
|
}
|
|
2761
2860
|
),
|
|
2762
|
-
hint ? /* @__PURE__ */
|
|
2861
|
+
hint ? /* @__PURE__ */ jsx26(
|
|
2763
2862
|
"span",
|
|
2764
2863
|
{
|
|
2765
2864
|
className: cx("nu-text-field__hint", slotClassNames?.hint),
|
|
@@ -2774,7 +2873,7 @@ function TextField({
|
|
|
2774
2873
|
}
|
|
2775
2874
|
|
|
2776
2875
|
// src/components/View/NuView.tsx
|
|
2777
|
-
import { jsx as
|
|
2876
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2778
2877
|
function NuView({
|
|
2779
2878
|
children,
|
|
2780
2879
|
className,
|
|
@@ -2783,7 +2882,7 @@ function NuView({
|
|
|
2783
2882
|
scroll = "auto",
|
|
2784
2883
|
...props
|
|
2785
2884
|
}) {
|
|
2786
|
-
return /* @__PURE__ */
|
|
2885
|
+
return /* @__PURE__ */ jsx27(
|
|
2787
2886
|
"div",
|
|
2788
2887
|
{
|
|
2789
2888
|
...props,
|
|
@@ -2797,7 +2896,7 @@ function NuView({
|
|
|
2797
2896
|
}
|
|
2798
2897
|
|
|
2799
2898
|
// src/windowing/dialogHelpers.tsx
|
|
2800
|
-
import { jsx as
|
|
2899
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2801
2900
|
function getPresetButtons(preset) {
|
|
2802
2901
|
switch (preset) {
|
|
2803
2902
|
case "ok-cancel":
|
|
@@ -2900,8 +2999,8 @@ function MessageBoxDialogContent({
|
|
|
2900
2999
|
const bodyStyle = kind === "error" ? {
|
|
2901
3000
|
background: "var(--nu-color-button-danger)"
|
|
2902
3001
|
} : void 0;
|
|
2903
|
-
return /* @__PURE__ */
|
|
2904
|
-
/* @__PURE__ */
|
|
3002
|
+
return /* @__PURE__ */ jsx28(NuView, { padding: "cell", style: bodyStyle, children: /* @__PURE__ */ jsxs15(Stack, { gap: "md", children: [
|
|
3003
|
+
/* @__PURE__ */ jsx28(
|
|
2905
3004
|
"div",
|
|
2906
3005
|
{
|
|
2907
3006
|
style: tone ? {
|
|
@@ -2910,8 +3009,8 @@ function MessageBoxDialogContent({
|
|
|
2910
3009
|
children: message
|
|
2911
3010
|
}
|
|
2912
3011
|
),
|
|
2913
|
-
/* @__PURE__ */
|
|
2914
|
-
ok ? /* @__PURE__ */
|
|
3012
|
+
/* @__PURE__ */ jsxs15(Stack, { direction: "row", gap: "sm", justify: "center", children: [
|
|
3013
|
+
ok ? /* @__PURE__ */ jsx28(
|
|
2915
3014
|
Button,
|
|
2916
3015
|
{
|
|
2917
3016
|
className: "nu-dialog-helper__button",
|
|
@@ -2920,7 +3019,7 @@ function MessageBoxDialogContent({
|
|
|
2920
3019
|
children: okLabel
|
|
2921
3020
|
}
|
|
2922
3021
|
) : null,
|
|
2923
|
-
yes ? /* @__PURE__ */
|
|
3022
|
+
yes ? /* @__PURE__ */ jsx28(
|
|
2924
3023
|
Button,
|
|
2925
3024
|
{
|
|
2926
3025
|
className: "nu-dialog-helper__button",
|
|
@@ -2929,7 +3028,7 @@ function MessageBoxDialogContent({
|
|
|
2929
3028
|
children: yesLabel
|
|
2930
3029
|
}
|
|
2931
3030
|
) : null,
|
|
2932
|
-
no ? /* @__PURE__ */
|
|
3031
|
+
no ? /* @__PURE__ */ jsx28(
|
|
2933
3032
|
Button,
|
|
2934
3033
|
{
|
|
2935
3034
|
className: "nu-dialog-helper__button",
|
|
@@ -2938,7 +3037,7 @@ function MessageBoxDialogContent({
|
|
|
2938
3037
|
children: noLabel
|
|
2939
3038
|
}
|
|
2940
3039
|
) : null,
|
|
2941
|
-
cancel ? /* @__PURE__ */
|
|
3040
|
+
cancel ? /* @__PURE__ */ jsx28(
|
|
2942
3041
|
Button,
|
|
2943
3042
|
{
|
|
2944
3043
|
className: "nu-dialog-helper__button",
|
|
@@ -2959,9 +3058,9 @@ function InputBoxDialogContent({
|
|
|
2959
3058
|
onResolve,
|
|
2960
3059
|
placeholder
|
|
2961
3060
|
}) {
|
|
2962
|
-
const [value, setValue] =
|
|
2963
|
-
return /* @__PURE__ */
|
|
2964
|
-
/* @__PURE__ */
|
|
3061
|
+
const [value, setValue] = useState9(defaultValue ?? "");
|
|
3062
|
+
return /* @__PURE__ */ jsx28(NuView, { padding: "cell", children: /* @__PURE__ */ jsxs15(Stack, { gap: "md", children: [
|
|
3063
|
+
/* @__PURE__ */ jsx28(
|
|
2965
3064
|
TextField,
|
|
2966
3065
|
{
|
|
2967
3066
|
autoFocus: true,
|
|
@@ -2972,8 +3071,8 @@ function InputBoxDialogContent({
|
|
|
2972
3071
|
placeholder
|
|
2973
3072
|
}
|
|
2974
3073
|
),
|
|
2975
|
-
/* @__PURE__ */
|
|
2976
|
-
/* @__PURE__ */
|
|
3074
|
+
/* @__PURE__ */ jsxs15(Stack, { direction: "row", gap: "sm", justify: "center", children: [
|
|
3075
|
+
/* @__PURE__ */ jsx28(
|
|
2977
3076
|
Button,
|
|
2978
3077
|
{
|
|
2979
3078
|
className: "nu-dialog-helper__button",
|
|
@@ -2982,7 +3081,7 @@ function InputBoxDialogContent({
|
|
|
2982
3081
|
children: okLabel
|
|
2983
3082
|
}
|
|
2984
3083
|
),
|
|
2985
|
-
/* @__PURE__ */
|
|
3084
|
+
/* @__PURE__ */ jsx28(
|
|
2986
3085
|
Button,
|
|
2987
3086
|
{
|
|
2988
3087
|
className: "nu-dialog-helper__button",
|
|
@@ -2996,7 +3095,7 @@ function InputBoxDialogContent({
|
|
|
2996
3095
|
}
|
|
2997
3096
|
|
|
2998
3097
|
// src/windowing/NuWindowProvider.tsx
|
|
2999
|
-
import { jsx as
|
|
3098
|
+
import { jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3000
3099
|
function getDefaultWindowStyle(mode, index) {
|
|
3001
3100
|
const offset = index * 18;
|
|
3002
3101
|
return {
|
|
@@ -3071,6 +3170,7 @@ function buildWindowRecord(definition, currentWindows, windowBoundsById, creatio
|
|
|
3071
3170
|
ownerCenteredStyle,
|
|
3072
3171
|
index
|
|
3073
3172
|
);
|
|
3173
|
+
const hasAspectRatio = typeof definition.aspectRatio === "number" && Number.isFinite(definition.aspectRatio) && definition.aspectRatio > 0;
|
|
3074
3174
|
return {
|
|
3075
3175
|
...definition,
|
|
3076
3176
|
appModal,
|
|
@@ -3079,18 +3179,18 @@ function buildWindowRecord(definition, currentWindows, windowBoundsById, creatio
|
|
|
3079
3179
|
creationOrder,
|
|
3080
3180
|
draggable: mode === "window",
|
|
3081
3181
|
id,
|
|
3082
|
-
maximizable: definition.maximizable ?? mode === "window",
|
|
3182
|
+
maximizable: !hasAspectRatio && (definition.maximizable ?? mode === "window"),
|
|
3083
3183
|
modalOwnerId,
|
|
3084
3184
|
minimizable: definition.minimizable ?? mode === "window",
|
|
3085
3185
|
mode,
|
|
3086
3186
|
resizable: definition.resizable ?? mode === "window",
|
|
3087
|
-
restoreStyle: savedWindowState.restoreStyle,
|
|
3187
|
+
restoreStyle: hasAspectRatio ? void 0 : savedWindowState.restoreStyle,
|
|
3088
3188
|
title: resolveManagedWindowTitle(currentWindows, titleBase),
|
|
3089
3189
|
titleBase,
|
|
3090
3190
|
style: {
|
|
3091
3191
|
...savedWindowState.style
|
|
3092
3192
|
},
|
|
3093
|
-
maximized: savedWindowState.maximized,
|
|
3193
|
+
maximized: hasAspectRatio ? false : savedWindowState.maximized,
|
|
3094
3194
|
minimized: savedWindowState.minimized
|
|
3095
3195
|
};
|
|
3096
3196
|
}
|
|
@@ -3140,11 +3240,11 @@ function NuWindowProvider({
|
|
|
3140
3240
|
onAppModalChange,
|
|
3141
3241
|
renderAppBar = false
|
|
3142
3242
|
}) {
|
|
3143
|
-
const creationOrderRef =
|
|
3144
|
-
const idRef =
|
|
3145
|
-
const windowBoundsByIdRef =
|
|
3146
|
-
const [windows, setWindows] =
|
|
3147
|
-
const [windowBoundsById, setWindowBoundsById] =
|
|
3243
|
+
const creationOrderRef = useRef8(0);
|
|
3244
|
+
const idRef = useRef8(0);
|
|
3245
|
+
const windowBoundsByIdRef = useRef8({});
|
|
3246
|
+
const [windows, setWindows] = useState10([]);
|
|
3247
|
+
const [windowBoundsById, setWindowBoundsById] = useState10({});
|
|
3148
3248
|
const appHostMenuContext = useContext7(AppHostMenuContext);
|
|
3149
3249
|
const nextId = useCallback3(() => {
|
|
3150
3250
|
idRef.current += 1;
|
|
@@ -3305,7 +3405,7 @@ function NuWindowProvider({
|
|
|
3305
3405
|
const toggleWindowMaximized = useCallback3((id) => {
|
|
3306
3406
|
setWindows(
|
|
3307
3407
|
(currentWindows) => currentWindows.map((windowEntry) => {
|
|
3308
|
-
if (windowEntry.id !== id) {
|
|
3408
|
+
if (windowEntry.id !== id || !windowEntry.maximizable) {
|
|
3309
3409
|
return windowEntry;
|
|
3310
3410
|
}
|
|
3311
3411
|
if (windowEntry.maximized) {
|
|
@@ -3390,7 +3490,7 @@ function NuWindowProvider({
|
|
|
3390
3490
|
openDialog({
|
|
3391
3491
|
appModal: options.appModal ?? true,
|
|
3392
3492
|
closeable: true,
|
|
3393
|
-
content: ({ close }) => /* @__PURE__ */
|
|
3493
|
+
content: ({ close }) => /* @__PURE__ */ jsx29(
|
|
3394
3494
|
MessageBoxDialogContent,
|
|
3395
3495
|
{
|
|
3396
3496
|
cancel: buttons.cancel,
|
|
@@ -3433,7 +3533,7 @@ function NuWindowProvider({
|
|
|
3433
3533
|
openDialog({
|
|
3434
3534
|
appModal: options.appModal ?? true,
|
|
3435
3535
|
closeable: true,
|
|
3436
|
-
content: ({ close }) => /* @__PURE__ */
|
|
3536
|
+
content: ({ close }) => /* @__PURE__ */ jsx29(
|
|
3437
3537
|
InputBoxDialogContent,
|
|
3438
3538
|
{
|
|
3439
3539
|
cancelLabel: options.cancelLabel ?? "&Cancel",
|
|
@@ -3471,21 +3571,32 @@ function NuWindowProvider({
|
|
|
3471
3571
|
const topmostAppModalIndex = findTopmostAppModalIndex(visibleWindows);
|
|
3472
3572
|
const topmostAppModalId = topmostAppModalIndex >= 0 ? visibleWindows[topmostAppModalIndex]?.id : void 0;
|
|
3473
3573
|
const activeWindowId = topmostAppModalIndex >= 0 ? visibleWindows[topmostAppModalIndex]?.id : visibleWindows[visibleWindows.length - 1]?.id;
|
|
3574
|
+
const activeWindow = activeWindowId ? windows.find((windowEntry) => windowEntry.id === activeWindowId) : void 0;
|
|
3575
|
+
const activeActivationGroup = topmostAppModalIndex >= 0 ? void 0 : activeWindow?.activationGroup;
|
|
3474
3576
|
const hasAppModal = topmostAppModalIndex >= 0;
|
|
3577
|
+
const isWindowActive = useCallback3(
|
|
3578
|
+
(windowEntry) => windowEntry.id === activeWindowId || activeActivationGroup !== void 0 && windowEntry.activationGroup === activeActivationGroup,
|
|
3579
|
+
[activeActivationGroup, activeWindowId]
|
|
3580
|
+
);
|
|
3475
3581
|
const windowsInfo = useMemo7(
|
|
3476
3582
|
() => [...windows].sort(
|
|
3477
3583
|
(leftWindow, rightWindow) => leftWindow.creationOrder - rightWindow.creationOrder
|
|
3478
3584
|
).map((windowEntry) => ({
|
|
3479
|
-
active: windowEntry
|
|
3585
|
+
active: isWindowActive(windowEntry),
|
|
3586
|
+
activationGroup: windowEntry.activationGroup,
|
|
3587
|
+
aspectRatio: windowEntry.aspectRatio,
|
|
3480
3588
|
bodyClassName: windowEntry.bodyClassName,
|
|
3481
3589
|
appModal: windowEntry.appModal,
|
|
3482
3590
|
border: windowEntry.border,
|
|
3483
3591
|
className: windowEntry.className,
|
|
3484
3592
|
closeable: windowEntry.closeable,
|
|
3485
3593
|
domain: windowEntry.domain,
|
|
3594
|
+
icon: windowEntry.icon,
|
|
3486
3595
|
id: windowEntry.id,
|
|
3487
3596
|
maximizable: windowEntry.maximizable,
|
|
3488
3597
|
maximized: windowEntry.maximized,
|
|
3598
|
+
minHeight: windowEntry.minHeight,
|
|
3599
|
+
minWidth: windowEntry.minWidth,
|
|
3489
3600
|
modal: windowEntry.modalOwnerId ?? false,
|
|
3490
3601
|
minimizable: windowEntry.minimizable,
|
|
3491
3602
|
minimized: windowEntry.minimized,
|
|
@@ -3496,7 +3607,7 @@ function NuWindowProvider({
|
|
|
3496
3607
|
title: windowEntry.title,
|
|
3497
3608
|
titleButtons: windowEntry.titleButtons
|
|
3498
3609
|
})),
|
|
3499
|
-
[
|
|
3610
|
+
[isWindowActive, windows]
|
|
3500
3611
|
);
|
|
3501
3612
|
const mdiBridge = useMemo7(
|
|
3502
3613
|
() => ({
|
|
@@ -3553,10 +3664,10 @@ function NuWindowProvider({
|
|
|
3553
3664
|
useEffect6(() => {
|
|
3554
3665
|
onAppModalChange?.(hasAppModal);
|
|
3555
3666
|
}, [hasAppModal, onAppModalChange]);
|
|
3556
|
-
return /* @__PURE__ */
|
|
3667
|
+
return /* @__PURE__ */ jsx29(NuWindowContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs16("div", { className: ["nu-window-host", className].filter(Boolean).join(" "), children: [
|
|
3557
3668
|
children,
|
|
3558
|
-
/* @__PURE__ */
|
|
3559
|
-
const isActiveWindow = windowEntry
|
|
3669
|
+
/* @__PURE__ */ jsx29("div", { className: "nu-window-layer", children: renderWindows.map((windowEntry) => {
|
|
3670
|
+
const isActiveWindow = isWindowActive(windowEntry);
|
|
3560
3671
|
const stackIndex = stackIndexById.get(windowEntry.id);
|
|
3561
3672
|
const isTopmostAppModal = windowEntry.id === topmostAppModalId;
|
|
3562
3673
|
const ownerBounds = windowEntry.modalOwnerId ? windowBoundsById[windowEntry.modalOwnerId] : void 0;
|
|
@@ -3584,30 +3695,34 @@ function NuWindowProvider({
|
|
|
3584
3695
|
update: handleUpdate
|
|
3585
3696
|
};
|
|
3586
3697
|
const content = typeof windowEntry.content === "function" ? windowEntry.content(controls) : windowEntry.content;
|
|
3587
|
-
return /* @__PURE__ */
|
|
3588
|
-
isTopmostAppModal ? /* @__PURE__ */
|
|
3698
|
+
return /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
3699
|
+
isTopmostAppModal ? /* @__PURE__ */ jsx29(
|
|
3589
3700
|
"div",
|
|
3590
3701
|
{
|
|
3591
3702
|
className: "nu-window-layer__modal-backdrop",
|
|
3592
3703
|
style: { zIndex: visibleWindows.length + 1 }
|
|
3593
3704
|
}
|
|
3594
|
-
) : ownerBackdropStyle ? /* @__PURE__ */
|
|
3705
|
+
) : ownerBackdropStyle ? /* @__PURE__ */ jsx29(
|
|
3595
3706
|
"div",
|
|
3596
3707
|
{
|
|
3597
3708
|
className: "nu-window-layer__modal-backdrop",
|
|
3598
3709
|
style: ownerBackdropStyle
|
|
3599
3710
|
}
|
|
3600
3711
|
) : null,
|
|
3601
|
-
/* @__PURE__ */
|
|
3712
|
+
/* @__PURE__ */ jsx29(
|
|
3602
3713
|
Window,
|
|
3603
3714
|
{
|
|
3604
3715
|
active: isActiveWindow,
|
|
3716
|
+
aspectRatio: windowEntry.aspectRatio,
|
|
3605
3717
|
bodyClassName: windowEntry.bodyClassName,
|
|
3606
3718
|
border: windowEntry.border,
|
|
3607
3719
|
className: windowEntry.className,
|
|
3608
3720
|
closeable: windowEntry.closeable,
|
|
3609
3721
|
draggable: windowEntry.draggable,
|
|
3722
|
+
icon: windowEntry.icon,
|
|
3610
3723
|
maximizable: windowEntry.maximizable,
|
|
3724
|
+
minHeight: windowEntry.minHeight,
|
|
3725
|
+
minWidth: windowEntry.minWidth,
|
|
3611
3726
|
minimizable: windowEntry.minimizable,
|
|
3612
3727
|
maximized: windowEntry.maximized,
|
|
3613
3728
|
minimized: windowEntry.minimized,
|
|
@@ -3631,13 +3746,14 @@ function NuWindowProvider({
|
|
|
3631
3746
|
)
|
|
3632
3747
|
] }, windowEntry.id);
|
|
3633
3748
|
}) }),
|
|
3634
|
-
renderAppBar ? /* @__PURE__ */
|
|
3749
|
+
renderAppBar ? /* @__PURE__ */ jsx29(AppBarHost, { children: /* @__PURE__ */ jsx29(
|
|
3635
3750
|
WindowBar,
|
|
3636
3751
|
{
|
|
3637
3752
|
items: windowsInfo.map((windowEntry) => ({
|
|
3638
3753
|
active: windowEntry.active,
|
|
3639
3754
|
domain: windowEntry.domain,
|
|
3640
3755
|
id: windowEntry.id,
|
|
3756
|
+
icon: windowEntry.icon,
|
|
3641
3757
|
minimized: windowEntry.minimized,
|
|
3642
3758
|
title: windowEntry.title
|
|
3643
3759
|
})),
|
|
@@ -3648,11 +3764,11 @@ function NuWindowProvider({
|
|
|
3648
3764
|
}
|
|
3649
3765
|
|
|
3650
3766
|
// src/components/Desktop/Desktop.tsx
|
|
3651
|
-
import { jsx as
|
|
3767
|
+
import { jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3652
3768
|
function DesktopWindowRegion({ appBar, children }) {
|
|
3653
|
-
return /* @__PURE__ */
|
|
3654
|
-
/* @__PURE__ */
|
|
3655
|
-
appBar ? /* @__PURE__ */
|
|
3769
|
+
return /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
3770
|
+
/* @__PURE__ */ jsx30("div", { className: "nu-desktop__workspace", children }),
|
|
3771
|
+
appBar ? /* @__PURE__ */ jsx30("div", { className: "nu-desktop__app-bar", children: appBar }) : null
|
|
3656
3772
|
] });
|
|
3657
3773
|
}
|
|
3658
3774
|
function NuDesktop({
|
|
@@ -3662,12 +3778,12 @@ function NuDesktop({
|
|
|
3662
3778
|
className,
|
|
3663
3779
|
...props
|
|
3664
3780
|
}) {
|
|
3665
|
-
const [hasAppModal, setHasAppModal] =
|
|
3781
|
+
const [hasAppModal, setHasAppModal] = useState11(false);
|
|
3666
3782
|
const appHostContext = useContext8(AppHostMenuContext);
|
|
3667
3783
|
if (appHostContext) {
|
|
3668
3784
|
throw new Error("NuDesktop should not be nested inside another app host.");
|
|
3669
3785
|
}
|
|
3670
|
-
return /* @__PURE__ */
|
|
3786
|
+
return /* @__PURE__ */ jsx30(NuAppHostProvider, { renderMenu: false, children: /* @__PURE__ */ jsx30(
|
|
3671
3787
|
NuDesktopShell,
|
|
3672
3788
|
{
|
|
3673
3789
|
appBar: appBar ?? appBarContent,
|
|
@@ -3695,21 +3811,21 @@ function NuDesktopShell({
|
|
|
3695
3811
|
appHostContext.mainMenu,
|
|
3696
3812
|
appHostContext.windowBridge
|
|
3697
3813
|
);
|
|
3698
|
-
return /* @__PURE__ */
|
|
3814
|
+
return /* @__PURE__ */ jsxs17(
|
|
3699
3815
|
"div",
|
|
3700
3816
|
{
|
|
3701
3817
|
...props,
|
|
3702
3818
|
className: ["nu-desktop", className].filter(Boolean).join(" "),
|
|
3703
3819
|
"data-modal-active": hasAppModal || void 0,
|
|
3704
3820
|
children: [
|
|
3705
|
-
hasVisibleMainMenuItems(resolvedMainMenu) ? /* @__PURE__ */
|
|
3706
|
-
/* @__PURE__ */
|
|
3821
|
+
hasVisibleMainMenuItems(resolvedMainMenu) ? /* @__PURE__ */ jsx30("div", { className: "nu-desktop__menu", children: /* @__PURE__ */ jsx30(MainMenu, { items: resolvedMainMenu }) }) : null,
|
|
3822
|
+
/* @__PURE__ */ jsx30(
|
|
3707
3823
|
NuWindowProvider,
|
|
3708
3824
|
{
|
|
3709
3825
|
className: "nu-desktop__window-region",
|
|
3710
3826
|
onAppModalChange,
|
|
3711
3827
|
renderAppBar: false,
|
|
3712
|
-
children: /* @__PURE__ */
|
|
3828
|
+
children: /* @__PURE__ */ jsx30(DesktopWindowRegion, { appBar, children })
|
|
3713
3829
|
}
|
|
3714
3830
|
)
|
|
3715
3831
|
]
|
|
@@ -3718,7 +3834,7 @@ function NuDesktopShell({
|
|
|
3718
3834
|
}
|
|
3719
3835
|
|
|
3720
3836
|
// src/components/Dashboard/Dashboard.tsx
|
|
3721
|
-
import { jsx as
|
|
3837
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
3722
3838
|
function resolveDashboardGap(gap) {
|
|
3723
3839
|
if (typeof gap === "number") {
|
|
3724
3840
|
return `${gap}px`;
|
|
@@ -3739,7 +3855,7 @@ function Dashboard({
|
|
|
3739
3855
|
const resolvedGap = resolveDashboardGap(gap);
|
|
3740
3856
|
if (layout === "lanes") {
|
|
3741
3857
|
const lanes = Array.from({ length: laneCount }, (_, index) => index + 1);
|
|
3742
|
-
return /* @__PURE__ */
|
|
3858
|
+
return /* @__PURE__ */ jsx31(
|
|
3743
3859
|
"div",
|
|
3744
3860
|
{
|
|
3745
3861
|
...props,
|
|
@@ -3751,7 +3867,7 @@ function Dashboard({
|
|
|
3751
3867
|
"--nu-dashboard-gap": resolvedGap,
|
|
3752
3868
|
"--nu-dashboard-lane-count": laneCount
|
|
3753
3869
|
},
|
|
3754
|
-
children: lanes.map((lane) => /* @__PURE__ */
|
|
3870
|
+
children: lanes.map((lane) => /* @__PURE__ */ jsx31("div", { className: "nu-dashboard__lane", children: items.filter((item) => (item.lane ?? 1) === lane).map((item) => /* @__PURE__ */ jsx31(
|
|
3755
3871
|
"div",
|
|
3756
3872
|
{
|
|
3757
3873
|
className: "nu-dashboard__cell",
|
|
@@ -3763,14 +3879,14 @@ function Dashboard({
|
|
|
3763
3879
|
minWidth: item.minWidth,
|
|
3764
3880
|
width: item.width
|
|
3765
3881
|
},
|
|
3766
|
-
children: /* @__PURE__ */
|
|
3882
|
+
children: /* @__PURE__ */ jsx31("div", { className: "nu-dashboard__content", children: item.content })
|
|
3767
3883
|
},
|
|
3768
3884
|
item.id
|
|
3769
3885
|
)) }, lane))
|
|
3770
3886
|
}
|
|
3771
3887
|
);
|
|
3772
3888
|
}
|
|
3773
|
-
return /* @__PURE__ */
|
|
3889
|
+
return /* @__PURE__ */ jsx31(
|
|
3774
3890
|
"div",
|
|
3775
3891
|
{
|
|
3776
3892
|
...props,
|
|
@@ -3781,7 +3897,7 @@ function Dashboard({
|
|
|
3781
3897
|
"--nu-dashboard-column-count": columnCount,
|
|
3782
3898
|
"--nu-dashboard-gap": resolvedGap
|
|
3783
3899
|
},
|
|
3784
|
-
children: items.map((item) => /* @__PURE__ */
|
|
3900
|
+
children: items.map((item) => /* @__PURE__ */ jsx31(
|
|
3785
3901
|
"div",
|
|
3786
3902
|
{
|
|
3787
3903
|
className: "nu-dashboard__cell",
|
|
@@ -3795,7 +3911,7 @@ function Dashboard({
|
|
|
3795
3911
|
minWidth: item.minWidth,
|
|
3796
3912
|
width: item.width
|
|
3797
3913
|
},
|
|
3798
|
-
children: /* @__PURE__ */
|
|
3914
|
+
children: /* @__PURE__ */ jsx31("div", { className: "nu-dashboard__content", children: item.content })
|
|
3799
3915
|
},
|
|
3800
3916
|
item.id
|
|
3801
3917
|
))
|
|
@@ -3804,8 +3920,8 @@ function Dashboard({
|
|
|
3804
3920
|
}
|
|
3805
3921
|
|
|
3806
3922
|
// src/components/CheckBox/CheckBox.tsx
|
|
3807
|
-
import { useId as useId3, useState as
|
|
3808
|
-
import { jsx as
|
|
3923
|
+
import { useId as useId3, useState as useState12 } from "react";
|
|
3924
|
+
import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3809
3925
|
function CheckBox({
|
|
3810
3926
|
checked,
|
|
3811
3927
|
className,
|
|
@@ -3824,7 +3940,7 @@ function CheckBox({
|
|
|
3824
3940
|
const inputId = id ?? generatedId;
|
|
3825
3941
|
const hintId = hint ? `${inputId}-hint` : void 0;
|
|
3826
3942
|
const isControlled = checked !== void 0;
|
|
3827
|
-
const [uncontrolledChecked, setUncontrolledChecked] =
|
|
3943
|
+
const [uncontrolledChecked, setUncontrolledChecked] = useState12(defaultChecked);
|
|
3828
3944
|
const resolvedChecked = isControlled ? checked : uncontrolledChecked;
|
|
3829
3945
|
function handleChange(event) {
|
|
3830
3946
|
if (!isControlled) {
|
|
@@ -3832,19 +3948,19 @@ function CheckBox({
|
|
|
3832
3948
|
}
|
|
3833
3949
|
onCheckedChange?.(event.target.checked, event);
|
|
3834
3950
|
}
|
|
3835
|
-
return /* @__PURE__ */
|
|
3951
|
+
return /* @__PURE__ */ jsxs18(
|
|
3836
3952
|
"label",
|
|
3837
3953
|
{
|
|
3838
3954
|
className: cx("nu-check-box", slotClassNames?.root, className),
|
|
3839
3955
|
style: slotStyles?.root,
|
|
3840
3956
|
children: [
|
|
3841
|
-
/* @__PURE__ */
|
|
3957
|
+
/* @__PURE__ */ jsxs18(
|
|
3842
3958
|
"span",
|
|
3843
3959
|
{
|
|
3844
3960
|
className: cx("nu-check-box__main", slotClassNames?.main),
|
|
3845
3961
|
style: slotStyles?.main,
|
|
3846
3962
|
children: [
|
|
3847
|
-
/* @__PURE__ */
|
|
3963
|
+
/* @__PURE__ */ jsx32(
|
|
3848
3964
|
"input",
|
|
3849
3965
|
{
|
|
3850
3966
|
...props,
|
|
@@ -3858,19 +3974,19 @@ function CheckBox({
|
|
|
3858
3974
|
type: "checkbox"
|
|
3859
3975
|
}
|
|
3860
3976
|
),
|
|
3861
|
-
/* @__PURE__ */
|
|
3977
|
+
/* @__PURE__ */ jsx32(
|
|
3862
3978
|
"span",
|
|
3863
3979
|
{
|
|
3864
3980
|
"aria-hidden": "true",
|
|
3865
3981
|
className: cx("nu-check-box__control", slotClassNames?.control),
|
|
3866
3982
|
style: slotStyles?.control,
|
|
3867
|
-
children: /* @__PURE__ */
|
|
3983
|
+
children: /* @__PURE__ */ jsx32(
|
|
3868
3984
|
"span",
|
|
3869
3985
|
{
|
|
3870
3986
|
className: cx("nu-check-box__box", slotClassNames?.box),
|
|
3871
3987
|
"data-unchecked-shape": uncheckedShape,
|
|
3872
3988
|
style: slotStyles?.box,
|
|
3873
|
-
children: resolvedChecked ? /* @__PURE__ */
|
|
3989
|
+
children: resolvedChecked ? /* @__PURE__ */ jsx32(
|
|
3874
3990
|
NuGlyph,
|
|
3875
3991
|
{
|
|
3876
3992
|
className: cx("nu-check-box__mark", slotClassNames?.mark),
|
|
@@ -3882,7 +3998,7 @@ function CheckBox({
|
|
|
3882
3998
|
)
|
|
3883
3999
|
}
|
|
3884
4000
|
),
|
|
3885
|
-
/* @__PURE__ */
|
|
4001
|
+
/* @__PURE__ */ jsx32(
|
|
3886
4002
|
"span",
|
|
3887
4003
|
{
|
|
3888
4004
|
className: cx("nu-check-box__label", slotClassNames?.label),
|
|
@@ -3893,7 +4009,7 @@ function CheckBox({
|
|
|
3893
4009
|
]
|
|
3894
4010
|
}
|
|
3895
4011
|
),
|
|
3896
|
-
hint ? /* @__PURE__ */
|
|
4012
|
+
hint ? /* @__PURE__ */ jsx32(
|
|
3897
4013
|
"span",
|
|
3898
4014
|
{
|
|
3899
4015
|
className: cx("nu-check-box__hint", slotClassNames?.hint),
|
|
@@ -3912,26 +4028,26 @@ import {
|
|
|
3912
4028
|
useEffect as useEffect7,
|
|
3913
4029
|
useId as useId4,
|
|
3914
4030
|
useMemo as useMemo8,
|
|
3915
|
-
useRef as
|
|
3916
|
-
useState as
|
|
4031
|
+
useRef as useRef9,
|
|
4032
|
+
useState as useState13
|
|
3917
4033
|
} from "react";
|
|
3918
4034
|
import { createPortal } from "react-dom";
|
|
3919
4035
|
|
|
3920
4036
|
// src/components/_shared/ControlOpener.tsx
|
|
3921
|
-
import { jsx as
|
|
4037
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
3922
4038
|
function ControlOpener(props) {
|
|
3923
4039
|
const { children, className, glyphClassName, glyphStyle, style } = props;
|
|
3924
4040
|
if (props.as === "button") {
|
|
3925
4041
|
const { as: _as2, type = "button", ...buttonProps } = props;
|
|
3926
4042
|
void _as2;
|
|
3927
|
-
return /* @__PURE__ */
|
|
4043
|
+
return /* @__PURE__ */ jsx33(
|
|
3928
4044
|
"button",
|
|
3929
4045
|
{
|
|
3930
4046
|
...buttonProps,
|
|
3931
4047
|
className: cx("nu-control-opener", className),
|
|
3932
4048
|
style,
|
|
3933
4049
|
type,
|
|
3934
|
-
children: children ?? /* @__PURE__ */
|
|
4050
|
+
children: children ?? /* @__PURE__ */ jsx33(
|
|
3935
4051
|
NuGlyph,
|
|
3936
4052
|
{
|
|
3937
4053
|
className: cx("nu-control-opener__glyph", glyphClassName),
|
|
@@ -3944,14 +4060,14 @@ function ControlOpener(props) {
|
|
|
3944
4060
|
}
|
|
3945
4061
|
const { ariaHidden = false, as: _as, ...spanProps } = props;
|
|
3946
4062
|
void _as;
|
|
3947
|
-
return /* @__PURE__ */
|
|
4063
|
+
return /* @__PURE__ */ jsx33(
|
|
3948
4064
|
"span",
|
|
3949
4065
|
{
|
|
3950
4066
|
...spanProps,
|
|
3951
4067
|
"aria-hidden": ariaHidden,
|
|
3952
4068
|
className: cx("nu-control-opener", className),
|
|
3953
4069
|
style,
|
|
3954
|
-
children: children ?? /* @__PURE__ */
|
|
4070
|
+
children: children ?? /* @__PURE__ */ jsx33(
|
|
3955
4071
|
NuGlyph,
|
|
3956
4072
|
{
|
|
3957
4073
|
className: cx("nu-control-opener__glyph", glyphClassName),
|
|
@@ -3964,7 +4080,7 @@ function ControlOpener(props) {
|
|
|
3964
4080
|
}
|
|
3965
4081
|
|
|
3966
4082
|
// src/components/_shared/usePopupPosition.ts
|
|
3967
|
-
import { useLayoutEffect as
|
|
4083
|
+
import { useLayoutEffect as useLayoutEffect3 } from "react";
|
|
3968
4084
|
|
|
3969
4085
|
// src/components/_shared/portalPositioning.ts
|
|
3970
4086
|
function isDocumentViewportRoot(portalRoot) {
|
|
@@ -4028,7 +4144,7 @@ function usePopupPosition({
|
|
|
4028
4144
|
popupRef,
|
|
4029
4145
|
portalRoot = defaultPortalRoot()
|
|
4030
4146
|
}) {
|
|
4031
|
-
|
|
4147
|
+
useLayoutEffect3(() => {
|
|
4032
4148
|
const anchor = anchorRef.current;
|
|
4033
4149
|
const popupNode = popupRef.current;
|
|
4034
4150
|
if (!open || !anchor || !popupNode) {
|
|
@@ -4067,7 +4183,7 @@ function usePopupPosition({
|
|
|
4067
4183
|
}
|
|
4068
4184
|
|
|
4069
4185
|
// src/components/Dropdown/Dropdown.tsx
|
|
4070
|
-
import { jsx as
|
|
4186
|
+
import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4071
4187
|
function flattenDropdownOptions(data) {
|
|
4072
4188
|
const options = [];
|
|
4073
4189
|
data.forEach((group) => {
|
|
@@ -4116,19 +4232,19 @@ function Dropdown({
|
|
|
4116
4232
|
style,
|
|
4117
4233
|
...props
|
|
4118
4234
|
}) {
|
|
4119
|
-
const rootRef =
|
|
4120
|
-
const triggerRef =
|
|
4121
|
-
const fieldRef =
|
|
4122
|
-
const popupRef =
|
|
4123
|
-
const popupListRef =
|
|
4124
|
-
const [open, setOpen] =
|
|
4235
|
+
const rootRef = useRef9(null);
|
|
4236
|
+
const triggerRef = useRef9(null);
|
|
4237
|
+
const fieldRef = useRef9(null);
|
|
4238
|
+
const popupRef = useRef9(null);
|
|
4239
|
+
const popupListRef = useRef9(null);
|
|
4240
|
+
const [open, setOpen] = useState13(false);
|
|
4125
4241
|
const options = useMemo8(() => flattenDropdownOptions(data), [data]);
|
|
4126
4242
|
const generatedId = useId4();
|
|
4127
4243
|
const fieldId = `${generatedId}-dropdown`;
|
|
4128
4244
|
const labelId = `${fieldId}-label`;
|
|
4129
4245
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
4130
4246
|
const isControlled = value !== void 0;
|
|
4131
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
4247
|
+
const [uncontrolledValue, setUncontrolledValue] = useState13(() => getInitialValue(options, defaultValue));
|
|
4132
4248
|
const resolvedValue = isControlled ? value : uncontrolledValue;
|
|
4133
4249
|
const selectedOption = useMemo8(
|
|
4134
4250
|
() => findSelectedOption(options, resolvedValue),
|
|
@@ -4233,7 +4349,7 @@ function Dropdown({
|
|
|
4233
4349
|
break;
|
|
4234
4350
|
}
|
|
4235
4351
|
}
|
|
4236
|
-
return /* @__PURE__ */
|
|
4352
|
+
return /* @__PURE__ */ jsxs19(
|
|
4237
4353
|
"div",
|
|
4238
4354
|
{
|
|
4239
4355
|
...props,
|
|
@@ -4241,7 +4357,7 @@ function Dropdown({
|
|
|
4241
4357
|
ref: rootRef,
|
|
4242
4358
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
4243
4359
|
children: [
|
|
4244
|
-
/* @__PURE__ */
|
|
4360
|
+
/* @__PURE__ */ jsx34(
|
|
4245
4361
|
"span",
|
|
4246
4362
|
{
|
|
4247
4363
|
className: cx("nu-dropdown__label", slotClassNames?.label),
|
|
@@ -4250,7 +4366,7 @@ function Dropdown({
|
|
|
4250
4366
|
children: renderMnemonicText(label)
|
|
4251
4367
|
}
|
|
4252
4368
|
),
|
|
4253
|
-
/* @__PURE__ */
|
|
4369
|
+
/* @__PURE__ */ jsx34(
|
|
4254
4370
|
"button",
|
|
4255
4371
|
{
|
|
4256
4372
|
"aria-describedby": hintId,
|
|
@@ -4268,20 +4384,20 @@ function Dropdown({
|
|
|
4268
4384
|
},
|
|
4269
4385
|
style: slotStyles?.trigger,
|
|
4270
4386
|
type: "button",
|
|
4271
|
-
children: /* @__PURE__ */
|
|
4387
|
+
children: /* @__PURE__ */ jsxs19(
|
|
4272
4388
|
"span",
|
|
4273
4389
|
{
|
|
4274
4390
|
className: cx("nu-dropdown__slot", slotClassNames?.slot),
|
|
4275
4391
|
style: slotStyles?.slot,
|
|
4276
4392
|
children: [
|
|
4277
|
-
/* @__PURE__ */
|
|
4393
|
+
/* @__PURE__ */ jsxs19(
|
|
4278
4394
|
"span",
|
|
4279
4395
|
{
|
|
4280
4396
|
className: cx("nu-dropdown__field", slotClassNames?.field),
|
|
4281
4397
|
ref: fieldRef,
|
|
4282
4398
|
style: slotStyles?.field,
|
|
4283
4399
|
children: [
|
|
4284
|
-
/* @__PURE__ */
|
|
4400
|
+
/* @__PURE__ */ jsx34(
|
|
4285
4401
|
"span",
|
|
4286
4402
|
{
|
|
4287
4403
|
"aria-hidden": "true",
|
|
@@ -4290,7 +4406,7 @@ function Dropdown({
|
|
|
4290
4406
|
children: "["
|
|
4291
4407
|
}
|
|
4292
4408
|
),
|
|
4293
|
-
/* @__PURE__ */
|
|
4409
|
+
/* @__PURE__ */ jsx34(
|
|
4294
4410
|
"span",
|
|
4295
4411
|
{
|
|
4296
4412
|
className: cx(
|
|
@@ -4298,7 +4414,7 @@ function Dropdown({
|
|
|
4298
4414
|
slotClassNames?.valueShell
|
|
4299
4415
|
),
|
|
4300
4416
|
style: slotStyles?.valueShell,
|
|
4301
|
-
children: /* @__PURE__ */
|
|
4417
|
+
children: /* @__PURE__ */ jsx34(
|
|
4302
4418
|
"span",
|
|
4303
4419
|
{
|
|
4304
4420
|
className: cx("nu-dropdown__value", slotClassNames?.value),
|
|
@@ -4308,7 +4424,7 @@ function Dropdown({
|
|
|
4308
4424
|
)
|
|
4309
4425
|
}
|
|
4310
4426
|
),
|
|
4311
|
-
/* @__PURE__ */
|
|
4427
|
+
/* @__PURE__ */ jsx34(
|
|
4312
4428
|
"span",
|
|
4313
4429
|
{
|
|
4314
4430
|
"aria-hidden": "true",
|
|
@@ -4320,7 +4436,7 @@ function Dropdown({
|
|
|
4320
4436
|
]
|
|
4321
4437
|
}
|
|
4322
4438
|
),
|
|
4323
|
-
/* @__PURE__ */
|
|
4439
|
+
/* @__PURE__ */ jsx34(
|
|
4324
4440
|
ControlOpener,
|
|
4325
4441
|
{
|
|
4326
4442
|
ariaHidden: true,
|
|
@@ -4331,7 +4447,7 @@ function Dropdown({
|
|
|
4331
4447
|
slotClassNames?.arrowShell
|
|
4332
4448
|
),
|
|
4333
4449
|
style: slotStyles?.arrowShell,
|
|
4334
|
-
children: /* @__PURE__ */
|
|
4450
|
+
children: /* @__PURE__ */ jsx34(
|
|
4335
4451
|
NuGlyph,
|
|
4336
4452
|
{
|
|
4337
4453
|
className: cx(
|
|
@@ -4350,7 +4466,7 @@ function Dropdown({
|
|
|
4350
4466
|
)
|
|
4351
4467
|
}
|
|
4352
4468
|
),
|
|
4353
|
-
hint ? /* @__PURE__ */
|
|
4469
|
+
hint ? /* @__PURE__ */ jsx34(
|
|
4354
4470
|
"span",
|
|
4355
4471
|
{
|
|
4356
4472
|
className: cx("nu-dropdown__hint", slotClassNames?.hint),
|
|
@@ -4360,7 +4476,7 @@ function Dropdown({
|
|
|
4360
4476
|
}
|
|
4361
4477
|
) : null,
|
|
4362
4478
|
open && typeof document !== "undefined" ? createPortal(
|
|
4363
|
-
/* @__PURE__ */
|
|
4479
|
+
/* @__PURE__ */ jsx34(
|
|
4364
4480
|
"div",
|
|
4365
4481
|
{
|
|
4366
4482
|
className: cx("nu-dropdown__popup", slotClassNames?.popup),
|
|
@@ -4369,7 +4485,7 @@ function Dropdown({
|
|
|
4369
4485
|
{ left: 0, top: 0, visibility: "hidden", width: 0 },
|
|
4370
4486
|
slotStyles?.popup
|
|
4371
4487
|
),
|
|
4372
|
-
children: /* @__PURE__ */
|
|
4488
|
+
children: /* @__PURE__ */ jsx34(
|
|
4373
4489
|
"div",
|
|
4374
4490
|
{
|
|
4375
4491
|
className: cx(
|
|
@@ -4378,7 +4494,7 @@ function Dropdown({
|
|
|
4378
4494
|
),
|
|
4379
4495
|
ref: popupListRef,
|
|
4380
4496
|
style: slotStyles?.popupShell,
|
|
4381
|
-
children: /* @__PURE__ */
|
|
4497
|
+
children: /* @__PURE__ */ jsx34(
|
|
4382
4498
|
ListBox,
|
|
4383
4499
|
{
|
|
4384
4500
|
className: cx(
|
|
@@ -4411,7 +4527,7 @@ function Dropdown({
|
|
|
4411
4527
|
}
|
|
4412
4528
|
|
|
4413
4529
|
// src/components/Frame/Frame.tsx
|
|
4414
|
-
import { jsx as
|
|
4530
|
+
import { jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4415
4531
|
function Frame({
|
|
4416
4532
|
children,
|
|
4417
4533
|
className,
|
|
@@ -4432,7 +4548,7 @@ function Frame({
|
|
|
4432
4548
|
}) {
|
|
4433
4549
|
const resolvedTitleContent = titleContent ?? (title ? renderMnemonicText(title) : null);
|
|
4434
4550
|
const hasTitleShell = Boolean(titleStart || resolvedTitleContent || titleEnd);
|
|
4435
|
-
return /* @__PURE__ */
|
|
4551
|
+
return /* @__PURE__ */ jsxs20(
|
|
4436
4552
|
"section",
|
|
4437
4553
|
{
|
|
4438
4554
|
...props,
|
|
@@ -4449,13 +4565,13 @@ function Frame({
|
|
|
4449
4565
|
...slotStyles?.root
|
|
4450
4566
|
},
|
|
4451
4567
|
children: [
|
|
4452
|
-
hasTitleShell ? /* @__PURE__ */
|
|
4568
|
+
hasTitleShell ? /* @__PURE__ */ jsxs20(
|
|
4453
4569
|
"span",
|
|
4454
4570
|
{
|
|
4455
4571
|
className: cx("nu-frame__title", slotClassNames?.title),
|
|
4456
4572
|
style: mergeSlotStyle(titleStyle, slotStyles?.title),
|
|
4457
4573
|
children: [
|
|
4458
|
-
titleStart ? /* @__PURE__ */
|
|
4574
|
+
titleStart ? /* @__PURE__ */ jsx35(
|
|
4459
4575
|
"span",
|
|
4460
4576
|
{
|
|
4461
4577
|
className: cx(
|
|
@@ -4466,7 +4582,7 @@ function Frame({
|
|
|
4466
4582
|
children: titleStart
|
|
4467
4583
|
}
|
|
4468
4584
|
) : null,
|
|
4469
|
-
resolvedTitleContent ? /* @__PURE__ */
|
|
4585
|
+
resolvedTitleContent ? /* @__PURE__ */ jsx35(
|
|
4470
4586
|
"span",
|
|
4471
4587
|
{
|
|
4472
4588
|
className: cx(
|
|
@@ -4477,7 +4593,7 @@ function Frame({
|
|
|
4477
4593
|
children: resolvedTitleContent
|
|
4478
4594
|
}
|
|
4479
4595
|
) : null,
|
|
4480
|
-
titleEnd ? /* @__PURE__ */
|
|
4596
|
+
titleEnd ? /* @__PURE__ */ jsx35(
|
|
4481
4597
|
"span",
|
|
4482
4598
|
{
|
|
4483
4599
|
className: cx("nu-frame__title-end", slotClassNames?.titleEnd),
|
|
@@ -4488,7 +4604,7 @@ function Frame({
|
|
|
4488
4604
|
]
|
|
4489
4605
|
}
|
|
4490
4606
|
) : null,
|
|
4491
|
-
/* @__PURE__ */
|
|
4607
|
+
/* @__PURE__ */ jsx35(
|
|
4492
4608
|
"div",
|
|
4493
4609
|
{
|
|
4494
4610
|
className: cx("nu-frame__body", slotClassNames?.body),
|
|
@@ -4502,7 +4618,7 @@ function Frame({
|
|
|
4502
4618
|
}
|
|
4503
4619
|
|
|
4504
4620
|
// src/components/Info/Info.tsx
|
|
4505
|
-
import { jsx as
|
|
4621
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
4506
4622
|
function Info({
|
|
4507
4623
|
accentColor,
|
|
4508
4624
|
children,
|
|
@@ -4511,7 +4627,7 @@ function Info({
|
|
|
4511
4627
|
style,
|
|
4512
4628
|
...props
|
|
4513
4629
|
}) {
|
|
4514
|
-
return /* @__PURE__ */
|
|
4630
|
+
return /* @__PURE__ */ jsx36(
|
|
4515
4631
|
"div",
|
|
4516
4632
|
{
|
|
4517
4633
|
...props,
|
|
@@ -4535,7 +4651,7 @@ function InfoAccent({
|
|
|
4535
4651
|
upper = false,
|
|
4536
4652
|
...props
|
|
4537
4653
|
}) {
|
|
4538
|
-
return /* @__PURE__ */
|
|
4654
|
+
return /* @__PURE__ */ jsx36(
|
|
4539
4655
|
"span",
|
|
4540
4656
|
{
|
|
4541
4657
|
...props,
|
|
@@ -4552,24 +4668,26 @@ function InfoAccent({
|
|
|
4552
4668
|
|
|
4553
4669
|
// src/components/IconGrid/NuIconGrid.tsx
|
|
4554
4670
|
import {
|
|
4555
|
-
useLayoutEffect as
|
|
4671
|
+
useLayoutEffect as useLayoutEffect5,
|
|
4556
4672
|
useMemo as useMemo9,
|
|
4557
|
-
useRef as
|
|
4558
|
-
useState as
|
|
4673
|
+
useRef as useRef11,
|
|
4674
|
+
useState as useState16
|
|
4559
4675
|
} from "react";
|
|
4560
4676
|
|
|
4561
4677
|
// src/components/PopupMenu/PopupMenu.tsx
|
|
4562
4678
|
import {
|
|
4563
4679
|
useCallback as useCallback4,
|
|
4564
4680
|
useEffect as useEffect8,
|
|
4565
|
-
useLayoutEffect as
|
|
4566
|
-
useRef as
|
|
4567
|
-
useState as
|
|
4681
|
+
useLayoutEffect as useLayoutEffect4,
|
|
4682
|
+
useRef as useRef10,
|
|
4683
|
+
useState as useState14
|
|
4568
4684
|
} from "react";
|
|
4569
4685
|
import { createPortal as createPortal2 } from "react-dom";
|
|
4570
|
-
import { jsx as
|
|
4686
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
4571
4687
|
function hasVisibleChildren2(item) {
|
|
4572
|
-
return Boolean(
|
|
4688
|
+
return Boolean(
|
|
4689
|
+
item.items?.some((child) => isMainMenuItem(child) && !child.hidden)
|
|
4690
|
+
);
|
|
4573
4691
|
}
|
|
4574
4692
|
function clamp(value, min, max) {
|
|
4575
4693
|
return Math.min(max, Math.max(min, value));
|
|
@@ -4608,9 +4726,9 @@ function PopupMenu({
|
|
|
4608
4726
|
uncheckedShape = "box",
|
|
4609
4727
|
...props
|
|
4610
4728
|
}) {
|
|
4611
|
-
const rootRef =
|
|
4612
|
-
const [activePath, setActivePath] =
|
|
4613
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
4729
|
+
const rootRef = useRef10(null);
|
|
4730
|
+
const [activePath, setActivePath] = useState14([]);
|
|
4731
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState14(defaultOpen);
|
|
4614
4732
|
const isControlled = open !== void 0;
|
|
4615
4733
|
const resolvedOpen = isControlled ? open : uncontrolledOpen;
|
|
4616
4734
|
const portalRoot = resolvePortalRoot();
|
|
@@ -4647,7 +4765,7 @@ function PopupMenu({
|
|
|
4647
4765
|
document.removeEventListener("keydown", handleKeyDown);
|
|
4648
4766
|
};
|
|
4649
4767
|
}, [resolvedOpen, setResolvedOpen]);
|
|
4650
|
-
|
|
4768
|
+
useLayoutEffect4(() => {
|
|
4651
4769
|
if (!resolvedOpen || !anchor || !rootRef.current) {
|
|
4652
4770
|
return;
|
|
4653
4771
|
}
|
|
@@ -4697,11 +4815,11 @@ function PopupMenu({
|
|
|
4697
4815
|
}
|
|
4698
4816
|
setActivePath((currentPath) => [...currentPath.slice(0, level), item.id]);
|
|
4699
4817
|
}
|
|
4700
|
-
if (!resolvedOpen || !anchor || !portalRoot || items
|
|
4818
|
+
if (!resolvedOpen || !anchor || !portalRoot || !hasVisibleMainMenuItems(items)) {
|
|
4701
4819
|
return null;
|
|
4702
4820
|
}
|
|
4703
4821
|
return createPortal2(
|
|
4704
|
-
/* @__PURE__ */
|
|
4822
|
+
/* @__PURE__ */ jsx37(
|
|
4705
4823
|
"div",
|
|
4706
4824
|
{
|
|
4707
4825
|
...props,
|
|
@@ -4717,7 +4835,7 @@ function PopupMenu({
|
|
|
4717
4835
|
top: 0,
|
|
4718
4836
|
visibility: "hidden"
|
|
4719
4837
|
},
|
|
4720
|
-
children: /* @__PURE__ */
|
|
4838
|
+
children: /* @__PURE__ */ jsx37("div", { className: "nu-popup-menu__shell", children: /* @__PURE__ */ jsx37(
|
|
4721
4839
|
MainMenuList,
|
|
4722
4840
|
{
|
|
4723
4841
|
activePath,
|
|
@@ -4736,10 +4854,10 @@ function PopupMenu({
|
|
|
4736
4854
|
}
|
|
4737
4855
|
|
|
4738
4856
|
// src/components/PopupMenu/usePopupMenu.ts
|
|
4739
|
-
import { useState as
|
|
4857
|
+
import { useState as useState15 } from "react";
|
|
4740
4858
|
function usePopupMenu() {
|
|
4741
|
-
const [anchor, setAnchor] =
|
|
4742
|
-
const [open, setOpen] =
|
|
4859
|
+
const [anchor, setAnchor] = useState15(null);
|
|
4860
|
+
const [open, setOpen] = useState15(false);
|
|
4743
4861
|
function close() {
|
|
4744
4862
|
setOpen(false);
|
|
4745
4863
|
}
|
|
@@ -4796,7 +4914,7 @@ function useNuIconGridContext() {
|
|
|
4796
4914
|
}
|
|
4797
4915
|
|
|
4798
4916
|
// src/components/IconGrid/NuIconGrid.tsx
|
|
4799
|
-
import { Fragment as Fragment5, jsx as
|
|
4917
|
+
import { Fragment as Fragment5, jsx as jsx38, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4800
4918
|
var DRAG_THRESHOLD2 = 3;
|
|
4801
4919
|
var gridRegistrations = /* @__PURE__ */ new Map();
|
|
4802
4920
|
function clamp2(value, minimum, maximum) {
|
|
@@ -4854,11 +4972,11 @@ function NuIconGridItem({
|
|
|
4854
4972
|
const manager = useNuIconGridContext();
|
|
4855
4973
|
const dragDrop = useNuDragDrop();
|
|
4856
4974
|
const contextMenu = usePopupMenu();
|
|
4857
|
-
const dragStartRef =
|
|
4858
|
-
const isDraggingRef =
|
|
4859
|
-
const [isDragging, setIsDragging] =
|
|
4860
|
-
const suppressClickRef =
|
|
4861
|
-
const latestPositionRef =
|
|
4975
|
+
const dragStartRef = useRef11(void 0);
|
|
4976
|
+
const isDraggingRef = useRef11(false);
|
|
4977
|
+
const [isDragging, setIsDragging] = useState16(false);
|
|
4978
|
+
const suppressClickRef = useRef11(false);
|
|
4979
|
+
const latestPositionRef = useRef11(icon.position);
|
|
4862
4980
|
const contextMenuItems = resolveIconContextMenuItems(
|
|
4863
4981
|
icon.contextMenuItems,
|
|
4864
4982
|
icon
|
|
@@ -5010,8 +5128,8 @@ function NuIconGridItem({
|
|
|
5010
5128
|
manager.selectIcon(icon.id);
|
|
5011
5129
|
contextMenu.openAtElement(event.currentTarget);
|
|
5012
5130
|
}
|
|
5013
|
-
return /* @__PURE__ */
|
|
5014
|
-
/* @__PURE__ */
|
|
5131
|
+
return /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
5132
|
+
/* @__PURE__ */ jsxs21(
|
|
5015
5133
|
"button",
|
|
5016
5134
|
{
|
|
5017
5135
|
"aria-haspopup": contextMenuItems.length > 0 ? "menu" : void 0,
|
|
@@ -5030,12 +5148,12 @@ function NuIconGridItem({
|
|
|
5030
5148
|
style: { left: icon.position.x, top: icon.position.y },
|
|
5031
5149
|
type: "button",
|
|
5032
5150
|
children: [
|
|
5033
|
-
/* @__PURE__ */
|
|
5034
|
-
/* @__PURE__ */
|
|
5151
|
+
/* @__PURE__ */ jsx38("span", { "aria-hidden": "true", className: "nu-icon-grid__glyph", children: typeof icon.icon === "string" ? /* @__PURE__ */ jsx38("img", { alt: "", draggable: false, src: icon.icon }) : icon.icon }),
|
|
5152
|
+
/* @__PURE__ */ jsx38("span", { className: "nu-icon-grid__label", children: renderMnemonicText(icon.label) })
|
|
5035
5153
|
]
|
|
5036
5154
|
}
|
|
5037
5155
|
),
|
|
5038
|
-
/* @__PURE__ */
|
|
5156
|
+
/* @__PURE__ */ jsx38(
|
|
5039
5157
|
PopupMenu,
|
|
5040
5158
|
{
|
|
5041
5159
|
anchor: contextMenu.anchor,
|
|
@@ -5061,9 +5179,9 @@ function NuIconGrid({
|
|
|
5061
5179
|
onPointerDown,
|
|
5062
5180
|
...props
|
|
5063
5181
|
}) {
|
|
5064
|
-
const [gridElement, setGridElement] =
|
|
5182
|
+
const [gridElement, setGridElement] = useState16(null);
|
|
5065
5183
|
const manager = useNuIconGridContext();
|
|
5066
|
-
const hasAppliedDefaultArrangementRef =
|
|
5184
|
+
const hasAppliedDefaultArrangementRef = useRef11(false);
|
|
5067
5185
|
const arrangeIcons = manager.arrangeIcons;
|
|
5068
5186
|
const setGridSize = manager.setGridSize;
|
|
5069
5187
|
const contextMenu = usePopupMenu();
|
|
@@ -5080,7 +5198,7 @@ function NuIconGrid({
|
|
|
5080
5198
|
[acceptsDrop, onDrop]
|
|
5081
5199
|
);
|
|
5082
5200
|
useNuDropTarget(gridElement, sharedDropTargetOptions);
|
|
5083
|
-
|
|
5201
|
+
useLayoutEffect5(() => {
|
|
5084
5202
|
if (!gridElement) {
|
|
5085
5203
|
return;
|
|
5086
5204
|
}
|
|
@@ -5101,7 +5219,7 @@ function NuIconGrid({
|
|
|
5101
5219
|
resizeObserver.observe(gridElement);
|
|
5102
5220
|
return () => resizeObserver.disconnect();
|
|
5103
5221
|
}, [arrangeIcons, defaultArrangeMode, gridElement, setGridSize]);
|
|
5104
|
-
|
|
5222
|
+
useLayoutEffect5(() => {
|
|
5105
5223
|
if (!gridElement) {
|
|
5106
5224
|
return;
|
|
5107
5225
|
}
|
|
@@ -5125,7 +5243,7 @@ function NuIconGrid({
|
|
|
5125
5243
|
manager.selectIcon(null);
|
|
5126
5244
|
contextMenu.openAtPoint(event.clientX, event.clientY, event.currentTarget);
|
|
5127
5245
|
}
|
|
5128
|
-
return /* @__PURE__ */
|
|
5246
|
+
return /* @__PURE__ */ jsxs21(
|
|
5129
5247
|
"div",
|
|
5130
5248
|
{
|
|
5131
5249
|
...props,
|
|
@@ -5144,7 +5262,7 @@ function NuIconGrid({
|
|
|
5144
5262
|
ref: setGridElement,
|
|
5145
5263
|
role: "group",
|
|
5146
5264
|
children: [
|
|
5147
|
-
manager.icons.map((icon) => /* @__PURE__ */
|
|
5265
|
+
manager.icons.map((icon) => /* @__PURE__ */ jsx38(
|
|
5148
5266
|
NuIconGridItem,
|
|
5149
5267
|
{
|
|
5150
5268
|
gridElement,
|
|
@@ -5154,7 +5272,7 @@ function NuIconGrid({
|
|
|
5154
5272
|
},
|
|
5155
5273
|
icon.id
|
|
5156
5274
|
)),
|
|
5157
|
-
/* @__PURE__ */
|
|
5275
|
+
/* @__PURE__ */ jsx38(
|
|
5158
5276
|
PopupMenu,
|
|
5159
5277
|
{
|
|
5160
5278
|
anchor: contextMenu.anchor,
|
|
@@ -5172,10 +5290,10 @@ function NuIconGrid({
|
|
|
5172
5290
|
import {
|
|
5173
5291
|
useCallback as useCallback5,
|
|
5174
5292
|
useMemo as useMemo10,
|
|
5175
|
-
useRef as
|
|
5176
|
-
useState as
|
|
5293
|
+
useRef as useRef12,
|
|
5294
|
+
useState as useState17
|
|
5177
5295
|
} from "react";
|
|
5178
|
-
import { jsx as
|
|
5296
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
5179
5297
|
var GRID_PADDING = 12;
|
|
5180
5298
|
var ICON_CELL_HEIGHT = 104;
|
|
5181
5299
|
var ICON_CELL_WIDTH = 104;
|
|
@@ -5240,12 +5358,12 @@ function NuIconProvider({
|
|
|
5240
5358
|
children,
|
|
5241
5359
|
defaultIcons = []
|
|
5242
5360
|
}) {
|
|
5243
|
-
const idRef =
|
|
5244
|
-
const gridSizeRef =
|
|
5245
|
-
const [icons, setIcons] =
|
|
5361
|
+
const idRef = useRef12(defaultIcons.length);
|
|
5362
|
+
const gridSizeRef = useRef12({ height: 0, width: 0 });
|
|
5363
|
+
const [icons, setIcons] = useState17(
|
|
5246
5364
|
() => getInitialIcons(defaultIcons)
|
|
5247
5365
|
);
|
|
5248
|
-
const [selectedIconId, setSelectedIconId] =
|
|
5366
|
+
const [selectedIconId, setSelectedIconId] = useState17(null);
|
|
5249
5367
|
const addIcon = useCallback5((definition) => {
|
|
5250
5368
|
const id = definition.id ?? `nu-icon-${++idRef.current}`;
|
|
5251
5369
|
setIcons((currentIcons) => {
|
|
@@ -5323,7 +5441,7 @@ function NuIconProvider({
|
|
|
5323
5441
|
updateIcon
|
|
5324
5442
|
]
|
|
5325
5443
|
);
|
|
5326
|
-
return /* @__PURE__ */
|
|
5444
|
+
return /* @__PURE__ */ jsx39(NuIconContext.Provider, { value: contextValue, children });
|
|
5327
5445
|
}
|
|
5328
5446
|
|
|
5329
5447
|
// src/components/ComboBox/ComboBox.tsx
|
|
@@ -5331,11 +5449,11 @@ import {
|
|
|
5331
5449
|
useEffect as useEffect9,
|
|
5332
5450
|
useId as useId5,
|
|
5333
5451
|
useMemo as useMemo11,
|
|
5334
|
-
useRef as
|
|
5335
|
-
useState as
|
|
5452
|
+
useRef as useRef13,
|
|
5453
|
+
useState as useState18
|
|
5336
5454
|
} from "react";
|
|
5337
5455
|
import { createPortal as createPortal3 } from "react-dom";
|
|
5338
|
-
import { jsx as
|
|
5456
|
+
import { jsx as jsx40, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5339
5457
|
function flattenComboBoxOptions(data) {
|
|
5340
5458
|
const options = [];
|
|
5341
5459
|
data.forEach((group) => {
|
|
@@ -5376,21 +5494,21 @@ function ComboBox({
|
|
|
5376
5494
|
value,
|
|
5377
5495
|
...props
|
|
5378
5496
|
}) {
|
|
5379
|
-
const rootRef =
|
|
5380
|
-
const inputRef =
|
|
5381
|
-
const fieldRef =
|
|
5382
|
-
const popupRef =
|
|
5497
|
+
const rootRef = useRef13(null);
|
|
5498
|
+
const inputRef = useRef13(null);
|
|
5499
|
+
const fieldRef = useRef13(null);
|
|
5500
|
+
const popupRef = useRef13(null);
|
|
5383
5501
|
const generatedId = useId5();
|
|
5384
5502
|
const fieldId = `${generatedId}-combo-box`;
|
|
5385
5503
|
const labelId = `${fieldId}-label`;
|
|
5386
5504
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
5387
|
-
const [open, setOpen] =
|
|
5505
|
+
const [open, setOpen] = useState18(false);
|
|
5388
5506
|
const options = useMemo11(() => flattenComboBoxOptions(data), [data]);
|
|
5389
5507
|
const isValueControlled = value !== void 0;
|
|
5390
5508
|
const isInputControlled = inputValueProp !== void 0;
|
|
5391
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
5509
|
+
const [uncontrolledValue, setUncontrolledValue] = useState18(() => defaultValue);
|
|
5392
5510
|
const initialSelectedOption = findComboBoxOption(options, defaultValue);
|
|
5393
|
-
const [uncontrolledInputValue, setUncontrolledInputValue] =
|
|
5511
|
+
const [uncontrolledInputValue, setUncontrolledInputValue] = useState18(
|
|
5394
5512
|
() => defaultInputValue ?? initialSelectedOption?.item.name.text ?? ""
|
|
5395
5513
|
);
|
|
5396
5514
|
const resolvedValue = isValueControlled ? value : uncontrolledValue;
|
|
@@ -5418,7 +5536,7 @@ function ComboBox({
|
|
|
5418
5536
|
[filteredData]
|
|
5419
5537
|
);
|
|
5420
5538
|
const popupRoot = typeof document === "undefined" ? null : resolveComboBoxPortalRoot();
|
|
5421
|
-
const [themePortalStyle, setThemePortalStyle] =
|
|
5539
|
+
const [themePortalStyle, setThemePortalStyle] = useState18(() => void 0);
|
|
5422
5540
|
useEffect9(() => {
|
|
5423
5541
|
if (!open) {
|
|
5424
5542
|
return;
|
|
@@ -5495,7 +5613,7 @@ function ComboBox({
|
|
|
5495
5613
|
break;
|
|
5496
5614
|
}
|
|
5497
5615
|
}
|
|
5498
|
-
return /* @__PURE__ */
|
|
5616
|
+
return /* @__PURE__ */ jsxs22(
|
|
5499
5617
|
"div",
|
|
5500
5618
|
{
|
|
5501
5619
|
...props,
|
|
@@ -5503,7 +5621,7 @@ function ComboBox({
|
|
|
5503
5621
|
ref: rootRef,
|
|
5504
5622
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
5505
5623
|
children: [
|
|
5506
|
-
/* @__PURE__ */
|
|
5624
|
+
/* @__PURE__ */ jsx40(
|
|
5507
5625
|
"label",
|
|
5508
5626
|
{
|
|
5509
5627
|
className: cx("nu-combo-box__label", slotClassNames?.label),
|
|
@@ -5513,20 +5631,20 @@ function ComboBox({
|
|
|
5513
5631
|
children: renderMnemonicText(label)
|
|
5514
5632
|
}
|
|
5515
5633
|
),
|
|
5516
|
-
/* @__PURE__ */
|
|
5634
|
+
/* @__PURE__ */ jsxs22(
|
|
5517
5635
|
"span",
|
|
5518
5636
|
{
|
|
5519
5637
|
className: cx("nu-combo-box__slot", slotClassNames?.slot),
|
|
5520
5638
|
style: slotStyles?.slot,
|
|
5521
5639
|
children: [
|
|
5522
|
-
/* @__PURE__ */
|
|
5640
|
+
/* @__PURE__ */ jsxs22(
|
|
5523
5641
|
"span",
|
|
5524
5642
|
{
|
|
5525
5643
|
className: cx("nu-combo-box__field", slotClassNames?.field),
|
|
5526
5644
|
ref: fieldRef,
|
|
5527
5645
|
style: slotStyles?.field,
|
|
5528
5646
|
children: [
|
|
5529
|
-
/* @__PURE__ */
|
|
5647
|
+
/* @__PURE__ */ jsx40(
|
|
5530
5648
|
"span",
|
|
5531
5649
|
{
|
|
5532
5650
|
"aria-hidden": "true",
|
|
@@ -5535,7 +5653,7 @@ function ComboBox({
|
|
|
5535
5653
|
children: "["
|
|
5536
5654
|
}
|
|
5537
5655
|
),
|
|
5538
|
-
/* @__PURE__ */
|
|
5656
|
+
/* @__PURE__ */ jsx40(
|
|
5539
5657
|
"span",
|
|
5540
5658
|
{
|
|
5541
5659
|
className: cx(
|
|
@@ -5543,7 +5661,7 @@ function ComboBox({
|
|
|
5543
5661
|
slotClassNames?.inputShell
|
|
5544
5662
|
),
|
|
5545
5663
|
style: slotStyles?.inputShell,
|
|
5546
|
-
children: /* @__PURE__ */
|
|
5664
|
+
children: /* @__PURE__ */ jsx40(
|
|
5547
5665
|
"input",
|
|
5548
5666
|
{
|
|
5549
5667
|
"aria-autocomplete": "list",
|
|
@@ -5570,7 +5688,7 @@ function ComboBox({
|
|
|
5570
5688
|
)
|
|
5571
5689
|
}
|
|
5572
5690
|
),
|
|
5573
|
-
/* @__PURE__ */
|
|
5691
|
+
/* @__PURE__ */ jsx40(
|
|
5574
5692
|
"span",
|
|
5575
5693
|
{
|
|
5576
5694
|
"aria-hidden": "true",
|
|
@@ -5582,7 +5700,7 @@ function ComboBox({
|
|
|
5582
5700
|
]
|
|
5583
5701
|
}
|
|
5584
5702
|
),
|
|
5585
|
-
/* @__PURE__ */
|
|
5703
|
+
/* @__PURE__ */ jsx40(
|
|
5586
5704
|
ControlOpener,
|
|
5587
5705
|
{
|
|
5588
5706
|
"aria-label": open ? "Collapse list" : "Expand list",
|
|
@@ -5600,7 +5718,7 @@ function ComboBox({
|
|
|
5600
5718
|
]
|
|
5601
5719
|
}
|
|
5602
5720
|
),
|
|
5603
|
-
hint ? /* @__PURE__ */
|
|
5721
|
+
hint ? /* @__PURE__ */ jsx40(
|
|
5604
5722
|
"span",
|
|
5605
5723
|
{
|
|
5606
5724
|
className: cx("nu-combo-box__hint", slotClassNames?.hint),
|
|
@@ -5610,7 +5728,7 @@ function ComboBox({
|
|
|
5610
5728
|
}
|
|
5611
5729
|
) : null,
|
|
5612
5730
|
open && popupRoot ? createPortal3(
|
|
5613
|
-
/* @__PURE__ */
|
|
5731
|
+
/* @__PURE__ */ jsx40(
|
|
5614
5732
|
"div",
|
|
5615
5733
|
{
|
|
5616
5734
|
className: cx("nu-combo-box__popup", slotClassNames?.popup),
|
|
@@ -5620,12 +5738,12 @@ function ComboBox({
|
|
|
5620
5738
|
themePortalStyle,
|
|
5621
5739
|
slotStyles?.popup
|
|
5622
5740
|
),
|
|
5623
|
-
children: /* @__PURE__ */
|
|
5741
|
+
children: /* @__PURE__ */ jsx40(
|
|
5624
5742
|
"div",
|
|
5625
5743
|
{
|
|
5626
5744
|
className: cx("nu-combo-box__listbox", slotClassNames?.listbox),
|
|
5627
5745
|
style: slotStyles?.listbox,
|
|
5628
|
-
children: /* @__PURE__ */
|
|
5746
|
+
children: /* @__PURE__ */ jsx40(
|
|
5629
5747
|
ListBox,
|
|
5630
5748
|
{
|
|
5631
5749
|
data: filteredData,
|
|
@@ -5658,7 +5776,7 @@ function ComboBox({
|
|
|
5658
5776
|
import {
|
|
5659
5777
|
Fragment as Fragment6
|
|
5660
5778
|
} from "react";
|
|
5661
|
-
import { jsx as
|
|
5779
|
+
import { jsx as jsx41, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5662
5780
|
var COMMAND_BUTTON_GLYPH_NAMES = /* @__PURE__ */ new Set([
|
|
5663
5781
|
"check-fill",
|
|
5664
5782
|
"check-mark",
|
|
@@ -5699,7 +5817,7 @@ function CommandButton({
|
|
|
5699
5817
|
const hasMenu = menuItems.length > 0;
|
|
5700
5818
|
const showCaret = dropdown || hasMenu;
|
|
5701
5819
|
const resolvedToggled = toggled ?? pressed;
|
|
5702
|
-
const resolvedIcon = typeof icon === "string" && isCommandButtonGlyphName(icon) ? /* @__PURE__ */
|
|
5820
|
+
const resolvedIcon = typeof icon === "string" && isCommandButtonGlyphName(icon) ? /* @__PURE__ */ jsx41(NuGlyph, { name: icon }) : icon ?? null;
|
|
5703
5821
|
function handleClick(event) {
|
|
5704
5822
|
onClick?.(event);
|
|
5705
5823
|
if (event.defaultPrevented || !hasMenu) {
|
|
@@ -5707,8 +5825,8 @@ function CommandButton({
|
|
|
5707
5825
|
}
|
|
5708
5826
|
popupMenu.openFromClick(event);
|
|
5709
5827
|
}
|
|
5710
|
-
return /* @__PURE__ */
|
|
5711
|
-
/* @__PURE__ */
|
|
5828
|
+
return /* @__PURE__ */ jsxs23(Fragment6, { children: [
|
|
5829
|
+
/* @__PURE__ */ jsxs23(
|
|
5712
5830
|
"button",
|
|
5713
5831
|
{
|
|
5714
5832
|
...props,
|
|
@@ -5724,7 +5842,7 @@ function CommandButton({
|
|
|
5724
5842
|
type,
|
|
5725
5843
|
onClick: handleClick,
|
|
5726
5844
|
children: [
|
|
5727
|
-
resolvedIcon ? /* @__PURE__ */
|
|
5845
|
+
resolvedIcon ? /* @__PURE__ */ jsx41(
|
|
5728
5846
|
"span",
|
|
5729
5847
|
{
|
|
5730
5848
|
className: cx(
|
|
@@ -5736,7 +5854,7 @@ function CommandButton({
|
|
|
5736
5854
|
children: resolvedIcon
|
|
5737
5855
|
}
|
|
5738
5856
|
) : null,
|
|
5739
|
-
children ? /* @__PURE__ */
|
|
5857
|
+
children ? /* @__PURE__ */ jsx41(
|
|
5740
5858
|
"span",
|
|
5741
5859
|
{
|
|
5742
5860
|
className: cx(
|
|
@@ -5748,7 +5866,7 @@ function CommandButton({
|
|
|
5748
5866
|
children: renderMnemonicNode(children)
|
|
5749
5867
|
}
|
|
5750
5868
|
) : null,
|
|
5751
|
-
showCaret ? /* @__PURE__ */
|
|
5869
|
+
showCaret ? /* @__PURE__ */ jsx41(
|
|
5752
5870
|
"span",
|
|
5753
5871
|
{
|
|
5754
5872
|
className: cx(
|
|
@@ -5757,13 +5875,13 @@ function CommandButton({
|
|
|
5757
5875
|
slotClassNames?.caret
|
|
5758
5876
|
),
|
|
5759
5877
|
style: slotStyles?.caret,
|
|
5760
|
-
children: /* @__PURE__ */
|
|
5878
|
+
children: /* @__PURE__ */ jsx41(NuGlyph, { name: "dropdown-arrow" })
|
|
5761
5879
|
}
|
|
5762
5880
|
) : null
|
|
5763
5881
|
]
|
|
5764
5882
|
}
|
|
5765
5883
|
),
|
|
5766
|
-
hasMenu ? /* @__PURE__ */
|
|
5884
|
+
hasMenu ? /* @__PURE__ */ jsx41(
|
|
5767
5885
|
PopupMenu,
|
|
5768
5886
|
{
|
|
5769
5887
|
anchor: popupMenu.anchor,
|
|
@@ -5778,8 +5896,8 @@ function CommandButton({
|
|
|
5778
5896
|
}
|
|
5779
5897
|
|
|
5780
5898
|
// src/components/CrtGlitch/CrtGlitch.tsx
|
|
5781
|
-
import { useEffect as useEffect10, useId as useId6, useRef as
|
|
5782
|
-
import { jsx as
|
|
5899
|
+
import { useEffect as useEffect10, useId as useId6, useRef as useRef14 } from "react";
|
|
5900
|
+
import { jsx as jsx42, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5783
5901
|
var DEFAULT_INTERVAL_MS = 3e3;
|
|
5784
5902
|
var DEFAULT_DURATION_MS = 2500;
|
|
5785
5903
|
var DEFAULT_TOP_LEVEL_RATIO = 1 / 3;
|
|
@@ -5805,12 +5923,12 @@ function NuCrtGlitch({
|
|
|
5805
5923
|
topLevelRatio = DEFAULT_TOP_LEVEL_RATIO
|
|
5806
5924
|
}) {
|
|
5807
5925
|
const filterId = useId6().replace(/:/g, "");
|
|
5808
|
-
const turbulenceRef =
|
|
5809
|
-
const warpRef =
|
|
5810
|
-
const rOffsetRef =
|
|
5811
|
-
const bOffsetRef =
|
|
5812
|
-
const rafRef =
|
|
5813
|
-
const targetElRef =
|
|
5926
|
+
const turbulenceRef = useRef14(null);
|
|
5927
|
+
const warpRef = useRef14(null);
|
|
5928
|
+
const rOffsetRef = useRef14(null);
|
|
5929
|
+
const bOffsetRef = useRef14(null);
|
|
5930
|
+
const rafRef = useRef14(null);
|
|
5931
|
+
const targetElRef = useRef14(null);
|
|
5814
5932
|
useEffect10(() => {
|
|
5815
5933
|
if (!enabled) {
|
|
5816
5934
|
return;
|
|
@@ -5913,7 +6031,7 @@ function NuCrtGlitch({
|
|
|
5913
6031
|
}
|
|
5914
6032
|
};
|
|
5915
6033
|
}, [durationMs, enabled, filterId, intervalMs, targetSelector, topLevelRatio]);
|
|
5916
|
-
return /* @__PURE__ */
|
|
6034
|
+
return /* @__PURE__ */ jsx42("svg", { "aria-hidden": "true", height: "0", style: { position: "absolute" }, width: "0", children: /* @__PURE__ */ jsx42("defs", { children: /* @__PURE__ */ jsxs24(
|
|
5917
6035
|
"filter",
|
|
5918
6036
|
{
|
|
5919
6037
|
"color-interpolation-filters": "sRGB",
|
|
@@ -5923,7 +6041,7 @@ function NuCrtGlitch({
|
|
|
5923
6041
|
x: "-15%",
|
|
5924
6042
|
y: "-5%",
|
|
5925
6043
|
children: [
|
|
5926
|
-
/* @__PURE__ */
|
|
6044
|
+
/* @__PURE__ */ jsx42(
|
|
5927
6045
|
"feTurbulence",
|
|
5928
6046
|
{
|
|
5929
6047
|
baseFrequency: "0.001 0.045",
|
|
@@ -5934,7 +6052,7 @@ function NuCrtGlitch({
|
|
|
5934
6052
|
type: "turbulence"
|
|
5935
6053
|
}
|
|
5936
6054
|
),
|
|
5937
|
-
/* @__PURE__ */
|
|
6055
|
+
/* @__PURE__ */ jsx42(
|
|
5938
6056
|
"feDisplacementMap",
|
|
5939
6057
|
{
|
|
5940
6058
|
in: "SourceGraphic",
|
|
@@ -5946,8 +6064,8 @@ function NuCrtGlitch({
|
|
|
5946
6064
|
yChannelSelector: "A"
|
|
5947
6065
|
}
|
|
5948
6066
|
),
|
|
5949
|
-
/* @__PURE__ */
|
|
5950
|
-
/* @__PURE__ */
|
|
6067
|
+
/* @__PURE__ */ jsx42("feOffset", { dx: 0, dy: 0, in: "warped", ref: rOffsetRef, result: "rOff" }),
|
|
6068
|
+
/* @__PURE__ */ jsx42(
|
|
5951
6069
|
"feColorMatrix",
|
|
5952
6070
|
{
|
|
5953
6071
|
in: "rOff",
|
|
@@ -5956,7 +6074,7 @@ function NuCrtGlitch({
|
|
|
5956
6074
|
values: "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"
|
|
5957
6075
|
}
|
|
5958
6076
|
),
|
|
5959
|
-
/* @__PURE__ */
|
|
6077
|
+
/* @__PURE__ */ jsx42(
|
|
5960
6078
|
"feColorMatrix",
|
|
5961
6079
|
{
|
|
5962
6080
|
in: "warped",
|
|
@@ -5965,8 +6083,8 @@ function NuCrtGlitch({
|
|
|
5965
6083
|
values: "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0"
|
|
5966
6084
|
}
|
|
5967
6085
|
),
|
|
5968
|
-
/* @__PURE__ */
|
|
5969
|
-
/* @__PURE__ */
|
|
6086
|
+
/* @__PURE__ */ jsx42("feOffset", { dx: 0, dy: 0, in: "warped", ref: bOffsetRef, result: "bOff" }),
|
|
6087
|
+
/* @__PURE__ */ jsx42(
|
|
5970
6088
|
"feColorMatrix",
|
|
5971
6089
|
{
|
|
5972
6090
|
in: "bOff",
|
|
@@ -5975,8 +6093,8 @@ function NuCrtGlitch({
|
|
|
5975
6093
|
values: "0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0"
|
|
5976
6094
|
}
|
|
5977
6095
|
),
|
|
5978
|
-
/* @__PURE__ */
|
|
5979
|
-
/* @__PURE__ */
|
|
6096
|
+
/* @__PURE__ */ jsx42("feBlend", { in: "rOnly", in2: "gOnly", mode: "screen", result: "rg" }),
|
|
6097
|
+
/* @__PURE__ */ jsx42("feBlend", { in: "rg", in2: "bOnly", mode: "screen" })
|
|
5980
6098
|
]
|
|
5981
6099
|
}
|
|
5982
6100
|
) }) });
|
|
@@ -5989,8 +6107,8 @@ import {
|
|
|
5989
6107
|
useEffect as useEffect11,
|
|
5990
6108
|
useImperativeHandle as useImperativeHandle2,
|
|
5991
6109
|
useMemo as useMemo12,
|
|
5992
|
-
useRef as
|
|
5993
|
-
useState as
|
|
6110
|
+
useRef as useRef15,
|
|
6111
|
+
useState as useState19
|
|
5994
6112
|
} from "react";
|
|
5995
6113
|
|
|
5996
6114
|
// src/components/ListView/internals/helpers.ts
|
|
@@ -6028,14 +6146,14 @@ function renderListViewCellValue(row, column) {
|
|
|
6028
6146
|
import { memo as memo3 } from "react";
|
|
6029
6147
|
|
|
6030
6148
|
// src/components/ListView/internals/ListViewCheckControl.tsx
|
|
6031
|
-
import { jsx as
|
|
6149
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
6032
6150
|
function ListViewCheckControl({
|
|
6033
6151
|
isChecked,
|
|
6034
6152
|
onActivate,
|
|
6035
6153
|
onToggleCheck,
|
|
6036
6154
|
uncheckedShape
|
|
6037
6155
|
}) {
|
|
6038
|
-
return /* @__PURE__ */
|
|
6156
|
+
return /* @__PURE__ */ jsx43(
|
|
6039
6157
|
"button",
|
|
6040
6158
|
{
|
|
6041
6159
|
"aria-label": isChecked ? "Uncheck row" : "Check row",
|
|
@@ -6048,13 +6166,13 @@ function ListViewCheckControl({
|
|
|
6048
6166
|
onToggleCheck();
|
|
6049
6167
|
},
|
|
6050
6168
|
type: "button",
|
|
6051
|
-
children: /* @__PURE__ */
|
|
6169
|
+
children: /* @__PURE__ */ jsx43(
|
|
6052
6170
|
"span",
|
|
6053
6171
|
{
|
|
6054
6172
|
"aria-hidden": "true",
|
|
6055
6173
|
className: "nu-list-view__check-box",
|
|
6056
6174
|
"data-unchecked-shape": uncheckedShape,
|
|
6057
|
-
children: isChecked ? /* @__PURE__ */
|
|
6175
|
+
children: isChecked ? /* @__PURE__ */ jsx43(
|
|
6058
6176
|
NuGlyph,
|
|
6059
6177
|
{
|
|
6060
6178
|
className: "nu-list-view__check-indicator",
|
|
@@ -6068,7 +6186,7 @@ function ListViewCheckControl({
|
|
|
6068
6186
|
}
|
|
6069
6187
|
|
|
6070
6188
|
// src/components/ListView/internals/ListViewRow.tsx
|
|
6071
|
-
import { jsx as
|
|
6189
|
+
import { jsx as jsx44, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6072
6190
|
function ListViewRowInner({
|
|
6073
6191
|
columns,
|
|
6074
6192
|
isActive,
|
|
@@ -6099,7 +6217,7 @@ function ListViewRowInner({
|
|
|
6099
6217
|
function handleToggleCheck() {
|
|
6100
6218
|
onToggleCheck(rowId);
|
|
6101
6219
|
}
|
|
6102
|
-
return /* @__PURE__ */
|
|
6220
|
+
return /* @__PURE__ */ jsxs25(
|
|
6103
6221
|
"div",
|
|
6104
6222
|
{
|
|
6105
6223
|
"aria-disabled": row.disabled || void 0,
|
|
@@ -6120,7 +6238,7 @@ function ListViewRowInner({
|
|
|
6120
6238
|
"--nu-list-view-columns": templateColumns
|
|
6121
6239
|
},
|
|
6122
6240
|
children: [
|
|
6123
|
-
showCheckBox ? /* @__PURE__ */
|
|
6241
|
+
showCheckBox ? /* @__PURE__ */ jsx44("span", { className: "nu-list-view__check-cell", role: "gridcell", children: /* @__PURE__ */ jsx44(
|
|
6124
6242
|
ListViewCheckControl,
|
|
6125
6243
|
{
|
|
6126
6244
|
isChecked,
|
|
@@ -6129,7 +6247,7 @@ function ListViewRowInner({
|
|
|
6129
6247
|
uncheckedShape
|
|
6130
6248
|
}
|
|
6131
6249
|
) }) : null,
|
|
6132
|
-
columns.map((column) => /* @__PURE__ */
|
|
6250
|
+
columns.map((column) => /* @__PURE__ */ jsx44(
|
|
6133
6251
|
"span",
|
|
6134
6252
|
{
|
|
6135
6253
|
className: [
|
|
@@ -6149,7 +6267,7 @@ function ListViewRowInner({
|
|
|
6149
6267
|
var ListViewRow = memo3(ListViewRowInner);
|
|
6150
6268
|
|
|
6151
6269
|
// src/components/ListView/ListView.tsx
|
|
6152
|
-
import { jsx as
|
|
6270
|
+
import { jsx as jsx45, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
6153
6271
|
function ListViewInner({
|
|
6154
6272
|
activeRowId: activeRowIdProp,
|
|
6155
6273
|
checkedIds,
|
|
@@ -6167,14 +6285,14 @@ function ListViewInner({
|
|
|
6167
6285
|
uncheckedShape = "box",
|
|
6168
6286
|
...props
|
|
6169
6287
|
}, ref) {
|
|
6170
|
-
const rootRef =
|
|
6171
|
-
const rowRefs =
|
|
6288
|
+
const rootRef = useRef15(null);
|
|
6289
|
+
const rowRefs = useRef15({});
|
|
6172
6290
|
const selectableRows = useMemo12(
|
|
6173
6291
|
() => data.filter((row) => !row.disabled),
|
|
6174
6292
|
[data]
|
|
6175
6293
|
);
|
|
6176
6294
|
const isActiveControlled = activeRowIdProp !== void 0;
|
|
6177
|
-
const [uncontrolledActiveRowId, setUncontrolledActiveRowId] =
|
|
6295
|
+
const [uncontrolledActiveRowId, setUncontrolledActiveRowId] = useState19(
|
|
6178
6296
|
() => defaultActiveRowId ?? getInitialActiveRowId(selectableRows, selectedId)
|
|
6179
6297
|
);
|
|
6180
6298
|
const activeRowId = activeRowIdProp !== void 0 ? activeRowIdProp : uncontrolledActiveRowId;
|
|
@@ -6317,7 +6435,7 @@ function ListViewInner({
|
|
|
6317
6435
|
break;
|
|
6318
6436
|
}
|
|
6319
6437
|
}
|
|
6320
|
-
return /* @__PURE__ */
|
|
6438
|
+
return /* @__PURE__ */ jsxs26(
|
|
6321
6439
|
"div",
|
|
6322
6440
|
{
|
|
6323
6441
|
...props,
|
|
@@ -6328,7 +6446,7 @@ function ListViewInner({
|
|
|
6328
6446
|
role: "grid",
|
|
6329
6447
|
tabIndex: 0,
|
|
6330
6448
|
children: [
|
|
6331
|
-
/* @__PURE__ */
|
|
6449
|
+
/* @__PURE__ */ jsxs26(
|
|
6332
6450
|
"div",
|
|
6333
6451
|
{
|
|
6334
6452
|
className: "nu-list-view__header",
|
|
@@ -6337,8 +6455,8 @@ function ListViewInner({
|
|
|
6337
6455
|
"--nu-list-view-columns": templateColumns
|
|
6338
6456
|
},
|
|
6339
6457
|
children: [
|
|
6340
|
-
showCheckBox ? /* @__PURE__ */
|
|
6341
|
-
columns.map((column) => /* @__PURE__ */
|
|
6458
|
+
showCheckBox ? /* @__PURE__ */ jsx45("span", { className: "nu-list-view__header-cell", role: "columnheader" }) : null,
|
|
6459
|
+
columns.map((column) => /* @__PURE__ */ jsx45(
|
|
6342
6460
|
"span",
|
|
6343
6461
|
{
|
|
6344
6462
|
className: [
|
|
@@ -6354,7 +6472,7 @@ function ListViewInner({
|
|
|
6354
6472
|
]
|
|
6355
6473
|
}
|
|
6356
6474
|
),
|
|
6357
|
-
/* @__PURE__ */
|
|
6475
|
+
/* @__PURE__ */ jsx45("div", { className: "nu-list-view__body", children: data.length > 0 ? data.map((row) => /* @__PURE__ */ jsx45(
|
|
6358
6476
|
ListViewRow,
|
|
6359
6477
|
{
|
|
6360
6478
|
columns,
|
|
@@ -6371,7 +6489,7 @@ function ListViewInner({
|
|
|
6371
6489
|
uncheckedShape
|
|
6372
6490
|
},
|
|
6373
6491
|
row.id
|
|
6374
|
-
)) : /* @__PURE__ */
|
|
6492
|
+
)) : /* @__PURE__ */ jsx45("div", { className: "nu-list-view__empty", children: emptyText }) })
|
|
6375
6493
|
]
|
|
6376
6494
|
}
|
|
6377
6495
|
);
|
|
@@ -6383,8 +6501,8 @@ import {
|
|
|
6383
6501
|
useEffect as useEffect12,
|
|
6384
6502
|
useId as useId7,
|
|
6385
6503
|
useMemo as useMemo13,
|
|
6386
|
-
useRef as
|
|
6387
|
-
useState as
|
|
6504
|
+
useRef as useRef16,
|
|
6505
|
+
useState as useState20
|
|
6388
6506
|
} from "react";
|
|
6389
6507
|
|
|
6390
6508
|
// src/components/MaskedField/textMask.ts
|
|
@@ -6549,7 +6667,7 @@ function getMaskedFieldState(mask, rawValue) {
|
|
|
6549
6667
|
}
|
|
6550
6668
|
|
|
6551
6669
|
// src/components/MaskedField/MaskedField.tsx
|
|
6552
|
-
import { jsx as
|
|
6670
|
+
import { jsx as jsx46, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6553
6671
|
function MaskedField({
|
|
6554
6672
|
"aria-invalid": ariaInvalid,
|
|
6555
6673
|
className,
|
|
@@ -6572,8 +6690,8 @@ function MaskedField({
|
|
|
6572
6690
|
const fieldId = id ?? generatedId;
|
|
6573
6691
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
6574
6692
|
const isControlled = value !== void 0;
|
|
6575
|
-
const hasMountedRef =
|
|
6576
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
6693
|
+
const hasMountedRef = useRef16(false);
|
|
6694
|
+
const [uncontrolledValue, setUncontrolledValue] = useState20(
|
|
6577
6695
|
() => defaultValue == null ? "" : getMaskedFieldState(mask, String(defaultValue)).formattedValue
|
|
6578
6696
|
);
|
|
6579
6697
|
const rawResolvedValue = isControlled ? value == null ? "" : String(value) : uncontrolledValue;
|
|
@@ -6621,7 +6739,7 @@ function MaskedField({
|
|
|
6621
6739
|
}
|
|
6622
6740
|
onChange?.(event);
|
|
6623
6741
|
}
|
|
6624
|
-
return /* @__PURE__ */
|
|
6742
|
+
return /* @__PURE__ */ jsxs27(
|
|
6625
6743
|
"label",
|
|
6626
6744
|
{
|
|
6627
6745
|
className: cx(
|
|
@@ -6633,7 +6751,7 @@ function MaskedField({
|
|
|
6633
6751
|
htmlFor: fieldId,
|
|
6634
6752
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
6635
6753
|
children: [
|
|
6636
|
-
/* @__PURE__ */
|
|
6754
|
+
/* @__PURE__ */ jsx46(
|
|
6637
6755
|
"span",
|
|
6638
6756
|
{
|
|
6639
6757
|
className: cx("nu-masked-field__label", slotClassNames?.label),
|
|
@@ -6641,13 +6759,13 @@ function MaskedField({
|
|
|
6641
6759
|
children: renderMnemonicText(label)
|
|
6642
6760
|
}
|
|
6643
6761
|
),
|
|
6644
|
-
/* @__PURE__ */
|
|
6762
|
+
/* @__PURE__ */ jsxs27(
|
|
6645
6763
|
"span",
|
|
6646
6764
|
{
|
|
6647
6765
|
className: cx("nu-masked-field__slot", slotClassNames?.slot),
|
|
6648
6766
|
style: slotStyles?.slot,
|
|
6649
6767
|
children: [
|
|
6650
|
-
/* @__PURE__ */
|
|
6768
|
+
/* @__PURE__ */ jsx46(
|
|
6651
6769
|
"span",
|
|
6652
6770
|
{
|
|
6653
6771
|
"aria-hidden": "true",
|
|
@@ -6656,7 +6774,7 @@ function MaskedField({
|
|
|
6656
6774
|
children: "["
|
|
6657
6775
|
}
|
|
6658
6776
|
),
|
|
6659
|
-
/* @__PURE__ */
|
|
6777
|
+
/* @__PURE__ */ jsx46(
|
|
6660
6778
|
"span",
|
|
6661
6779
|
{
|
|
6662
6780
|
className: cx(
|
|
@@ -6664,7 +6782,7 @@ function MaskedField({
|
|
|
6664
6782
|
slotClassNames?.inputShell
|
|
6665
6783
|
),
|
|
6666
6784
|
style: slotStyles?.inputShell,
|
|
6667
|
-
children: /* @__PURE__ */
|
|
6785
|
+
children: /* @__PURE__ */ jsx46(
|
|
6668
6786
|
"input",
|
|
6669
6787
|
{
|
|
6670
6788
|
...props,
|
|
@@ -6682,7 +6800,7 @@ function MaskedField({
|
|
|
6682
6800
|
)
|
|
6683
6801
|
}
|
|
6684
6802
|
),
|
|
6685
|
-
/* @__PURE__ */
|
|
6803
|
+
/* @__PURE__ */ jsx46(
|
|
6686
6804
|
"span",
|
|
6687
6805
|
{
|
|
6688
6806
|
"aria-hidden": "true",
|
|
@@ -6694,7 +6812,7 @@ function MaskedField({
|
|
|
6694
6812
|
]
|
|
6695
6813
|
}
|
|
6696
6814
|
),
|
|
6697
|
-
hint ? /* @__PURE__ */
|
|
6815
|
+
hint ? /* @__PURE__ */ jsx46(
|
|
6698
6816
|
"span",
|
|
6699
6817
|
{
|
|
6700
6818
|
className: cx("nu-masked-field__hint", slotClassNames?.hint),
|
|
@@ -6710,9 +6828,9 @@ function MaskedField({
|
|
|
6710
6828
|
|
|
6711
6829
|
// src/components/Memo/Memo.tsx
|
|
6712
6830
|
import {
|
|
6713
|
-
useState as
|
|
6831
|
+
useState as useState21
|
|
6714
6832
|
} from "react";
|
|
6715
|
-
import { jsx as
|
|
6833
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
6716
6834
|
function Memo({
|
|
6717
6835
|
background,
|
|
6718
6836
|
className,
|
|
@@ -6732,7 +6850,7 @@ function Memo({
|
|
|
6732
6850
|
const isControlled = value !== void 0;
|
|
6733
6851
|
const resolvedInitialValue = defaultValue == null ? content ?? "" : String(defaultValue);
|
|
6734
6852
|
const resolvedValue = value == null ? "" : Array.isArray(value) ? value.join("\n") : String(value);
|
|
6735
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
6853
|
+
const [uncontrolledValue, setUncontrolledValue] = useState21(
|
|
6736
6854
|
() => resolvedInitialValue
|
|
6737
6855
|
);
|
|
6738
6856
|
function handleChange(event) {
|
|
@@ -6742,7 +6860,7 @@ function Memo({
|
|
|
6742
6860
|
onValueChange?.(event.target.value);
|
|
6743
6861
|
onChange?.(event);
|
|
6744
6862
|
}
|
|
6745
|
-
return /* @__PURE__ */
|
|
6863
|
+
return /* @__PURE__ */ jsx47(
|
|
6746
6864
|
"div",
|
|
6747
6865
|
{
|
|
6748
6866
|
className: ["nu-memo", className].filter(Boolean).join(" "),
|
|
@@ -6755,7 +6873,7 @@ function Memo({
|
|
|
6755
6873
|
"--nu-memo-focus-text": focusTextColor,
|
|
6756
6874
|
"--nu-memo-text": textColor
|
|
6757
6875
|
},
|
|
6758
|
-
children: /* @__PURE__ */
|
|
6876
|
+
children: /* @__PURE__ */ jsx47("div", { className: "nu-memo__viewport", children: /* @__PURE__ */ jsx47(
|
|
6759
6877
|
"textarea",
|
|
6760
6878
|
{
|
|
6761
6879
|
...props,
|
|
@@ -6772,10 +6890,10 @@ function Memo({
|
|
|
6772
6890
|
import {
|
|
6773
6891
|
useId as useId8,
|
|
6774
6892
|
useMemo as useMemo14,
|
|
6775
|
-
useRef as
|
|
6776
|
-
useState as
|
|
6893
|
+
useRef as useRef17,
|
|
6894
|
+
useState as useState22
|
|
6777
6895
|
} from "react";
|
|
6778
|
-
import { jsx as
|
|
6896
|
+
import { jsx as jsx48, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
6779
6897
|
function PageControl({
|
|
6780
6898
|
activePageId: activePageIdProp,
|
|
6781
6899
|
className,
|
|
@@ -6789,8 +6907,8 @@ function PageControl({
|
|
|
6789
6907
|
}) {
|
|
6790
6908
|
const generatedId = useId8();
|
|
6791
6909
|
const isControlled = activePageIdProp !== void 0;
|
|
6792
|
-
const tabRefs =
|
|
6793
|
-
const [uncontrolledActivePageId, setUncontrolledActivePageId] =
|
|
6910
|
+
const tabRefs = useRef17({});
|
|
6911
|
+
const [uncontrolledActivePageId, setUncontrolledActivePageId] = useState22(
|
|
6794
6912
|
() => defaultActivePageId ?? pages.find((page) => !page.disabled)?.id ?? pages[0]?.id
|
|
6795
6913
|
);
|
|
6796
6914
|
const activePageId = isControlled ? activePageIdProp : uncontrolledActivePageId;
|
|
@@ -6860,7 +6978,7 @@ function PageControl({
|
|
|
6860
6978
|
break;
|
|
6861
6979
|
}
|
|
6862
6980
|
}
|
|
6863
|
-
return /* @__PURE__ */
|
|
6981
|
+
return /* @__PURE__ */ jsxs28(
|
|
6864
6982
|
"div",
|
|
6865
6983
|
{
|
|
6866
6984
|
...props,
|
|
@@ -6871,7 +6989,7 @@ function PageControl({
|
|
|
6871
6989
|
slotStyles?.root
|
|
6872
6990
|
),
|
|
6873
6991
|
children: [
|
|
6874
|
-
/* @__PURE__ */
|
|
6992
|
+
/* @__PURE__ */ jsx48(
|
|
6875
6993
|
"div",
|
|
6876
6994
|
{
|
|
6877
6995
|
className: cx("nu-page-control__tabs", slotClassNames?.tabs),
|
|
@@ -6882,7 +7000,7 @@ function PageControl({
|
|
|
6882
7000
|
const isActive = page.id === resolvedActivePage?.id;
|
|
6883
7001
|
const panelId = `${generatedId}-panel-${page.id}`;
|
|
6884
7002
|
const tabId = `${generatedId}-tab-${page.id}`;
|
|
6885
|
-
return /* @__PURE__ */
|
|
7003
|
+
return /* @__PURE__ */ jsx48(
|
|
6886
7004
|
"button",
|
|
6887
7005
|
{
|
|
6888
7006
|
"aria-controls": panelId,
|
|
@@ -6906,7 +7024,7 @@ function PageControl({
|
|
|
6906
7024
|
})
|
|
6907
7025
|
}
|
|
6908
7026
|
),
|
|
6909
|
-
/* @__PURE__ */
|
|
7027
|
+
/* @__PURE__ */ jsx48(
|
|
6910
7028
|
"div",
|
|
6911
7029
|
{
|
|
6912
7030
|
"aria-labelledby": resolvedActivePage ? `${generatedId}-tab-${resolvedActivePage.id}` : void 0,
|
|
@@ -6923,7 +7041,7 @@ function PageControl({
|
|
|
6923
7041
|
}
|
|
6924
7042
|
|
|
6925
7043
|
// src/components/Panel/Panel.tsx
|
|
6926
|
-
import { jsx as
|
|
7044
|
+
import { jsx as jsx49, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6927
7045
|
function Panel({
|
|
6928
7046
|
children,
|
|
6929
7047
|
className,
|
|
@@ -6934,14 +7052,14 @@ function Panel({
|
|
|
6934
7052
|
title,
|
|
6935
7053
|
...props
|
|
6936
7054
|
}) {
|
|
6937
|
-
return /* @__PURE__ */
|
|
7055
|
+
return /* @__PURE__ */ jsxs29(
|
|
6938
7056
|
"section",
|
|
6939
7057
|
{
|
|
6940
7058
|
...props,
|
|
6941
7059
|
className: cx("nu-panel", slotClassNames?.root, className),
|
|
6942
7060
|
style: mergeSlotStyle(props.style, slotStyles?.root),
|
|
6943
7061
|
children: [
|
|
6944
|
-
title ? /* @__PURE__ */
|
|
7062
|
+
title ? /* @__PURE__ */ jsx49(
|
|
6945
7063
|
"header",
|
|
6946
7064
|
{
|
|
6947
7065
|
className: cx("nu-panel__header", slotClassNames?.header),
|
|
@@ -6949,7 +7067,7 @@ function Panel({
|
|
|
6949
7067
|
children: renderMnemonicText(title)
|
|
6950
7068
|
}
|
|
6951
7069
|
) : null,
|
|
6952
|
-
/* @__PURE__ */
|
|
7070
|
+
/* @__PURE__ */ jsx49(
|
|
6953
7071
|
"div",
|
|
6954
7072
|
{
|
|
6955
7073
|
className: cx(
|
|
@@ -6961,7 +7079,7 @@ function Panel({
|
|
|
6961
7079
|
children
|
|
6962
7080
|
}
|
|
6963
7081
|
),
|
|
6964
|
-
footer ? /* @__PURE__ */
|
|
7082
|
+
footer ? /* @__PURE__ */ jsx49(
|
|
6965
7083
|
"footer",
|
|
6966
7084
|
{
|
|
6967
7085
|
className: cx("nu-panel__footer", slotClassNames?.footer),
|
|
@@ -6978,10 +7096,10 @@ function Panel({
|
|
|
6978
7096
|
import {
|
|
6979
7097
|
useId as useId9,
|
|
6980
7098
|
useMemo as useMemo15,
|
|
6981
|
-
useRef as
|
|
6982
|
-
useState as
|
|
7099
|
+
useRef as useRef18,
|
|
7100
|
+
useState as useState23
|
|
6983
7101
|
} from "react";
|
|
6984
|
-
import { jsx as
|
|
7102
|
+
import { jsx as jsx50, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6985
7103
|
function collectGroupIds(entries) {
|
|
6986
7104
|
const groupIds = /* @__PURE__ */ new Set();
|
|
6987
7105
|
function visit(nextEntries) {
|
|
@@ -7089,11 +7207,11 @@ function PropertyGrid({
|
|
|
7089
7207
|
...props
|
|
7090
7208
|
}) {
|
|
7091
7209
|
const editorIdPrefix = useId9();
|
|
7092
|
-
const rowButtonRefs =
|
|
7210
|
+
const rowButtonRefs = useRef18({});
|
|
7093
7211
|
const groupIds = useMemo15(() => collectGroupIds(entries), [entries]);
|
|
7094
7212
|
const isExpandedControlled = expandedIdsProp !== void 0;
|
|
7095
7213
|
const isActiveControlled = activeIdProp !== void 0;
|
|
7096
|
-
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] =
|
|
7214
|
+
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = useState23(() => getInitialExpandedIds(entries, defaultExpandedIds));
|
|
7097
7215
|
const resolvedExpandedIds = expandedIdsProp ?? uncontrolledExpandedIds;
|
|
7098
7216
|
const expandedIdSet = useMemo15(
|
|
7099
7217
|
() => new Set(
|
|
@@ -7106,7 +7224,7 @@ function PropertyGrid({
|
|
|
7106
7224
|
[entries, expandedIdSet]
|
|
7107
7225
|
);
|
|
7108
7226
|
const interactiveRows = useMemo15(() => collectInteractiveRows(rows), [rows]);
|
|
7109
|
-
const [uncontrolledActiveId, setUncontrolledActiveId] =
|
|
7227
|
+
const [uncontrolledActiveId, setUncontrolledActiveId] = useState23(() => getInitialActiveId2(interactiveRows, defaultActiveId));
|
|
7110
7228
|
const requestedActiveId = isActiveControlled ? activeIdProp : uncontrolledActiveId;
|
|
7111
7229
|
const resolvedActiveId = requestedActiveId && interactiveRows.some((row) => row.id === requestedActiveId) ? requestedActiveId : interactiveRows[0]?.id;
|
|
7112
7230
|
function updateExpandedIds(nextExpandedIds) {
|
|
@@ -7225,7 +7343,7 @@ function PropertyGrid({
|
|
|
7225
7343
|
const nextExpandedIds = expandedIdSet.has(entry.id) ? resolvedExpandedIds.filter((expandedId) => expandedId !== entry.id) : [...resolvedExpandedIds, entry.id];
|
|
7226
7344
|
updateExpandedIds(nextExpandedIds);
|
|
7227
7345
|
}
|
|
7228
|
-
return /* @__PURE__ */
|
|
7346
|
+
return /* @__PURE__ */ jsx50(
|
|
7229
7347
|
"div",
|
|
7230
7348
|
{
|
|
7231
7349
|
...props,
|
|
@@ -7236,13 +7354,13 @@ function PropertyGrid({
|
|
|
7236
7354
|
...style,
|
|
7237
7355
|
"--nu-property-grid-label-width": labelWidth
|
|
7238
7356
|
},
|
|
7239
|
-
children: /* @__PURE__ */
|
|
7357
|
+
children: /* @__PURE__ */ jsx50("div", { className: "nu-property-grid__body", children: rows.map((row) => {
|
|
7240
7358
|
if (row.type === "section") {
|
|
7241
|
-
return /* @__PURE__ */
|
|
7359
|
+
return /* @__PURE__ */ jsx50("div", { className: "nu-property-grid__section", children: renderMnemonicText(row.entry.title) }, row.entry.id);
|
|
7242
7360
|
}
|
|
7243
7361
|
if (row.type === "group") {
|
|
7244
7362
|
const isExpanded = expandedIdSet.has(row.entry.id);
|
|
7245
|
-
return /* @__PURE__ */
|
|
7363
|
+
return /* @__PURE__ */ jsxs30(
|
|
7246
7364
|
"div",
|
|
7247
7365
|
{
|
|
7248
7366
|
className: "nu-property-grid__row",
|
|
@@ -7251,7 +7369,7 @@ function PropertyGrid({
|
|
|
7251
7369
|
"data-expanded": isExpanded || void 0,
|
|
7252
7370
|
"data-group": true,
|
|
7253
7371
|
children: [
|
|
7254
|
-
/* @__PURE__ */
|
|
7372
|
+
/* @__PURE__ */ jsx50(
|
|
7255
7373
|
"button",
|
|
7256
7374
|
{
|
|
7257
7375
|
className: "nu-property-grid__label nu-property-grid__label-button",
|
|
@@ -7271,32 +7389,32 @@ function PropertyGrid({
|
|
|
7271
7389
|
"--nu-property-grid-depth": row.depth
|
|
7272
7390
|
},
|
|
7273
7391
|
type: "button",
|
|
7274
|
-
children: /* @__PURE__ */
|
|
7275
|
-
/* @__PURE__ */
|
|
7392
|
+
children: /* @__PURE__ */ jsxs30("span", { className: "nu-property-grid__lead", children: [
|
|
7393
|
+
/* @__PURE__ */ jsx50("span", { className: "nu-property-grid__expander", children: /* @__PURE__ */ jsx50(
|
|
7276
7394
|
NuGlyph,
|
|
7277
7395
|
{
|
|
7278
7396
|
name: isExpanded ? "tree-caret-down" : "tree-caret-right"
|
|
7279
7397
|
}
|
|
7280
7398
|
) }),
|
|
7281
|
-
/* @__PURE__ */
|
|
7399
|
+
/* @__PURE__ */ jsx50("span", { className: "nu-property-grid__label-text", children: renderMnemonicText(row.entry.label) })
|
|
7282
7400
|
] })
|
|
7283
7401
|
}
|
|
7284
7402
|
),
|
|
7285
|
-
/* @__PURE__ */
|
|
7403
|
+
/* @__PURE__ */ jsx50("div", { className: "nu-property-grid__editor", children: row.entry.summary ? /* @__PURE__ */ jsx50("div", { className: "nu-property-grid__control", children: row.entry.summary }) : null })
|
|
7286
7404
|
]
|
|
7287
7405
|
},
|
|
7288
7406
|
row.entry.id
|
|
7289
7407
|
);
|
|
7290
7408
|
}
|
|
7291
7409
|
const editorId = `${editorIdPrefix}-editor-${row.entry.id}`;
|
|
7292
|
-
return /* @__PURE__ */
|
|
7410
|
+
return /* @__PURE__ */ jsxs30(
|
|
7293
7411
|
"div",
|
|
7294
7412
|
{
|
|
7295
7413
|
className: "nu-property-grid__row",
|
|
7296
7414
|
"data-active": resolvedActiveId === row.entry.id || void 0,
|
|
7297
7415
|
"data-disabled": row.entry.disabled || void 0,
|
|
7298
7416
|
children: [
|
|
7299
|
-
/* @__PURE__ */
|
|
7417
|
+
/* @__PURE__ */ jsx50(
|
|
7300
7418
|
"button",
|
|
7301
7419
|
{
|
|
7302
7420
|
className: "nu-property-grid__label nu-property-grid__label-button",
|
|
@@ -7316,21 +7434,21 @@ function PropertyGrid({
|
|
|
7316
7434
|
"--nu-property-grid-depth": row.depth
|
|
7317
7435
|
},
|
|
7318
7436
|
type: "button",
|
|
7319
|
-
children: /* @__PURE__ */
|
|
7320
|
-
/* @__PURE__ */
|
|
7321
|
-
/* @__PURE__ */
|
|
7437
|
+
children: /* @__PURE__ */ jsxs30("span", { className: "nu-property-grid__lead", children: [
|
|
7438
|
+
/* @__PURE__ */ jsx50("span", { className: "nu-property-grid__expander-placeholder" }),
|
|
7439
|
+
/* @__PURE__ */ jsx50("span", { className: "nu-property-grid__label-text", children: renderMnemonicText(row.entry.label) })
|
|
7322
7440
|
] })
|
|
7323
7441
|
}
|
|
7324
7442
|
),
|
|
7325
|
-
/* @__PURE__ */
|
|
7443
|
+
/* @__PURE__ */ jsxs30(
|
|
7326
7444
|
"div",
|
|
7327
7445
|
{
|
|
7328
7446
|
className: "nu-property-grid__editor",
|
|
7329
7447
|
id: editorId,
|
|
7330
7448
|
onFocusCapture: () => updateActiveId(row.entry.id),
|
|
7331
7449
|
children: [
|
|
7332
|
-
/* @__PURE__ */
|
|
7333
|
-
row.entry.hint ? /* @__PURE__ */
|
|
7450
|
+
/* @__PURE__ */ jsx50("div", { className: "nu-property-grid__control", children: row.entry.content }),
|
|
7451
|
+
row.entry.hint ? /* @__PURE__ */ jsx50("div", { className: "nu-property-grid__hint", children: row.entry.hint }) : null
|
|
7334
7452
|
]
|
|
7335
7453
|
}
|
|
7336
7454
|
)
|
|
@@ -7344,7 +7462,7 @@ function PropertyGrid({
|
|
|
7344
7462
|
}
|
|
7345
7463
|
|
|
7346
7464
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
7347
|
-
import { jsx as
|
|
7465
|
+
import { jsx as jsx51, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
7348
7466
|
function clamp3(value, min, max) {
|
|
7349
7467
|
return Math.min(max, Math.max(min, value));
|
|
7350
7468
|
}
|
|
@@ -7368,7 +7486,7 @@ function ProgressBar({
|
|
|
7368
7486
|
const clampedValue = clamp3(value, min, safeMax);
|
|
7369
7487
|
const percent = Math.round((clampedValue - min) / (safeMax - min) * 100);
|
|
7370
7488
|
const renderedValue = valueRenderer ? valueRenderer(percent, clampedValue, min, safeMax) : `${percent}%`;
|
|
7371
|
-
return /* @__PURE__ */
|
|
7489
|
+
return /* @__PURE__ */ jsxs31(
|
|
7372
7490
|
"div",
|
|
7373
7491
|
{
|
|
7374
7492
|
...props,
|
|
@@ -7380,7 +7498,7 @@ function ProgressBar({
|
|
|
7380
7498
|
role: "progressbar",
|
|
7381
7499
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
7382
7500
|
children: [
|
|
7383
|
-
label ? /* @__PURE__ */
|
|
7501
|
+
label ? /* @__PURE__ */ jsx51(
|
|
7384
7502
|
"span",
|
|
7385
7503
|
{
|
|
7386
7504
|
className: cx("nu-progress-bar__label", slotClassNames?.label),
|
|
@@ -7388,7 +7506,7 @@ function ProgressBar({
|
|
|
7388
7506
|
children: renderMnemonicText(label)
|
|
7389
7507
|
}
|
|
7390
7508
|
) : null,
|
|
7391
|
-
/* @__PURE__ */
|
|
7509
|
+
/* @__PURE__ */ jsxs31(
|
|
7392
7510
|
"div",
|
|
7393
7511
|
{
|
|
7394
7512
|
className: cx("nu-progress-bar__track", slotClassNames?.track),
|
|
@@ -7399,7 +7517,7 @@ function ProgressBar({
|
|
|
7399
7517
|
slotStyles?.track
|
|
7400
7518
|
),
|
|
7401
7519
|
children: [
|
|
7402
|
-
/* @__PURE__ */
|
|
7520
|
+
/* @__PURE__ */ jsx51(
|
|
7403
7521
|
"div",
|
|
7404
7522
|
{
|
|
7405
7523
|
className: cx("nu-progress-bar__fill", slotClassNames?.fill),
|
|
@@ -7412,7 +7530,7 @@ function ProgressBar({
|
|
|
7412
7530
|
)
|
|
7413
7531
|
}
|
|
7414
7532
|
),
|
|
7415
|
-
showValue ? /* @__PURE__ */
|
|
7533
|
+
showValue ? /* @__PURE__ */ jsx51(
|
|
7416
7534
|
"span",
|
|
7417
7535
|
{
|
|
7418
7536
|
className: cx("nu-progress-bar__value", slotClassNames?.value),
|
|
@@ -7423,7 +7541,7 @@ function ProgressBar({
|
|
|
7423
7541
|
]
|
|
7424
7542
|
}
|
|
7425
7543
|
),
|
|
7426
|
-
hint ? /* @__PURE__ */
|
|
7544
|
+
hint ? /* @__PURE__ */ jsx51(
|
|
7427
7545
|
"span",
|
|
7428
7546
|
{
|
|
7429
7547
|
className: cx("nu-progress-bar__hint", slotClassNames?.hint),
|
|
@@ -7437,8 +7555,8 @@ function ProgressBar({
|
|
|
7437
7555
|
}
|
|
7438
7556
|
|
|
7439
7557
|
// src/components/RadioGroup/RadioButton.tsx
|
|
7440
|
-
import { useId as useId10, useState as
|
|
7441
|
-
import { jsx as
|
|
7558
|
+
import { useId as useId10, useState as useState24 } from "react";
|
|
7559
|
+
import { jsx as jsx52, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
7442
7560
|
function RadioButton({
|
|
7443
7561
|
checked,
|
|
7444
7562
|
className,
|
|
@@ -7454,7 +7572,7 @@ function RadioButton({
|
|
|
7454
7572
|
const inputId = id ?? generatedId;
|
|
7455
7573
|
const hintId = hint ? `${inputId}-hint` : void 0;
|
|
7456
7574
|
const isControlled = checked !== void 0;
|
|
7457
|
-
const [uncontrolledChecked, setUncontrolledChecked] =
|
|
7575
|
+
const [uncontrolledChecked, setUncontrolledChecked] = useState24(defaultChecked);
|
|
7458
7576
|
const resolvedChecked = isControlled ? checked : uncontrolledChecked;
|
|
7459
7577
|
function handleChange(event) {
|
|
7460
7578
|
if (!isControlled) {
|
|
@@ -7462,9 +7580,9 @@ function RadioButton({
|
|
|
7462
7580
|
}
|
|
7463
7581
|
onCheckedChange?.(event.target.checked, event);
|
|
7464
7582
|
}
|
|
7465
|
-
return /* @__PURE__ */
|
|
7466
|
-
/* @__PURE__ */
|
|
7467
|
-
/* @__PURE__ */
|
|
7583
|
+
return /* @__PURE__ */ jsxs32("label", { className: ["nu-radio-button", className].filter(Boolean).join(" "), children: [
|
|
7584
|
+
/* @__PURE__ */ jsxs32("span", { className: "nu-radio-button__main", children: [
|
|
7585
|
+
/* @__PURE__ */ jsx52(
|
|
7468
7586
|
"input",
|
|
7469
7587
|
{
|
|
7470
7588
|
...props,
|
|
@@ -7477,19 +7595,19 @@ function RadioButton({
|
|
|
7477
7595
|
type: "radio"
|
|
7478
7596
|
}
|
|
7479
7597
|
),
|
|
7480
|
-
/* @__PURE__ */
|
|
7481
|
-
/* @__PURE__ */
|
|
7482
|
-
resolvedChecked ? /* @__PURE__ */
|
|
7598
|
+
/* @__PURE__ */ jsx52("span", { "aria-hidden": "true", className: "nu-radio-button__control", children: /* @__PURE__ */ jsxs32("span", { className: "nu-radio-button__disc", children: [
|
|
7599
|
+
/* @__PURE__ */ jsx52(NuGlyph, { className: "nu-radio-button__ring", name: "radio-ring" }),
|
|
7600
|
+
resolvedChecked ? /* @__PURE__ */ jsx52(NuGlyph, { className: "nu-radio-button__fill", name: "radio-fill" }) : null
|
|
7483
7601
|
] }) }),
|
|
7484
|
-
/* @__PURE__ */
|
|
7602
|
+
/* @__PURE__ */ jsx52("span", { className: "nu-radio-button__label", children: renderMnemonicText(label) })
|
|
7485
7603
|
] }),
|
|
7486
|
-
hint ? /* @__PURE__ */
|
|
7604
|
+
hint ? /* @__PURE__ */ jsx52("span", { className: "nu-radio-button__hint", id: hintId, children: hint }) : null
|
|
7487
7605
|
] });
|
|
7488
7606
|
}
|
|
7489
7607
|
|
|
7490
7608
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
7491
|
-
import { useId as useId11, useState as
|
|
7492
|
-
import { jsx as
|
|
7609
|
+
import { useId as useId11, useState as useState25 } from "react";
|
|
7610
|
+
import { jsx as jsx53, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
7493
7611
|
function RadioGroup({
|
|
7494
7612
|
className,
|
|
7495
7613
|
defaultValue,
|
|
@@ -7508,7 +7626,7 @@ function RadioGroup({
|
|
|
7508
7626
|
const groupName = name ?? generatedId;
|
|
7509
7627
|
const hintId = hint ? `${groupName}-hint` : void 0;
|
|
7510
7628
|
const isControlled = value !== void 0;
|
|
7511
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
7629
|
+
const [uncontrolledValue, setUncontrolledValue] = useState25(defaultValue ?? options[0]?.value);
|
|
7512
7630
|
const resolvedValue = isControlled ? value : uncontrolledValue;
|
|
7513
7631
|
function commitValue(nextValue) {
|
|
7514
7632
|
if (!isControlled) {
|
|
@@ -7516,7 +7634,7 @@ function RadioGroup({
|
|
|
7516
7634
|
}
|
|
7517
7635
|
onValueChange?.(nextValue);
|
|
7518
7636
|
}
|
|
7519
|
-
return /* @__PURE__ */
|
|
7637
|
+
return /* @__PURE__ */ jsxs33(
|
|
7520
7638
|
"fieldset",
|
|
7521
7639
|
{
|
|
7522
7640
|
...props,
|
|
@@ -7524,7 +7642,7 @@ function RadioGroup({
|
|
|
7524
7642
|
className: cx("nu-radio-group", slotClassNames?.root, className),
|
|
7525
7643
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
7526
7644
|
children: [
|
|
7527
|
-
label ? /* @__PURE__ */
|
|
7645
|
+
label ? /* @__PURE__ */ jsx53(
|
|
7528
7646
|
"legend",
|
|
7529
7647
|
{
|
|
7530
7648
|
className: cx("nu-radio-group__label", slotClassNames?.label),
|
|
@@ -7532,12 +7650,12 @@ function RadioGroup({
|
|
|
7532
7650
|
children: renderMnemonicText(label)
|
|
7533
7651
|
}
|
|
7534
7652
|
) : null,
|
|
7535
|
-
/* @__PURE__ */
|
|
7653
|
+
/* @__PURE__ */ jsx53(
|
|
7536
7654
|
"div",
|
|
7537
7655
|
{
|
|
7538
7656
|
className: cx("nu-radio-group__options", slotClassNames?.options),
|
|
7539
7657
|
style: slotStyles?.options,
|
|
7540
|
-
children: options.map((option) => /* @__PURE__ */
|
|
7658
|
+
children: options.map((option) => /* @__PURE__ */ jsx53(
|
|
7541
7659
|
RadioButton,
|
|
7542
7660
|
{
|
|
7543
7661
|
checked: resolvedValue === option.value,
|
|
@@ -7556,7 +7674,7 @@ function RadioGroup({
|
|
|
7556
7674
|
))
|
|
7557
7675
|
}
|
|
7558
7676
|
),
|
|
7559
|
-
hint ? /* @__PURE__ */
|
|
7677
|
+
hint ? /* @__PURE__ */ jsx53(
|
|
7560
7678
|
"span",
|
|
7561
7679
|
{
|
|
7562
7680
|
className: cx("nu-radio-group__hint", slotClassNames?.hint),
|
|
@@ -7571,14 +7689,14 @@ function RadioGroup({
|
|
|
7571
7689
|
}
|
|
7572
7690
|
|
|
7573
7691
|
// src/components/ReportCell/ReportCell.tsx
|
|
7574
|
-
import { jsx as
|
|
7692
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
7575
7693
|
function ReportCell({
|
|
7576
7694
|
align = "start",
|
|
7577
7695
|
className,
|
|
7578
7696
|
tone = "default",
|
|
7579
7697
|
...props
|
|
7580
7698
|
}) {
|
|
7581
|
-
return /* @__PURE__ */
|
|
7699
|
+
return /* @__PURE__ */ jsx54(
|
|
7582
7700
|
"span",
|
|
7583
7701
|
{
|
|
7584
7702
|
...props,
|
|
@@ -7597,11 +7715,11 @@ import {
|
|
|
7597
7715
|
useEffect as useEffect13,
|
|
7598
7716
|
useId as useId12,
|
|
7599
7717
|
useMemo as useMemo16,
|
|
7600
|
-
useRef as
|
|
7601
|
-
useState as
|
|
7718
|
+
useRef as useRef19,
|
|
7719
|
+
useState as useState26
|
|
7602
7720
|
} from "react";
|
|
7603
7721
|
import { createPortal as createPortal4 } from "react-dom";
|
|
7604
|
-
import { jsx as
|
|
7722
|
+
import { jsx as jsx55, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
7605
7723
|
function resolveSearchBoxPortalRoot() {
|
|
7606
7724
|
return document.body;
|
|
7607
7725
|
}
|
|
@@ -7629,21 +7747,21 @@ function SearchBox({
|
|
|
7629
7747
|
style,
|
|
7630
7748
|
...props
|
|
7631
7749
|
}) {
|
|
7632
|
-
const rootRef =
|
|
7633
|
-
const fieldRef =
|
|
7634
|
-
const inputRef =
|
|
7635
|
-
const popupRef =
|
|
7636
|
-
const requestIdRef =
|
|
7750
|
+
const rootRef = useRef19(null);
|
|
7751
|
+
const fieldRef = useRef19(null);
|
|
7752
|
+
const inputRef = useRef19(null);
|
|
7753
|
+
const popupRef = useRef19(null);
|
|
7754
|
+
const requestIdRef = useRef19(0);
|
|
7637
7755
|
const generatedId = useId12();
|
|
7638
7756
|
const fieldId = `${generatedId}-search-box`;
|
|
7639
7757
|
const labelId = `${fieldId}-label`;
|
|
7640
7758
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
7641
7759
|
const isQueryControlled = queryProp !== void 0;
|
|
7642
|
-
const [uncontrolledQuery, setUncontrolledQuery] =
|
|
7643
|
-
const [open, setOpen] =
|
|
7644
|
-
const [status, setStatus] =
|
|
7645
|
-
const [results, setResults] =
|
|
7646
|
-
const [selectedValue, setSelectedValue] =
|
|
7760
|
+
const [uncontrolledQuery, setUncontrolledQuery] = useState26(defaultQuery);
|
|
7761
|
+
const [open, setOpen] = useState26(false);
|
|
7762
|
+
const [status, setStatus] = useState26("idle");
|
|
7763
|
+
const [results, setResults] = useState26([]);
|
|
7764
|
+
const [selectedValue, setSelectedValue] = useState26(null);
|
|
7647
7765
|
const normalizedQuery = (isQueryControlled ? queryProp : uncontrolledQuery) ?? "";
|
|
7648
7766
|
const trimmedQuery = normalizedQuery.trim();
|
|
7649
7767
|
const resultOptions = useMemo16(() => {
|
|
@@ -7670,7 +7788,7 @@ function SearchBox({
|
|
|
7670
7788
|
[resultOptions]
|
|
7671
7789
|
);
|
|
7672
7790
|
const popupRoot = typeof document === "undefined" ? null : resolveSearchBoxPortalRoot();
|
|
7673
|
-
const [themePortalStyle, setThemePortalStyle] =
|
|
7791
|
+
const [themePortalStyle, setThemePortalStyle] = useState26(() => void 0);
|
|
7674
7792
|
useEffect13(() => {
|
|
7675
7793
|
if (disabled) {
|
|
7676
7794
|
return;
|
|
@@ -7751,15 +7869,15 @@ function SearchBox({
|
|
|
7751
7869
|
}
|
|
7752
7870
|
function renderPopupContent() {
|
|
7753
7871
|
if (status === "loading") {
|
|
7754
|
-
return /* @__PURE__ */
|
|
7872
|
+
return /* @__PURE__ */ jsx55("div", { className: "nu-search-box__status", children: loadingText });
|
|
7755
7873
|
}
|
|
7756
7874
|
if (status === "error") {
|
|
7757
|
-
return /* @__PURE__ */
|
|
7875
|
+
return /* @__PURE__ */ jsx55("div", { className: "nu-search-box__status", children: errorText });
|
|
7758
7876
|
}
|
|
7759
7877
|
if (trimmedQuery.length < minQueryLength) {
|
|
7760
|
-
return /* @__PURE__ */
|
|
7878
|
+
return /* @__PURE__ */ jsx55("div", { className: "nu-search-box__status", children: idleText });
|
|
7761
7879
|
}
|
|
7762
|
-
return /* @__PURE__ */
|
|
7880
|
+
return /* @__PURE__ */ jsx55("div", { className: "nu-search-box__listbox", children: /* @__PURE__ */ jsx55(
|
|
7763
7881
|
ListBox,
|
|
7764
7882
|
{
|
|
7765
7883
|
data: listBoxData,
|
|
@@ -7796,7 +7914,7 @@ function SearchBox({
|
|
|
7796
7914
|
break;
|
|
7797
7915
|
}
|
|
7798
7916
|
}
|
|
7799
|
-
return /* @__PURE__ */
|
|
7917
|
+
return /* @__PURE__ */ jsxs34(
|
|
7800
7918
|
"div",
|
|
7801
7919
|
{
|
|
7802
7920
|
...props,
|
|
@@ -7804,10 +7922,10 @@ function SearchBox({
|
|
|
7804
7922
|
ref: rootRef,
|
|
7805
7923
|
style,
|
|
7806
7924
|
children: [
|
|
7807
|
-
/* @__PURE__ */
|
|
7808
|
-
/* @__PURE__ */
|
|
7809
|
-
/* @__PURE__ */
|
|
7810
|
-
/* @__PURE__ */
|
|
7925
|
+
/* @__PURE__ */ jsx55("label", { className: "nu-search-box__label", htmlFor: fieldId, id: labelId, children: renderMnemonicText(label) }),
|
|
7926
|
+
/* @__PURE__ */ jsxs34("span", { className: "nu-search-box__slot", ref: fieldRef, children: [
|
|
7927
|
+
/* @__PURE__ */ jsx55("span", { "aria-hidden": "true", className: "nu-search-box__bracket", children: "[" }),
|
|
7928
|
+
/* @__PURE__ */ jsx55("span", { className: "nu-search-box__input-shell", children: /* @__PURE__ */ jsx55(
|
|
7811
7929
|
"input",
|
|
7812
7930
|
{
|
|
7813
7931
|
"aria-autocomplete": "list",
|
|
@@ -7832,11 +7950,11 @@ function SearchBox({
|
|
|
7832
7950
|
value: normalizedQuery
|
|
7833
7951
|
}
|
|
7834
7952
|
) }),
|
|
7835
|
-
/* @__PURE__ */
|
|
7953
|
+
/* @__PURE__ */ jsx55("span", { "aria-hidden": "true", className: "nu-search-box__bracket", children: "]" })
|
|
7836
7954
|
] }),
|
|
7837
|
-
hint ? /* @__PURE__ */
|
|
7955
|
+
hint ? /* @__PURE__ */ jsx55("span", { className: "nu-search-box__hint", id: hintId, children: hint }) : null,
|
|
7838
7956
|
open && popupRoot ? createPortal4(
|
|
7839
|
-
/* @__PURE__ */
|
|
7957
|
+
/* @__PURE__ */ jsx55(
|
|
7840
7958
|
"div",
|
|
7841
7959
|
{
|
|
7842
7960
|
className: "nu-search-box__popup",
|
|
@@ -7857,9 +7975,9 @@ function SearchBox({
|
|
|
7857
7975
|
import {
|
|
7858
7976
|
useId as useId13,
|
|
7859
7977
|
useMemo as useMemo17,
|
|
7860
|
-
useState as
|
|
7978
|
+
useState as useState27
|
|
7861
7979
|
} from "react";
|
|
7862
|
-
import { jsx as
|
|
7980
|
+
import { jsx as jsx56, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
7863
7981
|
function clampSpinValue(value, min, max) {
|
|
7864
7982
|
let nextValue = value;
|
|
7865
7983
|
if (min !== void 0) {
|
|
@@ -7909,9 +8027,9 @@ function SpinBox({
|
|
|
7909
8027
|
min,
|
|
7910
8028
|
max
|
|
7911
8029
|
);
|
|
7912
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
8030
|
+
const [uncontrolledValue, setUncontrolledValue] = useState27(initialNumericValue);
|
|
7913
8031
|
const numericValue = isControlled ? clampSpinValue(value ?? initialNumericValue, min, max) : uncontrolledValue;
|
|
7914
|
-
const [uncontrolledDraftValue, setUncontrolledDraftValue] =
|
|
8032
|
+
const [uncontrolledDraftValue, setUncontrolledDraftValue] = useState27(
|
|
7915
8033
|
() => formatSpinValue(initialNumericValue)
|
|
7916
8034
|
);
|
|
7917
8035
|
const draftValue = isControlled ? formatSpinValue(numericValue) : uncontrolledDraftValue;
|
|
@@ -7972,14 +8090,14 @@ function SpinBox({
|
|
|
7972
8090
|
() => disabled || max !== void 0 && numericValue >= max,
|
|
7973
8091
|
[disabled, max, numericValue]
|
|
7974
8092
|
);
|
|
7975
|
-
return /* @__PURE__ */
|
|
8093
|
+
return /* @__PURE__ */ jsxs35(
|
|
7976
8094
|
"label",
|
|
7977
8095
|
{
|
|
7978
8096
|
className: cx("nu-spin-box", slotClassNames?.root, className),
|
|
7979
8097
|
htmlFor: fieldId,
|
|
7980
8098
|
style: mergeSlotStyle(style, slotStyles?.root),
|
|
7981
8099
|
children: [
|
|
7982
|
-
/* @__PURE__ */
|
|
8100
|
+
/* @__PURE__ */ jsx56(
|
|
7983
8101
|
"span",
|
|
7984
8102
|
{
|
|
7985
8103
|
className: cx("nu-spin-box__label", slotClassNames?.label),
|
|
@@ -7987,13 +8105,13 @@ function SpinBox({
|
|
|
7987
8105
|
children: renderMnemonicText(label)
|
|
7988
8106
|
}
|
|
7989
8107
|
),
|
|
7990
|
-
/* @__PURE__ */
|
|
8108
|
+
/* @__PURE__ */ jsxs35(
|
|
7991
8109
|
"span",
|
|
7992
8110
|
{
|
|
7993
8111
|
className: cx("nu-spin-box__slot", slotClassNames?.slot),
|
|
7994
8112
|
style: slotStyles?.slot,
|
|
7995
8113
|
children: [
|
|
7996
|
-
/* @__PURE__ */
|
|
8114
|
+
/* @__PURE__ */ jsx56(
|
|
7997
8115
|
"span",
|
|
7998
8116
|
{
|
|
7999
8117
|
"aria-hidden": "true",
|
|
@@ -8002,12 +8120,12 @@ function SpinBox({
|
|
|
8002
8120
|
children: "["
|
|
8003
8121
|
}
|
|
8004
8122
|
),
|
|
8005
|
-
/* @__PURE__ */
|
|
8123
|
+
/* @__PURE__ */ jsx56(
|
|
8006
8124
|
"span",
|
|
8007
8125
|
{
|
|
8008
8126
|
className: cx("nu-spin-box__input-shell", slotClassNames?.inputShell),
|
|
8009
8127
|
style: slotStyles?.inputShell,
|
|
8010
|
-
children: /* @__PURE__ */
|
|
8128
|
+
children: /* @__PURE__ */ jsx56(
|
|
8011
8129
|
"input",
|
|
8012
8130
|
{
|
|
8013
8131
|
...props,
|
|
@@ -8026,7 +8144,7 @@ function SpinBox({
|
|
|
8026
8144
|
)
|
|
8027
8145
|
}
|
|
8028
8146
|
),
|
|
8029
|
-
/* @__PURE__ */
|
|
8147
|
+
/* @__PURE__ */ jsx56(
|
|
8030
8148
|
"span",
|
|
8031
8149
|
{
|
|
8032
8150
|
"aria-hidden": "true",
|
|
@@ -8035,13 +8153,13 @@ function SpinBox({
|
|
|
8035
8153
|
children: "]"
|
|
8036
8154
|
}
|
|
8037
8155
|
),
|
|
8038
|
-
/* @__PURE__ */
|
|
8156
|
+
/* @__PURE__ */ jsxs35(
|
|
8039
8157
|
"span",
|
|
8040
8158
|
{
|
|
8041
8159
|
className: cx("nu-spin-box__controls", slotClassNames?.controls),
|
|
8042
8160
|
style: slotStyles?.controls,
|
|
8043
8161
|
children: [
|
|
8044
|
-
/* @__PURE__ */
|
|
8162
|
+
/* @__PURE__ */ jsx56(
|
|
8045
8163
|
"button",
|
|
8046
8164
|
{
|
|
8047
8165
|
className: cx("nu-spin-box__button", slotClassNames?.button),
|
|
@@ -8052,7 +8170,7 @@ function SpinBox({
|
|
|
8052
8170
|
children: "-"
|
|
8053
8171
|
}
|
|
8054
8172
|
),
|
|
8055
|
-
/* @__PURE__ */
|
|
8173
|
+
/* @__PURE__ */ jsx56(
|
|
8056
8174
|
"button",
|
|
8057
8175
|
{
|
|
8058
8176
|
className: cx("nu-spin-box__button", slotClassNames?.button),
|
|
@@ -8069,7 +8187,7 @@ function SpinBox({
|
|
|
8069
8187
|
]
|
|
8070
8188
|
}
|
|
8071
8189
|
),
|
|
8072
|
-
hint ? /* @__PURE__ */
|
|
8190
|
+
hint ? /* @__PURE__ */ jsx56(
|
|
8073
8191
|
"span",
|
|
8074
8192
|
{
|
|
8075
8193
|
className: cx("nu-spin-box__hint", slotClassNames?.hint),
|
|
@@ -8087,10 +8205,10 @@ function SpinBox({
|
|
|
8087
8205
|
import {
|
|
8088
8206
|
useEffect as useEffect14,
|
|
8089
8207
|
useId as useId14,
|
|
8090
|
-
useRef as
|
|
8091
|
-
useState as
|
|
8208
|
+
useRef as useRef20,
|
|
8209
|
+
useState as useState28
|
|
8092
8210
|
} from "react";
|
|
8093
|
-
import { jsx as
|
|
8211
|
+
import { jsx as jsx57, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
8094
8212
|
function clamp4(value, min, max) {
|
|
8095
8213
|
return Math.min(max, Math.max(min, value));
|
|
8096
8214
|
}
|
|
@@ -8121,12 +8239,12 @@ function Splitter({
|
|
|
8121
8239
|
const parsedValue = Number(rawValue);
|
|
8122
8240
|
return Number.isFinite(parsedValue) ? parsedValue : null;
|
|
8123
8241
|
};
|
|
8124
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
8242
|
+
const [uncontrolledValue, setUncontrolledValue] = useState28(
|
|
8125
8243
|
clamp4(getSavedValue() ?? defaultValue, min, max)
|
|
8126
8244
|
);
|
|
8127
|
-
const rootRef =
|
|
8128
|
-
const dragFrameRef =
|
|
8129
|
-
const dragValueRef =
|
|
8245
|
+
const rootRef = useRef20(null);
|
|
8246
|
+
const dragFrameRef = useRef20(null);
|
|
8247
|
+
const dragValueRef = useRef20(null);
|
|
8130
8248
|
const activeValue = clamp4(
|
|
8131
8249
|
(isControlled ? value : uncontrolledValue) ?? defaultValue,
|
|
8132
8250
|
min,
|
|
@@ -8245,7 +8363,7 @@ function Splitter({
|
|
|
8245
8363
|
commitValue(max);
|
|
8246
8364
|
}
|
|
8247
8365
|
}
|
|
8248
|
-
return /* @__PURE__ */
|
|
8366
|
+
return /* @__PURE__ */ jsxs36(
|
|
8249
8367
|
"div",
|
|
8250
8368
|
{
|
|
8251
8369
|
...props,
|
|
@@ -8257,8 +8375,8 @@ function Splitter({
|
|
|
8257
8375
|
"--nu-splitter-value": `${activeValue * 100}%`
|
|
8258
8376
|
},
|
|
8259
8377
|
children: [
|
|
8260
|
-
/* @__PURE__ */
|
|
8261
|
-
/* @__PURE__ */
|
|
8378
|
+
/* @__PURE__ */ jsx57("div", { className: "nu-splitter__pane", id: firstPaneId, children: first }),
|
|
8379
|
+
/* @__PURE__ */ jsx57(
|
|
8262
8380
|
"div",
|
|
8263
8381
|
{
|
|
8264
8382
|
"aria-controls": `${firstPaneId} ${secondPaneId}`,
|
|
@@ -8271,7 +8389,7 @@ function Splitter({
|
|
|
8271
8389
|
onPointerDown: handlePointerDown,
|
|
8272
8390
|
role: "separator",
|
|
8273
8391
|
tabIndex: 0,
|
|
8274
|
-
children: /* @__PURE__ */
|
|
8392
|
+
children: /* @__PURE__ */ jsx57(
|
|
8275
8393
|
"span",
|
|
8276
8394
|
{
|
|
8277
8395
|
"aria-hidden": "true",
|
|
@@ -8281,7 +8399,7 @@ function Splitter({
|
|
|
8281
8399
|
)
|
|
8282
8400
|
}
|
|
8283
8401
|
),
|
|
8284
|
-
/* @__PURE__ */
|
|
8402
|
+
/* @__PURE__ */ jsx57("div", { className: "nu-splitter__pane", id: secondPaneId, children: second })
|
|
8285
8403
|
]
|
|
8286
8404
|
}
|
|
8287
8405
|
);
|
|
@@ -8292,10 +8410,10 @@ import {
|
|
|
8292
8410
|
useEffect as useEffect15,
|
|
8293
8411
|
useId as useId15,
|
|
8294
8412
|
useMemo as useMemo18,
|
|
8295
|
-
useRef as
|
|
8296
|
-
useState as
|
|
8413
|
+
useRef as useRef21,
|
|
8414
|
+
useState as useState29
|
|
8297
8415
|
} from "react";
|
|
8298
|
-
import { jsx as
|
|
8416
|
+
import { jsx as jsx58, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
8299
8417
|
function clamp5(value, min, max) {
|
|
8300
8418
|
return Math.min(max, Math.max(min, value));
|
|
8301
8419
|
}
|
|
@@ -8340,9 +8458,9 @@ function TickBar({
|
|
|
8340
8458
|
min,
|
|
8341
8459
|
safeMax
|
|
8342
8460
|
);
|
|
8343
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
8344
|
-
const [dragging, setDragging] =
|
|
8345
|
-
const trackRef =
|
|
8461
|
+
const [uncontrolledValue, setUncontrolledValue] = useState29(initialValue);
|
|
8462
|
+
const [dragging, setDragging] = useState29(false);
|
|
8463
|
+
const trackRef = useRef21(null);
|
|
8346
8464
|
const resolvedValue = isControlled ? clamp5(snapToStep(value ?? initialValue, min, safeStep), min, safeMax) : uncontrolledValue;
|
|
8347
8465
|
const ratio = safeMax === min ? 0 : (resolvedValue - min) / (safeMax - min);
|
|
8348
8466
|
const derivedTickCount = useMemo18(() => {
|
|
@@ -8431,7 +8549,7 @@ function TickBar({
|
|
|
8431
8549
|
}
|
|
8432
8550
|
onKeyDown?.(event);
|
|
8433
8551
|
}
|
|
8434
|
-
return /* @__PURE__ */
|
|
8552
|
+
return /* @__PURE__ */ jsxs37(
|
|
8435
8553
|
"div",
|
|
8436
8554
|
{
|
|
8437
8555
|
...props,
|
|
@@ -8444,7 +8562,7 @@ function TickBar({
|
|
|
8444
8562
|
slotStyles?.root
|
|
8445
8563
|
),
|
|
8446
8564
|
children: [
|
|
8447
|
-
label ? /* @__PURE__ */
|
|
8565
|
+
label ? /* @__PURE__ */ jsx58(
|
|
8448
8566
|
"span",
|
|
8449
8567
|
{
|
|
8450
8568
|
className: cx("nu-tick-bar__label", slotClassNames?.label),
|
|
@@ -8452,13 +8570,13 @@ function TickBar({
|
|
|
8452
8570
|
children: renderMnemonicText(label)
|
|
8453
8571
|
}
|
|
8454
8572
|
) : null,
|
|
8455
|
-
/* @__PURE__ */
|
|
8573
|
+
/* @__PURE__ */ jsxs37(
|
|
8456
8574
|
"div",
|
|
8457
8575
|
{
|
|
8458
8576
|
className: cx("nu-tick-bar__slot", slotClassNames?.slot),
|
|
8459
8577
|
style: slotStyles?.slot,
|
|
8460
8578
|
children: [
|
|
8461
|
-
/* @__PURE__ */
|
|
8579
|
+
/* @__PURE__ */ jsxs37(
|
|
8462
8580
|
"div",
|
|
8463
8581
|
{
|
|
8464
8582
|
"aria-describedby": hintId,
|
|
@@ -8500,19 +8618,19 @@ function TickBar({
|
|
|
8500
8618
|
style: slotStyles?.track,
|
|
8501
8619
|
tabIndex: disabled ? -1 : 0,
|
|
8502
8620
|
children: [
|
|
8503
|
-
/* @__PURE__ */
|
|
8621
|
+
/* @__PURE__ */ jsx58(
|
|
8504
8622
|
"div",
|
|
8505
8623
|
{
|
|
8506
8624
|
className: cx("nu-tick-bar__rail", slotClassNames?.rail),
|
|
8507
8625
|
style: slotStyles?.rail
|
|
8508
8626
|
}
|
|
8509
8627
|
),
|
|
8510
|
-
/* @__PURE__ */
|
|
8628
|
+
/* @__PURE__ */ jsx58(
|
|
8511
8629
|
"div",
|
|
8512
8630
|
{
|
|
8513
8631
|
className: cx("nu-tick-bar__ticks", slotClassNames?.ticks),
|
|
8514
8632
|
style: slotStyles?.ticks,
|
|
8515
|
-
children: Array.from({ length: derivedTickCount }, (_, index) => /* @__PURE__ */
|
|
8633
|
+
children: Array.from({ length: derivedTickCount }, (_, index) => /* @__PURE__ */ jsx58(
|
|
8516
8634
|
"span",
|
|
8517
8635
|
{
|
|
8518
8636
|
"aria-hidden": "true",
|
|
@@ -8523,7 +8641,7 @@ function TickBar({
|
|
|
8523
8641
|
))
|
|
8524
8642
|
}
|
|
8525
8643
|
),
|
|
8526
|
-
/* @__PURE__ */
|
|
8644
|
+
/* @__PURE__ */ jsx58(
|
|
8527
8645
|
"div",
|
|
8528
8646
|
{
|
|
8529
8647
|
"aria-hidden": "true",
|
|
@@ -8541,7 +8659,7 @@ function TickBar({
|
|
|
8541
8659
|
]
|
|
8542
8660
|
}
|
|
8543
8661
|
),
|
|
8544
|
-
showValue ? /* @__PURE__ */
|
|
8662
|
+
showValue ? /* @__PURE__ */ jsx58(
|
|
8545
8663
|
"span",
|
|
8546
8664
|
{
|
|
8547
8665
|
className: cx("nu-tick-bar__value", slotClassNames?.value),
|
|
@@ -8552,7 +8670,7 @@ function TickBar({
|
|
|
8552
8670
|
]
|
|
8553
8671
|
}
|
|
8554
8672
|
),
|
|
8555
|
-
hint ? /* @__PURE__ */
|
|
8673
|
+
hint ? /* @__PURE__ */ jsx58(
|
|
8556
8674
|
"span",
|
|
8557
8675
|
{
|
|
8558
8676
|
className: cx("nu-tick-bar__hint", slotClassNames?.hint),
|
|
@@ -8567,17 +8685,19 @@ function TickBar({
|
|
|
8567
8685
|
}
|
|
8568
8686
|
|
|
8569
8687
|
// src/components/ToolBar/ToolBar.tsx
|
|
8570
|
-
import { jsx as
|
|
8688
|
+
import { jsx as jsx59, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
8571
8689
|
function ToolBar({
|
|
8572
8690
|
children,
|
|
8573
8691
|
className,
|
|
8692
|
+
endContent,
|
|
8574
8693
|
fill = true,
|
|
8575
8694
|
slotClassNames,
|
|
8576
8695
|
slotStyles,
|
|
8696
|
+
startContent,
|
|
8577
8697
|
wrap = false,
|
|
8578
8698
|
...props
|
|
8579
8699
|
}) {
|
|
8580
|
-
return /* @__PURE__ */
|
|
8700
|
+
return /* @__PURE__ */ jsxs38(
|
|
8581
8701
|
"div",
|
|
8582
8702
|
{
|
|
8583
8703
|
...props,
|
|
@@ -8586,7 +8706,11 @@ function ToolBar({
|
|
|
8586
8706
|
"data-wrap": wrap || void 0,
|
|
8587
8707
|
role: "toolbar",
|
|
8588
8708
|
style: mergeSlotStyle(props.style, slotStyles?.root),
|
|
8589
|
-
children
|
|
8709
|
+
children: [
|
|
8710
|
+
startContent !== null && startContent !== void 0 ? /* @__PURE__ */ jsx59("span", { className: "nu-toolbar__static nu-toolbar__static--start", children: startContent }) : null,
|
|
8711
|
+
children,
|
|
8712
|
+
endContent !== null && endContent !== void 0 ? /* @__PURE__ */ jsx59("span", { className: "nu-toolbar__static nu-toolbar__static--end", children: endContent }) : null
|
|
8713
|
+
]
|
|
8590
8714
|
}
|
|
8591
8715
|
);
|
|
8592
8716
|
}
|
|
@@ -8596,7 +8720,7 @@ function ToolButton({
|
|
|
8596
8720
|
slotStyles,
|
|
8597
8721
|
...props
|
|
8598
8722
|
}) {
|
|
8599
|
-
return /* @__PURE__ */
|
|
8723
|
+
return /* @__PURE__ */ jsx59(
|
|
8600
8724
|
CommandButton,
|
|
8601
8725
|
{
|
|
8602
8726
|
...props,
|
|
@@ -8626,7 +8750,7 @@ function ToolDropButton({
|
|
|
8626
8750
|
uncheckedShape,
|
|
8627
8751
|
...props
|
|
8628
8752
|
}) {
|
|
8629
|
-
return /* @__PURE__ */
|
|
8753
|
+
return /* @__PURE__ */ jsx59(
|
|
8630
8754
|
CommandButton,
|
|
8631
8755
|
{
|
|
8632
8756
|
...props,
|
|
@@ -8652,7 +8776,7 @@ function ToolDropButton({
|
|
|
8652
8776
|
);
|
|
8653
8777
|
}
|
|
8654
8778
|
function ToolSeparator({ className, ...props }) {
|
|
8655
|
-
return /* @__PURE__ */
|
|
8779
|
+
return /* @__PURE__ */ jsx59(
|
|
8656
8780
|
"div",
|
|
8657
8781
|
{
|
|
8658
8782
|
...props,
|
|
@@ -8675,8 +8799,8 @@ import {
|
|
|
8675
8799
|
useId as useId16,
|
|
8676
8800
|
useImperativeHandle as useImperativeHandle3,
|
|
8677
8801
|
useMemo as useMemo19,
|
|
8678
|
-
useRef as
|
|
8679
|
-
useState as
|
|
8802
|
+
useRef as useRef22,
|
|
8803
|
+
useState as useState30
|
|
8680
8804
|
} from "react";
|
|
8681
8805
|
|
|
8682
8806
|
// src/components/_shared/treeData.ts
|
|
@@ -8774,7 +8898,7 @@ function collectVisibleTreeItems(items, expandedIds, depth = 0, guideMask = [],
|
|
|
8774
8898
|
|
|
8775
8899
|
// src/components/TreeView/internals/TreeViewItem.tsx
|
|
8776
8900
|
import { memo as memo4 } from "react";
|
|
8777
|
-
import { jsx as
|
|
8901
|
+
import { jsx as jsx60, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
8778
8902
|
function areTreeViewGuideArraysEqual(previousArray, nextArray) {
|
|
8779
8903
|
if (previousArray.length !== nextArray.length) {
|
|
8780
8904
|
return false;
|
|
@@ -8848,8 +8972,8 @@ function TreeViewItemInner({
|
|
|
8848
8972
|
handleActivate();
|
|
8849
8973
|
onToggleItemCheck?.(item, !isChecked);
|
|
8850
8974
|
}
|
|
8851
|
-
return /* @__PURE__ */
|
|
8852
|
-
/* @__PURE__ */
|
|
8975
|
+
return /* @__PURE__ */ jsxs39("div", { className: "nu-tree-view__row", role: "none", children: [
|
|
8976
|
+
/* @__PURE__ */ jsxs39(
|
|
8853
8977
|
"div",
|
|
8854
8978
|
{
|
|
8855
8979
|
"aria-checked": isCheckable ? isChecked : void 0,
|
|
@@ -8868,8 +8992,8 @@ function TreeViewItemInner({
|
|
|
8868
8992
|
ref: (node) => registerItemRef(itemId, node),
|
|
8869
8993
|
role: "treeitem",
|
|
8870
8994
|
children: [
|
|
8871
|
-
/* @__PURE__ */
|
|
8872
|
-
guideMask.map((hasGuide, guideIndex) => /* @__PURE__ */
|
|
8995
|
+
/* @__PURE__ */ jsxs39("span", { "aria-hidden": "true", className: "nu-tree-view__prefix", children: [
|
|
8996
|
+
guideMask.map((hasGuide, guideIndex) => /* @__PURE__ */ jsx60(
|
|
8873
8997
|
"span",
|
|
8874
8998
|
{
|
|
8875
8999
|
className: "nu-tree-view__guide",
|
|
@@ -8880,7 +9004,7 @@ function TreeViewItemInner({
|
|
|
8880
9004
|
},
|
|
8881
9005
|
`${itemId}-guide-${guideIndex}`
|
|
8882
9006
|
)),
|
|
8883
|
-
/* @__PURE__ */
|
|
9007
|
+
/* @__PURE__ */ jsxs39(
|
|
8884
9008
|
"span",
|
|
8885
9009
|
{
|
|
8886
9010
|
className: "nu-tree-view__lead",
|
|
@@ -8888,19 +9012,19 @@ function TreeViewItemInner({
|
|
|
8888
9012
|
"--nu-tree-view-origin-offset": originOffset
|
|
8889
9013
|
},
|
|
8890
9014
|
children: [
|
|
8891
|
-
depth > 0 ? /* @__PURE__ */
|
|
9015
|
+
depth > 0 ? /* @__PURE__ */ jsx60(
|
|
8892
9016
|
"span",
|
|
8893
9017
|
{
|
|
8894
9018
|
className: "nu-tree-view__branch",
|
|
8895
9019
|
"data-branch": hasNextSibling ? "tee" : "elbow"
|
|
8896
9020
|
}
|
|
8897
9021
|
) : null,
|
|
8898
|
-
hasChildren ? /* @__PURE__ */
|
|
9022
|
+
hasChildren ? /* @__PURE__ */ jsx60(
|
|
8899
9023
|
"span",
|
|
8900
9024
|
{
|
|
8901
9025
|
className: "nu-tree-view__expander",
|
|
8902
9026
|
"data-connector": depth > 0 ? "lead" : void 0,
|
|
8903
|
-
children: /* @__PURE__ */
|
|
9027
|
+
children: /* @__PURE__ */ jsx60(
|
|
8904
9028
|
"button",
|
|
8905
9029
|
{
|
|
8906
9030
|
"aria-label": isExpanded ? "Collapse item" : "Expand item",
|
|
@@ -8908,7 +9032,7 @@ function TreeViewItemInner({
|
|
|
8908
9032
|
onClick: handleToggleExpanded,
|
|
8909
9033
|
tabIndex: -1,
|
|
8910
9034
|
type: "button",
|
|
8911
|
-
children: /* @__PURE__ */
|
|
9035
|
+
children: /* @__PURE__ */ jsx60(
|
|
8912
9036
|
NuGlyph,
|
|
8913
9037
|
{
|
|
8914
9038
|
name: isExpanded ? "tree-caret-down" : "tree-caret-right"
|
|
@@ -8917,7 +9041,7 @@ function TreeViewItemInner({
|
|
|
8917
9041
|
}
|
|
8918
9042
|
)
|
|
8919
9043
|
}
|
|
8920
|
-
) : depth > 0 ? /* @__PURE__ */
|
|
9044
|
+
) : depth > 0 ? /* @__PURE__ */ jsx60(
|
|
8921
9045
|
"span",
|
|
8922
9046
|
{
|
|
8923
9047
|
className: "nu-tree-view__expander-placeholder",
|
|
@@ -8928,8 +9052,8 @@ function TreeViewItemInner({
|
|
|
8928
9052
|
}
|
|
8929
9053
|
)
|
|
8930
9054
|
] }),
|
|
8931
|
-
/* @__PURE__ */
|
|
8932
|
-
isCheckable ? /* @__PURE__ */
|
|
9055
|
+
/* @__PURE__ */ jsxs39("span", { className: "nu-tree-view__content", children: [
|
|
9056
|
+
isCheckable ? /* @__PURE__ */ jsx60("span", { className: "nu-tree-view__check-slot", children: /* @__PURE__ */ jsx60(
|
|
8933
9057
|
"button",
|
|
8934
9058
|
{
|
|
8935
9059
|
"aria-label": isChecked ? "Uncheck item" : "Check item",
|
|
@@ -8937,12 +9061,12 @@ function TreeViewItemInner({
|
|
|
8937
9061
|
onClick: handleToggleChecked,
|
|
8938
9062
|
tabIndex: -1,
|
|
8939
9063
|
type: "button",
|
|
8940
|
-
children: /* @__PURE__ */
|
|
9064
|
+
children: /* @__PURE__ */ jsx60(
|
|
8941
9065
|
"span",
|
|
8942
9066
|
{
|
|
8943
9067
|
className: "nu-tree-view__check-box",
|
|
8944
9068
|
"data-unchecked-shape": uncheckedShape,
|
|
8945
|
-
children: isChecked ? /* @__PURE__ */
|
|
9069
|
+
children: isChecked ? /* @__PURE__ */ jsx60(
|
|
8946
9070
|
NuGlyph,
|
|
8947
9071
|
{
|
|
8948
9072
|
className: "nu-tree-view__check-mark",
|
|
@@ -8953,14 +9077,14 @@ function TreeViewItemInner({
|
|
|
8953
9077
|
)
|
|
8954
9078
|
}
|
|
8955
9079
|
) }) : null,
|
|
8956
|
-
item.icon ? /* @__PURE__ */
|
|
8957
|
-
/* @__PURE__ */
|
|
8958
|
-
item.hint ? /* @__PURE__ */
|
|
9080
|
+
item.icon ? /* @__PURE__ */ jsx60("span", { className: "nu-tree-view__icon", children: item.icon }) : null,
|
|
9081
|
+
/* @__PURE__ */ jsx60("span", { className: "nu-tree-view__title", children: item.title }),
|
|
9082
|
+
item.hint ? /* @__PURE__ */ jsx60("span", { className: "nu-tree-view__hint", children: item.hint }) : null
|
|
8959
9083
|
] })
|
|
8960
9084
|
]
|
|
8961
9085
|
}
|
|
8962
9086
|
),
|
|
8963
|
-
hasChildren && isExpanded ? /* @__PURE__ */
|
|
9087
|
+
hasChildren && isExpanded ? /* @__PURE__ */ jsx60("div", { role: "group", children: (item.children ?? []).map((child, index) => /* @__PURE__ */ jsx60(
|
|
8964
9088
|
TreeViewItem,
|
|
8965
9089
|
{
|
|
8966
9090
|
depth: depth + 1,
|
|
@@ -8996,7 +9120,7 @@ function areTreeViewItemPropsEqual(previousProps, nextProps) {
|
|
|
8996
9120
|
var TreeViewItem = memo4(TreeViewItemInner, areTreeViewItemPropsEqual);
|
|
8997
9121
|
|
|
8998
9122
|
// src/components/TreeView/TreeView.tsx
|
|
8999
|
-
import { jsx as
|
|
9123
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
9000
9124
|
function TreeViewInner({
|
|
9001
9125
|
className,
|
|
9002
9126
|
data,
|
|
@@ -9011,18 +9135,18 @@ function TreeViewInner({
|
|
|
9011
9135
|
uncheckedShape = "box",
|
|
9012
9136
|
...props
|
|
9013
9137
|
}, ref) {
|
|
9014
|
-
const rootRef =
|
|
9138
|
+
const rootRef = useRef22(null);
|
|
9015
9139
|
const treeId = useId16();
|
|
9016
|
-
const itemRefs =
|
|
9140
|
+
const itemRefs = useRef22({});
|
|
9017
9141
|
const isExpandedControlled = expandedIds !== void 0;
|
|
9018
|
-
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] =
|
|
9142
|
+
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = useState30(() => {
|
|
9019
9143
|
const expandedFromData = collectExpandedTreeIds(data);
|
|
9020
9144
|
if (!defaultExpandedIds?.length) {
|
|
9021
9145
|
return expandedFromData;
|
|
9022
9146
|
}
|
|
9023
9147
|
return Array.from(/* @__PURE__ */ new Set([...expandedFromData, ...defaultExpandedIds]));
|
|
9024
9148
|
});
|
|
9025
|
-
const [uncontrolledSelectedId, setUncontrolledSelectedId] =
|
|
9149
|
+
const [uncontrolledSelectedId, setUncontrolledSelectedId] = useState30(null);
|
|
9026
9150
|
const resolvedExpandedIds = isExpandedControlled ? expandedIds : uncontrolledExpandedIds;
|
|
9027
9151
|
const expandedIdSet = useMemo19(
|
|
9028
9152
|
() => new Set(resolvedExpandedIds),
|
|
@@ -9038,7 +9162,7 @@ function TreeViewInner({
|
|
|
9038
9162
|
);
|
|
9039
9163
|
const derivedSelectedId = selectedId ?? uncontrolledSelectedId ?? findSelectedTreeItemId(data) ?? selectableItems[0]?.itemId ?? null;
|
|
9040
9164
|
const resolvedSelectedId = derivedSelectedId && selectableItems.some((entry) => entry.itemId === derivedSelectedId) ? derivedSelectedId : selectableItems[0]?.itemId ?? null;
|
|
9041
|
-
const [activeId, setActiveId] =
|
|
9165
|
+
const [activeId, setActiveId] = useState30(resolvedSelectedId);
|
|
9042
9166
|
const resolvedActiveId = activeId && selectableItems.some((entry) => entry.itemId === activeId) ? activeId : resolvedSelectedId;
|
|
9043
9167
|
useEffect16(() => {
|
|
9044
9168
|
if (!resolvedActiveId) {
|
|
@@ -9247,7 +9371,7 @@ function TreeViewInner({
|
|
|
9247
9371
|
setExpandedState
|
|
9248
9372
|
]
|
|
9249
9373
|
);
|
|
9250
|
-
return /* @__PURE__ */
|
|
9374
|
+
return /* @__PURE__ */ jsx61(
|
|
9251
9375
|
"div",
|
|
9252
9376
|
{
|
|
9253
9377
|
...props,
|
|
@@ -9257,7 +9381,7 @@ function TreeViewInner({
|
|
|
9257
9381
|
ref: rootRef,
|
|
9258
9382
|
role: "tree",
|
|
9259
9383
|
tabIndex: 0,
|
|
9260
|
-
children: visibleItems.length > 0 ? data.map((item, index) => /* @__PURE__ */
|
|
9384
|
+
children: visibleItems.length > 0 ? data.map((item, index) => /* @__PURE__ */ jsx61(
|
|
9261
9385
|
TreeViewItem,
|
|
9262
9386
|
{
|
|
9263
9387
|
depth: 0,
|
|
@@ -9277,7 +9401,7 @@ function TreeViewInner({
|
|
|
9277
9401
|
uncheckedShape
|
|
9278
9402
|
},
|
|
9279
9403
|
item.id
|
|
9280
|
-
)) : /* @__PURE__ */
|
|
9404
|
+
)) : /* @__PURE__ */ jsx61("div", { className: "nu-tree-view__empty", children: emptyText })
|
|
9281
9405
|
}
|
|
9282
9406
|
);
|
|
9283
9407
|
}
|
|
@@ -9290,10 +9414,10 @@ import {
|
|
|
9290
9414
|
useEffect as useEffect17,
|
|
9291
9415
|
useId as useId17,
|
|
9292
9416
|
useImperativeHandle as useImperativeHandle4,
|
|
9293
|
-
useLayoutEffect as
|
|
9417
|
+
useLayoutEffect as useLayoutEffect6,
|
|
9294
9418
|
useMemo as useMemo20,
|
|
9295
|
-
useRef as
|
|
9296
|
-
useState as
|
|
9419
|
+
useRef as useRef23,
|
|
9420
|
+
useState as useState31
|
|
9297
9421
|
} from "react";
|
|
9298
9422
|
|
|
9299
9423
|
// src/components/TreeListView/internals/helpers.ts
|
|
@@ -9384,11 +9508,11 @@ function renderTreeListCellValue(item, column) {
|
|
|
9384
9508
|
|
|
9385
9509
|
// src/components/TreeListView/internals/TreeListViewRow.tsx
|
|
9386
9510
|
import { memo as memo5 } from "react";
|
|
9387
|
-
import { Fragment as Fragment7, jsx as
|
|
9511
|
+
import { Fragment as Fragment7, jsx as jsx62, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
9388
9512
|
function renderTreeTitleContent(item) {
|
|
9389
|
-
return /* @__PURE__ */
|
|
9390
|
-
/* @__PURE__ */
|
|
9391
|
-
item.hint ? /* @__PURE__ */
|
|
9513
|
+
return /* @__PURE__ */ jsxs40(Fragment7, { children: [
|
|
9514
|
+
/* @__PURE__ */ jsx62("span", { className: "nu-tree-list-view__title", children: item.title }),
|
|
9515
|
+
item.hint ? /* @__PURE__ */ jsx62("span", { className: "nu-tree-list-view__hint", children: item.hint }) : null
|
|
9392
9516
|
] });
|
|
9393
9517
|
}
|
|
9394
9518
|
function renderReportCellContent(item, column, depth, rowIndex, getCellContent) {
|
|
@@ -9514,8 +9638,8 @@ function TreeListViewRowInner({
|
|
|
9514
9638
|
handleActivate();
|
|
9515
9639
|
onToggleItemCheck?.(item, !isChecked);
|
|
9516
9640
|
}
|
|
9517
|
-
return /* @__PURE__ */
|
|
9518
|
-
/* @__PURE__ */
|
|
9641
|
+
return /* @__PURE__ */ jsxs40(Fragment7, { children: [
|
|
9642
|
+
/* @__PURE__ */ jsx62(
|
|
9519
9643
|
"div",
|
|
9520
9644
|
{
|
|
9521
9645
|
"aria-disabled": item.disabled || void 0,
|
|
@@ -9543,7 +9667,7 @@ function TreeListViewRowInner({
|
|
|
9543
9667
|
"--nu-tree-list-view-columns": templateColumns
|
|
9544
9668
|
},
|
|
9545
9669
|
children: columns.map(
|
|
9546
|
-
(column, columnIndex) => column.id === treeColumnId ? /* @__PURE__ */
|
|
9670
|
+
(column, columnIndex) => column.id === treeColumnId ? /* @__PURE__ */ jsxs40(
|
|
9547
9671
|
"span",
|
|
9548
9672
|
{
|
|
9549
9673
|
className: [
|
|
@@ -9555,8 +9679,8 @@ function TreeListViewRowInner({
|
|
|
9555
9679
|
"data-column-id": column.id,
|
|
9556
9680
|
role: "gridcell",
|
|
9557
9681
|
children: [
|
|
9558
|
-
/* @__PURE__ */
|
|
9559
|
-
guideMask.map((hasGuide, guideIndex) => /* @__PURE__ */
|
|
9682
|
+
/* @__PURE__ */ jsxs40("span", { "aria-hidden": "true", className: "nu-tree-list-view__prefix", children: [
|
|
9683
|
+
guideMask.map((hasGuide, guideIndex) => /* @__PURE__ */ jsx62(
|
|
9560
9684
|
"span",
|
|
9561
9685
|
{
|
|
9562
9686
|
className: "nu-tree-list-view__guide",
|
|
@@ -9567,7 +9691,7 @@ function TreeListViewRowInner({
|
|
|
9567
9691
|
},
|
|
9568
9692
|
`${itemId}-guide-${guideIndex}`
|
|
9569
9693
|
)),
|
|
9570
|
-
/* @__PURE__ */
|
|
9694
|
+
/* @__PURE__ */ jsxs40(
|
|
9571
9695
|
"span",
|
|
9572
9696
|
{
|
|
9573
9697
|
className: "nu-tree-list-view__lead",
|
|
@@ -9575,19 +9699,19 @@ function TreeListViewRowInner({
|
|
|
9575
9699
|
"--nu-tree-list-view-origin-offset": originOffset
|
|
9576
9700
|
},
|
|
9577
9701
|
children: [
|
|
9578
|
-
depth > 0 ? /* @__PURE__ */
|
|
9702
|
+
depth > 0 ? /* @__PURE__ */ jsx62(
|
|
9579
9703
|
"span",
|
|
9580
9704
|
{
|
|
9581
9705
|
className: "nu-tree-list-view__branch",
|
|
9582
9706
|
"data-branch": hasNextSibling ? "tee" : "elbow"
|
|
9583
9707
|
}
|
|
9584
9708
|
) : null,
|
|
9585
|
-
hasChildren ? /* @__PURE__ */
|
|
9709
|
+
hasChildren ? /* @__PURE__ */ jsx62(
|
|
9586
9710
|
"span",
|
|
9587
9711
|
{
|
|
9588
9712
|
className: "nu-tree-list-view__expander",
|
|
9589
9713
|
"data-connector": depth > 0 ? "lead" : void 0,
|
|
9590
|
-
children: /* @__PURE__ */
|
|
9714
|
+
children: /* @__PURE__ */ jsx62(
|
|
9591
9715
|
"button",
|
|
9592
9716
|
{
|
|
9593
9717
|
"aria-label": isExpanded ? "Collapse item" : "Expand item",
|
|
@@ -9595,7 +9719,7 @@ function TreeListViewRowInner({
|
|
|
9595
9719
|
onClick: handleToggleExpanded,
|
|
9596
9720
|
tabIndex: -1,
|
|
9597
9721
|
type: "button",
|
|
9598
|
-
children: /* @__PURE__ */
|
|
9722
|
+
children: /* @__PURE__ */ jsx62(
|
|
9599
9723
|
NuGlyph,
|
|
9600
9724
|
{
|
|
9601
9725
|
name: isExpanded ? "tree-caret-down" : "tree-caret-right"
|
|
@@ -9604,7 +9728,7 @@ function TreeListViewRowInner({
|
|
|
9604
9728
|
}
|
|
9605
9729
|
)
|
|
9606
9730
|
}
|
|
9607
|
-
) : depth > 0 ? /* @__PURE__ */
|
|
9731
|
+
) : depth > 0 ? /* @__PURE__ */ jsx62(
|
|
9608
9732
|
"span",
|
|
9609
9733
|
{
|
|
9610
9734
|
className: "nu-tree-list-view__expander-placeholder",
|
|
@@ -9615,8 +9739,8 @@ function TreeListViewRowInner({
|
|
|
9615
9739
|
}
|
|
9616
9740
|
)
|
|
9617
9741
|
] }),
|
|
9618
|
-
/* @__PURE__ */
|
|
9619
|
-
isCheckable ? /* @__PURE__ */
|
|
9742
|
+
/* @__PURE__ */ jsxs40("span", { className: "nu-tree-list-view__tree-content", children: [
|
|
9743
|
+
isCheckable ? /* @__PURE__ */ jsx62("span", { className: "nu-tree-list-view__check-slot", children: /* @__PURE__ */ jsx62(
|
|
9620
9744
|
"button",
|
|
9621
9745
|
{
|
|
9622
9746
|
"aria-label": isChecked ? "Uncheck item" : "Check item",
|
|
@@ -9624,12 +9748,12 @@ function TreeListViewRowInner({
|
|
|
9624
9748
|
onClick: handleToggleChecked,
|
|
9625
9749
|
tabIndex: -1,
|
|
9626
9750
|
type: "button",
|
|
9627
|
-
children: /* @__PURE__ */
|
|
9751
|
+
children: /* @__PURE__ */ jsx62(
|
|
9628
9752
|
"span",
|
|
9629
9753
|
{
|
|
9630
9754
|
className: "nu-tree-list-view__check-box",
|
|
9631
9755
|
"data-unchecked-shape": uncheckedShape,
|
|
9632
|
-
children: isChecked ? /* @__PURE__ */
|
|
9756
|
+
children: isChecked ? /* @__PURE__ */ jsx62(
|
|
9633
9757
|
NuGlyph,
|
|
9634
9758
|
{
|
|
9635
9759
|
className: "nu-tree-list-view__check-mark",
|
|
@@ -9640,13 +9764,13 @@ function TreeListViewRowInner({
|
|
|
9640
9764
|
)
|
|
9641
9765
|
}
|
|
9642
9766
|
) }) : null,
|
|
9643
|
-
item.icon ? /* @__PURE__ */
|
|
9767
|
+
item.icon ? /* @__PURE__ */ jsx62("span", { className: "nu-tree-list-view__icon", children: item.icon }) : null,
|
|
9644
9768
|
renderTreeTitleContent(item)
|
|
9645
9769
|
] })
|
|
9646
9770
|
]
|
|
9647
9771
|
},
|
|
9648
9772
|
column.id
|
|
9649
|
-
) : /* @__PURE__ */
|
|
9773
|
+
) : /* @__PURE__ */ jsx62(
|
|
9650
9774
|
"span",
|
|
9651
9775
|
{
|
|
9652
9776
|
className: [
|
|
@@ -9669,7 +9793,7 @@ function TreeListViewRowInner({
|
|
|
9669
9793
|
)
|
|
9670
9794
|
}
|
|
9671
9795
|
),
|
|
9672
|
-
hasChildren && isExpanded ? /* @__PURE__ */
|
|
9796
|
+
hasChildren && isExpanded ? /* @__PURE__ */ jsx62("div", { role: "rowgroup", children: (item.children ?? []).map((child, index) => /* @__PURE__ */ jsx62(
|
|
9673
9797
|
TreeListViewRow,
|
|
9674
9798
|
{
|
|
9675
9799
|
activeItemId,
|
|
@@ -9716,7 +9840,7 @@ var TreeListViewRow = memo5(
|
|
|
9716
9840
|
);
|
|
9717
9841
|
|
|
9718
9842
|
// src/components/TreeListView/TreeListView.tsx
|
|
9719
|
-
import { jsx as
|
|
9843
|
+
import { jsx as jsx63, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
9720
9844
|
function TreeListViewInner({
|
|
9721
9845
|
acceptsDrop,
|
|
9722
9846
|
activeItemId: activeItemIdProp,
|
|
@@ -9743,23 +9867,23 @@ function TreeListViewInner({
|
|
|
9743
9867
|
uncheckedShape = "box",
|
|
9744
9868
|
...props
|
|
9745
9869
|
}, ref) {
|
|
9746
|
-
const rootRef =
|
|
9747
|
-
const [rootElement, setRootElement] =
|
|
9870
|
+
const rootRef = useRef23(null);
|
|
9871
|
+
const [rootElement, setRootElement] = useState31(null);
|
|
9748
9872
|
const treeId = useId17();
|
|
9749
|
-
const itemRefs =
|
|
9750
|
-
const resizeFrameRef =
|
|
9751
|
-
const resizeStateRef =
|
|
9873
|
+
const itemRefs = useRef23({});
|
|
9874
|
+
const resizeFrameRef = useRef23(null);
|
|
9875
|
+
const resizeStateRef = useRef23(null);
|
|
9752
9876
|
const isExpandedControlled = expandedIds !== void 0;
|
|
9753
|
-
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] =
|
|
9877
|
+
const [uncontrolledExpandedIds, setUncontrolledExpandedIds] = useState31(() => {
|
|
9754
9878
|
const expandedFromData = collectExpandedTreeListIds(data);
|
|
9755
9879
|
if (!defaultExpandedIds?.length) {
|
|
9756
9880
|
return expandedFromData;
|
|
9757
9881
|
}
|
|
9758
9882
|
return Array.from(/* @__PURE__ */ new Set([...expandedFromData, ...defaultExpandedIds]));
|
|
9759
9883
|
});
|
|
9760
|
-
const [uncontrolledSelectedId, setUncontrolledSelectedId] =
|
|
9761
|
-
const [autoColumnWidths, setAutoColumnWidths] =
|
|
9762
|
-
const [userColumnWidths, setUserColumnWidths] =
|
|
9884
|
+
const [uncontrolledSelectedId, setUncontrolledSelectedId] = useState31(null);
|
|
9885
|
+
const [autoColumnWidths, setAutoColumnWidths] = useState31({});
|
|
9886
|
+
const [userColumnWidths, setUserColumnWidths] = useState31({});
|
|
9763
9887
|
const isActiveControlled = activeItemIdProp !== void 0;
|
|
9764
9888
|
const resolvedExpandedIds = isExpandedControlled ? expandedIds : uncontrolledExpandedIds;
|
|
9765
9889
|
const expandedIdSet = useMemo20(
|
|
@@ -9776,7 +9900,7 @@ function TreeListViewInner({
|
|
|
9776
9900
|
);
|
|
9777
9901
|
const derivedSelectedId = selectedId ?? uncontrolledSelectedId ?? findSelectedTreeListItemId(data) ?? selectableItems[0]?.itemId ?? null;
|
|
9778
9902
|
const resolvedSelectedId = derivedSelectedId && selectableItems.some((entry) => entry.itemId === derivedSelectedId) ? derivedSelectedId : selectableItems[0]?.itemId ?? null;
|
|
9779
|
-
const [uncontrolledActiveItemId, setUncontrolledActiveItemId] =
|
|
9903
|
+
const [uncontrolledActiveItemId, setUncontrolledActiveItemId] = useState31(() => defaultActiveItemId ?? resolvedSelectedId);
|
|
9780
9904
|
const activeItemId = activeItemIdProp !== void 0 ? activeItemIdProp : uncontrolledActiveItemId;
|
|
9781
9905
|
const resolvedActiveItemId = activeItemId && selectableItems.some((entry) => entry.itemId === activeItemId) ? activeItemId : resolvedSelectedId;
|
|
9782
9906
|
const minColumnWidthById = useMemo20(
|
|
@@ -9835,7 +9959,7 @@ function TreeListViewInner({
|
|
|
9835
9959
|
(item) => onItemDoubleClick?.(item),
|
|
9836
9960
|
[onItemDoubleClick]
|
|
9837
9961
|
);
|
|
9838
|
-
|
|
9962
|
+
useLayoutEffect6(() => {
|
|
9839
9963
|
const rootNode = rootRef.current;
|
|
9840
9964
|
if (!rootNode) {
|
|
9841
9965
|
return;
|
|
@@ -10160,7 +10284,7 @@ function TreeListViewInner({
|
|
|
10160
10284
|
window.addEventListener("pointermove", handleColumnResizeMove);
|
|
10161
10285
|
window.addEventListener("pointerup", handleColumnResizeEnd);
|
|
10162
10286
|
}
|
|
10163
|
-
return /* @__PURE__ */
|
|
10287
|
+
return /* @__PURE__ */ jsxs41(
|
|
10164
10288
|
"div",
|
|
10165
10289
|
{
|
|
10166
10290
|
...props,
|
|
@@ -10172,7 +10296,7 @@ function TreeListViewInner({
|
|
|
10172
10296
|
role: "treegrid",
|
|
10173
10297
|
tabIndex: 0,
|
|
10174
10298
|
children: [
|
|
10175
|
-
/* @__PURE__ */
|
|
10299
|
+
/* @__PURE__ */ jsx63(
|
|
10176
10300
|
"div",
|
|
10177
10301
|
{
|
|
10178
10302
|
className: "nu-tree-list-view__header",
|
|
@@ -10180,7 +10304,7 @@ function TreeListViewInner({
|
|
|
10180
10304
|
style: {
|
|
10181
10305
|
"--nu-tree-list-view-columns": templateColumns
|
|
10182
10306
|
},
|
|
10183
|
-
children: columns.map((column, columnIndex) => /* @__PURE__ */
|
|
10307
|
+
children: columns.map((column, columnIndex) => /* @__PURE__ */ jsxs41(
|
|
10184
10308
|
"span",
|
|
10185
10309
|
{
|
|
10186
10310
|
className: [
|
|
@@ -10191,8 +10315,8 @@ function TreeListViewInner({
|
|
|
10191
10315
|
"data-column-id": column.id,
|
|
10192
10316
|
role: "columnheader",
|
|
10193
10317
|
children: [
|
|
10194
|
-
/* @__PURE__ */
|
|
10195
|
-
column.resizable !== false ? /* @__PURE__ */
|
|
10318
|
+
/* @__PURE__ */ jsx63("span", { className: "nu-tree-list-view__header-label", children: renderMnemonicText(column.title) }),
|
|
10319
|
+
column.resizable !== false ? /* @__PURE__ */ jsx63(
|
|
10196
10320
|
"button",
|
|
10197
10321
|
{
|
|
10198
10322
|
"aria-label": `Resize ${column.title} column`,
|
|
@@ -10208,7 +10332,7 @@ function TreeListViewInner({
|
|
|
10208
10332
|
))
|
|
10209
10333
|
}
|
|
10210
10334
|
),
|
|
10211
|
-
/* @__PURE__ */
|
|
10335
|
+
/* @__PURE__ */ jsx63("div", { className: "nu-tree-list-view__body", children: visibleItems.length > 0 ? data.map((item, index) => /* @__PURE__ */ jsx63(
|
|
10212
10336
|
TreeListViewRow,
|
|
10213
10337
|
{
|
|
10214
10338
|
activeItemId: resolvedActiveItemId,
|
|
@@ -10238,7 +10362,7 @@ function TreeListViewInner({
|
|
|
10238
10362
|
uncheckedShape
|
|
10239
10363
|
},
|
|
10240
10364
|
item.id
|
|
10241
|
-
)) : /* @__PURE__ */
|
|
10365
|
+
)) : /* @__PURE__ */ jsx63("div", { className: "nu-tree-list-view__empty", children: emptyText }) })
|
|
10242
10366
|
]
|
|
10243
10367
|
}
|
|
10244
10368
|
);
|
|
@@ -10250,7 +10374,7 @@ import {
|
|
|
10250
10374
|
useCallback as useCallback9,
|
|
10251
10375
|
useId as useId18,
|
|
10252
10376
|
useMemo as useMemo21,
|
|
10253
|
-
useState as
|
|
10377
|
+
useState as useState32
|
|
10254
10378
|
} from "react";
|
|
10255
10379
|
|
|
10256
10380
|
// src/theme/themes.ts
|
|
@@ -10480,6 +10604,8 @@ function getNuThemeStyle(theme) {
|
|
|
10480
10604
|
"--nu-color-button-face-alt": theme.tokens.buttonFaceAlt,
|
|
10481
10605
|
"--nu-color-button-danger": theme.tokens.buttonDanger,
|
|
10482
10606
|
"--nu-color-button-success": theme.tokens.buttonSuccess,
|
|
10607
|
+
"--nu-text-danger": theme.tokens.buttonDanger,
|
|
10608
|
+
"--nu-text-success": theme.tokens.buttonSuccess,
|
|
10483
10609
|
"--nu-color-button-text": theme.tokens.buttonText,
|
|
10484
10610
|
"--nu-color-field-bg": theme.tokens.fieldBackground,
|
|
10485
10611
|
"--nu-color-field-text": theme.tokens.fieldText,
|
|
@@ -10541,7 +10667,7 @@ function useNuTheme() {
|
|
|
10541
10667
|
}
|
|
10542
10668
|
|
|
10543
10669
|
// src/theme/NuThemeProvider.tsx
|
|
10544
|
-
import { jsx as
|
|
10670
|
+
import { jsx as jsx64, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
10545
10671
|
function NuThemeProvider({
|
|
10546
10672
|
children,
|
|
10547
10673
|
className,
|
|
@@ -10561,10 +10687,10 @@ function NuThemeProvider({
|
|
|
10561
10687
|
theme
|
|
10562
10688
|
}) {
|
|
10563
10689
|
const generatedId = useId18();
|
|
10564
|
-
const [internalTheme, setInternalTheme] =
|
|
10565
|
-
const [internalDesktopPatternMode, setInternalDesktopPatternMode] =
|
|
10566
|
-
const [internalFontFamily, setInternalFontFamily] =
|
|
10567
|
-
const [internalFontSize, setInternalFontSize] =
|
|
10690
|
+
const [internalTheme, setInternalTheme] = useState32(defaultTheme);
|
|
10691
|
+
const [internalDesktopPatternMode, setInternalDesktopPatternMode] = useState32(defaultDesktopPatternMode);
|
|
10692
|
+
const [internalFontFamily, setInternalFontFamily] = useState32(defaultFontFamily);
|
|
10693
|
+
const [internalFontSize, setInternalFontSize] = useState32(defaultFontSize);
|
|
10568
10694
|
const currentTheme = theme ?? internalTheme;
|
|
10569
10695
|
const resolvedDesktopPatternMode = desktopPatternMode ?? internalDesktopPatternMode;
|
|
10570
10696
|
const resolvedFontFamily = fontFamily ?? internalFontFamily;
|
|
@@ -10632,7 +10758,7 @@ function NuThemeProvider({
|
|
|
10632
10758
|
handleThemeChange
|
|
10633
10759
|
]
|
|
10634
10760
|
);
|
|
10635
|
-
return /* @__PURE__ */
|
|
10761
|
+
return /* @__PURE__ */ jsx64(NuThemeContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs42(
|
|
10636
10762
|
"div",
|
|
10637
10763
|
{
|
|
10638
10764
|
className: ["nu-theme-root", className].filter(Boolean).join(" "),
|
|
@@ -10647,7 +10773,7 @@ function NuThemeProvider({
|
|
|
10647
10773
|
...style
|
|
10648
10774
|
},
|
|
10649
10775
|
children: [
|
|
10650
|
-
crtGlitch ? /* @__PURE__ */
|
|
10776
|
+
crtGlitch ? /* @__PURE__ */ jsx64(NuCrtGlitch, { ...typeof crtGlitch === "object" ? crtGlitch : {} }) : null,
|
|
10651
10777
|
children
|
|
10652
10778
|
]
|
|
10653
10779
|
}
|
|
@@ -10692,6 +10818,7 @@ export {
|
|
|
10692
10818
|
RadioGroup,
|
|
10693
10819
|
ReportCell,
|
|
10694
10820
|
SearchBox,
|
|
10821
|
+
Spacer,
|
|
10695
10822
|
SpinBox,
|
|
10696
10823
|
Splitter,
|
|
10697
10824
|
Stack,
|
|
@@ -10715,6 +10842,7 @@ export {
|
|
|
10715
10842
|
hasVisibleMainMenuItems,
|
|
10716
10843
|
isMainMenuDivider,
|
|
10717
10844
|
isMainMenuItem,
|
|
10845
|
+
isMainMenuSpacer,
|
|
10718
10846
|
isNuThemeName,
|
|
10719
10847
|
nuThemes,
|
|
10720
10848
|
resolveNuTheme,
|