@dxos/react-ui 0.9.0 → 0.9.1-main.c7dcc2e112
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/lib/browser/{chunk-7JFD5ZHZ.mjs → chunk-F3PLXTDA.mjs} +21 -25
- package/dist/lib/browser/{chunk-7JFD5ZHZ.mjs.map → chunk-F3PLXTDA.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-5SPBSIWS.mjs → chunk-HFJYTGHU.mjs} +11 -1
- package/dist/lib/browser/chunk-HFJYTGHU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1042 -856
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +5 -5
- package/dist/lib/browser/testing/index.mjs.map +2 -2
- package/dist/lib/browser/translations.mjs +1 -1
- package/dist/lib/node-esm/{chunk-TTEL2FP2.mjs → chunk-LLVUYLAM.mjs} +21 -25
- package/dist/lib/node-esm/{chunk-TTEL2FP2.mjs.map → chunk-LLVUYLAM.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-FPVTVXND.mjs → chunk-OJYUPUCY.mjs} +11 -1
- package/dist/lib/node-esm/chunk-OJYUPUCY.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1042 -856
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +5 -5
- package/dist/lib/node-esm/testing/index.mjs.map +2 -2
- package/dist/lib/node-esm/translations.mjs +1 -1
- package/dist/types/src/components/Button/Button.d.ts +2 -0
- package/dist/types/src/components/Button/Button.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.d.ts +0 -1
- package/dist/types/src/components/Button/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.stories.d.ts +34 -0
- package/dist/types/src/components/Button/IconButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/SystemIconButton.d.ts +20 -0
- package/dist/types/src/components/Button/SystemIconButton.d.ts.map +1 -0
- package/dist/types/src/components/Button/ToggleIconButton.d.ts +15 -0
- package/dist/types/src/components/Button/ToggleIconButton.d.ts.map +1 -0
- package/dist/types/src/components/Button/index.d.ts +2 -0
- package/dist/types/src/components/Button/index.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.d.ts +25 -19
- package/dist/types/src/components/Card/Card.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.stories.d.ts +1 -1
- package/dist/types/src/components/Card/Card.stories.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.theme.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +1 -0
- package/dist/types/src/components/Clipboard/index.d.ts.map +1 -1
- package/dist/types/src/components/Column/Column.d.ts +19 -1
- package/dist/types/src/components/Column/Column.d.ts.map +1 -1
- package/dist/types/src/components/Column/Column.theme.d.ts +8 -0
- package/dist/types/src/components/Column/Column.theme.d.ts.map +1 -1
- package/dist/types/src/components/Input/constants.d.ts +3 -0
- package/dist/types/src/components/Input/constants.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.theme.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.theme.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/TextTooltip.d.ts +19 -0
- package/dist/types/src/components/Tooltip/TextTooltip.d.ts.map +1 -0
- package/dist/types/src/components/Tooltip/index.d.ts +1 -0
- package/dist/types/src/components/Tooltip/index.d.ts.map +1 -1
- package/dist/types/src/testing/Loading.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +10 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -16
- package/src/components/Button/Button.tsx +23 -2
- package/src/components/Button/IconButton.stories.tsx +81 -1
- package/src/components/Button/IconButton.tsx +2 -4
- package/src/components/Button/SystemIconButton.tsx +153 -0
- package/src/components/Button/ToggleIconButton.tsx +32 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Card/Card.stories.tsx +69 -27
- package/src/components/Card/Card.theme.ts +27 -9
- package/src/components/Card/Card.tsx +165 -88
- package/src/components/Column/Column.theme.ts +32 -4
- package/src/components/Column/Column.tsx +36 -1
- package/src/components/Input/constants.ts +3 -0
- package/src/components/Message/Message.theme.ts +0 -10
- package/src/components/Message/Message.tsx +4 -4
- package/src/components/Popover/Popover.theme.ts +1 -1
- package/src/components/Toast/Toast.theme.ts +0 -6
- package/src/components/Toast/Toast.tsx +11 -10
- package/src/components/Tooltip/TextTooltip.tsx +54 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/testing/Loading.tsx +2 -1
- package/src/testing/decorators/withLayout.tsx +2 -2
- package/src/translations.ts +10 -0
- package/dist/lib/browser/chunk-5SPBSIWS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FPVTVXND.mjs.map +0 -7
|
@@ -53,10 +53,10 @@ import {
|
|
|
53
53
|
useTooltipContext,
|
|
54
54
|
useTranslation,
|
|
55
55
|
withColumn
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-F3PLXTDA.mjs";
|
|
57
57
|
import {
|
|
58
58
|
translationKey
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-HFJYTGHU.mjs";
|
|
60
60
|
|
|
61
61
|
// src/index.ts
|
|
62
62
|
import { Trans } from "react-i18next";
|
|
@@ -483,7 +483,7 @@ var BUTTON_NAME = "Button";
|
|
|
483
483
|
var [ButtonGroupProvider, useButtonGroupContext] = createContext2(BUTTON_GROUP_NAME, {
|
|
484
484
|
inGroup: false
|
|
485
485
|
});
|
|
486
|
-
var Button = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef7(({ classNames, children, density: densityProp, elevation: elevationProp, variant = "default", asChild, ...props }, ref) => {
|
|
486
|
+
var Button = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef7(({ classNames, children, density: densityProp, elevation: elevationProp, variant = "default", asChild, caretDown, ...props }, ref) => {
|
|
487
487
|
const { inGroup } = useButtonGroupContext(BUTTON_NAME);
|
|
488
488
|
const { tx } = useThemeContext();
|
|
489
489
|
const elevation = useElevationContext(elevationProp);
|
|
@@ -505,7 +505,10 @@ var Button = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef7(({ classNames, ch
|
|
|
505
505
|
...props.disabled && {
|
|
506
506
|
disabled: true
|
|
507
507
|
}
|
|
508
|
-
}, children
|
|
508
|
+
}, caretDown && !asChild ? /* @__PURE__ */ React9.createElement(React9.Fragment, null, children, /* @__PURE__ */ React9.createElement(Icon, {
|
|
509
|
+
size: 3,
|
|
510
|
+
icon: "ph--caret-down--bold"
|
|
511
|
+
})) : children);
|
|
509
512
|
}));
|
|
510
513
|
Button.displayName = BUTTON_NAME;
|
|
511
514
|
var ButtonGroup = /* @__PURE__ */ forwardRef7(({ children, elevation: propsElevation, classNames, asChild, ...props }, forwardedRef) => {
|
|
@@ -525,65 +528,192 @@ var ButtonGroup = /* @__PURE__ */ forwardRef7(({ children, elevation: propsEleva
|
|
|
525
528
|
ButtonGroup.displayName = BUTTON_GROUP_NAME;
|
|
526
529
|
|
|
527
530
|
// src/components/Button/IconButton.tsx
|
|
528
|
-
import
|
|
529
|
-
|
|
531
|
+
import React11, { forwardRef as forwardRef9 } from "react";
|
|
532
|
+
|
|
533
|
+
// src/components/Tooltip/TextTooltip.tsx
|
|
534
|
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
535
|
+
import React10, { forwardRef as forwardRef8, useCallback as useCallback3, useRef } from "react";
|
|
536
|
+
var TextTooltip = /* @__PURE__ */ forwardRef8(({ __scopeTooltip, text, children, onlyWhenTruncating, asChild = true, side, truncateQuery, ...props }, forwardedRef) => {
|
|
537
|
+
const content = useRef(null);
|
|
538
|
+
const ref = useComposedRefs(content, forwardedRef);
|
|
539
|
+
const handleInteract = useCallback3((event) => {
|
|
540
|
+
if (onlyWhenTruncating && content.current) {
|
|
541
|
+
const element = truncateQuery ? content.current.querySelector(truncateQuery) : content.current;
|
|
542
|
+
if (!element || element.scrollWidth <= element.offsetWidth) {
|
|
543
|
+
event.preventDefault();
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}, [
|
|
547
|
+
onlyWhenTruncating,
|
|
548
|
+
truncateQuery
|
|
549
|
+
]);
|
|
550
|
+
return /* @__PURE__ */ React10.createElement(Tooltip.Trigger, {
|
|
551
|
+
asChild,
|
|
552
|
+
...props,
|
|
553
|
+
content: text,
|
|
554
|
+
side,
|
|
555
|
+
onInteract: handleInteract,
|
|
556
|
+
ref
|
|
557
|
+
}, children);
|
|
558
|
+
});
|
|
559
|
+
|
|
560
|
+
// src/components/Button/IconButton.tsx
|
|
561
|
+
var IconButton = /* @__PURE__ */ forwardRef9((props, forwardedRef) => props.iconOnly ? /* @__PURE__ */ React11.createElement(IconOnlyButton, {
|
|
530
562
|
...props,
|
|
531
563
|
ref: forwardedRef
|
|
532
|
-
}) : /* @__PURE__ */
|
|
564
|
+
}) : /* @__PURE__ */ React11.createElement(LabelledIconButton, {
|
|
533
565
|
...props,
|
|
534
566
|
ref: forwardedRef
|
|
535
567
|
}));
|
|
536
|
-
var IconOnlyButton = /* @__PURE__ */
|
|
568
|
+
var IconOnlyButton = /* @__PURE__ */ forwardRef9(({ noTooltip, tooltipSide, ...props }, forwardedRef) => {
|
|
537
569
|
if (noTooltip) {
|
|
538
|
-
return /* @__PURE__ */
|
|
570
|
+
return /* @__PURE__ */ React11.createElement(LabelledIconButton, {
|
|
539
571
|
...props,
|
|
540
572
|
ref: forwardedRef
|
|
541
573
|
});
|
|
542
574
|
}
|
|
543
|
-
return /* @__PURE__ */
|
|
575
|
+
return /* @__PURE__ */ React11.createElement(Tooltip.Trigger, {
|
|
544
576
|
asChild: true,
|
|
545
577
|
content: props.label,
|
|
546
578
|
side: tooltipSide
|
|
547
|
-
}, /* @__PURE__ */
|
|
579
|
+
}, /* @__PURE__ */ React11.createElement(LabelledIconButton, {
|
|
548
580
|
...props,
|
|
549
581
|
ref: forwardedRef
|
|
550
582
|
}));
|
|
551
583
|
});
|
|
552
|
-
var LabelledIconButton = /* @__PURE__ */
|
|
584
|
+
var LabelledIconButton = /* @__PURE__ */ forwardRef9(({ size, icon, iconOnly, square, iconEnd, iconClassNames, label, noTooltip: _, classNames, ...props }, forwardedRef) => {
|
|
553
585
|
const { tx } = useThemeContext();
|
|
554
|
-
return /* @__PURE__ */
|
|
586
|
+
return /* @__PURE__ */ React11.createElement(Button, {
|
|
555
587
|
...props,
|
|
556
588
|
classNames: tx("iconButton.root", {
|
|
557
589
|
iconOnly,
|
|
558
590
|
square
|
|
559
591
|
}, classNames),
|
|
560
592
|
ref: forwardedRef
|
|
561
|
-
}, icon && !iconEnd && /* @__PURE__ */
|
|
593
|
+
}, icon && !iconEnd && /* @__PURE__ */ React11.createElement(Icon, {
|
|
562
594
|
icon,
|
|
563
595
|
size,
|
|
564
596
|
classNames: iconClassNames
|
|
565
|
-
}), /* @__PURE__ */
|
|
597
|
+
}), /* @__PURE__ */ React11.createElement("span", {
|
|
566
598
|
className: iconOnly ? "sr-only" : void 0
|
|
567
|
-
}, label), icon && iconEnd && /* @__PURE__ */
|
|
599
|
+
}, label), icon && iconEnd && /* @__PURE__ */ React11.createElement(Icon, {
|
|
568
600
|
icon,
|
|
569
601
|
size,
|
|
570
602
|
classNames: iconClassNames
|
|
571
|
-
}), caretDown && /* @__PURE__ */ React10.createElement(Icon, {
|
|
572
|
-
size: 3,
|
|
573
|
-
icon: "ph--caret-down--bold"
|
|
574
603
|
}));
|
|
575
604
|
});
|
|
576
605
|
|
|
606
|
+
// src/components/Button/SystemIconButton.tsx
|
|
607
|
+
import React13, { forwardRef as forwardRef11 } from "react";
|
|
608
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
609
|
+
import { translationKey as translationKey2 } from "#translations";
|
|
610
|
+
|
|
611
|
+
// src/components/Button/ToggleIconButton.tsx
|
|
612
|
+
import React12, { forwardRef as forwardRef10 } from "react";
|
|
613
|
+
import { mx as mx6 } from "@dxos/ui-theme";
|
|
614
|
+
var ToggleIconButton = /* @__PURE__ */ forwardRef10(({ active, icon, activeIcon, iconClassNames, ...props }, forwardedRef) => /* @__PURE__ */ React12.createElement(IconButton, {
|
|
615
|
+
...props,
|
|
616
|
+
ref: forwardedRef,
|
|
617
|
+
icon: active && activeIcon ? activeIcon : icon,
|
|
618
|
+
iconClassNames: activeIcon ? iconClassNames : mx6("transition-transform", active && "rotate-90", iconClassNames)
|
|
619
|
+
}));
|
|
620
|
+
|
|
621
|
+
// src/components/Button/SystemIconButton.tsx
|
|
622
|
+
var StarIconButton = /* @__PURE__ */ forwardRef11(({ label, active, ...props }, forwardedRef) => {
|
|
623
|
+
const { t } = useTranslation2(translationKey2);
|
|
624
|
+
return /* @__PURE__ */ React13.createElement(ToggleIconButton, {
|
|
625
|
+
...props,
|
|
626
|
+
active,
|
|
627
|
+
icon: "ph--star--regular",
|
|
628
|
+
activeIcon: "ph--star--fill",
|
|
629
|
+
label: label ?? t(active ? "system-button.unstar.label" : "system-button.star.label"),
|
|
630
|
+
ref: forwardedRef
|
|
631
|
+
});
|
|
632
|
+
});
|
|
633
|
+
StarIconButton.displayName = "SystemIconButton.Star";
|
|
634
|
+
var BookmarkIconButton = /* @__PURE__ */ forwardRef11(({ label, active, ...props }, forwardedRef) => {
|
|
635
|
+
const { t } = useTranslation2(translationKey2);
|
|
636
|
+
return /* @__PURE__ */ React13.createElement(ToggleIconButton, {
|
|
637
|
+
...props,
|
|
638
|
+
active,
|
|
639
|
+
icon: "ph--bookmark-simple--regular",
|
|
640
|
+
activeIcon: "ph--bookmark-simple--fill",
|
|
641
|
+
label: label ?? t(active ? "system-button.unbookmark.label" : "system-button.bookmark.label"),
|
|
642
|
+
ref: forwardedRef
|
|
643
|
+
});
|
|
644
|
+
});
|
|
645
|
+
BookmarkIconButton.displayName = "SystemIconButton.Bookmark";
|
|
646
|
+
var ExpanderIconButton = /* @__PURE__ */ forwardRef11(({ label, active, ...props }, forwardedRef) => {
|
|
647
|
+
const { t } = useTranslation2(translationKey2);
|
|
648
|
+
return /* @__PURE__ */ React13.createElement(ToggleIconButton, {
|
|
649
|
+
...props,
|
|
650
|
+
active,
|
|
651
|
+
icon: "ph--caret-right--regular",
|
|
652
|
+
label: label ?? t(active ? "system-button.collapse.label" : "system-button.expand.label"),
|
|
653
|
+
ref: forwardedRef
|
|
654
|
+
});
|
|
655
|
+
});
|
|
656
|
+
ExpanderIconButton.displayName = "SystemIconButton.Expander";
|
|
657
|
+
var AddIconButton = /* @__PURE__ */ forwardRef11(({ label, ...props }, forwardedRef) => {
|
|
658
|
+
const { t } = useTranslation2(translationKey2);
|
|
659
|
+
return /* @__PURE__ */ React13.createElement(IconButton, {
|
|
660
|
+
...props,
|
|
661
|
+
icon: "ph--plus--regular",
|
|
662
|
+
label: label ?? t("system-button.add.label"),
|
|
663
|
+
ref: forwardedRef
|
|
664
|
+
});
|
|
665
|
+
});
|
|
666
|
+
AddIconButton.displayName = "SystemIconButton.Add";
|
|
667
|
+
var DeleteIconButton = /* @__PURE__ */ forwardRef11(({ label, ...props }, forwardedRef) => {
|
|
668
|
+
const { t } = useTranslation2(translationKey2);
|
|
669
|
+
return /* @__PURE__ */ React13.createElement(IconButton, {
|
|
670
|
+
...props,
|
|
671
|
+
icon: "ph--trash--regular",
|
|
672
|
+
label: label ?? t("system-button.delete.label"),
|
|
673
|
+
ref: forwardedRef
|
|
674
|
+
});
|
|
675
|
+
});
|
|
676
|
+
DeleteIconButton.displayName = "SystemIconButton.Delete";
|
|
677
|
+
var EditIconButton = /* @__PURE__ */ forwardRef11(({ label, ...props }, forwardedRef) => {
|
|
678
|
+
const { t } = useTranslation2(translationKey2);
|
|
679
|
+
return /* @__PURE__ */ React13.createElement(IconButton, {
|
|
680
|
+
...props,
|
|
681
|
+
icon: "ph--pen--regular",
|
|
682
|
+
label: label ?? t("system-button.edit.label"),
|
|
683
|
+
ref: forwardedRef
|
|
684
|
+
});
|
|
685
|
+
});
|
|
686
|
+
EditIconButton.displayName = "SystemIconButton.Edit";
|
|
687
|
+
var CloseIconButton = /* @__PURE__ */ forwardRef11(({ label, ...props }, forwardedRef) => {
|
|
688
|
+
const { t } = useTranslation2(translationKey2);
|
|
689
|
+
return /* @__PURE__ */ React13.createElement(IconButton, {
|
|
690
|
+
...props,
|
|
691
|
+
icon: "ph--x--regular",
|
|
692
|
+
label: label ?? t("system-button.close.label"),
|
|
693
|
+
ref: forwardedRef
|
|
694
|
+
});
|
|
695
|
+
});
|
|
696
|
+
CloseIconButton.displayName = "SystemIconButton.Close";
|
|
697
|
+
var SystemIconButton = {
|
|
698
|
+
Star: StarIconButton,
|
|
699
|
+
Bookmark: BookmarkIconButton,
|
|
700
|
+
Expander: ExpanderIconButton,
|
|
701
|
+
Add: AddIconButton,
|
|
702
|
+
Delete: DeleteIconButton,
|
|
703
|
+
Edit: EditIconButton,
|
|
704
|
+
Close: CloseIconButton
|
|
705
|
+
};
|
|
706
|
+
|
|
577
707
|
// src/components/Button/Toggle.tsx
|
|
578
708
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
579
|
-
import
|
|
580
|
-
var Toggle = /* @__PURE__ */
|
|
581
|
-
return /* @__PURE__ */
|
|
709
|
+
import React14, { forwardRef as forwardRef12 } from "react";
|
|
710
|
+
var Toggle = /* @__PURE__ */ forwardRef12(({ defaultPressed, pressed, onPressedChange, ...props }, forwardedRef) => {
|
|
711
|
+
return /* @__PURE__ */ React14.createElement(TogglePrimitive.Root, {
|
|
582
712
|
defaultPressed,
|
|
583
713
|
pressed,
|
|
584
714
|
onPressedChange,
|
|
585
715
|
asChild: true
|
|
586
|
-
}, /* @__PURE__ */
|
|
716
|
+
}, /* @__PURE__ */ React14.createElement(Button, {
|
|
587
717
|
...props,
|
|
588
718
|
ref: forwardedRef
|
|
589
719
|
}));
|
|
@@ -591,22 +721,22 @@ var Toggle = /* @__PURE__ */ forwardRef9(({ defaultPressed, pressed, onPressedCh
|
|
|
591
721
|
|
|
592
722
|
// src/components/Button/ToggleGroup.tsx
|
|
593
723
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
594
|
-
import
|
|
595
|
-
var ToggleGroup = /* @__PURE__ */
|
|
596
|
-
return /* @__PURE__ */
|
|
724
|
+
import React15, { forwardRef as forwardRef13 } from "react";
|
|
725
|
+
var ToggleGroup = /* @__PURE__ */ forwardRef13(({ classNames, children, ...props }, forwardedRef) => {
|
|
726
|
+
return /* @__PURE__ */ React15.createElement(ToggleGroupPrimitive.Root, {
|
|
597
727
|
...props,
|
|
598
728
|
asChild: true
|
|
599
|
-
}, /* @__PURE__ */
|
|
729
|
+
}, /* @__PURE__ */ React15.createElement(ButtonGroup, {
|
|
600
730
|
classNames,
|
|
601
731
|
children,
|
|
602
732
|
ref: forwardedRef
|
|
603
733
|
}));
|
|
604
734
|
});
|
|
605
|
-
var ToggleGroupItem = /* @__PURE__ */
|
|
606
|
-
return /* @__PURE__ */
|
|
735
|
+
var ToggleGroupItem = /* @__PURE__ */ forwardRef13(({ variant, elevation, density, classNames, children, ...props }, forwardedRef) => {
|
|
736
|
+
return /* @__PURE__ */ React15.createElement(ToggleGroupPrimitive.Item, {
|
|
607
737
|
...props,
|
|
608
738
|
asChild: true
|
|
609
|
-
}, /* @__PURE__ */
|
|
739
|
+
}, /* @__PURE__ */ React15.createElement(Button, {
|
|
610
740
|
variant,
|
|
611
741
|
elevation,
|
|
612
742
|
density,
|
|
@@ -615,11 +745,11 @@ var ToggleGroupItem = /* @__PURE__ */ forwardRef10(({ variant, elevation, densit
|
|
|
615
745
|
ref: forwardedRef
|
|
616
746
|
}));
|
|
617
747
|
});
|
|
618
|
-
var ToggleGroupIconItem = /* @__PURE__ */
|
|
619
|
-
return /* @__PURE__ */
|
|
748
|
+
var ToggleGroupIconItem = /* @__PURE__ */ forwardRef13(({ variant, label, icon, size, elevation, density, classNames, ...props }, forwardedRef) => {
|
|
749
|
+
return /* @__PURE__ */ React15.createElement(ToggleGroupPrimitive.Item, {
|
|
620
750
|
...props,
|
|
621
751
|
asChild: true
|
|
622
|
-
}, /* @__PURE__ */
|
|
752
|
+
}, /* @__PURE__ */ React15.createElement(IconButton, {
|
|
623
753
|
variant,
|
|
624
754
|
elevation,
|
|
625
755
|
density,
|
|
@@ -633,7 +763,7 @@ var ToggleGroupIconItem = /* @__PURE__ */ forwardRef10(({ variant, label, icon,
|
|
|
633
763
|
|
|
634
764
|
// src/components/Calendar/Calendar.tsx
|
|
635
765
|
import { CalendarDate, parseDate } from "@internationalized/date";
|
|
636
|
-
import
|
|
766
|
+
import React16, { forwardRef as forwardRef14 } from "react";
|
|
637
767
|
import { Button as RACButton, Calendar as RACCalendar, CalendarCell as RACCalendarCell, CalendarGrid as RACCalendarGrid, CalendarGridBody as RACCalendarGridBody, CalendarGridHeader as RACCalendarGridHeader, CalendarHeaderCell as RACCalendarHeaderCell, Heading as RACHeading, RangeCalendar as RACRangeCalendar } from "react-aria-components";
|
|
638
768
|
var toCalendarDate = (date) => {
|
|
639
769
|
if (!date) {
|
|
@@ -649,7 +779,7 @@ var fromCalendarDate = (value) => {
|
|
|
649
779
|
};
|
|
650
780
|
var CalendarShell = ({ classNames, className, isDisabled, forwardedRef, children }) => {
|
|
651
781
|
const { tx } = useThemeContext();
|
|
652
|
-
return /* @__PURE__ */
|
|
782
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
653
783
|
ref: forwardedRef,
|
|
654
784
|
className: tx("calendar.root", {}, classNames, className) ?? void 0,
|
|
655
785
|
"aria-disabled": isDisabled || void 0
|
|
@@ -657,38 +787,38 @@ var CalendarShell = ({ classNames, className, isDisabled, forwardedRef, children
|
|
|
657
787
|
};
|
|
658
788
|
var CalendarChrome = () => {
|
|
659
789
|
const { tx } = useThemeContext();
|
|
660
|
-
return /* @__PURE__ */
|
|
790
|
+
return /* @__PURE__ */ React16.createElement("header", {
|
|
661
791
|
className: tx("calendar.nav", {}) ?? void 0
|
|
662
|
-
}, /* @__PURE__ */
|
|
792
|
+
}, /* @__PURE__ */ React16.createElement(RACButton, {
|
|
663
793
|
slot: "previous",
|
|
664
794
|
className: tx("calendar.button_previous", {}) ?? void 0
|
|
665
|
-
}, /* @__PURE__ */
|
|
795
|
+
}, /* @__PURE__ */ React16.createElement(Icon, {
|
|
666
796
|
size: 4,
|
|
667
797
|
icon: "ph--caret-left--regular"
|
|
668
|
-
})), /* @__PURE__ */
|
|
798
|
+
})), /* @__PURE__ */ React16.createElement(RACHeading, {
|
|
669
799
|
className: tx("calendar.caption_label", {}) ?? void 0
|
|
670
|
-
}), /* @__PURE__ */
|
|
800
|
+
}), /* @__PURE__ */ React16.createElement(RACButton, {
|
|
671
801
|
slot: "next",
|
|
672
802
|
className: tx("calendar.button_next", {}) ?? void 0
|
|
673
|
-
}, /* @__PURE__ */
|
|
803
|
+
}, /* @__PURE__ */ React16.createElement(Icon, {
|
|
674
804
|
size: 4,
|
|
675
805
|
icon: "ph--caret-right--regular"
|
|
676
806
|
})));
|
|
677
807
|
};
|
|
678
808
|
var CalendarGridContent = () => {
|
|
679
809
|
const { tx } = useThemeContext();
|
|
680
|
-
return /* @__PURE__ */
|
|
810
|
+
return /* @__PURE__ */ React16.createElement(RACCalendarGrid, {
|
|
681
811
|
className: tx("calendar.month_grid", {}) ?? void 0
|
|
682
|
-
}, /* @__PURE__ */
|
|
812
|
+
}, /* @__PURE__ */ React16.createElement(RACCalendarGridHeader, {
|
|
683
813
|
className: tx("calendar.weekdays", {}) ?? void 0
|
|
684
|
-
}, (day) => /* @__PURE__ */
|
|
814
|
+
}, (day) => /* @__PURE__ */ React16.createElement(RACCalendarHeaderCell, {
|
|
685
815
|
className: tx("calendar.weekday", {}) ?? void 0
|
|
686
|
-
}, day)), /* @__PURE__ */
|
|
816
|
+
}, day)), /* @__PURE__ */ React16.createElement(RACCalendarGridBody, null, (date) => /* @__PURE__ */ React16.createElement(RACCalendarCell, {
|
|
687
817
|
date,
|
|
688
818
|
className: tx("calendar.day", {}) ?? void 0
|
|
689
819
|
})));
|
|
690
820
|
};
|
|
691
|
-
var CalendarRoot = /* @__PURE__ */
|
|
821
|
+
var CalendarRoot = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
692
822
|
const { classNames, className, isDisabled, minValue, maxValue, defaultMonth } = props;
|
|
693
823
|
const defaultFocused = toCalendarDate(defaultMonth) ?? void 0;
|
|
694
824
|
if (props.mode === "range") {
|
|
@@ -716,12 +846,12 @@ var CalendarRoot = /* @__PURE__ */ forwardRef11((props, forwardedRef) => {
|
|
|
716
846
|
}
|
|
717
847
|
}
|
|
718
848
|
};
|
|
719
|
-
return /* @__PURE__ */
|
|
849
|
+
return /* @__PURE__ */ React16.createElement(CalendarShell, {
|
|
720
850
|
classNames,
|
|
721
851
|
className,
|
|
722
852
|
isDisabled,
|
|
723
853
|
forwardedRef
|
|
724
|
-
}, /* @__PURE__ */
|
|
854
|
+
}, /* @__PURE__ */ React16.createElement(RACRangeCalendar, racProps2, /* @__PURE__ */ React16.createElement(CalendarChrome, null), /* @__PURE__ */ React16.createElement(CalendarGridContent, null)));
|
|
725
855
|
}
|
|
726
856
|
const racProps = {
|
|
727
857
|
isDisabled,
|
|
@@ -731,12 +861,12 @@ var CalendarRoot = /* @__PURE__ */ forwardRef11((props, forwardedRef) => {
|
|
|
731
861
|
value: toCalendarDate(props.selected),
|
|
732
862
|
onChange: (next) => props.onSelect?.(fromCalendarDate(next))
|
|
733
863
|
};
|
|
734
|
-
return /* @__PURE__ */
|
|
864
|
+
return /* @__PURE__ */ React16.createElement(CalendarShell, {
|
|
735
865
|
classNames,
|
|
736
866
|
className,
|
|
737
867
|
isDisabled,
|
|
738
868
|
forwardedRef
|
|
739
|
-
}, /* @__PURE__ */
|
|
869
|
+
}, /* @__PURE__ */ React16.createElement(RACCalendar, racProps, /* @__PURE__ */ React16.createElement(CalendarChrome, null), /* @__PURE__ */ React16.createElement(CalendarGridContent, null)));
|
|
740
870
|
});
|
|
741
871
|
CalendarRoot.displayName = "Calendar.Root";
|
|
742
872
|
var Calendar = {
|
|
@@ -744,16 +874,18 @@ var Calendar = {
|
|
|
744
874
|
};
|
|
745
875
|
|
|
746
876
|
// src/components/Card/Card.tsx
|
|
747
|
-
import { Primitive as
|
|
748
|
-
import { Slot as
|
|
877
|
+
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
878
|
+
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
749
879
|
import DOMPurify from "dompurify";
|
|
750
|
-
import
|
|
880
|
+
import React21, { forwardRef as forwardRef17, useId as useId3, useMemo as useMemo5 } from "react";
|
|
881
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
751
882
|
import { iconSize } from "@dxos/ui-theme";
|
|
883
|
+
import { translationKey as translationKey3 } from "#translations";
|
|
752
884
|
|
|
753
885
|
// src/components/Column/Column.tsx
|
|
754
886
|
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
755
887
|
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
756
|
-
import
|
|
888
|
+
import React17 from "react";
|
|
757
889
|
var COLUMN_ROOT_NAME = "Column.Root";
|
|
758
890
|
var gutterSizes = {
|
|
759
891
|
xs: "var(--dx-gutter-xs)",
|
|
@@ -766,7 +898,7 @@ var ColumnRoot = slottable(({ children, asChild, role, gutter = "md", ...props }
|
|
|
766
898
|
const Comp = asChild ? Slot7 : Primitive7.div;
|
|
767
899
|
const { tx } = useThemeContext();
|
|
768
900
|
const gutterSize = gutterSizes[gutter];
|
|
769
|
-
return /* @__PURE__ */
|
|
901
|
+
return /* @__PURE__ */ React17.createElement(Comp, {
|
|
770
902
|
...rest,
|
|
771
903
|
role: role ?? "none",
|
|
772
904
|
style: {
|
|
@@ -791,7 +923,7 @@ var ColumnRow = slottable(({ children, asChild, role, ...props }, forwardedRef)
|
|
|
791
923
|
const { className, ...rest } = composableProps(props);
|
|
792
924
|
const Comp = asChild ? Slot7 : Primitive7.div;
|
|
793
925
|
const { tx } = useThemeContext();
|
|
794
|
-
return /* @__PURE__ */
|
|
926
|
+
return /* @__PURE__ */ React17.createElement(Comp, {
|
|
795
927
|
...rest,
|
|
796
928
|
role: role ?? "none",
|
|
797
929
|
className: tx("column.row", {}, className),
|
|
@@ -804,7 +936,7 @@ var ColumnBleed = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
|
804
936
|
const { tx } = useThemeContext();
|
|
805
937
|
const { className, ...rest } = composableProps(props);
|
|
806
938
|
const Comp = asChild ? Slot7 : Primitive7.div;
|
|
807
|
-
return /* @__PURE__ */
|
|
939
|
+
return /* @__PURE__ */ React17.createElement(Comp, {
|
|
808
940
|
...rest,
|
|
809
941
|
className: tx("column.bleed", {}, className),
|
|
810
942
|
ref: forwardedRef
|
|
@@ -816,33 +948,51 @@ var ColumnCenter = slottable(({ children, asChild, ...props }, forwardedRef) =>
|
|
|
816
948
|
const { tx } = useThemeContext();
|
|
817
949
|
const { className, ...rest } = composableProps(props);
|
|
818
950
|
const Comp = asChild ? Slot7 : Primitive7.div;
|
|
819
|
-
return /* @__PURE__ */
|
|
951
|
+
return /* @__PURE__ */ React17.createElement(Comp, {
|
|
820
952
|
...rest,
|
|
821
953
|
className: tx("column.center", {}, className),
|
|
822
954
|
ref: forwardedRef
|
|
823
955
|
}, children);
|
|
824
956
|
});
|
|
825
957
|
ColumnCenter.displayName = COLUMN_CENTER_NAME;
|
|
958
|
+
var COLUMN_BLOCK_NAME = "Column.Block";
|
|
959
|
+
var ColumnBlock = slottable(({ children, asChild, end, compact, square, ...props }, forwardedRef) => {
|
|
960
|
+
const { tx } = useThemeContext();
|
|
961
|
+
const { className, ...rest } = composableProps(props);
|
|
962
|
+
const Comp = asChild ? Slot7 : Primitive7.div;
|
|
963
|
+
return /* @__PURE__ */ React17.createElement(Comp, {
|
|
964
|
+
...rest,
|
|
965
|
+
"data-slot": end ? "end" : "start",
|
|
966
|
+
className: tx("column.block", {
|
|
967
|
+
end,
|
|
968
|
+
compact,
|
|
969
|
+
square
|
|
970
|
+
}, className),
|
|
971
|
+
ref: forwardedRef
|
|
972
|
+
}, children);
|
|
973
|
+
});
|
|
974
|
+
ColumnBlock.displayName = COLUMN_BLOCK_NAME;
|
|
826
975
|
var Column = {
|
|
827
976
|
Root: ColumnRoot,
|
|
828
977
|
Row: ColumnRow,
|
|
978
|
+
Block: ColumnBlock,
|
|
829
979
|
Bleed: ColumnBleed,
|
|
830
980
|
Center: ColumnCenter
|
|
831
981
|
};
|
|
832
982
|
|
|
833
983
|
// src/components/Image/Image.tsx
|
|
834
|
-
import
|
|
835
|
-
import { mx as
|
|
984
|
+
import React18, { useCallback as useCallback4, useRef as useRef2, useState as useState3 } from "react";
|
|
985
|
+
import { mx as mx7 } from "@dxos/ui-theme";
|
|
836
986
|
var cache = /* @__PURE__ */ new Map();
|
|
837
987
|
var Image = ({ classNames, src, alt = "", fit = "contain", crossOrigin, sampleSize = 64, contrast = 0.9 }) => {
|
|
838
988
|
const [crossOriginState, setCrossOriginState] = useState3(crossOrigin);
|
|
839
989
|
const [dominantColor, setDominantColor] = useState3(void 0);
|
|
840
990
|
const [imageLoaded, setImageLoaded] = useState3(false);
|
|
841
|
-
const canvasRef =
|
|
991
|
+
const canvasRef = useRef2(null);
|
|
842
992
|
const handleImageError = () => {
|
|
843
993
|
setCrossOriginState(void 0);
|
|
844
994
|
};
|
|
845
|
-
const handleImageLoad =
|
|
995
|
+
const handleImageLoad = useCallback4(({ target }) => {
|
|
846
996
|
const rgb = cache.get(src);
|
|
847
997
|
if (rgb) {
|
|
848
998
|
setDominantColor(rgb);
|
|
@@ -872,37 +1022,37 @@ var Image = ({ classNames, src, alt = "", fit = "contain", crossOrigin, sampleSi
|
|
|
872
1022
|
contrast,
|
|
873
1023
|
src
|
|
874
1024
|
]);
|
|
875
|
-
return /* @__PURE__ */
|
|
1025
|
+
return /* @__PURE__ */ React18.createElement("div", {
|
|
876
1026
|
// `isolate` (`isolation: isolate`) creates a new stacking context so
|
|
877
1027
|
// the inner <img>'s `z-10` stays scoped to this wrapper. Without it
|
|
878
1028
|
// the z-10 leaks into the parent's stacking context and elevates the
|
|
879
1029
|
// image above any pseudo-element rings (e.g. Focus.Item's
|
|
880
1030
|
// `dx-ring-pseudo` `::after`) painted on ancestors — most visibly,
|
|
881
1031
|
// the focus ring on a Card containing a Card.Poster.
|
|
882
|
-
className:
|
|
1032
|
+
className: mx7(`relative flex w-full justify-center overflow-hidden transition-all duration-700 isolate`, classNames),
|
|
883
1033
|
style: {
|
|
884
1034
|
backgroundColor: dominantColor
|
|
885
1035
|
}
|
|
886
|
-
}, /* @__PURE__ */
|
|
1036
|
+
}, /* @__PURE__ */ React18.createElement("canvas", {
|
|
887
1037
|
ref: canvasRef,
|
|
888
1038
|
style: {
|
|
889
1039
|
display: "none"
|
|
890
1040
|
},
|
|
891
1041
|
"aria-hidden": "true"
|
|
892
|
-
}), /* @__PURE__ */
|
|
1042
|
+
}), /* @__PURE__ */ React18.createElement("div", {
|
|
893
1043
|
className: "absolute inset-0 pointer-events-none",
|
|
894
1044
|
style: {
|
|
895
1045
|
background: dominantColor ? `radial-gradient(circle at center, transparent 30%, ${dominantColor} 100%)` : void 0,
|
|
896
1046
|
transition: "opacity 0.7s ease-in-out",
|
|
897
1047
|
opacity: 0.5
|
|
898
1048
|
}
|
|
899
|
-
}), /* @__PURE__ */
|
|
1049
|
+
}), /* @__PURE__ */ React18.createElement("img", {
|
|
900
1050
|
src,
|
|
901
1051
|
alt,
|
|
902
1052
|
crossOrigin: crossOriginState,
|
|
903
1053
|
onError: handleImageError,
|
|
904
1054
|
onLoad: handleImageLoad,
|
|
905
|
-
className:
|
|
1055
|
+
className: mx7("z-10 transition-opacity duration-500", fit === "cover" ? "w-full h-full object-cover" : "object-contain"),
|
|
906
1056
|
style: {
|
|
907
1057
|
opacity: imageLoaded ? 1 : 0
|
|
908
1058
|
}
|
|
@@ -991,27 +1141,19 @@ var isTransparent = (pixels, sampleSize, threshold = 0.5) => {
|
|
|
991
1141
|
return edgeTransparentPixels / edgePixels > threshold;
|
|
992
1142
|
};
|
|
993
1143
|
|
|
994
|
-
// src/components/Toolbar/Toolbar.tsx
|
|
995
|
-
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
996
|
-
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
997
|
-
import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
998
|
-
import React19, { forwardRef as forwardRef15 } from "react";
|
|
999
|
-
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
1000
|
-
import { translationKey as translationKey2 } from "#translations";
|
|
1001
|
-
|
|
1002
1144
|
// src/components/Menu/ContextMenu.tsx
|
|
1003
1145
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
1004
1146
|
import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
|
|
1005
1147
|
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
1006
|
-
import
|
|
1148
|
+
import React19, { forwardRef as forwardRef15 } from "react";
|
|
1007
1149
|
var ContextMenuRoot = ContextMenuPrimitive.ContextMenu;
|
|
1008
1150
|
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
1009
1151
|
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
1010
|
-
var ContextMenuContent = /* @__PURE__ */
|
|
1152
|
+
var ContextMenuContent = /* @__PURE__ */ forwardRef15(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
1011
1153
|
const { tx } = useThemeContext();
|
|
1012
1154
|
const elevation = useElevationContext();
|
|
1013
1155
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1014
|
-
return /* @__PURE__ */
|
|
1156
|
+
return /* @__PURE__ */ React19.createElement(ContextMenuPrimitive.Content, {
|
|
1015
1157
|
...props,
|
|
1016
1158
|
"data-arrow-keys": "up down",
|
|
1017
1159
|
collisionPadding: safeCollisionPadding,
|
|
@@ -1021,18 +1163,18 @@ var ContextMenuContent = /* @__PURE__ */ forwardRef12(({ classNames, children, c
|
|
|
1021
1163
|
ref: forwardedRef
|
|
1022
1164
|
}, children);
|
|
1023
1165
|
});
|
|
1024
|
-
var ContextMenuViewport = /* @__PURE__ */
|
|
1166
|
+
var ContextMenuViewport = /* @__PURE__ */ forwardRef15(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
1025
1167
|
const { tx } = useThemeContext();
|
|
1026
1168
|
const Comp = asChild ? Slot8 : Primitive8.div;
|
|
1027
|
-
return /* @__PURE__ */
|
|
1169
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1028
1170
|
...props,
|
|
1029
1171
|
className: tx("menu.viewport", {}, classNames),
|
|
1030
1172
|
ref: forwardedRef
|
|
1031
1173
|
}, children);
|
|
1032
1174
|
});
|
|
1033
|
-
var ContextMenuArrow = /* @__PURE__ */
|
|
1175
|
+
var ContextMenuArrow = /* @__PURE__ */ forwardRef15(({ classNames, ...props }, forwardedRef) => {
|
|
1034
1176
|
const { tx } = useThemeContext();
|
|
1035
|
-
return /* @__PURE__ */
|
|
1177
|
+
return /* @__PURE__ */ React19.createElement(ContextMenuPrimitive.Arrow, {
|
|
1036
1178
|
...props,
|
|
1037
1179
|
className: tx("menu.arrow", {}, classNames),
|
|
1038
1180
|
ref: forwardedRef
|
|
@@ -1040,33 +1182,33 @@ var ContextMenuArrow = /* @__PURE__ */ forwardRef12(({ classNames, ...props }, f
|
|
|
1040
1182
|
});
|
|
1041
1183
|
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
1042
1184
|
var ContextMenuItemIndicator = ContextMenuPrimitive.ItemIndicator;
|
|
1043
|
-
var ContextMenuItem = /* @__PURE__ */
|
|
1185
|
+
var ContextMenuItem = /* @__PURE__ */ forwardRef15(({ classNames, ...props }, forwardedRef) => {
|
|
1044
1186
|
const { tx } = useThemeContext();
|
|
1045
|
-
return /* @__PURE__ */
|
|
1187
|
+
return /* @__PURE__ */ React19.createElement(ContextMenuPrimitive.Item, {
|
|
1046
1188
|
...props,
|
|
1047
1189
|
className: tx("menu.item", {}, classNames),
|
|
1048
1190
|
ref: forwardedRef
|
|
1049
1191
|
});
|
|
1050
1192
|
});
|
|
1051
|
-
var ContextMenuCheckboxItem = /* @__PURE__ */
|
|
1193
|
+
var ContextMenuCheckboxItem = /* @__PURE__ */ forwardRef15(({ classNames, ...props }, forwardedRef) => {
|
|
1052
1194
|
const { tx } = useThemeContext();
|
|
1053
|
-
return /* @__PURE__ */
|
|
1195
|
+
return /* @__PURE__ */ React19.createElement(ContextMenuPrimitive.CheckboxItem, {
|
|
1054
1196
|
...props,
|
|
1055
1197
|
className: tx("menu.item", {}, classNames),
|
|
1056
1198
|
ref: forwardedRef
|
|
1057
1199
|
});
|
|
1058
1200
|
});
|
|
1059
|
-
var ContextMenuSeparator = /* @__PURE__ */
|
|
1201
|
+
var ContextMenuSeparator = /* @__PURE__ */ forwardRef15(({ classNames, ...props }, forwardedRef) => {
|
|
1060
1202
|
const { tx } = useThemeContext();
|
|
1061
|
-
return /* @__PURE__ */
|
|
1203
|
+
return /* @__PURE__ */ React19.createElement(ContextMenuPrimitive.Separator, {
|
|
1062
1204
|
...props,
|
|
1063
1205
|
className: tx("menu.separator", {}, classNames),
|
|
1064
1206
|
ref: forwardedRef
|
|
1065
1207
|
});
|
|
1066
1208
|
});
|
|
1067
|
-
var ContextMenuGroupLabel = /* @__PURE__ */
|
|
1209
|
+
var ContextMenuGroupLabel = /* @__PURE__ */ forwardRef15(({ classNames, ...props }, forwardedRef) => {
|
|
1068
1210
|
const { tx } = useThemeContext();
|
|
1069
|
-
return /* @__PURE__ */
|
|
1211
|
+
return /* @__PURE__ */ React19.createElement(ContextMenuPrimitive.Label, {
|
|
1070
1212
|
...props,
|
|
1071
1213
|
className: tx("menu.groupLabel", {}, classNames),
|
|
1072
1214
|
ref: forwardedRef
|
|
@@ -1097,7 +1239,7 @@ import { createMenuScope } from "@radix-ui/react-menu";
|
|
|
1097
1239
|
import { Primitive as Primitive9 } from "@radix-ui/react-primitive";
|
|
1098
1240
|
import { Slot as Slot9 } from "@radix-ui/react-slot";
|
|
1099
1241
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
1100
|
-
import
|
|
1242
|
+
import React20, { forwardRef as forwardRef16, useCallback as useCallback5, useEffect as useEffect2, useMemo as useMemo4, useRef as useRef3 } from "react";
|
|
1101
1243
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
1102
1244
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [
|
|
1103
1245
|
createMenuScope
|
|
@@ -1106,24 +1248,24 @@ var useMenuScope = createMenuScope();
|
|
|
1106
1248
|
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
1107
1249
|
var DropdownMenuRoot = ({ __scopeDropdownMenu, children, dir, modal = true, open: openProp, defaultOpen, onOpenChange }) => {
|
|
1108
1250
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1109
|
-
const triggerRef =
|
|
1251
|
+
const triggerRef = useRef3(null);
|
|
1110
1252
|
const [open = false, setOpen] = useControllableState({
|
|
1111
1253
|
prop: openProp,
|
|
1112
1254
|
defaultProp: defaultOpen,
|
|
1113
1255
|
onChange: onOpenChange
|
|
1114
1256
|
});
|
|
1115
|
-
return /* @__PURE__ */
|
|
1257
|
+
return /* @__PURE__ */ React20.createElement(DropdownMenuProvider, {
|
|
1116
1258
|
scope: __scopeDropdownMenu,
|
|
1117
1259
|
triggerId: useId2(),
|
|
1118
1260
|
triggerRef,
|
|
1119
1261
|
contentId: useId2(),
|
|
1120
1262
|
open,
|
|
1121
1263
|
onOpenChange: setOpen,
|
|
1122
|
-
onOpenToggle:
|
|
1264
|
+
onOpenToggle: useCallback5(() => setOpen((prevOpen) => !prevOpen), [
|
|
1123
1265
|
setOpen
|
|
1124
1266
|
]),
|
|
1125
1267
|
modal
|
|
1126
|
-
}, /* @__PURE__ */
|
|
1268
|
+
}, /* @__PURE__ */ React20.createElement(MenuPrimitive.Root, {
|
|
1127
1269
|
...menuScope,
|
|
1128
1270
|
dir,
|
|
1129
1271
|
modal,
|
|
@@ -1133,14 +1275,14 @@ var DropdownMenuRoot = ({ __scopeDropdownMenu, children, dir, modal = true, open
|
|
|
1133
1275
|
};
|
|
1134
1276
|
DropdownMenuRoot.displayName = DROPDOWN_MENU_NAME;
|
|
1135
1277
|
var TRIGGER_NAME = "DropdownMenu.Trigger";
|
|
1136
|
-
var DropdownMenuTrigger = /* @__PURE__ */
|
|
1278
|
+
var DropdownMenuTrigger = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1137
1279
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
1138
1280
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
1139
1281
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1140
|
-
return /* @__PURE__ */
|
|
1282
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Anchor, {
|
|
1141
1283
|
asChild: true,
|
|
1142
1284
|
...menuScope
|
|
1143
|
-
}, /* @__PURE__ */
|
|
1285
|
+
}, /* @__PURE__ */ React20.createElement(Primitive9.button, {
|
|
1144
1286
|
type: "button",
|
|
1145
1287
|
id: context.triggerId,
|
|
1146
1288
|
"aria-haspopup": "menu",
|
|
@@ -1194,7 +1336,7 @@ var DropdownMenuVirtualTrigger = (props) => {
|
|
|
1194
1336
|
context.triggerRef.current = virtualRef.current;
|
|
1195
1337
|
}
|
|
1196
1338
|
});
|
|
1197
|
-
return /* @__PURE__ */
|
|
1339
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Anchor, {
|
|
1198
1340
|
...menuScope,
|
|
1199
1341
|
virtualRef
|
|
1200
1342
|
});
|
|
@@ -1204,29 +1346,29 @@ var PORTAL_NAME = "DropdownMenu.Portal";
|
|
|
1204
1346
|
var DropdownMenuPortal = (props) => {
|
|
1205
1347
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
1206
1348
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1207
|
-
return /* @__PURE__ */
|
|
1349
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Portal, {
|
|
1208
1350
|
...menuScope,
|
|
1209
1351
|
...portalProps
|
|
1210
1352
|
});
|
|
1211
1353
|
};
|
|
1212
1354
|
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
1213
|
-
var DropdownMenuViewport = /* @__PURE__ */
|
|
1355
|
+
var DropdownMenuViewport = /* @__PURE__ */ forwardRef16(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
1214
1356
|
const { tx } = useThemeContext();
|
|
1215
1357
|
const Comp = asChild ? Slot9 : Primitive9.div;
|
|
1216
|
-
return /* @__PURE__ */
|
|
1358
|
+
return /* @__PURE__ */ React20.createElement(Comp, {
|
|
1217
1359
|
...props,
|
|
1218
1360
|
className: tx("menu.viewport", {}, classNames),
|
|
1219
1361
|
ref: forwardedRef
|
|
1220
1362
|
}, children);
|
|
1221
1363
|
});
|
|
1222
1364
|
var CONTENT_NAME = "DropdownMenu.Content";
|
|
1223
|
-
var DropdownMenuContent = /* @__PURE__ */
|
|
1365
|
+
var DropdownMenuContent = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1224
1366
|
const { __scopeDropdownMenu, classNames, collisionPadding = 8, collisionBoundary, ...contentProps } = props;
|
|
1225
1367
|
const { tx } = useThemeContext();
|
|
1226
1368
|
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
1227
1369
|
const elevation = useElevationContext();
|
|
1228
1370
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1229
|
-
const hasInteractedOutsideRef =
|
|
1371
|
+
const hasInteractedOutsideRef = useRef3(false);
|
|
1230
1372
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1231
1373
|
const computedCollisionBoundary = useMemo4(() => {
|
|
1232
1374
|
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
@@ -1244,7 +1386,7 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef13((props, forwardedRef) =>
|
|
|
1244
1386
|
collisionBoundary,
|
|
1245
1387
|
context.triggerRef.current
|
|
1246
1388
|
]);
|
|
1247
|
-
return /* @__PURE__ */
|
|
1389
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Content, {
|
|
1248
1390
|
id: context.contentId,
|
|
1249
1391
|
"aria-labelledby": context.triggerId,
|
|
1250
1392
|
...menuScope,
|
|
@@ -1286,10 +1428,10 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef13((props, forwardedRef) =>
|
|
|
1286
1428
|
});
|
|
1287
1429
|
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
1288
1430
|
var GROUP_NAME = "DropdownMenu.Group";
|
|
1289
|
-
var DropdownMenuGroup = /* @__PURE__ */
|
|
1431
|
+
var DropdownMenuGroup = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1290
1432
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
1291
1433
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1292
|
-
return /* @__PURE__ */
|
|
1434
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Group, {
|
|
1293
1435
|
...menuScope,
|
|
1294
1436
|
...groupProps,
|
|
1295
1437
|
ref: forwardedRef
|
|
@@ -1297,11 +1439,11 @@ var DropdownMenuGroup = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
|
1297
1439
|
});
|
|
1298
1440
|
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
1299
1441
|
var LABEL_NAME = "DropdownMenu.Label";
|
|
1300
|
-
var DropdownMenuGroupLabel = /* @__PURE__ */
|
|
1442
|
+
var DropdownMenuGroupLabel = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1301
1443
|
const { __scopeDropdownMenu, classNames, ...labelProps } = props;
|
|
1302
1444
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1303
1445
|
const { tx } = useThemeContext();
|
|
1304
|
-
return /* @__PURE__ */
|
|
1446
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Label, {
|
|
1305
1447
|
...menuScope,
|
|
1306
1448
|
...labelProps,
|
|
1307
1449
|
className: tx("menu.groupLabel", {}, classNames),
|
|
@@ -1310,11 +1452,11 @@ var DropdownMenuGroupLabel = /* @__PURE__ */ forwardRef13((props, forwardedRef)
|
|
|
1310
1452
|
});
|
|
1311
1453
|
DropdownMenuGroupLabel.displayName = LABEL_NAME;
|
|
1312
1454
|
var ITEM_NAME = "DropdownMenu.Item";
|
|
1313
|
-
var DropdownMenuItem = /* @__PURE__ */
|
|
1455
|
+
var DropdownMenuItem = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1314
1456
|
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
1315
1457
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1316
1458
|
const { tx } = useThemeContext();
|
|
1317
|
-
return /* @__PURE__ */
|
|
1459
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Item, {
|
|
1318
1460
|
...menuScope,
|
|
1319
1461
|
...itemProps,
|
|
1320
1462
|
className: tx("menu.item", {}, classNames),
|
|
@@ -1323,11 +1465,11 @@ var DropdownMenuItem = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
|
1323
1465
|
});
|
|
1324
1466
|
DropdownMenuItem.displayName = ITEM_NAME;
|
|
1325
1467
|
var CHECKBOX_ITEM_NAME = "DropdownMenu.CheckboxItem";
|
|
1326
|
-
var DropdownMenuCheckboxItem = /* @__PURE__ */
|
|
1468
|
+
var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1327
1469
|
const { __scopeDropdownMenu, classNames, ...checkboxItemProps } = props;
|
|
1328
1470
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1329
1471
|
const { tx } = useThemeContext();
|
|
1330
|
-
return /* @__PURE__ */
|
|
1472
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.CheckboxItem, {
|
|
1331
1473
|
...menuScope,
|
|
1332
1474
|
...checkboxItemProps,
|
|
1333
1475
|
className: tx("menu.item", {}, classNames),
|
|
@@ -1336,10 +1478,10 @@ var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef13((props, forwardedRef
|
|
|
1336
1478
|
});
|
|
1337
1479
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
1338
1480
|
var RADIO_GROUP_NAME = "DropdownMenu.RadioGroup";
|
|
1339
|
-
var DropdownMenuRadioGroup = /* @__PURE__ */
|
|
1481
|
+
var DropdownMenuRadioGroup = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1340
1482
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
1341
1483
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1342
|
-
return /* @__PURE__ */
|
|
1484
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.RadioGroup, {
|
|
1343
1485
|
...menuScope,
|
|
1344
1486
|
...radioGroupProps,
|
|
1345
1487
|
ref: forwardedRef
|
|
@@ -1347,11 +1489,11 @@ var DropdownMenuRadioGroup = /* @__PURE__ */ forwardRef13((props, forwardedRef)
|
|
|
1347
1489
|
});
|
|
1348
1490
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
1349
1491
|
var RADIO_ITEM_NAME = "DropdownMenu.RadioItem";
|
|
1350
|
-
var DropdownMenuRadioItem = /* @__PURE__ */
|
|
1492
|
+
var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1351
1493
|
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
1352
1494
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1353
1495
|
const { tx } = useThemeContext();
|
|
1354
|
-
return /* @__PURE__ */
|
|
1496
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Item, {
|
|
1355
1497
|
...menuScope,
|
|
1356
1498
|
...itemProps,
|
|
1357
1499
|
className: tx("menu.item", {}, classNames),
|
|
@@ -1360,10 +1502,10 @@ var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef13((props, forwardedRef) =
|
|
|
1360
1502
|
});
|
|
1361
1503
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
1362
1504
|
var INDICATOR_NAME = "DropdownMenu.ItemIndicator";
|
|
1363
|
-
var DropdownMenuItemIndicator = /* @__PURE__ */
|
|
1505
|
+
var DropdownMenuItemIndicator = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1364
1506
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
1365
1507
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1366
|
-
return /* @__PURE__ */
|
|
1508
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.ItemIndicator, {
|
|
1367
1509
|
...menuScope,
|
|
1368
1510
|
...itemIndicatorProps,
|
|
1369
1511
|
ref: forwardedRef
|
|
@@ -1371,11 +1513,11 @@ var DropdownMenuItemIndicator = /* @__PURE__ */ forwardRef13((props, forwardedRe
|
|
|
1371
1513
|
});
|
|
1372
1514
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
1373
1515
|
var SEPARATOR_NAME = "DropdownMenu.Separator";
|
|
1374
|
-
var DropdownMenuSeparator = /* @__PURE__ */
|
|
1516
|
+
var DropdownMenuSeparator = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1375
1517
|
const { __scopeDropdownMenu, classNames, ...separatorProps } = props;
|
|
1376
1518
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1377
1519
|
const { tx } = useThemeContext();
|
|
1378
|
-
return /* @__PURE__ */
|
|
1520
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Separator, {
|
|
1379
1521
|
...menuScope,
|
|
1380
1522
|
...separatorProps,
|
|
1381
1523
|
className: tx("menu.separator", {}, classNames),
|
|
@@ -1384,11 +1526,11 @@ var DropdownMenuSeparator = /* @__PURE__ */ forwardRef13((props, forwardedRef) =
|
|
|
1384
1526
|
});
|
|
1385
1527
|
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
1386
1528
|
var ARROW_NAME = "DropdownMenu.Arrow";
|
|
1387
|
-
var DropdownMenuArrow = /* @__PURE__ */
|
|
1529
|
+
var DropdownMenuArrow = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1388
1530
|
const { __scopeDropdownMenu, classNames, ...arrowProps } = props;
|
|
1389
1531
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1390
1532
|
const { tx } = useThemeContext();
|
|
1391
|
-
return /* @__PURE__ */
|
|
1533
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Arrow, {
|
|
1392
1534
|
...menuScope,
|
|
1393
1535
|
...arrowProps,
|
|
1394
1536
|
className: tx("menu.arrow", {}, classNames),
|
|
@@ -1404,17 +1546,17 @@ var DropdownMenuSub = (props) => {
|
|
|
1404
1546
|
defaultProp: defaultOpen,
|
|
1405
1547
|
onChange: onOpenChange
|
|
1406
1548
|
});
|
|
1407
|
-
return /* @__PURE__ */
|
|
1549
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Sub, {
|
|
1408
1550
|
...menuScope,
|
|
1409
1551
|
open,
|
|
1410
1552
|
onOpenChange: setOpen
|
|
1411
1553
|
}, children);
|
|
1412
1554
|
};
|
|
1413
1555
|
var SUB_TRIGGER_NAME = "DropdownMenu.SubTrigger";
|
|
1414
|
-
var DropdownMenuSubTrigger = /* @__PURE__ */
|
|
1556
|
+
var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1415
1557
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
1416
1558
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1417
|
-
return /* @__PURE__ */
|
|
1559
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.SubTrigger, {
|
|
1418
1560
|
...menuScope,
|
|
1419
1561
|
...subTriggerProps,
|
|
1420
1562
|
ref: forwardedRef
|
|
@@ -1422,10 +1564,10 @@ var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef13((props, forwardedRef)
|
|
|
1422
1564
|
});
|
|
1423
1565
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
1424
1566
|
var SUB_CONTENT_NAME = "DropdownMenu.SubContent";
|
|
1425
|
-
var DropdownMenuSubContent = /* @__PURE__ */
|
|
1567
|
+
var DropdownMenuSubContent = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1426
1568
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
1427
1569
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1428
|
-
return /* @__PURE__ */
|
|
1570
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.SubContent, {
|
|
1429
1571
|
...menuScope,
|
|
1430
1572
|
...subContentProps,
|
|
1431
1573
|
ref: forwardedRef,
|
|
@@ -1465,148 +1607,48 @@ var DropdownMenu = {
|
|
|
1465
1607
|
};
|
|
1466
1608
|
var useDropdownMenuMenuScope = useMenuScope;
|
|
1467
1609
|
|
|
1468
|
-
// src/components/
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
const { tx } = useThemeContext();
|
|
1473
|
-
return /* @__PURE__ */ React18.createElement(SeparatorPrimitive.Root, {
|
|
1474
|
-
...props,
|
|
1475
|
-
orientation,
|
|
1476
|
-
className: tx("separator.root", {
|
|
1477
|
-
orientation,
|
|
1478
|
-
subdued
|
|
1479
|
-
}, classNames),
|
|
1480
|
-
ref: forwardedRef
|
|
1481
|
-
});
|
|
1482
|
-
});
|
|
1483
|
-
|
|
1484
|
-
// src/components/Toolbar/Toolbar.tsx
|
|
1485
|
-
var ToolbarRoot = composable(({ children, density, disabled, layoutManaged, orientation, ...props }, forwardedRef) => {
|
|
1486
|
-
const { className, role, ...rest } = composableProps(props);
|
|
1610
|
+
// src/components/Card/Card.tsx
|
|
1611
|
+
var CARD_ROOT_NAME = "Card.Root";
|
|
1612
|
+
var CardRoot = composable(({ children, id, role, border = true, fullWidth, density, ...props }, forwardedRef) => {
|
|
1613
|
+
const { className, ...rest } = composableProps(props);
|
|
1487
1614
|
const { tx } = useThemeContext();
|
|
1488
|
-
return /* @__PURE__ */
|
|
1615
|
+
return /* @__PURE__ */ React21.createElement(Column.Root, {
|
|
1616
|
+
asChild: true,
|
|
1617
|
+
gutter: density === "lg" ? "lg" : density === "sm" || density === "xs" ? "sm" : "md",
|
|
1618
|
+
classNames: tx("card.root", {
|
|
1619
|
+
border,
|
|
1620
|
+
fullWidth
|
|
1621
|
+
}, className),
|
|
1622
|
+
role: role ?? "group"
|
|
1623
|
+
}, /* @__PURE__ */ React21.createElement("div", {
|
|
1489
1624
|
...rest,
|
|
1490
|
-
...
|
|
1491
|
-
|
|
1625
|
+
...id && {
|
|
1626
|
+
"data-object-id": id
|
|
1492
1627
|
},
|
|
1493
|
-
orientation,
|
|
1494
|
-
"data-arrow-keys": orientation === "vertical" ? "up down" : "left right",
|
|
1495
|
-
className: tx("toolbar.root", {
|
|
1496
|
-
density,
|
|
1497
|
-
disabled,
|
|
1498
|
-
layoutManaged
|
|
1499
|
-
}, className),
|
|
1500
1628
|
ref: forwardedRef
|
|
1501
|
-
}, children);
|
|
1629
|
+
}, children));
|
|
1502
1630
|
});
|
|
1503
|
-
|
|
1504
|
-
var
|
|
1505
|
-
|
|
1506
|
-
const Comp = asChild ? Slot10 : Primitive10.div;
|
|
1631
|
+
CardRoot.displayName = CARD_ROOT_NAME;
|
|
1632
|
+
var CARD_HEADER_NAME = "Card.Header";
|
|
1633
|
+
var CardHeader = slottable(({ children, asChild, style, ...props }, forwardedRef) => {
|
|
1507
1634
|
const { tx } = useThemeContext();
|
|
1508
|
-
|
|
1635
|
+
const { className, ...rest } = composableProps(props);
|
|
1636
|
+
const Comp = asChild ? Slot10 : "header";
|
|
1637
|
+
return /* @__PURE__ */ React21.createElement(Comp, {
|
|
1509
1638
|
...rest,
|
|
1510
|
-
|
|
1639
|
+
style: {
|
|
1640
|
+
...iconSize(5),
|
|
1641
|
+
...style
|
|
1642
|
+
},
|
|
1643
|
+
className: tx("card.header", {}, className),
|
|
1511
1644
|
ref: forwardedRef
|
|
1512
1645
|
}, children);
|
|
1513
1646
|
});
|
|
1514
|
-
|
|
1515
|
-
var
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
...props,
|
|
1520
|
-
ref: forwardedRef
|
|
1521
|
-
}));
|
|
1522
|
-
});
|
|
1523
|
-
ToolbarButton.displayName = "Toolbar.Button";
|
|
1524
|
-
var ToolbarIconButton = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
1525
|
-
return /* @__PURE__ */ React19.createElement(ToolbarPrimitive.Button, {
|
|
1526
|
-
asChild: true
|
|
1527
|
-
}, /* @__PURE__ */ React19.createElement(IconButton, {
|
|
1528
|
-
...props,
|
|
1529
|
-
ref: forwardedRef
|
|
1530
|
-
}));
|
|
1531
|
-
});
|
|
1532
|
-
ToolbarIconButton.displayName = "Toolbar.IconButton";
|
|
1533
|
-
var ToolbarToggle = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
1534
|
-
return /* @__PURE__ */ React19.createElement(ToolbarPrimitive.Button, {
|
|
1535
|
-
asChild: true
|
|
1536
|
-
}, /* @__PURE__ */ React19.createElement(Toggle, {
|
|
1537
|
-
...props,
|
|
1538
|
-
ref: forwardedRef
|
|
1539
|
-
}));
|
|
1540
|
-
});
|
|
1541
|
-
ToolbarToggle.displayName = "Toolbar.Toggle";
|
|
1542
|
-
var ToolbarLink = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
1543
|
-
return /* @__PURE__ */ React19.createElement(ToolbarPrimitive.Link, {
|
|
1544
|
-
asChild: true
|
|
1545
|
-
}, /* @__PURE__ */ React19.createElement(Link, {
|
|
1546
|
-
...props,
|
|
1547
|
-
ref: forwardedRef
|
|
1548
|
-
}));
|
|
1549
|
-
});
|
|
1550
|
-
ToolbarLink.displayName = "Toolbar.Link";
|
|
1551
|
-
var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef15(({ classNames, children, elevation, ...props }, forwardedRef) => {
|
|
1552
|
-
return /* @__PURE__ */ React19.createElement(ToolbarPrimitive.ToolbarToggleGroup, {
|
|
1553
|
-
...props,
|
|
1554
|
-
asChild: true
|
|
1555
|
-
}, /* @__PURE__ */ React19.createElement(ButtonGroup, {
|
|
1556
|
-
classNames,
|
|
1557
|
-
children,
|
|
1558
|
-
elevation,
|
|
1559
|
-
ref: forwardedRef
|
|
1560
|
-
}));
|
|
1561
|
-
});
|
|
1562
|
-
ToolbarToggleGroup2.displayName = "Toolbar.ToggleGroup";
|
|
1563
|
-
var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef15(({ variant, density, elevation, classNames, children, ...props }, forwardedRef) => {
|
|
1564
|
-
return /* @__PURE__ */ React19.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
1565
|
-
...props,
|
|
1566
|
-
asChild: true
|
|
1567
|
-
}, /* @__PURE__ */ React19.createElement(Button, {
|
|
1568
|
-
variant,
|
|
1569
|
-
density,
|
|
1570
|
-
elevation,
|
|
1571
|
-
classNames,
|
|
1572
|
-
children,
|
|
1573
|
-
ref: forwardedRef
|
|
1574
|
-
}));
|
|
1575
|
-
});
|
|
1576
|
-
ToolbarToggleGroupItem.displayName = "Toolbar.ToggleGroupItem";
|
|
1577
|
-
var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef15(({ variant, density, elevation, classNames, icon, label, iconOnly, iconClassNames, ...props }, forwardedRef) => {
|
|
1578
|
-
return /* @__PURE__ */ React19.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
1579
|
-
...props,
|
|
1580
|
-
asChild: true
|
|
1581
|
-
}, /* @__PURE__ */ React19.createElement(IconButton, {
|
|
1582
|
-
variant,
|
|
1583
|
-
density,
|
|
1584
|
-
elevation,
|
|
1585
|
-
classNames,
|
|
1586
|
-
icon,
|
|
1587
|
-
label,
|
|
1588
|
-
iconOnly,
|
|
1589
|
-
iconClassNames,
|
|
1590
|
-
ref: forwardedRef
|
|
1591
|
-
}));
|
|
1592
|
-
});
|
|
1593
|
-
ToolbarToggleGroupIconItem.displayName = "Toolbar.ToggleGroupIconItem";
|
|
1594
|
-
var ToolbarSeparator = /* @__PURE__ */ forwardRef15(({ variant = "gap", ...props }, forwardedRef) => {
|
|
1595
|
-
return variant === "line" ? /* @__PURE__ */ React19.createElement(ToolbarPrimitive.Separator, {
|
|
1596
|
-
asChild: true
|
|
1597
|
-
}, /* @__PURE__ */ React19.createElement(Separator3, {
|
|
1598
|
-
orientation: "vertical",
|
|
1599
|
-
...props,
|
|
1600
|
-
ref: forwardedRef
|
|
1601
|
-
})) : /* @__PURE__ */ React19.createElement(ToolbarPrimitive.Separator, {
|
|
1602
|
-
className: "grow",
|
|
1603
|
-
ref: forwardedRef
|
|
1604
|
-
});
|
|
1605
|
-
});
|
|
1606
|
-
ToolbarSeparator.displayName = "Toolbar.Separator";
|
|
1607
|
-
var ToolbarDragHandle = /* @__PURE__ */ forwardRef15(({ testId = "drag-handle", label }, forwardedRef) => {
|
|
1608
|
-
const { t } = useTranslation2(translationKey2);
|
|
1609
|
-
return /* @__PURE__ */ React19.createElement(ToolbarIconButton, {
|
|
1647
|
+
CardHeader.displayName = CARD_HEADER_NAME;
|
|
1648
|
+
var CARD_DRAG_HANDLE_NAME = "Card.DragHandle";
|
|
1649
|
+
var CardDragHandle = /* @__PURE__ */ forwardRef17(({ testId = "drag-handle", label }, forwardedRef) => {
|
|
1650
|
+
const { t } = useTranslation3(translationKey3);
|
|
1651
|
+
return /* @__PURE__ */ React21.createElement(CardBlock, null, /* @__PURE__ */ React21.createElement(IconButton, {
|
|
1610
1652
|
"data-testid": testId,
|
|
1611
1653
|
tabIndex: -1,
|
|
1612
1654
|
noTooltip: true,
|
|
@@ -1614,147 +1656,78 @@ var ToolbarDragHandle = /* @__PURE__ */ forwardRef15(({ testId = "drag-handle",
|
|
|
1614
1656
|
icon: "ph--dots-six-vertical--regular",
|
|
1615
1657
|
variant: "ghost",
|
|
1616
1658
|
label: label ?? t("toolbar-drag-handle.label"),
|
|
1617
|
-
classNames: "dx-focus-ring-none cursor-pointer",
|
|
1659
|
+
classNames: "dx-focus-ring-none cursor-pointer text-base-fg",
|
|
1618
1660
|
disabled: !forwardedRef,
|
|
1619
1661
|
ref: forwardedRef
|
|
1620
|
-
});
|
|
1662
|
+
}));
|
|
1621
1663
|
});
|
|
1622
|
-
|
|
1623
|
-
var
|
|
1664
|
+
CardDragHandle.displayName = CARD_DRAG_HANDLE_NAME;
|
|
1665
|
+
var CARD_ACTION_ICON_BUTTON_NAME = "Card.ActionIconButton";
|
|
1666
|
+
var CARD_ACTION_ICONS = {
|
|
1624
1667
|
close: "ph--x--regular",
|
|
1625
1668
|
delete: "ph--trash--regular"
|
|
1626
1669
|
};
|
|
1627
|
-
var
|
|
1670
|
+
var CARD_ACTION_LABEL_KEYS = {
|
|
1628
1671
|
close: "toolbar-close.label",
|
|
1629
1672
|
delete: "toolbar-delete.label"
|
|
1630
1673
|
};
|
|
1631
|
-
var
|
|
1632
|
-
const { t } =
|
|
1633
|
-
return /* @__PURE__ */
|
|
1674
|
+
var CardActionIconButton = /* @__PURE__ */ forwardRef17(({ action, onClick, label }, forwardedRef) => {
|
|
1675
|
+
const { t } = useTranslation3(translationKey3);
|
|
1676
|
+
return /* @__PURE__ */ React21.createElement(CardBlock, {
|
|
1677
|
+
end: true
|
|
1678
|
+
}, /* @__PURE__ */ React21.createElement(IconButton, {
|
|
1634
1679
|
iconOnly: true,
|
|
1635
|
-
icon:
|
|
1680
|
+
icon: CARD_ACTION_ICONS[action],
|
|
1636
1681
|
variant: "ghost",
|
|
1637
|
-
label: label ?? t(
|
|
1682
|
+
label: label ?? t(CARD_ACTION_LABEL_KEYS[action]),
|
|
1638
1683
|
classNames: "cursor-pointer",
|
|
1639
1684
|
onClick,
|
|
1640
1685
|
ref: forwardedRef
|
|
1641
|
-
});
|
|
1686
|
+
}));
|
|
1642
1687
|
});
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1688
|
+
CardActionIconButton.displayName = CARD_ACTION_ICON_BUTTON_NAME;
|
|
1689
|
+
var CARD_MENU_NAME = "Card.Menu";
|
|
1690
|
+
function CardMenu({ context, items }) {
|
|
1691
|
+
const { t } = useTranslation3(translationKey3);
|
|
1692
|
+
return /* @__PURE__ */ React21.createElement(CardBlock, {
|
|
1693
|
+
end: true
|
|
1694
|
+
}, /* @__PURE__ */ React21.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React21.createElement(DropdownMenu.Trigger, {
|
|
1647
1695
|
disabled: !items?.length,
|
|
1648
1696
|
asChild: true
|
|
1649
|
-
}, /* @__PURE__ */
|
|
1697
|
+
}, /* @__PURE__ */ React21.createElement(IconButton, {
|
|
1650
1698
|
iconOnly: true,
|
|
1651
1699
|
variant: "ghost",
|
|
1652
1700
|
icon: "ph--dots-three-vertical--regular",
|
|
1653
1701
|
label: t("toolbar-menu.label")
|
|
1654
|
-
})), (items?.length ?? 0) > 0 && /* @__PURE__ */
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1702
|
+
})), (items?.length ?? 0) > 0 && /* @__PURE__ */ React21.createElement(DropdownMenu.Portal, null, /* @__PURE__ */ React21.createElement(DropdownMenu.Content, null, /* @__PURE__ */ React21.createElement(DropdownMenu.Viewport, null, items?.map(({ label, onClick: onSelect }, index) => (
|
|
1703
|
+
// `context` is the generic payload threaded to each handler; the cast is the
|
|
1704
|
+
// generic boundary (T may be `void`, so `context` is typed `T | undefined`).
|
|
1705
|
+
/* @__PURE__ */ React21.createElement(DropdownMenu.Item, {
|
|
1706
|
+
key: index,
|
|
1707
|
+
onSelect: () => onSelect(context)
|
|
1708
|
+
}, label)
|
|
1709
|
+
))), /* @__PURE__ */ React21.createElement(DropdownMenu.Arrow, null)))));
|
|
1658
1710
|
}
|
|
1659
|
-
|
|
1660
|
-
var
|
|
1661
|
-
|
|
1662
|
-
Text: ToolbarText,
|
|
1663
|
-
Button: ToolbarButton,
|
|
1664
|
-
IconButton: ToolbarIconButton,
|
|
1665
|
-
Link: ToolbarLink,
|
|
1666
|
-
Toggle: ToolbarToggle,
|
|
1667
|
-
ToggleGroup: ToolbarToggleGroup2,
|
|
1668
|
-
ToggleGroupItem: ToolbarToggleGroupItem,
|
|
1669
|
-
ToggleGroupIconItem: ToolbarToggleGroupIconItem,
|
|
1670
|
-
Separator: ToolbarSeparator,
|
|
1671
|
-
DragHandle: ToolbarDragHandle,
|
|
1672
|
-
ActionIconButton: ToolbarActionIconButton,
|
|
1673
|
-
Menu: ToolbarMenu
|
|
1674
|
-
};
|
|
1675
|
-
|
|
1676
|
-
// src/components/Card/Card.tsx
|
|
1677
|
-
var CARD_ROOT_NAME = "Card.Root";
|
|
1678
|
-
var CardRoot = composable(({ children, id, role, border = true, fullWidth, density, ...props }, forwardedRef) => {
|
|
1679
|
-
const { className, ...rest } = composableProps(props);
|
|
1711
|
+
CardMenu.displayName = CARD_MENU_NAME;
|
|
1712
|
+
var CARD_BLOCK_NAME = "Card.Block";
|
|
1713
|
+
var CardBlock = composable(({ children, ...props }, forwardedRef) => {
|
|
1680
1714
|
const { tx } = useThemeContext();
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
gutter: density === "lg" ? "lg" : density === "sm" || density === "xs" ? "sm" : "md",
|
|
1684
|
-
classNames: tx("card.root", {
|
|
1685
|
-
border,
|
|
1686
|
-
fullWidth
|
|
1687
|
-
}, className),
|
|
1688
|
-
role: role ?? "group"
|
|
1689
|
-
}, /* @__PURE__ */ React20.createElement("div", {
|
|
1715
|
+
const { className, ...rest } = composableProps(props);
|
|
1716
|
+
return /* @__PURE__ */ React21.createElement(Column.Block, {
|
|
1690
1717
|
...rest,
|
|
1691
|
-
|
|
1692
|
-
"data-object-id": id
|
|
1693
|
-
},
|
|
1694
|
-
ref: forwardedRef
|
|
1695
|
-
}, children));
|
|
1696
|
-
});
|
|
1697
|
-
CardRoot.displayName = CARD_ROOT_NAME;
|
|
1698
|
-
var CARD_HEADER_NAME = "Card.Header";
|
|
1699
|
-
var CardHeader = composable(({ children, classNames, ...props }, forwardedRef) => {
|
|
1700
|
-
const { tx } = useThemeContext();
|
|
1701
|
-
return /* @__PURE__ */ React20.createElement(Toolbar.Root, {
|
|
1702
|
-
...props,
|
|
1703
|
-
style: iconSize(5),
|
|
1704
|
-
classNames: [
|
|
1705
|
-
tx("card.header", {}),
|
|
1706
|
-
classNames
|
|
1707
|
-
],
|
|
1718
|
+
classNames: tx("card.block", {}, className),
|
|
1708
1719
|
ref: forwardedRef
|
|
1709
1720
|
}, children);
|
|
1710
1721
|
});
|
|
1711
|
-
|
|
1712
|
-
var CARD_DRAG_HANDLE_NAME = "Card.DragHandle";
|
|
1713
|
-
var CardDragHandle = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1714
|
-
return /* @__PURE__ */ React20.createElement(CardIconBlock, null, /* @__PURE__ */ React20.createElement(Toolbar.DragHandle, {
|
|
1715
|
-
...props,
|
|
1716
|
-
ref: forwardedRef
|
|
1717
|
-
}));
|
|
1718
|
-
});
|
|
1719
|
-
CardDragHandle.displayName = CARD_DRAG_HANDLE_NAME;
|
|
1720
|
-
var CARD_ACTION_ICON_BUTTON_NAME = "Card.ActionIconButton";
|
|
1721
|
-
var CardActionIconButton = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1722
|
-
return /* @__PURE__ */ React20.createElement(CardIconBlock, null, /* @__PURE__ */ React20.createElement(Toolbar.ActionIconButton, {
|
|
1723
|
-
...props,
|
|
1724
|
-
ref: forwardedRef
|
|
1725
|
-
}));
|
|
1726
|
-
});
|
|
1727
|
-
CardActionIconButton.displayName = CARD_ACTION_ICON_BUTTON_NAME;
|
|
1728
|
-
var CARD_MENU_NAME = "Card.Menu";
|
|
1729
|
-
function CardMenu({ context, items, ...props }) {
|
|
1730
|
-
return /* @__PURE__ */ React20.createElement(CardIconBlock, null, /* @__PURE__ */ React20.createElement(Toolbar.Menu, {
|
|
1731
|
-
...props,
|
|
1732
|
-
context,
|
|
1733
|
-
items: items ?? []
|
|
1734
|
-
}));
|
|
1735
|
-
}
|
|
1736
|
-
CardMenu.displayName = CARD_MENU_NAME;
|
|
1737
|
-
var CARD_ICON_NAME = "Card.Icon";
|
|
1738
|
-
function CardIcon(props) {
|
|
1739
|
-
return /* @__PURE__ */ React20.createElement(CardIconBlock, null, /* @__PURE__ */ React20.createElement(Icon, props));
|
|
1740
|
-
}
|
|
1741
|
-
CardIcon.displayName = CARD_ICON_NAME;
|
|
1742
|
-
var CARD_ICON_BLOCK_NAME = "Card.IconBlock";
|
|
1743
|
-
var CardIconBlock = /* @__PURE__ */ forwardRef16((props, forwardedRef) => {
|
|
1744
|
-
return /* @__PURE__ */ React20.createElement(IconBlock, {
|
|
1745
|
-
...props,
|
|
1746
|
-
ref: forwardedRef
|
|
1747
|
-
});
|
|
1748
|
-
});
|
|
1749
|
-
CardIconBlock.displayName = CARD_ICON_BLOCK_NAME;
|
|
1722
|
+
CardBlock.displayName = CARD_BLOCK_NAME;
|
|
1750
1723
|
var CARD_TITLE_NAME = "Card.Title";
|
|
1751
1724
|
var CardTitle = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
1752
1725
|
const { tx } = useThemeContext();
|
|
1753
1726
|
const { className, ...rest } = composableProps(props, {
|
|
1754
1727
|
role: "heading"
|
|
1755
1728
|
});
|
|
1756
|
-
const Comp = asChild ?
|
|
1757
|
-
return /* @__PURE__ */
|
|
1729
|
+
const Comp = asChild ? Slot10 : Primitive10.div;
|
|
1730
|
+
return /* @__PURE__ */ React21.createElement(Comp, {
|
|
1758
1731
|
...rest,
|
|
1759
1732
|
className: tx("card.title", {}, className),
|
|
1760
1733
|
ref: forwardedRef
|
|
@@ -1764,9 +1737,9 @@ CardTitle.displayName = CARD_TITLE_NAME;
|
|
|
1764
1737
|
var CARD_BODY_NAME = "Card.Body";
|
|
1765
1738
|
var CardBody = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
1766
1739
|
const { className, ...rest } = composableProps(props);
|
|
1767
|
-
const Comp = asChild ?
|
|
1740
|
+
const Comp = asChild ? Slot10 : Primitive10.div;
|
|
1768
1741
|
const { tx } = useThemeContext();
|
|
1769
|
-
return /* @__PURE__ */
|
|
1742
|
+
return /* @__PURE__ */ React21.createElement(Comp, {
|
|
1770
1743
|
...rest,
|
|
1771
1744
|
className: tx("card.body", {}, className),
|
|
1772
1745
|
ref: forwardedRef
|
|
@@ -1776,53 +1749,52 @@ CardBody.displayName = CARD_BODY_NAME;
|
|
|
1776
1749
|
var CARD_SECTION_NAME = "Card.Section";
|
|
1777
1750
|
var CardSection = slottable(({ children, asChild, title, role, ...props }, forwardedRef) => {
|
|
1778
1751
|
const { className, ...rest } = composableProps(props);
|
|
1779
|
-
const Comp = asChild ?
|
|
1752
|
+
const Comp = asChild ? Slot10 : Primitive10.div;
|
|
1780
1753
|
const { tx } = useThemeContext();
|
|
1781
1754
|
const titleId = useId3();
|
|
1782
|
-
return /* @__PURE__ */
|
|
1755
|
+
return /* @__PURE__ */ React21.createElement(Comp, {
|
|
1783
1756
|
...rest,
|
|
1784
1757
|
role: role ?? (title ? "group" : "none"),
|
|
1785
1758
|
"aria-labelledby": title ? titleId : void 0,
|
|
1786
1759
|
className: tx("card.section", {}, className),
|
|
1787
1760
|
ref: forwardedRef
|
|
1788
|
-
}, title && /* @__PURE__ */
|
|
1761
|
+
}, title && /* @__PURE__ */ React21.createElement("div", {
|
|
1789
1762
|
id: titleId,
|
|
1790
1763
|
className: tx("card.section-title", {})
|
|
1791
1764
|
}, title), children);
|
|
1792
1765
|
});
|
|
1793
1766
|
CardSection.displayName = CARD_SECTION_NAME;
|
|
1794
1767
|
var CARD_ROW_NAME = "Card.Row";
|
|
1795
|
-
var CardRow = slottable(({ children, asChild,
|
|
1768
|
+
var CardRow = slottable(({ children, asChild, fullWidth, style, ...props }, forwardedRef) => {
|
|
1796
1769
|
const { tx } = useThemeContext();
|
|
1797
1770
|
const { className, ...rest } = composableProps(props);
|
|
1798
|
-
const Comp = asChild ?
|
|
1799
|
-
|
|
1800
|
-
classNames: "text-subdued",
|
|
1801
|
-
icon: iconProp,
|
|
1802
|
-
size: 4
|
|
1803
|
-
}) : iconProp ? iconProp : /* @__PURE__ */ React20.createElement("div", null);
|
|
1804
|
-
return /* @__PURE__ */ React20.createElement(Comp, {
|
|
1771
|
+
const Comp = asChild ? Slot10 : Primitive10.div;
|
|
1772
|
+
return /* @__PURE__ */ React21.createElement(Comp, {
|
|
1805
1773
|
...rest,
|
|
1774
|
+
style: {
|
|
1775
|
+
...iconSize(4),
|
|
1776
|
+
...style
|
|
1777
|
+
},
|
|
1806
1778
|
className: tx("card.row", {
|
|
1807
1779
|
fullWidth
|
|
1808
1780
|
}, className),
|
|
1809
1781
|
ref: forwardedRef
|
|
1810
|
-
},
|
|
1782
|
+
}, children);
|
|
1811
1783
|
});
|
|
1812
1784
|
CardRow.displayName = CARD_ROW_NAME;
|
|
1813
1785
|
var CARD_TEXT_NAME = "Card.Text";
|
|
1814
1786
|
var CardText = slottable(({ children, asChild, role, truncate, variant = "default", ...props }, forwardedRef) => {
|
|
1815
1787
|
const { tx } = useThemeContext();
|
|
1816
1788
|
const { className, ...rest } = composableProps(props);
|
|
1817
|
-
const Comp = asChild ?
|
|
1818
|
-
return /* @__PURE__ */
|
|
1789
|
+
const Comp = asChild ? Slot10 : Primitive10.div;
|
|
1790
|
+
return /* @__PURE__ */ React21.createElement(Comp, {
|
|
1819
1791
|
...rest,
|
|
1820
1792
|
role: role ?? "none",
|
|
1821
1793
|
className: tx("card.text", {
|
|
1822
1794
|
variant
|
|
1823
1795
|
}, className),
|
|
1824
1796
|
ref: forwardedRef
|
|
1825
|
-
}, /* @__PURE__ */
|
|
1797
|
+
}, /* @__PURE__ */ React21.createElement("span", {
|
|
1826
1798
|
className: tx("card.text-span", {
|
|
1827
1799
|
variant,
|
|
1828
1800
|
truncate
|
|
@@ -1836,7 +1808,7 @@ function CardHtml({ html = "", variant = "default", ...props }) {
|
|
|
1836
1808
|
const sanitized = useMemo5(() => DOMPurify.sanitize(html), [
|
|
1837
1809
|
html
|
|
1838
1810
|
]);
|
|
1839
|
-
return /* @__PURE__ */
|
|
1811
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
1840
1812
|
...props,
|
|
1841
1813
|
className: tx("card.text", {
|
|
1842
1814
|
variant
|
|
@@ -1849,13 +1821,11 @@ function CardHtml({ html = "", variant = "default", ...props }) {
|
|
|
1849
1821
|
}
|
|
1850
1822
|
CardHtml.displayName = CARD_HTML_NAME;
|
|
1851
1823
|
var CARD_POSTER_NAME = "Card.Poster";
|
|
1852
|
-
function CardPoster({ classNames, alt, aspect: aspectProp, image, icon, ...imageProps }) {
|
|
1824
|
+
function CardPoster({ classNames, alt, aspect: aspectProp, image, icon, fit = "cover", ...imageProps }) {
|
|
1853
1825
|
const { tx } = useThemeContext();
|
|
1854
1826
|
const aspect = aspectProp === "auto" ? "aspect-auto" : "aspect-video";
|
|
1855
1827
|
if (image) {
|
|
1856
|
-
return /* @__PURE__ */
|
|
1857
|
-
className: "col-span-full"
|
|
1858
|
-
}, /* @__PURE__ */ React20.createElement(Image, {
|
|
1828
|
+
return /* @__PURE__ */ React21.createElement(Image, {
|
|
1859
1829
|
classNames: [
|
|
1860
1830
|
tx("card.poster", {}),
|
|
1861
1831
|
aspect,
|
|
@@ -1863,18 +1833,19 @@ function CardPoster({ classNames, alt, aspect: aspectProp, image, icon, ...image
|
|
|
1863
1833
|
],
|
|
1864
1834
|
src: image,
|
|
1865
1835
|
alt,
|
|
1836
|
+
fit,
|
|
1866
1837
|
...imageProps
|
|
1867
|
-
})
|
|
1838
|
+
});
|
|
1868
1839
|
}
|
|
1869
1840
|
if (icon) {
|
|
1870
|
-
return /* @__PURE__ */
|
|
1841
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
1871
1842
|
role: "image",
|
|
1872
1843
|
className: tx("card.poster-icon", {}, [
|
|
1873
1844
|
aspect,
|
|
1874
1845
|
classNames
|
|
1875
1846
|
]),
|
|
1876
1847
|
"aria-label": alt
|
|
1877
|
-
}, /* @__PURE__ */
|
|
1848
|
+
}, /* @__PURE__ */ React21.createElement(Icon, {
|
|
1878
1849
|
icon,
|
|
1879
1850
|
size: 10
|
|
1880
1851
|
}));
|
|
@@ -1884,52 +1855,55 @@ CardPoster.displayName = CARD_POSTER_NAME;
|
|
|
1884
1855
|
var CARD_ACTION_NAME = "Card.Action";
|
|
1885
1856
|
function CardAction({ icon, actionIcon = "ph--arrow-right--regular", label, onClick }) {
|
|
1886
1857
|
const { tx } = useThemeContext();
|
|
1887
|
-
return /* @__PURE__ */
|
|
1858
|
+
return /* @__PURE__ */ React21.createElement(Button, {
|
|
1888
1859
|
variant: "ghost",
|
|
1889
1860
|
classNames: tx("card.action", {}),
|
|
1890
1861
|
onClick
|
|
1891
|
-
}, icon
|
|
1892
|
-
classNames: "text-subdued",
|
|
1862
|
+
}, icon && /* @__PURE__ */ React21.createElement(CardBlock, null, /* @__PURE__ */ React21.createElement(Icon, {
|
|
1893
1863
|
icon,
|
|
1894
1864
|
size: 4
|
|
1895
|
-
})
|
|
1896
|
-
className: tx("card.action-label", {}
|
|
1897
|
-
}, label), actionIcon && /* @__PURE__ */
|
|
1865
|
+
})), /* @__PURE__ */ React21.createElement("span", {
|
|
1866
|
+
className: tx("card.action-label", {})
|
|
1867
|
+
}, label), actionIcon && /* @__PURE__ */ React21.createElement(CardBlock, {
|
|
1868
|
+
end: true
|
|
1869
|
+
}, /* @__PURE__ */ React21.createElement(Icon, {
|
|
1898
1870
|
icon: actionIcon,
|
|
1899
1871
|
size: 4
|
|
1900
|
-
}));
|
|
1872
|
+
})));
|
|
1901
1873
|
}
|
|
1902
1874
|
CardAction.displayName = CARD_ACTION_NAME;
|
|
1903
1875
|
var CARD_LINK_NAME = "Card.Link";
|
|
1904
1876
|
function CardLink({ label, href }) {
|
|
1905
1877
|
const { tx } = useThemeContext();
|
|
1906
|
-
return /* @__PURE__ */
|
|
1878
|
+
return /* @__PURE__ */ React21.createElement("a", {
|
|
1907
1879
|
className: tx("card.link", {}),
|
|
1908
1880
|
"data-variant": "ghost",
|
|
1909
1881
|
href,
|
|
1910
1882
|
target: "_blank",
|
|
1911
1883
|
rel: "noreferrer"
|
|
1912
|
-
}, /* @__PURE__ */
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
}), /* @__PURE__ */
|
|
1884
|
+
}, /* @__PURE__ */ React21.createElement(CardBlock, null, /* @__PURE__ */ React21.createElement(Icon, {
|
|
1885
|
+
icon: "ph--link--regular",
|
|
1886
|
+
size: 4
|
|
1887
|
+
})), /* @__PURE__ */ React21.createElement("span", {
|
|
1916
1888
|
className: tx("card.link-label", {})
|
|
1917
|
-
}, label), /* @__PURE__ */
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
}
|
|
1889
|
+
}, label), /* @__PURE__ */ React21.createElement(CardBlock, {
|
|
1890
|
+
end: true,
|
|
1891
|
+
classNames: "invisible group-hover:visible"
|
|
1892
|
+
}, /* @__PURE__ */ React21.createElement(Icon, {
|
|
1893
|
+
icon: "ph--arrow-square-out--regular",
|
|
1894
|
+
size: 4
|
|
1895
|
+
})));
|
|
1921
1896
|
}
|
|
1922
1897
|
CardLink.displayName = CARD_LINK_NAME;
|
|
1923
1898
|
var Card = {
|
|
1924
1899
|
Root: CardRoot,
|
|
1925
1900
|
// Header
|
|
1926
1901
|
Header: CardHeader,
|
|
1927
|
-
// Header parts
|
|
1928
|
-
|
|
1902
|
+
// Header / row parts
|
|
1903
|
+
Block: CardBlock,
|
|
1929
1904
|
DragHandle: CardDragHandle,
|
|
1930
1905
|
ActionIconButton: CardActionIconButton,
|
|
1931
1906
|
Menu: CardMenu,
|
|
1932
|
-
Icon: CardIcon,
|
|
1933
1907
|
Title: CardTitle,
|
|
1934
1908
|
// Body
|
|
1935
1909
|
Body: CardBody,
|
|
@@ -1946,12 +1920,12 @@ var Card = {
|
|
|
1946
1920
|
// src/components/Carousel/Carousel.tsx
|
|
1947
1921
|
import { useArrowNavigationGroup } from "@fluentui/react-tabster";
|
|
1948
1922
|
import { createContext as createContext3 } from "@radix-ui/react-context";
|
|
1949
|
-
import
|
|
1950
|
-
import { mx as
|
|
1923
|
+
import React23, { useCallback as useCallback6, useEffect as useEffect3, useState as useState5 } from "react";
|
|
1924
|
+
import { mx as mx9 } from "@dxos/ui-theme";
|
|
1951
1925
|
|
|
1952
1926
|
// src/components/MediaPlayer/MediaPlayer.tsx
|
|
1953
|
-
import
|
|
1954
|
-
import { mx as
|
|
1927
|
+
import React22, { useState as useState4 } from "react";
|
|
1928
|
+
import { mx as mx8 } from "@dxos/ui-theme";
|
|
1955
1929
|
var FIT_CLASS = {
|
|
1956
1930
|
cover: "object-cover",
|
|
1957
1931
|
contain: "object-contain",
|
|
@@ -1994,8 +1968,8 @@ var MediaPlayer = ({ classNames, src, kind, controls = true, autoPlay = false, l
|
|
|
1994
1968
|
if (isEmbedUrl(src)) {
|
|
1995
1969
|
const resolved = kind ?? detectMediaKind(src) ?? "video";
|
|
1996
1970
|
if (resolved === "audio") {
|
|
1997
|
-
return /* @__PURE__ */
|
|
1998
|
-
className:
|
|
1971
|
+
return /* @__PURE__ */ React22.createElement("audio", {
|
|
1972
|
+
className: mx8("w-full", classNames),
|
|
1999
1973
|
src,
|
|
2000
1974
|
controls,
|
|
2001
1975
|
autoPlay,
|
|
@@ -2005,8 +1979,8 @@ var MediaPlayer = ({ classNames, src, kind, controls = true, autoPlay = false, l
|
|
|
2005
1979
|
"aria-label": alt
|
|
2006
1980
|
});
|
|
2007
1981
|
}
|
|
2008
|
-
return /* @__PURE__ */
|
|
2009
|
-
className:
|
|
1982
|
+
return /* @__PURE__ */ React22.createElement("video", {
|
|
1983
|
+
className: mx8("max-w-full max-h-full aspect-video", fitClass, classNames),
|
|
2010
1984
|
src,
|
|
2011
1985
|
controls,
|
|
2012
1986
|
autoPlay,
|
|
@@ -2017,15 +1991,15 @@ var MediaPlayer = ({ classNames, src, kind, controls = true, autoPlay = false, l
|
|
|
2017
1991
|
});
|
|
2018
1992
|
}
|
|
2019
1993
|
if (isCloudflareStreamEmbed(src)) {
|
|
2020
|
-
return /* @__PURE__ */
|
|
1994
|
+
return /* @__PURE__ */ React22.createElement(IframePlayer, {
|
|
2021
1995
|
key: src,
|
|
2022
1996
|
classNames,
|
|
2023
1997
|
src,
|
|
2024
1998
|
alt
|
|
2025
1999
|
});
|
|
2026
2000
|
}
|
|
2027
|
-
return /* @__PURE__ */
|
|
2028
|
-
className:
|
|
2001
|
+
return /* @__PURE__ */ React22.createElement("img", {
|
|
2002
|
+
className: mx8(fitClass, classNames),
|
|
2029
2003
|
src,
|
|
2030
2004
|
alt: alt ?? "",
|
|
2031
2005
|
loading: "lazy",
|
|
@@ -2036,13 +2010,13 @@ var MediaPlayer = ({ classNames, src, kind, controls = true, autoPlay = false, l
|
|
|
2036
2010
|
};
|
|
2037
2011
|
var IframePlayer = ({ src, alt, classNames }) => {
|
|
2038
2012
|
const [loaded, setLoaded] = useState4(false);
|
|
2039
|
-
return /* @__PURE__ */
|
|
2040
|
-
className:
|
|
2041
|
-
}, /* @__PURE__ */
|
|
2013
|
+
return /* @__PURE__ */ React22.createElement("div", {
|
|
2014
|
+
className: mx8("relative bg-baseSurface", classNames)
|
|
2015
|
+
}, /* @__PURE__ */ React22.createElement("iframe", {
|
|
2042
2016
|
src,
|
|
2043
2017
|
title: alt ?? "Embedded media",
|
|
2044
2018
|
loading: "lazy",
|
|
2045
|
-
className:
|
|
2019
|
+
className: mx8("border-none w-full h-full transition-opacity duration-150", loaded ? "opacity-100" : "opacity-0"),
|
|
2046
2020
|
style: {
|
|
2047
2021
|
colorScheme: "dark"
|
|
2048
2022
|
},
|
|
@@ -2080,17 +2054,17 @@ var CarouselRoot = ({ children, count, autorun = false, intervalMs = 5e3, defaul
|
|
|
2080
2054
|
count,
|
|
2081
2055
|
intervalMs
|
|
2082
2056
|
]);
|
|
2083
|
-
const setIndex =
|
|
2057
|
+
const setIndex = useCallback6((next2) => {
|
|
2084
2058
|
setAutoAdvance(false);
|
|
2085
2059
|
setIndexState(next2);
|
|
2086
2060
|
}, []);
|
|
2087
|
-
const next =
|
|
2061
|
+
const next = useCallback6(() => {
|
|
2088
2062
|
setAutoAdvance(false);
|
|
2089
2063
|
setIndexState((i) => (i + 1) % count);
|
|
2090
2064
|
}, [
|
|
2091
2065
|
count
|
|
2092
2066
|
]);
|
|
2093
|
-
const prev =
|
|
2067
|
+
const prev = useCallback6(() => {
|
|
2094
2068
|
setAutoAdvance(false);
|
|
2095
2069
|
setIndexState((i) => (i - 1 + count) % count);
|
|
2096
2070
|
}, [
|
|
@@ -2099,7 +2073,7 @@ var CarouselRoot = ({ children, count, autorun = false, intervalMs = 5e3, defaul
|
|
|
2099
2073
|
if (count === 0) {
|
|
2100
2074
|
return null;
|
|
2101
2075
|
}
|
|
2102
|
-
return /* @__PURE__ */
|
|
2076
|
+
return /* @__PURE__ */ React23.createElement(CarouselProvider, {
|
|
2103
2077
|
index,
|
|
2104
2078
|
count,
|
|
2105
2079
|
setIndex,
|
|
@@ -2114,7 +2088,7 @@ var CarouselContent = composable(({ children, ...props }, forwardedRef) => (
|
|
|
2114
2088
|
// its content height. With no parent height constraint, the `1fr` row simply tracks
|
|
2115
2089
|
// row-1 content — preserving the existing aspect-video behaviour for unbounded use.
|
|
2116
2090
|
// TODO(burdon): Move to Carousel.theme.ts
|
|
2117
|
-
/* @__PURE__ */
|
|
2091
|
+
/* @__PURE__ */ React23.createElement("div", {
|
|
2118
2092
|
...composableProps(props, {
|
|
2119
2093
|
classNames: "w-full grid grid-cols-[min-content_1fr_min-content] grid-rows-[minmax(0,1fr)_auto] gap-4 items-center"
|
|
2120
2094
|
}),
|
|
@@ -2125,7 +2099,7 @@ CarouselContent.displayName = "Carousel.Content";
|
|
|
2125
2099
|
var CarouselViewport = ({ children, classNames }) => {
|
|
2126
2100
|
const { t } = useTranslation(translationKey);
|
|
2127
2101
|
const { count, next, prev } = useCarousel();
|
|
2128
|
-
const handleKeyDown =
|
|
2102
|
+
const handleKeyDown = useCallback6((event) => {
|
|
2129
2103
|
if (count <= 1) {
|
|
2130
2104
|
return;
|
|
2131
2105
|
}
|
|
@@ -2141,9 +2115,9 @@ var CarouselViewport = ({ children, classNames }) => {
|
|
|
2141
2115
|
next,
|
|
2142
2116
|
prev
|
|
2143
2117
|
]);
|
|
2144
|
-
return /* @__PURE__ */
|
|
2118
|
+
return /* @__PURE__ */ React23.createElement("div", {
|
|
2145
2119
|
// TODO(burdon): Move to ui-theme.
|
|
2146
|
-
className:
|
|
2120
|
+
className: mx9("relative w-full aspect-video overflow-hidden", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500", classNames),
|
|
2147
2121
|
tabIndex: 0,
|
|
2148
2122
|
role: "region",
|
|
2149
2123
|
"aria-roledescription": "carousel",
|
|
@@ -2157,9 +2131,9 @@ var CarouselSlide = ({ index, classNames, src, kind, alt, controls, autoPlay, lo
|
|
|
2157
2131
|
if (active !== index) {
|
|
2158
2132
|
return null;
|
|
2159
2133
|
}
|
|
2160
|
-
return /* @__PURE__ */
|
|
2161
|
-
className:
|
|
2162
|
-
}, /* @__PURE__ */
|
|
2134
|
+
return /* @__PURE__ */ React23.createElement("div", {
|
|
2135
|
+
className: mx9("absolute inset-0 w-full h-full bg-baseSurface", classNames)
|
|
2136
|
+
}, /* @__PURE__ */ React23.createElement(MediaPlayer, {
|
|
2163
2137
|
src,
|
|
2164
2138
|
kind,
|
|
2165
2139
|
alt,
|
|
@@ -2176,10 +2150,10 @@ var CarouselPrevious = ({ classNames }) => {
|
|
|
2176
2150
|
const { t } = useTranslation(translationKey);
|
|
2177
2151
|
const { count, prev } = useCarousel();
|
|
2178
2152
|
if (count <= 1) {
|
|
2179
|
-
return /* @__PURE__ */
|
|
2153
|
+
return /* @__PURE__ */ React23.createElement("div", null);
|
|
2180
2154
|
}
|
|
2181
|
-
return /* @__PURE__ */
|
|
2182
|
-
classNames:
|
|
2155
|
+
return /* @__PURE__ */ React23.createElement(IconButton, {
|
|
2156
|
+
classNames: mx9("self-center", classNames),
|
|
2183
2157
|
square: true,
|
|
2184
2158
|
variant: "ghost",
|
|
2185
2159
|
icon: "ph--caret-left--regular",
|
|
@@ -2193,10 +2167,10 @@ var CarouselNext = ({ classNames }) => {
|
|
|
2193
2167
|
const { t } = useTranslation(translationKey);
|
|
2194
2168
|
const { count, next } = useCarousel();
|
|
2195
2169
|
if (count <= 1) {
|
|
2196
|
-
return /* @__PURE__ */
|
|
2170
|
+
return /* @__PURE__ */ React23.createElement("div", null);
|
|
2197
2171
|
}
|
|
2198
|
-
return /* @__PURE__ */
|
|
2199
|
-
classNames:
|
|
2172
|
+
return /* @__PURE__ */ React23.createElement(IconButton, {
|
|
2173
|
+
classNames: mx9("self-center", classNames),
|
|
2200
2174
|
square: true,
|
|
2201
2175
|
variant: "ghost",
|
|
2202
2176
|
icon: "ph--caret-right--regular",
|
|
@@ -2216,16 +2190,16 @@ var CarouselIndicators = ({ classNames }) => {
|
|
|
2216
2190
|
if (count <= 1) {
|
|
2217
2191
|
return null;
|
|
2218
2192
|
}
|
|
2219
|
-
return /* @__PURE__ */
|
|
2193
|
+
return /* @__PURE__ */ React23.createElement("div", {
|
|
2220
2194
|
className: "col-start-2 overflow-hidden"
|
|
2221
|
-
}, /* @__PURE__ */
|
|
2195
|
+
}, /* @__PURE__ */ React23.createElement("div", {
|
|
2222
2196
|
...arrowNavigationAttrs,
|
|
2223
|
-
className:
|
|
2197
|
+
className: mx9("flex items-center justify-center", classNames),
|
|
2224
2198
|
role: "tablist",
|
|
2225
2199
|
"aria-label": t("carousel-indicators.label")
|
|
2226
2200
|
}, Array.from({
|
|
2227
2201
|
length: count
|
|
2228
|
-
}).map((_, i) => /* @__PURE__ */
|
|
2202
|
+
}).map((_, i) => /* @__PURE__ */ React23.createElement(IconButton, {
|
|
2229
2203
|
key: i,
|
|
2230
2204
|
role: "tab",
|
|
2231
2205
|
"aria-selected": i === index,
|
|
@@ -2250,10 +2224,10 @@ var CarouselCaption = ({ children, classNames }) => {
|
|
|
2250
2224
|
}
|
|
2251
2225
|
return (
|
|
2252
2226
|
// TODO(burdon): Move to ui-theme.
|
|
2253
|
-
/* @__PURE__ */
|
|
2227
|
+
/* @__PURE__ */ React23.createElement("div", {
|
|
2254
2228
|
className: "col-start-2"
|
|
2255
|
-
}, /* @__PURE__ */
|
|
2256
|
-
className:
|
|
2229
|
+
}, /* @__PURE__ */ React23.createElement("p", {
|
|
2230
|
+
className: mx9("text-center text-description", classNames)
|
|
2257
2231
|
}, content))
|
|
2258
2232
|
);
|
|
2259
2233
|
};
|
|
@@ -2270,7 +2244,7 @@ var Carousel = {
|
|
|
2270
2244
|
};
|
|
2271
2245
|
|
|
2272
2246
|
// src/components/Clipboard/ClipboardProvider.tsx
|
|
2273
|
-
import
|
|
2247
|
+
import React24, { createContext as createContext4, useCallback as useCallback7, useContext as useContext3, useState as useState6 } from "react";
|
|
2274
2248
|
var ClipboardContext = /* @__PURE__ */ createContext4({
|
|
2275
2249
|
textValue: "",
|
|
2276
2250
|
setTextValue: async (_) => {
|
|
@@ -2279,11 +2253,11 @@ var ClipboardContext = /* @__PURE__ */ createContext4({
|
|
|
2279
2253
|
var useClipboard = () => useContext3(ClipboardContext);
|
|
2280
2254
|
var ClipboardProvider = ({ children }) => {
|
|
2281
2255
|
const [textValue, setInternalTextValue] = useState6("");
|
|
2282
|
-
const setTextValue =
|
|
2256
|
+
const setTextValue = useCallback7(async (nextValue) => {
|
|
2283
2257
|
await navigator.clipboard.writeText(nextValue);
|
|
2284
2258
|
return setInternalTextValue(nextValue);
|
|
2285
2259
|
}, []);
|
|
2286
|
-
return /* @__PURE__ */
|
|
2260
|
+
return /* @__PURE__ */ React24.createElement(ClipboardContext.Provider, {
|
|
2287
2261
|
value: {
|
|
2288
2262
|
textValue,
|
|
2289
2263
|
setTextValue
|
|
@@ -2292,14 +2266,14 @@ var ClipboardProvider = ({ children }) => {
|
|
|
2292
2266
|
};
|
|
2293
2267
|
|
|
2294
2268
|
// src/components/Clipboard/CopyButton.tsx
|
|
2295
|
-
import
|
|
2296
|
-
import { mx as
|
|
2269
|
+
import React25 from "react";
|
|
2270
|
+
import { mx as mx10, osTranslations } from "@dxos/ui-theme";
|
|
2297
2271
|
var inactiveLabelStyles = "invisible h-px -mb-px overflow-hidden";
|
|
2298
2272
|
var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
2299
2273
|
const { t } = useTranslation(osTranslations);
|
|
2300
2274
|
const { textValue, setTextValue } = useClipboard();
|
|
2301
2275
|
const isCopied = textValue === value;
|
|
2302
|
-
return /* @__PURE__ */
|
|
2276
|
+
return /* @__PURE__ */ React25.createElement(Button, {
|
|
2303
2277
|
...props,
|
|
2304
2278
|
classNames: [
|
|
2305
2279
|
"inline-flex flex-col justify-center",
|
|
@@ -2307,18 +2281,18 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
2307
2281
|
],
|
|
2308
2282
|
onClick: () => setTextValue(value),
|
|
2309
2283
|
"data-testid": "copy-invitation"
|
|
2310
|
-
}, /* @__PURE__ */
|
|
2311
|
-
className:
|
|
2312
|
-
}, /* @__PURE__ */
|
|
2284
|
+
}, /* @__PURE__ */ React25.createElement("div", {
|
|
2285
|
+
className: mx10("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
2286
|
+
}, /* @__PURE__ */ React25.createElement("span", {
|
|
2313
2287
|
className: "px-1"
|
|
2314
|
-
}, t("copy.label")), /* @__PURE__ */
|
|
2288
|
+
}, t("copy.label")), /* @__PURE__ */ React25.createElement(Icon, {
|
|
2315
2289
|
icon: "ph--copy--regular",
|
|
2316
2290
|
size
|
|
2317
|
-
})), /* @__PURE__ */
|
|
2318
|
-
className:
|
|
2319
|
-
}, /* @__PURE__ */
|
|
2291
|
+
})), /* @__PURE__ */ React25.createElement("div", {
|
|
2292
|
+
className: mx10("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
2293
|
+
}, /* @__PURE__ */ React25.createElement("span", {
|
|
2320
2294
|
className: "px-1"
|
|
2321
|
-
}, t("copy-success.label")), /* @__PURE__ */
|
|
2295
|
+
}, t("copy-success.label")), /* @__PURE__ */ React25.createElement(Icon, {
|
|
2322
2296
|
icon: "ph--check--regular",
|
|
2323
2297
|
size
|
|
2324
2298
|
})));
|
|
@@ -2329,7 +2303,7 @@ var CopyButtonIconOnly = ({ __scopeTooltip, value, classNames, size, variant, ..
|
|
|
2329
2303
|
const isCopied = textValue === value;
|
|
2330
2304
|
const label = isCopied ? t("copy-success.label") : props.label ?? t("copy.label");
|
|
2331
2305
|
const { onOpen } = useTooltipContext("CopyButton", __scopeTooltip);
|
|
2332
|
-
return /* @__PURE__ */
|
|
2306
|
+
return /* @__PURE__ */ React25.createElement(IconButton, {
|
|
2333
2307
|
iconOnly: true,
|
|
2334
2308
|
label,
|
|
2335
2309
|
icon: "ph--copy--regular",
|
|
@@ -2354,11 +2328,11 @@ var Clipboard = {
|
|
|
2354
2328
|
// src/components/DatePicker/DatePicker.tsx
|
|
2355
2329
|
import { createContext as createContext5 } from "@radix-ui/react-context";
|
|
2356
2330
|
import { format as formatDate } from "date-fns";
|
|
2357
|
-
import
|
|
2331
|
+
import React27, { forwardRef as forwardRef19, useCallback as useCallback9, useState as useState8 } from "react";
|
|
2358
2332
|
|
|
2359
2333
|
// src/components/Popover/Popover.tsx
|
|
2360
2334
|
import { composeEventHandlers as composeEventHandlers2 } from "@radix-ui/primitive";
|
|
2361
|
-
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
2335
|
+
import { useComposedRefs as useComposedRefs2 } from "@radix-ui/react-compose-refs";
|
|
2362
2336
|
import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
|
|
2363
2337
|
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
|
2364
2338
|
import { useFocusGuards } from "@radix-ui/react-focus-guards";
|
|
@@ -2368,11 +2342,11 @@ import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
|
2368
2342
|
import { createPopperScope } from "@radix-ui/react-popper";
|
|
2369
2343
|
import { Portal as PortalPrimitive } from "@radix-ui/react-portal";
|
|
2370
2344
|
import { Presence } from "@radix-ui/react-presence";
|
|
2371
|
-
import { Primitive as
|
|
2372
|
-
import { Slot as
|
|
2345
|
+
import { Primitive as Primitive11 } from "@radix-ui/react-primitive";
|
|
2346
|
+
import { Slot as Slot11 } from "@radix-ui/react-slot";
|
|
2373
2347
|
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
2374
2348
|
import { hideOthers } from "aria-hidden";
|
|
2375
|
-
import
|
|
2349
|
+
import React26, { forwardRef as forwardRef18, useCallback as useCallback8, useEffect as useEffect4, useMemo as useMemo6, useRef as useRef4, useState as useState7 } from "react";
|
|
2376
2350
|
import { RemoveScroll } from "react-remove-scroll";
|
|
2377
2351
|
var POPOVER_NAME = "Popover";
|
|
2378
2352
|
var [createPopoverContext, createPopoverScope] = createContextScope2(POPOVER_NAME, [
|
|
@@ -2383,31 +2357,31 @@ var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
|
2383
2357
|
var PopoverRoot = (props) => {
|
|
2384
2358
|
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
2385
2359
|
const popperScope = usePopperScope(__scopePopover);
|
|
2386
|
-
const triggerRef =
|
|
2360
|
+
const triggerRef = useRef4(null);
|
|
2387
2361
|
const [hasCustomAnchor, setHasCustomAnchor] = useState7(false);
|
|
2388
2362
|
const [open = false, setOpen] = useControllableState2({
|
|
2389
2363
|
prop: openProp,
|
|
2390
2364
|
defaultProp: defaultOpen,
|
|
2391
2365
|
onChange: onOpenChange
|
|
2392
2366
|
});
|
|
2393
|
-
return /* @__PURE__ */
|
|
2367
|
+
return /* @__PURE__ */ React26.createElement(PopperPrimitive.Root, popperScope, /* @__PURE__ */ React26.createElement(PopoverProvider, {
|
|
2394
2368
|
scope: __scopePopover,
|
|
2395
2369
|
contentId: useId4(),
|
|
2396
2370
|
triggerRef,
|
|
2397
2371
|
open,
|
|
2398
2372
|
onOpenChange: setOpen,
|
|
2399
|
-
onOpenToggle:
|
|
2373
|
+
onOpenToggle: useCallback8(() => setOpen((prevOpen) => !prevOpen), [
|
|
2400
2374
|
setOpen
|
|
2401
2375
|
]),
|
|
2402
2376
|
hasCustomAnchor,
|
|
2403
|
-
onCustomAnchorAdd:
|
|
2404
|
-
onCustomAnchorRemove:
|
|
2377
|
+
onCustomAnchorAdd: useCallback8(() => setHasCustomAnchor(true), []),
|
|
2378
|
+
onCustomAnchorRemove: useCallback8(() => setHasCustomAnchor(false), []),
|
|
2405
2379
|
modal
|
|
2406
2380
|
}, children));
|
|
2407
2381
|
};
|
|
2408
2382
|
PopoverRoot.displayName = POPOVER_NAME;
|
|
2409
2383
|
var ANCHOR_NAME = "Popover.Anchor";
|
|
2410
|
-
var PopoverAnchor = /* @__PURE__ */
|
|
2384
|
+
var PopoverAnchor = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2411
2385
|
const { __scopePopover, ...anchorProps } = props;
|
|
2412
2386
|
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
2413
2387
|
const popperScope = usePopperScope(__scopePopover);
|
|
@@ -2419,7 +2393,7 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
|
2419
2393
|
onCustomAnchorAdd,
|
|
2420
2394
|
onCustomAnchorRemove
|
|
2421
2395
|
]);
|
|
2422
|
-
return /* @__PURE__ */
|
|
2396
|
+
return /* @__PURE__ */ React26.createElement(PopperPrimitive.Anchor, {
|
|
2423
2397
|
...popperScope,
|
|
2424
2398
|
...anchorProps,
|
|
2425
2399
|
ref: forwardedRef
|
|
@@ -2427,13 +2401,13 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
|
2427
2401
|
});
|
|
2428
2402
|
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
2429
2403
|
var TRIGGER_NAME2 = "Popover.Trigger";
|
|
2430
|
-
var PopoverTrigger = /* @__PURE__ */
|
|
2404
|
+
var PopoverTrigger = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2431
2405
|
const { __scopePopover, asChild, ...triggerProps } = props;
|
|
2432
2406
|
const context = usePopoverContext(TRIGGER_NAME2, __scopePopover);
|
|
2433
2407
|
const popperScope = usePopperScope(__scopePopover);
|
|
2434
|
-
const composedTriggerRef =
|
|
2435
|
-
const Comp = asChild ?
|
|
2436
|
-
const trigger = /* @__PURE__ */
|
|
2408
|
+
const composedTriggerRef = useComposedRefs2(forwardedRef, context.triggerRef);
|
|
2409
|
+
const Comp = asChild ? Slot11 : Primitive11.button;
|
|
2410
|
+
const trigger = /* @__PURE__ */ React26.createElement(Comp, {
|
|
2437
2411
|
type: "button",
|
|
2438
2412
|
"aria-haspopup": "dialog",
|
|
2439
2413
|
"aria-expanded": context.open,
|
|
@@ -2443,7 +2417,7 @@ var PopoverTrigger = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
|
2443
2417
|
ref: composedTriggerRef,
|
|
2444
2418
|
onClick: composeEventHandlers2(props.onClick, context.onOpenToggle)
|
|
2445
2419
|
});
|
|
2446
|
-
return context.hasCustomAnchor ? trigger : /* @__PURE__ */
|
|
2420
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ React26.createElement(PopperPrimitive.Anchor, {
|
|
2447
2421
|
asChild: true,
|
|
2448
2422
|
...popperScope
|
|
2449
2423
|
}, trigger);
|
|
@@ -2459,7 +2433,7 @@ var PopoverVirtualTrigger = (props) => {
|
|
|
2459
2433
|
context.triggerRef.current = virtualRef.current;
|
|
2460
2434
|
}
|
|
2461
2435
|
});
|
|
2462
|
-
return /* @__PURE__ */
|
|
2436
|
+
return /* @__PURE__ */ React26.createElement(PopperPrimitive.Anchor, {
|
|
2463
2437
|
...popperScope,
|
|
2464
2438
|
virtualRef
|
|
2465
2439
|
});
|
|
@@ -2472,48 +2446,48 @@ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME2, {
|
|
|
2472
2446
|
var PopoverPortal = (props) => {
|
|
2473
2447
|
const { __scopePopover, forceMount, children, container } = props;
|
|
2474
2448
|
const context = usePopoverContext(PORTAL_NAME2, __scopePopover);
|
|
2475
|
-
return /* @__PURE__ */
|
|
2449
|
+
return /* @__PURE__ */ React26.createElement(PortalProvider, {
|
|
2476
2450
|
scope: __scopePopover,
|
|
2477
2451
|
forceMount
|
|
2478
|
-
}, /* @__PURE__ */
|
|
2452
|
+
}, /* @__PURE__ */ React26.createElement(Presence, {
|
|
2479
2453
|
present: forceMount || context.open
|
|
2480
|
-
}, /* @__PURE__ */
|
|
2454
|
+
}, /* @__PURE__ */ React26.createElement(PortalPrimitive, {
|
|
2481
2455
|
asChild: true,
|
|
2482
2456
|
container
|
|
2483
2457
|
}, children)));
|
|
2484
2458
|
};
|
|
2485
2459
|
PopoverPortal.displayName = PORTAL_NAME2;
|
|
2486
2460
|
var CONTENT_NAME2 = "Popover.Content";
|
|
2487
|
-
var PopoverContent = /* @__PURE__ */
|
|
2461
|
+
var PopoverContent = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2488
2462
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
|
|
2489
2463
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
2490
2464
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2491
|
-
return /* @__PURE__ */
|
|
2465
|
+
return /* @__PURE__ */ React26.createElement(Presence, {
|
|
2492
2466
|
present: forceMount || context.open
|
|
2493
|
-
}, context.modal ? /* @__PURE__ */
|
|
2467
|
+
}, context.modal ? /* @__PURE__ */ React26.createElement(PopoverContentModal, {
|
|
2494
2468
|
...contentProps,
|
|
2495
2469
|
ref: forwardedRef
|
|
2496
|
-
}) : /* @__PURE__ */
|
|
2470
|
+
}) : /* @__PURE__ */ React26.createElement(PopoverContentNonModal, {
|
|
2497
2471
|
...contentProps,
|
|
2498
2472
|
ref: forwardedRef
|
|
2499
2473
|
}));
|
|
2500
2474
|
});
|
|
2501
2475
|
PopoverContent.displayName = CONTENT_NAME2;
|
|
2502
|
-
var PopoverContentModal = /* @__PURE__ */
|
|
2476
|
+
var PopoverContentModal = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2503
2477
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2504
|
-
const contentRef =
|
|
2505
|
-
const composedRefs =
|
|
2506
|
-
const isRightClickOutsideRef =
|
|
2478
|
+
const contentRef = useRef4(null);
|
|
2479
|
+
const composedRefs = useComposedRefs2(forwardedRef, contentRef);
|
|
2480
|
+
const isRightClickOutsideRef = useRef4(false);
|
|
2507
2481
|
useEffect4(() => {
|
|
2508
2482
|
const content = contentRef.current;
|
|
2509
2483
|
if (content) {
|
|
2510
2484
|
return hideOthers(content);
|
|
2511
2485
|
}
|
|
2512
2486
|
}, []);
|
|
2513
|
-
return /* @__PURE__ */
|
|
2514
|
-
as:
|
|
2487
|
+
return /* @__PURE__ */ React26.createElement(RemoveScroll, {
|
|
2488
|
+
as: Slot11,
|
|
2515
2489
|
allowPinchZoom: true
|
|
2516
|
-
}, /* @__PURE__ */
|
|
2490
|
+
}, /* @__PURE__ */ React26.createElement(PopoverContentImpl, {
|
|
2517
2491
|
...props,
|
|
2518
2492
|
ref: composedRefs,
|
|
2519
2493
|
// Make sure we're not trapping once it's been closed (closed !== unmounted when animating out).
|
|
@@ -2540,11 +2514,11 @@ var PopoverContentModal = /* @__PURE__ */ forwardRef17((props, forwardedRef) =>
|
|
|
2540
2514
|
})
|
|
2541
2515
|
}));
|
|
2542
2516
|
});
|
|
2543
|
-
var PopoverContentNonModal = /* @__PURE__ */
|
|
2517
|
+
var PopoverContentNonModal = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2544
2518
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2545
|
-
const hasInteractedOutsideRef =
|
|
2546
|
-
const hasPointerDownOutsideRef =
|
|
2547
|
-
return /* @__PURE__ */
|
|
2519
|
+
const hasInteractedOutsideRef = useRef4(false);
|
|
2520
|
+
const hasPointerDownOutsideRef = useRef4(false);
|
|
2521
|
+
return /* @__PURE__ */ React26.createElement(PopoverContentImpl, {
|
|
2548
2522
|
...props,
|
|
2549
2523
|
ref: forwardedRef,
|
|
2550
2524
|
trapFocus: false,
|
|
@@ -2579,7 +2553,7 @@ var PopoverContentNonModal = /* @__PURE__ */ forwardRef17((props, forwardedRef)
|
|
|
2579
2553
|
}
|
|
2580
2554
|
});
|
|
2581
2555
|
});
|
|
2582
|
-
var PopoverContentImpl = /* @__PURE__ */
|
|
2556
|
+
var PopoverContentImpl = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2583
2557
|
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, collisionPadding = 8, collisionBoundary, classNames, ...contentProps } = props;
|
|
2584
2558
|
const context = usePopoverContext(CONTENT_NAME2, __scopePopover);
|
|
2585
2559
|
const popperScope = usePopperScope(__scopePopover);
|
|
@@ -2603,13 +2577,13 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
|
2603
2577
|
collisionBoundary,
|
|
2604
2578
|
context.triggerRef.current
|
|
2605
2579
|
]);
|
|
2606
|
-
return /* @__PURE__ */
|
|
2580
|
+
return /* @__PURE__ */ React26.createElement(FocusScope, {
|
|
2607
2581
|
asChild: true,
|
|
2608
2582
|
loop: true,
|
|
2609
2583
|
trapped: trapFocus,
|
|
2610
2584
|
onMountAutoFocus: onOpenAutoFocus,
|
|
2611
2585
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
2612
|
-
}, /* @__PURE__ */
|
|
2586
|
+
}, /* @__PURE__ */ React26.createElement(DismissableLayer, {
|
|
2613
2587
|
asChild: true,
|
|
2614
2588
|
disableOutsidePointerEvents,
|
|
2615
2589
|
onInteractOutside,
|
|
@@ -2617,7 +2591,7 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
|
2617
2591
|
onPointerDownOutside,
|
|
2618
2592
|
onFocusOutside,
|
|
2619
2593
|
onDismiss: () => context.onOpenChange(false)
|
|
2620
|
-
}, /* @__PURE__ */
|
|
2594
|
+
}, /* @__PURE__ */ React26.createElement(PopperPrimitive.Content, {
|
|
2621
2595
|
"data-state": getState(context.open),
|
|
2622
2596
|
role: "dialog",
|
|
2623
2597
|
id: context.contentId,
|
|
@@ -2643,10 +2617,10 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
|
2643
2617
|
})));
|
|
2644
2618
|
});
|
|
2645
2619
|
var CLOSE_NAME = "Popover.Close";
|
|
2646
|
-
var PopoverClose = /* @__PURE__ */
|
|
2620
|
+
var PopoverClose = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2647
2621
|
const { __scopePopover, ...closeProps } = props;
|
|
2648
2622
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
2649
|
-
return /* @__PURE__ */
|
|
2623
|
+
return /* @__PURE__ */ React26.createElement(Primitive11.button, {
|
|
2650
2624
|
type: "button",
|
|
2651
2625
|
...closeProps,
|
|
2652
2626
|
ref: forwardedRef,
|
|
@@ -2655,11 +2629,11 @@ var PopoverClose = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
|
2655
2629
|
});
|
|
2656
2630
|
PopoverClose.displayName = CLOSE_NAME;
|
|
2657
2631
|
var ARROW_NAME2 = "Popover.Arrow";
|
|
2658
|
-
var PopoverArrow = /* @__PURE__ */
|
|
2632
|
+
var PopoverArrow = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2659
2633
|
const { __scopePopover, classNames, ...arrowProps } = props;
|
|
2660
2634
|
const popperScope = usePopperScope(__scopePopover);
|
|
2661
2635
|
const { tx } = useThemeContext();
|
|
2662
|
-
return /* @__PURE__ */
|
|
2636
|
+
return /* @__PURE__ */ React26.createElement(PopperPrimitive.Arrow, {
|
|
2663
2637
|
...popperScope,
|
|
2664
2638
|
...arrowProps,
|
|
2665
2639
|
className: tx("popover.arrow", {}, classNames),
|
|
@@ -2667,10 +2641,10 @@ var PopoverArrow = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
|
2667
2641
|
});
|
|
2668
2642
|
});
|
|
2669
2643
|
PopoverArrow.displayName = ARROW_NAME2;
|
|
2670
|
-
var PopoverViewport = /* @__PURE__ */
|
|
2644
|
+
var PopoverViewport = /* @__PURE__ */ forwardRef18(({ classNames, asChild, constrainInline = true, constrainBlock = true, children, ...props }, forwardedRef) => {
|
|
2671
2645
|
const { tx } = useThemeContext();
|
|
2672
|
-
const Comp = asChild ?
|
|
2673
|
-
return /* @__PURE__ */
|
|
2646
|
+
const Comp = asChild ? Slot11 : Primitive11.div;
|
|
2647
|
+
return /* @__PURE__ */ React26.createElement(Comp, {
|
|
2674
2648
|
...props,
|
|
2675
2649
|
className: tx("popover.viewport", {
|
|
2676
2650
|
constrainInline,
|
|
@@ -2699,7 +2673,7 @@ var DatePickerRoot = ({ mode = "single", value, defaultValue, onValueChange, wit
|
|
|
2699
2673
|
const [internalOpen, setInternalOpen] = useState8(defaultOpen ?? false);
|
|
2700
2674
|
const controlled = value !== void 0 || onValueChange !== void 0;
|
|
2701
2675
|
const resolvedValue = controlled ? value : internalValue;
|
|
2702
|
-
const setValue =
|
|
2676
|
+
const setValue = useCallback9((next) => {
|
|
2703
2677
|
if (!controlled) {
|
|
2704
2678
|
setInternalValue(next);
|
|
2705
2679
|
}
|
|
@@ -2709,7 +2683,7 @@ var DatePickerRoot = ({ mode = "single", value, defaultValue, onValueChange, wit
|
|
|
2709
2683
|
onValueChange
|
|
2710
2684
|
]);
|
|
2711
2685
|
const resolvedOpen = open ?? internalOpen;
|
|
2712
|
-
const handleOpenChange =
|
|
2686
|
+
const handleOpenChange = useCallback9((next) => {
|
|
2713
2687
|
if (open === void 0) {
|
|
2714
2688
|
setInternalOpen(next);
|
|
2715
2689
|
}
|
|
@@ -2718,14 +2692,14 @@ var DatePickerRoot = ({ mode = "single", value, defaultValue, onValueChange, wit
|
|
|
2718
2692
|
open,
|
|
2719
2693
|
onOpenChange
|
|
2720
2694
|
]);
|
|
2721
|
-
return /* @__PURE__ */
|
|
2695
|
+
return /* @__PURE__ */ React27.createElement(DatePickerProvider, {
|
|
2722
2696
|
mode,
|
|
2723
2697
|
value: resolvedValue,
|
|
2724
2698
|
setValue,
|
|
2725
2699
|
withTime,
|
|
2726
2700
|
open: resolvedOpen,
|
|
2727
2701
|
onOpenChange: handleOpenChange
|
|
2728
|
-
}, /* @__PURE__ */
|
|
2702
|
+
}, /* @__PURE__ */ React27.createElement(Popover.Root, {
|
|
2729
2703
|
open: resolvedOpen,
|
|
2730
2704
|
onOpenChange: handleOpenChange
|
|
2731
2705
|
}, children));
|
|
@@ -2746,36 +2720,36 @@ var formatValue = (mode, value, fmt) => {
|
|
|
2746
2720
|
}
|
|
2747
2721
|
}
|
|
2748
2722
|
};
|
|
2749
|
-
var DatePickerTrigger = /* @__PURE__ */
|
|
2723
|
+
var DatePickerTrigger = /* @__PURE__ */ forwardRef19(({ classNames, format: fmt = "PPP", placeholder, icon = true, children, ...props }, forwardedRef) => {
|
|
2750
2724
|
const { tx } = useThemeContext();
|
|
2751
2725
|
const { t } = useTranslation(translationKey);
|
|
2752
2726
|
const { mode, value } = useDatePickerContext("DatePickerTrigger");
|
|
2753
2727
|
const placeholderText = placeholder ?? t(`date-picker.placeholder.${mode}.label`);
|
|
2754
2728
|
const label = formatValue(mode, value, fmt) ?? placeholderText;
|
|
2755
2729
|
const hasValue = label !== placeholderText;
|
|
2756
|
-
return /* @__PURE__ */
|
|
2730
|
+
return /* @__PURE__ */ React27.createElement(Popover.Trigger, {
|
|
2757
2731
|
asChild: true
|
|
2758
|
-
}, /* @__PURE__ */
|
|
2732
|
+
}, /* @__PURE__ */ React27.createElement("button", {
|
|
2759
2733
|
ref: forwardedRef,
|
|
2760
2734
|
type: "button",
|
|
2761
2735
|
...props,
|
|
2762
2736
|
className: tx("datePicker.trigger", {
|
|
2763
2737
|
hasValue
|
|
2764
2738
|
}, classNames) ?? void 0
|
|
2765
|
-
}, children ?? /* @__PURE__ */
|
|
2739
|
+
}, children ?? /* @__PURE__ */ React27.createElement(React27.Fragment, null, icon && /* @__PURE__ */ React27.createElement(Icon, {
|
|
2766
2740
|
size: 4,
|
|
2767
2741
|
icon: "ph--calendar--regular"
|
|
2768
2742
|
}), label)));
|
|
2769
2743
|
});
|
|
2770
2744
|
DatePickerTrigger.displayName = "DatePickerTrigger";
|
|
2771
|
-
var DatePickerContent = /* @__PURE__ */
|
|
2745
|
+
var DatePickerContent = /* @__PURE__ */ forwardRef19(({ classNames, children, ...props }, forwardedRef) => {
|
|
2772
2746
|
const { tx } = useThemeContext();
|
|
2773
|
-
return /* @__PURE__ */
|
|
2747
|
+
return /* @__PURE__ */ React27.createElement(Popover.Portal, null, /* @__PURE__ */ React27.createElement(Popover.Content, {
|
|
2774
2748
|
ref: forwardedRef,
|
|
2775
2749
|
align: "start",
|
|
2776
2750
|
sideOffset: 4,
|
|
2777
2751
|
...props
|
|
2778
|
-
}, /* @__PURE__ */
|
|
2752
|
+
}, /* @__PURE__ */ React27.createElement("div", {
|
|
2779
2753
|
className: tx("datePicker.content", {}, classNames)
|
|
2780
2754
|
}, children)));
|
|
2781
2755
|
});
|
|
@@ -2795,7 +2769,7 @@ var DatePickerCalendar = ({ classNames } = {}) => {
|
|
|
2795
2769
|
const { mode, value, setValue, withTime, onOpenChange } = useDatePickerContext("DatePickerCalendar");
|
|
2796
2770
|
if (mode === "single") {
|
|
2797
2771
|
const date = value;
|
|
2798
|
-
return /* @__PURE__ */
|
|
2772
|
+
return /* @__PURE__ */ React27.createElement(Calendar.Root, {
|
|
2799
2773
|
mode: "single",
|
|
2800
2774
|
classNames,
|
|
2801
2775
|
selected: date,
|
|
@@ -2809,7 +2783,7 @@ var DatePickerCalendar = ({ classNames } = {}) => {
|
|
|
2809
2783
|
});
|
|
2810
2784
|
}
|
|
2811
2785
|
const range = value;
|
|
2812
|
-
return /* @__PURE__ */
|
|
2786
|
+
return /* @__PURE__ */ React27.createElement(Calendar.Root, {
|
|
2813
2787
|
mode: "range",
|
|
2814
2788
|
classNames,
|
|
2815
2789
|
selected: range,
|
|
@@ -2840,14 +2814,14 @@ var DatePicker = {
|
|
|
2840
2814
|
// src/components/Dialog/Dialog.tsx
|
|
2841
2815
|
import { createContext as createContext6 } from "@radix-ui/react-context";
|
|
2842
2816
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2843
|
-
import { Primitive as
|
|
2844
|
-
import { Slot as
|
|
2845
|
-
import
|
|
2846
|
-
import { useTranslation as
|
|
2817
|
+
import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
|
|
2818
|
+
import { Slot as Slot12 } from "@radix-ui/react-slot";
|
|
2819
|
+
import React28, { forwardRef as forwardRef20 } from "react";
|
|
2820
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
2847
2821
|
import { osTranslations as osTranslations2 } from "@dxos/ui-theme";
|
|
2848
|
-
var DialogRoot = (props) => /* @__PURE__ */
|
|
2822
|
+
var DialogRoot = (props) => /* @__PURE__ */ React28.createElement(ElevationProvider, {
|
|
2849
2823
|
elevation: "dialog"
|
|
2850
|
-
}, /* @__PURE__ */
|
|
2824
|
+
}, /* @__PURE__ */ React28.createElement(DialogPrimitive.Root, {
|
|
2851
2825
|
// NOTE: Radix warning unless set to undefined.
|
|
2852
2826
|
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
2853
2827
|
"aria-describedby": void 0,
|
|
@@ -2858,23 +2832,23 @@ var DialogTrigger = DialogPrimitive.Trigger;
|
|
|
2858
2832
|
var DialogPortal = DialogPrimitive.Portal;
|
|
2859
2833
|
var DIALOG_OVERLAY_NAME = "Dialog.Overlay";
|
|
2860
2834
|
var [OverlayLayoutProvider, useOverlayLayoutContext] = createContext6(DIALOG_OVERLAY_NAME, {});
|
|
2861
|
-
var DialogOverlay = /* @__PURE__ */
|
|
2835
|
+
var DialogOverlay = /* @__PURE__ */ forwardRef20(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
2862
2836
|
const { tx } = useThemeContext();
|
|
2863
|
-
return /* @__PURE__ */
|
|
2837
|
+
return /* @__PURE__ */ React28.createElement(DialogPrimitive.Overlay, {
|
|
2864
2838
|
...props,
|
|
2865
2839
|
"data-block-align": blockAlign,
|
|
2866
2840
|
className: tx("dialog.overlay", {}, classNames),
|
|
2867
2841
|
ref: forwardedRef
|
|
2868
|
-
}, /* @__PURE__ */
|
|
2842
|
+
}, /* @__PURE__ */ React28.createElement(OverlayLayoutProvider, {
|
|
2869
2843
|
inOverlayLayout: true
|
|
2870
2844
|
}, children));
|
|
2871
2845
|
});
|
|
2872
2846
|
DialogOverlay.displayName = DIALOG_OVERLAY_NAME;
|
|
2873
2847
|
var DIALOG_CONTENT_NAME = "Dialog.Content";
|
|
2874
|
-
var DialogContent = /* @__PURE__ */
|
|
2848
|
+
var DialogContent = /* @__PURE__ */ forwardRef20(({ classNames, children, size = "md", inOverlayLayout: propsInOverlayLayout, ...props }, forwardedRef) => {
|
|
2875
2849
|
const { tx } = useThemeContext();
|
|
2876
2850
|
const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);
|
|
2877
|
-
return /* @__PURE__ */
|
|
2851
|
+
return /* @__PURE__ */ React28.createElement(DialogPrimitive.Content, {
|
|
2878
2852
|
...props,
|
|
2879
2853
|
// NOTE: Radix warning unless set to undefined.
|
|
2880
2854
|
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
@@ -2884,7 +2858,7 @@ var DialogContent = /* @__PURE__ */ forwardRef19(({ classNames, children, size =
|
|
|
2884
2858
|
inOverlayLayout: propsInOverlayLayout || inOverlayLayout
|
|
2885
2859
|
}, classNames),
|
|
2886
2860
|
ref: forwardedRef
|
|
2887
|
-
}, /* @__PURE__ */
|
|
2861
|
+
}, /* @__PURE__ */ React28.createElement(Column.Root, {
|
|
2888
2862
|
classNames: "dx-expander",
|
|
2889
2863
|
gutter: "sm"
|
|
2890
2864
|
}, children));
|
|
@@ -2892,9 +2866,9 @@ var DialogContent = /* @__PURE__ */ forwardRef19(({ classNames, children, size =
|
|
|
2892
2866
|
DialogContent.displayName = DIALOG_CONTENT_NAME;
|
|
2893
2867
|
var DialogHeader = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
2894
2868
|
const { className, ...rest } = composableProps(props);
|
|
2895
|
-
const Comp = asChild ?
|
|
2869
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
2896
2870
|
const { tx } = useThemeContext();
|
|
2897
|
-
return /* @__PURE__ */
|
|
2871
|
+
return /* @__PURE__ */ React28.createElement(Comp, {
|
|
2898
2872
|
...rest,
|
|
2899
2873
|
className: tx("dialog.header", {}, className),
|
|
2900
2874
|
ref: forwardedRef
|
|
@@ -2910,9 +2884,9 @@ var DIALOG_ACTION_LABEL_KEYS = {
|
|
|
2910
2884
|
close: "close-dialog.label",
|
|
2911
2885
|
delete: "toolbar-delete.label"
|
|
2912
2886
|
};
|
|
2913
|
-
var DialogActionIconButton = /* @__PURE__ */
|
|
2914
|
-
const { t } =
|
|
2915
|
-
return /* @__PURE__ */
|
|
2887
|
+
var DialogActionIconButton = /* @__PURE__ */ forwardRef20(({ action, label, ...props }, forwardedRef) => {
|
|
2888
|
+
const { t } = useTranslation4(osTranslations2);
|
|
2889
|
+
return /* @__PURE__ */ React28.createElement(IconButton, {
|
|
2916
2890
|
...props,
|
|
2917
2891
|
label: label ?? t(DIALOG_ACTION_LABEL_KEYS[action]),
|
|
2918
2892
|
icon: DIALOG_ACTION_ICONS[action],
|
|
@@ -2925,18 +2899,18 @@ var DialogActionIconButton = /* @__PURE__ */ forwardRef19(({ action, label, ...p
|
|
|
2925
2899
|
DialogActionIconButton.displayName = "Dialog.ActionIconButton";
|
|
2926
2900
|
var DialogBody = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
2927
2901
|
const { className, ...rest } = composableProps(props);
|
|
2928
|
-
const Comp = asChild ?
|
|
2902
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
2929
2903
|
const { tx } = useThemeContext();
|
|
2930
|
-
return /* @__PURE__ */
|
|
2904
|
+
return /* @__PURE__ */ React28.createElement(Comp, {
|
|
2931
2905
|
...rest,
|
|
2932
2906
|
className: tx("dialog.body", {}, className),
|
|
2933
2907
|
ref: forwardedRef
|
|
2934
2908
|
}, children);
|
|
2935
2909
|
});
|
|
2936
2910
|
DialogBody.displayName = "Dialog.Body";
|
|
2937
|
-
var DialogTitle = /* @__PURE__ */
|
|
2911
|
+
var DialogTitle = /* @__PURE__ */ forwardRef20(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
2938
2912
|
const { tx } = useThemeContext();
|
|
2939
|
-
return /* @__PURE__ */
|
|
2913
|
+
return /* @__PURE__ */ React28.createElement(DialogPrimitive.Title, {
|
|
2940
2914
|
...props,
|
|
2941
2915
|
className: tx("dialog.title", {
|
|
2942
2916
|
srOnly
|
|
@@ -2945,9 +2919,9 @@ var DialogTitle = /* @__PURE__ */ forwardRef19(({ classNames, srOnly, ...props }
|
|
|
2945
2919
|
});
|
|
2946
2920
|
});
|
|
2947
2921
|
DialogTitle.displayName = "Dialog.Title";
|
|
2948
|
-
var DialogDescription = /* @__PURE__ */
|
|
2922
|
+
var DialogDescription = /* @__PURE__ */ forwardRef20(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
2949
2923
|
const { tx } = useThemeContext();
|
|
2950
|
-
return /* @__PURE__ */
|
|
2924
|
+
return /* @__PURE__ */ React28.createElement(DialogPrimitive.Description, {
|
|
2951
2925
|
...props,
|
|
2952
2926
|
className: tx("dialog.description", {
|
|
2953
2927
|
srOnly
|
|
@@ -2958,9 +2932,9 @@ var DialogDescription = /* @__PURE__ */ forwardRef19(({ classNames, srOnly, ...p
|
|
|
2958
2932
|
DialogDescription.displayName = "Dialog.Description";
|
|
2959
2933
|
var DialogActionBar = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
2960
2934
|
const { className: classNames, ...rest } = composableProps(props);
|
|
2961
|
-
const Comp = asChild ?
|
|
2935
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
2962
2936
|
const { tx } = useThemeContext();
|
|
2963
|
-
return /* @__PURE__ */
|
|
2937
|
+
return /* @__PURE__ */ React28.createElement(Comp, {
|
|
2964
2938
|
...rest,
|
|
2965
2939
|
className: tx("dialog.actionbar", {}, classNames),
|
|
2966
2940
|
ref: forwardedRef
|
|
@@ -2986,10 +2960,10 @@ var Dialog = {
|
|
|
2986
2960
|
// src/components/Dialog/AlertDialog.tsx
|
|
2987
2961
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
2988
2962
|
import { createContext as createContext7 } from "@radix-ui/react-context";
|
|
2989
|
-
import
|
|
2990
|
-
var AlertDialogRoot = (props) => /* @__PURE__ */
|
|
2963
|
+
import React29, { forwardRef as forwardRef21 } from "react";
|
|
2964
|
+
var AlertDialogRoot = (props) => /* @__PURE__ */ React29.createElement(ElevationProvider, {
|
|
2991
2965
|
elevation: "dialog"
|
|
2992
|
-
}, /* @__PURE__ */
|
|
2966
|
+
}, /* @__PURE__ */ React29.createElement(AlertDialogPrimitive.Root, props));
|
|
2993
2967
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
2994
2968
|
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
2995
2969
|
var AlertDialogCancel = AlertDialogPrimitive.Cancel;
|
|
@@ -2999,37 +2973,37 @@ var ALERT_DIALOG_CONTENT_NAME = "AlertDialog.Content";
|
|
|
2999
2973
|
var [OverlayLayoutProvider2, useOverlayLayoutContext2] = createContext7(ALERT_DIALOG_OVERLAY_NAME, {
|
|
3000
2974
|
inOverlayLayout: false
|
|
3001
2975
|
});
|
|
3002
|
-
var AlertDialogOverlay = /* @__PURE__ */
|
|
2976
|
+
var AlertDialogOverlay = /* @__PURE__ */ forwardRef21(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
3003
2977
|
const { tx } = useThemeContext();
|
|
3004
|
-
return /* @__PURE__ */
|
|
2978
|
+
return /* @__PURE__ */ React29.createElement(AlertDialogPrimitive.Overlay, {
|
|
3005
2979
|
...props,
|
|
3006
2980
|
"data-block-align": blockAlign,
|
|
3007
2981
|
className: tx("dialog.overlay", {}, classNames),
|
|
3008
2982
|
ref: forwardedRef
|
|
3009
|
-
}, /* @__PURE__ */
|
|
2983
|
+
}, /* @__PURE__ */ React29.createElement(OverlayLayoutProvider2, {
|
|
3010
2984
|
inOverlayLayout: true
|
|
3011
2985
|
}, children));
|
|
3012
2986
|
});
|
|
3013
2987
|
AlertDialogOverlay.displayName = ALERT_DIALOG_OVERLAY_NAME;
|
|
3014
|
-
var AlertDialogContent = /* @__PURE__ */
|
|
2988
|
+
var AlertDialogContent = /* @__PURE__ */ forwardRef21(({ classNames, children, size = "md", ...props }, forwardedRef) => {
|
|
3015
2989
|
const { tx } = useThemeContext();
|
|
3016
2990
|
const { inOverlayLayout } = useOverlayLayoutContext2(ALERT_DIALOG_CONTENT_NAME);
|
|
3017
|
-
return /* @__PURE__ */
|
|
2991
|
+
return /* @__PURE__ */ React29.createElement(AlertDialogPrimitive.Content, {
|
|
3018
2992
|
...props,
|
|
3019
2993
|
className: tx("dialog.content", {
|
|
3020
2994
|
inOverlayLayout,
|
|
3021
2995
|
size
|
|
3022
2996
|
}, classNames),
|
|
3023
2997
|
ref: forwardedRef
|
|
3024
|
-
}, /* @__PURE__ */
|
|
2998
|
+
}, /* @__PURE__ */ React29.createElement(Column.Root, {
|
|
3025
2999
|
classNames: "dx-expander",
|
|
3026
3000
|
gutter: "sm"
|
|
3027
3001
|
}, children));
|
|
3028
3002
|
});
|
|
3029
3003
|
AlertDialogContent.displayName = ALERT_DIALOG_CONTENT_NAME;
|
|
3030
|
-
var AlertDialogTitle = /* @__PURE__ */
|
|
3004
|
+
var AlertDialogTitle = /* @__PURE__ */ forwardRef21(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
3031
3005
|
const { tx } = useThemeContext();
|
|
3032
|
-
return /* @__PURE__ */
|
|
3006
|
+
return /* @__PURE__ */ React29.createElement(AlertDialogPrimitive.Title, {
|
|
3033
3007
|
...props,
|
|
3034
3008
|
className: tx("dialog.title", {
|
|
3035
3009
|
srOnly
|
|
@@ -3037,9 +3011,9 @@ var AlertDialogTitle = /* @__PURE__ */ forwardRef20(({ classNames, srOnly, ...pr
|
|
|
3037
3011
|
ref: forwardedRef
|
|
3038
3012
|
});
|
|
3039
3013
|
});
|
|
3040
|
-
var AlertDialogDescription = /* @__PURE__ */
|
|
3014
|
+
var AlertDialogDescription = /* @__PURE__ */ forwardRef21(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
3041
3015
|
const { tx } = useThemeContext();
|
|
3042
|
-
return /* @__PURE__ */
|
|
3016
|
+
return /* @__PURE__ */ React29.createElement(AlertDialogPrimitive.Description, {
|
|
3043
3017
|
...props,
|
|
3044
3018
|
className: tx("dialog.description", {
|
|
3045
3019
|
srOnly
|
|
@@ -3069,40 +3043,40 @@ var AlertDialog = {
|
|
|
3069
3043
|
import { ErrorBoundary } from "@dxos/react-error-boundary";
|
|
3070
3044
|
|
|
3071
3045
|
// src/components/ErrorFallback/ErrorFallback.tsx
|
|
3072
|
-
import
|
|
3046
|
+
import React30 from "react";
|
|
3073
3047
|
import { safeStringify } from "@dxos/util";
|
|
3074
|
-
import { translationKey as
|
|
3048
|
+
import { translationKey as translationKey4 } from "#translations";
|
|
3075
3049
|
var ErrorFallback = ({ children, error, title, data }) => {
|
|
3076
|
-
const { t } = useTranslation(
|
|
3050
|
+
const { t } = useTranslation(translationKey4);
|
|
3077
3051
|
const isDev = true;
|
|
3078
3052
|
const message = error instanceof Error ? error.message : String(error);
|
|
3079
|
-
return /* @__PURE__ */
|
|
3053
|
+
return /* @__PURE__ */ React30.createElement("div", {
|
|
3080
3054
|
role: "alert",
|
|
3081
3055
|
"data-testid": "error-boundary-fallback",
|
|
3082
3056
|
className: "flex flex-col p-4 gap-4 overflow-auto"
|
|
3083
|
-
}, /* @__PURE__ */
|
|
3057
|
+
}, /* @__PURE__ */ React30.createElement("h1", {
|
|
3084
3058
|
className: "text-lg text-info-text"
|
|
3085
|
-
}, title ?? "Runtime Error"), /* @__PURE__ */
|
|
3059
|
+
}, title ?? "Runtime Error"), /* @__PURE__ */ React30.createElement("p", null, message), isDev && error instanceof Error && /* @__PURE__ */ React30.createElement(Section, {
|
|
3086
3060
|
title: "Stack",
|
|
3087
3061
|
onClick: () => {
|
|
3088
3062
|
const text = error instanceof Error ? error.stack ?? error.message : String(error);
|
|
3089
3063
|
void navigator.clipboard.writeText(text);
|
|
3090
3064
|
}
|
|
3091
|
-
}, /* @__PURE__ */
|
|
3065
|
+
}, /* @__PURE__ */ React30.createElement(ErrorStack, {
|
|
3092
3066
|
error
|
|
3093
|
-
})), data && /* @__PURE__ */
|
|
3067
|
+
})), data && /* @__PURE__ */ React30.createElement(Section, {
|
|
3094
3068
|
title: "Data",
|
|
3095
3069
|
onClick: () => {
|
|
3096
3070
|
void navigator.clipboard.writeText(JSON.stringify(data, void 0, 2));
|
|
3097
3071
|
}
|
|
3098
|
-
}, /* @__PURE__ */
|
|
3072
|
+
}, /* @__PURE__ */ React30.createElement("pre", {
|
|
3099
3073
|
className: "overflow-x-auto text-xs"
|
|
3100
3074
|
}, safeStringify(data, void 0, 2))), children);
|
|
3101
3075
|
};
|
|
3102
3076
|
var Section = ({ children, title, onClick }) => {
|
|
3103
|
-
return /* @__PURE__ */
|
|
3077
|
+
return /* @__PURE__ */ React30.createElement("div", {
|
|
3104
3078
|
className: "flex flex-col gap-1"
|
|
3105
|
-
}, onClick && /* @__PURE__ */
|
|
3079
|
+
}, onClick && /* @__PURE__ */ React30.createElement("div", null, /* @__PURE__ */ React30.createElement(IconButton, {
|
|
3106
3080
|
classNames: "text-xs uppercase",
|
|
3107
3081
|
label: title ?? "Copy",
|
|
3108
3082
|
icon: "ph--clipboard-text--regular",
|
|
@@ -3141,17 +3115,17 @@ var generator = ({ error, delay }) => {
|
|
|
3141
3115
|
|
|
3142
3116
|
// src/components/Focus/Focus.tsx
|
|
3143
3117
|
import { useArrowNavigationGroup as useArrowNavigationGroup2, useFocusableGroup, useMergedTabsterAttributes_unstable } from "@fluentui/react-tabster";
|
|
3144
|
-
import { useComposedRefs as
|
|
3145
|
-
import { Primitive as
|
|
3146
|
-
import { Slot as
|
|
3147
|
-
import
|
|
3118
|
+
import { useComposedRefs as useComposedRefs3 } from "@radix-ui/react-compose-refs";
|
|
3119
|
+
import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
|
|
3120
|
+
import { Slot as Slot13 } from "@radix-ui/react-slot";
|
|
3121
|
+
import React31, { createContext as createContext8, useCallback as useCallback10, useContext as useContext4, useRef as useRef5, useState as useState10 } from "react";
|
|
3148
3122
|
var FOCUS_STATE_ATTR = "focus-state";
|
|
3149
3123
|
var FocusContext = /* @__PURE__ */ createContext8({});
|
|
3150
3124
|
var useFocus = () => useContext4(FocusContext);
|
|
3151
3125
|
var Group3 = slottable(({ children, asChild, orientation = "vertical", border = false, ...props }, forwardedRef) => {
|
|
3152
|
-
const Comp = asChild ?
|
|
3126
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
3153
3127
|
const { tx } = useThemeContext();
|
|
3154
|
-
const rootRef =
|
|
3128
|
+
const rootRef = useRef5(null);
|
|
3155
3129
|
const focusableGroupAttrs = useFocusableGroup({
|
|
3156
3130
|
tabBehavior: "limited-trap-focus"
|
|
3157
3131
|
});
|
|
@@ -3162,20 +3136,20 @@ var Group3 = slottable(({ children, asChild, orientation = "vertical", border =
|
|
|
3162
3136
|
const tabsterAttrs = useMergedTabsterAttributes_unstable(focusableGroupAttrs, arrowNavigationAttrs);
|
|
3163
3137
|
const [state, setState] = useState10();
|
|
3164
3138
|
const [groupHasFocus, setGroupHasFocus] = useState10(false);
|
|
3165
|
-
const handleFocusIn =
|
|
3166
|
-
const handleFocusOut =
|
|
3139
|
+
const handleFocusIn = useCallback10(() => setGroupHasFocus(true), []);
|
|
3140
|
+
const handleFocusOut = useCallback10((event) => {
|
|
3167
3141
|
const related = event.relatedTarget;
|
|
3168
3142
|
if (!related || !rootRef.current?.contains(related)) {
|
|
3169
3143
|
setGroupHasFocus(false);
|
|
3170
3144
|
}
|
|
3171
3145
|
}, []);
|
|
3172
3146
|
const { className, ...rest } = composableProps(props);
|
|
3173
|
-
return /* @__PURE__ */
|
|
3147
|
+
return /* @__PURE__ */ React31.createElement(FocusContext.Provider, {
|
|
3174
3148
|
value: {
|
|
3175
3149
|
setFocus: setState,
|
|
3176
3150
|
groupHasFocus
|
|
3177
3151
|
}
|
|
3178
|
-
}, /* @__PURE__ */
|
|
3152
|
+
}, /* @__PURE__ */ React31.createElement(Comp, {
|
|
3179
3153
|
...rest,
|
|
3180
3154
|
tabIndex: 0,
|
|
3181
3155
|
className: tx("focus.group", {
|
|
@@ -3187,11 +3161,11 @@ var Group3 = slottable(({ children, asChild, orientation = "vertical", border =
|
|
|
3187
3161
|
},
|
|
3188
3162
|
onBlur: handleFocusOut,
|
|
3189
3163
|
onFocus: handleFocusIn,
|
|
3190
|
-
ref:
|
|
3164
|
+
ref: useComposedRefs3(rootRef, forwardedRef)
|
|
3191
3165
|
}, children));
|
|
3192
3166
|
});
|
|
3193
3167
|
var Item4 = slottable(({ children, asChild, current, border = false, onCurrentChange, onClick, onFocus, onBlur, ...props }, forwardedRef) => {
|
|
3194
|
-
const Comp = asChild ?
|
|
3168
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
3195
3169
|
const { tx } = useThemeContext();
|
|
3196
3170
|
const focusableGroupAttrs = useFocusableGroup({
|
|
3197
3171
|
ignoreDefaultKeydown: {
|
|
@@ -3199,27 +3173,27 @@ var Item4 = slottable(({ children, asChild, current, border = false, onCurrentCh
|
|
|
3199
3173
|
}
|
|
3200
3174
|
});
|
|
3201
3175
|
const [focused, setFocused] = useState10(false);
|
|
3202
|
-
const handleClick =
|
|
3176
|
+
const handleClick = useCallback10((event) => {
|
|
3203
3177
|
onCurrentChange?.();
|
|
3204
3178
|
onClick?.(event);
|
|
3205
3179
|
}, [
|
|
3206
3180
|
onCurrentChange,
|
|
3207
3181
|
onClick
|
|
3208
3182
|
]);
|
|
3209
|
-
const handleKeyDown =
|
|
3183
|
+
const handleKeyDown = useCallback10((event) => {
|
|
3210
3184
|
if (event.key === "Enter") {
|
|
3211
3185
|
onCurrentChange?.();
|
|
3212
3186
|
}
|
|
3213
3187
|
}, [
|
|
3214
3188
|
onCurrentChange
|
|
3215
3189
|
]);
|
|
3216
|
-
const handleFocus =
|
|
3190
|
+
const handleFocus = useCallback10((event) => {
|
|
3217
3191
|
setFocused(true);
|
|
3218
3192
|
onFocus?.(event);
|
|
3219
3193
|
}, [
|
|
3220
3194
|
onFocus
|
|
3221
3195
|
]);
|
|
3222
|
-
const handleBlur =
|
|
3196
|
+
const handleBlur = useCallback10((event) => {
|
|
3223
3197
|
setFocused(false);
|
|
3224
3198
|
onBlur?.(event);
|
|
3225
3199
|
}, [
|
|
@@ -3227,7 +3201,7 @@ var Item4 = slottable(({ children, asChild, current, border = false, onCurrentCh
|
|
|
3227
3201
|
]);
|
|
3228
3202
|
const isCurrent = current ?? focused;
|
|
3229
3203
|
const { className, ...rest } = composableProps(props);
|
|
3230
|
-
return /* @__PURE__ */
|
|
3204
|
+
return /* @__PURE__ */ React31.createElement(Comp, {
|
|
3231
3205
|
...rest,
|
|
3232
3206
|
tabIndex: 0,
|
|
3233
3207
|
className: tx("focus.item", {
|
|
@@ -3251,16 +3225,16 @@ var Focus = {
|
|
|
3251
3225
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3252
3226
|
import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
3253
3227
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
3254
|
-
import
|
|
3255
|
-
import { useTranslation as
|
|
3228
|
+
import React33, { forwardRef as forwardRef23, useCallback as useCallback12, useEffect as useEffect6, useRef as useRef6, useState as useState12 } from "react";
|
|
3229
|
+
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
3256
3230
|
import { DescriptionAndValidation as DescriptionAndValidationPrimitive, Description as DescriptionPrimitive, INPUT_NAME as INPUT_NAME2, InputRoot, Label as LabelPrimitive, PinInput as PinInputPrimitive, TextArea as TextAreaPrimitive, TextInput as TextInputPrimitive, Validation as ValidationPrimitive, useInputContext as useInputContext2 } from "@dxos/react-input";
|
|
3257
|
-
import { mx as
|
|
3258
|
-
import { translationKey as
|
|
3231
|
+
import { mx as mx11 } from "@dxos/ui-theme";
|
|
3232
|
+
import { translationKey as translationKey5 } from "#translations";
|
|
3259
3233
|
|
|
3260
3234
|
// src/components/Input/SegmentedInput.tsx
|
|
3261
3235
|
import { CalendarDate as CalendarDate2, CalendarDateTime, parseDate as parseDate2, parseDateTime, parseTime } from "@internationalized/date";
|
|
3262
3236
|
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
3263
|
-
import
|
|
3237
|
+
import React32, { forwardRef as forwardRef22, useCallback as useCallback11, useState as useState11 } from "react";
|
|
3264
3238
|
import { DateField, DateInput, DateSegment, TimeField } from "react-aria-components";
|
|
3265
3239
|
import { INPUT_NAME, useInputContext } from "@dxos/react-input";
|
|
3266
3240
|
var tryParse = (parser, value) => {
|
|
@@ -3284,19 +3258,19 @@ var BIDI_FORMAT_RE = /^[--]+$/;
|
|
|
3284
3258
|
var renderSegment = (segment) => {
|
|
3285
3259
|
if (segment.type === "literal") {
|
|
3286
3260
|
if (BIDI_FORMAT_RE.test(segment.text)) {
|
|
3287
|
-
return /* @__PURE__ */
|
|
3261
|
+
return /* @__PURE__ */ React32.createElement("span", {
|
|
3288
3262
|
"aria-hidden": true,
|
|
3289
3263
|
className: "select-none w-[2ch] first:hidden last:hidden"
|
|
3290
3264
|
});
|
|
3291
3265
|
}
|
|
3292
3266
|
if (segment.text.includes(",")) {
|
|
3293
|
-
return /* @__PURE__ */
|
|
3267
|
+
return /* @__PURE__ */ React32.createElement("span", {
|
|
3294
3268
|
"aria-hidden": true,
|
|
3295
3269
|
className: "select-none"
|
|
3296
3270
|
}, " ");
|
|
3297
3271
|
}
|
|
3298
3272
|
}
|
|
3299
|
-
return /* @__PURE__ */
|
|
3273
|
+
return /* @__PURE__ */ React32.createElement(DateSegment, {
|
|
3300
3274
|
segment,
|
|
3301
3275
|
className: segmentClass
|
|
3302
3276
|
});
|
|
@@ -3318,7 +3292,7 @@ var useFieldChrome = ({ __inputScope, density: densityProp, elevation: elevation
|
|
|
3318
3292
|
};
|
|
3319
3293
|
var PickerWrapper = ({ pickerValue, onPickerChange, withTime, disabled = false, children, calendar }) => {
|
|
3320
3294
|
const [open, setOpen] = useState11(false);
|
|
3321
|
-
const openPicker =
|
|
3295
|
+
const openPicker = useCallback11(() => {
|
|
3322
3296
|
if (!disabled) {
|
|
3323
3297
|
setOpen(true);
|
|
3324
3298
|
}
|
|
@@ -3326,18 +3300,18 @@ var PickerWrapper = ({ pickerValue, onPickerChange, withTime, disabled = false,
|
|
|
3326
3300
|
disabled
|
|
3327
3301
|
]);
|
|
3328
3302
|
useInputTrigger(disabled ? void 0 : openPicker);
|
|
3329
|
-
return /* @__PURE__ */
|
|
3303
|
+
return /* @__PURE__ */ React32.createElement(DatePicker.Root, {
|
|
3330
3304
|
mode: "single",
|
|
3331
3305
|
withTime,
|
|
3332
3306
|
value: pickerValue,
|
|
3333
3307
|
onValueChange: disabled ? void 0 : onPickerChange,
|
|
3334
3308
|
open,
|
|
3335
3309
|
onOpenChange: setOpen
|
|
3336
|
-
}, /* @__PURE__ */
|
|
3310
|
+
}, /* @__PURE__ */ React32.createElement(Popover.Anchor, {
|
|
3337
3311
|
asChild: true
|
|
3338
|
-
}, children), /* @__PURE__ */
|
|
3312
|
+
}, children), /* @__PURE__ */ React32.createElement(DatePicker.Content, null, calendar));
|
|
3339
3313
|
};
|
|
3340
|
-
var SegmentedDate = /* @__PURE__ */
|
|
3314
|
+
var SegmentedDate = /* @__PURE__ */ forwardRef22(({ __inputScope, classNames, density: densityProp, elevation: elevationProp, variant, value, defaultValue, onValueChange, disabled, autoFocus, id, "aria-label": ariaLabel }, forwardedRef) => {
|
|
3341
3315
|
const { tx, density, elevation, validationValence, contextId, descriptionId, errorMessageId } = useFieldChrome({
|
|
3342
3316
|
__inputScope,
|
|
3343
3317
|
density: densityProp,
|
|
@@ -3358,7 +3332,7 @@ var SegmentedDate = /* @__PURE__ */ forwardRef21(({ __inputScope, classNames, de
|
|
|
3358
3332
|
granularity: "day",
|
|
3359
3333
|
shouldForceLeadingZeros: true
|
|
3360
3334
|
};
|
|
3361
|
-
const field = /* @__PURE__ */
|
|
3335
|
+
const field = /* @__PURE__ */ React32.createElement(DateField, fieldProps, /* @__PURE__ */ React32.createElement(DateInput, {
|
|
3362
3336
|
ref: forwardedRef,
|
|
3363
3337
|
...id ?? contextId ? {
|
|
3364
3338
|
id: id ?? contextId
|
|
@@ -3379,16 +3353,16 @@ var SegmentedDate = /* @__PURE__ */ forwardRef21(({ __inputScope, classNames, de
|
|
|
3379
3353
|
validationValence
|
|
3380
3354
|
}, fieldClass, classNames)
|
|
3381
3355
|
}, renderSegment));
|
|
3382
|
-
return /* @__PURE__ */
|
|
3356
|
+
return /* @__PURE__ */ React32.createElement(PickerWrapper, {
|
|
3383
3357
|
pickerValue: parsed ? new Date(parsed.year, parsed.month - 1, parsed.day) : void 0,
|
|
3384
3358
|
onPickerChange: (next) => setStringValue(next ? formatCalendarDate(toCalendarDate2(next)) : ""),
|
|
3385
3359
|
withTime: false,
|
|
3386
3360
|
disabled,
|
|
3387
|
-
calendar: /* @__PURE__ */
|
|
3361
|
+
calendar: /* @__PURE__ */ React32.createElement(DatePicker.Calendar, null)
|
|
3388
3362
|
}, field);
|
|
3389
3363
|
});
|
|
3390
3364
|
SegmentedDate.displayName = "Input.SegmentedDate";
|
|
3391
|
-
var SegmentedTime = /* @__PURE__ */
|
|
3365
|
+
var SegmentedTime = /* @__PURE__ */ forwardRef22(({ __inputScope, classNames, density: densityProp, elevation: elevationProp, variant, value, defaultValue, onValueChange, disabled, autoFocus, id, hourCycle = 24, "aria-label": ariaLabel }, forwardedRef) => {
|
|
3392
3366
|
const { tx, density, elevation, validationValence, contextId, descriptionId, errorMessageId } = useFieldChrome({
|
|
3393
3367
|
__inputScope,
|
|
3394
3368
|
density: densityProp,
|
|
@@ -3410,7 +3384,7 @@ var SegmentedTime = /* @__PURE__ */ forwardRef21(({ __inputScope, classNames, de
|
|
|
3410
3384
|
hourCycle,
|
|
3411
3385
|
shouldForceLeadingZeros: true
|
|
3412
3386
|
};
|
|
3413
|
-
return /* @__PURE__ */
|
|
3387
|
+
return /* @__PURE__ */ React32.createElement(TimeField, fieldProps, /* @__PURE__ */ React32.createElement(DateInput, {
|
|
3414
3388
|
ref: forwardedRef,
|
|
3415
3389
|
...id ?? contextId ? {
|
|
3416
3390
|
id: id ?? contextId
|
|
@@ -3433,7 +3407,7 @@ var SegmentedTime = /* @__PURE__ */ forwardRef21(({ __inputScope, classNames, de
|
|
|
3433
3407
|
}, renderSegment));
|
|
3434
3408
|
});
|
|
3435
3409
|
SegmentedTime.displayName = "Input.SegmentedTime";
|
|
3436
|
-
var SegmentedDateTime = /* @__PURE__ */
|
|
3410
|
+
var SegmentedDateTime = /* @__PURE__ */ forwardRef22(({ __inputScope, classNames, density: densityProp, elevation: elevationProp, variant, value, defaultValue, onValueChange, disabled, autoFocus, id, hourCycle = 24, "aria-label": ariaLabel }, forwardedRef) => {
|
|
3437
3411
|
const { tx, density, elevation, validationValence, contextId, descriptionId, errorMessageId } = useFieldChrome({
|
|
3438
3412
|
__inputScope,
|
|
3439
3413
|
density: densityProp,
|
|
@@ -3455,7 +3429,7 @@ var SegmentedDateTime = /* @__PURE__ */ forwardRef21(({ __inputScope, classNames
|
|
|
3455
3429
|
hourCycle,
|
|
3456
3430
|
shouldForceLeadingZeros: true
|
|
3457
3431
|
};
|
|
3458
|
-
const field = /* @__PURE__ */
|
|
3432
|
+
const field = /* @__PURE__ */ React32.createElement(DateField, fieldProps, /* @__PURE__ */ React32.createElement(DateInput, {
|
|
3459
3433
|
ref: forwardedRef,
|
|
3460
3434
|
...id ?? contextId ? {
|
|
3461
3435
|
id: id ?? contextId
|
|
@@ -3476,12 +3450,12 @@ var SegmentedDateTime = /* @__PURE__ */ forwardRef21(({ __inputScope, classNames
|
|
|
3476
3450
|
validationValence
|
|
3477
3451
|
}, fieldClass, classNames)
|
|
3478
3452
|
}, renderSegment));
|
|
3479
|
-
return /* @__PURE__ */
|
|
3453
|
+
return /* @__PURE__ */ React32.createElement(PickerWrapper, {
|
|
3480
3454
|
pickerValue: parsed ? new Date(parsed.year, parsed.month - 1, parsed.day, parsed.hour, parsed.minute) : void 0,
|
|
3481
3455
|
onPickerChange: (next) => setStringValue(next ? formatCalendarDateTime(new CalendarDateTime(next.getFullYear(), next.getMonth() + 1, next.getDate(), next.getHours(), next.getMinutes())) : ""),
|
|
3482
3456
|
withTime: true,
|
|
3483
3457
|
disabled,
|
|
3484
|
-
calendar: /* @__PURE__ */
|
|
3458
|
+
calendar: /* @__PURE__ */ React32.createElement(DatePicker.Calendar, null)
|
|
3485
3459
|
}, field);
|
|
3486
3460
|
});
|
|
3487
3461
|
SegmentedDateTime.displayName = "Input.SegmentedDateTime";
|
|
@@ -3506,10 +3480,10 @@ var useInputTrigger = (handler) => {
|
|
|
3506
3480
|
handler
|
|
3507
3481
|
]);
|
|
3508
3482
|
};
|
|
3509
|
-
var
|
|
3510
|
-
const handlerRef =
|
|
3483
|
+
var Root8 = (props) => {
|
|
3484
|
+
const handlerRef = useRef6(null);
|
|
3511
3485
|
const [hasTrigger, setHasTrigger] = useState12(false);
|
|
3512
|
-
const registerTrigger =
|
|
3486
|
+
const registerTrigger = useCallback12((handler) => {
|
|
3513
3487
|
handlerRef.current = handler;
|
|
3514
3488
|
setHasTrigger(true);
|
|
3515
3489
|
return () => {
|
|
@@ -3519,23 +3493,23 @@ var Root10 = (props) => {
|
|
|
3519
3493
|
}
|
|
3520
3494
|
};
|
|
3521
3495
|
}, []);
|
|
3522
|
-
const trigger =
|
|
3496
|
+
const trigger = useCallback12(() => {
|
|
3523
3497
|
handlerRef.current?.();
|
|
3524
3498
|
}, []);
|
|
3525
|
-
return /* @__PURE__ */
|
|
3499
|
+
return /* @__PURE__ */ React33.createElement(InputTriggerProvider, {
|
|
3526
3500
|
registerTrigger,
|
|
3527
3501
|
trigger,
|
|
3528
3502
|
hasTrigger
|
|
3529
|
-
}, /* @__PURE__ */
|
|
3503
|
+
}, /* @__PURE__ */ React33.createElement(InputRoot, props));
|
|
3530
3504
|
};
|
|
3531
|
-
|
|
3532
|
-
var TriggerIcon = /* @__PURE__ */
|
|
3533
|
-
const { t } =
|
|
3505
|
+
Root8.displayName = "Input.Root";
|
|
3506
|
+
var TriggerIcon = /* @__PURE__ */ forwardRef23(({ classNames, icon = "ph--calendar--regular", "aria-label": ariaLabel, label, ...props }, forwardedRef) => {
|
|
3507
|
+
const { t } = useTranslation5(translationKey5);
|
|
3534
3508
|
const ctx = useInputTriggerContext("Input.TriggerIcon");
|
|
3535
3509
|
if (!ctx.hasTrigger) {
|
|
3536
3510
|
return null;
|
|
3537
3511
|
}
|
|
3538
|
-
return /* @__PURE__ */
|
|
3512
|
+
return /* @__PURE__ */ React33.createElement(IconButton, {
|
|
3539
3513
|
ref: forwardedRef,
|
|
3540
3514
|
variant: "ghost",
|
|
3541
3515
|
icon,
|
|
@@ -3548,9 +3522,9 @@ var TriggerIcon = /* @__PURE__ */ forwardRef22(({ classNames, icon = "ph--calend
|
|
|
3548
3522
|
});
|
|
3549
3523
|
});
|
|
3550
3524
|
TriggerIcon.displayName = "Input.TriggerIcon";
|
|
3551
|
-
var Label3 = /* @__PURE__ */
|
|
3525
|
+
var Label3 = /* @__PURE__ */ forwardRef23(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
3552
3526
|
const { tx } = useThemeContext();
|
|
3553
|
-
return /* @__PURE__ */
|
|
3527
|
+
return /* @__PURE__ */ React33.createElement(LabelPrimitive, {
|
|
3554
3528
|
...props,
|
|
3555
3529
|
className: tx("input.label", {
|
|
3556
3530
|
srOnly
|
|
@@ -3559,9 +3533,9 @@ var Label3 = /* @__PURE__ */ forwardRef22(({ classNames, children, srOnly, ...pr
|
|
|
3559
3533
|
}, children);
|
|
3560
3534
|
});
|
|
3561
3535
|
Label3.displayName = "Input.Label";
|
|
3562
|
-
var Description3 = /* @__PURE__ */
|
|
3536
|
+
var Description3 = /* @__PURE__ */ forwardRef23(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
3563
3537
|
const { tx } = useThemeContext();
|
|
3564
|
-
return /* @__PURE__ */
|
|
3538
|
+
return /* @__PURE__ */ React33.createElement(DescriptionPrimitive, {
|
|
3565
3539
|
...props,
|
|
3566
3540
|
className: tx("input.description", {
|
|
3567
3541
|
srOnly
|
|
@@ -3570,10 +3544,10 @@ var Description3 = /* @__PURE__ */ forwardRef22(({ classNames, children, srOnly,
|
|
|
3570
3544
|
}, children);
|
|
3571
3545
|
});
|
|
3572
3546
|
Description3.displayName = "Input.Description";
|
|
3573
|
-
var Validation = /* @__PURE__ */
|
|
3547
|
+
var Validation = /* @__PURE__ */ forwardRef23(({ __inputScope, classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
3574
3548
|
const { tx } = useThemeContext();
|
|
3575
3549
|
const { validationValence } = useInputContext2(INPUT_NAME2, __inputScope);
|
|
3576
|
-
return /* @__PURE__ */
|
|
3550
|
+
return /* @__PURE__ */ React33.createElement(ValidationPrimitive, {
|
|
3577
3551
|
...props,
|
|
3578
3552
|
className: tx("input.validation", {
|
|
3579
3553
|
srOnly,
|
|
@@ -3583,9 +3557,9 @@ var Validation = /* @__PURE__ */ forwardRef22(({ __inputScope, classNames, child
|
|
|
3583
3557
|
}, children);
|
|
3584
3558
|
});
|
|
3585
3559
|
Validation.displayName = "Input.Validation";
|
|
3586
|
-
var DescriptionAndValidation = /* @__PURE__ */
|
|
3560
|
+
var DescriptionAndValidation = /* @__PURE__ */ forwardRef23(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
3587
3561
|
const { tx } = useThemeContext();
|
|
3588
|
-
return /* @__PURE__ */
|
|
3562
|
+
return /* @__PURE__ */ React33.createElement(DescriptionAndValidationPrimitive, {
|
|
3589
3563
|
...props,
|
|
3590
3564
|
className: tx("input.descriptionAndValidation", {
|
|
3591
3565
|
srOnly
|
|
@@ -3594,12 +3568,12 @@ var DescriptionAndValidation = /* @__PURE__ */ forwardRef22(({ classNames, child
|
|
|
3594
3568
|
}, children);
|
|
3595
3569
|
});
|
|
3596
3570
|
DescriptionAndValidation.displayName = "Input.DescriptionAndValidation";
|
|
3597
|
-
var PinInput = /* @__PURE__ */
|
|
3571
|
+
var PinInput = /* @__PURE__ */ forwardRef23(({ classNames, density: propsDensity, elevation: propsElevation, ...props }, forwardedRef) => {
|
|
3598
3572
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
3599
3573
|
const { tx } = useThemeContext();
|
|
3600
3574
|
const density = useDensityContext(propsDensity);
|
|
3601
3575
|
const elevation = useElevationContext(propsElevation);
|
|
3602
|
-
return /* @__PURE__ */
|
|
3576
|
+
return /* @__PURE__ */ React33.createElement(PinInputPrimitive, {
|
|
3603
3577
|
...props,
|
|
3604
3578
|
...props.autoFocus && !hasIosKeyboard2 && {
|
|
3605
3579
|
autoFocus: true
|
|
@@ -3616,13 +3590,13 @@ var PinInput = /* @__PURE__ */ forwardRef22(({ classNames, density: propsDensity
|
|
|
3616
3590
|
});
|
|
3617
3591
|
});
|
|
3618
3592
|
PinInput.displayName = "Input.PinInput";
|
|
3619
|
-
var TextInput = /* @__PURE__ */
|
|
3593
|
+
var TextInput = /* @__PURE__ */ forwardRef23(({ __inputScope, classNames, density: densityProp, elevation: elevationProp, variant, noAutoFill, ...props }, forwardedRef) => {
|
|
3620
3594
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
3621
3595
|
const { tx } = useThemeContext();
|
|
3622
3596
|
const density = useDensityContext(densityProp);
|
|
3623
3597
|
const elevation = useElevationContext(elevationProp);
|
|
3624
3598
|
const { validationValence } = useInputContext2(INPUT_NAME2, __inputScope);
|
|
3625
|
-
return /* @__PURE__ */
|
|
3599
|
+
return /* @__PURE__ */ React33.createElement(TextInputPrimitive, {
|
|
3626
3600
|
...props,
|
|
3627
3601
|
"data-1p-ignore": noAutoFill,
|
|
3628
3602
|
className: tx("input.input", {
|
|
@@ -3639,13 +3613,13 @@ var TextInput = /* @__PURE__ */ forwardRef22(({ __inputScope, classNames, densit
|
|
|
3639
3613
|
});
|
|
3640
3614
|
});
|
|
3641
3615
|
TextInput.displayName = "Input.TextInput";
|
|
3642
|
-
var TextArea = /* @__PURE__ */
|
|
3616
|
+
var TextArea = /* @__PURE__ */ forwardRef23(({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
3643
3617
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
3644
3618
|
const { tx } = useThemeContext();
|
|
3645
3619
|
const density = useDensityContext(propsDensity);
|
|
3646
3620
|
const elevation = useElevationContext(propsElevation);
|
|
3647
3621
|
const { validationValence } = useInputContext2(INPUT_NAME2, __inputScope);
|
|
3648
|
-
return /* @__PURE__ */
|
|
3622
|
+
return /* @__PURE__ */ React33.createElement(TextAreaPrimitive, {
|
|
3649
3623
|
...props,
|
|
3650
3624
|
className: tx("input.textArea", {
|
|
3651
3625
|
variant,
|
|
@@ -3661,7 +3635,7 @@ var TextArea = /* @__PURE__ */ forwardRef22(({ __inputScope, classNames, density
|
|
|
3661
3635
|
});
|
|
3662
3636
|
});
|
|
3663
3637
|
TextArea.displayName = "Input.TextArea";
|
|
3664
|
-
var Checkbox = /* @__PURE__ */
|
|
3638
|
+
var Checkbox = /* @__PURE__ */ forwardRef23(({ __inputScope, classNames, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size, ...props }, forwardedRef) => {
|
|
3665
3639
|
const [checked, onCheckedChange] = useControllableState4({
|
|
3666
3640
|
prop: propsChecked,
|
|
3667
3641
|
defaultProp: propsDefaultChecked,
|
|
@@ -3669,7 +3643,7 @@ var Checkbox = /* @__PURE__ */ forwardRef22(({ __inputScope, classNames, checked
|
|
|
3669
3643
|
});
|
|
3670
3644
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext2(INPUT_NAME2, __inputScope);
|
|
3671
3645
|
const { tx } = useThemeContext();
|
|
3672
|
-
return /* @__PURE__ */
|
|
3646
|
+
return /* @__PURE__ */ React33.createElement(CheckboxPrimitive.Root, {
|
|
3673
3647
|
...props,
|
|
3674
3648
|
checked,
|
|
3675
3649
|
onCheckedChange,
|
|
@@ -3683,7 +3657,7 @@ var Checkbox = /* @__PURE__ */ forwardRef22(({ __inputScope, classNames, checked
|
|
|
3683
3657
|
size
|
|
3684
3658
|
}, "shrink-0", classNames),
|
|
3685
3659
|
ref: forwardedRef
|
|
3686
|
-
}, /* @__PURE__ */
|
|
3660
|
+
}, /* @__PURE__ */ React33.createElement(Icon, {
|
|
3687
3661
|
icon: checked === "indeterminate" ? "ph--minus--regular" : "ph--check--regular",
|
|
3688
3662
|
classNames: tx("input.checkboxIndicator", {
|
|
3689
3663
|
size,
|
|
@@ -3692,16 +3666,16 @@ var Checkbox = /* @__PURE__ */ forwardRef22(({ __inputScope, classNames, checked
|
|
|
3692
3666
|
}));
|
|
3693
3667
|
});
|
|
3694
3668
|
Checkbox.displayName = "Input.Checkbox";
|
|
3695
|
-
var Switch = /* @__PURE__ */
|
|
3669
|
+
var Switch = /* @__PURE__ */ forwardRef23(({ __inputScope, classNames, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, ...props }, forwardedRef) => {
|
|
3696
3670
|
const [checked, onCheckedChange] = useControllableState4({
|
|
3697
3671
|
prop: propsChecked,
|
|
3698
3672
|
defaultProp: propsDefaultChecked ?? false,
|
|
3699
3673
|
onChange: propsOnCheckedChange
|
|
3700
3674
|
});
|
|
3701
3675
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext2(INPUT_NAME2, __inputScope);
|
|
3702
|
-
return /* @__PURE__ */
|
|
3676
|
+
return /* @__PURE__ */ React33.createElement("input", {
|
|
3703
3677
|
type: "checkbox",
|
|
3704
|
-
className:
|
|
3678
|
+
className: mx11("dx-checkbox--switch dx-focus-ring", classNames),
|
|
3705
3679
|
checked,
|
|
3706
3680
|
onChange: (event) => {
|
|
3707
3681
|
onCheckedChange(event.target.checked);
|
|
@@ -3721,7 +3695,7 @@ var Time = SegmentedTime;
|
|
|
3721
3695
|
var Date2 = SegmentedDate;
|
|
3722
3696
|
var DateTime = SegmentedDateTime;
|
|
3723
3697
|
var Input = {
|
|
3724
|
-
Root:
|
|
3698
|
+
Root: Root8,
|
|
3725
3699
|
TriggerIcon,
|
|
3726
3700
|
PinInput,
|
|
3727
3701
|
TextInput,
|
|
@@ -3738,13 +3712,13 @@ var Input = {
|
|
|
3738
3712
|
};
|
|
3739
3713
|
|
|
3740
3714
|
// src/components/List/List.tsx
|
|
3741
|
-
import { Primitive as
|
|
3742
|
-
import { Slot as
|
|
3743
|
-
import
|
|
3715
|
+
import { Primitive as Primitive14 } from "@radix-ui/react-primitive";
|
|
3716
|
+
import { Slot as Slot14 } from "@radix-ui/react-slot";
|
|
3717
|
+
import React35, { forwardRef as forwardRef24 } from "react";
|
|
3744
3718
|
import { LIST_ITEM_NAME, LIST_NAME, ListItemCollapsibleContent, List as ListPrimitive, ListItem as ListPrimitiveItem, ListItemHeading as ListPrimitiveItemHeading, ListItemOpenTrigger as ListPrimitiveItemOpenTrigger, useListContext, useListItemContext } from "@dxos/react-list";
|
|
3745
3719
|
|
|
3746
3720
|
// src/components/List/ListDropIndicator.tsx
|
|
3747
|
-
import
|
|
3721
|
+
import React34 from "react";
|
|
3748
3722
|
var edgeToOrientationMap = {
|
|
3749
3723
|
top: "horizontal",
|
|
3750
3724
|
bottom: "horizontal",
|
|
@@ -3766,7 +3740,7 @@ var terminalSize = 8;
|
|
|
3766
3740
|
var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
3767
3741
|
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
3768
3742
|
const orientation = edgeToOrientationMap[edge];
|
|
3769
|
-
return /* @__PURE__ */
|
|
3743
|
+
return /* @__PURE__ */ React34.createElement("div", {
|
|
3770
3744
|
style: {
|
|
3771
3745
|
"--line-thickness": `${strokeSize}px`,
|
|
3772
3746
|
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
@@ -3785,19 +3759,19 @@ var List = composable(({ children, ...props }, forwardedRef) => {
|
|
|
3785
3759
|
const { tx } = useThemeContext();
|
|
3786
3760
|
const density = useDensityContext(props.density);
|
|
3787
3761
|
const { className, ...rest } = composableProps(props);
|
|
3788
|
-
return /* @__PURE__ */
|
|
3762
|
+
return /* @__PURE__ */ React35.createElement(DensityProvider, {
|
|
3789
3763
|
density
|
|
3790
|
-
}, /* @__PURE__ */
|
|
3764
|
+
}, /* @__PURE__ */ React35.createElement(ListPrimitive, {
|
|
3791
3765
|
...rest,
|
|
3792
3766
|
className: tx("list.root", {}, className),
|
|
3793
3767
|
ref: forwardedRef
|
|
3794
3768
|
}, children));
|
|
3795
3769
|
});
|
|
3796
|
-
var ListItemEndcap = /* @__PURE__ */
|
|
3797
|
-
const Comp = asChild ?
|
|
3770
|
+
var ListItemEndcap = /* @__PURE__ */ forwardRef24(({ children, classNames, asChild, ...props }, forwardedRef) => {
|
|
3771
|
+
const Comp = asChild ? Slot14 : Primitive14.div;
|
|
3798
3772
|
const density = useDensityContext();
|
|
3799
3773
|
const { tx } = useThemeContext();
|
|
3800
|
-
return /* @__PURE__ */
|
|
3774
|
+
return /* @__PURE__ */ React35.createElement(Comp, {
|
|
3801
3775
|
...!asChild && {
|
|
3802
3776
|
role: "none"
|
|
3803
3777
|
},
|
|
@@ -3811,44 +3785,44 @@ var ListItemEndcap = /* @__PURE__ */ forwardRef23(({ children, classNames, asChi
|
|
|
3811
3785
|
var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
3812
3786
|
const density = useDensityContext();
|
|
3813
3787
|
const { tx } = useThemeContext();
|
|
3814
|
-
return /* @__PURE__ */
|
|
3788
|
+
return /* @__PURE__ */ React35.createElement("div", {
|
|
3815
3789
|
...props,
|
|
3816
3790
|
className: tx("list.item.openTrigger", {
|
|
3817
3791
|
density
|
|
3818
3792
|
}, classNames)
|
|
3819
3793
|
});
|
|
3820
3794
|
};
|
|
3821
|
-
var ListItemHeading = /* @__PURE__ */
|
|
3795
|
+
var ListItemHeading = /* @__PURE__ */ forwardRef24(({ children, classNames, ...props }, forwardedRef) => {
|
|
3822
3796
|
const { tx } = useThemeContext();
|
|
3823
3797
|
const density = useDensityContext();
|
|
3824
|
-
return /* @__PURE__ */
|
|
3798
|
+
return /* @__PURE__ */ React35.createElement(ListPrimitiveItemHeading, {
|
|
3825
3799
|
...props,
|
|
3826
3800
|
className: tx("list.item.heading", {
|
|
3827
3801
|
density
|
|
3828
3802
|
}, classNames),
|
|
3829
3803
|
ref: forwardedRef
|
|
3830
|
-
}, /* @__PURE__ */
|
|
3804
|
+
}, /* @__PURE__ */ React35.createElement("span", null, children));
|
|
3831
3805
|
});
|
|
3832
|
-
var ListItemOpenTrigger = /* @__PURE__ */
|
|
3806
|
+
var ListItemOpenTrigger = /* @__PURE__ */ forwardRef24(({ __listItemScope, classNames, children, ...props }, forwardedRef) => {
|
|
3833
3807
|
const { tx } = useThemeContext();
|
|
3834
3808
|
const density = useDensityContext();
|
|
3835
3809
|
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
3836
|
-
return /* @__PURE__ */
|
|
3810
|
+
return /* @__PURE__ */ React35.createElement(ListPrimitiveItemOpenTrigger, {
|
|
3837
3811
|
...props,
|
|
3838
3812
|
className: tx("list.item.openTrigger", {
|
|
3839
3813
|
density
|
|
3840
3814
|
}, classNames),
|
|
3841
3815
|
ref: forwardedRef
|
|
3842
|
-
}, children || /* @__PURE__ */
|
|
3816
|
+
}, children || /* @__PURE__ */ React35.createElement(Icon, {
|
|
3843
3817
|
size: 3,
|
|
3844
3818
|
icon: open ? "ph--caret-down--bold" : "ph--caret-right--bold",
|
|
3845
3819
|
classNames: tx("list.item.openTriggerIcon", {})
|
|
3846
3820
|
}));
|
|
3847
3821
|
});
|
|
3848
|
-
var ListItemRoot = /* @__PURE__ */
|
|
3822
|
+
var ListItemRoot = /* @__PURE__ */ forwardRef24(({ classNames, children, ...props }, forwardedRef) => {
|
|
3849
3823
|
const { tx } = useThemeContext();
|
|
3850
3824
|
const density = useDensityContext();
|
|
3851
|
-
return /* @__PURE__ */
|
|
3825
|
+
return /* @__PURE__ */ React35.createElement(ListPrimitiveItem, {
|
|
3852
3826
|
...props,
|
|
3853
3827
|
className: tx("list.item.root", {
|
|
3854
3828
|
density,
|
|
@@ -3868,10 +3842,10 @@ var ListItem = {
|
|
|
3868
3842
|
};
|
|
3869
3843
|
|
|
3870
3844
|
// src/components/List/Tree.tsx
|
|
3871
|
-
import
|
|
3845
|
+
import React37, { forwardRef as forwardRef25 } from "react";
|
|
3872
3846
|
|
|
3873
3847
|
// src/components/List/TreeDropIndicator.tsx
|
|
3874
|
-
import
|
|
3848
|
+
import React36 from "react";
|
|
3875
3849
|
var edgeToOrientationMap2 = {
|
|
3876
3850
|
"reorder-above": "sibling",
|
|
3877
3851
|
"reorder-below": "sibling",
|
|
@@ -3901,7 +3875,7 @@ var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
|
3901
3875
|
if (isBlocked) {
|
|
3902
3876
|
return null;
|
|
3903
3877
|
}
|
|
3904
|
-
return /* @__PURE__ */
|
|
3878
|
+
return /* @__PURE__ */ React36.createElement("div", {
|
|
3905
3879
|
style: {
|
|
3906
3880
|
"--line-thickness": `${strokeSize2}px`,
|
|
3907
3881
|
"--line-offset": `${lineOffset}`,
|
|
@@ -3916,22 +3890,22 @@ var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
|
3916
3890
|
};
|
|
3917
3891
|
|
|
3918
3892
|
// src/components/List/Tree.tsx
|
|
3919
|
-
var TreeRoot = /* @__PURE__ */
|
|
3920
|
-
return /* @__PURE__ */
|
|
3893
|
+
var TreeRoot = /* @__PURE__ */ forwardRef25((props, forwardedRef) => {
|
|
3894
|
+
return /* @__PURE__ */ React37.createElement(List, {
|
|
3921
3895
|
...props,
|
|
3922
3896
|
ref: forwardedRef
|
|
3923
3897
|
});
|
|
3924
3898
|
});
|
|
3925
|
-
var TreeBranch = /* @__PURE__ */
|
|
3899
|
+
var TreeBranch = /* @__PURE__ */ forwardRef25(({ __listScope, ...props }, forwardedRef) => {
|
|
3926
3900
|
const { headingId } = useListItemContext(LIST_ITEM_NAME, __listScope);
|
|
3927
|
-
return /* @__PURE__ */
|
|
3901
|
+
return /* @__PURE__ */ React37.createElement(List, {
|
|
3928
3902
|
...props,
|
|
3929
3903
|
"aria-labelledby": headingId,
|
|
3930
3904
|
ref: forwardedRef
|
|
3931
3905
|
});
|
|
3932
3906
|
});
|
|
3933
|
-
var TreeItemRoot = /* @__PURE__ */
|
|
3934
|
-
return /* @__PURE__ */
|
|
3907
|
+
var TreeItemRoot = /* @__PURE__ */ forwardRef25((props, forwardedRef) => {
|
|
3908
|
+
return /* @__PURE__ */ React37.createElement(ListItem.Root, {
|
|
3935
3909
|
role: "treeitem",
|
|
3936
3910
|
...props,
|
|
3937
3911
|
ref: forwardedRef
|
|
@@ -3957,10 +3931,10 @@ var TreeItem = {
|
|
|
3957
3931
|
// src/components/List/Treegrid.tsx
|
|
3958
3932
|
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
3959
3933
|
import { createContextScope as createContextScope3 } from "@radix-ui/react-context";
|
|
3960
|
-
import { Primitive as
|
|
3961
|
-
import { Slot as
|
|
3934
|
+
import { Primitive as Primitive15 } from "@radix-ui/react-primitive";
|
|
3935
|
+
import { Slot as Slot15 } from "@radix-ui/react-slot";
|
|
3962
3936
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
3963
|
-
import
|
|
3937
|
+
import React38, { forwardRef as forwardRef26, useCallback as useCallback13 } from "react";
|
|
3964
3938
|
var TREEGRID_ROW_NAME = "Treegrid.Row";
|
|
3965
3939
|
var [createTreegridRowContext, createTreegridRowScope] = createContextScope3(TREEGRID_ROW_NAME, []);
|
|
3966
3940
|
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
@@ -3971,9 +3945,9 @@ var TreegridRoot = composable(({ asChild, classNames, children, style, gridTempl
|
|
|
3971
3945
|
const { className, role: _role, ...rest } = composableProps(props, {
|
|
3972
3946
|
classNames
|
|
3973
3947
|
});
|
|
3974
|
-
const Comp = asChild ?
|
|
3948
|
+
const Comp = asChild ? Slot15 : Primitive15.div;
|
|
3975
3949
|
const { findFirstFocusable } = useFocusFinders();
|
|
3976
|
-
const handleKeyDown =
|
|
3950
|
+
const handleKeyDown = useCallback13((event) => {
|
|
3977
3951
|
switch (event.key) {
|
|
3978
3952
|
case "ArrowDown":
|
|
3979
3953
|
case "ArrowUp": {
|
|
@@ -4007,7 +3981,7 @@ var TreegridRoot = composable(({ asChild, classNames, children, style, gridTempl
|
|
|
4007
3981
|
findFirstFocusable,
|
|
4008
3982
|
onKeyDownProp
|
|
4009
3983
|
]);
|
|
4010
|
-
return /* @__PURE__ */
|
|
3984
|
+
return /* @__PURE__ */ React38.createElement(Comp, {
|
|
4011
3985
|
role: "treegrid",
|
|
4012
3986
|
...rest,
|
|
4013
3987
|
className: tx("treegrid.root", {}, className),
|
|
@@ -4019,9 +3993,9 @@ var TreegridRoot = composable(({ asChild, classNames, children, style, gridTempl
|
|
|
4019
3993
|
ref: forwardedRef
|
|
4020
3994
|
}, children);
|
|
4021
3995
|
});
|
|
4022
|
-
var TreegridRow = /* @__PURE__ */
|
|
3996
|
+
var TreegridRow = /* @__PURE__ */ forwardRef26(({ __treegridRowScope, asChild, classNames, children, id, parentOf, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, ...props }, forwardedRef) => {
|
|
4023
3997
|
const { tx } = useThemeContext();
|
|
4024
|
-
const Comp = asChild ?
|
|
3998
|
+
const Comp = asChild ? Slot15 : Primitive15.div;
|
|
4025
3999
|
const pathParts = id.split(TREEGRID_PATH_SEPARATOR);
|
|
4026
4000
|
const level = pathParts.length - 1;
|
|
4027
4001
|
const [open, onOpenChange] = useControllableState5({
|
|
@@ -4029,11 +4003,11 @@ var TreegridRow = /* @__PURE__ */ forwardRef25(({ __treegridRowScope, asChild, c
|
|
|
4029
4003
|
onChange: propsOnOpenChange,
|
|
4030
4004
|
defaultProp: defaultOpen
|
|
4031
4005
|
});
|
|
4032
|
-
return /* @__PURE__ */
|
|
4006
|
+
return /* @__PURE__ */ React38.createElement(TreegridRowProvider, {
|
|
4033
4007
|
open,
|
|
4034
4008
|
onOpenChange,
|
|
4035
4009
|
scope: __treegridRowScope
|
|
4036
|
-
}, /* @__PURE__ */
|
|
4010
|
+
}, /* @__PURE__ */ React38.createElement(Comp, {
|
|
4037
4011
|
role: "row",
|
|
4038
4012
|
"aria-level": level,
|
|
4039
4013
|
className: tx("treegrid.row", {
|
|
@@ -4048,9 +4022,9 @@ var TreegridRow = /* @__PURE__ */ forwardRef25(({ __treegridRowScope, asChild, c
|
|
|
4048
4022
|
ref: forwardedRef
|
|
4049
4023
|
}, children));
|
|
4050
4024
|
});
|
|
4051
|
-
var TreegridCell = /* @__PURE__ */
|
|
4025
|
+
var TreegridCell = /* @__PURE__ */ forwardRef26(({ classNames, children, indent, ...props }, forwardedRef) => {
|
|
4052
4026
|
const { tx } = useThemeContext();
|
|
4053
|
-
return /* @__PURE__ */
|
|
4027
|
+
return /* @__PURE__ */ React38.createElement("div", {
|
|
4054
4028
|
role: "gridcell",
|
|
4055
4029
|
className: tx("treegrid.cell", {
|
|
4056
4030
|
indent
|
|
@@ -4069,17 +4043,17 @@ var Treegrid = {
|
|
|
4069
4043
|
import { useFocusableGroup as useFocusableGroup2 } from "@fluentui/react-tabster";
|
|
4070
4044
|
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
4071
4045
|
import { DialogContent as DialogContent2, Root as DialogRoot2, DialogTitle as DialogTitle2 } from "@radix-ui/react-dialog";
|
|
4072
|
-
import { Primitive as
|
|
4073
|
-
import { Slot as
|
|
4046
|
+
import { Primitive as Primitive16 } from "@radix-ui/react-primitive";
|
|
4047
|
+
import { Slot as Slot16 } from "@radix-ui/react-slot";
|
|
4074
4048
|
import { useControllableState as useControllableState6 } from "@radix-ui/react-use-controllable-state";
|
|
4075
|
-
import
|
|
4049
|
+
import React39, { forwardRef as forwardRef27, useCallback as useCallback15, useEffect as useEffect8, useRef as useRef7, useState as useState14 } from "react";
|
|
4076
4050
|
import { addEventListener } from "@dxos/async";
|
|
4077
4051
|
import { log as log2 } from "@dxos/log";
|
|
4078
4052
|
import { useForwardedRef, useMediaQuery } from "@dxos/react-hooks";
|
|
4079
4053
|
import { osTranslations as osTranslations3 } from "@dxos/ui-theme";
|
|
4080
4054
|
|
|
4081
4055
|
// src/components/Main/useSwipeToDismiss.ts
|
|
4082
|
-
import { useCallback as
|
|
4056
|
+
import { useCallback as useCallback14, useEffect as useEffect7, useState as useState13 } from "react";
|
|
4083
4057
|
var useSwipeToDismiss = (ref, {
|
|
4084
4058
|
onDismiss,
|
|
4085
4059
|
dismissThreshold = 64,
|
|
@@ -4090,20 +4064,20 @@ var useSwipeToDismiss = (ref, {
|
|
|
4090
4064
|
const $root = ref.current;
|
|
4091
4065
|
const [motionState, setMotionState] = useState13(0);
|
|
4092
4066
|
const [gestureStartX, setGestureStartX] = useState13(0);
|
|
4093
|
-
const setIdle =
|
|
4067
|
+
const setIdle = useCallback14(() => {
|
|
4094
4068
|
setMotionState(0);
|
|
4095
4069
|
$root?.style.removeProperty("inset-inline-start");
|
|
4096
4070
|
$root?.style.setProperty("transition-duration", "200ms");
|
|
4097
4071
|
}, [
|
|
4098
4072
|
$root
|
|
4099
4073
|
]);
|
|
4100
|
-
const setFollowing =
|
|
4074
|
+
const setFollowing = useCallback14(() => {
|
|
4101
4075
|
setMotionState(2);
|
|
4102
4076
|
$root?.style.setProperty("transition-duration", "0ms");
|
|
4103
4077
|
}, [
|
|
4104
4078
|
$root
|
|
4105
4079
|
]);
|
|
4106
|
-
const handlePointerDown =
|
|
4080
|
+
const handlePointerDown = useCallback14(({ screenX }) => {
|
|
4107
4081
|
if (motionState === 0) {
|
|
4108
4082
|
setMotionState(1);
|
|
4109
4083
|
setGestureStartX(screenX);
|
|
@@ -4111,7 +4085,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
4111
4085
|
}, [
|
|
4112
4086
|
motionState
|
|
4113
4087
|
]);
|
|
4114
|
-
const handlePointerMove =
|
|
4088
|
+
const handlePointerMove = useCallback14(({ screenX }) => {
|
|
4115
4089
|
if ($root) {
|
|
4116
4090
|
const delta = Math.min(screenX - gestureStartX, 0);
|
|
4117
4091
|
switch (motionState) {
|
|
@@ -4135,7 +4109,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
4135
4109
|
motionState,
|
|
4136
4110
|
gestureStartX
|
|
4137
4111
|
]);
|
|
4138
|
-
const handlePointerUp =
|
|
4112
|
+
const handlePointerUp = useCallback14(() => {
|
|
4139
4113
|
setIdle();
|
|
4140
4114
|
}, [
|
|
4141
4115
|
setIdle
|
|
@@ -4182,7 +4156,7 @@ var handleOpenAutoFocus = (event) => {
|
|
|
4182
4156
|
};
|
|
4183
4157
|
var landmarkAttr = "data-main-landmark";
|
|
4184
4158
|
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
4185
|
-
const handleKeyDown =
|
|
4159
|
+
const handleKeyDown = useCallback15((event) => {
|
|
4186
4160
|
const target = event.target;
|
|
4187
4161
|
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
4188
4162
|
event.preventDefault();
|
|
@@ -4225,22 +4199,22 @@ var useSidebars = (consumerName) => {
|
|
|
4225
4199
|
return {
|
|
4226
4200
|
navigationSidebarState,
|
|
4227
4201
|
setNavigationSidebarState,
|
|
4228
|
-
toggleNavigationSidebar:
|
|
4202
|
+
toggleNavigationSidebar: useCallback15(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
4229
4203
|
navigationSidebarState,
|
|
4230
4204
|
setNavigationSidebarState
|
|
4231
4205
|
]),
|
|
4232
|
-
openNavigationSidebar:
|
|
4233
|
-
collapseNavigationSidebar:
|
|
4234
|
-
closeNavigationSidebar:
|
|
4206
|
+
openNavigationSidebar: useCallback15(() => setNavigationSidebarState("expanded"), []),
|
|
4207
|
+
collapseNavigationSidebar: useCallback15(() => setNavigationSidebarState("collapsed"), []),
|
|
4208
|
+
closeNavigationSidebar: useCallback15(() => setNavigationSidebarState("closed"), []),
|
|
4235
4209
|
complementarySidebarState,
|
|
4236
4210
|
setComplementarySidebarState,
|
|
4237
|
-
toggleComplementarySidebar:
|
|
4211
|
+
toggleComplementarySidebar: useCallback15(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
4238
4212
|
complementarySidebarState,
|
|
4239
4213
|
setComplementarySidebarState
|
|
4240
4214
|
]),
|
|
4241
|
-
openComplementarySidebar:
|
|
4242
|
-
collapseComplementarySidebar:
|
|
4243
|
-
closeComplementarySidebar:
|
|
4215
|
+
openComplementarySidebar: useCallback15(() => setComplementarySidebarState("expanded"), []),
|
|
4216
|
+
collapseComplementarySidebar: useCallback15(() => setComplementarySidebarState("collapsed"), []),
|
|
4217
|
+
closeComplementarySidebar: useCallback15(() => setComplementarySidebarState("closed"), [])
|
|
4244
4218
|
};
|
|
4245
4219
|
};
|
|
4246
4220
|
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState = "closed", onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState = "closed", onComplementarySidebarStateChange, children, ...props }) => {
|
|
@@ -4256,7 +4230,7 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
4256
4230
|
onChange: onComplementarySidebarStateChange
|
|
4257
4231
|
});
|
|
4258
4232
|
const [resizing, setResizing] = useState14(false);
|
|
4259
|
-
const resizeInterval =
|
|
4233
|
+
const resizeInterval = useRef7(null);
|
|
4260
4234
|
useEffect8(() => addEventListener(window, "resize", () => {
|
|
4261
4235
|
setResizing(true);
|
|
4262
4236
|
if (resizeInterval.current) {
|
|
@@ -4267,7 +4241,7 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
4267
4241
|
resizeInterval.current = null;
|
|
4268
4242
|
}, 3e3);
|
|
4269
4243
|
}), []);
|
|
4270
|
-
return /* @__PURE__ */
|
|
4244
|
+
return /* @__PURE__ */ React39.createElement(MainProvider, {
|
|
4271
4245
|
...props,
|
|
4272
4246
|
navigationSidebarState,
|
|
4273
4247
|
setNavigationSidebarState,
|
|
@@ -4277,11 +4251,11 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
4277
4251
|
}, children);
|
|
4278
4252
|
};
|
|
4279
4253
|
MainRoot.displayName = MAIN_ROOT_NAME;
|
|
4280
|
-
var MainOverlay = /* @__PURE__ */
|
|
4254
|
+
var MainOverlay = /* @__PURE__ */ forwardRef27(({ classNames, ...props }, forwardedRef) => {
|
|
4281
4255
|
const [isLg] = useMediaQuery("lg");
|
|
4282
4256
|
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_OVERLAY_NAME);
|
|
4283
4257
|
const { tx } = useThemeContext();
|
|
4284
|
-
return /* @__PURE__ */
|
|
4258
|
+
return /* @__PURE__ */ React39.createElement("div", {
|
|
4285
4259
|
...props,
|
|
4286
4260
|
onClick: () => {
|
|
4287
4261
|
setNavigationSidebarState("collapsed");
|
|
@@ -4298,16 +4272,16 @@ var MainOverlay = /* @__PURE__ */ forwardRef26(({ classNames, ...props }, forwar
|
|
|
4298
4272
|
});
|
|
4299
4273
|
});
|
|
4300
4274
|
MainOverlay.displayName = MAIN_OVERLAY_NAME;
|
|
4301
|
-
var MainSidebar = /* @__PURE__ */
|
|
4275
|
+
var MainSidebar = /* @__PURE__ */ forwardRef27(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props }, forwardedRef) => {
|
|
4302
4276
|
const [isLg] = useMediaQuery("lg");
|
|
4303
4277
|
const { tx } = useThemeContext();
|
|
4304
4278
|
const { t } = useTranslation(osTranslations3);
|
|
4305
4279
|
const ref = useForwardedRef(forwardedRef);
|
|
4306
|
-
const noopRef =
|
|
4280
|
+
const noopRef = useRef7(null);
|
|
4307
4281
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
4308
4282
|
onDismiss: () => onStateChange?.("closed")
|
|
4309
4283
|
});
|
|
4310
|
-
const handleKeyDown =
|
|
4284
|
+
const handleKeyDown = useCallback15((event) => {
|
|
4311
4285
|
const focusGroupParent = event.target.closest("[data-tabster]");
|
|
4312
4286
|
if (event.key === "Escape" && focusGroupParent) {
|
|
4313
4287
|
event.preventDefault();
|
|
@@ -4318,14 +4292,14 @@ var MainSidebar = /* @__PURE__ */ forwardRef26(({ classNames, children, swipeToD
|
|
|
4318
4292
|
}, [
|
|
4319
4293
|
props.onKeyDown
|
|
4320
4294
|
]);
|
|
4321
|
-
const Root13 = isLg ?
|
|
4322
|
-
return /* @__PURE__ */
|
|
4295
|
+
const Root13 = isLg ? Primitive16.div : DialogContent2;
|
|
4296
|
+
return /* @__PURE__ */ React39.createElement(DialogRoot2, {
|
|
4323
4297
|
open: state !== "closed",
|
|
4324
4298
|
"aria-label": toLocalizedString(label, t),
|
|
4325
4299
|
modal: false
|
|
4326
|
-
}, !isLg && /* @__PURE__ */
|
|
4300
|
+
}, !isLg && /* @__PURE__ */ React39.createElement(DialogTitle2, {
|
|
4327
4301
|
className: "sr-only"
|
|
4328
|
-
}, toLocalizedString(label, t)), /* @__PURE__ */
|
|
4302
|
+
}, toLocalizedString(label, t)), /* @__PURE__ */ React39.createElement(Root13, {
|
|
4329
4303
|
...!isLg && {
|
|
4330
4304
|
forceMount: true,
|
|
4331
4305
|
tabIndex: -1,
|
|
@@ -4343,10 +4317,10 @@ var MainSidebar = /* @__PURE__ */ forwardRef26(({ classNames, children, swipeToD
|
|
|
4343
4317
|
ref
|
|
4344
4318
|
}, children));
|
|
4345
4319
|
});
|
|
4346
|
-
var MainNavigationSidebar = /* @__PURE__ */
|
|
4320
|
+
var MainNavigationSidebar = /* @__PURE__ */ forwardRef27((props, forwardedRef) => {
|
|
4347
4321
|
const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);
|
|
4348
4322
|
const mover = useLandmarkMover(props.onKeyDown, "0");
|
|
4349
|
-
return /* @__PURE__ */
|
|
4323
|
+
return /* @__PURE__ */ React39.createElement(MainSidebar, {
|
|
4350
4324
|
...mover,
|
|
4351
4325
|
...props,
|
|
4352
4326
|
state: navigationSidebarState,
|
|
@@ -4357,10 +4331,10 @@ var MainNavigationSidebar = /* @__PURE__ */ forwardRef26((props, forwardedRef) =
|
|
|
4357
4331
|
});
|
|
4358
4332
|
});
|
|
4359
4333
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
4360
|
-
var MainComplementarySidebar = /* @__PURE__ */
|
|
4334
|
+
var MainComplementarySidebar = /* @__PURE__ */ forwardRef27((props, forwardedRef) => {
|
|
4361
4335
|
const { complementarySidebarState, setComplementarySidebarState, resizing } = useMainContext(COMPLEMENTARY_SIDEBAR_NAME);
|
|
4362
4336
|
const mover = useLandmarkMover(props.onKeyDown, "2");
|
|
4363
|
-
return /* @__PURE__ */
|
|
4337
|
+
return /* @__PURE__ */ React39.createElement(MainSidebar, {
|
|
4364
4338
|
...mover,
|
|
4365
4339
|
...props,
|
|
4366
4340
|
state: complementarySidebarState,
|
|
@@ -4371,12 +4345,12 @@ var MainComplementarySidebar = /* @__PURE__ */ forwardRef26((props, forwardedRef
|
|
|
4371
4345
|
});
|
|
4372
4346
|
});
|
|
4373
4347
|
MainComplementarySidebar.displayName = COMPLEMENTARY_SIDEBAR_NAME;
|
|
4374
|
-
var MainContent = /* @__PURE__ */
|
|
4348
|
+
var MainContent = /* @__PURE__ */ forwardRef27(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
4375
4349
|
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
4376
4350
|
const { tx } = useThemeContext();
|
|
4377
|
-
const Comp = asChild ?
|
|
4351
|
+
const Comp = asChild ? Slot16 : role ? Primitive16.div : "main";
|
|
4378
4352
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
4379
|
-
return /* @__PURE__ */
|
|
4353
|
+
return /* @__PURE__ */ React39.createElement(Comp, {
|
|
4380
4354
|
...handlesFocus && {
|
|
4381
4355
|
...mover
|
|
4382
4356
|
},
|
|
@@ -4403,12 +4377,12 @@ var Main = {
|
|
|
4403
4377
|
|
|
4404
4378
|
// src/components/Message/Message.tsx
|
|
4405
4379
|
import { createContext as createContext11 } from "@radix-ui/react-context";
|
|
4406
|
-
import { Primitive as
|
|
4407
|
-
import { Slot as
|
|
4408
|
-
import
|
|
4409
|
-
import { useTranslation as
|
|
4380
|
+
import { Primitive as Primitive17 } from "@radix-ui/react-primitive";
|
|
4381
|
+
import { Slot as Slot17 } from "@radix-ui/react-slot";
|
|
4382
|
+
import React40, { forwardRef as forwardRef28 } from "react";
|
|
4383
|
+
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
4410
4384
|
import { useId as useId5 } from "@dxos/react-hooks";
|
|
4411
|
-
import { translationKey as
|
|
4385
|
+
import { translationKey as translationKey6 } from "#translations";
|
|
4412
4386
|
var messageIcons = {
|
|
4413
4387
|
success: "ph--check-circle--duotone",
|
|
4414
4388
|
info: "ph--info--duotone",
|
|
@@ -4445,16 +4419,16 @@ var valenceVars = {
|
|
|
4445
4419
|
}
|
|
4446
4420
|
};
|
|
4447
4421
|
var [MessageProvider, useMessageContext] = createContext11(MESSAGE_NAME);
|
|
4448
|
-
var MessageRoot = /* @__PURE__ */
|
|
4422
|
+
var MessageRoot = /* @__PURE__ */ forwardRef28(({ asChild, valence = "neutral", elevation: propsElevation, classNames, titleId: propsTitleId, descriptionId: propsDescriptionId, children, ...props }, forwardedRef) => {
|
|
4449
4423
|
const { tx } = useThemeContext();
|
|
4450
4424
|
const titleId = useId5("message__title", propsTitleId);
|
|
4451
4425
|
const descriptionId = useId5("message__description", propsDescriptionId);
|
|
4452
4426
|
const elevation = useElevationContext(propsElevation);
|
|
4453
|
-
return /* @__PURE__ */
|
|
4427
|
+
return /* @__PURE__ */ React40.createElement(MessageProvider, {
|
|
4454
4428
|
titleId,
|
|
4455
4429
|
descriptionId,
|
|
4456
4430
|
valence
|
|
4457
|
-
}, /* @__PURE__ */
|
|
4431
|
+
}, /* @__PURE__ */ React40.createElement(Column.Root, {
|
|
4458
4432
|
asChild,
|
|
4459
4433
|
role: valence === "neutral" ? "paragraph" : "alert",
|
|
4460
4434
|
"aria-labelledby": titleId,
|
|
@@ -4473,26 +4447,22 @@ var MessageRoot = /* @__PURE__ */ forwardRef27(({ asChild, valence = "neutral",
|
|
|
4473
4447
|
});
|
|
4474
4448
|
MessageRoot.displayName = MESSAGE_NAME;
|
|
4475
4449
|
var MESSAGE_TITLE_NAME = "Message.Title";
|
|
4476
|
-
var MessageTitle = /* @__PURE__ */
|
|
4477
|
-
const { t } =
|
|
4450
|
+
var MessageTitle = /* @__PURE__ */ forwardRef28(({ classNames, children, icon: iconProp, onClose }, forwardedRef) => {
|
|
4451
|
+
const { t } = useTranslation6(translationKey6);
|
|
4478
4452
|
const { tx } = useThemeContext();
|
|
4479
4453
|
const { titleId, valence } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
4480
4454
|
const icon = iconProp ?? messageIcons[valence];
|
|
4481
|
-
return /* @__PURE__ */
|
|
4455
|
+
return /* @__PURE__ */ React40.createElement(Column.Row, {
|
|
4482
4456
|
classNames: tx("message.header", {}, classNames),
|
|
4483
4457
|
ref: forwardedRef
|
|
4484
|
-
}, icon && /* @__PURE__ */
|
|
4485
|
-
className: tx("message.icon", {
|
|
4486
|
-
valence
|
|
4487
|
-
})
|
|
4488
|
-
}, /* @__PURE__ */ React39.createElement(Icon, {
|
|
4458
|
+
}, icon && /* @__PURE__ */ React40.createElement(Column.Block, null, /* @__PURE__ */ React40.createElement(Icon, {
|
|
4489
4459
|
icon
|
|
4490
|
-
})), /* @__PURE__ */
|
|
4460
|
+
})), /* @__PURE__ */ React40.createElement("h2", {
|
|
4491
4461
|
className: tx("message.title", {}, classNames),
|
|
4492
4462
|
id: titleId
|
|
4493
|
-
}, children), onClose && /* @__PURE__ */
|
|
4494
|
-
|
|
4495
|
-
}, /* @__PURE__ */
|
|
4463
|
+
}, children), onClose && /* @__PURE__ */ React40.createElement(Column.Block, {
|
|
4464
|
+
end: true
|
|
4465
|
+
}, /* @__PURE__ */ React40.createElement(IconButton, {
|
|
4496
4466
|
variant: "ghost",
|
|
4497
4467
|
icon: "ph--x--regular",
|
|
4498
4468
|
iconOnly: true,
|
|
@@ -4503,11 +4473,11 @@ var MessageTitle = /* @__PURE__ */ forwardRef27(({ classNames, children, icon: i
|
|
|
4503
4473
|
});
|
|
4504
4474
|
MessageTitle.displayName = MESSAGE_TITLE_NAME;
|
|
4505
4475
|
var MESSAGE_CONTENT_NAME = "Message.Content";
|
|
4506
|
-
var MessageContent = /* @__PURE__ */
|
|
4476
|
+
var MessageContent = /* @__PURE__ */ forwardRef28(({ asChild, classNames, children, ...props }, forwardedRef) => {
|
|
4507
4477
|
const { tx } = useThemeContext();
|
|
4508
4478
|
const { descriptionId } = useMessageContext(MESSAGE_CONTENT_NAME);
|
|
4509
|
-
const Comp = asChild ?
|
|
4510
|
-
return /* @__PURE__ */
|
|
4479
|
+
const Comp = asChild ? Slot17 : Primitive17.p;
|
|
4480
|
+
return /* @__PURE__ */ React40.createElement(Comp, {
|
|
4511
4481
|
...props,
|
|
4512
4482
|
className: tx("message.content", {}, classNames),
|
|
4513
4483
|
id: descriptionId,
|
|
@@ -4523,16 +4493,16 @@ var Message = {
|
|
|
4523
4493
|
var Callout = Message;
|
|
4524
4494
|
|
|
4525
4495
|
// src/components/Panel/Panel.tsx
|
|
4526
|
-
import { Primitive as
|
|
4527
|
-
import { Slot as
|
|
4528
|
-
import
|
|
4496
|
+
import { Primitive as Primitive18 } from "@radix-ui/react-primitive";
|
|
4497
|
+
import { Slot as Slot18 } from "@radix-ui/react-slot";
|
|
4498
|
+
import React41 from "react";
|
|
4529
4499
|
var GRID_TEMPLATE_ROWS = "auto 1fr auto";
|
|
4530
4500
|
var GRID_TEMPLATE_AREAS = '"toolbar" "content" "statusbar"';
|
|
4531
4501
|
var PanelRoot = slottable(({ children, asChild, role, style, ...props }, forwardedRef) => {
|
|
4532
4502
|
const { className, ...rest } = composableProps(props);
|
|
4533
|
-
const Comp = asChild ?
|
|
4503
|
+
const Comp = asChild ? Slot18 : Primitive18.div;
|
|
4534
4504
|
const { tx } = useThemeContext();
|
|
4535
|
-
return /* @__PURE__ */
|
|
4505
|
+
return /* @__PURE__ */ React41.createElement(Comp, {
|
|
4536
4506
|
...rest,
|
|
4537
4507
|
role: role ?? "none",
|
|
4538
4508
|
style: {
|
|
@@ -4547,9 +4517,9 @@ var PanelRoot = slottable(({ children, asChild, role, style, ...props }, forward
|
|
|
4547
4517
|
PanelRoot.displayName = "Panel.Root";
|
|
4548
4518
|
var PanelToolbar = slottable(({ children, asChild, size, ...props }, forwardedRef) => {
|
|
4549
4519
|
const { className, ...rest } = composableProps(props);
|
|
4550
|
-
const Comp = asChild ?
|
|
4520
|
+
const Comp = asChild ? Slot18 : Primitive18.div;
|
|
4551
4521
|
const { tx } = useThemeContext();
|
|
4552
|
-
return /* @__PURE__ */
|
|
4522
|
+
return /* @__PURE__ */ React41.createElement(Comp, {
|
|
4553
4523
|
...rest,
|
|
4554
4524
|
"data-slot": "toolbar",
|
|
4555
4525
|
className: tx("panel.toolbar", {
|
|
@@ -4561,9 +4531,9 @@ var PanelToolbar = slottable(({ children, asChild, size, ...props }, forwardedRe
|
|
|
4561
4531
|
PanelToolbar.displayName = "Panel.Toolbar";
|
|
4562
4532
|
var PanelContent = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
4563
4533
|
const { className, ...rest } = composableProps(props);
|
|
4564
|
-
const Comp = asChild ?
|
|
4534
|
+
const Comp = asChild ? Slot18 : Primitive18.div;
|
|
4565
4535
|
const { tx } = useThemeContext();
|
|
4566
|
-
return /* @__PURE__ */
|
|
4536
|
+
return /* @__PURE__ */ React41.createElement(Comp, {
|
|
4567
4537
|
...rest,
|
|
4568
4538
|
"data-slot": "content",
|
|
4569
4539
|
className: tx("panel.content", {}, className),
|
|
@@ -4573,9 +4543,9 @@ var PanelContent = slottable(({ children, asChild, ...props }, forwardedRef) =>
|
|
|
4573
4543
|
PanelContent.displayName = "Panel.Content";
|
|
4574
4544
|
var PanelStatusbar = slottable(({ children, asChild, size, ...props }, forwardedRef) => {
|
|
4575
4545
|
const { className, ...rest } = composableProps(props);
|
|
4576
|
-
const Comp = asChild ?
|
|
4546
|
+
const Comp = asChild ? Slot18 : Primitive18.div;
|
|
4577
4547
|
const { tx } = useThemeContext();
|
|
4578
|
-
return /* @__PURE__ */
|
|
4548
|
+
return /* @__PURE__ */ React41.createElement(Comp, {
|
|
4579
4549
|
...rest,
|
|
4580
4550
|
"data-slot": "statusbar",
|
|
4581
4551
|
className: tx("panel.statusbar", {
|
|
@@ -4594,9 +4564,9 @@ var Panel = {
|
|
|
4594
4564
|
|
|
4595
4565
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
4596
4566
|
import { createContext as createContext12 } from "@radix-ui/react-context";
|
|
4597
|
-
import { Primitive as
|
|
4598
|
-
import { Slot as
|
|
4599
|
-
import
|
|
4567
|
+
import { Primitive as Primitive19 } from "@radix-ui/react-primitive";
|
|
4568
|
+
import { Slot as Slot19 } from "@radix-ui/react-slot";
|
|
4569
|
+
import React42, { useMemo as useMemo7 } from "react";
|
|
4600
4570
|
|
|
4601
4571
|
// src/components/ScrollArea/scrollbar.ts
|
|
4602
4572
|
var scrollbar = {
|
|
@@ -4621,7 +4591,7 @@ var SCROLLAREA_ROOT_NAME = "ScrollArea.Root";
|
|
|
4621
4591
|
var ScrollAreaRoot = slottable(({ children, asChild, orientation = "vertical", autoHide = true, centered = false, padding = false, thin = false, snap = false, ...props }, forwardedRef) => {
|
|
4622
4592
|
const { tx } = useThemeContext();
|
|
4623
4593
|
const { className, ...rest } = composableProps(props);
|
|
4624
|
-
const Comp = asChild ?
|
|
4594
|
+
const Comp = asChild ? Slot19 : Primitive19.div;
|
|
4625
4595
|
const options = useMemo7(() => ({
|
|
4626
4596
|
orientation,
|
|
4627
4597
|
autoHide,
|
|
@@ -4637,7 +4607,7 @@ var ScrollAreaRoot = slottable(({ children, asChild, orientation = "vertical", a
|
|
|
4637
4607
|
thin,
|
|
4638
4608
|
snap
|
|
4639
4609
|
]);
|
|
4640
|
-
return /* @__PURE__ */
|
|
4610
|
+
return /* @__PURE__ */ React42.createElement(ScrollAreaProvider, options, /* @__PURE__ */ React42.createElement(Comp, {
|
|
4641
4611
|
...rest,
|
|
4642
4612
|
className: tx("scrollArea.root", options, className),
|
|
4643
4613
|
ref: forwardedRef
|
|
@@ -4651,8 +4621,8 @@ var ScrollAreaViewport = slottable(({ children, asChild, ...props }, forwardedRe
|
|
|
4651
4621
|
const density = options.thin ? scrollbar.md : scrollbar.lg;
|
|
4652
4622
|
const { className, ...rest } = composableProps(props);
|
|
4653
4623
|
const { style, ...restWithoutStyle } = rest;
|
|
4654
|
-
const Comp = asChild ?
|
|
4655
|
-
return /* @__PURE__ */
|
|
4624
|
+
const Comp = asChild ? Slot19 : Primitive19.div;
|
|
4625
|
+
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
4656
4626
|
...restWithoutStyle,
|
|
4657
4627
|
style: {
|
|
4658
4628
|
"--scroll-width": `${density.size}px`,
|
|
@@ -4671,23 +4641,23 @@ var ScrollArea = {
|
|
|
4671
4641
|
|
|
4672
4642
|
// src/components/ScrollContainer/ScrollContainer.tsx
|
|
4673
4643
|
import { createContext as createContext13 } from "@radix-ui/react-context";
|
|
4674
|
-
import
|
|
4644
|
+
import React43, { forwardRef as forwardRef29, useCallback as useCallback16, useEffect as useEffect9, useImperativeHandle, useMemo as useMemo8, useRef as useRef8, useState as useState15 } from "react";
|
|
4675
4645
|
import { addEventListener as addEventListener2, combine } from "@dxos/async";
|
|
4676
4646
|
import { invariant } from "@dxos/invariant";
|
|
4677
4647
|
import { useMergeRefs } from "@dxos/react-hooks";
|
|
4678
|
-
import { mx as
|
|
4648
|
+
import { mx as mx12 } from "@dxos/ui-theme";
|
|
4679
4649
|
var __dxlog_file3 = "/__w/dxos/dxos/packages/ui/react-ui/src/components/ScrollContainer/ScrollContainer.tsx";
|
|
4680
4650
|
var isBottom = (el) => {
|
|
4681
4651
|
return !!(el && el.scrollHeight - el.scrollTop === el.clientHeight);
|
|
4682
4652
|
};
|
|
4683
4653
|
var [ScrollContainerProvider, useScrollContainerContext] = createContext13("ScrollContainer");
|
|
4684
|
-
var ScrollContainerRoot = /* @__PURE__ */
|
|
4685
|
-
const scrollerRef =
|
|
4686
|
-
const autoScrollRef =
|
|
4654
|
+
var ScrollContainerRoot = /* @__PURE__ */ forwardRef29(({ children, pin, behavior: behaviorProp = "smooth" }, forwardedRef) => {
|
|
4655
|
+
const scrollerRef = useRef8(null);
|
|
4656
|
+
const autoScrollRef = useRef8(false);
|
|
4687
4657
|
const [pinned, setPinned] = useState15(pin);
|
|
4688
4658
|
const [overflow, setOverflow] = useState15(false);
|
|
4689
|
-
const timeoutRef =
|
|
4690
|
-
const scrollToBottom =
|
|
4659
|
+
const timeoutRef = useRef8(void 0);
|
|
4660
|
+
const scrollToBottom = useCallback16((behavior = behaviorProp) => {
|
|
4691
4661
|
if (scrollerRef.current) {
|
|
4692
4662
|
if (behavior !== "instant") {
|
|
4693
4663
|
autoScrollRef.current = true;
|
|
@@ -4728,10 +4698,10 @@ var ScrollContainerRoot = /* @__PURE__ */ forwardRef28(({ children, pin, behavio
|
|
|
4728
4698
|
useImperativeHandle(forwardedRef, () => controller, [
|
|
4729
4699
|
controller
|
|
4730
4700
|
]);
|
|
4731
|
-
const setViewport =
|
|
4701
|
+
const setViewport = useCallback16((el) => {
|
|
4732
4702
|
scrollerRef.current = el;
|
|
4733
4703
|
}, []);
|
|
4734
|
-
return /* @__PURE__ */
|
|
4704
|
+
return /* @__PURE__ */ React43.createElement(ScrollContainerProvider, {
|
|
4735
4705
|
pinned,
|
|
4736
4706
|
overflow,
|
|
4737
4707
|
controller,
|
|
@@ -4742,7 +4712,7 @@ var ScrollContainerRoot = /* @__PURE__ */ forwardRef28(({ children, pin, behavio
|
|
|
4742
4712
|
});
|
|
4743
4713
|
ScrollContainerRoot.displayName = "ScrollContainer.Root";
|
|
4744
4714
|
var ScrollContainerContent = composable(({ children, thin, padding, centered, ...props }, forwardedRef) => {
|
|
4745
|
-
return /* @__PURE__ */
|
|
4715
|
+
return /* @__PURE__ */ React43.createElement(ScrollArea.Root, {
|
|
4746
4716
|
...composableProps(props, {
|
|
4747
4717
|
classNames: "relative isolate"
|
|
4748
4718
|
}),
|
|
@@ -4755,7 +4725,7 @@ var ScrollContainerContent = composable(({ children, thin, padding, centered, ..
|
|
|
4755
4725
|
ScrollContainerContent.displayName = "ScrollContainer.Content";
|
|
4756
4726
|
var VIEWPORT_NAME = "ScrollContainer.Viewport";
|
|
4757
4727
|
var ScrollContainerViewport = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
4758
|
-
const scrollerRef =
|
|
4728
|
+
const scrollerRef = useRef8(null);
|
|
4759
4729
|
const mergedRef = useMergeRefs([
|
|
4760
4730
|
forwardedRef,
|
|
4761
4731
|
scrollerRef
|
|
@@ -4773,11 +4743,11 @@ var ScrollContainerViewport = slottable(({ children, asChild, ...props }, forwar
|
|
|
4773
4743
|
setPinned,
|
|
4774
4744
|
setOverflow
|
|
4775
4745
|
]);
|
|
4776
|
-
return /* @__PURE__ */
|
|
4746
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(ScrollArea.Viewport, {
|
|
4777
4747
|
asChild,
|
|
4778
4748
|
...composableProps(props),
|
|
4779
4749
|
ref: mergedRef
|
|
4780
|
-
}, children), /* @__PURE__ */
|
|
4750
|
+
}, children), /* @__PURE__ */ React43.createElement(ScrollContainerPinEffect, {
|
|
4781
4751
|
scrollerRef
|
|
4782
4752
|
}));
|
|
4783
4753
|
});
|
|
@@ -4822,9 +4792,9 @@ var ScrollContainerPinEffect = ({ scrollerRef }) => {
|
|
|
4822
4792
|
var FADE_NAME = "ScrollContainer.Fade";
|
|
4823
4793
|
function ScrollContainerFade() {
|
|
4824
4794
|
const { overflow } = useScrollContainerContext(FADE_NAME);
|
|
4825
|
-
return /* @__PURE__ */
|
|
4795
|
+
return /* @__PURE__ */ React43.createElement("div", {
|
|
4826
4796
|
"data-visible": overflow,
|
|
4827
|
-
className:
|
|
4797
|
+
className: mx12(
|
|
4828
4798
|
// NOTE: Gradients may not be visible with dark reader extensions.
|
|
4829
4799
|
"z-10 absolute top-0 inset-x-0 h-24 w-full",
|
|
4830
4800
|
'opacity-0 duration-200 transition-opacity data-[visible="true"]:opacity-100',
|
|
@@ -4836,9 +4806,9 @@ ScrollContainerFade.displayName = FADE_NAME;
|
|
|
4836
4806
|
var SCROLL_DOWN_BUTTON_NAME = "ScrollContainer.ScrollDownButton";
|
|
4837
4807
|
function ScrollContainerScrollDownButton({ classNames }) {
|
|
4838
4808
|
const { pinned, controller } = useScrollContainerContext(SCROLL_DOWN_BUTTON_NAME);
|
|
4839
|
-
return /* @__PURE__ */
|
|
4840
|
-
className:
|
|
4841
|
-
}, /* @__PURE__ */
|
|
4809
|
+
return /* @__PURE__ */ React43.createElement("div", {
|
|
4810
|
+
className: mx12("absolute bottom-2 right-4 opacity-100 transition-opacity duration-300", pinned && "opacity-0", classNames)
|
|
4811
|
+
}, /* @__PURE__ */ React43.createElement(IconButton, {
|
|
4842
4812
|
variant: "primary",
|
|
4843
4813
|
icon: "ph--arrow-down--regular",
|
|
4844
4814
|
iconOnly: true,
|
|
@@ -4858,35 +4828,35 @@ var ScrollContainer = {
|
|
|
4858
4828
|
|
|
4859
4829
|
// src/components/Select/Select.tsx
|
|
4860
4830
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4861
|
-
import
|
|
4831
|
+
import React44, { forwardRef as forwardRef30 } from "react";
|
|
4862
4832
|
var SelectRoot = SelectPrimitive.Root;
|
|
4863
4833
|
var SelectTrigger = SelectPrimitive.Trigger;
|
|
4864
4834
|
var SelectValue = SelectPrimitive.Value;
|
|
4865
4835
|
var SelectIcon = SelectPrimitive.Icon;
|
|
4866
4836
|
var SelectPortal = SelectPrimitive.Portal;
|
|
4867
|
-
var SelectTriggerButton = /* @__PURE__ */
|
|
4837
|
+
var SelectTriggerButton = /* @__PURE__ */ forwardRef30(({ children, placeholder, classNames, ...props }, forwardedRef) => {
|
|
4868
4838
|
const { tx } = useThemeContext();
|
|
4869
|
-
return /* @__PURE__ */
|
|
4839
|
+
return /* @__PURE__ */ React44.createElement(SelectPrimitive.Trigger, {
|
|
4870
4840
|
asChild: true,
|
|
4871
4841
|
ref: forwardedRef
|
|
4872
|
-
}, /* @__PURE__ */
|
|
4842
|
+
}, /* @__PURE__ */ React44.createElement(Button, {
|
|
4873
4843
|
...props,
|
|
4874
4844
|
classNames: tx("select.triggerButton", {}, classNames)
|
|
4875
|
-
}, /* @__PURE__ */
|
|
4845
|
+
}, /* @__PURE__ */ React44.createElement(SelectPrimitive.Value, {
|
|
4876
4846
|
placeholder
|
|
4877
|
-
}, children), /* @__PURE__ */
|
|
4847
|
+
}, children), /* @__PURE__ */ React44.createElement(SelectPrimitive.Icon, {
|
|
4878
4848
|
asChild: true
|
|
4879
|
-
}, /* @__PURE__ */
|
|
4849
|
+
}, /* @__PURE__ */ React44.createElement(Icon, {
|
|
4880
4850
|
size: 3,
|
|
4881
4851
|
icon: "ph--caret-down--bold"
|
|
4882
4852
|
}))));
|
|
4883
4853
|
});
|
|
4884
4854
|
SelectTriggerButton.displayName = "Select.TriggerButton";
|
|
4885
|
-
var SelectContent = /* @__PURE__ */
|
|
4855
|
+
var SelectContent = /* @__PURE__ */ forwardRef30(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
4886
4856
|
const { tx } = useThemeContext();
|
|
4887
4857
|
const elevation = useElevationContext();
|
|
4888
4858
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
4889
|
-
return /* @__PURE__ */
|
|
4859
|
+
return /* @__PURE__ */ React44.createElement(SelectPrimitive.Content, {
|
|
4890
4860
|
...props,
|
|
4891
4861
|
"data-arrow-keys": "up down",
|
|
4892
4862
|
collisionPadding: safeCollisionPadding,
|
|
@@ -4898,42 +4868,42 @@ var SelectContent = /* @__PURE__ */ forwardRef29(({ classNames, children, collis
|
|
|
4898
4868
|
}, children);
|
|
4899
4869
|
});
|
|
4900
4870
|
SelectContent.displayName = "Select.Content";
|
|
4901
|
-
var SelectScrollUpButton2 = /* @__PURE__ */
|
|
4871
|
+
var SelectScrollUpButton2 = /* @__PURE__ */ forwardRef30(({ classNames, children, ...props }, forwardedRef) => {
|
|
4902
4872
|
const { tx } = useThemeContext();
|
|
4903
|
-
return /* @__PURE__ */
|
|
4873
|
+
return /* @__PURE__ */ React44.createElement(SelectPrimitive.SelectScrollUpButton, {
|
|
4904
4874
|
...props,
|
|
4905
4875
|
className: tx("select.scrollButton", {}, classNames),
|
|
4906
4876
|
ref: forwardedRef
|
|
4907
|
-
}, children ?? /* @__PURE__ */
|
|
4877
|
+
}, children ?? /* @__PURE__ */ React44.createElement(Icon, {
|
|
4908
4878
|
size: 3,
|
|
4909
4879
|
icon: "ph--caret-up--bold"
|
|
4910
4880
|
}));
|
|
4911
4881
|
});
|
|
4912
4882
|
SelectScrollUpButton2.displayName = "Select.ScrollUpButton";
|
|
4913
|
-
var SelectScrollDownButton2 = /* @__PURE__ */
|
|
4883
|
+
var SelectScrollDownButton2 = /* @__PURE__ */ forwardRef30(({ classNames, children, ...props }, forwardedRef) => {
|
|
4914
4884
|
const { tx } = useThemeContext();
|
|
4915
|
-
return /* @__PURE__ */
|
|
4885
|
+
return /* @__PURE__ */ React44.createElement(SelectPrimitive.SelectScrollDownButton, {
|
|
4916
4886
|
...props,
|
|
4917
4887
|
className: tx("select.scrollButton", {}, classNames),
|
|
4918
4888
|
ref: forwardedRef
|
|
4919
|
-
}, children ?? /* @__PURE__ */
|
|
4889
|
+
}, children ?? /* @__PURE__ */ React44.createElement(Icon, {
|
|
4920
4890
|
size: 3,
|
|
4921
4891
|
icon: "ph--caret-down--bold"
|
|
4922
4892
|
}));
|
|
4923
4893
|
});
|
|
4924
4894
|
SelectScrollDownButton2.displayName = "Select.ScrollDownButton";
|
|
4925
|
-
var SelectViewport2 = /* @__PURE__ */
|
|
4895
|
+
var SelectViewport2 = /* @__PURE__ */ forwardRef30(({ classNames, children, ...props }, forwardedRef) => {
|
|
4926
4896
|
const { tx } = useThemeContext();
|
|
4927
|
-
return /* @__PURE__ */
|
|
4897
|
+
return /* @__PURE__ */ React44.createElement(SelectPrimitive.SelectViewport, {
|
|
4928
4898
|
...props,
|
|
4929
4899
|
className: tx("select.viewport", {}, classNames),
|
|
4930
4900
|
ref: forwardedRef
|
|
4931
4901
|
}, children);
|
|
4932
4902
|
});
|
|
4933
4903
|
SelectViewport2.displayName = "Select.Viewport";
|
|
4934
|
-
var SelectItem = /* @__PURE__ */
|
|
4904
|
+
var SelectItem = /* @__PURE__ */ forwardRef30(({ classNames, ...props }, forwardedRef) => {
|
|
4935
4905
|
const { tx } = useThemeContext();
|
|
4936
|
-
return /* @__PURE__ */
|
|
4906
|
+
return /* @__PURE__ */ React44.createElement(SelectPrimitive.Item, {
|
|
4937
4907
|
...props,
|
|
4938
4908
|
className: tx("select.item", {}, classNames),
|
|
4939
4909
|
ref: forwardedRef
|
|
@@ -4941,24 +4911,24 @@ var SelectItem = /* @__PURE__ */ forwardRef29(({ classNames, ...props }, forward
|
|
|
4941
4911
|
});
|
|
4942
4912
|
SelectItem.displayName = "Select.Item";
|
|
4943
4913
|
var SelectItemText = SelectPrimitive.ItemText;
|
|
4944
|
-
var SelectItemIndicator = /* @__PURE__ */
|
|
4914
|
+
var SelectItemIndicator = /* @__PURE__ */ forwardRef30(({ classNames, children, ...props }, forwardedRef) => {
|
|
4945
4915
|
const { tx } = useThemeContext();
|
|
4946
|
-
return /* @__PURE__ */
|
|
4916
|
+
return /* @__PURE__ */ React44.createElement(SelectPrimitive.ItemIndicator, {
|
|
4947
4917
|
...props,
|
|
4948
4918
|
className: tx("select.itemIndicator", {}, classNames),
|
|
4949
4919
|
ref: forwardedRef
|
|
4950
4920
|
}, children);
|
|
4951
4921
|
});
|
|
4952
4922
|
SelectItemIndicator.displayName = "Select.ItemIndicator";
|
|
4953
|
-
var SelectOption = /* @__PURE__ */
|
|
4923
|
+
var SelectOption = /* @__PURE__ */ forwardRef30(({ children, classNames, ...props }, forwardedRef) => {
|
|
4954
4924
|
const { tx } = useThemeContext();
|
|
4955
|
-
return /* @__PURE__ */
|
|
4925
|
+
return /* @__PURE__ */ React44.createElement(SelectPrimitive.Item, {
|
|
4956
4926
|
...props,
|
|
4957
4927
|
className: tx("select.item", {}, classNames),
|
|
4958
4928
|
ref: forwardedRef
|
|
4959
|
-
}, /* @__PURE__ */
|
|
4929
|
+
}, /* @__PURE__ */ React44.createElement(SelectPrimitive.ItemText, null, children), /* @__PURE__ */ React44.createElement("span", {
|
|
4960
4930
|
className: "grow"
|
|
4961
|
-
}), /* @__PURE__ */
|
|
4931
|
+
}), /* @__PURE__ */ React44.createElement(Icon, {
|
|
4962
4932
|
size: 3,
|
|
4963
4933
|
icon: "ph--check--regular"
|
|
4964
4934
|
}));
|
|
@@ -4966,18 +4936,18 @@ var SelectOption = /* @__PURE__ */ forwardRef29(({ children, classNames, ...prop
|
|
|
4966
4936
|
SelectOption.displayName = "Select.Option";
|
|
4967
4937
|
var SelectGroup = SelectPrimitive.Group;
|
|
4968
4938
|
var SelectLabel = SelectPrimitive.Label;
|
|
4969
|
-
var SelectSeparator = /* @__PURE__ */
|
|
4939
|
+
var SelectSeparator = /* @__PURE__ */ forwardRef30(({ classNames, ...props }, forwardedRef) => {
|
|
4970
4940
|
const { tx } = useThemeContext();
|
|
4971
|
-
return /* @__PURE__ */
|
|
4941
|
+
return /* @__PURE__ */ React44.createElement(SelectPrimitive.Separator, {
|
|
4972
4942
|
...props,
|
|
4973
4943
|
className: tx("select.separator", {}, classNames),
|
|
4974
4944
|
ref: forwardedRef
|
|
4975
4945
|
});
|
|
4976
4946
|
});
|
|
4977
4947
|
SelectSeparator.displayName = "Select.Separator";
|
|
4978
|
-
var SelectArrow = /* @__PURE__ */
|
|
4948
|
+
var SelectArrow = /* @__PURE__ */ forwardRef30(({ classNames, ...props }, forwardedRef) => {
|
|
4979
4949
|
const { tx } = useThemeContext();
|
|
4980
|
-
return /* @__PURE__ */
|
|
4950
|
+
return /* @__PURE__ */ React44.createElement(SelectPrimitive.Arrow, {
|
|
4981
4951
|
...props,
|
|
4982
4952
|
className: tx("select.arrow", {}, classNames),
|
|
4983
4953
|
ref: forwardedRef
|
|
@@ -5005,11 +4975,27 @@ var Select = {
|
|
|
5005
4975
|
Arrow: SelectArrow
|
|
5006
4976
|
};
|
|
5007
4977
|
|
|
4978
|
+
// src/components/Separator/Separator.tsx
|
|
4979
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4980
|
+
import React45, { forwardRef as forwardRef31 } from "react";
|
|
4981
|
+
var Separator4 = /* @__PURE__ */ forwardRef31(({ classNames, orientation = "horizontal", subdued, ...props }, forwardedRef) => {
|
|
4982
|
+
const { tx } = useThemeContext();
|
|
4983
|
+
return /* @__PURE__ */ React45.createElement(SeparatorPrimitive.Root, {
|
|
4984
|
+
...props,
|
|
4985
|
+
orientation,
|
|
4986
|
+
className: tx("separator.root", {
|
|
4987
|
+
orientation,
|
|
4988
|
+
subdued
|
|
4989
|
+
}, classNames),
|
|
4990
|
+
ref: forwardedRef
|
|
4991
|
+
});
|
|
4992
|
+
});
|
|
4993
|
+
|
|
5008
4994
|
// src/components/Skeleton/Skeleton.tsx
|
|
5009
|
-
import
|
|
5010
|
-
var Skeleton = /* @__PURE__ */
|
|
4995
|
+
import React46, { forwardRef as forwardRef32 } from "react";
|
|
4996
|
+
var Skeleton = /* @__PURE__ */ forwardRef32(({ classNames, variant = "default", ...props }, forwardedRef) => {
|
|
5011
4997
|
const { tx } = useThemeContext();
|
|
5012
|
-
return /* @__PURE__ */
|
|
4998
|
+
return /* @__PURE__ */ React46.createElement("div", {
|
|
5013
4999
|
...props,
|
|
5014
5000
|
className: tx("skeleton.root", {
|
|
5015
5001
|
variant
|
|
@@ -5020,9 +5006,9 @@ var Skeleton = /* @__PURE__ */ forwardRef30(({ classNames, variant = "default",
|
|
|
5020
5006
|
|
|
5021
5007
|
// src/components/Splitter/Splitter.tsx
|
|
5022
5008
|
import { createContextScope as createContextScope4 } from "@radix-ui/react-context";
|
|
5023
|
-
import { Primitive as
|
|
5024
|
-
import { Slot as
|
|
5025
|
-
import
|
|
5009
|
+
import { Primitive as Primitive20 } from "@radix-ui/react-primitive";
|
|
5010
|
+
import { Slot as Slot20 } from "@radix-ui/react-slot";
|
|
5011
|
+
import React47 from "react";
|
|
5026
5012
|
var SPLITTER_NAME = "Splitter";
|
|
5027
5013
|
var [createSplitterContext, createSplitterScope] = createContextScope4(SPLITTER_NAME);
|
|
5028
5014
|
var [SplitterProvider, useSplitterContext] = createSplitterContext(SPLITTER_NAME);
|
|
@@ -5031,13 +5017,13 @@ var SplitterRoot = slottable(({ asChild, mode = "top", ratio = 0.5, transition =
|
|
|
5031
5017
|
const { tx } = useThemeContext();
|
|
5032
5018
|
const { __scopeSplitter, ...rest } = props;
|
|
5033
5019
|
const { className, ...restProps } = composableProps(rest);
|
|
5034
|
-
const Comp = asChild ?
|
|
5035
|
-
return /* @__PURE__ */
|
|
5020
|
+
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
5021
|
+
return /* @__PURE__ */ React47.createElement(SplitterProvider, {
|
|
5036
5022
|
scope: __scopeSplitter,
|
|
5037
5023
|
mode,
|
|
5038
5024
|
ratio,
|
|
5039
5025
|
transition
|
|
5040
|
-
}, /* @__PURE__ */
|
|
5026
|
+
}, /* @__PURE__ */ React47.createElement(Comp, {
|
|
5041
5027
|
...restProps,
|
|
5042
5028
|
ref: forwardedRef,
|
|
5043
5029
|
className: tx("splitter.root", {}, className)
|
|
@@ -5048,13 +5034,13 @@ var PANEL_NAME = "Splitter.Panel";
|
|
|
5048
5034
|
var SplitterPanel = slottable(({ classNames, asChild, children, position, style, ...props }, forwardedRef) => {
|
|
5049
5035
|
const { tx } = useThemeContext();
|
|
5050
5036
|
const { __scopeSplitter, ...rest } = props;
|
|
5051
|
-
const Comp = asChild ?
|
|
5037
|
+
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
5052
5038
|
const { mode, ratio = 0.5, transition } = useSplitterContext(PANEL_NAME, __scopeSplitter);
|
|
5053
5039
|
const { className, ...restProps } = composableProps(rest);
|
|
5054
5040
|
const isTopPanel = position === "top";
|
|
5055
5041
|
const topOffset = isTopPanel ? "0%" : mode === "top" ? "100%" : mode === "bottom" ? "0%" : `${ratio * 100}%`;
|
|
5056
5042
|
const height = isTopPanel ? mode === "top" ? "100%" : mode === "bottom" ? "0%" : `${ratio * 100}%` : mode === "bottom" ? "100%" : mode === "top" ? "0%" : `${(1 - ratio) * 100}%`;
|
|
5057
|
-
return /* @__PURE__ */
|
|
5043
|
+
return /* @__PURE__ */ React47.createElement(Comp, {
|
|
5058
5044
|
...restProps,
|
|
5059
5045
|
ref: forwardedRef,
|
|
5060
5046
|
className: tx("splitter.panel", {}, className),
|
|
@@ -5073,10 +5059,10 @@ var Splitter = {
|
|
|
5073
5059
|
};
|
|
5074
5060
|
|
|
5075
5061
|
// src/components/Status/Status.tsx
|
|
5076
|
-
import
|
|
5077
|
-
var Status = /* @__PURE__ */
|
|
5062
|
+
import React48, { forwardRef as forwardRef33 } from "react";
|
|
5063
|
+
var Status = /* @__PURE__ */ forwardRef33(({ classNames, children, progress = 0, indeterminate, variant, ...props }, forwardedRef) => {
|
|
5078
5064
|
const { tx } = useThemeContext();
|
|
5079
|
-
return /* @__PURE__ */
|
|
5065
|
+
return /* @__PURE__ */ React48.createElement("span", {
|
|
5080
5066
|
role: "status",
|
|
5081
5067
|
...props,
|
|
5082
5068
|
className: tx("status.root", {
|
|
@@ -5084,7 +5070,7 @@ var Status = /* @__PURE__ */ forwardRef31(({ classNames, children, progress = 0,
|
|
|
5084
5070
|
variant
|
|
5085
5071
|
}, classNames),
|
|
5086
5072
|
ref: forwardedRef
|
|
5087
|
-
}, /* @__PURE__ */
|
|
5073
|
+
}, /* @__PURE__ */ React48.createElement("span", {
|
|
5088
5074
|
role: "none",
|
|
5089
5075
|
className: tx("status.bar", {
|
|
5090
5076
|
indeterminate,
|
|
@@ -5099,13 +5085,13 @@ var Status = /* @__PURE__ */ forwardRef31(({ classNames, children, progress = 0,
|
|
|
5099
5085
|
});
|
|
5100
5086
|
|
|
5101
5087
|
// src/components/Tag/Tag.tsx
|
|
5102
|
-
import { Primitive as
|
|
5103
|
-
import { Slot as
|
|
5104
|
-
import
|
|
5105
|
-
var Tag = /* @__PURE__ */
|
|
5088
|
+
import { Primitive as Primitive21 } from "@radix-ui/react-primitive";
|
|
5089
|
+
import { Slot as Slot21 } from "@radix-ui/react-slot";
|
|
5090
|
+
import React49, { forwardRef as forwardRef34 } from "react";
|
|
5091
|
+
var Tag = /* @__PURE__ */ forwardRef34(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
5106
5092
|
const { tx } = useThemeContext();
|
|
5107
|
-
const Comp = asChild ?
|
|
5108
|
-
return /* @__PURE__ */
|
|
5093
|
+
const Comp = asChild ? Slot21 : Primitive21.span;
|
|
5094
|
+
return /* @__PURE__ */ React49.createElement(Comp, {
|
|
5109
5095
|
...props,
|
|
5110
5096
|
className: tx("tag.root", {
|
|
5111
5097
|
palette
|
|
@@ -5117,72 +5103,71 @@ var Tag = /* @__PURE__ */ forwardRef32(({ asChild, palette = "neutral", classNam
|
|
|
5117
5103
|
|
|
5118
5104
|
// src/components/Toast/Toast.tsx
|
|
5119
5105
|
import * as ToastPrimitive from "@radix-ui/react-toast";
|
|
5120
|
-
import
|
|
5121
|
-
import { useTranslation as
|
|
5122
|
-
import { translationKey as
|
|
5106
|
+
import React50, { forwardRef as forwardRef35 } from "react";
|
|
5107
|
+
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
5108
|
+
import { translationKey as translationKey7 } from "#translations";
|
|
5123
5109
|
var ToastProvider = ToastPrimitive.Provider;
|
|
5124
|
-
var ToastViewport = /* @__PURE__ */
|
|
5110
|
+
var ToastViewport = /* @__PURE__ */ forwardRef35(({ classNames, ...props }, forwardedRef) => {
|
|
5125
5111
|
const { tx } = useThemeContext();
|
|
5126
|
-
return /* @__PURE__ */
|
|
5112
|
+
return /* @__PURE__ */ React50.createElement(ToastPrimitive.Viewport, {
|
|
5127
5113
|
...props,
|
|
5128
5114
|
className: tx("toast.viewport", {}, classNames),
|
|
5129
5115
|
ref: forwardedRef
|
|
5130
5116
|
});
|
|
5131
5117
|
});
|
|
5132
5118
|
ToastViewport.displayName = "Toast.Viewport";
|
|
5133
|
-
var ToastRoot = /* @__PURE__ */
|
|
5119
|
+
var ToastRoot = /* @__PURE__ */ forwardRef35(({ classNames, children, ...props }, forwardedRef) => {
|
|
5134
5120
|
const { tx } = useThemeContext();
|
|
5135
|
-
return /* @__PURE__ */
|
|
5121
|
+
return /* @__PURE__ */ React50.createElement(ToastPrimitive.Root, {
|
|
5136
5122
|
...props,
|
|
5137
5123
|
className: tx("toast.root", {}, classNames),
|
|
5138
5124
|
ref: forwardedRef
|
|
5139
|
-
}, /* @__PURE__ */
|
|
5125
|
+
}, /* @__PURE__ */ React50.createElement(ElevationProvider, {
|
|
5140
5126
|
elevation: "toast"
|
|
5141
|
-
}, /* @__PURE__ */
|
|
5127
|
+
}, /* @__PURE__ */ React50.createElement(Column.Root, {
|
|
5142
5128
|
classNames: tx("toast.grid", {})
|
|
5143
5129
|
}, children)));
|
|
5144
5130
|
});
|
|
5145
5131
|
ToastRoot.displayName = "Toast.Root";
|
|
5146
|
-
var ToastTitle = /* @__PURE__ */
|
|
5147
|
-
const { t } =
|
|
5132
|
+
var ToastTitle = /* @__PURE__ */ forwardRef35(({ classNames, children, icon, onClose, ...props }, forwardedRef) => {
|
|
5133
|
+
const { t } = useTranslation7(translationKey7);
|
|
5148
5134
|
const { tx } = useThemeContext();
|
|
5149
|
-
return /* @__PURE__ */
|
|
5135
|
+
return /* @__PURE__ */ React50.createElement(Column.Row, {
|
|
5150
5136
|
classNames: tx("toast.header", {})
|
|
5151
|
-
}, icon && /* @__PURE__ */
|
|
5152
|
-
className: tx("toast.icon", {})
|
|
5153
|
-
}, /* @__PURE__ */ React48.createElement(Icon, {
|
|
5137
|
+
}, icon && /* @__PURE__ */ React50.createElement(Column.Block, null, /* @__PURE__ */ React50.createElement(Icon, {
|
|
5154
5138
|
icon,
|
|
5155
5139
|
size: 5
|
|
5156
|
-
})), /* @__PURE__ */
|
|
5140
|
+
})), /* @__PURE__ */ React50.createElement(ToastPrimitive.Title, {
|
|
5157
5141
|
...props,
|
|
5158
5142
|
className: tx("toast.title", {}, classNames),
|
|
5159
5143
|
ref: forwardedRef
|
|
5160
|
-
}, children), onClose && /* @__PURE__ */
|
|
5144
|
+
}, children), onClose && /* @__PURE__ */ React50.createElement(Column.Block, {
|
|
5145
|
+
end: true
|
|
5146
|
+
}, /* @__PURE__ */ React50.createElement(IconButton, {
|
|
5161
5147
|
variant: "ghost",
|
|
5162
5148
|
icon: "ph--x--regular",
|
|
5163
5149
|
iconOnly: true,
|
|
5164
5150
|
label: t("toolbar-close.label"),
|
|
5165
|
-
classNames: tx("toast.close", {}),
|
|
5166
5151
|
onClick: onClose
|
|
5167
|
-
}));
|
|
5152
|
+
})));
|
|
5168
5153
|
});
|
|
5169
5154
|
ToastTitle.displayName = "Toast.Title";
|
|
5170
|
-
var ToastDescription = /* @__PURE__ */
|
|
5155
|
+
var ToastDescription = /* @__PURE__ */ forwardRef35(({ classNames, children, ...props }, forwardedRef) => {
|
|
5171
5156
|
const { tx } = useThemeContext();
|
|
5172
|
-
return /* @__PURE__ */
|
|
5157
|
+
return /* @__PURE__ */ React50.createElement(ToastPrimitive.Description, {
|
|
5173
5158
|
...props,
|
|
5174
5159
|
className: tx("toast.description", {}, classNames),
|
|
5175
5160
|
ref: forwardedRef
|
|
5176
5161
|
}, children);
|
|
5177
5162
|
});
|
|
5178
5163
|
ToastDescription.displayName = "Toast.Description";
|
|
5179
|
-
var ToastActions = /* @__PURE__ */
|
|
5164
|
+
var ToastActions = /* @__PURE__ */ forwardRef35(({ classNames, children, ...props }, forwardedRef) => {
|
|
5180
5165
|
const { tx } = useThemeContext();
|
|
5181
|
-
return /* @__PURE__ */
|
|
5166
|
+
return /* @__PURE__ */ React50.createElement(Column.Center, {
|
|
5182
5167
|
classNames: tx("toast.actions", {}, classNames),
|
|
5183
5168
|
ref: forwardedRef,
|
|
5184
5169
|
...props
|
|
5185
|
-
}, /* @__PURE__ */
|
|
5170
|
+
}, /* @__PURE__ */ React50.createElement(DensityProvider, {
|
|
5186
5171
|
density: "sm"
|
|
5187
5172
|
}, children));
|
|
5188
5173
|
});
|
|
@@ -5199,6 +5184,204 @@ var Toast = {
|
|
|
5199
5184
|
Action: ToastAction,
|
|
5200
5185
|
Close: ToastClose
|
|
5201
5186
|
};
|
|
5187
|
+
|
|
5188
|
+
// src/components/Toolbar/Toolbar.tsx
|
|
5189
|
+
import { Primitive as Primitive22 } from "@radix-ui/react-primitive";
|
|
5190
|
+
import { Slot as Slot22 } from "@radix-ui/react-slot";
|
|
5191
|
+
import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
5192
|
+
import React51, { forwardRef as forwardRef36 } from "react";
|
|
5193
|
+
import { useTranslation as useTranslation8 } from "react-i18next";
|
|
5194
|
+
import { translationKey as translationKey8 } from "#translations";
|
|
5195
|
+
var ToolbarRoot = composable(({ children, density, disabled, layoutManaged, orientation, ...props }, forwardedRef) => {
|
|
5196
|
+
const { className, role, ...rest } = composableProps(props);
|
|
5197
|
+
const { tx } = useThemeContext();
|
|
5198
|
+
return /* @__PURE__ */ React51.createElement(ToolbarPrimitive.Root, {
|
|
5199
|
+
...rest,
|
|
5200
|
+
...role !== "none" && {
|
|
5201
|
+
role
|
|
5202
|
+
},
|
|
5203
|
+
orientation,
|
|
5204
|
+
"data-arrow-keys": orientation === "vertical" ? "up down" : "left right",
|
|
5205
|
+
className: tx("toolbar.root", {
|
|
5206
|
+
density,
|
|
5207
|
+
disabled,
|
|
5208
|
+
layoutManaged
|
|
5209
|
+
}, className),
|
|
5210
|
+
ref: forwardedRef
|
|
5211
|
+
}, children);
|
|
5212
|
+
});
|
|
5213
|
+
ToolbarRoot.displayName = "Toolbar.Root";
|
|
5214
|
+
var ToolbarText = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
5215
|
+
const { className, ...rest } = composableProps(props);
|
|
5216
|
+
const Comp = asChild ? Slot22 : Primitive22.div;
|
|
5217
|
+
const { tx } = useThemeContext();
|
|
5218
|
+
return /* @__PURE__ */ React51.createElement(Comp, {
|
|
5219
|
+
...rest,
|
|
5220
|
+
className: tx("toolbar.text", {}, className),
|
|
5221
|
+
ref: forwardedRef
|
|
5222
|
+
}, children);
|
|
5223
|
+
});
|
|
5224
|
+
ToolbarText.displayName = "Toolbar.Text";
|
|
5225
|
+
var ToolbarButton = /* @__PURE__ */ forwardRef36((props, forwardedRef) => {
|
|
5226
|
+
return /* @__PURE__ */ React51.createElement(ToolbarPrimitive.Button, {
|
|
5227
|
+
asChild: true
|
|
5228
|
+
}, /* @__PURE__ */ React51.createElement(Button, {
|
|
5229
|
+
...props,
|
|
5230
|
+
ref: forwardedRef
|
|
5231
|
+
}));
|
|
5232
|
+
});
|
|
5233
|
+
ToolbarButton.displayName = "Toolbar.Button";
|
|
5234
|
+
var ToolbarIconButton = /* @__PURE__ */ forwardRef36((props, forwardedRef) => {
|
|
5235
|
+
return /* @__PURE__ */ React51.createElement(ToolbarPrimitive.Button, {
|
|
5236
|
+
asChild: true
|
|
5237
|
+
}, /* @__PURE__ */ React51.createElement(IconButton, {
|
|
5238
|
+
...props,
|
|
5239
|
+
ref: forwardedRef
|
|
5240
|
+
}));
|
|
5241
|
+
});
|
|
5242
|
+
ToolbarIconButton.displayName = "Toolbar.IconButton";
|
|
5243
|
+
var ToolbarToggle = /* @__PURE__ */ forwardRef36((props, forwardedRef) => {
|
|
5244
|
+
return /* @__PURE__ */ React51.createElement(ToolbarPrimitive.Button, {
|
|
5245
|
+
asChild: true
|
|
5246
|
+
}, /* @__PURE__ */ React51.createElement(Toggle, {
|
|
5247
|
+
...props,
|
|
5248
|
+
ref: forwardedRef
|
|
5249
|
+
}));
|
|
5250
|
+
});
|
|
5251
|
+
ToolbarToggle.displayName = "Toolbar.Toggle";
|
|
5252
|
+
var ToolbarLink = /* @__PURE__ */ forwardRef36((props, forwardedRef) => {
|
|
5253
|
+
return /* @__PURE__ */ React51.createElement(ToolbarPrimitive.Link, {
|
|
5254
|
+
asChild: true
|
|
5255
|
+
}, /* @__PURE__ */ React51.createElement(Link, {
|
|
5256
|
+
...props,
|
|
5257
|
+
ref: forwardedRef
|
|
5258
|
+
}));
|
|
5259
|
+
});
|
|
5260
|
+
ToolbarLink.displayName = "Toolbar.Link";
|
|
5261
|
+
var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef36(({ classNames, children, elevation, ...props }, forwardedRef) => {
|
|
5262
|
+
return /* @__PURE__ */ React51.createElement(ToolbarPrimitive.ToolbarToggleGroup, {
|
|
5263
|
+
...props,
|
|
5264
|
+
asChild: true
|
|
5265
|
+
}, /* @__PURE__ */ React51.createElement(ButtonGroup, {
|
|
5266
|
+
classNames,
|
|
5267
|
+
children,
|
|
5268
|
+
elevation,
|
|
5269
|
+
ref: forwardedRef
|
|
5270
|
+
}));
|
|
5271
|
+
});
|
|
5272
|
+
ToolbarToggleGroup2.displayName = "Toolbar.ToggleGroup";
|
|
5273
|
+
var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef36(({ variant, density, elevation, classNames, children, ...props }, forwardedRef) => {
|
|
5274
|
+
return /* @__PURE__ */ React51.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
5275
|
+
...props,
|
|
5276
|
+
asChild: true
|
|
5277
|
+
}, /* @__PURE__ */ React51.createElement(Button, {
|
|
5278
|
+
variant,
|
|
5279
|
+
density,
|
|
5280
|
+
elevation,
|
|
5281
|
+
classNames,
|
|
5282
|
+
children,
|
|
5283
|
+
ref: forwardedRef
|
|
5284
|
+
}));
|
|
5285
|
+
});
|
|
5286
|
+
ToolbarToggleGroupItem.displayName = "Toolbar.ToggleGroupItem";
|
|
5287
|
+
var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef36(({ variant, density, elevation, classNames, icon, label, iconOnly, iconClassNames, ...props }, forwardedRef) => {
|
|
5288
|
+
return /* @__PURE__ */ React51.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
5289
|
+
...props,
|
|
5290
|
+
asChild: true
|
|
5291
|
+
}, /* @__PURE__ */ React51.createElement(IconButton, {
|
|
5292
|
+
variant,
|
|
5293
|
+
density,
|
|
5294
|
+
elevation,
|
|
5295
|
+
classNames,
|
|
5296
|
+
icon,
|
|
5297
|
+
label,
|
|
5298
|
+
iconOnly,
|
|
5299
|
+
iconClassNames,
|
|
5300
|
+
ref: forwardedRef
|
|
5301
|
+
}));
|
|
5302
|
+
});
|
|
5303
|
+
ToolbarToggleGroupIconItem.displayName = "Toolbar.ToggleGroupIconItem";
|
|
5304
|
+
var ToolbarSeparator = /* @__PURE__ */ forwardRef36(({ variant = "gap", ...props }, forwardedRef) => {
|
|
5305
|
+
return variant === "line" ? /* @__PURE__ */ React51.createElement(ToolbarPrimitive.Separator, {
|
|
5306
|
+
asChild: true
|
|
5307
|
+
}, /* @__PURE__ */ React51.createElement(Separator4, {
|
|
5308
|
+
orientation: "vertical",
|
|
5309
|
+
...props,
|
|
5310
|
+
ref: forwardedRef
|
|
5311
|
+
})) : /* @__PURE__ */ React51.createElement(ToolbarPrimitive.Separator, {
|
|
5312
|
+
className: "grow",
|
|
5313
|
+
ref: forwardedRef
|
|
5314
|
+
});
|
|
5315
|
+
});
|
|
5316
|
+
ToolbarSeparator.displayName = "Toolbar.Separator";
|
|
5317
|
+
var ToolbarDragHandle = /* @__PURE__ */ forwardRef36(({ testId = "drag-handle", label }, forwardedRef) => {
|
|
5318
|
+
const { t } = useTranslation8(translationKey8);
|
|
5319
|
+
return /* @__PURE__ */ React51.createElement(ToolbarIconButton, {
|
|
5320
|
+
"data-testid": testId,
|
|
5321
|
+
tabIndex: -1,
|
|
5322
|
+
noTooltip: true,
|
|
5323
|
+
iconOnly: true,
|
|
5324
|
+
icon: "ph--dots-six-vertical--regular",
|
|
5325
|
+
variant: "ghost",
|
|
5326
|
+
label: label ?? t("toolbar-drag-handle.label"),
|
|
5327
|
+
classNames: "dx-focus-ring-none cursor-pointer",
|
|
5328
|
+
disabled: !forwardedRef,
|
|
5329
|
+
ref: forwardedRef
|
|
5330
|
+
});
|
|
5331
|
+
});
|
|
5332
|
+
ToolbarDragHandle.displayName = "Toolbar.DragHandle";
|
|
5333
|
+
var TOOLBAR_ACTION_ICONS = {
|
|
5334
|
+
close: "ph--x--regular",
|
|
5335
|
+
delete: "ph--trash--regular"
|
|
5336
|
+
};
|
|
5337
|
+
var TOOLBAR_ACTION_LABEL_KEYS = {
|
|
5338
|
+
close: "toolbar-close.label",
|
|
5339
|
+
delete: "toolbar-delete.label"
|
|
5340
|
+
};
|
|
5341
|
+
var ToolbarActionIconButton = /* @__PURE__ */ forwardRef36(({ action, onClick, label }, forwardedRef) => {
|
|
5342
|
+
const { t } = useTranslation8(translationKey8);
|
|
5343
|
+
return /* @__PURE__ */ React51.createElement(ToolbarIconButton, {
|
|
5344
|
+
iconOnly: true,
|
|
5345
|
+
icon: TOOLBAR_ACTION_ICONS[action],
|
|
5346
|
+
variant: "ghost",
|
|
5347
|
+
label: label ?? t(TOOLBAR_ACTION_LABEL_KEYS[action]),
|
|
5348
|
+
classNames: "cursor-pointer",
|
|
5349
|
+
onClick,
|
|
5350
|
+
ref: forwardedRef
|
|
5351
|
+
});
|
|
5352
|
+
});
|
|
5353
|
+
ToolbarActionIconButton.displayName = "Toolbar.ActionIconButton";
|
|
5354
|
+
function ToolbarMenu({ context, items }) {
|
|
5355
|
+
const { t } = useTranslation8(translationKey8);
|
|
5356
|
+
return /* @__PURE__ */ React51.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React51.createElement(DropdownMenu.Trigger, {
|
|
5357
|
+
disabled: !items?.length,
|
|
5358
|
+
asChild: true
|
|
5359
|
+
}, /* @__PURE__ */ React51.createElement(ToolbarIconButton, {
|
|
5360
|
+
iconOnly: true,
|
|
5361
|
+
variant: "ghost",
|
|
5362
|
+
icon: "ph--dots-three-vertical--regular",
|
|
5363
|
+
label: t("toolbar-menu.label")
|
|
5364
|
+
})), (items?.length ?? 0) > 0 && /* @__PURE__ */ React51.createElement(DropdownMenu.Portal, null, /* @__PURE__ */ React51.createElement(DropdownMenu.Content, null, /* @__PURE__ */ React51.createElement(DropdownMenu.Viewport, null, items?.map(({ label, onClick: onSelect }, index) => /* @__PURE__ */ React51.createElement(DropdownMenu.Item, {
|
|
5365
|
+
key: index,
|
|
5366
|
+
onSelect: () => onSelect(context)
|
|
5367
|
+
}, label))), /* @__PURE__ */ React51.createElement(DropdownMenu.Arrow, null))));
|
|
5368
|
+
}
|
|
5369
|
+
ToolbarMenu.displayName = "Toolbar.Menu";
|
|
5370
|
+
var Toolbar = {
|
|
5371
|
+
Root: ToolbarRoot,
|
|
5372
|
+
Text: ToolbarText,
|
|
5373
|
+
Button: ToolbarButton,
|
|
5374
|
+
IconButton: ToolbarIconButton,
|
|
5375
|
+
Link: ToolbarLink,
|
|
5376
|
+
Toggle: ToolbarToggle,
|
|
5377
|
+
ToggleGroup: ToolbarToggleGroup2,
|
|
5378
|
+
ToggleGroupItem: ToolbarToggleGroupItem,
|
|
5379
|
+
ToggleGroupIconItem: ToolbarToggleGroupIconItem,
|
|
5380
|
+
Separator: ToolbarSeparator,
|
|
5381
|
+
DragHandle: ToolbarDragHandle,
|
|
5382
|
+
ActionIconButton: ToolbarActionIconButton,
|
|
5383
|
+
Menu: ToolbarMenu
|
|
5384
|
+
};
|
|
5202
5385
|
export {
|
|
5203
5386
|
AlertDialog,
|
|
5204
5387
|
Avatar,
|
|
@@ -5248,13 +5431,15 @@ export {
|
|
|
5248
5431
|
SegmentedDateTime,
|
|
5249
5432
|
SegmentedTime,
|
|
5250
5433
|
Select,
|
|
5251
|
-
|
|
5434
|
+
Separator4 as Separator,
|
|
5252
5435
|
Skeleton,
|
|
5253
5436
|
Splitter,
|
|
5254
5437
|
Status,
|
|
5438
|
+
SystemIconButton,
|
|
5255
5439
|
TREEGRID_PARENT_OF_SEPARATOR,
|
|
5256
5440
|
TREEGRID_PATH_SEPARATOR,
|
|
5257
5441
|
Tag,
|
|
5442
|
+
TextTooltip,
|
|
5258
5443
|
ThemeContext,
|
|
5259
5444
|
ThemeProvider,
|
|
5260
5445
|
ThrowError,
|
|
@@ -5263,6 +5448,7 @@ export {
|
|
|
5263
5448
|
ToggleGroup,
|
|
5264
5449
|
ToggleGroupIconItem,
|
|
5265
5450
|
ToggleGroupItem,
|
|
5451
|
+
ToggleIconButton,
|
|
5266
5452
|
Toolbar,
|
|
5267
5453
|
Tooltip,
|
|
5268
5454
|
Trans,
|