aeon-ui-engine 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/CONSUMER.md +45 -0
- package/package.json +1 -1
- package/packages/core/dist/index.d.ts +88 -8
- package/packages/core/dist/index.js +123 -0
- package/packages/core/src/anatomy.ts +38 -0
- package/packages/core/src/brand-theme.ts +183 -0
- package/packages/core/src/index.ts +1 -0
- package/packages/panda/aeon.css +1 -0
- package/packages/panda/src/theme/consumer-shell.css +250 -0
- package/packages/panda/src/theme/electron.css +114 -0
- package/packages/primitives/dist/chunk-4NOKRUSG.js +81 -0
- package/packages/primitives/dist/index.d.ts +1 -0
- package/packages/primitives/dist/index.js +16 -6
- package/packages/primitives/dist/machines/app-nav.d.ts +96 -0
- package/packages/primitives/dist/machines/app-nav.js +12 -0
- package/packages/primitives/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/packages/primitives/src/__tests__/app-nav.test.ts +30 -0
- package/packages/primitives/src/index.ts +1 -0
- package/packages/primitives/src/machines/app-nav.ts +107 -0
- package/packages/react/dist/index.d.ts +135 -3
- package/packages/react/dist/index.js +1126 -720
- package/packages/react/src/app-nav/index.tsx +249 -0
- package/packages/react/src/avatar/index.tsx +4 -1
- package/packages/react/src/hooks/use-fit-text.ts +59 -0
- package/packages/react/src/index.ts +4 -0
- package/packages/react/src/prompt/index.tsx +161 -0
- package/packages/react/src/status-banner/index.tsx +84 -0
- package/packages/ui/src/app-nav.tsx +2 -0
- package/packages/ui/src/index.ts +4 -0
- package/packages/ui/src/prompt.tsx +29 -0
- package/packages/ui/src/status-banner.tsx +1 -0
- package/scripts/vite-aliases.mjs +8 -0
|
@@ -650,24 +650,197 @@ var Dialog = {
|
|
|
650
650
|
CloseTrigger
|
|
651
651
|
};
|
|
652
652
|
|
|
653
|
-
// src/
|
|
654
|
-
import { partAttrs as partAttrs5,
|
|
655
|
-
import { tabsMachine } from "@aeon-ui/primitives";
|
|
653
|
+
// src/prompt/index.tsx
|
|
654
|
+
import { partAttrs as partAttrs5, promptAnatomy, scopeAttrs } from "@aeon-ui/core";
|
|
656
655
|
import {
|
|
657
656
|
createContext as createContext4,
|
|
658
657
|
forwardRef as forwardRef5,
|
|
659
658
|
useContext as useContext4,
|
|
660
|
-
useEffect as useEffect7,
|
|
661
659
|
useMemo as useMemo4
|
|
662
660
|
} from "react";
|
|
663
661
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
664
|
-
var
|
|
662
|
+
var PromptCtx = createContext4(null);
|
|
663
|
+
function usePromptCtx() {
|
|
664
|
+
const ctx = useContext4(PromptCtx);
|
|
665
|
+
if (!ctx) throw new Error("Prompt parts must be used within Prompt.Root");
|
|
666
|
+
return ctx;
|
|
667
|
+
}
|
|
668
|
+
var Root5 = forwardRef5(function PromptRoot({ status = "pending", children, className, ...dialogProps }, ref) {
|
|
669
|
+
const value = useMemo4(() => ({ status }), [status]);
|
|
670
|
+
return /* @__PURE__ */ jsx5(PromptCtx.Provider, { value, children: /* @__PURE__ */ jsx5(Dialog.Root, { ...dialogProps, children: /* @__PURE__ */ jsx5(
|
|
671
|
+
"div",
|
|
672
|
+
{
|
|
673
|
+
ref,
|
|
674
|
+
className,
|
|
675
|
+
...scopeAttrs(promptAnatomy.scope, promptAnatomy.root, { state: status }),
|
|
676
|
+
children
|
|
677
|
+
}
|
|
678
|
+
) }) });
|
|
679
|
+
});
|
|
680
|
+
var Eyebrow = forwardRef5(
|
|
681
|
+
function PromptEyebrow(props, ref) {
|
|
682
|
+
const { status } = usePromptCtx();
|
|
683
|
+
return /* @__PURE__ */ jsx5(
|
|
684
|
+
"p",
|
|
685
|
+
{
|
|
686
|
+
ref,
|
|
687
|
+
...mergeProps(partAttrs5(promptAnatomy.scope, promptAnatomy.eyebrow, { state: status }), props)
|
|
688
|
+
}
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
);
|
|
692
|
+
var Meta = forwardRef5(function PromptMeta(props, ref) {
|
|
693
|
+
const { status } = usePromptCtx();
|
|
694
|
+
return /* @__PURE__ */ jsx5(
|
|
695
|
+
"dl",
|
|
696
|
+
{
|
|
697
|
+
ref,
|
|
698
|
+
...mergeProps(partAttrs5(promptAnatomy.scope, promptAnatomy.meta, { state: status }), props)
|
|
699
|
+
}
|
|
700
|
+
);
|
|
701
|
+
});
|
|
702
|
+
var Amount = forwardRef5(function PromptAmount(props, ref) {
|
|
703
|
+
const { status } = usePromptCtx();
|
|
704
|
+
return /* @__PURE__ */ jsx5(
|
|
705
|
+
"div",
|
|
706
|
+
{
|
|
707
|
+
ref,
|
|
708
|
+
...mergeProps(partAttrs5(promptAnatomy.scope, promptAnatomy.amount, { state: status }), props)
|
|
709
|
+
}
|
|
710
|
+
);
|
|
711
|
+
});
|
|
712
|
+
var Actions = forwardRef5(function PromptActions(props, ref) {
|
|
713
|
+
const { status } = usePromptCtx();
|
|
714
|
+
return /* @__PURE__ */ jsx5(
|
|
715
|
+
"div",
|
|
716
|
+
{
|
|
717
|
+
ref,
|
|
718
|
+
...mergeProps(partAttrs5(promptAnatomy.scope, promptAnatomy.actions, { state: status }), props)
|
|
719
|
+
}
|
|
720
|
+
);
|
|
721
|
+
});
|
|
722
|
+
var Primary = forwardRef5(
|
|
723
|
+
function PromptPrimary(props, ref) {
|
|
724
|
+
const { status } = usePromptCtx();
|
|
725
|
+
return /* @__PURE__ */ jsx5(
|
|
726
|
+
"button",
|
|
727
|
+
{
|
|
728
|
+
ref,
|
|
729
|
+
type: "button",
|
|
730
|
+
...mergeProps(
|
|
731
|
+
partAttrs5(promptAnatomy.scope, promptAnatomy.primary, { state: status }),
|
|
732
|
+
props
|
|
733
|
+
)
|
|
734
|
+
}
|
|
735
|
+
);
|
|
736
|
+
}
|
|
737
|
+
);
|
|
738
|
+
var Secondary = forwardRef5(
|
|
739
|
+
function PromptSecondary(props, ref) {
|
|
740
|
+
const { status } = usePromptCtx();
|
|
741
|
+
return /* @__PURE__ */ jsx5(
|
|
742
|
+
"button",
|
|
743
|
+
{
|
|
744
|
+
ref,
|
|
745
|
+
type: "button",
|
|
746
|
+
...mergeProps(
|
|
747
|
+
partAttrs5(promptAnatomy.scope, promptAnatomy.secondary, { state: status }),
|
|
748
|
+
props
|
|
749
|
+
)
|
|
750
|
+
}
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
);
|
|
754
|
+
var Prompt = {
|
|
755
|
+
Root: Root5,
|
|
756
|
+
Trigger: Dialog.Trigger,
|
|
757
|
+
Portal: Dialog.Portal,
|
|
758
|
+
Backdrop: Dialog.Backdrop,
|
|
759
|
+
Positioner: Dialog.Positioner,
|
|
760
|
+
Content: Dialog.Content,
|
|
761
|
+
Title: Dialog.Title,
|
|
762
|
+
Description: Dialog.Description,
|
|
763
|
+
CloseTrigger: Dialog.CloseTrigger,
|
|
764
|
+
Eyebrow,
|
|
765
|
+
Meta,
|
|
766
|
+
Amount,
|
|
767
|
+
Actions,
|
|
768
|
+
Primary,
|
|
769
|
+
Secondary
|
|
770
|
+
};
|
|
771
|
+
|
|
772
|
+
// src/status-banner/index.tsx
|
|
773
|
+
import { partAttrs as partAttrs6, scopeAttrs as scopeAttrs2, statusBannerAnatomy } from "@aeon-ui/core";
|
|
774
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
775
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
776
|
+
var Root6 = forwardRef6(function StatusBannerRoot({ tone = "info", status, children, ...rest }, ref) {
|
|
777
|
+
const state = [tone, status].filter(Boolean).join(" ");
|
|
778
|
+
return /* @__PURE__ */ jsx6(
|
|
779
|
+
"div",
|
|
780
|
+
{
|
|
781
|
+
ref,
|
|
782
|
+
role: "status",
|
|
783
|
+
...mergeProps(scopeAttrs2(statusBannerAnatomy.scope, statusBannerAnatomy.root, { state }), rest),
|
|
784
|
+
children
|
|
785
|
+
}
|
|
786
|
+
);
|
|
787
|
+
});
|
|
788
|
+
var Copy = forwardRef6(function StatusBannerCopy(props, ref) {
|
|
789
|
+
return /* @__PURE__ */ jsx6("div", { ref, ...mergeProps(partAttrs6(statusBannerAnatomy.scope, statusBannerAnatomy.copy), props) });
|
|
790
|
+
});
|
|
791
|
+
var Title2 = forwardRef6(function StatusBannerTitle(props, ref) {
|
|
792
|
+
return /* @__PURE__ */ jsx6(
|
|
793
|
+
"strong",
|
|
794
|
+
{
|
|
795
|
+
ref,
|
|
796
|
+
...mergeProps(partAttrs6(statusBannerAnatomy.scope, statusBannerAnatomy.title), props)
|
|
797
|
+
}
|
|
798
|
+
);
|
|
799
|
+
});
|
|
800
|
+
var Body = forwardRef6(function StatusBannerBody(props, ref) {
|
|
801
|
+
return /* @__PURE__ */ jsx6("span", { ref, ...mergeProps(partAttrs6(statusBannerAnatomy.scope, statusBannerAnatomy.body), props) });
|
|
802
|
+
});
|
|
803
|
+
var Actions2 = forwardRef6(function StatusBannerActions(props, ref) {
|
|
804
|
+
return /* @__PURE__ */ jsx6(
|
|
805
|
+
"div",
|
|
806
|
+
{
|
|
807
|
+
ref,
|
|
808
|
+
...mergeProps(partAttrs6(statusBannerAnatomy.scope, statusBannerAnatomy.actions), props)
|
|
809
|
+
}
|
|
810
|
+
);
|
|
811
|
+
});
|
|
812
|
+
var Action = forwardRef6(
|
|
813
|
+
function StatusBannerAction(props, ref) {
|
|
814
|
+
return /* @__PURE__ */ jsx6("button", { ref, type: "button", ...props });
|
|
815
|
+
}
|
|
816
|
+
);
|
|
817
|
+
var StatusBanner = {
|
|
818
|
+
Root: Root6,
|
|
819
|
+
Copy,
|
|
820
|
+
Title: Title2,
|
|
821
|
+
Body,
|
|
822
|
+
Actions: Actions2,
|
|
823
|
+
Action
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
// src/tabs/index.tsx
|
|
827
|
+
import { partAttrs as partAttrs7, tabsAnatomy } from "@aeon-ui/core";
|
|
828
|
+
import { tabsMachine } from "@aeon-ui/primitives";
|
|
829
|
+
import {
|
|
830
|
+
createContext as createContext5,
|
|
831
|
+
forwardRef as forwardRef7,
|
|
832
|
+
useContext as useContext5,
|
|
833
|
+
useEffect as useEffect7,
|
|
834
|
+
useMemo as useMemo5
|
|
835
|
+
} from "react";
|
|
836
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
837
|
+
var TabsCtx = createContext5(null);
|
|
665
838
|
function useTabsCtx() {
|
|
666
|
-
const ctx =
|
|
839
|
+
const ctx = useContext5(TabsCtx);
|
|
667
840
|
if (!ctx) throw new Error("Tabs parts must be used within Tabs.Root");
|
|
668
841
|
return ctx;
|
|
669
842
|
}
|
|
670
|
-
var
|
|
843
|
+
var Root7 = forwardRef7(function TabsRoot({ value, defaultValue = "", onValueChange, children, className, ...rest }, ref) {
|
|
671
844
|
const [snapshot, send] = useAeonMachine(tabsMachine, {
|
|
672
845
|
input: { value: defaultValue, disabled: false }
|
|
673
846
|
});
|
|
@@ -678,24 +851,24 @@ var Root5 = forwardRef5(function TabsRoot({ value, defaultValue = "", onValueCha
|
|
|
678
851
|
useEffect7(() => {
|
|
679
852
|
if (value !== void 0) send({ type: "SET_VALUE", value });
|
|
680
853
|
}, [value, send]);
|
|
681
|
-
const ctx =
|
|
682
|
-
return /* @__PURE__ */
|
|
854
|
+
const ctx = useMemo5(() => ({ value: resolvedValue, send }), [resolvedValue, send]);
|
|
855
|
+
return /* @__PURE__ */ jsx7(TabsCtx.Provider, { value: ctx, children: /* @__PURE__ */ jsx7(
|
|
683
856
|
"div",
|
|
684
857
|
{
|
|
685
858
|
ref,
|
|
686
859
|
className,
|
|
687
|
-
...mergeProps(
|
|
860
|
+
...mergeProps(partAttrs7(tabsAnatomy.scope, tabsAnatomy.root), rest),
|
|
688
861
|
children
|
|
689
862
|
}
|
|
690
863
|
) });
|
|
691
864
|
});
|
|
692
|
-
var List =
|
|
693
|
-
return /* @__PURE__ */
|
|
865
|
+
var List = forwardRef7(function TabsList(props, ref) {
|
|
866
|
+
return /* @__PURE__ */ jsx7("div", { ref, role: "tablist", ...mergeProps(partAttrs7(tabsAnatomy.scope, tabsAnatomy.list), props) });
|
|
694
867
|
});
|
|
695
|
-
var Trigger2 =
|
|
868
|
+
var Trigger2 = forwardRef7(function TabsTrigger({ value: triggerValue, onClick, ...rest }, ref) {
|
|
696
869
|
const { value, send } = useTabsCtx();
|
|
697
870
|
const selected = value === triggerValue;
|
|
698
|
-
return /* @__PURE__ */
|
|
871
|
+
return /* @__PURE__ */ jsx7(
|
|
699
872
|
"button",
|
|
700
873
|
{
|
|
701
874
|
ref,
|
|
@@ -704,7 +877,7 @@ var Trigger2 = forwardRef5(function TabsTrigger({ value: triggerValue, onClick,
|
|
|
704
877
|
"aria-selected": selected,
|
|
705
878
|
"data-selected": selected ? "" : void 0,
|
|
706
879
|
...mergeProps(
|
|
707
|
-
|
|
880
|
+
partAttrs7(tabsAnatomy.scope, tabsAnatomy.trigger, {
|
|
708
881
|
state: selected ? "selected" : "unselected",
|
|
709
882
|
highlighted: selected
|
|
710
883
|
}),
|
|
@@ -719,55 +892,55 @@ var Trigger2 = forwardRef5(function TabsTrigger({ value: triggerValue, onClick,
|
|
|
719
892
|
}
|
|
720
893
|
);
|
|
721
894
|
});
|
|
722
|
-
var Content2 =
|
|
895
|
+
var Content2 = forwardRef7(function TabsContent({ value: contentValue, ...rest }, ref) {
|
|
723
896
|
const { value } = useTabsCtx();
|
|
724
897
|
if (value !== contentValue) return null;
|
|
725
|
-
return /* @__PURE__ */
|
|
898
|
+
return /* @__PURE__ */ jsx7(
|
|
726
899
|
"div",
|
|
727
900
|
{
|
|
728
901
|
ref,
|
|
729
902
|
role: "tabpanel",
|
|
730
903
|
...mergeProps(
|
|
731
|
-
|
|
904
|
+
partAttrs7(tabsAnatomy.scope, tabsAnatomy.content, { state: "active" }),
|
|
732
905
|
rest
|
|
733
906
|
)
|
|
734
907
|
}
|
|
735
908
|
);
|
|
736
909
|
});
|
|
737
|
-
var Indicator2 =
|
|
738
|
-
return /* @__PURE__ */
|
|
910
|
+
var Indicator2 = forwardRef7(function TabsIndicator(props, ref) {
|
|
911
|
+
return /* @__PURE__ */ jsx7("div", { ref, ...mergeProps(partAttrs7(tabsAnatomy.scope, tabsAnatomy.indicator), props) });
|
|
739
912
|
});
|
|
740
|
-
var Tabs = { Root:
|
|
913
|
+
var Tabs = { Root: Root7, List, Trigger: Trigger2, Content: Content2, Indicator: Indicator2 };
|
|
741
914
|
|
|
742
915
|
// src/separator/index.tsx
|
|
743
|
-
import { partAttrs as
|
|
744
|
-
import { forwardRef as
|
|
745
|
-
import { jsx as
|
|
746
|
-
var
|
|
747
|
-
return /* @__PURE__ */
|
|
916
|
+
import { partAttrs as partAttrs8, separatorAnatomy } from "@aeon-ui/core";
|
|
917
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
918
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
919
|
+
var Root8 = forwardRef8(function SeparatorRoot({ orientation = "horizontal", ...rest }, ref) {
|
|
920
|
+
return /* @__PURE__ */ jsx8(
|
|
748
921
|
"div",
|
|
749
922
|
{
|
|
750
923
|
ref,
|
|
751
924
|
role: "separator",
|
|
752
925
|
"aria-orientation": orientation,
|
|
753
|
-
...mergeProps(
|
|
926
|
+
...mergeProps(partAttrs8(separatorAnatomy.scope, separatorAnatomy.root), rest)
|
|
754
927
|
}
|
|
755
928
|
);
|
|
756
929
|
});
|
|
757
|
-
var Separator = { Root:
|
|
930
|
+
var Separator = { Root: Root8 };
|
|
758
931
|
|
|
759
932
|
// src/progress/index.tsx
|
|
760
|
-
import { partAttrs as
|
|
933
|
+
import { partAttrs as partAttrs9, partOnlyAttrs, progressAnatomy } from "@aeon-ui/core";
|
|
761
934
|
import {
|
|
762
|
-
createContext as
|
|
763
|
-
forwardRef as
|
|
764
|
-
useContext as
|
|
765
|
-
useMemo as
|
|
935
|
+
createContext as createContext6,
|
|
936
|
+
forwardRef as forwardRef9,
|
|
937
|
+
useContext as useContext6,
|
|
938
|
+
useMemo as useMemo6
|
|
766
939
|
} from "react";
|
|
767
|
-
import { jsx as
|
|
768
|
-
var ProgressCtx =
|
|
940
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
941
|
+
var ProgressCtx = createContext6(null);
|
|
769
942
|
function useProgressCtx() {
|
|
770
|
-
const ctx =
|
|
943
|
+
const ctx = useContext6(ProgressCtx);
|
|
771
944
|
if (!ctx) throw new Error("Progress parts must be used within Progress.Root");
|
|
772
945
|
return ctx;
|
|
773
946
|
}
|
|
@@ -776,14 +949,14 @@ function resolveProgressState(value, max, indeterminate) {
|
|
|
776
949
|
if (value >= max) return "complete";
|
|
777
950
|
return "idle";
|
|
778
951
|
}
|
|
779
|
-
var
|
|
952
|
+
var Root9 = forwardRef9(function ProgressRoot({ value = 0, max = 100, indeterminate = false, children, className, ...rest }, ref) {
|
|
780
953
|
const clampedValue = Math.min(Math.max(value, 0), max);
|
|
781
954
|
const state = resolveProgressState(clampedValue, max, indeterminate);
|
|
782
|
-
const ctx =
|
|
955
|
+
const ctx = useMemo6(
|
|
783
956
|
() => ({ value: clampedValue, max, indeterminate, state }),
|
|
784
957
|
[clampedValue, max, indeterminate, state]
|
|
785
958
|
);
|
|
786
|
-
return /* @__PURE__ */
|
|
959
|
+
return /* @__PURE__ */ jsx9(ProgressCtx.Provider, { value: ctx, children: /* @__PURE__ */ jsx9(
|
|
787
960
|
"div",
|
|
788
961
|
{
|
|
789
962
|
ref,
|
|
@@ -794,20 +967,20 @@ var Root7 = forwardRef7(function ProgressRoot({ value = 0, max = 100, indetermin
|
|
|
794
967
|
"aria-valuenow": indeterminate ? void 0 : clampedValue,
|
|
795
968
|
"aria-busy": indeterminate || void 0,
|
|
796
969
|
...mergeProps(
|
|
797
|
-
|
|
970
|
+
partAttrs9(progressAnatomy.scope, progressAnatomy.root, { state }),
|
|
798
971
|
rest
|
|
799
972
|
),
|
|
800
973
|
children
|
|
801
974
|
}
|
|
802
975
|
) });
|
|
803
976
|
});
|
|
804
|
-
var Track =
|
|
805
|
-
return /* @__PURE__ */
|
|
977
|
+
var Track = forwardRef9(function ProgressTrack(props, ref) {
|
|
978
|
+
return /* @__PURE__ */ jsx9("div", { ref, ...mergeProps(partOnlyAttrs(progressAnatomy.track), props) });
|
|
806
979
|
});
|
|
807
|
-
var Range =
|
|
980
|
+
var Range = forwardRef9(function ProgressRange({ style, ...rest }, ref) {
|
|
808
981
|
const { value, max, indeterminate } = useProgressCtx();
|
|
809
982
|
const width = indeterminate ? void 0 : `${value / max * 100}%`;
|
|
810
|
-
return /* @__PURE__ */
|
|
983
|
+
return /* @__PURE__ */ jsx9(
|
|
811
984
|
"div",
|
|
812
985
|
{
|
|
813
986
|
ref,
|
|
@@ -817,36 +990,36 @@ var Range = forwardRef7(function ProgressRange({ style, ...rest }, ref) {
|
|
|
817
990
|
}
|
|
818
991
|
);
|
|
819
992
|
});
|
|
820
|
-
var Label4 =
|
|
821
|
-
return /* @__PURE__ */
|
|
993
|
+
var Label4 = forwardRef9(function ProgressLabel(props, ref) {
|
|
994
|
+
return /* @__PURE__ */ jsx9("span", { ref, ...mergeProps(partOnlyAttrs(progressAnatomy.label), props) });
|
|
822
995
|
});
|
|
823
|
-
var Progress = { Root:
|
|
996
|
+
var Progress = { Root: Root9, Track, Range, Label: Label4 };
|
|
824
997
|
|
|
825
998
|
// src/radio-group/index.tsx
|
|
826
|
-
import { partAttrs as
|
|
999
|
+
import { partAttrs as partAttrs10, partOnlyAttrs as partOnlyAttrs2, radioGroupAnatomy } from "@aeon-ui/core";
|
|
827
1000
|
import { tabsMachine as tabsMachine2 } from "@aeon-ui/primitives";
|
|
828
1001
|
import {
|
|
829
|
-
createContext as
|
|
830
|
-
forwardRef as
|
|
1002
|
+
createContext as createContext7,
|
|
1003
|
+
forwardRef as forwardRef10,
|
|
831
1004
|
useCallback,
|
|
832
|
-
useContext as
|
|
1005
|
+
useContext as useContext7,
|
|
833
1006
|
useEffect as useEffect8,
|
|
834
|
-
useMemo as
|
|
1007
|
+
useMemo as useMemo7
|
|
835
1008
|
} from "react";
|
|
836
|
-
import { jsx as
|
|
837
|
-
var RadioGroupCtx =
|
|
1009
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1010
|
+
var RadioGroupCtx = createContext7(null);
|
|
838
1011
|
function useRadioGroupCtx() {
|
|
839
|
-
const ctx =
|
|
1012
|
+
const ctx = useContext7(RadioGroupCtx);
|
|
840
1013
|
if (!ctx) throw new Error("RadioGroup parts must be used within RadioGroup.Root");
|
|
841
1014
|
return ctx;
|
|
842
1015
|
}
|
|
843
|
-
var RadioGroupItemCtx =
|
|
1016
|
+
var RadioGroupItemCtx = createContext7(null);
|
|
844
1017
|
function useRadioGroupItemCtx() {
|
|
845
|
-
const ctx =
|
|
1018
|
+
const ctx = useContext7(RadioGroupItemCtx);
|
|
846
1019
|
if (!ctx) throw new Error("RadioGroup item parts must be used within RadioGroup.Item");
|
|
847
1020
|
return ctx;
|
|
848
1021
|
}
|
|
849
|
-
var
|
|
1022
|
+
var Root10 = forwardRef10(function RadioGroupRoot({ value, defaultValue = "", onValueChange, children, className, ...rest }, ref) {
|
|
850
1023
|
const [snapshot, send] = useAeonMachine(tabsMachine2, {
|
|
851
1024
|
input: { value: defaultValue, disabled: false }
|
|
852
1025
|
});
|
|
@@ -866,26 +1039,26 @@ var Root8 = forwardRef8(function RadioGroupRoot({ value, defaultValue = "", onVa
|
|
|
866
1039
|
useEffect8(() => {
|
|
867
1040
|
if (value !== void 0) send({ type: "SET_VALUE", value });
|
|
868
1041
|
}, [value, send]);
|
|
869
|
-
const ctx =
|
|
870
|
-
return /* @__PURE__ */
|
|
1042
|
+
const ctx = useMemo7(() => ({ value: resolvedValue, send, selectValue }), [resolvedValue, send, selectValue]);
|
|
1043
|
+
return /* @__PURE__ */ jsx10(RadioGroupCtx.Provider, { value: ctx, children: /* @__PURE__ */ jsx10(
|
|
871
1044
|
"div",
|
|
872
1045
|
{
|
|
873
1046
|
ref,
|
|
874
1047
|
role: "radiogroup",
|
|
875
1048
|
className,
|
|
876
1049
|
...mergeProps(
|
|
877
|
-
|
|
1050
|
+
partAttrs10(radioGroupAnatomy.scope, radioGroupAnatomy.root),
|
|
878
1051
|
rest
|
|
879
1052
|
),
|
|
880
1053
|
children
|
|
881
1054
|
}
|
|
882
1055
|
) });
|
|
883
1056
|
});
|
|
884
|
-
var Item =
|
|
1057
|
+
var Item = forwardRef10(function RadioGroupItem({ value: itemValue, children, ...rest }, ref) {
|
|
885
1058
|
const { value } = useRadioGroupCtx();
|
|
886
1059
|
const selected = value === itemValue;
|
|
887
|
-
const itemCtx =
|
|
888
|
-
return /* @__PURE__ */
|
|
1060
|
+
const itemCtx = useMemo7(() => ({ value: itemValue, selected }), [itemValue, selected]);
|
|
1061
|
+
return /* @__PURE__ */ jsx10(RadioGroupItemCtx.Provider, { value: itemCtx, children: /* @__PURE__ */ jsx10(
|
|
889
1062
|
"div",
|
|
890
1063
|
{
|
|
891
1064
|
ref,
|
|
@@ -899,11 +1072,11 @@ var Item = forwardRef8(function RadioGroupItem({ value: itemValue, children, ...
|
|
|
899
1072
|
}
|
|
900
1073
|
) });
|
|
901
1074
|
});
|
|
902
|
-
var ItemControl =
|
|
1075
|
+
var ItemControl = forwardRef10(function RadioGroupItemControl({ onClick, onKeyDown, ...rest }, ref) {
|
|
903
1076
|
const { selectValue } = useRadioGroupCtx();
|
|
904
1077
|
const { value: itemValue, selected } = useRadioGroupItemCtx();
|
|
905
1078
|
const select = () => selectValue(itemValue);
|
|
906
|
-
return /* @__PURE__ */
|
|
1079
|
+
return /* @__PURE__ */ jsx10(
|
|
907
1080
|
"span",
|
|
908
1081
|
{
|
|
909
1082
|
ref,
|
|
@@ -933,10 +1106,10 @@ var ItemControl = forwardRef8(function RadioGroupItemControl({ onClick, onKeyDow
|
|
|
933
1106
|
}
|
|
934
1107
|
);
|
|
935
1108
|
});
|
|
936
|
-
var ItemIndicator =
|
|
1109
|
+
var ItemIndicator = forwardRef10(function RadioGroupItemIndicator(props, ref) {
|
|
937
1110
|
const { selected } = useRadioGroupItemCtx();
|
|
938
1111
|
if (!selected) return null;
|
|
939
|
-
return /* @__PURE__ */
|
|
1112
|
+
return /* @__PURE__ */ jsx10(
|
|
940
1113
|
"span",
|
|
941
1114
|
{
|
|
942
1115
|
ref,
|
|
@@ -947,10 +1120,10 @@ var ItemIndicator = forwardRef8(function RadioGroupItemIndicator(props, ref) {
|
|
|
947
1120
|
}
|
|
948
1121
|
);
|
|
949
1122
|
});
|
|
950
|
-
var ItemLabel =
|
|
1123
|
+
var ItemLabel = forwardRef10(function RadioGroupItemLabel({ onClick, ...rest }, ref) {
|
|
951
1124
|
const { selectValue } = useRadioGroupCtx();
|
|
952
1125
|
const { value: itemValue } = useRadioGroupItemCtx();
|
|
953
|
-
return /* @__PURE__ */
|
|
1126
|
+
return /* @__PURE__ */ jsx10(
|
|
954
1127
|
"span",
|
|
955
1128
|
{
|
|
956
1129
|
ref,
|
|
@@ -967,24 +1140,24 @@ var ItemLabel = forwardRef8(function RadioGroupItemLabel({ onClick, ...rest }, r
|
|
|
967
1140
|
}
|
|
968
1141
|
);
|
|
969
1142
|
});
|
|
970
|
-
var RadioGroup = { Root:
|
|
1143
|
+
var RadioGroup = { Root: Root10, Item, ItemControl, ItemIndicator, ItemLabel };
|
|
971
1144
|
|
|
972
1145
|
// src/slider/index.tsx
|
|
973
|
-
import { partAttrs as
|
|
1146
|
+
import { partAttrs as partAttrs11, partOnlyAttrs as partOnlyAttrs3, sliderAnatomy } from "@aeon-ui/core";
|
|
974
1147
|
import { sliderMachine, snapSliderValue } from "@aeon-ui/primitives";
|
|
975
1148
|
import {
|
|
976
|
-
createContext as
|
|
977
|
-
forwardRef as
|
|
1149
|
+
createContext as createContext8,
|
|
1150
|
+
forwardRef as forwardRef11,
|
|
978
1151
|
useCallback as useCallback2,
|
|
979
|
-
useContext as
|
|
1152
|
+
useContext as useContext8,
|
|
980
1153
|
useEffect as useEffect9,
|
|
981
|
-
useMemo as
|
|
1154
|
+
useMemo as useMemo8,
|
|
982
1155
|
useRef as useRef2
|
|
983
1156
|
} from "react";
|
|
984
|
-
import { jsx as
|
|
985
|
-
var SliderCtx =
|
|
1157
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1158
|
+
var SliderCtx = createContext8(null);
|
|
986
1159
|
function useSliderCtx() {
|
|
987
|
-
const ctx =
|
|
1160
|
+
const ctx = useContext8(SliderCtx);
|
|
988
1161
|
if (!ctx) throw new Error("Slider parts must be used within Slider.Root");
|
|
989
1162
|
return ctx;
|
|
990
1163
|
}
|
|
@@ -992,7 +1165,7 @@ function percent(value, min, max) {
|
|
|
992
1165
|
if (max <= min) return 0;
|
|
993
1166
|
return (value - min) / (max - min) * 100;
|
|
994
1167
|
}
|
|
995
|
-
var
|
|
1168
|
+
var Root11 = forwardRef11(function SliderRoot({
|
|
996
1169
|
value,
|
|
997
1170
|
defaultValue,
|
|
998
1171
|
min = 0,
|
|
@@ -1046,7 +1219,7 @@ var Root9 = forwardRef9(function SliderRoot({
|
|
|
1046
1219
|
window.removeEventListener("pointerup", onUp);
|
|
1047
1220
|
};
|
|
1048
1221
|
}, [dragging, setValueFromClientX, send]);
|
|
1049
|
-
const ctx =
|
|
1222
|
+
const ctx = useMemo8(
|
|
1050
1223
|
() => ({
|
|
1051
1224
|
value: resolvedValue,
|
|
1052
1225
|
min,
|
|
@@ -1061,13 +1234,13 @@ var Root9 = forwardRef9(function SliderRoot({
|
|
|
1061
1234
|
}),
|
|
1062
1235
|
[resolvedValue, min, max, step, disabled, dragging, send, onValueChange, setValueFromClientX]
|
|
1063
1236
|
);
|
|
1064
|
-
return /* @__PURE__ */
|
|
1237
|
+
return /* @__PURE__ */ jsx11(SliderCtx.Provider, { value: ctx, children: /* @__PURE__ */ jsx11(
|
|
1065
1238
|
"div",
|
|
1066
1239
|
{
|
|
1067
1240
|
ref,
|
|
1068
1241
|
className,
|
|
1069
1242
|
...mergeProps(
|
|
1070
|
-
|
|
1243
|
+
partAttrs11(sliderAnatomy.scope, sliderAnatomy.root, {
|
|
1071
1244
|
state: dragging ? "dragging" : "idle",
|
|
1072
1245
|
disabled
|
|
1073
1246
|
}),
|
|
@@ -1077,9 +1250,9 @@ var Root9 = forwardRef9(function SliderRoot({
|
|
|
1077
1250
|
}
|
|
1078
1251
|
) });
|
|
1079
1252
|
});
|
|
1080
|
-
var Track2 =
|
|
1253
|
+
var Track2 = forwardRef11(function SliderTrack({ onPointerDown, ...rest }, ref) {
|
|
1081
1254
|
const { disabled, send, setValueFromClientX, trackRef } = useSliderCtx();
|
|
1082
|
-
return /* @__PURE__ */
|
|
1255
|
+
return /* @__PURE__ */ jsx11(
|
|
1083
1256
|
"div",
|
|
1084
1257
|
{
|
|
1085
1258
|
ref: (node) => {
|
|
@@ -1103,9 +1276,9 @@ var Track2 = forwardRef9(function SliderTrack({ onPointerDown, ...rest }, ref) {
|
|
|
1103
1276
|
}
|
|
1104
1277
|
);
|
|
1105
1278
|
});
|
|
1106
|
-
var Range2 =
|
|
1279
|
+
var Range2 = forwardRef11(function SliderRange({ style, ...rest }, ref) {
|
|
1107
1280
|
const { value, min, max } = useSliderCtx();
|
|
1108
|
-
return /* @__PURE__ */
|
|
1281
|
+
return /* @__PURE__ */ jsx11(
|
|
1109
1282
|
"div",
|
|
1110
1283
|
{
|
|
1111
1284
|
ref,
|
|
@@ -1115,9 +1288,9 @@ var Range2 = forwardRef9(function SliderRange({ style, ...rest }, ref) {
|
|
|
1115
1288
|
}
|
|
1116
1289
|
);
|
|
1117
1290
|
});
|
|
1118
|
-
var Thumb2 =
|
|
1291
|
+
var Thumb2 = forwardRef11(function SliderThumb({ onKeyDown, onPointerDown, style, ...rest }, ref) {
|
|
1119
1292
|
const { value, min, max, step, disabled, dragging, send, setValueFromClientX } = useSliderCtx();
|
|
1120
|
-
return /* @__PURE__ */
|
|
1293
|
+
return /* @__PURE__ */ jsx11(
|
|
1121
1294
|
"span",
|
|
1122
1295
|
{
|
|
1123
1296
|
ref,
|
|
@@ -1165,35 +1338,35 @@ var Thumb2 = forwardRef9(function SliderThumb({ onKeyDown, onPointerDown, style,
|
|
|
1165
1338
|
}
|
|
1166
1339
|
);
|
|
1167
1340
|
});
|
|
1168
|
-
var ValueText =
|
|
1341
|
+
var ValueText = forwardRef11(function SliderValueText(props, ref) {
|
|
1169
1342
|
const { value } = useSliderCtx();
|
|
1170
|
-
return /* @__PURE__ */
|
|
1343
|
+
return /* @__PURE__ */ jsx11("span", { ref, ...mergeProps(partOnlyAttrs3(sliderAnatomy.valueText), props), children: props.children ?? value });
|
|
1171
1344
|
});
|
|
1172
|
-
var Slider = { Root:
|
|
1345
|
+
var Slider = { Root: Root11, Track: Track2, Range: Range2, Thumb: Thumb2, ValueText };
|
|
1173
1346
|
|
|
1174
1347
|
// src/pin-input/index.tsx
|
|
1175
|
-
import { partAttrs as
|
|
1348
|
+
import { partAttrs as partAttrs12, partOnlyAttrs as partOnlyAttrs4, pinInputAnatomy } from "@aeon-ui/core";
|
|
1176
1349
|
import {
|
|
1177
|
-
createContext as
|
|
1178
|
-
forwardRef as
|
|
1350
|
+
createContext as createContext9,
|
|
1351
|
+
forwardRef as forwardRef12,
|
|
1179
1352
|
useCallback as useCallback3,
|
|
1180
|
-
useContext as
|
|
1353
|
+
useContext as useContext9,
|
|
1181
1354
|
useEffect as useEffect10,
|
|
1182
|
-
useMemo as
|
|
1355
|
+
useMemo as useMemo9,
|
|
1183
1356
|
useRef as useRef3,
|
|
1184
1357
|
useState as useState2
|
|
1185
1358
|
} from "react";
|
|
1186
|
-
import { jsx as
|
|
1187
|
-
var PinInputCtx =
|
|
1359
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1360
|
+
var PinInputCtx = createContext9(null);
|
|
1188
1361
|
function usePinInputCtx() {
|
|
1189
|
-
const ctx =
|
|
1362
|
+
const ctx = useContext9(PinInputCtx);
|
|
1190
1363
|
if (!ctx) throw new Error("PinInput parts must be used within PinInput.Root");
|
|
1191
1364
|
return ctx;
|
|
1192
1365
|
}
|
|
1193
1366
|
function normalizePinValue(raw, length) {
|
|
1194
1367
|
return raw.replace(/\s/g, "").slice(0, length).split("");
|
|
1195
1368
|
}
|
|
1196
|
-
var
|
|
1369
|
+
var Root12 = forwardRef12(function PinInputRoot({
|
|
1197
1370
|
length = 4,
|
|
1198
1371
|
value,
|
|
1199
1372
|
defaultValue = "",
|
|
@@ -1241,17 +1414,17 @@ var Root10 = forwardRef10(function PinInputRoot({
|
|
|
1241
1414
|
const registerInput = useCallback3((index, el) => {
|
|
1242
1415
|
inputRefs.current[index] = el;
|
|
1243
1416
|
}, []);
|
|
1244
|
-
const ctx =
|
|
1417
|
+
const ctx = useMemo9(
|
|
1245
1418
|
() => ({ length, values: chars.slice(0, length), disabled, type, setChar, focusInput, registerInput }),
|
|
1246
1419
|
[length, chars, disabled, type, setChar, focusInput, registerInput]
|
|
1247
1420
|
);
|
|
1248
|
-
return /* @__PURE__ */
|
|
1421
|
+
return /* @__PURE__ */ jsx12(PinInputCtx.Provider, { value: ctx, children: /* @__PURE__ */ jsx12(
|
|
1249
1422
|
"div",
|
|
1250
1423
|
{
|
|
1251
1424
|
ref,
|
|
1252
1425
|
className,
|
|
1253
1426
|
...mergeProps(
|
|
1254
|
-
|
|
1427
|
+
partAttrs12(pinInputAnatomy.scope, pinInputAnatomy.root, {
|
|
1255
1428
|
state: resolved.length === length && !resolved.includes("") ? "complete" : "idle",
|
|
1256
1429
|
disabled
|
|
1257
1430
|
}),
|
|
@@ -1261,7 +1434,7 @@ var Root10 = forwardRef10(function PinInputRoot({
|
|
|
1261
1434
|
}
|
|
1262
1435
|
) });
|
|
1263
1436
|
});
|
|
1264
|
-
var Input =
|
|
1437
|
+
var Input = forwardRef12(function PinInputInput({ index, onKeyDown, onChange, onPaste, ...rest }, ref) {
|
|
1265
1438
|
const { length, values, disabled, type, setChar, focusInput, registerInput } = usePinInputCtx();
|
|
1266
1439
|
const value = values[index] ?? "";
|
|
1267
1440
|
const pattern = type === "numeric" ? /^[0-9]$/ : /^[0-9a-zA-Z]$/;
|
|
@@ -1270,7 +1443,7 @@ var Input = forwardRef10(function PinInputInput({ index, onKeyDown, onChange, on
|
|
|
1270
1443
|
const char = raw.slice(-1);
|
|
1271
1444
|
return pattern.test(char) ? char : "";
|
|
1272
1445
|
};
|
|
1273
|
-
return /* @__PURE__ */
|
|
1446
|
+
return /* @__PURE__ */ jsx12(
|
|
1274
1447
|
"input",
|
|
1275
1448
|
{
|
|
1276
1449
|
ref: (node) => {
|
|
@@ -1323,32 +1496,32 @@ var Input = forwardRef10(function PinInputInput({ index, onKeyDown, onChange, on
|
|
|
1323
1496
|
}
|
|
1324
1497
|
);
|
|
1325
1498
|
});
|
|
1326
|
-
var Group2 =
|
|
1499
|
+
var Group2 = forwardRef12(
|
|
1327
1500
|
function PinInputGroup({ inputClassName, className, ...rest }, ref) {
|
|
1328
1501
|
const { length } = usePinInputCtx();
|
|
1329
|
-
return /* @__PURE__ */
|
|
1502
|
+
return /* @__PURE__ */ jsx12("div", { ref, className, ...rest, children: Array.from({ length }, (_, index) => /* @__PURE__ */ jsx12(Input, { index, className: inputClassName }, index)) });
|
|
1330
1503
|
}
|
|
1331
1504
|
);
|
|
1332
|
-
var PinInput = { Root:
|
|
1505
|
+
var PinInput = { Root: Root12, Input, Group: Group2 };
|
|
1333
1506
|
|
|
1334
1507
|
// src/accordion/index.tsx
|
|
1335
|
-
import { accordionAnatomy, partOnlyAttrs as partOnlyAttrs5, scopeAttrs } from "@aeon-ui/core";
|
|
1508
|
+
import { accordionAnatomy, partOnlyAttrs as partOnlyAttrs5, scopeAttrs as scopeAttrs3 } from "@aeon-ui/core";
|
|
1336
1509
|
import { accordionMachine } from "@aeon-ui/primitives";
|
|
1337
1510
|
import {
|
|
1338
|
-
createContext as
|
|
1339
|
-
forwardRef as
|
|
1340
|
-
useContext as
|
|
1511
|
+
createContext as createContext10,
|
|
1512
|
+
forwardRef as forwardRef13,
|
|
1513
|
+
useContext as useContext10,
|
|
1341
1514
|
useEffect as useEffect11,
|
|
1342
|
-
useMemo as
|
|
1515
|
+
useMemo as useMemo10
|
|
1343
1516
|
} from "react";
|
|
1344
|
-
import { jsx as
|
|
1345
|
-
var AccordionCtx =
|
|
1517
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1518
|
+
var AccordionCtx = createContext10(null);
|
|
1346
1519
|
function useAccordionCtx() {
|
|
1347
|
-
const ctx =
|
|
1520
|
+
const ctx = useContext10(AccordionCtx);
|
|
1348
1521
|
if (!ctx) throw new Error("Accordion parts must be used within Accordion.Root");
|
|
1349
1522
|
return ctx;
|
|
1350
1523
|
}
|
|
1351
|
-
var
|
|
1524
|
+
var Root13 = forwardRef13(function AccordionRoot({
|
|
1352
1525
|
value,
|
|
1353
1526
|
defaultValue = [],
|
|
1354
1527
|
multiple = false,
|
|
@@ -1368,24 +1541,24 @@ var Root11 = forwardRef11(function AccordionRoot({
|
|
|
1368
1541
|
useEffect11(() => {
|
|
1369
1542
|
if (value !== void 0) send({ type: "SET_VALUE", value });
|
|
1370
1543
|
}, [value, send]);
|
|
1371
|
-
const ctx =
|
|
1372
|
-
return /* @__PURE__ */
|
|
1544
|
+
const ctx = useMemo10(() => ({ value: resolvedValue, send }), [resolvedValue, send]);
|
|
1545
|
+
return /* @__PURE__ */ jsx13(AccordionCtx.Provider, { value: ctx, children: /* @__PURE__ */ jsx13(
|
|
1373
1546
|
"div",
|
|
1374
1547
|
{
|
|
1375
1548
|
ref,
|
|
1376
1549
|
className,
|
|
1377
1550
|
...mergeProps(
|
|
1378
|
-
|
|
1551
|
+
scopeAttrs3(accordionAnatomy.scope, accordionAnatomy.root),
|
|
1379
1552
|
rest
|
|
1380
1553
|
),
|
|
1381
1554
|
children
|
|
1382
1555
|
}
|
|
1383
1556
|
) });
|
|
1384
1557
|
});
|
|
1385
|
-
var Item2 =
|
|
1558
|
+
var Item2 = forwardRef13(function AccordionItem({ value: itemValue, children, ...rest }, ref) {
|
|
1386
1559
|
const { value } = useAccordionCtx();
|
|
1387
1560
|
const open = value.includes(itemValue);
|
|
1388
|
-
return /* @__PURE__ */
|
|
1561
|
+
return /* @__PURE__ */ jsx13(
|
|
1389
1562
|
"div",
|
|
1390
1563
|
{
|
|
1391
1564
|
ref,
|
|
@@ -1399,10 +1572,10 @@ var Item2 = forwardRef11(function AccordionItem({ value: itemValue, children, ..
|
|
|
1399
1572
|
}
|
|
1400
1573
|
);
|
|
1401
1574
|
});
|
|
1402
|
-
var ItemTrigger =
|
|
1575
|
+
var ItemTrigger = forwardRef13(function AccordionItemTrigger({ value: itemValue, onClick, ...rest }, ref) {
|
|
1403
1576
|
const { value, send } = useAccordionCtx();
|
|
1404
1577
|
const open = value.includes(itemValue);
|
|
1405
|
-
return /* @__PURE__ */
|
|
1578
|
+
return /* @__PURE__ */ jsx13(
|
|
1406
1579
|
"button",
|
|
1407
1580
|
{
|
|
1408
1581
|
ref,
|
|
@@ -1423,10 +1596,10 @@ var ItemTrigger = forwardRef11(function AccordionItemTrigger({ value: itemValue,
|
|
|
1423
1596
|
}
|
|
1424
1597
|
);
|
|
1425
1598
|
});
|
|
1426
|
-
var ItemContent =
|
|
1599
|
+
var ItemContent = forwardRef13(function AccordionItemContent({ value: itemValue, children, ...rest }, ref) {
|
|
1427
1600
|
const { value } = useAccordionCtx();
|
|
1428
1601
|
if (!value.includes(itemValue)) return null;
|
|
1429
|
-
return /* @__PURE__ */
|
|
1602
|
+
return /* @__PURE__ */ jsx13(
|
|
1430
1603
|
"div",
|
|
1431
1604
|
{
|
|
1432
1605
|
ref,
|
|
@@ -1438,8 +1611,8 @@ var ItemContent = forwardRef11(function AccordionItemContent({ value: itemValue,
|
|
|
1438
1611
|
}
|
|
1439
1612
|
);
|
|
1440
1613
|
});
|
|
1441
|
-
var ItemIndicator2 =
|
|
1442
|
-
return /* @__PURE__ */
|
|
1614
|
+
var ItemIndicator2 = forwardRef13(function AccordionItemIndicator(props, ref) {
|
|
1615
|
+
return /* @__PURE__ */ jsx13(
|
|
1443
1616
|
"span",
|
|
1444
1617
|
{
|
|
1445
1618
|
ref,
|
|
@@ -1447,14 +1620,14 @@ var ItemIndicator2 = forwardRef11(function AccordionItemIndicator(props, ref) {
|
|
|
1447
1620
|
}
|
|
1448
1621
|
);
|
|
1449
1622
|
});
|
|
1450
|
-
var Accordion = { Root:
|
|
1623
|
+
var Accordion = { Root: Root13, Item: Item2, ItemTrigger, ItemContent, ItemIndicator: ItemIndicator2 };
|
|
1451
1624
|
|
|
1452
1625
|
// src/async/actions.tsx
|
|
1453
1626
|
import { asyncAnatomy, partOnlyAttrs as partOnlyAttrs6 } from "@aeon-ui/core";
|
|
1454
|
-
import { forwardRef as
|
|
1455
|
-
import { jsx as
|
|
1456
|
-
var AsyncActions =
|
|
1457
|
-
return /* @__PURE__ */
|
|
1627
|
+
import { forwardRef as forwardRef14 } from "react";
|
|
1628
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1629
|
+
var AsyncActions = forwardRef14(function AsyncActions2({ children, className, ...rest }, ref) {
|
|
1630
|
+
return /* @__PURE__ */ jsx14(
|
|
1458
1631
|
"div",
|
|
1459
1632
|
{
|
|
1460
1633
|
ref,
|
|
@@ -1467,12 +1640,12 @@ var AsyncActions = forwardRef12(function AsyncActions2({ children, className, ..
|
|
|
1467
1640
|
|
|
1468
1641
|
// src/async/context.tsx
|
|
1469
1642
|
import { createAsyncMachine } from "@aeon-ui/primitives";
|
|
1470
|
-
import { createContext as
|
|
1471
|
-
import { jsx as
|
|
1643
|
+
import { createContext as createContext11, useContext as useContext11, useMemo as useMemo11 } from "react";
|
|
1644
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1472
1645
|
var defaultMachine = createAsyncMachine();
|
|
1473
|
-
var AsyncCtx =
|
|
1646
|
+
var AsyncCtx = createContext11(null);
|
|
1474
1647
|
function useAsyncContext() {
|
|
1475
|
-
const ctx =
|
|
1648
|
+
const ctx = useContext11(AsyncCtx);
|
|
1476
1649
|
if (!ctx) {
|
|
1477
1650
|
throw new Error("Async compound components must be used within <Async.Root>");
|
|
1478
1651
|
}
|
|
@@ -1484,7 +1657,7 @@ function AsyncProvider({ children, machine }) {
|
|
|
1484
1657
|
const status = String(snapshot.value);
|
|
1485
1658
|
const { data, error, stale } = snapshot.context;
|
|
1486
1659
|
const stateAttr = stale && status === "success" ? `${status} stale` : status;
|
|
1487
|
-
const value =
|
|
1660
|
+
const value = useMemo11(
|
|
1488
1661
|
() => ({
|
|
1489
1662
|
send,
|
|
1490
1663
|
status,
|
|
@@ -1495,14 +1668,14 @@ function AsyncProvider({ children, machine }) {
|
|
|
1495
1668
|
}),
|
|
1496
1669
|
[send, status, data, error, stale, stateAttr]
|
|
1497
1670
|
);
|
|
1498
|
-
return /* @__PURE__ */
|
|
1671
|
+
return /* @__PURE__ */ jsx15(AsyncCtx.Provider, { value, children });
|
|
1499
1672
|
}
|
|
1500
1673
|
|
|
1501
1674
|
// src/async/readout.tsx
|
|
1502
|
-
import { asyncAnatomy as asyncAnatomy2, partAttrs as
|
|
1503
|
-
import { forwardRef as
|
|
1504
|
-
import { jsx as
|
|
1505
|
-
var AsyncReadout =
|
|
1675
|
+
import { asyncAnatomy as asyncAnatomy2, partAttrs as partAttrs13, partOnlyAttrs as partOnlyAttrs7 } from "@aeon-ui/core";
|
|
1676
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
1677
|
+
import { jsx as jsx16, jsxs } from "react/jsx-runtime";
|
|
1678
|
+
var AsyncReadout = forwardRef15(function AsyncReadout2({ children, className, ...rest }, ref) {
|
|
1506
1679
|
const { stateAttr } = useAsyncContext();
|
|
1507
1680
|
return /* @__PURE__ */ jsxs(
|
|
1508
1681
|
"div",
|
|
@@ -1511,9 +1684,9 @@ var AsyncReadout = forwardRef13(function AsyncReadout2({ children, className, ..
|
|
|
1511
1684
|
role: "status",
|
|
1512
1685
|
"aria-live": "polite",
|
|
1513
1686
|
className,
|
|
1514
|
-
...mergeProps(
|
|
1687
|
+
...mergeProps(partAttrs13(asyncAnatomy2.scope, asyncAnatomy2.readout, { state: stateAttr }), rest),
|
|
1515
1688
|
children: [
|
|
1516
|
-
/* @__PURE__ */
|
|
1689
|
+
/* @__PURE__ */ jsx16(
|
|
1517
1690
|
"span",
|
|
1518
1691
|
{
|
|
1519
1692
|
className: "aeon-async-readout__rail",
|
|
@@ -1521,48 +1694,48 @@ var AsyncReadout = forwardRef13(function AsyncReadout2({ children, className, ..
|
|
|
1521
1694
|
...partOnlyAttrs7(asyncAnatomy2.readoutRail)
|
|
1522
1695
|
}
|
|
1523
1696
|
),
|
|
1524
|
-
/* @__PURE__ */
|
|
1697
|
+
/* @__PURE__ */ jsx16("div", { className: "aeon-async-readout__body", ...partOnlyAttrs7(asyncAnatomy2.readoutBody), children })
|
|
1525
1698
|
]
|
|
1526
1699
|
}
|
|
1527
1700
|
);
|
|
1528
1701
|
});
|
|
1529
1702
|
|
|
1530
1703
|
// src/async/root.tsx
|
|
1531
|
-
import { asyncAnatomy as asyncAnatomy3, partAttrs as
|
|
1532
|
-
import { forwardRef as
|
|
1533
|
-
import { jsx as
|
|
1534
|
-
var AsyncRootInner =
|
|
1704
|
+
import { asyncAnatomy as asyncAnatomy3, partAttrs as partAttrs14 } from "@aeon-ui/core";
|
|
1705
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
1706
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1707
|
+
var AsyncRootInner = forwardRef16(function AsyncRootInner2({ children, className, ...rest }, ref) {
|
|
1535
1708
|
const { stateAttr } = useAsyncContext();
|
|
1536
|
-
return /* @__PURE__ */
|
|
1709
|
+
return /* @__PURE__ */ jsx17(
|
|
1537
1710
|
"div",
|
|
1538
1711
|
{
|
|
1539
1712
|
ref,
|
|
1540
1713
|
className,
|
|
1541
|
-
...mergeProps(
|
|
1714
|
+
...mergeProps(partAttrs14(asyncAnatomy3.scope, asyncAnatomy3.root, { state: stateAttr }), rest),
|
|
1542
1715
|
children
|
|
1543
1716
|
}
|
|
1544
1717
|
);
|
|
1545
1718
|
});
|
|
1546
|
-
var AsyncRoot =
|
|
1547
|
-
return /* @__PURE__ */
|
|
1719
|
+
var AsyncRoot = forwardRef16(function AsyncRoot2({ children, className, ...rest }, ref) {
|
|
1720
|
+
return /* @__PURE__ */ jsx17(AsyncProvider, { children: /* @__PURE__ */ jsx17(AsyncRootInner, { ref, className, ...rest, children }) });
|
|
1548
1721
|
});
|
|
1549
1722
|
|
|
1550
1723
|
// src/async/track.tsx
|
|
1551
1724
|
import { asyncAnatomy as asyncAnatomy4, partOnlyAttrs as partOnlyAttrs8 } from "@aeon-ui/core";
|
|
1552
1725
|
import { ASYNC_LIFECYCLE_STATES } from "@aeon-ui/primitives";
|
|
1553
|
-
import { forwardRef as
|
|
1554
|
-
import { jsx as
|
|
1726
|
+
import { forwardRef as forwardRef17 } from "react";
|
|
1727
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1555
1728
|
function segmentPhase(index, activeIndex) {
|
|
1556
1729
|
if (activeIndex === -1) return "future";
|
|
1557
1730
|
if (index === activeIndex) return "active";
|
|
1558
1731
|
if (index < activeIndex) return "past";
|
|
1559
1732
|
return "future";
|
|
1560
1733
|
}
|
|
1561
|
-
var AsyncTrack =
|
|
1734
|
+
var AsyncTrack = forwardRef17(function AsyncTrack2({ states = ASYNC_LIFECYCLE_STATES, className, ...rest }, ref) {
|
|
1562
1735
|
const { status } = useAsyncContext();
|
|
1563
1736
|
const activeIndex = states.indexOf(status);
|
|
1564
1737
|
const { style, ...restWithoutStyle } = rest;
|
|
1565
|
-
return /* @__PURE__ */
|
|
1738
|
+
return /* @__PURE__ */ jsx18(
|
|
1566
1739
|
"div",
|
|
1567
1740
|
{
|
|
1568
1741
|
ref,
|
|
@@ -1576,7 +1749,7 @@ var AsyncTrack = forwardRef15(function AsyncTrack2({ states = ASYNC_LIFECYCLE_ST
|
|
|
1576
1749
|
...mergeProps(partOnlyAttrs8(asyncAnatomy4.track), restWithoutStyle),
|
|
1577
1750
|
children: states.map((id, index) => {
|
|
1578
1751
|
const phase = segmentPhase(index, activeIndex);
|
|
1579
|
-
return /* @__PURE__ */
|
|
1752
|
+
return /* @__PURE__ */ jsx18(
|
|
1580
1753
|
"span",
|
|
1581
1754
|
{
|
|
1582
1755
|
role: "listitem",
|
|
@@ -1621,28 +1794,28 @@ var Async = {
|
|
|
1621
1794
|
};
|
|
1622
1795
|
|
|
1623
1796
|
// src/field/index.tsx
|
|
1624
|
-
import { fieldAnatomy, fieldFace, fieldRegions, partAttrs as
|
|
1797
|
+
import { fieldAnatomy, fieldFace, fieldRegions, partAttrs as partAttrs15, partOnlyAttrs as partOnlyAttrs9 } from "@aeon-ui/core";
|
|
1625
1798
|
import { fieldMachine } from "@aeon-ui/primitives";
|
|
1626
1799
|
import {
|
|
1627
|
-
createContext as
|
|
1628
|
-
forwardRef as
|
|
1629
|
-
useContext as
|
|
1630
|
-
useMemo as
|
|
1800
|
+
createContext as createContext12,
|
|
1801
|
+
forwardRef as forwardRef18,
|
|
1802
|
+
useContext as useContext12,
|
|
1803
|
+
useMemo as useMemo12
|
|
1631
1804
|
} from "react";
|
|
1632
|
-
import { jsx as
|
|
1633
|
-
var FieldCtx =
|
|
1805
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1806
|
+
var FieldCtx = createContext12(null);
|
|
1634
1807
|
function useFieldContext() {
|
|
1635
|
-
const ctx =
|
|
1808
|
+
const ctx = useContext12(FieldCtx);
|
|
1636
1809
|
if (!ctx) throw new Error("Field parts must be used within <Field.Root>");
|
|
1637
1810
|
return ctx;
|
|
1638
1811
|
}
|
|
1639
|
-
var
|
|
1812
|
+
var Root14 = forwardRef18(function FieldRoot({ children, className, id }, ref) {
|
|
1640
1813
|
const [snapshot, send] = useAeonMachine(fieldMachine);
|
|
1641
1814
|
const face = fieldFace(snapshot.value);
|
|
1642
1815
|
const regions = fieldRegions(snapshot.value);
|
|
1643
1816
|
const invalid = regions.validation === "invalid";
|
|
1644
1817
|
const pending = regions.submission === "pending";
|
|
1645
|
-
const value =
|
|
1818
|
+
const value = useMemo12(
|
|
1646
1819
|
() => ({
|
|
1647
1820
|
face,
|
|
1648
1821
|
stateAttr: face,
|
|
@@ -1655,7 +1828,7 @@ var Root12 = forwardRef16(function FieldRoot({ children, className, id }, ref) {
|
|
|
1655
1828
|
}),
|
|
1656
1829
|
[face, regions.interaction, regions.validation, regions.submission, send, invalid, pending]
|
|
1657
1830
|
);
|
|
1658
|
-
return /* @__PURE__ */
|
|
1831
|
+
return /* @__PURE__ */ jsx19(FieldCtx.Provider, { value, children: /* @__PURE__ */ jsx19(
|
|
1659
1832
|
"div",
|
|
1660
1833
|
{
|
|
1661
1834
|
ref,
|
|
@@ -1664,17 +1837,17 @@ var Root12 = forwardRef16(function FieldRoot({ children, className, id }, ref) {
|
|
|
1664
1837
|
"data-aeon-interaction": regions.interaction,
|
|
1665
1838
|
"data-aeon-validation": regions.validation,
|
|
1666
1839
|
"data-aeon-submission": regions.submission,
|
|
1667
|
-
...
|
|
1840
|
+
...partAttrs15(fieldAnatomy.scope, fieldAnatomy.root, { state: face }),
|
|
1668
1841
|
children
|
|
1669
1842
|
}
|
|
1670
1843
|
) });
|
|
1671
1844
|
});
|
|
1672
|
-
var Label5 =
|
|
1673
|
-
return /* @__PURE__ */
|
|
1845
|
+
var Label5 = forwardRef18(function FieldLabel(props, ref) {
|
|
1846
|
+
return /* @__PURE__ */ jsx19("label", { ref, ...partOnlyAttrs9(fieldAnatomy.label), ...props });
|
|
1674
1847
|
});
|
|
1675
|
-
var Control3 =
|
|
1848
|
+
var Control3 = forwardRef18(function FieldControl({ validate, onChange, onBlur, ...rest }, ref) {
|
|
1676
1849
|
const { send, invalid } = useFieldContext();
|
|
1677
|
-
return /* @__PURE__ */
|
|
1850
|
+
return /* @__PURE__ */ jsx19(
|
|
1678
1851
|
"input",
|
|
1679
1852
|
{
|
|
1680
1853
|
ref,
|
|
@@ -1698,9 +1871,9 @@ var Control3 = forwardRef16(function FieldControl({ validate, onChange, onBlur,
|
|
|
1698
1871
|
}
|
|
1699
1872
|
);
|
|
1700
1873
|
});
|
|
1701
|
-
var Textarea =
|
|
1874
|
+
var Textarea = forwardRef18(function FieldTextarea({ validate, onChange, onBlur, ...rest }, ref) {
|
|
1702
1875
|
const { send, invalid } = useFieldContext();
|
|
1703
|
-
return /* @__PURE__ */
|
|
1876
|
+
return /* @__PURE__ */ jsx19(
|
|
1704
1877
|
"textarea",
|
|
1705
1878
|
{
|
|
1706
1879
|
ref,
|
|
@@ -1724,11 +1897,11 @@ var Textarea = forwardRef16(function FieldTextarea({ validate, onChange, onBlur,
|
|
|
1724
1897
|
}
|
|
1725
1898
|
);
|
|
1726
1899
|
});
|
|
1727
|
-
var Message =
|
|
1900
|
+
var Message = forwardRef18(
|
|
1728
1901
|
function FieldMessage({ children, ...props }, ref) {
|
|
1729
1902
|
const { invalid } = useFieldContext();
|
|
1730
1903
|
if (!invalid) return null;
|
|
1731
|
-
return /* @__PURE__ */
|
|
1904
|
+
return /* @__PURE__ */ jsx19(
|
|
1732
1905
|
"p",
|
|
1733
1906
|
{
|
|
1734
1907
|
ref,
|
|
@@ -1740,20 +1913,20 @@ var Message = forwardRef16(
|
|
|
1740
1913
|
);
|
|
1741
1914
|
}
|
|
1742
1915
|
);
|
|
1743
|
-
var Hint =
|
|
1916
|
+
var Hint = forwardRef18(
|
|
1744
1917
|
function FieldHint(props, ref) {
|
|
1745
|
-
return /* @__PURE__ */
|
|
1918
|
+
return /* @__PURE__ */ jsx19("p", { ref, ...partOnlyAttrs9(fieldAnatomy.hint), ...props });
|
|
1746
1919
|
}
|
|
1747
1920
|
);
|
|
1748
|
-
var Field = { Root:
|
|
1921
|
+
var Field = { Root: Root14, Label: Label5, Control: Control3, Input: Control3, Textarea, Message, Hint };
|
|
1749
1922
|
|
|
1750
1923
|
// src/scroll/index.tsx
|
|
1751
|
-
import { scrollAnatomy, partAttrs as
|
|
1924
|
+
import { scrollAnatomy, partAttrs as partAttrs16, partOnlyAttrs as partOnlyAttrs10 } from "@aeon-ui/core";
|
|
1752
1925
|
import {
|
|
1753
|
-
createContext as
|
|
1754
|
-
forwardRef as
|
|
1755
|
-
useContext as
|
|
1756
|
-
useMemo as
|
|
1926
|
+
createContext as createContext13,
|
|
1927
|
+
forwardRef as forwardRef19,
|
|
1928
|
+
useContext as useContext13,
|
|
1929
|
+
useMemo as useMemo13,
|
|
1757
1930
|
useRef as useRef4
|
|
1758
1931
|
} from "react";
|
|
1759
1932
|
|
|
@@ -1783,35 +1956,35 @@ function useScrollState(ref) {
|
|
|
1783
1956
|
}
|
|
1784
1957
|
|
|
1785
1958
|
// src/scroll/index.tsx
|
|
1786
|
-
import { jsx as
|
|
1787
|
-
var ScrollCtx =
|
|
1959
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1960
|
+
var ScrollCtx = createContext13(null);
|
|
1788
1961
|
function useScrollContext() {
|
|
1789
|
-
const ctx =
|
|
1962
|
+
const ctx = useContext13(ScrollCtx);
|
|
1790
1963
|
if (!ctx) throw new Error("Scroll parts must be used within <Scroll.Root>");
|
|
1791
1964
|
return ctx;
|
|
1792
1965
|
}
|
|
1793
|
-
var
|
|
1966
|
+
var Root15 = forwardRef19(function ScrollRoot({ children, className, ...rest }, ref) {
|
|
1794
1967
|
const viewportRef = useRef4(null);
|
|
1795
1968
|
const stateAttr = useScrollState(viewportRef);
|
|
1796
|
-
const value =
|
|
1797
|
-
return /* @__PURE__ */
|
|
1969
|
+
const value = useMemo13(() => ({ stateAttr }), [stateAttr]);
|
|
1970
|
+
return /* @__PURE__ */ jsx20(ScrollCtx.Provider, { value, children: /* @__PURE__ */ jsx20(
|
|
1798
1971
|
"div",
|
|
1799
1972
|
{
|
|
1800
1973
|
ref,
|
|
1801
1974
|
className,
|
|
1802
|
-
...
|
|
1975
|
+
...partAttrs16(scrollAnatomy.scope, scrollAnatomy.root),
|
|
1803
1976
|
...rest,
|
|
1804
|
-
children: /* @__PURE__ */
|
|
1977
|
+
children: /* @__PURE__ */ jsx20(ScrollViewportRefContext.Provider, { value: viewportRef, children })
|
|
1805
1978
|
}
|
|
1806
1979
|
) });
|
|
1807
1980
|
});
|
|
1808
|
-
var ScrollViewportRefContext =
|
|
1981
|
+
var ScrollViewportRefContext = createContext13(
|
|
1809
1982
|
null
|
|
1810
1983
|
);
|
|
1811
|
-
var Viewport =
|
|
1812
|
-
const ctxRef =
|
|
1984
|
+
var Viewport = forwardRef19(function ScrollViewport({ children, className, ...rest }, forwardedRef) {
|
|
1985
|
+
const ctxRef = useContext13(ScrollViewportRefContext);
|
|
1813
1986
|
const { stateAttr } = useScrollContext();
|
|
1814
|
-
return /* @__PURE__ */
|
|
1987
|
+
return /* @__PURE__ */ jsx20(
|
|
1815
1988
|
"div",
|
|
1816
1989
|
{
|
|
1817
1990
|
ref: (node) => {
|
|
@@ -1821,38 +1994,38 @@ var Viewport = forwardRef17(function ScrollViewport({ children, className, ...re
|
|
|
1821
1994
|
},
|
|
1822
1995
|
className,
|
|
1823
1996
|
"data-aeon-scroll": "",
|
|
1824
|
-
...
|
|
1997
|
+
...partAttrs16(scrollAnatomy.scope, scrollAnatomy.viewport, { state: stateAttr }),
|
|
1825
1998
|
...rest,
|
|
1826
1999
|
children
|
|
1827
2000
|
}
|
|
1828
2001
|
);
|
|
1829
2002
|
});
|
|
1830
|
-
var Content3 =
|
|
1831
|
-
return /* @__PURE__ */
|
|
2003
|
+
var Content3 = forwardRef19(function ScrollContent(props, ref) {
|
|
2004
|
+
return /* @__PURE__ */ jsx20("div", { ref, ...partOnlyAttrs10(scrollAnatomy.content), ...props });
|
|
1832
2005
|
});
|
|
1833
2006
|
var Scroll = {
|
|
1834
|
-
Root:
|
|
2007
|
+
Root: Root15,
|
|
1835
2008
|
Viewport,
|
|
1836
2009
|
Content: Content3
|
|
1837
2010
|
};
|
|
1838
2011
|
|
|
1839
2012
|
// src/select/index.tsx
|
|
1840
|
-
import { selectAnatomy, partAttrs as
|
|
2013
|
+
import { selectAnatomy, partAttrs as partAttrs18, partOnlyAttrs as partOnlyAttrs11 } from "@aeon-ui/core";
|
|
1841
2014
|
import { popoverMachine } from "@aeon-ui/primitives";
|
|
1842
2015
|
import {
|
|
1843
|
-
createContext as
|
|
1844
|
-
forwardRef as
|
|
2016
|
+
createContext as createContext14,
|
|
2017
|
+
forwardRef as forwardRef21,
|
|
1845
2018
|
useCallback as useCallback4,
|
|
1846
|
-
useContext as
|
|
2019
|
+
useContext as useContext14,
|
|
1847
2020
|
useId as useId2,
|
|
1848
|
-
useMemo as
|
|
2021
|
+
useMemo as useMemo14,
|
|
1849
2022
|
useRef as useRef5,
|
|
1850
2023
|
useState as useState4
|
|
1851
2024
|
} from "react";
|
|
1852
2025
|
|
|
1853
2026
|
// src/floating/FloatingPositioner.tsx
|
|
1854
|
-
import { partAttrs as
|
|
1855
|
-
import { forwardRef as
|
|
2027
|
+
import { partAttrs as partAttrs17 } from "@aeon-ui/core";
|
|
2028
|
+
import { forwardRef as forwardRef20 } from "react";
|
|
1856
2029
|
|
|
1857
2030
|
// src/hooks/use-anchor-position.ts
|
|
1858
2031
|
import { useEffect as useEffect12 } from "react";
|
|
@@ -1896,8 +2069,8 @@ function useAnchorPosition(anchorRef, floatingRef, active, placement = "bottom-s
|
|
|
1896
2069
|
}
|
|
1897
2070
|
|
|
1898
2071
|
// src/floating/FloatingPositioner.tsx
|
|
1899
|
-
import { jsx as
|
|
1900
|
-
var FloatingPositioner =
|
|
2072
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2073
|
+
var FloatingPositioner = forwardRef20(
|
|
1901
2074
|
function FloatingPositioner2({
|
|
1902
2075
|
open,
|
|
1903
2076
|
scope,
|
|
@@ -1916,7 +2089,7 @@ var FloatingPositioner = forwardRef18(
|
|
|
1916
2089
|
matchWidth: matchAnchorWidth
|
|
1917
2090
|
});
|
|
1918
2091
|
if (!open) return null;
|
|
1919
|
-
const node = /* @__PURE__ */
|
|
2092
|
+
const node = /* @__PURE__ */ jsx21(
|
|
1920
2093
|
"div",
|
|
1921
2094
|
{
|
|
1922
2095
|
ref: (el) => {
|
|
@@ -1925,7 +2098,7 @@ var FloatingPositioner = forwardRef18(
|
|
|
1925
2098
|
else if (ref) ref.current = el;
|
|
1926
2099
|
},
|
|
1927
2100
|
className,
|
|
1928
|
-
...mergeProps(
|
|
2101
|
+
...mergeProps(partAttrs17(scope, part, { state: "open" }), rest),
|
|
1929
2102
|
children
|
|
1930
2103
|
}
|
|
1931
2104
|
);
|
|
@@ -1949,11 +2122,11 @@ function useOutsideClick(refs, enabled, onOutside) {
|
|
|
1949
2122
|
}
|
|
1950
2123
|
|
|
1951
2124
|
// src/select/index.tsx
|
|
1952
|
-
import { jsx as
|
|
1953
|
-
var SelectCtx =
|
|
1954
|
-
var SelectPositionerCtx =
|
|
2125
|
+
import { jsx as jsx22, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2126
|
+
var SelectCtx = createContext14(null);
|
|
2127
|
+
var SelectPositionerCtx = createContext14(false);
|
|
1955
2128
|
function useSelectCtx() {
|
|
1956
|
-
const ctx =
|
|
2129
|
+
const ctx = useContext14(SelectCtx);
|
|
1957
2130
|
if (!ctx) throw new Error("Select parts must be used within <Select.Root>");
|
|
1958
2131
|
return ctx;
|
|
1959
2132
|
}
|
|
@@ -1962,7 +2135,7 @@ function optionValuesFromDom(listboxId, content) {
|
|
|
1962
2135
|
const prefix = `${listboxId}-option-`;
|
|
1963
2136
|
return Array.from(content.querySelectorAll('button[role="option"]:not(:disabled)')).map((el) => el.id.startsWith(prefix) ? el.id.slice(prefix.length) : "").filter(Boolean);
|
|
1964
2137
|
}
|
|
1965
|
-
var
|
|
2138
|
+
var Root16 = forwardRef21(function SelectRoot({ value, onValueChange, children, className, disabled }, ref) {
|
|
1966
2139
|
const [snapshot, send] = useAeonMachine(popoverMachine, { input: { open: false } });
|
|
1967
2140
|
const [highlightedValue, setHighlightedValue] = useState4(null);
|
|
1968
2141
|
const triggerRef = useRef5(null);
|
|
@@ -2048,7 +2221,7 @@ var Root14 = forwardRef19(function SelectRoot({ value, onValueChange, children,
|
|
|
2048
2221
|
},
|
|
2049
2222
|
[open, send, moveHighlight, getOptionValues, highlightValue, highlightedValue, selectValue]
|
|
2050
2223
|
);
|
|
2051
|
-
const ctx =
|
|
2224
|
+
const ctx = useMemo14(
|
|
2052
2225
|
() => ({
|
|
2053
2226
|
value,
|
|
2054
2227
|
open,
|
|
@@ -2077,7 +2250,7 @@ var Root14 = forwardRef19(function SelectRoot({ value, onValueChange, children,
|
|
|
2077
2250
|
onListboxKeyDown
|
|
2078
2251
|
]
|
|
2079
2252
|
);
|
|
2080
|
-
return /* @__PURE__ */
|
|
2253
|
+
return /* @__PURE__ */ jsx22(SelectCtx.Provider, { value: ctx, children: /* @__PURE__ */ jsx22(
|
|
2081
2254
|
"div",
|
|
2082
2255
|
{
|
|
2083
2256
|
ref: (node) => {
|
|
@@ -2086,17 +2259,17 @@ var Root14 = forwardRef19(function SelectRoot({ value, onValueChange, children,
|
|
|
2086
2259
|
else if (ref) ref.current = node;
|
|
2087
2260
|
},
|
|
2088
2261
|
className,
|
|
2089
|
-
...
|
|
2262
|
+
...partAttrs18(selectAnatomy.scope, selectAnatomy.root, {
|
|
2090
2263
|
state: open ? "open" : "closed"
|
|
2091
2264
|
}),
|
|
2092
2265
|
children
|
|
2093
2266
|
}
|
|
2094
2267
|
) });
|
|
2095
2268
|
});
|
|
2096
|
-
var ValueText2 =
|
|
2097
|
-
return /* @__PURE__ */
|
|
2269
|
+
var ValueText2 = forwardRef21(function SelectValueText(props, ref) {
|
|
2270
|
+
return /* @__PURE__ */ jsx22("span", { ref, ...partOnlyAttrs11(selectAnatomy.value), ...props });
|
|
2098
2271
|
});
|
|
2099
|
-
var Trigger3 =
|
|
2272
|
+
var Trigger3 = forwardRef21(function SelectTrigger({ children, onClick, onKeyDown, ...rest }, ref) {
|
|
2100
2273
|
const { open, send, listboxId, triggerRef, onListboxKeyDown } = useSelectCtx();
|
|
2101
2274
|
return /* @__PURE__ */ jsxs2(
|
|
2102
2275
|
"button",
|
|
@@ -2110,7 +2283,7 @@ var Trigger3 = forwardRef19(function SelectTrigger({ children, onClick, onKeyDow
|
|
|
2110
2283
|
"aria-haspopup": "listbox",
|
|
2111
2284
|
"aria-expanded": open,
|
|
2112
2285
|
"aria-controls": open ? listboxId : void 0,
|
|
2113
|
-
...
|
|
2286
|
+
...partAttrs18(selectAnatomy.scope, selectAnatomy.trigger, { state: open ? "open" : "closed" }),
|
|
2114
2287
|
...mergeProps(rest, {
|
|
2115
2288
|
onClick: (e) => {
|
|
2116
2289
|
onClick?.(e);
|
|
@@ -2123,14 +2296,14 @@ var Trigger3 = forwardRef19(function SelectTrigger({ children, onClick, onKeyDow
|
|
|
2123
2296
|
}),
|
|
2124
2297
|
children: [
|
|
2125
2298
|
children,
|
|
2126
|
-
/* @__PURE__ */
|
|
2299
|
+
/* @__PURE__ */ jsx22("span", { ...partOnlyAttrs11(selectAnatomy.icon), "aria-hidden": true })
|
|
2127
2300
|
]
|
|
2128
2301
|
}
|
|
2129
2302
|
);
|
|
2130
2303
|
});
|
|
2131
|
-
var Positioner2 =
|
|
2304
|
+
var Positioner2 = forwardRef21(function SelectPositioner({ portalled = true, children, className, ...rest }, ref) {
|
|
2132
2305
|
const { open, triggerRef, positionerRef } = useSelectCtx();
|
|
2133
|
-
return /* @__PURE__ */
|
|
2306
|
+
return /* @__PURE__ */ jsx22(SelectPositionerCtx.Provider, { value: true, children: /* @__PURE__ */ jsx22(
|
|
2134
2307
|
FloatingPositioner,
|
|
2135
2308
|
{
|
|
2136
2309
|
ref,
|
|
@@ -2147,12 +2320,12 @@ var Positioner2 = forwardRef19(function SelectPositioner({ portalled = true, chi
|
|
|
2147
2320
|
}
|
|
2148
2321
|
) });
|
|
2149
2322
|
});
|
|
2150
|
-
var Content4 =
|
|
2151
|
-
const inPositioner =
|
|
2323
|
+
var Content4 = forwardRef21(function SelectContent({ portalled = true, onKeyDown, children, className, ...rest }, ref) {
|
|
2324
|
+
const inPositioner = useContext14(SelectPositionerCtx);
|
|
2152
2325
|
const { open, listboxId, contentRef, highlightedValue, onListboxKeyDown, triggerRef, positionerRef } = useSelectCtx();
|
|
2153
2326
|
if (!open) return null;
|
|
2154
2327
|
const activeId = highlightedValue && open ? `${listboxId}-option-${highlightedValue}` : void 0;
|
|
2155
|
-
const listbox = /* @__PURE__ */
|
|
2328
|
+
const listbox = /* @__PURE__ */ jsx22(
|
|
2156
2329
|
"div",
|
|
2157
2330
|
{
|
|
2158
2331
|
ref: (node) => {
|
|
@@ -2165,7 +2338,7 @@ var Content4 = forwardRef19(function SelectContent({ portalled = true, onKeyDown
|
|
|
2165
2338
|
"aria-activedescendant": activeId,
|
|
2166
2339
|
className,
|
|
2167
2340
|
"data-aeon-scroll": "",
|
|
2168
|
-
...
|
|
2341
|
+
...partAttrs18(selectAnatomy.scope, selectAnatomy.content, { state: "open" }),
|
|
2169
2342
|
...mergeProps(rest, {
|
|
2170
2343
|
onKeyDown: (e) => {
|
|
2171
2344
|
onKeyDown?.(e);
|
|
@@ -2176,7 +2349,7 @@ var Content4 = forwardRef19(function SelectContent({ portalled = true, onKeyDown
|
|
|
2176
2349
|
}
|
|
2177
2350
|
);
|
|
2178
2351
|
if (inPositioner) return listbox;
|
|
2179
|
-
return /* @__PURE__ */
|
|
2352
|
+
return /* @__PURE__ */ jsx22(
|
|
2180
2353
|
FloatingPositioner,
|
|
2181
2354
|
{
|
|
2182
2355
|
open,
|
|
@@ -2190,11 +2363,11 @@ var Content4 = forwardRef19(function SelectContent({ portalled = true, onKeyDown
|
|
|
2190
2363
|
}
|
|
2191
2364
|
);
|
|
2192
2365
|
});
|
|
2193
|
-
var Item3 =
|
|
2366
|
+
var Item3 = forwardRef21(function SelectItem({ value, disabled = false, children, onClick, ...rest }, ref) {
|
|
2194
2367
|
const { value: selected, listboxId, highlightedValue, selectValue } = useSelectCtx();
|
|
2195
2368
|
const selectedState = value === selected;
|
|
2196
2369
|
const highlighted = value === highlightedValue;
|
|
2197
|
-
return /* @__PURE__ */
|
|
2370
|
+
return /* @__PURE__ */ jsx22(
|
|
2198
2371
|
"button",
|
|
2199
2372
|
{
|
|
2200
2373
|
ref,
|
|
@@ -2203,7 +2376,7 @@ var Item3 = forwardRef19(function SelectItem({ value, disabled = false, children
|
|
|
2203
2376
|
id: `${listboxId}-option-${value}`,
|
|
2204
2377
|
"aria-selected": selectedState,
|
|
2205
2378
|
disabled,
|
|
2206
|
-
...
|
|
2379
|
+
...partAttrs18(selectAnatomy.scope, selectAnatomy.item, {
|
|
2207
2380
|
state: selectedState ? "selected" : highlighted ? "highlighted" : "idle",
|
|
2208
2381
|
highlighted
|
|
2209
2382
|
}),
|
|
@@ -2218,7 +2391,7 @@ var Item3 = forwardRef19(function SelectItem({ value, disabled = false, children
|
|
|
2218
2391
|
);
|
|
2219
2392
|
});
|
|
2220
2393
|
var Select = {
|
|
2221
|
-
Root:
|
|
2394
|
+
Root: Root16,
|
|
2222
2395
|
Trigger: Trigger3,
|
|
2223
2396
|
ValueText: ValueText2,
|
|
2224
2397
|
Positioner: Positioner2,
|
|
@@ -2227,22 +2400,22 @@ var Select = {
|
|
|
2227
2400
|
};
|
|
2228
2401
|
|
|
2229
2402
|
// src/combobox/index.tsx
|
|
2230
|
-
import { comboboxAnatomy, partAttrs as
|
|
2403
|
+
import { comboboxAnatomy, partAttrs as partAttrs19, partOnlyAttrs as partOnlyAttrs12 } from "@aeon-ui/core";
|
|
2231
2404
|
import {
|
|
2232
|
-
createContext as
|
|
2233
|
-
forwardRef as
|
|
2405
|
+
createContext as createContext15,
|
|
2406
|
+
forwardRef as forwardRef22,
|
|
2234
2407
|
useCallback as useCallback5,
|
|
2235
|
-
useContext as
|
|
2408
|
+
useContext as useContext15,
|
|
2236
2409
|
useEffect as useEffect14,
|
|
2237
2410
|
useId as useId3,
|
|
2238
|
-
useMemo as
|
|
2411
|
+
useMemo as useMemo15,
|
|
2239
2412
|
useRef as useRef6,
|
|
2240
2413
|
useState as useState5
|
|
2241
2414
|
} from "react";
|
|
2242
|
-
import { Fragment as Fragment2, jsx as
|
|
2243
|
-
var ComboboxCtx =
|
|
2415
|
+
import { Fragment as Fragment2, jsx as jsx23, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2416
|
+
var ComboboxCtx = createContext15(null);
|
|
2244
2417
|
function useComboboxCtx() {
|
|
2245
|
-
const ctx =
|
|
2418
|
+
const ctx = useContext15(ComboboxCtx);
|
|
2246
2419
|
if (!ctx) throw new Error("Combobox parts must be used within <Combobox.Root>");
|
|
2247
2420
|
return ctx;
|
|
2248
2421
|
}
|
|
@@ -2256,7 +2429,7 @@ function matchesQuery(label, query) {
|
|
|
2256
2429
|
if (!q) return true;
|
|
2257
2430
|
return label.toLowerCase().includes(q);
|
|
2258
2431
|
}
|
|
2259
|
-
var
|
|
2432
|
+
var Root17 = forwardRef22(function ComboboxRoot({ value, onValueChange, children, className, disabled }, ref) {
|
|
2260
2433
|
const [open, setOpenState] = useState5(false);
|
|
2261
2434
|
const [query, setQuery] = useState5("");
|
|
2262
2435
|
const [highlightedValue, setHighlightedValue] = useState5(null);
|
|
@@ -2283,7 +2456,7 @@ var Root15 = forwardRef20(function ComboboxRoot({ value, onValueChange, children
|
|
|
2283
2456
|
setItemsVersion((v) => v + 1);
|
|
2284
2457
|
}, []);
|
|
2285
2458
|
const getItems = useCallback5(() => itemsRef.current, []);
|
|
2286
|
-
const ctx =
|
|
2459
|
+
const ctx = useMemo15(
|
|
2287
2460
|
() => ({
|
|
2288
2461
|
value,
|
|
2289
2462
|
open: disabled ? false : open,
|
|
@@ -2314,12 +2487,12 @@ var Root15 = forwardRef20(function ComboboxRoot({ value, onValueChange, children
|
|
|
2314
2487
|
disabled
|
|
2315
2488
|
]
|
|
2316
2489
|
);
|
|
2317
|
-
return /* @__PURE__ */
|
|
2490
|
+
return /* @__PURE__ */ jsx23(ComboboxCtx.Provider, { value: ctx, children: /* @__PURE__ */ jsx23(
|
|
2318
2491
|
"div",
|
|
2319
2492
|
{
|
|
2320
2493
|
ref,
|
|
2321
2494
|
className,
|
|
2322
|
-
...
|
|
2495
|
+
...partAttrs19(comboboxAnatomy.scope, comboboxAnatomy.root, {
|
|
2323
2496
|
state: open ? "open" : "closed"
|
|
2324
2497
|
}),
|
|
2325
2498
|
children
|
|
@@ -2328,12 +2501,12 @@ var Root15 = forwardRef20(function ComboboxRoot({ value, onValueChange, children
|
|
|
2328
2501
|
});
|
|
2329
2502
|
function useVisibleItems() {
|
|
2330
2503
|
const { query, getItems, itemsVersion } = useComboboxCtx();
|
|
2331
|
-
return
|
|
2504
|
+
return useMemo15(() => {
|
|
2332
2505
|
void itemsVersion;
|
|
2333
2506
|
return getItems().filter((i) => matchesQuery(i.label, query));
|
|
2334
2507
|
}, [query, getItems, itemsVersion]);
|
|
2335
2508
|
}
|
|
2336
|
-
var Input2 =
|
|
2509
|
+
var Input2 = forwardRef22(function ComboboxInput({ onChange, onKeyDown, onFocus, onClick, value: valueProp, ...rest }, ref) {
|
|
2337
2510
|
const {
|
|
2338
2511
|
value: selected,
|
|
2339
2512
|
open,
|
|
@@ -2349,7 +2522,7 @@ var Input2 = forwardRef20(function ComboboxInput({ onChange, onKeyDown, onFocus,
|
|
|
2349
2522
|
} = useComboboxCtx();
|
|
2350
2523
|
const inputRef = useRef6(null);
|
|
2351
2524
|
const visible = useVisibleItems();
|
|
2352
|
-
const selectedLabel =
|
|
2525
|
+
const selectedLabel = useMemo15(() => {
|
|
2353
2526
|
void itemsVersion;
|
|
2354
2527
|
return getItems().find((i) => i.value === selected)?.label ?? "";
|
|
2355
2528
|
}, [getItems, selected, itemsVersion]);
|
|
@@ -2403,7 +2576,7 @@ var Input2 = forwardRef20(function ComboboxInput({ onChange, onKeyDown, onFocus,
|
|
|
2403
2576
|
}, [open, setOpen]);
|
|
2404
2577
|
const activeDescendant = highlightedValue && open ? `${listboxId}-option-${highlightedValue}` : void 0;
|
|
2405
2578
|
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
2406
|
-
/* @__PURE__ */
|
|
2579
|
+
/* @__PURE__ */ jsx23(
|
|
2407
2580
|
"input",
|
|
2408
2581
|
{
|
|
2409
2582
|
ref: setRefs,
|
|
@@ -2415,7 +2588,7 @@ var Input2 = forwardRef20(function ComboboxInput({ onChange, onKeyDown, onFocus,
|
|
|
2415
2588
|
"aria-activedescendant": activeDescendant,
|
|
2416
2589
|
autoComplete: "off",
|
|
2417
2590
|
value: valueProp ?? displayValue,
|
|
2418
|
-
...
|
|
2591
|
+
...partAttrs19(comboboxAnatomy.scope, comboboxAnatomy.input, { state: open ? "open" : "closed" }),
|
|
2419
2592
|
...mergeProps(rest, {
|
|
2420
2593
|
onFocus: (e) => {
|
|
2421
2594
|
onFocus?.(e);
|
|
@@ -2464,7 +2637,7 @@ var Input2 = forwardRef20(function ComboboxInput({ onChange, onKeyDown, onFocus,
|
|
|
2464
2637
|
})
|
|
2465
2638
|
}
|
|
2466
2639
|
),
|
|
2467
|
-
/* @__PURE__ */
|
|
2640
|
+
/* @__PURE__ */ jsx23(
|
|
2468
2641
|
"span",
|
|
2469
2642
|
{
|
|
2470
2643
|
...partOnlyAttrs12(comboboxAnatomy.icon, { state: open ? "open" : "closed" }),
|
|
@@ -2474,10 +2647,10 @@ var Input2 = forwardRef20(function ComboboxInput({ onChange, onKeyDown, onFocus,
|
|
|
2474
2647
|
)
|
|
2475
2648
|
] });
|
|
2476
2649
|
});
|
|
2477
|
-
var Content5 =
|
|
2650
|
+
var Content5 = forwardRef22(function ComboboxContent({ children, className, ...rest }, ref) {
|
|
2478
2651
|
const { open, listboxId } = useComboboxCtx();
|
|
2479
2652
|
if (!open) return null;
|
|
2480
|
-
return /* @__PURE__ */
|
|
2653
|
+
return /* @__PURE__ */ jsx23(
|
|
2481
2654
|
"div",
|
|
2482
2655
|
{
|
|
2483
2656
|
ref,
|
|
@@ -2485,13 +2658,13 @@ var Content5 = forwardRef20(function ComboboxContent({ children, className, ...r
|
|
|
2485
2658
|
role: "listbox",
|
|
2486
2659
|
className,
|
|
2487
2660
|
"data-aeon-scroll": "",
|
|
2488
|
-
...
|
|
2661
|
+
...partAttrs19(comboboxAnatomy.scope, comboboxAnatomy.content),
|
|
2489
2662
|
...rest,
|
|
2490
2663
|
children
|
|
2491
2664
|
}
|
|
2492
2665
|
);
|
|
2493
2666
|
});
|
|
2494
|
-
var Item4 =
|
|
2667
|
+
var Item4 = forwardRef22(function ComboboxItem({ value, textValue, children, onClick, ...rest }, ref) {
|
|
2495
2668
|
const {
|
|
2496
2669
|
value: selected,
|
|
2497
2670
|
query,
|
|
@@ -2512,7 +2685,7 @@ var Item4 = forwardRef20(function ComboboxItem({ value, textValue, children, onC
|
|
|
2512
2685
|
if (!matchesQuery(label, query)) return null;
|
|
2513
2686
|
const selectedState = value === selected;
|
|
2514
2687
|
const highlighted = value === highlightedValue;
|
|
2515
|
-
return /* @__PURE__ */
|
|
2688
|
+
return /* @__PURE__ */ jsx23(
|
|
2516
2689
|
"button",
|
|
2517
2690
|
{
|
|
2518
2691
|
ref,
|
|
@@ -2521,7 +2694,7 @@ var Item4 = forwardRef20(function ComboboxItem({ value, textValue, children, onC
|
|
|
2521
2694
|
id: resolvedOptionId,
|
|
2522
2695
|
"aria-selected": selectedState,
|
|
2523
2696
|
"data-highlighted": highlighted ? "" : void 0,
|
|
2524
|
-
...
|
|
2697
|
+
...partAttrs19(comboboxAnatomy.scope, comboboxAnatomy.item, {
|
|
2525
2698
|
state: selectedState ? "selected" : "idle",
|
|
2526
2699
|
highlighted
|
|
2527
2700
|
}),
|
|
@@ -2539,23 +2712,23 @@ var Item4 = forwardRef20(function ComboboxItem({ value, textValue, children, onC
|
|
|
2539
2712
|
}
|
|
2540
2713
|
);
|
|
2541
2714
|
});
|
|
2542
|
-
var Empty =
|
|
2715
|
+
var Empty = forwardRef22(function ComboboxEmpty({ children, className, ...rest }, ref) {
|
|
2543
2716
|
const { open, query } = useComboboxCtx();
|
|
2544
2717
|
const visible = useVisibleItems();
|
|
2545
2718
|
if (!open || !query.trim() || visible.length > 0) return null;
|
|
2546
|
-
return /* @__PURE__ */
|
|
2719
|
+
return /* @__PURE__ */ jsx23(
|
|
2547
2720
|
"div",
|
|
2548
2721
|
{
|
|
2549
2722
|
ref,
|
|
2550
2723
|
className,
|
|
2551
|
-
...
|
|
2724
|
+
...partAttrs19(comboboxAnatomy.scope, comboboxAnatomy.empty),
|
|
2552
2725
|
...rest,
|
|
2553
2726
|
children: children ?? "No results"
|
|
2554
2727
|
}
|
|
2555
2728
|
);
|
|
2556
2729
|
});
|
|
2557
2730
|
var Combobox = {
|
|
2558
|
-
Root:
|
|
2731
|
+
Root: Root17,
|
|
2559
2732
|
Input: Input2,
|
|
2560
2733
|
Content: Content5,
|
|
2561
2734
|
Item: Item4,
|
|
@@ -2563,26 +2736,26 @@ var Combobox = {
|
|
|
2563
2736
|
};
|
|
2564
2737
|
|
|
2565
2738
|
// src/popover/index.tsx
|
|
2566
|
-
import { popoverAnatomy, partAttrs as
|
|
2739
|
+
import { popoverAnatomy, partAttrs as partAttrs20 } from "@aeon-ui/core";
|
|
2567
2740
|
import { popoverMachine as popoverMachine2 } from "@aeon-ui/primitives";
|
|
2568
2741
|
import {
|
|
2569
|
-
createContext as
|
|
2570
|
-
forwardRef as
|
|
2742
|
+
createContext as createContext16,
|
|
2743
|
+
forwardRef as forwardRef23,
|
|
2571
2744
|
useCallback as useCallback6,
|
|
2572
|
-
useContext as
|
|
2745
|
+
useContext as useContext16,
|
|
2573
2746
|
useEffect as useEffect15,
|
|
2574
2747
|
useId as useId4,
|
|
2575
|
-
useMemo as
|
|
2748
|
+
useMemo as useMemo16,
|
|
2576
2749
|
useRef as useRef7
|
|
2577
2750
|
} from "react";
|
|
2578
|
-
import { jsx as
|
|
2579
|
-
var PopoverCtx =
|
|
2751
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2752
|
+
var PopoverCtx = createContext16(null);
|
|
2580
2753
|
function usePopoverCtx() {
|
|
2581
|
-
const ctx =
|
|
2754
|
+
const ctx = useContext16(PopoverCtx);
|
|
2582
2755
|
if (!ctx) throw new Error("Popover parts must be used within Popover.Root");
|
|
2583
2756
|
return ctx;
|
|
2584
2757
|
}
|
|
2585
|
-
var
|
|
2758
|
+
var Root18 = forwardRef23(function PopoverRoot({ open, defaultOpen = false, onOpenChange, children, className, ...rest }, ref) {
|
|
2586
2759
|
const [snapshot, send] = useAeonMachine(popoverMachine2, {
|
|
2587
2760
|
input: { open: defaultOpen }
|
|
2588
2761
|
});
|
|
@@ -2600,11 +2773,11 @@ var Root16 = forwardRef21(function PopoverRoot({ open, defaultOpen = false, onOp
|
|
|
2600
2773
|
}, [open, send]);
|
|
2601
2774
|
const close = useCallback6(() => send({ type: "CLOSE" }), [send]);
|
|
2602
2775
|
useOutsideClick([rootRef, positionerRef], resolvedOpen, close);
|
|
2603
|
-
const value =
|
|
2776
|
+
const value = useMemo16(
|
|
2604
2777
|
() => ({ open: resolvedOpen, send, triggerId, contentId, triggerRef, positionerRef }),
|
|
2605
2778
|
[resolvedOpen, send, triggerId, contentId]
|
|
2606
2779
|
);
|
|
2607
|
-
return /* @__PURE__ */
|
|
2780
|
+
return /* @__PURE__ */ jsx24(PopoverCtx.Provider, { value, children: /* @__PURE__ */ jsx24(
|
|
2608
2781
|
"div",
|
|
2609
2782
|
{
|
|
2610
2783
|
ref: (node) => {
|
|
@@ -2614,7 +2787,7 @@ var Root16 = forwardRef21(function PopoverRoot({ open, defaultOpen = false, onOp
|
|
|
2614
2787
|
},
|
|
2615
2788
|
className,
|
|
2616
2789
|
...mergeProps(
|
|
2617
|
-
|
|
2790
|
+
partAttrs20(popoverAnatomy.scope, popoverAnatomy.root, {
|
|
2618
2791
|
state: resolvedOpen ? "open" : "closed"
|
|
2619
2792
|
}),
|
|
2620
2793
|
rest
|
|
@@ -2623,9 +2796,9 @@ var Root16 = forwardRef21(function PopoverRoot({ open, defaultOpen = false, onOp
|
|
|
2623
2796
|
}
|
|
2624
2797
|
) });
|
|
2625
2798
|
});
|
|
2626
|
-
var Trigger4 =
|
|
2799
|
+
var Trigger4 = forwardRef23(function PopoverTrigger({ onClick, ...rest }, ref) {
|
|
2627
2800
|
const { open, send, triggerId, contentId, triggerRef } = usePopoverCtx();
|
|
2628
|
-
return /* @__PURE__ */
|
|
2801
|
+
return /* @__PURE__ */ jsx24(
|
|
2629
2802
|
"button",
|
|
2630
2803
|
{
|
|
2631
2804
|
ref: (node) => {
|
|
@@ -2638,7 +2811,7 @@ var Trigger4 = forwardRef21(function PopoverTrigger({ onClick, ...rest }, ref) {
|
|
|
2638
2811
|
"aria-expanded": open,
|
|
2639
2812
|
"aria-controls": open ? contentId : void 0,
|
|
2640
2813
|
...mergeProps(
|
|
2641
|
-
|
|
2814
|
+
partAttrs20(popoverAnatomy.scope, popoverAnatomy.trigger, { state: open ? "open" : "closed" }),
|
|
2642
2815
|
{
|
|
2643
2816
|
onClick: (e) => {
|
|
2644
2817
|
onClick?.(e);
|
|
@@ -2650,9 +2823,9 @@ var Trigger4 = forwardRef21(function PopoverTrigger({ onClick, ...rest }, ref) {
|
|
|
2650
2823
|
}
|
|
2651
2824
|
);
|
|
2652
2825
|
});
|
|
2653
|
-
var Positioner3 =
|
|
2826
|
+
var Positioner3 = forwardRef23(function PopoverPositioner({ portalled = true, placement = "bottom-start", children, className, ...rest }, ref) {
|
|
2654
2827
|
const { open, triggerRef, positionerRef } = usePopoverCtx();
|
|
2655
|
-
return /* @__PURE__ */
|
|
2828
|
+
return /* @__PURE__ */ jsx24(
|
|
2656
2829
|
FloatingPositioner,
|
|
2657
2830
|
{
|
|
2658
2831
|
ref,
|
|
@@ -2669,10 +2842,10 @@ var Positioner3 = forwardRef21(function PopoverPositioner({ portalled = true, pl
|
|
|
2669
2842
|
}
|
|
2670
2843
|
);
|
|
2671
2844
|
});
|
|
2672
|
-
var Content6 =
|
|
2845
|
+
var Content6 = forwardRef23(function PopoverContent({ onKeyDown, ...rest }, ref) {
|
|
2673
2846
|
const { open, send, triggerId, contentId } = usePopoverCtx();
|
|
2674
2847
|
if (!open) return null;
|
|
2675
|
-
return /* @__PURE__ */
|
|
2848
|
+
return /* @__PURE__ */ jsx24(
|
|
2676
2849
|
"div",
|
|
2677
2850
|
{
|
|
2678
2851
|
ref,
|
|
@@ -2681,7 +2854,7 @@ var Content6 = forwardRef21(function PopoverContent({ onKeyDown, ...rest }, ref)
|
|
|
2681
2854
|
"aria-modal": false,
|
|
2682
2855
|
"aria-labelledby": triggerId,
|
|
2683
2856
|
...mergeProps(
|
|
2684
|
-
|
|
2857
|
+
partAttrs20(popoverAnatomy.scope, popoverAnatomy.content, { state: "open" }),
|
|
2685
2858
|
{
|
|
2686
2859
|
onKeyDown: (e) => {
|
|
2687
2860
|
onKeyDown?.(e);
|
|
@@ -2693,22 +2866,22 @@ var Content6 = forwardRef21(function PopoverContent({ onKeyDown, ...rest }, ref)
|
|
|
2693
2866
|
}
|
|
2694
2867
|
);
|
|
2695
2868
|
});
|
|
2696
|
-
var Arrow =
|
|
2869
|
+
var Arrow = forwardRef23(function PopoverArrow(props, ref) {
|
|
2697
2870
|
const { open } = usePopoverCtx();
|
|
2698
2871
|
if (!open) return null;
|
|
2699
|
-
return /* @__PURE__ */
|
|
2872
|
+
return /* @__PURE__ */ jsx24("div", { ref, ...mergeProps(partAttrs20(popoverAnatomy.scope, popoverAnatomy.arrow), props) });
|
|
2700
2873
|
});
|
|
2701
|
-
var CloseTrigger2 =
|
|
2874
|
+
var CloseTrigger2 = forwardRef23(
|
|
2702
2875
|
function PopoverCloseTrigger({ onClick, ...rest }, ref) {
|
|
2703
2876
|
const { send } = usePopoverCtx();
|
|
2704
|
-
return /* @__PURE__ */
|
|
2877
|
+
return /* @__PURE__ */ jsx24(
|
|
2705
2878
|
"button",
|
|
2706
2879
|
{
|
|
2707
2880
|
ref,
|
|
2708
2881
|
type: "button",
|
|
2709
2882
|
"aria-label": "Close",
|
|
2710
2883
|
...mergeProps(
|
|
2711
|
-
|
|
2884
|
+
partAttrs20(popoverAnatomy.scope, popoverAnatomy.closeTrigger),
|
|
2712
2885
|
{
|
|
2713
2886
|
onClick: (e) => {
|
|
2714
2887
|
onClick?.(e);
|
|
@@ -2721,29 +2894,29 @@ var CloseTrigger2 = forwardRef21(
|
|
|
2721
2894
|
);
|
|
2722
2895
|
}
|
|
2723
2896
|
);
|
|
2724
|
-
var Popover = { Root:
|
|
2897
|
+
var Popover = { Root: Root18, Trigger: Trigger4, Positioner: Positioner3, Content: Content6, Arrow, CloseTrigger: CloseTrigger2 };
|
|
2725
2898
|
|
|
2726
2899
|
// src/menu/index.tsx
|
|
2727
|
-
import { menuAnatomy, partAttrs as
|
|
2900
|
+
import { menuAnatomy, partAttrs as partAttrs21 } from "@aeon-ui/core";
|
|
2728
2901
|
import { popoverMachine as popoverMachine3 } from "@aeon-ui/primitives";
|
|
2729
2902
|
import {
|
|
2730
|
-
createContext as
|
|
2731
|
-
forwardRef as
|
|
2903
|
+
createContext as createContext17,
|
|
2904
|
+
forwardRef as forwardRef24,
|
|
2732
2905
|
useCallback as useCallback7,
|
|
2733
|
-
useContext as
|
|
2906
|
+
useContext as useContext17,
|
|
2734
2907
|
useEffect as useEffect16,
|
|
2735
2908
|
useId as useId5,
|
|
2736
|
-
useMemo as
|
|
2909
|
+
useMemo as useMemo17,
|
|
2737
2910
|
useRef as useRef8
|
|
2738
2911
|
} from "react";
|
|
2739
|
-
import { jsx as
|
|
2740
|
-
var MenuCtx =
|
|
2912
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2913
|
+
var MenuCtx = createContext17(null);
|
|
2741
2914
|
function useMenuCtx() {
|
|
2742
|
-
const ctx =
|
|
2915
|
+
const ctx = useContext17(MenuCtx);
|
|
2743
2916
|
if (!ctx) throw new Error("Menu parts must be used within Menu.Root");
|
|
2744
2917
|
return ctx;
|
|
2745
2918
|
}
|
|
2746
|
-
var
|
|
2919
|
+
var Root19 = forwardRef24(function MenuRoot({ open, defaultOpen = false, onOpenChange, children, className, ...rest }, ref) {
|
|
2747
2920
|
const [snapshot, send] = useAeonMachine(popoverMachine3, { input: { open: defaultOpen } });
|
|
2748
2921
|
const resolvedOpen = open ?? snapshot.context.open;
|
|
2749
2922
|
const rootRef = useRef8(null);
|
|
@@ -2759,11 +2932,11 @@ var Root17 = forwardRef22(function MenuRoot({ open, defaultOpen = false, onOpenC
|
|
|
2759
2932
|
}, [open, send]);
|
|
2760
2933
|
const close = useCallback7(() => send({ type: "CLOSE" }), [send]);
|
|
2761
2934
|
useOutsideClick([rootRef, positionerRef], resolvedOpen, close);
|
|
2762
|
-
const value =
|
|
2935
|
+
const value = useMemo17(
|
|
2763
2936
|
() => ({ open: resolvedOpen, send, triggerId, menuId, triggerRef, positionerRef }),
|
|
2764
2937
|
[resolvedOpen, send, triggerId, menuId]
|
|
2765
2938
|
);
|
|
2766
|
-
return /* @__PURE__ */
|
|
2939
|
+
return /* @__PURE__ */ jsx25(MenuCtx.Provider, { value, children: /* @__PURE__ */ jsx25(
|
|
2767
2940
|
"div",
|
|
2768
2941
|
{
|
|
2769
2942
|
ref: (node) => {
|
|
@@ -2773,16 +2946,16 @@ var Root17 = forwardRef22(function MenuRoot({ open, defaultOpen = false, onOpenC
|
|
|
2773
2946
|
},
|
|
2774
2947
|
className,
|
|
2775
2948
|
...mergeProps(
|
|
2776
|
-
|
|
2949
|
+
partAttrs21(menuAnatomy.scope, menuAnatomy.root, { state: resolvedOpen ? "open" : "closed" }),
|
|
2777
2950
|
rest
|
|
2778
2951
|
),
|
|
2779
2952
|
children
|
|
2780
2953
|
}
|
|
2781
2954
|
) });
|
|
2782
2955
|
});
|
|
2783
|
-
var Trigger5 =
|
|
2956
|
+
var Trigger5 = forwardRef24(function MenuTrigger({ onClick, ...rest }, ref) {
|
|
2784
2957
|
const { open, send, triggerId, menuId, triggerRef } = useMenuCtx();
|
|
2785
|
-
return /* @__PURE__ */
|
|
2958
|
+
return /* @__PURE__ */ jsx25(
|
|
2786
2959
|
"button",
|
|
2787
2960
|
{
|
|
2788
2961
|
ref: (node) => {
|
|
@@ -2796,7 +2969,7 @@ var Trigger5 = forwardRef22(function MenuTrigger({ onClick, ...rest }, ref) {
|
|
|
2796
2969
|
"aria-expanded": open,
|
|
2797
2970
|
"aria-controls": open ? menuId : void 0,
|
|
2798
2971
|
...mergeProps(
|
|
2799
|
-
|
|
2972
|
+
partAttrs21(menuAnatomy.scope, menuAnatomy.trigger, { state: open ? "open" : "closed" }),
|
|
2800
2973
|
{
|
|
2801
2974
|
onClick: (e) => {
|
|
2802
2975
|
onClick?.(e);
|
|
@@ -2808,9 +2981,9 @@ var Trigger5 = forwardRef22(function MenuTrigger({ onClick, ...rest }, ref) {
|
|
|
2808
2981
|
}
|
|
2809
2982
|
);
|
|
2810
2983
|
});
|
|
2811
|
-
var Positioner4 =
|
|
2984
|
+
var Positioner4 = forwardRef24(function MenuPositioner({ portalled = true, placement = "bottom-start", children, className, ...rest }, ref) {
|
|
2812
2985
|
const { open, triggerRef, positionerRef } = useMenuCtx();
|
|
2813
|
-
return /* @__PURE__ */
|
|
2986
|
+
return /* @__PURE__ */ jsx25(
|
|
2814
2987
|
FloatingPositioner,
|
|
2815
2988
|
{
|
|
2816
2989
|
ref,
|
|
@@ -2827,17 +3000,17 @@ var Positioner4 = forwardRef22(function MenuPositioner({ portalled = true, place
|
|
|
2827
3000
|
}
|
|
2828
3001
|
);
|
|
2829
3002
|
});
|
|
2830
|
-
var Content7 =
|
|
3003
|
+
var Content7 = forwardRef24(function MenuContent({ onKeyDown, ...rest }, ref) {
|
|
2831
3004
|
const { open, send, menuId } = useMenuCtx();
|
|
2832
3005
|
if (!open) return null;
|
|
2833
|
-
return /* @__PURE__ */
|
|
3006
|
+
return /* @__PURE__ */ jsx25(
|
|
2834
3007
|
"div",
|
|
2835
3008
|
{
|
|
2836
3009
|
ref,
|
|
2837
3010
|
id: menuId,
|
|
2838
3011
|
role: "menu",
|
|
2839
3012
|
...mergeProps(
|
|
2840
|
-
|
|
3013
|
+
partAttrs21(menuAnatomy.scope, menuAnatomy.content, { state: "open" }),
|
|
2841
3014
|
{
|
|
2842
3015
|
onKeyDown: (e) => {
|
|
2843
3016
|
onKeyDown?.(e);
|
|
@@ -2849,16 +3022,16 @@ var Content7 = forwardRef22(function MenuContent({ onKeyDown, ...rest }, ref) {
|
|
|
2849
3022
|
}
|
|
2850
3023
|
);
|
|
2851
3024
|
});
|
|
2852
|
-
var Item5 =
|
|
3025
|
+
var Item5 = forwardRef24(function MenuItem({ closeOnSelect = true, onClick, ...rest }, ref) {
|
|
2853
3026
|
const { send } = useMenuCtx();
|
|
2854
|
-
return /* @__PURE__ */
|
|
3027
|
+
return /* @__PURE__ */ jsx25(
|
|
2855
3028
|
"button",
|
|
2856
3029
|
{
|
|
2857
3030
|
ref,
|
|
2858
3031
|
type: "button",
|
|
2859
3032
|
role: "menuitem",
|
|
2860
3033
|
...mergeProps(
|
|
2861
|
-
|
|
3034
|
+
partAttrs21(menuAnatomy.scope, menuAnatomy.item),
|
|
2862
3035
|
{
|
|
2863
3036
|
onClick: (e) => {
|
|
2864
3037
|
onClick?.(e);
|
|
@@ -2870,20 +3043,20 @@ var Item5 = forwardRef22(function MenuItem({ closeOnSelect = true, onClick, ...r
|
|
|
2870
3043
|
}
|
|
2871
3044
|
);
|
|
2872
3045
|
});
|
|
2873
|
-
var Separator2 =
|
|
2874
|
-
return /* @__PURE__ */
|
|
3046
|
+
var Separator2 = forwardRef24(function MenuSeparator(props, ref) {
|
|
3047
|
+
return /* @__PURE__ */ jsx25("div", { ref, role: "separator", ...mergeProps(partAttrs21(menuAnatomy.scope, menuAnatomy.separator), props) });
|
|
2875
3048
|
});
|
|
2876
|
-
var Menu = { Root:
|
|
3049
|
+
var Menu = { Root: Root19, Trigger: Trigger5, Positioner: Positioner4, Content: Content7, Item: Item5, Separator: Separator2 };
|
|
2877
3050
|
|
|
2878
3051
|
// src/tooltip/index.tsx
|
|
2879
|
-
import { tooltipAnatomy, partAttrs as
|
|
3052
|
+
import { tooltipAnatomy, partAttrs as partAttrs22 } from "@aeon-ui/core";
|
|
2880
3053
|
import {
|
|
2881
|
-
createContext as
|
|
2882
|
-
forwardRef as
|
|
2883
|
-
useContext as
|
|
3054
|
+
createContext as createContext18,
|
|
3055
|
+
forwardRef as forwardRef25,
|
|
3056
|
+
useContext as useContext18,
|
|
2884
3057
|
useEffect as useEffect18,
|
|
2885
3058
|
useId as useId6,
|
|
2886
|
-
useMemo as
|
|
3059
|
+
useMemo as useMemo18,
|
|
2887
3060
|
useRef as useRef9,
|
|
2888
3061
|
useState as useState7
|
|
2889
3062
|
} from "react";
|
|
@@ -2903,14 +3076,14 @@ function usePrefersHover() {
|
|
|
2903
3076
|
}
|
|
2904
3077
|
|
|
2905
3078
|
// src/tooltip/index.tsx
|
|
2906
|
-
import { jsx as
|
|
2907
|
-
var TooltipCtx =
|
|
3079
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3080
|
+
var TooltipCtx = createContext18(null);
|
|
2908
3081
|
function useTooltipCtx() {
|
|
2909
|
-
const ctx =
|
|
3082
|
+
const ctx = useContext18(TooltipCtx);
|
|
2910
3083
|
if (!ctx) throw new Error("Tooltip parts must be used within Tooltip.Root");
|
|
2911
3084
|
return ctx;
|
|
2912
3085
|
}
|
|
2913
|
-
var
|
|
3086
|
+
var Root20 = forwardRef25(function TooltipRoot({
|
|
2914
3087
|
open,
|
|
2915
3088
|
defaultOpen = false,
|
|
2916
3089
|
onOpenChange,
|
|
@@ -2981,7 +3154,7 @@ var Root18 = forwardRef23(function TooltipRoot({
|
|
|
2981
3154
|
else showImmediately();
|
|
2982
3155
|
};
|
|
2983
3156
|
useOutsideClick([triggerRef, positionerRef], resolvedOpen && !prefersHover && outsideClickEnabled, hideNow);
|
|
2984
|
-
const value =
|
|
3157
|
+
const value = useMemo18(
|
|
2985
3158
|
() => ({
|
|
2986
3159
|
open: resolvedOpen,
|
|
2987
3160
|
setOpen,
|
|
@@ -2999,13 +3172,13 @@ var Root18 = forwardRef23(function TooltipRoot({
|
|
|
2999
3172
|
}),
|
|
3000
3173
|
[resolvedOpen, triggerId, contentId, openDelay, closeDelay, touchDurationMs, touchOutsideGraceMs, showOnFocus, prefersHover]
|
|
3001
3174
|
);
|
|
3002
|
-
return /* @__PURE__ */
|
|
3175
|
+
return /* @__PURE__ */ jsx26(TooltipCtx.Provider, { value, children: /* @__PURE__ */ jsx26(
|
|
3003
3176
|
"div",
|
|
3004
3177
|
{
|
|
3005
3178
|
ref,
|
|
3006
3179
|
className,
|
|
3007
3180
|
...mergeProps(
|
|
3008
|
-
|
|
3181
|
+
partAttrs22(tooltipAnatomy.scope, tooltipAnatomy.root, {
|
|
3009
3182
|
state: resolvedOpen ? "open" : "closed"
|
|
3010
3183
|
}),
|
|
3011
3184
|
rest
|
|
@@ -3014,7 +3187,7 @@ var Root18 = forwardRef23(function TooltipRoot({
|
|
|
3014
3187
|
}
|
|
3015
3188
|
) });
|
|
3016
3189
|
});
|
|
3017
|
-
var Trigger6 =
|
|
3190
|
+
var Trigger6 = forwardRef25(function TooltipTrigger({ onClick, onMouseEnter, onMouseLeave, onFocus, onBlur, onPointerDown, ...rest }, ref) {
|
|
3018
3191
|
const {
|
|
3019
3192
|
open,
|
|
3020
3193
|
triggerId,
|
|
@@ -3027,7 +3200,7 @@ var Trigger6 = forwardRef23(function TooltipTrigger({ onClick, onMouseEnter, onM
|
|
|
3027
3200
|
showOnFocus,
|
|
3028
3201
|
prefersHover
|
|
3029
3202
|
} = useTooltipCtx();
|
|
3030
|
-
return /* @__PURE__ */
|
|
3203
|
+
return /* @__PURE__ */ jsx26(
|
|
3031
3204
|
"span",
|
|
3032
3205
|
{
|
|
3033
3206
|
ref: (node) => {
|
|
@@ -3039,7 +3212,7 @@ var Trigger6 = forwardRef23(function TooltipTrigger({ onClick, onMouseEnter, onM
|
|
|
3039
3212
|
tabIndex: 0,
|
|
3040
3213
|
"aria-describedby": open ? contentId : void 0,
|
|
3041
3214
|
...mergeProps(
|
|
3042
|
-
|
|
3215
|
+
partAttrs22(tooltipAnatomy.scope, tooltipAnatomy.trigger, { state: open ? "open" : "closed" }),
|
|
3043
3216
|
{
|
|
3044
3217
|
onMouseEnter: (e) => {
|
|
3045
3218
|
onMouseEnter?.(e);
|
|
@@ -3071,9 +3244,9 @@ var Trigger6 = forwardRef23(function TooltipTrigger({ onClick, onMouseEnter, onM
|
|
|
3071
3244
|
}
|
|
3072
3245
|
);
|
|
3073
3246
|
});
|
|
3074
|
-
var Positioner5 =
|
|
3247
|
+
var Positioner5 = forwardRef25(function TooltipPositioner({ portalled = true, placement = "top-start", children, className, ...rest }, ref) {
|
|
3075
3248
|
const { open, triggerRef, positionerRef } = useTooltipCtx();
|
|
3076
|
-
return /* @__PURE__ */
|
|
3249
|
+
return /* @__PURE__ */ jsx26(
|
|
3077
3250
|
FloatingPositioner,
|
|
3078
3251
|
{
|
|
3079
3252
|
ref,
|
|
@@ -3090,46 +3263,46 @@ var Positioner5 = forwardRef23(function TooltipPositioner({ portalled = true, pl
|
|
|
3090
3263
|
}
|
|
3091
3264
|
);
|
|
3092
3265
|
});
|
|
3093
|
-
var Content8 =
|
|
3266
|
+
var Content8 = forwardRef25(function TooltipContent(props, ref) {
|
|
3094
3267
|
const { open, contentId } = useTooltipCtx();
|
|
3095
3268
|
if (!open) return null;
|
|
3096
|
-
return /* @__PURE__ */
|
|
3269
|
+
return /* @__PURE__ */ jsx26(
|
|
3097
3270
|
"div",
|
|
3098
3271
|
{
|
|
3099
3272
|
ref,
|
|
3100
3273
|
id: contentId,
|
|
3101
3274
|
role: "tooltip",
|
|
3102
|
-
...mergeProps(
|
|
3275
|
+
...mergeProps(partAttrs22(tooltipAnatomy.scope, tooltipAnatomy.content, { state: "open" }), props)
|
|
3103
3276
|
}
|
|
3104
3277
|
);
|
|
3105
3278
|
});
|
|
3106
|
-
var Arrow2 =
|
|
3279
|
+
var Arrow2 = forwardRef25(function TooltipArrow(props, ref) {
|
|
3107
3280
|
const { open } = useTooltipCtx();
|
|
3108
3281
|
if (!open) return null;
|
|
3109
|
-
return /* @__PURE__ */
|
|
3282
|
+
return /* @__PURE__ */ jsx26("div", { ref, ...mergeProps(partAttrs22(tooltipAnatomy.scope, tooltipAnatomy.arrow), props) });
|
|
3110
3283
|
});
|
|
3111
|
-
var Tooltip = { Root:
|
|
3284
|
+
var Tooltip = { Root: Root20, Trigger: Trigger6, Positioner: Positioner5, Content: Content8, Arrow: Arrow2 };
|
|
3112
3285
|
|
|
3113
3286
|
// src/toast/primitives.tsx
|
|
3114
|
-
import { toastAnatomy, partAttrs as
|
|
3287
|
+
import { toastAnatomy, partAttrs as partAttrs23 } from "@aeon-ui/core";
|
|
3115
3288
|
import { toastMachine } from "@aeon-ui/primitives";
|
|
3116
3289
|
import {
|
|
3117
|
-
createContext as
|
|
3118
|
-
forwardRef as
|
|
3119
|
-
useContext as
|
|
3290
|
+
createContext as createContext19,
|
|
3291
|
+
forwardRef as forwardRef26,
|
|
3292
|
+
useContext as useContext19,
|
|
3120
3293
|
useEffect as useEffect19,
|
|
3121
3294
|
useId as useId7,
|
|
3122
|
-
useMemo as
|
|
3295
|
+
useMemo as useMemo19,
|
|
3123
3296
|
useRef as useRef10
|
|
3124
3297
|
} from "react";
|
|
3125
|
-
import { jsx as
|
|
3126
|
-
var ToastCtx =
|
|
3298
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3299
|
+
var ToastCtx = createContext19(null);
|
|
3127
3300
|
function useToastCtx() {
|
|
3128
|
-
const ctx =
|
|
3301
|
+
const ctx = useContext19(ToastCtx);
|
|
3129
3302
|
if (!ctx) throw new Error("Toast parts must be used within Toast.Root");
|
|
3130
3303
|
return ctx;
|
|
3131
3304
|
}
|
|
3132
|
-
var
|
|
3305
|
+
var Root21 = forwardRef26(function ToastRoot({ durationMs = 5e3, defaultVisible = false, onVisibleChange, children, className, ...rest }, ref) {
|
|
3133
3306
|
const [snapshot, send] = useAeonMachine(toastMachine, { input: { durationMs } });
|
|
3134
3307
|
const visible = snapshot.matches("visible");
|
|
3135
3308
|
const titleId = useId7();
|
|
@@ -3145,8 +3318,8 @@ var Root19 = forwardRef24(function ToastRoot({ durationMs = 5e3, defaultVisible
|
|
|
3145
3318
|
}
|
|
3146
3319
|
if (hasBeenVisible.current) onVisibleChange?.(false);
|
|
3147
3320
|
}, [visible, onVisibleChange]);
|
|
3148
|
-
const value =
|
|
3149
|
-
return /* @__PURE__ */
|
|
3321
|
+
const value = useMemo19(() => ({ visible, send, titleId }), [visible, send, titleId]);
|
|
3322
|
+
return /* @__PURE__ */ jsx27(ToastCtx.Provider, { value, children: /* @__PURE__ */ jsx27(
|
|
3150
3323
|
"div",
|
|
3151
3324
|
{
|
|
3152
3325
|
ref,
|
|
@@ -3154,7 +3327,7 @@ var Root19 = forwardRef24(function ToastRoot({ durationMs = 5e3, defaultVisible
|
|
|
3154
3327
|
"aria-live": "polite",
|
|
3155
3328
|
"aria-atomic": "true",
|
|
3156
3329
|
...mergeProps(
|
|
3157
|
-
|
|
3330
|
+
partAttrs23(toastAnatomy.scope, toastAnatomy.root, { state: visible ? "visible" : "hidden" }),
|
|
3158
3331
|
rest
|
|
3159
3332
|
),
|
|
3160
3333
|
className,
|
|
@@ -3163,26 +3336,26 @@ var Root19 = forwardRef24(function ToastRoot({ durationMs = 5e3, defaultVisible
|
|
|
3163
3336
|
}
|
|
3164
3337
|
) });
|
|
3165
3338
|
});
|
|
3166
|
-
var
|
|
3339
|
+
var Title3 = forwardRef26(function ToastTitle(props, ref) {
|
|
3167
3340
|
const { titleId } = useToastCtx();
|
|
3168
|
-
return /* @__PURE__ */
|
|
3341
|
+
return /* @__PURE__ */ jsx27("p", { ref, id: titleId, ...mergeProps(partAttrs23(toastAnatomy.scope, toastAnatomy.title), props) });
|
|
3169
3342
|
});
|
|
3170
|
-
var Description2 =
|
|
3343
|
+
var Description2 = forwardRef26(
|
|
3171
3344
|
function ToastDescription(props, ref) {
|
|
3172
|
-
return /* @__PURE__ */
|
|
3345
|
+
return /* @__PURE__ */ jsx27("p", { ref, ...mergeProps(partAttrs23(toastAnatomy.scope, toastAnatomy.description), props) });
|
|
3173
3346
|
}
|
|
3174
3347
|
);
|
|
3175
|
-
var CloseTrigger3 =
|
|
3348
|
+
var CloseTrigger3 = forwardRef26(
|
|
3176
3349
|
function ToastCloseTrigger({ onClick, children, ...rest }, ref) {
|
|
3177
3350
|
const { send } = useToastCtx();
|
|
3178
|
-
return /* @__PURE__ */
|
|
3351
|
+
return /* @__PURE__ */ jsx27(
|
|
3179
3352
|
"button",
|
|
3180
3353
|
{
|
|
3181
3354
|
ref,
|
|
3182
3355
|
type: "button",
|
|
3183
3356
|
"aria-label": "Dismiss",
|
|
3184
3357
|
...mergeProps(
|
|
3185
|
-
|
|
3358
|
+
partAttrs23(toastAnatomy.scope, toastAnatomy.closeTrigger),
|
|
3186
3359
|
{
|
|
3187
3360
|
onClick: (e) => {
|
|
3188
3361
|
onClick?.(e);
|
|
@@ -3208,20 +3381,20 @@ function Show({ durationMs }) {
|
|
|
3208
3381
|
}
|
|
3209
3382
|
|
|
3210
3383
|
// src/toast/provider.tsx
|
|
3211
|
-
import { toastAnatomy as toastAnatomy2, partAttrs as
|
|
3384
|
+
import { toastAnatomy as toastAnatomy2, partAttrs as partAttrs24 } from "@aeon-ui/core";
|
|
3212
3385
|
import {
|
|
3213
3386
|
useCallback as useCallback8,
|
|
3214
3387
|
useEffect as useEffect20,
|
|
3215
|
-
useMemo as
|
|
3388
|
+
useMemo as useMemo20,
|
|
3216
3389
|
useState as useState8
|
|
3217
3390
|
} from "react";
|
|
3218
3391
|
import { createPortal as createPortal2 } from "react-dom";
|
|
3219
3392
|
|
|
3220
3393
|
// src/toast/context.tsx
|
|
3221
|
-
import { createContext as
|
|
3222
|
-
var ToastStoreCtx =
|
|
3394
|
+
import { createContext as createContext20, useContext as useContext20 } from "react";
|
|
3395
|
+
var ToastStoreCtx = createContext20(null);
|
|
3223
3396
|
function useToastStore() {
|
|
3224
|
-
const ctx =
|
|
3397
|
+
const ctx = useContext20(ToastStoreCtx);
|
|
3225
3398
|
if (!ctx) {
|
|
3226
3399
|
throw new Error("useToast must be used within Toast.Provider");
|
|
3227
3400
|
}
|
|
@@ -3229,12 +3402,12 @@ function useToastStore() {
|
|
|
3229
3402
|
}
|
|
3230
3403
|
|
|
3231
3404
|
// src/toast/toast-item.tsx
|
|
3232
|
-
import { forwardRef as
|
|
3233
|
-
import { jsx as
|
|
3234
|
-
var ToastItem =
|
|
3405
|
+
import { forwardRef as forwardRef27 } from "react";
|
|
3406
|
+
import { jsx as jsx28, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
3407
|
+
var ToastItem = forwardRef27(function ToastItem2({ item, onExited, className, ...rest }, ref) {
|
|
3235
3408
|
const { id, title, description, durationMs } = item;
|
|
3236
3409
|
return /* @__PURE__ */ jsxs4(
|
|
3237
|
-
|
|
3410
|
+
Root21,
|
|
3238
3411
|
{
|
|
3239
3412
|
ref,
|
|
3240
3413
|
className,
|
|
@@ -3245,16 +3418,16 @@ var ToastItem = forwardRef25(function ToastItem2({ item, onExited, className, ..
|
|
|
3245
3418
|
},
|
|
3246
3419
|
...rest,
|
|
3247
3420
|
children: [
|
|
3248
|
-
title ? /* @__PURE__ */
|
|
3249
|
-
description ? /* @__PURE__ */
|
|
3250
|
-
/* @__PURE__ */
|
|
3421
|
+
title ? /* @__PURE__ */ jsx28(Title3, { children: title }) : null,
|
|
3422
|
+
description ? /* @__PURE__ */ jsx28(Description2, { children: description }) : null,
|
|
3423
|
+
/* @__PURE__ */ jsx28(CloseTrigger3, {})
|
|
3251
3424
|
]
|
|
3252
3425
|
}
|
|
3253
3426
|
);
|
|
3254
3427
|
});
|
|
3255
3428
|
|
|
3256
3429
|
// src/toast/provider.tsx
|
|
3257
|
-
import { jsx as
|
|
3430
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3258
3431
|
var PLACEMENT_ATTR = {
|
|
3259
3432
|
"top-start": "top-start",
|
|
3260
3433
|
"top-end": "top-end",
|
|
@@ -3285,11 +3458,11 @@ function ToastProvider({ children, limit = 5 }) {
|
|
|
3285
3458
|
},
|
|
3286
3459
|
[limit]
|
|
3287
3460
|
);
|
|
3288
|
-
const value =
|
|
3461
|
+
const value = useMemo20(
|
|
3289
3462
|
() => ({ items, publish, dismiss, dismissAll }),
|
|
3290
3463
|
[items, publish, dismiss, dismissAll]
|
|
3291
3464
|
);
|
|
3292
|
-
return /* @__PURE__ */
|
|
3465
|
+
return /* @__PURE__ */ jsx29(ToastStoreCtx.Provider, { value, children });
|
|
3293
3466
|
}
|
|
3294
3467
|
function ToastViewport({ placement = "bottom-end", className, ...rest }) {
|
|
3295
3468
|
const { items, dismiss } = useToastStore();
|
|
@@ -3299,11 +3472,11 @@ function ToastViewport({ placement = "bottom-end", className, ...rest }) {
|
|
|
3299
3472
|
}, []);
|
|
3300
3473
|
if (!mounted) return null;
|
|
3301
3474
|
return createPortal2(
|
|
3302
|
-
/* @__PURE__ */
|
|
3475
|
+
/* @__PURE__ */ jsx29(
|
|
3303
3476
|
"div",
|
|
3304
3477
|
{
|
|
3305
3478
|
...mergeProps(
|
|
3306
|
-
|
|
3479
|
+
partAttrs24(toastAnatomy2.scope, toastAnatomy2.viewport, {
|
|
3307
3480
|
state: items.length > 0 ? "active" : "idle"
|
|
3308
3481
|
}),
|
|
3309
3482
|
{
|
|
@@ -3312,7 +3485,7 @@ function ToastViewport({ placement = "bottom-end", className, ...rest }) {
|
|
|
3312
3485
|
rest
|
|
3313
3486
|
),
|
|
3314
3487
|
className,
|
|
3315
|
-
children: items.map((item) => /* @__PURE__ */
|
|
3488
|
+
children: items.map((item) => /* @__PURE__ */ jsx29(ToastItem, { item, onExited: dismiss }, item.id))
|
|
3316
3489
|
}
|
|
3317
3490
|
),
|
|
3318
3491
|
document.body
|
|
@@ -3327,28 +3500,28 @@ function useToast() {
|
|
|
3327
3500
|
var Toast = {
|
|
3328
3501
|
Provider: ToastProvider,
|
|
3329
3502
|
Viewport: ToastViewport,
|
|
3330
|
-
Root:
|
|
3331
|
-
Title:
|
|
3503
|
+
Root: Root21,
|
|
3504
|
+
Title: Title3,
|
|
3332
3505
|
Description: Description2,
|
|
3333
3506
|
CloseTrigger: CloseTrigger3,
|
|
3334
3507
|
Show
|
|
3335
3508
|
};
|
|
3336
3509
|
|
|
3337
3510
|
// src/theme-switcher/index.tsx
|
|
3338
|
-
import { partAttrs as
|
|
3511
|
+
import { partAttrs as partAttrs25, scopeAttrs as scopeAttrs4, themeSwitcherAnatomy } from "@aeon-ui/core";
|
|
3339
3512
|
import {
|
|
3340
3513
|
applyAeonTheme,
|
|
3341
3514
|
initAeonTheme
|
|
3342
3515
|
} from "@aeon-ui/core";
|
|
3343
3516
|
import {
|
|
3344
|
-
createContext as
|
|
3345
|
-
forwardRef as
|
|
3346
|
-
useContext as
|
|
3517
|
+
createContext as createContext21,
|
|
3518
|
+
forwardRef as forwardRef28,
|
|
3519
|
+
useContext as useContext21,
|
|
3347
3520
|
useLayoutEffect as useLayoutEffect2,
|
|
3348
3521
|
useState as useState9
|
|
3349
3522
|
} from "react";
|
|
3350
|
-
import { jsx as
|
|
3351
|
-
var
|
|
3523
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
3524
|
+
var Root22 = forwardRef28(
|
|
3352
3525
|
function ThemeSwitcherRoot({ defaultTheme, defaultMode, onThemeChange, children, ...rest }, ref) {
|
|
3353
3526
|
const [themeId, setThemeId] = useState9(defaultTheme ?? "default");
|
|
3354
3527
|
const [mode, setMode] = useState9(defaultMode ?? "dark");
|
|
@@ -3367,15 +3540,15 @@ var Root20 = forwardRef26(
|
|
|
3367
3540
|
applyAeonTheme(themeId, next);
|
|
3368
3541
|
onThemeChange?.(themeId, next);
|
|
3369
3542
|
};
|
|
3370
|
-
return /* @__PURE__ */
|
|
3543
|
+
return /* @__PURE__ */ jsx30(
|
|
3371
3544
|
"div",
|
|
3372
3545
|
{
|
|
3373
3546
|
ref,
|
|
3374
3547
|
...mergeProps(
|
|
3375
|
-
|
|
3548
|
+
scopeAttrs4(themeSwitcherAnatomy.scope, themeSwitcherAnatomy.root),
|
|
3376
3549
|
rest
|
|
3377
3550
|
),
|
|
3378
|
-
children: /* @__PURE__ */
|
|
3551
|
+
children: /* @__PURE__ */ jsx30(
|
|
3379
3552
|
ThemeSwitcherContext.Provider,
|
|
3380
3553
|
{
|
|
3381
3554
|
value: { themeId, mode, handleThemeChange, handleModeChange },
|
|
@@ -3386,32 +3559,32 @@ var Root20 = forwardRef26(
|
|
|
3386
3559
|
);
|
|
3387
3560
|
}
|
|
3388
3561
|
);
|
|
3389
|
-
var ThemeSwitcherContext =
|
|
3562
|
+
var ThemeSwitcherContext = createContext21(null);
|
|
3390
3563
|
function useThemeSwitcher() {
|
|
3391
|
-
const ctx =
|
|
3564
|
+
const ctx = useContext21(ThemeSwitcherContext);
|
|
3392
3565
|
if (!ctx) throw new Error("ThemeSwitcher parts must be used inside <ThemeSwitcher.Root>");
|
|
3393
3566
|
return ctx;
|
|
3394
3567
|
}
|
|
3395
|
-
var Modes =
|
|
3568
|
+
var Modes = forwardRef28(
|
|
3396
3569
|
function ThemeSwitcherModes(props, ref) {
|
|
3397
|
-
return /* @__PURE__ */
|
|
3570
|
+
return /* @__PURE__ */ jsx30(
|
|
3398
3571
|
"div",
|
|
3399
3572
|
{
|
|
3400
3573
|
ref,
|
|
3401
3574
|
role: "group",
|
|
3402
3575
|
"aria-label": "Color mode",
|
|
3403
3576
|
...mergeProps(
|
|
3404
|
-
|
|
3577
|
+
partAttrs25(themeSwitcherAnatomy.scope, themeSwitcherAnatomy.modes),
|
|
3405
3578
|
props
|
|
3406
3579
|
)
|
|
3407
3580
|
}
|
|
3408
3581
|
);
|
|
3409
3582
|
}
|
|
3410
3583
|
);
|
|
3411
|
-
var ModeBtn =
|
|
3584
|
+
var ModeBtn = forwardRef28(
|
|
3412
3585
|
function ThemeSwitcherModeBtn({ mode, active, ...rest }, ref) {
|
|
3413
3586
|
const { handleModeChange } = useThemeSwitcher();
|
|
3414
|
-
return /* @__PURE__ */
|
|
3587
|
+
return /* @__PURE__ */ jsx30(
|
|
3415
3588
|
"button",
|
|
3416
3589
|
{
|
|
3417
3590
|
ref,
|
|
@@ -3419,7 +3592,7 @@ var ModeBtn = forwardRef26(
|
|
|
3419
3592
|
"aria-pressed": active,
|
|
3420
3593
|
"data-active": active ? "true" : void 0,
|
|
3421
3594
|
...mergeProps(
|
|
3422
|
-
|
|
3595
|
+
partAttrs25(themeSwitcherAnatomy.scope, themeSwitcherAnatomy.modeBtn),
|
|
3423
3596
|
rest
|
|
3424
3597
|
),
|
|
3425
3598
|
onClick: (e) => {
|
|
@@ -3431,14 +3604,14 @@ var ModeBtn = forwardRef26(
|
|
|
3431
3604
|
);
|
|
3432
3605
|
}
|
|
3433
3606
|
);
|
|
3434
|
-
var ThemeSelect =
|
|
3607
|
+
var ThemeSelect = forwardRef28(
|
|
3435
3608
|
function ThemeSwitcherThemeSelect({ children, ...rest }, ref) {
|
|
3436
|
-
return /* @__PURE__ */
|
|
3609
|
+
return /* @__PURE__ */ jsx30(
|
|
3437
3610
|
"div",
|
|
3438
3611
|
{
|
|
3439
3612
|
ref,
|
|
3440
3613
|
...mergeProps(
|
|
3441
|
-
|
|
3614
|
+
partAttrs25(themeSwitcherAnatomy.scope, themeSwitcherAnatomy.themeSelect),
|
|
3442
3615
|
rest
|
|
3443
3616
|
),
|
|
3444
3617
|
children
|
|
@@ -3446,17 +3619,17 @@ var ThemeSelect = forwardRef26(
|
|
|
3446
3619
|
);
|
|
3447
3620
|
}
|
|
3448
3621
|
);
|
|
3449
|
-
var ThemeTrigger =
|
|
3622
|
+
var ThemeTrigger = forwardRef28(
|
|
3450
3623
|
function ThemeSwitcherThemeTrigger(props, ref) {
|
|
3451
3624
|
const { themeId } = useThemeSwitcher();
|
|
3452
|
-
return /* @__PURE__ */
|
|
3625
|
+
return /* @__PURE__ */ jsx30(
|
|
3453
3626
|
"button",
|
|
3454
3627
|
{
|
|
3455
3628
|
ref,
|
|
3456
3629
|
type: "button",
|
|
3457
3630
|
"aria-label": `Theme preset: ${themeId}`,
|
|
3458
3631
|
...mergeProps(
|
|
3459
|
-
|
|
3632
|
+
partAttrs25(themeSwitcherAnatomy.scope, themeSwitcherAnatomy.themeTrigger),
|
|
3460
3633
|
props
|
|
3461
3634
|
),
|
|
3462
3635
|
children: props.children ?? themeId
|
|
@@ -3465,7 +3638,7 @@ var ThemeTrigger = forwardRef26(
|
|
|
3465
3638
|
}
|
|
3466
3639
|
);
|
|
3467
3640
|
var ThemeSwitcher = {
|
|
3468
|
-
Root:
|
|
3641
|
+
Root: Root22,
|
|
3469
3642
|
Modes,
|
|
3470
3643
|
ModeBtn,
|
|
3471
3644
|
ThemeSelect,
|
|
@@ -3473,40 +3646,43 @@ var ThemeSwitcher = {
|
|
|
3473
3646
|
};
|
|
3474
3647
|
|
|
3475
3648
|
// src/avatar/index.tsx
|
|
3476
|
-
import { avatarAnatomy, partAttrs as
|
|
3649
|
+
import { avatarAnatomy, partAttrs as partAttrs26 } from "@aeon-ui/core";
|
|
3477
3650
|
import {
|
|
3478
|
-
createContext as
|
|
3479
|
-
forwardRef as
|
|
3651
|
+
createContext as createContext22,
|
|
3652
|
+
forwardRef as forwardRef29,
|
|
3480
3653
|
useCallback as useCallback9,
|
|
3481
|
-
useContext as
|
|
3654
|
+
useContext as useContext22,
|
|
3482
3655
|
useEffect as useEffect21,
|
|
3483
|
-
useMemo as
|
|
3656
|
+
useMemo as useMemo21,
|
|
3484
3657
|
useState as useState10
|
|
3485
3658
|
} from "react";
|
|
3486
|
-
import { jsx as
|
|
3487
|
-
var AvatarCtx =
|
|
3659
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
3660
|
+
var AvatarCtx = createContext22(null);
|
|
3488
3661
|
function useAvatarCtx() {
|
|
3489
|
-
const ctx =
|
|
3662
|
+
const ctx = useContext22(AvatarCtx);
|
|
3490
3663
|
if (!ctx) throw new Error("Avatar parts must be used within Avatar.Root");
|
|
3491
3664
|
return ctx;
|
|
3492
3665
|
}
|
|
3493
|
-
var
|
|
3666
|
+
var Root23 = forwardRef29(function AvatarRoot({ children, className, ...rest }, ref) {
|
|
3494
3667
|
const [status, setStatus] = useState10("idle");
|
|
3495
|
-
const value =
|
|
3496
|
-
return /* @__PURE__ */
|
|
3668
|
+
const value = useMemo21(() => ({ status, setStatus }), [status]);
|
|
3669
|
+
return /* @__PURE__ */ jsx31(AvatarCtx.Provider, { value, children: /* @__PURE__ */ jsx31(
|
|
3497
3670
|
"span",
|
|
3498
3671
|
{
|
|
3499
3672
|
ref,
|
|
3500
3673
|
className,
|
|
3501
3674
|
...mergeProps(
|
|
3502
|
-
|
|
3675
|
+
partAttrs26(avatarAnatomy.scope, avatarAnatomy.root, {
|
|
3676
|
+
// `ready` alias keeps product CSS friendly; `loaded` stays for existing recipes.
|
|
3677
|
+
state: status === "loaded" ? "loaded ready" : status
|
|
3678
|
+
}),
|
|
3503
3679
|
rest
|
|
3504
3680
|
),
|
|
3505
3681
|
children
|
|
3506
3682
|
}
|
|
3507
3683
|
) });
|
|
3508
3684
|
});
|
|
3509
|
-
var Image =
|
|
3685
|
+
var Image = forwardRef29(function AvatarImage({ src, alt, onLoad, onError, className, ...rest }, ref) {
|
|
3510
3686
|
const { status, setStatus } = useAvatarCtx();
|
|
3511
3687
|
useEffect21(() => {
|
|
3512
3688
|
if (!src) setStatus("idle");
|
|
@@ -3526,244 +3702,244 @@ var Image = forwardRef27(function AvatarImage({ src, alt, onLoad, onError, class
|
|
|
3526
3702
|
},
|
|
3527
3703
|
[onError, setStatus]
|
|
3528
3704
|
);
|
|
3529
|
-
return /* @__PURE__ */
|
|
3705
|
+
return /* @__PURE__ */ jsx31(
|
|
3530
3706
|
"img",
|
|
3531
3707
|
{
|
|
3532
3708
|
ref,
|
|
3533
3709
|
src,
|
|
3534
3710
|
alt,
|
|
3535
3711
|
hidden: status !== "loaded",
|
|
3536
|
-
...
|
|
3712
|
+
...partAttrs26(avatarAnatomy.scope, avatarAnatomy.image, { state: status }),
|
|
3537
3713
|
className,
|
|
3538
3714
|
...mergeProps(rest, { onLoad: handleLoad, onError: handleError })
|
|
3539
3715
|
}
|
|
3540
3716
|
);
|
|
3541
3717
|
});
|
|
3542
|
-
var Fallback =
|
|
3718
|
+
var Fallback = forwardRef29(function AvatarFallback({ className, ...rest }, ref) {
|
|
3543
3719
|
const { status } = useAvatarCtx();
|
|
3544
3720
|
const show = status !== "loaded";
|
|
3545
|
-
return /* @__PURE__ */
|
|
3721
|
+
return /* @__PURE__ */ jsx31(
|
|
3546
3722
|
"span",
|
|
3547
3723
|
{
|
|
3548
3724
|
ref,
|
|
3549
3725
|
hidden: !show,
|
|
3550
|
-
...
|
|
3726
|
+
...partAttrs26(avatarAnatomy.scope, avatarAnatomy.fallback, { state: status }),
|
|
3551
3727
|
className,
|
|
3552
3728
|
...rest
|
|
3553
3729
|
}
|
|
3554
3730
|
);
|
|
3555
3731
|
});
|
|
3556
|
-
var Badge =
|
|
3732
|
+
var Badge = forwardRef29(function AvatarBadge({ presence = "idle", className, ...rest }, ref) {
|
|
3557
3733
|
useAvatarCtx();
|
|
3558
|
-
return /* @__PURE__ */
|
|
3734
|
+
return /* @__PURE__ */ jsx31(
|
|
3559
3735
|
"span",
|
|
3560
3736
|
{
|
|
3561
3737
|
ref,
|
|
3562
3738
|
"data-aeon-presence": presence,
|
|
3563
|
-
...
|
|
3739
|
+
...partAttrs26(avatarAnatomy.scope, avatarAnatomy.badge, { state: presence }),
|
|
3564
3740
|
className,
|
|
3565
3741
|
...rest
|
|
3566
3742
|
}
|
|
3567
3743
|
);
|
|
3568
3744
|
});
|
|
3569
3745
|
var Avatar = {
|
|
3570
|
-
Root:
|
|
3746
|
+
Root: Root23,
|
|
3571
3747
|
Image,
|
|
3572
3748
|
Fallback,
|
|
3573
3749
|
Badge
|
|
3574
3750
|
};
|
|
3575
3751
|
|
|
3576
3752
|
// src/identity/index.tsx
|
|
3577
|
-
import { identityAnatomy, partAttrs as
|
|
3578
|
-
import { createContext as
|
|
3579
|
-
import { jsx as
|
|
3580
|
-
var IdentityCtx =
|
|
3753
|
+
import { identityAnatomy, partAttrs as partAttrs27, scopeAttrs as scopeAttrs5 } from "@aeon-ui/core";
|
|
3754
|
+
import { createContext as createContext23, forwardRef as forwardRef30, useContext as useContext23 } from "react";
|
|
3755
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3756
|
+
var IdentityCtx = createContext23(null);
|
|
3581
3757
|
function useIdentityCtx() {
|
|
3582
|
-
const ctx =
|
|
3758
|
+
const ctx = useContext23(IdentityCtx);
|
|
3583
3759
|
if (!ctx) throw new Error("Identity parts must be used within Identity.Root");
|
|
3584
3760
|
return ctx;
|
|
3585
3761
|
}
|
|
3586
|
-
var
|
|
3587
|
-
return /* @__PURE__ */
|
|
3762
|
+
var Root24 = forwardRef30(function IdentityRoot({ as: Tag = "div", size = "md", children, ...rest }, ref) {
|
|
3763
|
+
return /* @__PURE__ */ jsx32(IdentityCtx.Provider, { value: { size }, children: /* @__PURE__ */ jsx32(
|
|
3588
3764
|
Tag,
|
|
3589
3765
|
{
|
|
3590
3766
|
ref,
|
|
3591
3767
|
"data-aeon-size": size,
|
|
3592
|
-
...mergeProps(
|
|
3768
|
+
...mergeProps(scopeAttrs5(identityAnatomy.scope, identityAnatomy.root), rest),
|
|
3593
3769
|
children
|
|
3594
3770
|
}
|
|
3595
3771
|
) });
|
|
3596
3772
|
});
|
|
3597
|
-
var AvatarSlot =
|
|
3773
|
+
var AvatarSlot = forwardRef30(
|
|
3598
3774
|
function IdentityAvatar(props, ref) {
|
|
3599
3775
|
useIdentityCtx();
|
|
3600
|
-
return /* @__PURE__ */
|
|
3776
|
+
return /* @__PURE__ */ jsx32(
|
|
3601
3777
|
"span",
|
|
3602
3778
|
{
|
|
3603
3779
|
ref,
|
|
3604
|
-
...mergeProps(
|
|
3780
|
+
...mergeProps(partAttrs27(identityAnatomy.scope, identityAnatomy.avatar), props)
|
|
3605
3781
|
}
|
|
3606
3782
|
);
|
|
3607
3783
|
}
|
|
3608
3784
|
);
|
|
3609
|
-
var
|
|
3785
|
+
var Title4 = forwardRef30(function IdentityTitle(props, ref) {
|
|
3610
3786
|
useIdentityCtx();
|
|
3611
|
-
return /* @__PURE__ */
|
|
3787
|
+
return /* @__PURE__ */ jsx32(
|
|
3612
3788
|
"span",
|
|
3613
3789
|
{
|
|
3614
3790
|
ref,
|
|
3615
|
-
...mergeProps(
|
|
3791
|
+
...mergeProps(partAttrs27(identityAnatomy.scope, identityAnatomy.title), props)
|
|
3616
3792
|
}
|
|
3617
3793
|
);
|
|
3618
3794
|
});
|
|
3619
|
-
var Subtitle =
|
|
3795
|
+
var Subtitle = forwardRef30(
|
|
3620
3796
|
function IdentitySubtitle(props, ref) {
|
|
3621
3797
|
useIdentityCtx();
|
|
3622
|
-
return /* @__PURE__ */
|
|
3798
|
+
return /* @__PURE__ */ jsx32(
|
|
3623
3799
|
"span",
|
|
3624
3800
|
{
|
|
3625
3801
|
ref,
|
|
3626
|
-
...mergeProps(
|
|
3802
|
+
...mergeProps(partAttrs27(identityAnatomy.scope, identityAnatomy.subtitle), props)
|
|
3627
3803
|
}
|
|
3628
3804
|
);
|
|
3629
3805
|
}
|
|
3630
3806
|
);
|
|
3631
|
-
var
|
|
3807
|
+
var Meta2 = forwardRef30(function IdentityMeta(props, ref) {
|
|
3632
3808
|
useIdentityCtx();
|
|
3633
|
-
return /* @__PURE__ */
|
|
3809
|
+
return /* @__PURE__ */ jsx32("span", { ref, ...mergeProps(partAttrs27(identityAnatomy.scope, identityAnatomy.meta), props) });
|
|
3634
3810
|
});
|
|
3635
|
-
var Trailing =
|
|
3811
|
+
var Trailing = forwardRef30(
|
|
3636
3812
|
function IdentityTrailing(props, ref) {
|
|
3637
3813
|
useIdentityCtx();
|
|
3638
|
-
return /* @__PURE__ */
|
|
3814
|
+
return /* @__PURE__ */ jsx32(
|
|
3639
3815
|
"span",
|
|
3640
3816
|
{
|
|
3641
3817
|
ref,
|
|
3642
|
-
...mergeProps(
|
|
3818
|
+
...mergeProps(partAttrs27(identityAnatomy.scope, identityAnatomy.trailing), props)
|
|
3643
3819
|
}
|
|
3644
3820
|
);
|
|
3645
3821
|
}
|
|
3646
3822
|
);
|
|
3647
3823
|
var Identity = {
|
|
3648
|
-
Root:
|
|
3824
|
+
Root: Root24,
|
|
3649
3825
|
Avatar: AvatarSlot,
|
|
3650
|
-
Title:
|
|
3826
|
+
Title: Title4,
|
|
3651
3827
|
Subtitle,
|
|
3652
|
-
Meta,
|
|
3828
|
+
Meta: Meta2,
|
|
3653
3829
|
Trailing
|
|
3654
3830
|
};
|
|
3655
3831
|
|
|
3656
3832
|
// src/metric-strip/index.tsx
|
|
3657
|
-
import { metricStripAnatomy, partAttrs as
|
|
3658
|
-
import { createContext as
|
|
3659
|
-
import { jsx as
|
|
3660
|
-
var MetricCtx =
|
|
3833
|
+
import { metricStripAnatomy, partAttrs as partAttrs28, scopeAttrs as scopeAttrs6 } from "@aeon-ui/core";
|
|
3834
|
+
import { createContext as createContext24, forwardRef as forwardRef31, useContext as useContext24 } from "react";
|
|
3835
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
3836
|
+
var MetricCtx = createContext24(null);
|
|
3661
3837
|
function useMetricCtx() {
|
|
3662
|
-
const ctx =
|
|
3838
|
+
const ctx = useContext24(MetricCtx);
|
|
3663
3839
|
if (!ctx) throw new Error("MetricStrip parts must be used within MetricStrip.Root");
|
|
3664
3840
|
return ctx;
|
|
3665
3841
|
}
|
|
3666
|
-
var
|
|
3667
|
-
return /* @__PURE__ */
|
|
3842
|
+
var Root25 = forwardRef31(function MetricStripRoot({ density = "cluster", children, ...rest }, ref) {
|
|
3843
|
+
return /* @__PURE__ */ jsx33(MetricCtx.Provider, { value: { density }, children: /* @__PURE__ */ jsx33(
|
|
3668
3844
|
"div",
|
|
3669
3845
|
{
|
|
3670
3846
|
ref,
|
|
3671
3847
|
"data-aeon-density": density,
|
|
3672
3848
|
role: "group",
|
|
3673
|
-
...mergeProps(
|
|
3849
|
+
...mergeProps(scopeAttrs6(metricStripAnatomy.scope, metricStripAnatomy.root), rest),
|
|
3674
3850
|
children
|
|
3675
3851
|
}
|
|
3676
3852
|
) });
|
|
3677
3853
|
});
|
|
3678
|
-
var Chip =
|
|
3854
|
+
var Chip = forwardRef31(function MetricChip(props, ref) {
|
|
3679
3855
|
useMetricCtx();
|
|
3680
|
-
return /* @__PURE__ */
|
|
3856
|
+
return /* @__PURE__ */ jsx33(
|
|
3681
3857
|
"span",
|
|
3682
3858
|
{
|
|
3683
3859
|
ref,
|
|
3684
|
-
...mergeProps(
|
|
3860
|
+
...mergeProps(partAttrs28(metricStripAnatomy.scope, metricStripAnatomy.chip), props)
|
|
3685
3861
|
}
|
|
3686
3862
|
);
|
|
3687
3863
|
});
|
|
3688
|
-
var Value =
|
|
3864
|
+
var Value = forwardRef31(function MetricValue(props, ref) {
|
|
3689
3865
|
useMetricCtx();
|
|
3690
|
-
return /* @__PURE__ */
|
|
3866
|
+
return /* @__PURE__ */ jsx33(
|
|
3691
3867
|
"span",
|
|
3692
3868
|
{
|
|
3693
3869
|
ref,
|
|
3694
|
-
...mergeProps(
|
|
3870
|
+
...mergeProps(partAttrs28(metricStripAnatomy.scope, metricStripAnatomy.value), props)
|
|
3695
3871
|
}
|
|
3696
3872
|
);
|
|
3697
3873
|
});
|
|
3698
|
-
var Label6 =
|
|
3874
|
+
var Label6 = forwardRef31(function MetricLabel(props, ref) {
|
|
3699
3875
|
useMetricCtx();
|
|
3700
|
-
return /* @__PURE__ */
|
|
3876
|
+
return /* @__PURE__ */ jsx33(
|
|
3701
3877
|
"span",
|
|
3702
3878
|
{
|
|
3703
3879
|
ref,
|
|
3704
|
-
...mergeProps(
|
|
3880
|
+
...mergeProps(partAttrs28(metricStripAnatomy.scope, metricStripAnatomy.label), props)
|
|
3705
3881
|
}
|
|
3706
3882
|
);
|
|
3707
3883
|
});
|
|
3708
3884
|
var MetricStrip = {
|
|
3709
|
-
Root:
|
|
3885
|
+
Root: Root25,
|
|
3710
3886
|
Chip,
|
|
3711
3887
|
Value,
|
|
3712
3888
|
Label: Label6
|
|
3713
3889
|
};
|
|
3714
3890
|
|
|
3715
3891
|
// src/list-row/index.tsx
|
|
3716
|
-
import { listRowAnatomy, partAttrs as
|
|
3717
|
-
import { forwardRef as
|
|
3718
|
-
import { jsx as
|
|
3719
|
-
var
|
|
3892
|
+
import { listRowAnatomy, partAttrs as partAttrs29, scopeAttrs as scopeAttrs7 } from "@aeon-ui/core";
|
|
3893
|
+
import { forwardRef as forwardRef32 } from "react";
|
|
3894
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
3895
|
+
var Root26 = forwardRef32(function ListRowRoot({ as: Tag = "button", type, children, ...rest }, ref) {
|
|
3720
3896
|
const buttonType = Tag === "button" ? type ?? "button" : void 0;
|
|
3721
|
-
return /* @__PURE__ */
|
|
3897
|
+
return /* @__PURE__ */ jsx34(
|
|
3722
3898
|
Tag,
|
|
3723
3899
|
{
|
|
3724
3900
|
ref,
|
|
3725
3901
|
type: buttonType,
|
|
3726
|
-
...mergeProps(
|
|
3902
|
+
...mergeProps(scopeAttrs7(listRowAnatomy.scope, listRowAnatomy.root), rest),
|
|
3727
3903
|
children
|
|
3728
3904
|
}
|
|
3729
3905
|
);
|
|
3730
3906
|
});
|
|
3731
|
-
var Leading =
|
|
3732
|
-
return /* @__PURE__ */
|
|
3907
|
+
var Leading = forwardRef32(function ListRowLeading(props, ref) {
|
|
3908
|
+
return /* @__PURE__ */ jsx34(
|
|
3733
3909
|
"span",
|
|
3734
3910
|
{
|
|
3735
3911
|
ref,
|
|
3736
|
-
...mergeProps(
|
|
3912
|
+
...mergeProps(partAttrs29(listRowAnatomy.scope, listRowAnatomy.leading), props)
|
|
3737
3913
|
}
|
|
3738
3914
|
);
|
|
3739
3915
|
});
|
|
3740
|
-
var Label7 =
|
|
3741
|
-
return /* @__PURE__ */
|
|
3916
|
+
var Label7 = forwardRef32(function ListRowLabel(props, ref) {
|
|
3917
|
+
return /* @__PURE__ */ jsx34("span", { ref, ...mergeProps(partAttrs29(listRowAnatomy.scope, listRowAnatomy.label), props) });
|
|
3742
3918
|
});
|
|
3743
|
-
var Description3 =
|
|
3919
|
+
var Description3 = forwardRef32(
|
|
3744
3920
|
function ListRowDescription(props, ref) {
|
|
3745
|
-
return /* @__PURE__ */
|
|
3921
|
+
return /* @__PURE__ */ jsx34(
|
|
3746
3922
|
"span",
|
|
3747
3923
|
{
|
|
3748
3924
|
ref,
|
|
3749
|
-
...mergeProps(
|
|
3925
|
+
...mergeProps(partAttrs29(listRowAnatomy.scope, listRowAnatomy.description), props)
|
|
3750
3926
|
}
|
|
3751
3927
|
);
|
|
3752
3928
|
}
|
|
3753
3929
|
);
|
|
3754
|
-
var Trailing2 =
|
|
3930
|
+
var Trailing2 = forwardRef32(
|
|
3755
3931
|
function ListRowTrailing(props, ref) {
|
|
3756
|
-
return /* @__PURE__ */
|
|
3932
|
+
return /* @__PURE__ */ jsx34(
|
|
3757
3933
|
"span",
|
|
3758
3934
|
{
|
|
3759
3935
|
ref,
|
|
3760
|
-
...mergeProps(
|
|
3936
|
+
...mergeProps(partAttrs29(listRowAnatomy.scope, listRowAnatomy.trailing), props)
|
|
3761
3937
|
}
|
|
3762
3938
|
);
|
|
3763
3939
|
}
|
|
3764
3940
|
);
|
|
3765
3941
|
var ListRow = {
|
|
3766
|
-
Root:
|
|
3942
|
+
Root: Root26,
|
|
3767
3943
|
Leading,
|
|
3768
3944
|
Label: Label7,
|
|
3769
3945
|
Description: Description3,
|
|
@@ -3771,37 +3947,37 @@ var ListRow = {
|
|
|
3771
3947
|
};
|
|
3772
3948
|
|
|
3773
3949
|
// src/entry/index.tsx
|
|
3774
|
-
import { entryAnatomy, partAttrs as
|
|
3775
|
-
import { forwardRef as
|
|
3776
|
-
import { jsx as
|
|
3777
|
-
var List2 =
|
|
3778
|
-
return /* @__PURE__ */
|
|
3950
|
+
import { entryAnatomy, partAttrs as partAttrs30, scopeAttrs as scopeAttrs8 } from "@aeon-ui/core";
|
|
3951
|
+
import { forwardRef as forwardRef33 } from "react";
|
|
3952
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3953
|
+
var List2 = forwardRef33(function EntryList({ children, ...rest }, ref) {
|
|
3954
|
+
return /* @__PURE__ */ jsx35(
|
|
3779
3955
|
"div",
|
|
3780
3956
|
{
|
|
3781
3957
|
ref,
|
|
3782
|
-
...mergeProps(
|
|
3958
|
+
...mergeProps(scopeAttrs8(entryAnatomy.scope, entryAnatomy.list), rest),
|
|
3783
3959
|
children
|
|
3784
3960
|
}
|
|
3785
3961
|
);
|
|
3786
3962
|
});
|
|
3787
|
-
var
|
|
3788
|
-
return /* @__PURE__ */
|
|
3963
|
+
var Root27 = forwardRef33(function EntryRoot({ as: Tag = "article", state = "idle", children, ...rest }, ref) {
|
|
3964
|
+
return /* @__PURE__ */ jsx35(
|
|
3789
3965
|
Tag,
|
|
3790
3966
|
{
|
|
3791
3967
|
ref,
|
|
3792
|
-
...mergeProps(
|
|
3968
|
+
...mergeProps(scopeAttrs8(entryAnatomy.scope, entryAnatomy.root, { state }), rest),
|
|
3793
3969
|
children
|
|
3794
3970
|
}
|
|
3795
3971
|
);
|
|
3796
3972
|
});
|
|
3797
3973
|
function Part(part, displayName, defaultTag = "div") {
|
|
3798
|
-
const Comp =
|
|
3974
|
+
const Comp = forwardRef33(
|
|
3799
3975
|
function EntryPart({ as: Tag = defaultTag, ...props }, ref) {
|
|
3800
|
-
return /* @__PURE__ */
|
|
3976
|
+
return /* @__PURE__ */ jsx35(
|
|
3801
3977
|
Tag,
|
|
3802
3978
|
{
|
|
3803
3979
|
ref,
|
|
3804
|
-
...mergeProps(
|
|
3980
|
+
...mergeProps(partAttrs30(entryAnatomy.scope, part), props)
|
|
3805
3981
|
}
|
|
3806
3982
|
);
|
|
3807
3983
|
}
|
|
@@ -3811,7 +3987,7 @@ function Part(part, displayName, defaultTag = "div") {
|
|
|
3811
3987
|
}
|
|
3812
3988
|
var Entry = {
|
|
3813
3989
|
List: List2,
|
|
3814
|
-
Root:
|
|
3990
|
+
Root: Root27,
|
|
3815
3991
|
Header: Part(entryAnatomy.header, "Entry.Header", "header"),
|
|
3816
3992
|
Leading: Part(entryAnatomy.leading, "Entry.Leading", "div"),
|
|
3817
3993
|
Heading: Part(entryAnatomy.heading, "Entry.Heading", "div"),
|
|
@@ -3827,28 +4003,28 @@ var Entry = {
|
|
|
3827
4003
|
};
|
|
3828
4004
|
|
|
3829
4005
|
// src/conversation/index.tsx
|
|
3830
|
-
import { conversationAnatomy, partAttrs as
|
|
3831
|
-
import { forwardRef as
|
|
3832
|
-
import { jsx as
|
|
3833
|
-
var
|
|
3834
|
-
return /* @__PURE__ */
|
|
4006
|
+
import { conversationAnatomy, partAttrs as partAttrs31, scopeAttrs as scopeAttrs9 } from "@aeon-ui/core";
|
|
4007
|
+
import { forwardRef as forwardRef34 } from "react";
|
|
4008
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
4009
|
+
var Root28 = forwardRef34(function ConversationRoot({ children, ...rest }, ref) {
|
|
4010
|
+
return /* @__PURE__ */ jsx36(
|
|
3835
4011
|
"div",
|
|
3836
4012
|
{
|
|
3837
4013
|
ref,
|
|
3838
|
-
...mergeProps(
|
|
4014
|
+
...mergeProps(scopeAttrs9(conversationAnatomy.scope, conversationAnatomy.root), rest),
|
|
3839
4015
|
children
|
|
3840
4016
|
}
|
|
3841
4017
|
);
|
|
3842
4018
|
});
|
|
3843
|
-
var Item6 =
|
|
4019
|
+
var Item6 = forwardRef34(function ConversationItem({ state = "idle", as: Tag = "button", type, children, ...rest }, ref) {
|
|
3844
4020
|
const buttonType = Tag === "button" ? type ?? "button" : void 0;
|
|
3845
|
-
return /* @__PURE__ */
|
|
4021
|
+
return /* @__PURE__ */ jsx36(
|
|
3846
4022
|
Tag,
|
|
3847
4023
|
{
|
|
3848
4024
|
ref,
|
|
3849
4025
|
type: buttonType,
|
|
3850
4026
|
...mergeProps(
|
|
3851
|
-
|
|
4027
|
+
partAttrs31(conversationAnatomy.scope, conversationAnatomy.item, { state }),
|
|
3852
4028
|
rest
|
|
3853
4029
|
),
|
|
3854
4030
|
children
|
|
@@ -3856,12 +4032,12 @@ var Item6 = forwardRef32(function ConversationItem({ state = "idle", as: Tag = "
|
|
|
3856
4032
|
);
|
|
3857
4033
|
});
|
|
3858
4034
|
function Part2(part, displayName) {
|
|
3859
|
-
const Comp =
|
|
3860
|
-
return /* @__PURE__ */
|
|
4035
|
+
const Comp = forwardRef34(function ConversationPart(props, ref) {
|
|
4036
|
+
return /* @__PURE__ */ jsx36(
|
|
3861
4037
|
"span",
|
|
3862
4038
|
{
|
|
3863
4039
|
ref,
|
|
3864
|
-
...mergeProps(
|
|
4040
|
+
...mergeProps(partAttrs31(conversationAnatomy.scope, part), props)
|
|
3865
4041
|
}
|
|
3866
4042
|
);
|
|
3867
4043
|
});
|
|
@@ -3869,7 +4045,7 @@ function Part2(part, displayName) {
|
|
|
3869
4045
|
return Comp;
|
|
3870
4046
|
}
|
|
3871
4047
|
var Conversation = {
|
|
3872
|
-
Root:
|
|
4048
|
+
Root: Root28,
|
|
3873
4049
|
Item: Item6,
|
|
3874
4050
|
Leading: Part2(conversationAnatomy.leading, "Conversation.Leading"),
|
|
3875
4051
|
Body: Part2(conversationAnatomy.body, "Conversation.Body"),
|
|
@@ -3880,269 +4056,269 @@ var Conversation = {
|
|
|
3880
4056
|
};
|
|
3881
4057
|
|
|
3882
4058
|
// src/thread/index.tsx
|
|
3883
|
-
import { partAttrs as
|
|
3884
|
-
import { forwardRef as
|
|
3885
|
-
import { jsx as
|
|
3886
|
-
var
|
|
3887
|
-
return /* @__PURE__ */
|
|
4059
|
+
import { partAttrs as partAttrs32, scopeAttrs as scopeAttrs10, threadAnatomy } from "@aeon-ui/core";
|
|
4060
|
+
import { forwardRef as forwardRef35 } from "react";
|
|
4061
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
4062
|
+
var Root29 = forwardRef35(function ThreadRoot({ children, ...rest }, ref) {
|
|
4063
|
+
return /* @__PURE__ */ jsx37(
|
|
3888
4064
|
"div",
|
|
3889
4065
|
{
|
|
3890
4066
|
ref,
|
|
3891
|
-
...mergeProps(
|
|
4067
|
+
...mergeProps(scopeAttrs10(threadAnatomy.scope, threadAnatomy.root), rest),
|
|
3892
4068
|
children
|
|
3893
4069
|
}
|
|
3894
4070
|
);
|
|
3895
4071
|
});
|
|
3896
|
-
var List3 =
|
|
3897
|
-
return /* @__PURE__ */
|
|
4072
|
+
var List3 = forwardRef35(function ThreadList(props, ref) {
|
|
4073
|
+
return /* @__PURE__ */ jsx37(
|
|
3898
4074
|
"div",
|
|
3899
4075
|
{
|
|
3900
4076
|
ref,
|
|
3901
4077
|
role: "log",
|
|
3902
4078
|
"aria-live": "polite",
|
|
3903
|
-
...mergeProps(
|
|
4079
|
+
...mergeProps(partAttrs32(threadAnatomy.scope, threadAnatomy.list), props)
|
|
3904
4080
|
}
|
|
3905
4081
|
);
|
|
3906
4082
|
});
|
|
3907
|
-
var Item7 =
|
|
3908
|
-
return /* @__PURE__ */
|
|
4083
|
+
var Item7 = forwardRef35(function ThreadItem({ state = "theirs", ...rest }, ref) {
|
|
4084
|
+
return /* @__PURE__ */ jsx37(
|
|
3909
4085
|
"div",
|
|
3910
4086
|
{
|
|
3911
4087
|
ref,
|
|
3912
|
-
...mergeProps(
|
|
4088
|
+
...mergeProps(partAttrs32(threadAnatomy.scope, threadAnatomy.item, { state }), rest)
|
|
3913
4089
|
}
|
|
3914
4090
|
);
|
|
3915
4091
|
});
|
|
3916
|
-
var Bubble =
|
|
3917
|
-
return /* @__PURE__ */
|
|
4092
|
+
var Bubble = forwardRef35(function ThreadBubble(props, ref) {
|
|
4093
|
+
return /* @__PURE__ */ jsx37(
|
|
3918
4094
|
"div",
|
|
3919
4095
|
{
|
|
3920
4096
|
ref,
|
|
3921
|
-
...mergeProps(
|
|
4097
|
+
...mergeProps(partAttrs32(threadAnatomy.scope, threadAnatomy.bubble), props)
|
|
3922
4098
|
}
|
|
3923
4099
|
);
|
|
3924
4100
|
});
|
|
3925
|
-
var
|
|
3926
|
-
return /* @__PURE__ */
|
|
4101
|
+
var Meta3 = forwardRef35(function ThreadMeta(props, ref) {
|
|
4102
|
+
return /* @__PURE__ */ jsx37("span", { ref, ...mergeProps(partAttrs32(threadAnatomy.scope, threadAnatomy.meta), props) });
|
|
3927
4103
|
});
|
|
3928
|
-
var Day =
|
|
3929
|
-
return /* @__PURE__ */
|
|
4104
|
+
var Day = forwardRef35(function ThreadDay(props, ref) {
|
|
4105
|
+
return /* @__PURE__ */ jsx37("div", { ref, ...mergeProps(partAttrs32(threadAnatomy.scope, threadAnatomy.day), props) });
|
|
3930
4106
|
});
|
|
3931
4107
|
var Thread = {
|
|
3932
|
-
Root:
|
|
4108
|
+
Root: Root29,
|
|
3933
4109
|
List: List3,
|
|
3934
4110
|
Item: Item7,
|
|
3935
4111
|
Bubble,
|
|
3936
|
-
Meta:
|
|
4112
|
+
Meta: Meta3,
|
|
3937
4113
|
Day
|
|
3938
4114
|
};
|
|
3939
4115
|
|
|
3940
4116
|
// src/composer/index.tsx
|
|
3941
|
-
import { composerAnatomy, partAttrs as
|
|
4117
|
+
import { composerAnatomy, partAttrs as partAttrs33, scopeAttrs as scopeAttrs11 } from "@aeon-ui/core";
|
|
3942
4118
|
import {
|
|
3943
|
-
forwardRef as
|
|
4119
|
+
forwardRef as forwardRef36
|
|
3944
4120
|
} from "react";
|
|
3945
|
-
import { jsx as
|
|
3946
|
-
var
|
|
3947
|
-
return /* @__PURE__ */
|
|
4121
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
4122
|
+
var Root30 = forwardRef36(function ComposerRoot({ state = "idle", children, ...rest }, ref) {
|
|
4123
|
+
return /* @__PURE__ */ jsx38(
|
|
3948
4124
|
"form",
|
|
3949
4125
|
{
|
|
3950
4126
|
ref,
|
|
3951
|
-
...mergeProps(
|
|
4127
|
+
...mergeProps(scopeAttrs11(composerAnatomy.scope, composerAnatomy.root, { state }), rest),
|
|
3952
4128
|
children
|
|
3953
4129
|
}
|
|
3954
4130
|
);
|
|
3955
4131
|
});
|
|
3956
|
-
var Input3 =
|
|
4132
|
+
var Input3 = forwardRef36(
|
|
3957
4133
|
function ComposerInput(props, ref) {
|
|
3958
|
-
return /* @__PURE__ */
|
|
4134
|
+
return /* @__PURE__ */ jsx38(
|
|
3959
4135
|
"textarea",
|
|
3960
4136
|
{
|
|
3961
4137
|
ref,
|
|
3962
4138
|
rows: 1,
|
|
3963
|
-
...mergeProps(
|
|
4139
|
+
...mergeProps(partAttrs33(composerAnatomy.scope, composerAnatomy.input), props)
|
|
3964
4140
|
}
|
|
3965
4141
|
);
|
|
3966
4142
|
}
|
|
3967
4143
|
);
|
|
3968
|
-
var
|
|
4144
|
+
var Actions3 = forwardRef36(
|
|
3969
4145
|
function ComposerActions(props, ref) {
|
|
3970
|
-
return /* @__PURE__ */
|
|
4146
|
+
return /* @__PURE__ */ jsx38(
|
|
3971
4147
|
"div",
|
|
3972
4148
|
{
|
|
3973
4149
|
ref,
|
|
3974
|
-
...mergeProps(
|
|
4150
|
+
...mergeProps(partAttrs33(composerAnatomy.scope, composerAnatomy.actions), props)
|
|
3975
4151
|
}
|
|
3976
4152
|
);
|
|
3977
4153
|
}
|
|
3978
4154
|
);
|
|
3979
|
-
var Send =
|
|
4155
|
+
var Send = forwardRef36(
|
|
3980
4156
|
function ComposerSend(props, ref) {
|
|
3981
|
-
return /* @__PURE__ */
|
|
4157
|
+
return /* @__PURE__ */ jsx38(
|
|
3982
4158
|
"span",
|
|
3983
4159
|
{
|
|
3984
4160
|
ref,
|
|
3985
|
-
...mergeProps(
|
|
4161
|
+
...mergeProps(partAttrs33(composerAnatomy.scope, composerAnatomy.send), props)
|
|
3986
4162
|
}
|
|
3987
4163
|
);
|
|
3988
4164
|
}
|
|
3989
4165
|
);
|
|
3990
4166
|
var Composer = {
|
|
3991
|
-
Root:
|
|
4167
|
+
Root: Root30,
|
|
3992
4168
|
Input: Input3,
|
|
3993
|
-
Actions,
|
|
4169
|
+
Actions: Actions3,
|
|
3994
4170
|
Send
|
|
3995
4171
|
};
|
|
3996
4172
|
|
|
3997
4173
|
// src/profile-header/index.tsx
|
|
3998
|
-
import { profileHeaderAnatomy, partAttrs as
|
|
3999
|
-
import { forwardRef as
|
|
4000
|
-
import { jsx as
|
|
4001
|
-
var
|
|
4002
|
-
return /* @__PURE__ */
|
|
4174
|
+
import { profileHeaderAnatomy, partAttrs as partAttrs34, scopeAttrs as scopeAttrs12 } from "@aeon-ui/core";
|
|
4175
|
+
import { forwardRef as forwardRef37 } from "react";
|
|
4176
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
4177
|
+
var Root31 = forwardRef37(function ProfileHeaderRoot({ children, ...rest }, ref) {
|
|
4178
|
+
return /* @__PURE__ */ jsx39(
|
|
4003
4179
|
"header",
|
|
4004
4180
|
{
|
|
4005
4181
|
ref,
|
|
4006
|
-
...mergeProps(
|
|
4182
|
+
...mergeProps(scopeAttrs12(profileHeaderAnatomy.scope, profileHeaderAnatomy.root), rest),
|
|
4007
4183
|
children
|
|
4008
4184
|
}
|
|
4009
4185
|
);
|
|
4010
4186
|
});
|
|
4011
|
-
var Media =
|
|
4012
|
-
return /* @__PURE__ */
|
|
4187
|
+
var Media = forwardRef37(function ProfileHeaderMedia(props, ref) {
|
|
4188
|
+
return /* @__PURE__ */ jsx39(
|
|
4013
4189
|
"div",
|
|
4014
4190
|
{
|
|
4015
4191
|
ref,
|
|
4016
|
-
...mergeProps(
|
|
4192
|
+
...mergeProps(partAttrs34(profileHeaderAnatomy.scope, profileHeaderAnatomy.media), props)
|
|
4017
4193
|
}
|
|
4018
4194
|
);
|
|
4019
4195
|
});
|
|
4020
|
-
var IdentitySlot =
|
|
4196
|
+
var IdentitySlot = forwardRef37(
|
|
4021
4197
|
function ProfileHeaderIdentity(props, ref) {
|
|
4022
|
-
return /* @__PURE__ */
|
|
4198
|
+
return /* @__PURE__ */ jsx39(
|
|
4023
4199
|
"div",
|
|
4024
4200
|
{
|
|
4025
4201
|
ref,
|
|
4026
|
-
...mergeProps(
|
|
4202
|
+
...mergeProps(partAttrs34(profileHeaderAnatomy.scope, profileHeaderAnatomy.identity), props)
|
|
4027
4203
|
}
|
|
4028
4204
|
);
|
|
4029
4205
|
}
|
|
4030
4206
|
);
|
|
4031
|
-
var Metrics =
|
|
4207
|
+
var Metrics = forwardRef37(
|
|
4032
4208
|
function ProfileHeaderMetrics(props, ref) {
|
|
4033
|
-
return /* @__PURE__ */
|
|
4209
|
+
return /* @__PURE__ */ jsx39(
|
|
4034
4210
|
"div",
|
|
4035
4211
|
{
|
|
4036
4212
|
ref,
|
|
4037
|
-
...mergeProps(
|
|
4213
|
+
...mergeProps(partAttrs34(profileHeaderAnatomy.scope, profileHeaderAnatomy.metrics), props)
|
|
4038
4214
|
}
|
|
4039
4215
|
);
|
|
4040
4216
|
}
|
|
4041
4217
|
);
|
|
4042
|
-
var
|
|
4218
|
+
var Actions4 = forwardRef37(
|
|
4043
4219
|
function ProfileHeaderActions(props, ref) {
|
|
4044
|
-
return /* @__PURE__ */
|
|
4220
|
+
return /* @__PURE__ */ jsx39(
|
|
4045
4221
|
"div",
|
|
4046
4222
|
{
|
|
4047
4223
|
ref,
|
|
4048
|
-
...mergeProps(
|
|
4224
|
+
...mergeProps(partAttrs34(profileHeaderAnatomy.scope, profileHeaderAnatomy.actions), props)
|
|
4049
4225
|
}
|
|
4050
4226
|
);
|
|
4051
4227
|
}
|
|
4052
4228
|
);
|
|
4053
|
-
var
|
|
4054
|
-
return /* @__PURE__ */
|
|
4229
|
+
var Body2 = forwardRef37(function ProfileHeaderBody(props, ref) {
|
|
4230
|
+
return /* @__PURE__ */ jsx39(
|
|
4055
4231
|
"div",
|
|
4056
4232
|
{
|
|
4057
4233
|
ref,
|
|
4058
|
-
...mergeProps(
|
|
4234
|
+
...mergeProps(partAttrs34(profileHeaderAnatomy.scope, profileHeaderAnatomy.body), props)
|
|
4059
4235
|
}
|
|
4060
4236
|
);
|
|
4061
4237
|
});
|
|
4062
4238
|
var ProfileHeader = {
|
|
4063
|
-
Root:
|
|
4239
|
+
Root: Root31,
|
|
4064
4240
|
Media,
|
|
4065
4241
|
Identity: IdentitySlot,
|
|
4066
4242
|
Metrics,
|
|
4067
|
-
Actions:
|
|
4068
|
-
Body
|
|
4243
|
+
Actions: Actions4,
|
|
4244
|
+
Body: Body2
|
|
4069
4245
|
};
|
|
4070
4246
|
|
|
4071
4247
|
// src/bar/index.tsx
|
|
4072
|
-
import { barAnatomy, partAttrs as
|
|
4073
|
-
import { createContext as
|
|
4074
|
-
import { jsx as
|
|
4075
|
-
var BarContext =
|
|
4076
|
-
var
|
|
4077
|
-
return /* @__PURE__ */
|
|
4248
|
+
import { barAnatomy, partAttrs as partAttrs35, scopeAttrs as scopeAttrs13 } from "@aeon-ui/core";
|
|
4249
|
+
import { createContext as createContext25, forwardRef as forwardRef38 } from "react";
|
|
4250
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
4251
|
+
var BarContext = createContext25({});
|
|
4252
|
+
var Root32 = forwardRef38(function BarRoot({ as: Tag = "header", gap, children, ...rest }, ref) {
|
|
4253
|
+
return /* @__PURE__ */ jsx40(BarContext.Provider, { value: { gap }, children: /* @__PURE__ */ jsx40(
|
|
4078
4254
|
Tag,
|
|
4079
4255
|
{
|
|
4080
4256
|
ref,
|
|
4081
|
-
...mergeProps(
|
|
4257
|
+
...mergeProps(scopeAttrs13(barAnatomy.scope, barAnatomy.root), rest),
|
|
4082
4258
|
children
|
|
4083
4259
|
}
|
|
4084
4260
|
) });
|
|
4085
4261
|
});
|
|
4086
|
-
var Zone =
|
|
4087
|
-
return /* @__PURE__ */
|
|
4262
|
+
var Zone = forwardRef38(function BarZone({ zone, children, ...rest }, ref) {
|
|
4263
|
+
return /* @__PURE__ */ jsx40(
|
|
4088
4264
|
"div",
|
|
4089
4265
|
{
|
|
4090
4266
|
ref,
|
|
4091
|
-
...mergeProps(
|
|
4267
|
+
...mergeProps(partAttrs35(barAnatomy.scope, zone), rest),
|
|
4092
4268
|
children
|
|
4093
4269
|
}
|
|
4094
4270
|
);
|
|
4095
4271
|
});
|
|
4096
4272
|
var Bar = {
|
|
4097
|
-
Root:
|
|
4098
|
-
Leading:
|
|
4273
|
+
Root: Root32,
|
|
4274
|
+
Leading: forwardRef38(
|
|
4099
4275
|
function BarLeading(props, ref) {
|
|
4100
|
-
return /* @__PURE__ */
|
|
4276
|
+
return /* @__PURE__ */ jsx40(Zone, { ref, zone: "leading", ...props });
|
|
4101
4277
|
}
|
|
4102
4278
|
),
|
|
4103
|
-
Center:
|
|
4279
|
+
Center: forwardRef38(
|
|
4104
4280
|
function BarCenter(props, ref) {
|
|
4105
|
-
return /* @__PURE__ */
|
|
4281
|
+
return /* @__PURE__ */ jsx40(Zone, { ref, zone: "center", ...props });
|
|
4106
4282
|
}
|
|
4107
4283
|
),
|
|
4108
|
-
Trailing:
|
|
4284
|
+
Trailing: forwardRef38(
|
|
4109
4285
|
function BarTrailing(props, ref) {
|
|
4110
|
-
return /* @__PURE__ */
|
|
4286
|
+
return /* @__PURE__ */ jsx40(Zone, { ref, zone: "trailing", ...props });
|
|
4111
4287
|
}
|
|
4112
4288
|
)
|
|
4113
4289
|
};
|
|
4114
4290
|
|
|
4115
4291
|
// src/panel/index.tsx
|
|
4116
|
-
import { panelAnatomy, partAttrs as
|
|
4292
|
+
import { panelAnatomy, partAttrs as partAttrs36, scopeAttrs as scopeAttrs14 } from "@aeon-ui/core";
|
|
4117
4293
|
import { panelMachine } from "@aeon-ui/primitives";
|
|
4118
4294
|
import {
|
|
4119
|
-
createContext as
|
|
4120
|
-
forwardRef as
|
|
4121
|
-
useContext as
|
|
4295
|
+
createContext as createContext26,
|
|
4296
|
+
forwardRef as forwardRef39,
|
|
4297
|
+
useContext as useContext25,
|
|
4122
4298
|
useEffect as useEffect22,
|
|
4123
4299
|
useId as useId8,
|
|
4124
|
-
useMemo as
|
|
4300
|
+
useMemo as useMemo22
|
|
4125
4301
|
} from "react";
|
|
4126
|
-
import { jsx as
|
|
4127
|
-
var PanelCtx =
|
|
4302
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
4303
|
+
var PanelCtx = createContext26(null);
|
|
4128
4304
|
function usePanelCtx() {
|
|
4129
|
-
const ctx =
|
|
4305
|
+
const ctx = useContext25(PanelCtx);
|
|
4130
4306
|
if (!ctx) throw new Error("Panel parts must be used within Panel.Root");
|
|
4131
4307
|
return ctx;
|
|
4132
4308
|
}
|
|
4133
|
-
var Group3 =
|
|
4134
|
-
return /* @__PURE__ */
|
|
4309
|
+
var Group3 = forwardRef39(function PanelGroup({ orientation = "horizontal", children, className, ...rest }, ref) {
|
|
4310
|
+
return /* @__PURE__ */ jsx41(
|
|
4135
4311
|
"div",
|
|
4136
4312
|
{
|
|
4137
4313
|
ref,
|
|
4138
4314
|
className,
|
|
4139
4315
|
"data-aeon-orientation": orientation,
|
|
4140
|
-
...mergeProps(
|
|
4316
|
+
...mergeProps(partAttrs36(panelAnatomy.scope, panelAnatomy.group), rest),
|
|
4141
4317
|
children
|
|
4142
4318
|
}
|
|
4143
4319
|
);
|
|
4144
4320
|
});
|
|
4145
|
-
var
|
|
4321
|
+
var Root33 = forwardRef39(function PanelRoot({
|
|
4146
4322
|
label,
|
|
4147
4323
|
defaultExpanded = true,
|
|
4148
4324
|
expanded: expandedProp,
|
|
@@ -4166,7 +4342,7 @@ var Root31 = forwardRef37(function PanelRoot({
|
|
|
4166
4342
|
if (expandedProp === void 0) return;
|
|
4167
4343
|
send({ type: "SET_EXPANDED", expanded: expandedProp });
|
|
4168
4344
|
}, [expandedProp, send]);
|
|
4169
|
-
const ctx =
|
|
4345
|
+
const ctx = useMemo22(
|
|
4170
4346
|
() => ({
|
|
4171
4347
|
state,
|
|
4172
4348
|
expanded,
|
|
@@ -4177,13 +4353,13 @@ var Root31 = forwardRef37(function PanelRoot({
|
|
|
4177
4353
|
}),
|
|
4178
4354
|
[state, expanded, collapsible, label, contentId, send]
|
|
4179
4355
|
);
|
|
4180
|
-
return /* @__PURE__ */
|
|
4356
|
+
return /* @__PURE__ */ jsx41(PanelCtx.Provider, { value: ctx, children: /* @__PURE__ */ jsx41(
|
|
4181
4357
|
"div",
|
|
4182
4358
|
{
|
|
4183
4359
|
ref,
|
|
4184
4360
|
className,
|
|
4185
4361
|
...mergeProps(
|
|
4186
|
-
|
|
4362
|
+
scopeAttrs14(panelAnatomy.scope, panelAnatomy.root, { state }),
|
|
4187
4363
|
{
|
|
4188
4364
|
"data-aeon-collapsible": collapsible ? "true" : void 0
|
|
4189
4365
|
},
|
|
@@ -4193,9 +4369,9 @@ var Root31 = forwardRef37(function PanelRoot({
|
|
|
4193
4369
|
}
|
|
4194
4370
|
) });
|
|
4195
4371
|
});
|
|
4196
|
-
var Trigger7 =
|
|
4372
|
+
var Trigger7 = forwardRef39(function PanelTrigger({ children, onClick, ...rest }, ref) {
|
|
4197
4373
|
const { expanded, collapsible, contentId, send, label } = usePanelCtx();
|
|
4198
|
-
return /* @__PURE__ */
|
|
4374
|
+
return /* @__PURE__ */ jsx41(
|
|
4199
4375
|
"button",
|
|
4200
4376
|
{
|
|
4201
4377
|
ref,
|
|
@@ -4204,7 +4380,7 @@ var Trigger7 = forwardRef37(function PanelTrigger({ children, onClick, ...rest }
|
|
|
4204
4380
|
"aria-controls": contentId,
|
|
4205
4381
|
disabled: !collapsible,
|
|
4206
4382
|
...mergeProps(
|
|
4207
|
-
|
|
4383
|
+
partAttrs36(panelAnatomy.scope, panelAnatomy.trigger, {
|
|
4208
4384
|
state: expanded ? "expanded" : "collapsed"
|
|
4209
4385
|
}),
|
|
4210
4386
|
rest
|
|
@@ -4217,10 +4393,10 @@ var Trigger7 = forwardRef37(function PanelTrigger({ children, onClick, ...rest }
|
|
|
4217
4393
|
}
|
|
4218
4394
|
);
|
|
4219
4395
|
});
|
|
4220
|
-
var Label8 =
|
|
4396
|
+
var Label8 = forwardRef39(function PanelLabel({ children, onClick, ...rest }, ref) {
|
|
4221
4397
|
const { label, state, collapsible, send, expanded, contentId } = usePanelCtx();
|
|
4222
4398
|
const text = typeof children === "string" || children == null ? String(children ?? label) : null;
|
|
4223
|
-
return /* @__PURE__ */
|
|
4399
|
+
return /* @__PURE__ */ jsx41(
|
|
4224
4400
|
"span",
|
|
4225
4401
|
{
|
|
4226
4402
|
ref,
|
|
@@ -4228,7 +4404,7 @@ var Label8 = forwardRef37(function PanelLabel({ children, onClick, ...rest }, re
|
|
|
4228
4404
|
tabIndex: collapsible ? 0 : void 0,
|
|
4229
4405
|
"aria-expanded": collapsible ? expanded : void 0,
|
|
4230
4406
|
"aria-controls": collapsible ? contentId : void 0,
|
|
4231
|
-
...mergeProps(
|
|
4407
|
+
...mergeProps(partAttrs36(panelAnatomy.scope, panelAnatomy.label, { state }), rest),
|
|
4232
4408
|
onClick: (e) => {
|
|
4233
4409
|
onClick?.(e);
|
|
4234
4410
|
if (!e.defaultPrevented && collapsible) send({ type: "TOGGLE" });
|
|
@@ -4241,50 +4417,50 @@ var Label8 = forwardRef37(function PanelLabel({ children, onClick, ...rest }, re
|
|
|
4241
4417
|
}
|
|
4242
4418
|
},
|
|
4243
4419
|
children: text != null ? state === "collapsed" ? text.split("").map(
|
|
4244
|
-
(ch, i) => ch === " " ? /* @__PURE__ */
|
|
4420
|
+
(ch, i) => ch === " " ? /* @__PURE__ */ jsx41("span", { "data-aeon-part": "label-gap", "aria-hidden": true, children: " " }, `sp-${i}`) : /* @__PURE__ */ jsx41("span", { "data-aeon-part": "label-char", children: ch }, `${ch}-${i}`)
|
|
4245
4421
|
) : text : children
|
|
4246
4422
|
}
|
|
4247
4423
|
);
|
|
4248
4424
|
});
|
|
4249
|
-
var Content9 =
|
|
4425
|
+
var Content9 = forwardRef39(function PanelContent({ children, ...rest }, ref) {
|
|
4250
4426
|
const { expanded, contentId, state } = usePanelCtx();
|
|
4251
|
-
return /* @__PURE__ */
|
|
4427
|
+
return /* @__PURE__ */ jsx41(
|
|
4252
4428
|
"div",
|
|
4253
4429
|
{
|
|
4254
4430
|
ref,
|
|
4255
4431
|
id: contentId,
|
|
4256
4432
|
hidden: !expanded,
|
|
4257
|
-
...mergeProps(
|
|
4433
|
+
...mergeProps(partAttrs36(panelAnatomy.scope, panelAnatomy.content, { state }), rest),
|
|
4258
4434
|
children
|
|
4259
4435
|
}
|
|
4260
4436
|
);
|
|
4261
4437
|
});
|
|
4262
4438
|
var Panel = {
|
|
4263
4439
|
Group: Group3,
|
|
4264
|
-
Root:
|
|
4440
|
+
Root: Root33,
|
|
4265
4441
|
Trigger: Trigger7,
|
|
4266
4442
|
Label: Label8,
|
|
4267
4443
|
Content: Content9
|
|
4268
4444
|
};
|
|
4269
4445
|
|
|
4270
4446
|
// src/app-shell/index.tsx
|
|
4271
|
-
import { appShellAnatomy, partAttrs as
|
|
4447
|
+
import { appShellAnatomy, partAttrs as partAttrs37, scopeAttrs as scopeAttrs15 } from "@aeon-ui/core";
|
|
4272
4448
|
import { appShellMachine } from "@aeon-ui/primitives";
|
|
4273
4449
|
import {
|
|
4274
|
-
createContext as
|
|
4275
|
-
forwardRef as
|
|
4276
|
-
useContext as
|
|
4450
|
+
createContext as createContext27,
|
|
4451
|
+
forwardRef as forwardRef40,
|
|
4452
|
+
useContext as useContext26,
|
|
4277
4453
|
useEffect as useEffect23,
|
|
4278
|
-
useMemo as
|
|
4454
|
+
useMemo as useMemo23
|
|
4279
4455
|
} from "react";
|
|
4280
|
-
import { jsx as
|
|
4281
|
-
var AppShellCtx =
|
|
4456
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
4457
|
+
var AppShellCtx = createContext27(null);
|
|
4282
4458
|
function useAppShellContext() {
|
|
4283
|
-
const ctx =
|
|
4459
|
+
const ctx = useContext26(AppShellCtx);
|
|
4284
4460
|
if (!ctx) throw new Error("AppShell parts must be used within AppShell.Root");
|
|
4285
4461
|
return ctx;
|
|
4286
4462
|
}
|
|
4287
|
-
var
|
|
4463
|
+
var Root34 = forwardRef40(function AppShellRoot({ defaultDockVisible = true, dockVisible: dockVisibleProp, children, ...rest }, ref) {
|
|
4288
4464
|
const [snapshot, send] = useAeonMachine(appShellMachine, {
|
|
4289
4465
|
input: { dockVisible: dockVisibleProp ?? defaultDockVisible }
|
|
4290
4466
|
});
|
|
@@ -4296,7 +4472,7 @@ var Root32 = forwardRef38(function AppShellRoot({ defaultDockVisible = true, doc
|
|
|
4296
4472
|
send({ type: "SET_DOCK", visible: dockVisibleProp });
|
|
4297
4473
|
}
|
|
4298
4474
|
}, [dockVisibleProp, snapshot.context.dockVisible, send]);
|
|
4299
|
-
const value =
|
|
4475
|
+
const value = useMemo23(
|
|
4300
4476
|
() => ({
|
|
4301
4477
|
chrome,
|
|
4302
4478
|
dockVisible,
|
|
@@ -4305,13 +4481,13 @@ var Root32 = forwardRef38(function AppShellRoot({ defaultDockVisible = true, doc
|
|
|
4305
4481
|
}),
|
|
4306
4482
|
[chrome, dockVisible, send]
|
|
4307
4483
|
);
|
|
4308
|
-
return /* @__PURE__ */
|
|
4484
|
+
return /* @__PURE__ */ jsx42(AppShellCtx.Provider, { value, children: /* @__PURE__ */ jsx42(
|
|
4309
4485
|
"div",
|
|
4310
4486
|
{
|
|
4311
4487
|
ref,
|
|
4312
4488
|
"data-aeon-dock": dockVisible ? "visible" : "hidden",
|
|
4313
4489
|
...mergeProps(
|
|
4314
|
-
|
|
4490
|
+
scopeAttrs15(appShellAnatomy.scope, appShellAnatomy.root, { state: chrome }),
|
|
4315
4491
|
rest
|
|
4316
4492
|
),
|
|
4317
4493
|
children
|
|
@@ -4319,14 +4495,14 @@ var Root32 = forwardRef38(function AppShellRoot({ defaultDockVisible = true, doc
|
|
|
4319
4495
|
) });
|
|
4320
4496
|
});
|
|
4321
4497
|
function ShellPart(part, displayName, defaultTag = "div") {
|
|
4322
|
-
const Comp =
|
|
4498
|
+
const Comp = forwardRef40(
|
|
4323
4499
|
function AeonShellPart({ as: Tag = defaultTag, ...rest }, ref) {
|
|
4324
4500
|
const { chrome } = useAppShellContext();
|
|
4325
|
-
return /* @__PURE__ */
|
|
4501
|
+
return /* @__PURE__ */ jsx42(
|
|
4326
4502
|
Tag,
|
|
4327
4503
|
{
|
|
4328
4504
|
ref,
|
|
4329
|
-
...mergeProps(
|
|
4505
|
+
...mergeProps(partAttrs37(appShellAnatomy.scope, part, { state: chrome }), rest)
|
|
4330
4506
|
}
|
|
4331
4507
|
);
|
|
4332
4508
|
}
|
|
@@ -4339,33 +4515,33 @@ var Subheader = ShellPart(appShellAnatomy.subheader, "AppShell.Subheader");
|
|
|
4339
4515
|
var Content10 = ShellPart(appShellAnatomy.content, "AppShell.Content", "main");
|
|
4340
4516
|
var Aside = ShellPart(appShellAnatomy.aside, "AppShell.Aside", "aside");
|
|
4341
4517
|
var Footer = ShellPart(appShellAnatomy.footer, "AppShell.Footer", "footer");
|
|
4342
|
-
var Dock =
|
|
4518
|
+
var Dock = forwardRef40(function AppShellDock({ hidden, ...rest }, ref) {
|
|
4343
4519
|
const { chrome, dockVisible } = useAppShellContext();
|
|
4344
4520
|
if (!dockVisible) return null;
|
|
4345
|
-
return /* @__PURE__ */
|
|
4521
|
+
return /* @__PURE__ */ jsx42(
|
|
4346
4522
|
"div",
|
|
4347
4523
|
{
|
|
4348
4524
|
ref,
|
|
4349
4525
|
hidden,
|
|
4350
|
-
...mergeProps(
|
|
4526
|
+
...mergeProps(partAttrs37(appShellAnatomy.scope, appShellAnatomy.dock, { state: chrome }), rest)
|
|
4351
4527
|
}
|
|
4352
4528
|
);
|
|
4353
4529
|
});
|
|
4354
|
-
var Scrim =
|
|
4530
|
+
var Scrim = forwardRef40(function AppShellScrim(props, ref) {
|
|
4355
4531
|
const { chrome, overlayOpen, send } = useAppShellContext();
|
|
4356
4532
|
if (!overlayOpen) return null;
|
|
4357
|
-
return /* @__PURE__ */
|
|
4533
|
+
return /* @__PURE__ */ jsx42(
|
|
4358
4534
|
"div",
|
|
4359
4535
|
{
|
|
4360
4536
|
ref,
|
|
4361
4537
|
role: "presentation",
|
|
4362
4538
|
onClick: () => send({ type: "CLOSE_OVERLAY" }),
|
|
4363
|
-
...mergeProps(
|
|
4539
|
+
...mergeProps(partAttrs37(appShellAnatomy.scope, appShellAnatomy.scrim, { state: chrome }), props)
|
|
4364
4540
|
}
|
|
4365
4541
|
);
|
|
4366
4542
|
});
|
|
4367
4543
|
var AppShell = {
|
|
4368
|
-
Root:
|
|
4544
|
+
Root: Root34,
|
|
4369
4545
|
Header,
|
|
4370
4546
|
Subheader,
|
|
4371
4547
|
Content: Content10,
|
|
@@ -4375,73 +4551,258 @@ var AppShell = {
|
|
|
4375
4551
|
Scrim
|
|
4376
4552
|
};
|
|
4377
4553
|
|
|
4554
|
+
// src/app-nav/index.tsx
|
|
4555
|
+
import {
|
|
4556
|
+
appNavAnatomy,
|
|
4557
|
+
partAttrs as partAttrs38,
|
|
4558
|
+
scopeAttrs as scopeAttrs16
|
|
4559
|
+
} from "@aeon-ui/core";
|
|
4560
|
+
import {
|
|
4561
|
+
appNavChild,
|
|
4562
|
+
appNavMachine,
|
|
4563
|
+
appNavStateAttr
|
|
4564
|
+
} from "@aeon-ui/primitives";
|
|
4565
|
+
import {
|
|
4566
|
+
createContext as createContext28,
|
|
4567
|
+
forwardRef as forwardRef41,
|
|
4568
|
+
useContext as useContext27,
|
|
4569
|
+
useMemo as useMemo24
|
|
4570
|
+
} from "react";
|
|
4571
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
4572
|
+
var AppNavCtx = createContext28(null);
|
|
4573
|
+
function useAppNav() {
|
|
4574
|
+
const ctx = useContext27(AppNavCtx);
|
|
4575
|
+
if (!ctx) throw new Error("AppNav parts must be used within AppNav.Root");
|
|
4576
|
+
return ctx;
|
|
4577
|
+
}
|
|
4578
|
+
function useAppNavMachine(input) {
|
|
4579
|
+
const [snapshot, send] = useAeonMachine(appNavMachine, {
|
|
4580
|
+
input: { section: input?.section ?? "home", stack: input?.stack ?? [] }
|
|
4581
|
+
});
|
|
4582
|
+
const section = snapshot.context.section;
|
|
4583
|
+
const stack = snapshot.context.stack;
|
|
4584
|
+
const child = appNavChild(snapshot.context);
|
|
4585
|
+
const stateAttr = appNavStateAttr(snapshot.context);
|
|
4586
|
+
return useMemo24(
|
|
4587
|
+
() => ({
|
|
4588
|
+
section,
|
|
4589
|
+
stack,
|
|
4590
|
+
child,
|
|
4591
|
+
stateAttr,
|
|
4592
|
+
send,
|
|
4593
|
+
setSection: (next) => send({ type: "SET_SECTION", section: next }),
|
|
4594
|
+
push: (next) => send({ type: "PUSH", child: next }),
|
|
4595
|
+
replace: (next) => send({ type: "REPLACE", child: next }),
|
|
4596
|
+
pop: () => send({ type: "POP" }),
|
|
4597
|
+
popTo: (id) => send({ type: "POP_TO", id }),
|
|
4598
|
+
clear: () => send({ type: "CLEAR" }),
|
|
4599
|
+
reset: (next) => send({ type: "RESET", section: next })
|
|
4600
|
+
}),
|
|
4601
|
+
[section, stack, child, stateAttr, send]
|
|
4602
|
+
);
|
|
4603
|
+
}
|
|
4604
|
+
var Root35 = forwardRef41(function AppNavRoot({ defaultSection = "home", children, ...rest }, ref) {
|
|
4605
|
+
const nav = useAppNavMachine({ section: defaultSection });
|
|
4606
|
+
return /* @__PURE__ */ jsx43(AppNavCtx.Provider, { value: nav, children: /* @__PURE__ */ jsx43(
|
|
4607
|
+
"div",
|
|
4608
|
+
{
|
|
4609
|
+
ref,
|
|
4610
|
+
...mergeProps(
|
|
4611
|
+
scopeAttrs16(appNavAnatomy.scope, appNavAnatomy.root, { state: nav.stateAttr }),
|
|
4612
|
+
rest
|
|
4613
|
+
),
|
|
4614
|
+
children
|
|
4615
|
+
}
|
|
4616
|
+
) });
|
|
4617
|
+
});
|
|
4618
|
+
var Rail = forwardRef41(function AppNavRail(props, ref) {
|
|
4619
|
+
const { stateAttr } = useAppNav();
|
|
4620
|
+
return /* @__PURE__ */ jsx43(
|
|
4621
|
+
"nav",
|
|
4622
|
+
{
|
|
4623
|
+
ref,
|
|
4624
|
+
...mergeProps(partAttrs38(appNavAnatomy.scope, appNavAnatomy.rail, { state: stateAttr }), props)
|
|
4625
|
+
}
|
|
4626
|
+
);
|
|
4627
|
+
});
|
|
4628
|
+
var Section = forwardRef41(function AppNavSection({ value, onClick, ...rest }, ref) {
|
|
4629
|
+
const { section, child, setSection } = useAppNav();
|
|
4630
|
+
const isActive = section === value && !child;
|
|
4631
|
+
return /* @__PURE__ */ jsx43(
|
|
4632
|
+
"button",
|
|
4633
|
+
{
|
|
4634
|
+
ref,
|
|
4635
|
+
type: "button",
|
|
4636
|
+
"aria-current": isActive ? "page" : void 0,
|
|
4637
|
+
"data-aeon-value": value,
|
|
4638
|
+
onClick: (e) => {
|
|
4639
|
+
onClick?.(e);
|
|
4640
|
+
if (e.defaultPrevented) return;
|
|
4641
|
+
setSection(value);
|
|
4642
|
+
},
|
|
4643
|
+
...mergeProps(
|
|
4644
|
+
partAttrs38(appNavAnatomy.scope, appNavAnatomy.section, {
|
|
4645
|
+
state: section === value ? child ? "section-active" : "active" : "inactive"
|
|
4646
|
+
}),
|
|
4647
|
+
rest
|
|
4648
|
+
)
|
|
4649
|
+
}
|
|
4650
|
+
);
|
|
4651
|
+
});
|
|
4652
|
+
var Stage = forwardRef41(function AppNavStage(props, ref) {
|
|
4653
|
+
const { stateAttr } = useAppNav();
|
|
4654
|
+
return /* @__PURE__ */ jsx43(
|
|
4655
|
+
"div",
|
|
4656
|
+
{
|
|
4657
|
+
ref,
|
|
4658
|
+
...mergeProps(partAttrs38(appNavAnatomy.scope, appNavAnatomy.stage, { state: stateAttr }), props)
|
|
4659
|
+
}
|
|
4660
|
+
);
|
|
4661
|
+
});
|
|
4662
|
+
var Breadcrumb = forwardRef41(function AppNavBreadcrumb({ labels, ...rest }, ref) {
|
|
4663
|
+
const { section, stack, setSection, popTo, clear, stateAttr } = useAppNav();
|
|
4664
|
+
const crumbs = [
|
|
4665
|
+
{ id: section, label: labels?.[0] ?? section, kind: "section" },
|
|
4666
|
+
...stack.map((entry, i) => ({
|
|
4667
|
+
id: entry.id,
|
|
4668
|
+
label: labels?.[i + 1] ?? entry.type,
|
|
4669
|
+
kind: "child"
|
|
4670
|
+
}))
|
|
4671
|
+
];
|
|
4672
|
+
return /* @__PURE__ */ jsx43(
|
|
4673
|
+
"nav",
|
|
4674
|
+
{
|
|
4675
|
+
ref,
|
|
4676
|
+
"aria-label": "Breadcrumb",
|
|
4677
|
+
...mergeProps(
|
|
4678
|
+
partAttrs38(appNavAnatomy.scope, appNavAnatomy.breadcrumb, { state: stateAttr }),
|
|
4679
|
+
rest
|
|
4680
|
+
),
|
|
4681
|
+
children: crumbs.map((crumb, index) => {
|
|
4682
|
+
const last = index === crumbs.length - 1;
|
|
4683
|
+
return /* @__PURE__ */ jsx43(
|
|
4684
|
+
"button",
|
|
4685
|
+
{
|
|
4686
|
+
type: "button",
|
|
4687
|
+
disabled: last,
|
|
4688
|
+
...partAttrs38(appNavAnatomy.scope, appNavAnatomy.crumb, {
|
|
4689
|
+
state: last ? "current" : "ancestor"
|
|
4690
|
+
}),
|
|
4691
|
+
onClick: () => {
|
|
4692
|
+
if (crumb.kind === "section") {
|
|
4693
|
+
clear();
|
|
4694
|
+
setSection(crumb.id);
|
|
4695
|
+
} else {
|
|
4696
|
+
popTo(crumb.id);
|
|
4697
|
+
}
|
|
4698
|
+
},
|
|
4699
|
+
children: crumb.label
|
|
4700
|
+
},
|
|
4701
|
+
`${crumb.kind}:${crumb.id}`
|
|
4702
|
+
);
|
|
4703
|
+
})
|
|
4704
|
+
}
|
|
4705
|
+
);
|
|
4706
|
+
});
|
|
4707
|
+
var Back = forwardRef41(
|
|
4708
|
+
function AppNavBack({ onClick, children = "Back", ...rest }, ref) {
|
|
4709
|
+
const { child, pop, stateAttr } = useAppNav();
|
|
4710
|
+
if (!child) return null;
|
|
4711
|
+
return /* @__PURE__ */ jsx43(
|
|
4712
|
+
"button",
|
|
4713
|
+
{
|
|
4714
|
+
ref,
|
|
4715
|
+
type: "button",
|
|
4716
|
+
onClick: (e) => {
|
|
4717
|
+
onClick?.(e);
|
|
4718
|
+
if (e.defaultPrevented) return;
|
|
4719
|
+
pop();
|
|
4720
|
+
},
|
|
4721
|
+
...mergeProps(
|
|
4722
|
+
partAttrs38(appNavAnatomy.scope, appNavAnatomy.back, { state: stateAttr }),
|
|
4723
|
+
rest
|
|
4724
|
+
),
|
|
4725
|
+
children
|
|
4726
|
+
}
|
|
4727
|
+
);
|
|
4728
|
+
}
|
|
4729
|
+
);
|
|
4730
|
+
var AppNav = {
|
|
4731
|
+
Root: Root35,
|
|
4732
|
+
Rail,
|
|
4733
|
+
Section,
|
|
4734
|
+
Stage,
|
|
4735
|
+
Breadcrumb,
|
|
4736
|
+
Back
|
|
4737
|
+
};
|
|
4738
|
+
|
|
4378
4739
|
// src/content/index.tsx
|
|
4379
|
-
import { contentAnatomy, partAttrs as
|
|
4740
|
+
import { contentAnatomy, partAttrs as partAttrs39, scopeAttrs as scopeAttrs17 } from "@aeon-ui/core";
|
|
4380
4741
|
import { contentRegionMachine } from "@aeon-ui/primitives";
|
|
4381
4742
|
import {
|
|
4382
|
-
createContext as
|
|
4383
|
-
forwardRef as
|
|
4384
|
-
useContext as
|
|
4385
|
-
useMemo as
|
|
4743
|
+
createContext as createContext29,
|
|
4744
|
+
forwardRef as forwardRef42,
|
|
4745
|
+
useContext as useContext28,
|
|
4746
|
+
useMemo as useMemo25
|
|
4386
4747
|
} from "react";
|
|
4387
|
-
import { jsx as
|
|
4388
|
-
var ContentCtx =
|
|
4748
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
4749
|
+
var ContentCtx = createContext29(null);
|
|
4389
4750
|
function useContentContext() {
|
|
4390
|
-
const ctx =
|
|
4751
|
+
const ctx = useContext28(ContentCtx);
|
|
4391
4752
|
if (!ctx) throw new Error("Content parts must be used within Content.Root");
|
|
4392
4753
|
return ctx;
|
|
4393
4754
|
}
|
|
4394
|
-
var
|
|
4755
|
+
var Root36 = forwardRef42(function ContentRoot({ state: stateProp, children, ...rest }, ref) {
|
|
4395
4756
|
const [snapshot, send] = useAeonMachine(contentRegionMachine);
|
|
4396
4757
|
const machineState = snapshot.value;
|
|
4397
4758
|
const state = stateProp ?? machineState;
|
|
4398
|
-
const value =
|
|
4759
|
+
const value = useMemo25(
|
|
4399
4760
|
() => ({ state, error: snapshot.context.error, send }),
|
|
4400
4761
|
[state, snapshot.context.error, send]
|
|
4401
4762
|
);
|
|
4402
|
-
return /* @__PURE__ */
|
|
4763
|
+
return /* @__PURE__ */ jsx44(ContentCtx.Provider, { value, children: /* @__PURE__ */ jsx44(
|
|
4403
4764
|
"div",
|
|
4404
4765
|
{
|
|
4405
4766
|
ref,
|
|
4406
|
-
...mergeProps(
|
|
4767
|
+
...mergeProps(scopeAttrs17(contentAnatomy.scope, contentAnatomy.root, { state }), rest),
|
|
4407
4768
|
children
|
|
4408
4769
|
}
|
|
4409
4770
|
) });
|
|
4410
4771
|
});
|
|
4411
|
-
var Toolbar =
|
|
4772
|
+
var Toolbar = forwardRef42(function ContentToolbar(props, ref) {
|
|
4412
4773
|
const { state } = useContentContext();
|
|
4413
|
-
return /* @__PURE__ */
|
|
4774
|
+
return /* @__PURE__ */ jsx44(
|
|
4414
4775
|
"div",
|
|
4415
4776
|
{
|
|
4416
4777
|
ref,
|
|
4417
|
-
...mergeProps(
|
|
4778
|
+
...mergeProps(partAttrs39(contentAnatomy.scope, contentAnatomy.toolbar, { state }), props)
|
|
4418
4779
|
}
|
|
4419
4780
|
);
|
|
4420
4781
|
});
|
|
4421
|
-
var
|
|
4782
|
+
var Body3 = forwardRef42(function ContentBody({ hidden, ...rest }, ref) {
|
|
4422
4783
|
const { state } = useContentContext();
|
|
4423
4784
|
const show = state === "ready" || state === "loadingMore" || state === "success" || state === "idle";
|
|
4424
4785
|
if (!show) return null;
|
|
4425
|
-
return /* @__PURE__ */
|
|
4786
|
+
return /* @__PURE__ */ jsx44(
|
|
4426
4787
|
"div",
|
|
4427
4788
|
{
|
|
4428
4789
|
ref,
|
|
4429
4790
|
hidden,
|
|
4430
|
-
...mergeProps(
|
|
4791
|
+
...mergeProps(partAttrs39(contentAnatomy.scope, contentAnatomy.body, { state }), rest)
|
|
4431
4792
|
}
|
|
4432
4793
|
);
|
|
4433
4794
|
});
|
|
4434
4795
|
function StatusSlot(part, match, displayName) {
|
|
4435
4796
|
const matches = Array.isArray(match) ? match : [match];
|
|
4436
|
-
const Comp =
|
|
4797
|
+
const Comp = forwardRef42(function ContentStatusSlot(props, ref) {
|
|
4437
4798
|
const { state } = useContentContext();
|
|
4438
4799
|
if (!matches.includes(state)) return null;
|
|
4439
|
-
return /* @__PURE__ */
|
|
4800
|
+
return /* @__PURE__ */ jsx44(
|
|
4440
4801
|
"div",
|
|
4441
4802
|
{
|
|
4442
4803
|
ref,
|
|
4443
4804
|
role: "status",
|
|
4444
|
-
...mergeProps(
|
|
4805
|
+
...mergeProps(partAttrs39(contentAnatomy.scope, part, { state }), props)
|
|
4445
4806
|
}
|
|
4446
4807
|
);
|
|
4447
4808
|
});
|
|
@@ -4452,21 +4813,21 @@ var Pending = StatusSlot(contentAnatomy.pending, "pending", "Content.Pending");
|
|
|
4452
4813
|
var Empty2 = StatusSlot(contentAnatomy.empty, "empty", "Content.Empty");
|
|
4453
4814
|
var ErrorSlot = StatusSlot(contentAnatomy.error, "error", "Content.Error");
|
|
4454
4815
|
var Success = StatusSlot(contentAnatomy.success, "success", "Content.Success");
|
|
4455
|
-
var Sentinel =
|
|
4816
|
+
var Sentinel = forwardRef42(function ContentSentinel(props, ref) {
|
|
4456
4817
|
const { state } = useContentContext();
|
|
4457
4818
|
if (state !== "ready" && state !== "loadingMore") return null;
|
|
4458
|
-
return /* @__PURE__ */
|
|
4819
|
+
return /* @__PURE__ */ jsx44(
|
|
4459
4820
|
"div",
|
|
4460
4821
|
{
|
|
4461
4822
|
ref,
|
|
4462
|
-
...mergeProps(
|
|
4823
|
+
...mergeProps(partAttrs39(contentAnatomy.scope, contentAnatomy.sentinel, { state }), props)
|
|
4463
4824
|
}
|
|
4464
4825
|
);
|
|
4465
4826
|
});
|
|
4466
4827
|
var Content11 = {
|
|
4467
|
-
Root:
|
|
4828
|
+
Root: Root36,
|
|
4468
4829
|
Toolbar,
|
|
4469
|
-
Body:
|
|
4830
|
+
Body: Body3,
|
|
4470
4831
|
Pending,
|
|
4471
4832
|
Empty: Empty2,
|
|
4472
4833
|
Error: ErrorSlot,
|
|
@@ -4475,23 +4836,23 @@ var Content11 = {
|
|
|
4475
4836
|
};
|
|
4476
4837
|
|
|
4477
4838
|
// src/nav/index.tsx
|
|
4478
|
-
import { navAnatomy, partAttrs as
|
|
4839
|
+
import { navAnatomy, partAttrs as partAttrs40, scopeAttrs as scopeAttrs18 } from "@aeon-ui/core";
|
|
4479
4840
|
import { tabsMachine as tabsMachine3 } from "@aeon-ui/primitives";
|
|
4480
4841
|
import {
|
|
4481
|
-
createContext as
|
|
4482
|
-
forwardRef as
|
|
4483
|
-
useContext as
|
|
4842
|
+
createContext as createContext30,
|
|
4843
|
+
forwardRef as forwardRef43,
|
|
4844
|
+
useContext as useContext29,
|
|
4484
4845
|
useEffect as useEffect24,
|
|
4485
|
-
useMemo as
|
|
4846
|
+
useMemo as useMemo26
|
|
4486
4847
|
} from "react";
|
|
4487
|
-
import { jsx as
|
|
4488
|
-
var NavCtx =
|
|
4848
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
4849
|
+
var NavCtx = createContext30(null);
|
|
4489
4850
|
function useNavCtx() {
|
|
4490
|
-
const ctx =
|
|
4851
|
+
const ctx = useContext29(NavCtx);
|
|
4491
4852
|
if (!ctx) throw new Error("Nav parts must be used within Nav.Root");
|
|
4492
4853
|
return ctx;
|
|
4493
4854
|
}
|
|
4494
|
-
var
|
|
4855
|
+
var Root37 = forwardRef43(function NavRoot({
|
|
4495
4856
|
defaultValue = "",
|
|
4496
4857
|
value,
|
|
4497
4858
|
onValueChange,
|
|
@@ -4507,25 +4868,25 @@ var Root34 = forwardRef40(function NavRoot({
|
|
|
4507
4868
|
useEffect24(() => {
|
|
4508
4869
|
if (value !== void 0) send({ type: "SET_VALUE", value });
|
|
4509
4870
|
}, [value, send]);
|
|
4510
|
-
const ctx =
|
|
4871
|
+
const ctx = useMemo26(
|
|
4511
4872
|
() => ({ value: resolvedValue, send, onValueChange }),
|
|
4512
4873
|
[resolvedValue, send, onValueChange]
|
|
4513
4874
|
);
|
|
4514
|
-
return /* @__PURE__ */
|
|
4875
|
+
return /* @__PURE__ */ jsx45(NavCtx.Provider, { value: ctx, children: /* @__PURE__ */ jsx45(
|
|
4515
4876
|
Tag,
|
|
4516
4877
|
{
|
|
4517
4878
|
ref,
|
|
4518
4879
|
"data-aeon-orientation": orientation,
|
|
4519
|
-
...mergeProps(
|
|
4880
|
+
...mergeProps(scopeAttrs18(navAnatomy.scope, navAnatomy.root), rest),
|
|
4520
4881
|
children
|
|
4521
4882
|
}
|
|
4522
4883
|
) });
|
|
4523
4884
|
});
|
|
4524
|
-
var Item8 =
|
|
4885
|
+
var Item8 = forwardRef43(function NavItem({ value, disabled, onClick, children, ...rest }, ref) {
|
|
4525
4886
|
const { value: selected, send, onValueChange } = useNavCtx();
|
|
4526
4887
|
const active = selected === value;
|
|
4527
4888
|
const state = disabled ? "disabled" : active ? "active" : "inactive";
|
|
4528
|
-
return /* @__PURE__ */
|
|
4889
|
+
return /* @__PURE__ */ jsx45(
|
|
4529
4890
|
"button",
|
|
4530
4891
|
{
|
|
4531
4892
|
ref,
|
|
@@ -4539,32 +4900,32 @@ var Item8 = forwardRef40(function NavItem({ value, disabled, onClick, children,
|
|
|
4539
4900
|
send({ type: "SELECT", value });
|
|
4540
4901
|
onValueChange?.(value);
|
|
4541
4902
|
},
|
|
4542
|
-
...mergeProps(
|
|
4903
|
+
...mergeProps(partAttrs40(navAnatomy.scope, navAnatomy.item, { state, disabled }), rest),
|
|
4543
4904
|
children
|
|
4544
4905
|
}
|
|
4545
4906
|
);
|
|
4546
4907
|
});
|
|
4547
|
-
var Indicator3 =
|
|
4548
|
-
return /* @__PURE__ */
|
|
4908
|
+
var Indicator3 = forwardRef43(function NavIndicator(props, ref) {
|
|
4909
|
+
return /* @__PURE__ */ jsx45(
|
|
4549
4910
|
"span",
|
|
4550
4911
|
{
|
|
4551
4912
|
ref,
|
|
4552
4913
|
"aria-hidden": true,
|
|
4553
|
-
...mergeProps(
|
|
4914
|
+
...mergeProps(partAttrs40(navAnatomy.scope, navAnatomy.indicator), props)
|
|
4554
4915
|
}
|
|
4555
4916
|
);
|
|
4556
4917
|
});
|
|
4557
|
-
var Label9 =
|
|
4558
|
-
return /* @__PURE__ */
|
|
4918
|
+
var Label9 = forwardRef43(function NavLabel(props, ref) {
|
|
4919
|
+
return /* @__PURE__ */ jsx45("span", { ref, ...mergeProps(partAttrs40(navAnatomy.scope, navAnatomy.label), props) });
|
|
4559
4920
|
});
|
|
4560
|
-
var Icon2 =
|
|
4561
|
-
return /* @__PURE__ */
|
|
4921
|
+
var Icon2 = forwardRef43(function NavIcon(props, ref) {
|
|
4922
|
+
return /* @__PURE__ */ jsx45("span", { ref, ...mergeProps(partAttrs40(navAnatomy.scope, navAnatomy.icon), props) });
|
|
4562
4923
|
});
|
|
4563
|
-
var Badge2 =
|
|
4564
|
-
return /* @__PURE__ */
|
|
4924
|
+
var Badge2 = forwardRef43(function NavBadge(props, ref) {
|
|
4925
|
+
return /* @__PURE__ */ jsx45("span", { ref, ...mergeProps(partAttrs40(navAnatomy.scope, navAnatomy.badge), props) });
|
|
4565
4926
|
});
|
|
4566
4927
|
var Nav = {
|
|
4567
|
-
Root:
|
|
4928
|
+
Root: Root37,
|
|
4568
4929
|
Item: Item8,
|
|
4569
4930
|
Indicator: Indicator3,
|
|
4570
4931
|
Label: Label9,
|
|
@@ -4573,22 +4934,22 @@ var Nav = {
|
|
|
4573
4934
|
};
|
|
4574
4935
|
|
|
4575
4936
|
// src/sticky-bar/index.tsx
|
|
4576
|
-
import { barAnatomy as barAnatomy2, partAttrs as
|
|
4937
|
+
import { barAnatomy as barAnatomy2, partAttrs as partAttrs41, scopeAttrs as scopeAttrs19 } from "@aeon-ui/core";
|
|
4577
4938
|
import { stickyBarMachine } from "@aeon-ui/primitives";
|
|
4578
4939
|
import {
|
|
4579
|
-
createContext as
|
|
4580
|
-
forwardRef as
|
|
4581
|
-
useContext as
|
|
4582
|
-
useMemo as
|
|
4940
|
+
createContext as createContext31,
|
|
4941
|
+
forwardRef as forwardRef44,
|
|
4942
|
+
useContext as useContext30,
|
|
4943
|
+
useMemo as useMemo27
|
|
4583
4944
|
} from "react";
|
|
4584
|
-
import { jsx as
|
|
4585
|
-
var StickyBarCtx =
|
|
4945
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
4946
|
+
var StickyBarCtx = createContext31(null);
|
|
4586
4947
|
function useStickyBarContext() {
|
|
4587
|
-
const ctx =
|
|
4948
|
+
const ctx = useContext30(StickyBarCtx);
|
|
4588
4949
|
if (!ctx) throw new Error("StickyBar parts must be used within StickyBar.Root");
|
|
4589
4950
|
return ctx;
|
|
4590
4951
|
}
|
|
4591
|
-
var
|
|
4952
|
+
var Root38 = forwardRef44(function StickyBarRoot({
|
|
4592
4953
|
/* Default div — AppShell.Header is already the landmark; nested <header> is invalid
|
|
4593
4954
|
HTML and browsers auto-close the outer header (0-height), so the bar covers content. */
|
|
4594
4955
|
as: Tag = "div",
|
|
@@ -4603,61 +4964,61 @@ var Root35 = forwardRef41(function StickyBarRoot({
|
|
|
4603
4964
|
});
|
|
4604
4965
|
const state = snapshot.value;
|
|
4605
4966
|
const offsetPx = snapshot.context.offsetPx;
|
|
4606
|
-
const value =
|
|
4967
|
+
const value = useMemo27(() => ({ state, offsetPx, send }), [state, offsetPx, send]);
|
|
4607
4968
|
if (state === "hidden") return null;
|
|
4608
4969
|
const stickyStyle = {
|
|
4609
4970
|
...typeof style === "object" && style ? style : {},
|
|
4610
4971
|
...offsetPx > 0 ? { ["--aeon-bar-offset"]: `${offsetPx}px` } : {}
|
|
4611
4972
|
};
|
|
4612
|
-
return /* @__PURE__ */
|
|
4973
|
+
return /* @__PURE__ */ jsx46(StickyBarCtx.Provider, { value, children: /* @__PURE__ */ jsx46(
|
|
4613
4974
|
Tag,
|
|
4614
4975
|
{
|
|
4615
4976
|
ref,
|
|
4616
4977
|
"data-aeon-placement": placement,
|
|
4617
4978
|
style: stickyStyle,
|
|
4618
|
-
...mergeProps(
|
|
4979
|
+
...mergeProps(scopeAttrs19(barAnatomy2.scope, barAnatomy2.root, { state }), rest),
|
|
4619
4980
|
children
|
|
4620
4981
|
}
|
|
4621
4982
|
) });
|
|
4622
4983
|
});
|
|
4623
|
-
var Zone2 =
|
|
4984
|
+
var Zone2 = forwardRef44(function StickyBarZone({ zone, ...rest }, ref) {
|
|
4624
4985
|
const { state } = useStickyBarContext();
|
|
4625
|
-
return /* @__PURE__ */
|
|
4986
|
+
return /* @__PURE__ */ jsx46(
|
|
4626
4987
|
"div",
|
|
4627
4988
|
{
|
|
4628
4989
|
ref,
|
|
4629
|
-
...mergeProps(
|
|
4990
|
+
...mergeProps(partAttrs41(barAnatomy2.scope, zone, { state }), rest)
|
|
4630
4991
|
}
|
|
4631
4992
|
);
|
|
4632
4993
|
});
|
|
4633
|
-
var Leading2 =
|
|
4994
|
+
var Leading2 = forwardRef44(
|
|
4634
4995
|
function StickyBarLeading(props, ref) {
|
|
4635
|
-
return /* @__PURE__ */
|
|
4996
|
+
return /* @__PURE__ */ jsx46(Zone2, { ref, zone: "leading", ...props });
|
|
4636
4997
|
}
|
|
4637
4998
|
);
|
|
4638
|
-
var Center =
|
|
4999
|
+
var Center = forwardRef44(
|
|
4639
5000
|
function StickyBarCenter(props, ref) {
|
|
4640
|
-
return /* @__PURE__ */
|
|
5001
|
+
return /* @__PURE__ */ jsx46(Zone2, { ref, zone: "center", ...props });
|
|
4641
5002
|
}
|
|
4642
5003
|
);
|
|
4643
|
-
var Trailing3 =
|
|
5004
|
+
var Trailing3 = forwardRef44(
|
|
4644
5005
|
function StickyBarTrailing(props, ref) {
|
|
4645
|
-
return /* @__PURE__ */
|
|
5006
|
+
return /* @__PURE__ */ jsx46(Zone2, { ref, zone: "trailing", ...props });
|
|
4646
5007
|
}
|
|
4647
5008
|
);
|
|
4648
|
-
var Seam =
|
|
5009
|
+
var Seam = forwardRef44(function StickyBarSeam(props, ref) {
|
|
4649
5010
|
const { state } = useStickyBarContext();
|
|
4650
|
-
return /* @__PURE__ */
|
|
5011
|
+
return /* @__PURE__ */ jsx46(
|
|
4651
5012
|
"div",
|
|
4652
5013
|
{
|
|
4653
5014
|
ref,
|
|
4654
5015
|
"aria-hidden": true,
|
|
4655
|
-
...mergeProps(
|
|
5016
|
+
...mergeProps(partAttrs41(barAnatomy2.scope, barAnatomy2.seam, { state }), props)
|
|
4656
5017
|
}
|
|
4657
5018
|
);
|
|
4658
5019
|
});
|
|
4659
5020
|
var StickyBar = {
|
|
4660
|
-
Root:
|
|
5021
|
+
Root: Root38,
|
|
4661
5022
|
Leading: Leading2,
|
|
4662
5023
|
Center,
|
|
4663
5024
|
Trailing: Trailing3,
|
|
@@ -4666,9 +5027,9 @@ var StickyBar = {
|
|
|
4666
5027
|
|
|
4667
5028
|
// src/hooks/use-layout-mode.ts
|
|
4668
5029
|
import { getCompactMq, layoutCompositionForMode, matchLayoutMode } from "@aeon-ui/core";
|
|
4669
|
-
import { useEffect as useEffect25, useMemo as
|
|
5030
|
+
import { useEffect as useEffect25, useMemo as useMemo28, useState as useState11 } from "react";
|
|
4670
5031
|
function useLayoutMode(spec) {
|
|
4671
|
-
const mq =
|
|
5032
|
+
const mq = useMemo28(() => getCompactMq(spec), [spec.compactMq]);
|
|
4672
5033
|
const [mode, setMode] = useState11(() => matchLayoutMode(spec, mq));
|
|
4673
5034
|
useEffect25(() => {
|
|
4674
5035
|
const sync = () => setMode(matchLayoutMode(spec, mq));
|
|
@@ -4676,11 +5037,51 @@ function useLayoutMode(spec) {
|
|
|
4676
5037
|
mq.addEventListener("change", sync);
|
|
4677
5038
|
return () => mq.removeEventListener("change", sync);
|
|
4678
5039
|
}, [spec, mq]);
|
|
4679
|
-
const composition =
|
|
5040
|
+
const composition = useMemo28(() => layoutCompositionForMode(spec, mode), [spec, mode]);
|
|
4680
5041
|
return { mode, composition };
|
|
4681
5042
|
}
|
|
5043
|
+
|
|
5044
|
+
// src/hooks/use-fit-text.ts
|
|
5045
|
+
import { useLayoutEffect as useLayoutEffect3 } from "react";
|
|
5046
|
+
function useFitText(slotRef, contentRef, opts = {}) {
|
|
5047
|
+
const maxPx = opts.maxPx ?? 28;
|
|
5048
|
+
const minPx = opts.minPx ?? 8;
|
|
5049
|
+
const watch = opts.watch;
|
|
5050
|
+
useLayoutEffect3(() => {
|
|
5051
|
+
const slot = slotRef.current;
|
|
5052
|
+
const content = contentRef.current;
|
|
5053
|
+
if (!slot || !content) return;
|
|
5054
|
+
const fit = () => {
|
|
5055
|
+
const available = slot.clientWidth;
|
|
5056
|
+
if (available <= 0) return;
|
|
5057
|
+
content.style.transform = "";
|
|
5058
|
+
content.style.transformOrigin = "";
|
|
5059
|
+
content.style.fontSize = `${maxPx}px`;
|
|
5060
|
+
let size = maxPx;
|
|
5061
|
+
while (size > minPx && content.scrollWidth > available + 0.5) {
|
|
5062
|
+
size -= 0.5;
|
|
5063
|
+
content.style.fontSize = `${size}px`;
|
|
5064
|
+
}
|
|
5065
|
+
if (content.scrollWidth > available + 0.5) {
|
|
5066
|
+
const scale = Math.max(0.35, available / content.scrollWidth);
|
|
5067
|
+
content.style.transformOrigin = "center center";
|
|
5068
|
+
content.style.transform = `scale(${scale})`;
|
|
5069
|
+
}
|
|
5070
|
+
};
|
|
5071
|
+
fit();
|
|
5072
|
+
const ro = new ResizeObserver(fit);
|
|
5073
|
+
ro.observe(slot);
|
|
5074
|
+
return () => {
|
|
5075
|
+
ro.disconnect();
|
|
5076
|
+
content.style.fontSize = "";
|
|
5077
|
+
content.style.transform = "";
|
|
5078
|
+
content.style.transformOrigin = "";
|
|
5079
|
+
};
|
|
5080
|
+
}, [slotRef, contentRef, maxPx, minPx, watch]);
|
|
5081
|
+
}
|
|
4682
5082
|
export {
|
|
4683
5083
|
Accordion,
|
|
5084
|
+
AppNav,
|
|
4684
5085
|
AppShell,
|
|
4685
5086
|
Async,
|
|
4686
5087
|
AsyncActions,
|
|
@@ -4709,11 +5110,13 @@ export {
|
|
|
4709
5110
|
Popover,
|
|
4710
5111
|
ProfileHeader,
|
|
4711
5112
|
Progress,
|
|
5113
|
+
Prompt,
|
|
4712
5114
|
RadioGroup,
|
|
4713
5115
|
Scroll,
|
|
4714
5116
|
Select,
|
|
4715
5117
|
Separator,
|
|
4716
5118
|
Slider,
|
|
5119
|
+
StatusBanner,
|
|
4717
5120
|
StickyBar,
|
|
4718
5121
|
Switch,
|
|
4719
5122
|
Tabs,
|
|
@@ -4726,10 +5129,13 @@ export {
|
|
|
4726
5129
|
createAsyncMachine2 as createAsyncMachine,
|
|
4727
5130
|
fieldMachine,
|
|
4728
5131
|
useAeonMachine,
|
|
5132
|
+
useAppNav,
|
|
5133
|
+
useAppNavMachine,
|
|
4729
5134
|
useAppShellContext,
|
|
4730
5135
|
useAsyncContext,
|
|
4731
5136
|
useContentContext,
|
|
4732
5137
|
useFieldContext,
|
|
5138
|
+
useFitText,
|
|
4733
5139
|
useLayoutMode,
|
|
4734
5140
|
useScrollContext,
|
|
4735
5141
|
useScrollState,
|