@ably/ui 15.6.0-dev.1a416b3 → 15.6.0-dev.46254f5
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/core/Flyout.js +1 -1
- package/core/Flyout.js.map +1 -1
- package/core/Footer.js +1 -1
- package/core/Footer.js.map +1 -1
- package/core/Header.js +1 -1
- package/core/Header.js.map +1 -1
- package/core/LegacyMeganav/MeganavBlogPostsList/component.js +2 -0
- package/core/LegacyMeganav/MeganavBlogPostsList/component.js.map +1 -0
- package/core/LegacyMeganav/MeganavControl/component.js +2 -0
- package/core/LegacyMeganav/MeganavControl/component.js.map +1 -0
- package/core/LegacyMeganav/MeganavControlMobileDropdown/component.js +2 -0
- package/core/LegacyMeganav/MeganavControlMobileDropdown/component.js.map +1 -0
- package/core/LegacyMeganav/MeganavControlMobilePanelClose/component.js +2 -0
- package/core/LegacyMeganav/MeganavControlMobilePanelClose/component.js.map +1 -0
- package/core/LegacyMeganav/MeganavControlMobilePanelOpen/component.js +2 -0
- package/core/LegacyMeganav/MeganavControlMobilePanelOpen/component.js.map +1 -0
- package/core/LegacyMeganav/MeganavSearchAutocomplete/component.js +2 -0
- package/core/LegacyMeganav/MeganavSearchAutocomplete/component.js.map +1 -0
- package/core/LegacyMeganav/MeganavSearchSuggestions/component.js +2 -0
- package/core/LegacyMeganav/MeganavSearchSuggestions/component.js.map +1 -0
- package/core/LegacyMeganav/component.js +2 -0
- package/core/{Meganav → LegacyMeganav}/component.js.map +1 -1
- package/core/LegacyMeganav.js +2 -0
- package/core/{Meganav.js.map → LegacyMeganav.js.map} +1 -1
- package/core/Meganav/Meganav.js +2 -0
- package/core/Meganav/Meganav.js.map +1 -0
- package/core/Meganav/MeganavMobile.js +2 -0
- package/core/Meganav/MeganavMobile.js.map +1 -0
- package/core/Meganav/MeganavPanel.js +2 -0
- package/core/Meganav/MeganavPanel.js.map +1 -0
- package/core/Meganav/data.js +2 -0
- package/core/Meganav/data.js.map +1 -0
- package/core/Meganav/images/fan-engagement-nav-image.png +0 -0
- package/core/Meganav/images/founders-nav-image.png +0 -0
- package/core/MeganavBlogPostsList.js.map +1 -1
- package/core/MeganavContentCompany.js.map +1 -1
- package/core/MeganavContentDevelopers.js.map +1 -1
- package/core/MeganavContentProducts.js.map +1 -1
- package/core/MeganavContentUseCases.js.map +1 -1
- package/core/MeganavControl.js.map +1 -1
- package/core/MeganavControlMobileDropdown.js.map +1 -1
- package/core/MeganavItemsDesktop.js +1 -1
- package/core/MeganavItemsDesktop.js.map +1 -1
- package/core/MeganavItemsMobile.js +1 -1
- package/core/MeganavItemsMobile.js.map +1 -1
- package/core/MeganavItemsSignedIn.js.map +1 -1
- package/core/MeganavSearch.js.map +1 -1
- package/core/MeganavSearchPanel.js.map +1 -1
- package/core/MeganavSearchSuggestions.js.map +1 -1
- package/core/Notice.js +1 -1
- package/core/Notice.js.map +1 -1
- package/core/SignOutLink.js.map +1 -1
- package/core/images/award/g2-best-meets-requirements-2025.png +0 -0
- package/core/images/award/g2-best-support-2025.png +0 -0
- package/core/images/award/g2-high-performer-2025.png +0 -0
- package/core/images/award/g2-users-most-likely-to-recommend-2025.png +0 -0
- package/core/images/g2-best-meets-requirements-2025.svg +10 -0
- package/core/images/g2-best-support-2025.svg +10 -0
- package/core/images/g2-high-performer-2025.svg +9 -0
- package/core/images/g2-users-most-likely-to-recommend-2025.svg +10 -0
- package/index.d.ts +215 -131
- package/package.json +11 -13
- package/core/Meganav/component.js +0 -2
- package/core/Meganav.js +0 -2
- package/core/MeganavBlogPostsList/component.js +0 -2
- package/core/MeganavBlogPostsList/component.js.map +0 -1
- package/core/MeganavControl/component.js +0 -2
- package/core/MeganavControl/component.js.map +0 -1
- package/core/MeganavControlMobileDropdown/component.js +0 -2
- package/core/MeganavControlMobileDropdown/component.js.map +0 -1
- package/core/MeganavControlMobilePanelClose/component.js +0 -2
- package/core/MeganavControlMobilePanelClose/component.js.map +0 -1
- package/core/MeganavControlMobilePanelOpen/component.js +0 -2
- package/core/MeganavControlMobilePanelOpen/component.js.map +0 -1
- package/core/MeganavSearchAutocomplete/component.js +0 -2
- package/core/MeganavSearchAutocomplete/component.js.map +0 -1
- package/core/MeganavSearchSuggestions/component.js +0 -2
- package/core/MeganavSearchSuggestions/component.js.map +0 -1
- /package/core/{Meganav → LegacyMeganav}/component.css +0 -0
- /package/core/{Meganav → LegacyMeganav}/component.json +0 -0
package/index.d.ts
CHANGED
|
@@ -475,9 +475,9 @@ type FlyoutProps = {
|
|
|
475
475
|
*/
|
|
476
476
|
menuItems: {
|
|
477
477
|
/**
|
|
478
|
-
*
|
|
478
|
+
* name for the menu item.
|
|
479
479
|
*/
|
|
480
|
-
|
|
480
|
+
name: string;
|
|
481
481
|
/**
|
|
482
482
|
* Optional content to be displayed in the flyout panel.
|
|
483
483
|
*/
|
|
@@ -521,10 +521,10 @@ declare module '@ably/ui/core/Footer' {
|
|
|
521
521
|
type FooterProps = {
|
|
522
522
|
paths: {
|
|
523
523
|
ablyStack: string;
|
|
524
|
-
highestPerformer: string;
|
|
525
|
-
highestUserAdoption: string;
|
|
526
524
|
bestSupport: string;
|
|
527
|
-
|
|
525
|
+
highPerformer: string;
|
|
526
|
+
usersMostLikely: string;
|
|
527
|
+
bestMeetsRequirements: string;
|
|
528
528
|
};
|
|
529
529
|
urlBase: string;
|
|
530
530
|
statusUrl: string;
|
|
@@ -545,6 +545,7 @@ export const HeaderLinks: React.FC<Pick<HeaderProps, "sessionState" | "headerLin
|
|
|
545
545
|
|
|
546
546
|
declare module '@ably/ui/core/Header' {
|
|
547
547
|
import React, { ReactNode } from "react";
|
|
548
|
+
import { NoticeProps } from "@ably/ui/core/Notice";
|
|
548
549
|
export type ThemedScrollpoint = {
|
|
549
550
|
id: string;
|
|
550
551
|
className: string;
|
|
@@ -579,6 +580,7 @@ export type HeaderSessionState = {
|
|
|
579
580
|
* Props for the Header component.
|
|
580
581
|
*/
|
|
581
582
|
export type HeaderProps = {
|
|
583
|
+
headerClassName?: string;
|
|
582
584
|
/**
|
|
583
585
|
* Optional search bar element.
|
|
584
586
|
*/
|
|
@@ -631,6 +633,14 @@ export type HeaderProps = {
|
|
|
631
633
|
* - "mobile": Visible only on mobile devices.
|
|
632
634
|
*/
|
|
633
635
|
searchButtonVisibility?: "all" | "desktop" | "mobile";
|
|
636
|
+
/**
|
|
637
|
+
Props for the notice component to be displayed in the header.
|
|
638
|
+
*/
|
|
639
|
+
notice: NoticeProps;
|
|
640
|
+
/**
|
|
641
|
+
Reference to the notice DOM element for handling visibility and overflow.
|
|
642
|
+
*/
|
|
643
|
+
noticeRef: React.RefObject<HTMLDivElement>;
|
|
634
644
|
};
|
|
635
645
|
const Header: React.FC<HeaderProps>;
|
|
636
646
|
export default Header;
|
|
@@ -683,50 +693,63 @@ export default Icon;
|
|
|
683
693
|
//# sourceMappingURL=Icon.d.ts.map
|
|
684
694
|
}
|
|
685
695
|
|
|
686
|
-
declare module '@ably/ui/core/
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
iconColor?: ColorClass | ColorThemeSet;
|
|
694
|
-
} & React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
695
|
-
const LinkButton: React.FC<LinkButtonProps>;
|
|
696
|
-
export default LinkButton;
|
|
697
|
-
//# sourceMappingURL=LinkButton.d.ts.map
|
|
696
|
+
declare module '@ably/ui/core/LegacyMeganav/MeganavControl/component' {
|
|
697
|
+
export default MeganavControl;
|
|
698
|
+
function MeganavControl(): {
|
|
699
|
+
teardown: () => void;
|
|
700
|
+
clear: () => void;
|
|
701
|
+
}[];
|
|
702
|
+
//# sourceMappingURL=component.d.ts.map
|
|
698
703
|
}
|
|
699
704
|
|
|
700
|
-
declare module '@ably/ui/core/
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
+
declare module '@ably/ui/core/LegacyMeganav/MeganavControlMobileDropdown/component' {
|
|
706
|
+
export default MeganavControlMobileDropdown;
|
|
707
|
+
function MeganavControlMobileDropdown({ clearPanels }: {
|
|
708
|
+
clearPanels: any;
|
|
709
|
+
}): {
|
|
710
|
+
teardown: () => void;
|
|
711
|
+
clear: () => void;
|
|
705
712
|
};
|
|
706
|
-
|
|
707
|
-
export default Loader;
|
|
708
|
-
//# sourceMappingURL=Loader.d.ts.map
|
|
713
|
+
//# sourceMappingURL=component.d.ts.map
|
|
709
714
|
}
|
|
710
715
|
|
|
711
|
-
declare module '@ably/ui/core/
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
logoAlt?: string;
|
|
717
|
-
href?: string;
|
|
718
|
-
additionalImgAttrs?: object;
|
|
719
|
-
additionalLinkAttrs?: object;
|
|
720
|
-
theme?: "light" | "dark";
|
|
721
|
-
variant?: "default" | "mono";
|
|
722
|
-
orientation?: "default" | "stacked";
|
|
723
|
-
};
|
|
724
|
-
const _default: React.MemoExoticComponent<({ dataId, href, additionalImgAttrs, additionalLinkAttrs, theme, variant, orientation, logoUrl, logoAlt, }: LogoProps) => import("react/jsx-runtime").JSX.Element>;
|
|
716
|
+
declare module '@ably/ui/core/LegacyMeganav/MeganavControlMobilePanelClose/component' {
|
|
717
|
+
function _default(): {
|
|
718
|
+
teardown: () => void;
|
|
719
|
+
clear: () => void;
|
|
720
|
+
}[];
|
|
725
721
|
export default _default;
|
|
726
|
-
//# sourceMappingURL=
|
|
722
|
+
//# sourceMappingURL=component.d.ts.map
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
declare module '@ably/ui/core/LegacyMeganav/MeganavControlMobilePanelOpen/component' {
|
|
726
|
+
function _default(): {
|
|
727
|
+
teardown: () => void;
|
|
728
|
+
clear: () => void;
|
|
729
|
+
}[];
|
|
730
|
+
export default _default;
|
|
731
|
+
//# sourceMappingURL=component.d.ts.map
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
declare module '@ably/ui/core/LegacyMeganav/MeganavSearchAutocomplete/component' {
|
|
735
|
+
function _default(apiKey: any): {
|
|
736
|
+
teardown: () => void;
|
|
737
|
+
clear: () => void;
|
|
738
|
+
}[];
|
|
739
|
+
export default _default;
|
|
740
|
+
//# sourceMappingURL=component.d.ts.map
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
declare module '@ably/ui/core/LegacyMeganav/MeganavSearchSuggestions/component' {
|
|
744
|
+
export default MeganavSearchSuggestions;
|
|
745
|
+
function MeganavSearchSuggestions(): {
|
|
746
|
+
teardown: () => void;
|
|
747
|
+
clear: () => void;
|
|
748
|
+
};
|
|
749
|
+
//# sourceMappingURL=component.d.ts.map
|
|
727
750
|
}
|
|
728
751
|
|
|
729
|
-
declare module '@ably/ui/core/
|
|
752
|
+
declare module '@ably/ui/core/LegacyMeganav/component' {
|
|
730
753
|
export default function Meganav({ themeName, addSearchApiKey }: {
|
|
731
754
|
themeName: any;
|
|
732
755
|
addSearchApiKey: any;
|
|
@@ -734,7 +757,7 @@ export default function Meganav({ themeName, addSearchApiKey }: {
|
|
|
734
757
|
//# sourceMappingURL=component.d.ts.map
|
|
735
758
|
}
|
|
736
759
|
|
|
737
|
-
declare module '@ably/ui/core/
|
|
760
|
+
declare module '@ably/ui/core/LegacyMeganav' {
|
|
738
761
|
import { ReactNode } from "react";
|
|
739
762
|
import { ColorClass } from "@ably/ui/core/styles/colors/types";
|
|
740
763
|
export type MeganavTheme = {
|
|
@@ -788,23 +811,26 @@ export type MeganavSessionState = {
|
|
|
788
811
|
href: string;
|
|
789
812
|
};
|
|
790
813
|
};
|
|
791
|
-
type
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
cookieId: string;
|
|
804
|
-
noticeId: string;
|
|
814
|
+
export type MeganavNoticeProps = {
|
|
815
|
+
props: {
|
|
816
|
+
title: string;
|
|
817
|
+
bodyText: string;
|
|
818
|
+
buttonLink: string;
|
|
819
|
+
buttonLabel: string;
|
|
820
|
+
closeBtn: boolean;
|
|
821
|
+
};
|
|
822
|
+
config: {
|
|
823
|
+
cookieId: string;
|
|
824
|
+
noticeId: string | number;
|
|
825
|
+
options: {
|
|
805
826
|
collapse: boolean;
|
|
806
827
|
};
|
|
807
828
|
};
|
|
829
|
+
};
|
|
830
|
+
type MeganavProps = {
|
|
831
|
+
paths?: MeganavPaths;
|
|
832
|
+
themeName: "white" | "black" | "transparentToWhite";
|
|
833
|
+
notice?: MeganavNoticeProps;
|
|
808
834
|
loginLink?: string;
|
|
809
835
|
urlBase?: string;
|
|
810
836
|
addSearchApiKey: string;
|
|
@@ -813,11 +839,121 @@ type MeganavProps = {
|
|
|
813
839
|
};
|
|
814
840
|
const Meganav: ({ paths, themeName, notice, loginLink, urlBase, addSearchApiKey, statusUrl, searchDataId, }: MeganavProps) => import("react/jsx-runtime").JSX.Element;
|
|
815
841
|
export default Meganav;
|
|
842
|
+
//# sourceMappingURL=LegacyMeganav.d.ts.map
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
declare module '@ably/ui/core/LinkButton' {
|
|
846
|
+
import React from "react";
|
|
847
|
+
import { ButtonPropsBase } from "@ably/ui/core/Button";
|
|
848
|
+
import { ColorClass, ColorThemeSet } from "@ably/ui/core/styles/colors/types";
|
|
849
|
+
export type LinkButtonProps = ButtonPropsBase & {
|
|
850
|
+
disabled?: boolean;
|
|
851
|
+
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
852
|
+
iconColor?: ColorClass | ColorThemeSet;
|
|
853
|
+
} & React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
854
|
+
const LinkButton: React.FC<LinkButtonProps>;
|
|
855
|
+
export default LinkButton;
|
|
856
|
+
//# sourceMappingURL=LinkButton.d.ts.map
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
declare module '@ably/ui/core/Loader' {
|
|
860
|
+
type LoaderProps = {
|
|
861
|
+
size?: string;
|
|
862
|
+
ringColor?: string;
|
|
863
|
+
additionalCSS?: string;
|
|
864
|
+
};
|
|
865
|
+
const Loader: ({ ringColor, size, additionalCSS, }: LoaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
866
|
+
export default Loader;
|
|
867
|
+
//# sourceMappingURL=Loader.d.ts.map
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
declare module '@ably/ui/core/Logo' {
|
|
871
|
+
import React from "react";
|
|
872
|
+
type LogoProps = {
|
|
873
|
+
dataId?: string;
|
|
874
|
+
logoUrl?: string;
|
|
875
|
+
logoAlt?: string;
|
|
876
|
+
href?: string;
|
|
877
|
+
additionalImgAttrs?: object;
|
|
878
|
+
additionalLinkAttrs?: object;
|
|
879
|
+
theme?: "light" | "dark";
|
|
880
|
+
variant?: "default" | "mono";
|
|
881
|
+
orientation?: "default" | "stacked";
|
|
882
|
+
};
|
|
883
|
+
const _default: React.MemoExoticComponent<({ dataId, href, additionalImgAttrs, additionalLinkAttrs, theme, variant, orientation, logoUrl, logoAlt, }: LogoProps) => import("react/jsx-runtime").JSX.Element>;
|
|
884
|
+
export default _default;
|
|
885
|
+
//# sourceMappingURL=Logo.d.ts.map
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
declare module '@ably/ui/core/Meganav/Meganav' {
|
|
889
|
+
import { HeaderSessionState } from ".@ably/ui/core/Header";
|
|
890
|
+
import { NoticeProps } from ".@ably/ui/core/Notice";
|
|
891
|
+
export type MeganavProps = {
|
|
892
|
+
sessionState: HeaderSessionState;
|
|
893
|
+
searchDataId: string;
|
|
894
|
+
notice: NoticeProps;
|
|
895
|
+
};
|
|
896
|
+
const Meganav: ({ sessionState, searchDataId, notice }: MeganavProps) => import("react/jsx-runtime").JSX.Element;
|
|
897
|
+
export default Meganav;
|
|
816
898
|
//# sourceMappingURL=Meganav.d.ts.map
|
|
817
899
|
}
|
|
818
900
|
|
|
901
|
+
declare module '@ably/ui/core/Meganav/MeganavMobile' {
|
|
902
|
+
import { AccordionData } from ".@ably/ui/core/Accordion/types";
|
|
903
|
+
export const MeganavMobile: ({ mobileNavItems, }: {
|
|
904
|
+
mobileNavItems: AccordionData[];
|
|
905
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
906
|
+
//# sourceMappingURL=MeganavMobile.d.ts.map
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
declare module '@ably/ui/core/Meganav/MeganavPanel' {
|
|
910
|
+
import React from "react";
|
|
911
|
+
import { FlyoutPanelHighlight, FlyoutPanelList } from "@ably/ui/core/data";
|
|
912
|
+
export const MeganavPanel: ({ displayProductTile, panelLeft, panelLeftClassName, panelRightHeading, panelRightItems, panelRightBottom, }: {
|
|
913
|
+
displayProductTile?: boolean;
|
|
914
|
+
panelLeft?: FlyoutPanelHighlight;
|
|
915
|
+
panelLeftClassName?: string;
|
|
916
|
+
panelRightHeading?: string;
|
|
917
|
+
panelRightItems: FlyoutPanelList[];
|
|
918
|
+
panelRightBottom?: React.ReactNode;
|
|
919
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
920
|
+
//# sourceMappingURL=MeganavPanel.d.ts.map
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
declare module '@ably/ui/core/Meganav/data' {
|
|
924
|
+
import React from "react";
|
|
925
|
+
import { IconName } from ".@ably/ui/core/Icon/types";
|
|
926
|
+
export type FlyoutPanelList = {
|
|
927
|
+
label: string;
|
|
928
|
+
icon: IconName;
|
|
929
|
+
link: string;
|
|
930
|
+
isMobile?: boolean;
|
|
931
|
+
};
|
|
932
|
+
export type FlyoutPanelHighlight = {
|
|
933
|
+
heading: string;
|
|
934
|
+
content: string;
|
|
935
|
+
labelLink: string;
|
|
936
|
+
url: string;
|
|
937
|
+
image: string;
|
|
938
|
+
};
|
|
939
|
+
export type MenuItem = {
|
|
940
|
+
name: string;
|
|
941
|
+
link?: string;
|
|
942
|
+
isHiddenMobile?: boolean;
|
|
943
|
+
content?: React.ReactNode;
|
|
944
|
+
panelClassName?: string;
|
|
945
|
+
};
|
|
946
|
+
export const menuItemLinks: {
|
|
947
|
+
name: string;
|
|
948
|
+
link: string;
|
|
949
|
+
isHiddenMobile: boolean;
|
|
950
|
+
}[];
|
|
951
|
+
export const menuItemsForHeader: MenuItem[];
|
|
952
|
+
//# sourceMappingURL=data.d.ts.map
|
|
953
|
+
}
|
|
954
|
+
|
|
819
955
|
declare module '@ably/ui/core/MeganavBlogPostsList' {
|
|
820
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
956
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
821
957
|
type MeganavBlogPostsListProps = {
|
|
822
958
|
recentBlogPosts: {
|
|
823
959
|
link: string;
|
|
@@ -832,7 +968,7 @@ export default MeganavBlogPostsList;
|
|
|
832
968
|
}
|
|
833
969
|
|
|
834
970
|
declare module '@ably/ui/core/MeganavContentCompany' {
|
|
835
|
-
import { AbsUrl, MeganavPaths } from "@ably/ui/core/
|
|
971
|
+
import { AbsUrl, MeganavPaths } from "@ably/ui/core/LegacyMeganav";
|
|
836
972
|
type MeganavContentCompanyProps = {
|
|
837
973
|
absUrl: AbsUrl;
|
|
838
974
|
paths?: MeganavPaths;
|
|
@@ -843,7 +979,7 @@ export default MeganavContentCompany;
|
|
|
843
979
|
}
|
|
844
980
|
|
|
845
981
|
declare module '@ably/ui/core/MeganavContentDevelopers' {
|
|
846
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
982
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
847
983
|
const MeganavContentDevelopers: ({ absUrl, statusUrl, }: {
|
|
848
984
|
absUrl: AbsUrl;
|
|
849
985
|
statusUrl: string;
|
|
@@ -853,7 +989,7 @@ export default MeganavContentDevelopers;
|
|
|
853
989
|
}
|
|
854
990
|
|
|
855
991
|
declare module '@ably/ui/core/MeganavContentProducts' {
|
|
856
|
-
import { AbsUrl, MeganavPaths } from "@ably/ui/core/
|
|
992
|
+
import { AbsUrl, MeganavPaths } from "@ably/ui/core/LegacyMeganav";
|
|
857
993
|
type MeganavContentProductsProps = {
|
|
858
994
|
paths?: MeganavPaths;
|
|
859
995
|
absUrl: AbsUrl;
|
|
@@ -864,7 +1000,7 @@ export default MeganavContentProducts;
|
|
|
864
1000
|
}
|
|
865
1001
|
|
|
866
1002
|
declare module '@ably/ui/core/MeganavContentUseCases' {
|
|
867
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1003
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
868
1004
|
const MeganavContentUseCases: ({ absUrl }: {
|
|
869
1005
|
absUrl: AbsUrl;
|
|
870
1006
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -872,18 +1008,9 @@ export default MeganavContentUseCases;
|
|
|
872
1008
|
//# sourceMappingURL=MeganavContentUseCases.d.ts.map
|
|
873
1009
|
}
|
|
874
1010
|
|
|
875
|
-
declare module '@ably/ui/core/MeganavControl/component' {
|
|
876
|
-
export default MeganavControl;
|
|
877
|
-
function MeganavControl(): {
|
|
878
|
-
teardown: () => void;
|
|
879
|
-
clear: () => void;
|
|
880
|
-
}[];
|
|
881
|
-
//# sourceMappingURL=component.d.ts.map
|
|
882
|
-
}
|
|
883
|
-
|
|
884
1011
|
declare module '@ably/ui/core/MeganavControl' {
|
|
885
1012
|
import { ReactNode } from "react";
|
|
886
|
-
import { MeganavTheme } from "@ably/ui/core/
|
|
1013
|
+
import { MeganavTheme } from "@ably/ui/core/LegacyMeganav";
|
|
887
1014
|
type MeganavControlProps = {
|
|
888
1015
|
ariaControls: string;
|
|
889
1016
|
ariaLabel: string;
|
|
@@ -896,19 +1023,8 @@ export default MeganavControl;
|
|
|
896
1023
|
//# sourceMappingURL=MeganavControl.d.ts.map
|
|
897
1024
|
}
|
|
898
1025
|
|
|
899
|
-
declare module '@ably/ui/core/MeganavControlMobileDropdown/component' {
|
|
900
|
-
export default MeganavControlMobileDropdown;
|
|
901
|
-
function MeganavControlMobileDropdown({ clearPanels }: {
|
|
902
|
-
clearPanels: any;
|
|
903
|
-
}): {
|
|
904
|
-
teardown: () => void;
|
|
905
|
-
clear: () => void;
|
|
906
|
-
};
|
|
907
|
-
//# sourceMappingURL=component.d.ts.map
|
|
908
|
-
}
|
|
909
|
-
|
|
910
1026
|
declare module '@ably/ui/core/MeganavControlMobileDropdown' {
|
|
911
|
-
import { MeganavTheme } from "@ably/ui/core/
|
|
1027
|
+
import { MeganavTheme } from "@ably/ui/core/LegacyMeganav";
|
|
912
1028
|
const MeganavControlMobileDropdown: ({ theme }: {
|
|
913
1029
|
theme: MeganavTheme;
|
|
914
1030
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -916,15 +1032,6 @@ export default MeganavControlMobileDropdown;
|
|
|
916
1032
|
//# sourceMappingURL=MeganavControlMobileDropdown.d.ts.map
|
|
917
1033
|
}
|
|
918
1034
|
|
|
919
|
-
declare module '@ably/ui/core/MeganavControlMobilePanelClose/component' {
|
|
920
|
-
function _default(): {
|
|
921
|
-
teardown: () => void;
|
|
922
|
-
clear: () => void;
|
|
923
|
-
}[];
|
|
924
|
-
export default _default;
|
|
925
|
-
//# sourceMappingURL=component.d.ts.map
|
|
926
|
-
}
|
|
927
|
-
|
|
928
1035
|
declare module '@ably/ui/core/MeganavControlMobilePanelClose' {
|
|
929
1036
|
type MeganavControlMobilePanelCloseProps = {
|
|
930
1037
|
ariaControls: string;
|
|
@@ -935,15 +1042,6 @@ export default MeganavControlMobilePanelClose;
|
|
|
935
1042
|
//# sourceMappingURL=MeganavControlMobilePanelClose.d.ts.map
|
|
936
1043
|
}
|
|
937
1044
|
|
|
938
|
-
declare module '@ably/ui/core/MeganavControlMobilePanelOpen/component' {
|
|
939
|
-
function _default(): {
|
|
940
|
-
teardown: () => void;
|
|
941
|
-
clear: () => void;
|
|
942
|
-
}[];
|
|
943
|
-
export default _default;
|
|
944
|
-
//# sourceMappingURL=component.d.ts.map
|
|
945
|
-
}
|
|
946
|
-
|
|
947
1045
|
declare module '@ably/ui/core/MeganavControlMobilePanelOpen' {
|
|
948
1046
|
import { ReactNode } from "react";
|
|
949
1047
|
type MeganavControlMobilePanelOpenProps = {
|
|
@@ -957,7 +1055,7 @@ export default MeganavControlMobilePanelOpen;
|
|
|
957
1055
|
|
|
958
1056
|
declare module '@ably/ui/core/MeganavItemsDesktop' {
|
|
959
1057
|
import React from "react";
|
|
960
|
-
import { AbsUrl, MeganavPanels, MeganavPaths, MeganavTheme } from "@ably/ui/core/
|
|
1058
|
+
import { AbsUrl, MeganavPanels, MeganavPaths, MeganavTheme } from "@ably/ui/core/LegacyMeganav";
|
|
961
1059
|
type MeganavDesktopItems = {
|
|
962
1060
|
panels: MeganavPanels;
|
|
963
1061
|
paths?: MeganavPaths;
|
|
@@ -973,7 +1071,7 @@ export default _default;
|
|
|
973
1071
|
|
|
974
1072
|
declare module '@ably/ui/core/MeganavItemsMobile' {
|
|
975
1073
|
import React from "react";
|
|
976
|
-
import { AbsUrl, MeganavPanels, MeganavPaths, MeganavSessionState, MeganavTheme } from "@ably/ui/core/
|
|
1074
|
+
import { AbsUrl, MeganavPanels, MeganavPaths, MeganavSessionState, MeganavTheme } from "@ably/ui/core/LegacyMeganav";
|
|
977
1075
|
type MeganavItemsMobileProps = {
|
|
978
1076
|
panels: MeganavPanels;
|
|
979
1077
|
paths?: MeganavPaths;
|
|
@@ -990,7 +1088,7 @@ export default _default;
|
|
|
990
1088
|
}
|
|
991
1089
|
|
|
992
1090
|
declare module '@ably/ui/core/MeganavItemsSignedIn' {
|
|
993
|
-
import { AbsUrl, MeganavSessionState, MeganavTheme } from "@ably/ui/core/
|
|
1091
|
+
import { AbsUrl, MeganavSessionState, MeganavTheme } from "@ably/ui/core/LegacyMeganav";
|
|
994
1092
|
type MeganavItemsSignedIn = {
|
|
995
1093
|
sessionState: MeganavSessionState;
|
|
996
1094
|
theme: MeganavTheme;
|
|
@@ -1003,7 +1101,7 @@ export default MeganavItemsSignedIn;
|
|
|
1003
1101
|
}
|
|
1004
1102
|
|
|
1005
1103
|
declare module '@ably/ui/core/MeganavSearch' {
|
|
1006
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1104
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
1007
1105
|
const MeganavSearch: ({ absUrl, dataId, }: {
|
|
1008
1106
|
absUrl: AbsUrl;
|
|
1009
1107
|
dataId?: string;
|
|
@@ -1012,15 +1110,6 @@ export default MeganavSearch;
|
|
|
1012
1110
|
//# sourceMappingURL=MeganavSearch.d.ts.map
|
|
1013
1111
|
}
|
|
1014
1112
|
|
|
1015
|
-
declare module '@ably/ui/core/MeganavSearchAutocomplete/component' {
|
|
1016
|
-
function _default(apiKey: any): {
|
|
1017
|
-
teardown: () => void;
|
|
1018
|
-
clear: () => void;
|
|
1019
|
-
}[];
|
|
1020
|
-
export default _default;
|
|
1021
|
-
//# sourceMappingURL=component.d.ts.map
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
1113
|
declare module '@ably/ui/core/MeganavSearchAutocomplete' {
|
|
1025
1114
|
const MeganavSearchAutocomplete: () => import("react/jsx-runtime").JSX.Element;
|
|
1026
1115
|
export default MeganavSearchAutocomplete;
|
|
@@ -1028,7 +1117,7 @@ export default MeganavSearchAutocomplete;
|
|
|
1028
1117
|
}
|
|
1029
1118
|
|
|
1030
1119
|
declare module '@ably/ui/core/MeganavSearchPanel' {
|
|
1031
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1120
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
1032
1121
|
const MeganavSearchPanel: ({ absUrl }: {
|
|
1033
1122
|
absUrl: AbsUrl;
|
|
1034
1123
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1036,17 +1125,8 @@ export default MeganavSearchPanel;
|
|
|
1036
1125
|
//# sourceMappingURL=MeganavSearchPanel.d.ts.map
|
|
1037
1126
|
}
|
|
1038
1127
|
|
|
1039
|
-
declare module '@ably/ui/core/MeganavSearchSuggestions/component' {
|
|
1040
|
-
export default MeganavSearchSuggestions;
|
|
1041
|
-
function MeganavSearchSuggestions(): {
|
|
1042
|
-
teardown: () => void;
|
|
1043
|
-
clear: () => void;
|
|
1044
|
-
};
|
|
1045
|
-
//# sourceMappingURL=component.d.ts.map
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
1128
|
declare module '@ably/ui/core/MeganavSearchSuggestions' {
|
|
1049
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1129
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
1050
1130
|
type MeganavSearchSuggestionsProps = {
|
|
1051
1131
|
absUrl: AbsUrl;
|
|
1052
1132
|
displaySupportLink: boolean;
|
|
@@ -1068,19 +1148,23 @@ function Notice({ bannerContainer, cookieId, noticeId, options }: {
|
|
|
1068
1148
|
}
|
|
1069
1149
|
|
|
1070
1150
|
declare module '@ably/ui/core/Notice' {
|
|
1071
|
-
|
|
1151
|
+
import React from "react";
|
|
1152
|
+
import { ColorClass, ColorThemeSet } from "@ably/ui/core/styles/colors/types";
|
|
1153
|
+
export type NoticeProps = {
|
|
1072
1154
|
buttonLink?: string;
|
|
1073
1155
|
buttonLabel?: string;
|
|
1074
1156
|
bodyText?: string;
|
|
1075
1157
|
title?: string;
|
|
1076
1158
|
closeBtn?: boolean;
|
|
1077
1159
|
config?: {
|
|
1078
|
-
|
|
1079
|
-
|
|
1160
|
+
options: {
|
|
1161
|
+
collapse: boolean;
|
|
1162
|
+
};
|
|
1163
|
+
noticeId: string | number;
|
|
1080
1164
|
cookieId: string;
|
|
1081
1165
|
};
|
|
1082
1166
|
bgColor?: string;
|
|
1083
|
-
textColor?:
|
|
1167
|
+
textColor?: ColorClass | ColorThemeSet;
|
|
1084
1168
|
bannerContainer?: Element | null;
|
|
1085
1169
|
cookieId?: string;
|
|
1086
1170
|
noticeId?: string;
|
|
@@ -1088,7 +1172,7 @@ type NoticeProps = {
|
|
|
1088
1172
|
collapse: boolean;
|
|
1089
1173
|
};
|
|
1090
1174
|
};
|
|
1091
|
-
const Notice:
|
|
1175
|
+
const Notice: React.ForwardRefExoticComponent<NoticeProps & React.RefAttributes<HTMLDivElement>>;
|
|
1092
1176
|
export default Notice;
|
|
1093
1177
|
//# sourceMappingURL=Notice.d.ts.map
|
|
1094
1178
|
}
|
|
@@ -1270,7 +1354,7 @@ export default ProductTile;
|
|
|
1270
1354
|
|
|
1271
1355
|
declare module '@ably/ui/core/SignOutLink' {
|
|
1272
1356
|
import { MouseEventHandler, ReactNode } from "react";
|
|
1273
|
-
import { AbsUrl } from "@ably/ui/core/
|
|
1357
|
+
import { AbsUrl } from "@ably/ui/core/LegacyMeganav";
|
|
1274
1358
|
type SignOutLinkProps = {
|
|
1275
1359
|
token: string;
|
|
1276
1360
|
href: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ably/ui",
|
|
3
|
-
"version": "15.6.0-dev.
|
|
3
|
+
"version": "15.6.0-dev.46254f5",
|
|
4
4
|
"description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,30 +19,28 @@
|
|
|
19
19
|
"workerDirectory": "./public"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@storybook/addon-
|
|
23
|
-
"@storybook/
|
|
24
|
-
"@storybook/
|
|
25
|
-
"@storybook/
|
|
26
|
-
"@storybook/blocks": "^8.6.0",
|
|
27
|
-
"@storybook/react-vite": "^8.6.0",
|
|
28
|
-
"@storybook/test": "^8.6.0",
|
|
29
|
-
"@storybook/test-runner": "^0.21.3",
|
|
22
|
+
"@storybook/addon-essentials": "^8.6.4",
|
|
23
|
+
"@storybook/react-vite": "^8.6.4",
|
|
24
|
+
"@storybook/test": "^8.6.4",
|
|
25
|
+
"@storybook/test-runner": "^0.22.0",
|
|
30
26
|
"@swc/cli": "^0.6.0",
|
|
31
27
|
"@swc/core": "^1.4.11",
|
|
32
28
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
33
29
|
"@types/js-cookie": "^3.0.6",
|
|
34
30
|
"@types/lodash.throttle": "^4.1.9",
|
|
31
|
+
"@types/node": "^20",
|
|
32
|
+
"@types/react": "^18.3.1",
|
|
35
33
|
"@types/react-dom": "^18.3.0",
|
|
36
34
|
"@types/svg-sprite": "^0.0.39",
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
38
|
-
"@typescript-eslint/parser": "^8.
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^8.25.0",
|
|
36
|
+
"@typescript-eslint/parser": "^8.25.0",
|
|
39
37
|
"@vitejs/plugin-react": "^4.2.1",
|
|
40
38
|
"@whitespace/storybook-addon-html": "^6.1.1",
|
|
41
39
|
"autoprefixer": "^10.0.2",
|
|
42
40
|
"eslint": "^8.57.0",
|
|
43
41
|
"eslint-config-prettier": "^10.0.1",
|
|
44
42
|
"eslint-plugin-react": "^7.34.3",
|
|
45
|
-
"eslint-plugin-storybook": "^0.11.
|
|
43
|
+
"eslint-plugin-storybook": "^0.11.4",
|
|
46
44
|
"heroicons": "^2.2.0",
|
|
47
45
|
"http-server": "14.1.1",
|
|
48
46
|
"mixpanel-browser": "^2.60.0",
|
|
@@ -52,7 +50,7 @@
|
|
|
52
50
|
"posthog-js": "^1.217.4",
|
|
53
51
|
"prettier": "^3.2.5",
|
|
54
52
|
"react-syntax-highlighter": "^15.6.1",
|
|
55
|
-
"storybook": "^8.6.
|
|
53
|
+
"storybook": "^8.6.4",
|
|
56
54
|
"storybook-dark-mode": "^4.0.2",
|
|
57
55
|
"svg-sprite": "^2.0.4",
|
|
58
56
|
"tailwindcss": "^3.3.6",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import throttle from"lodash.throttle";import{queryId,queryIdAll}from"../dom-query";import MeganavControl from"../MeganavControl/component.js";import MeganavControlMobileDropdown from"../MeganavControlMobileDropdown/component.js";import MobilePanelOpenClick from"../MeganavControlMobilePanelOpen/component.js";import MobilePanelCloseClick from"../MeganavControlMobilePanelClose/component.js";import MeganavSearchAutocomplete from"../MeganavSearchAutocomplete/component.js";import MeganavSearchSuggestions from"../MeganavSearchSuggestions/component.js";const windowOnBlur=closeAll=>{window.onblur=()=>closeAll();return{teardown:()=>window.onblur=null}};const documentClick=closeAll=>{const meganav=queryId("meganav");const clickHandler=e=>{if(meganav.contains(e.target))return;closeAll()};document.addEventListener("click",clickHandler);return{teardown:()=>document.removeEventListener("click",clickHandler)}};const documentScroll=themeName=>{if(themeName!=="transparentToWhite")return{teardown:()=>{}};const meganav=queryId("meganav");const navItems=queryIdAll("meganav-link");const controlMobileDropdownMenu=queryId("meganav-control-mobile-dropdown-menu");const controlMobileDropdownClose=queryId("meganav-control-mobile-dropdown-close");const controls=queryIdAll("meganav-control");const signUpBtn=queryId("meganav-sign-up-btn");const invertTextCollection=[...Array.from(controls),...Array.from(navItems),queryId("meganav-logo")];const invertMobleDropdownColor=invert=>{const whiteToBlack=["ui-icon-white","ui-icon-cool-black"];const blackToWhite=[...whiteToBlack].reverse();if(invert){controlMobileDropdownMenu?.classList.replace(...whiteToBlack);controlMobileDropdownClose?.classList.replace(...whiteToBlack)}else{controlMobileDropdownMenu?.classList.replace(...blackToWhite);controlMobileDropdownClose?.classList.replace(...blackToWhite)}};const inverSignupBtnColors=invert=>{if(invert){signUpBtn?.classList.replace("bg-white","bg-cool-black");signUpBtn?.classList.replace("text-cool-black","text-white")}else{signUpBtn?.classList.replace("bg-cool-black","bg-white");signUpBtn?.classList.replace("text-white","text-cool-black")}};const scrollHandler=throttle(()=>{if(window.scrollY>5){meganav.classList.replace("bg-transparent","bg-white");inverSignupBtnColors(true);invertMobleDropdownColor(true);invertTextCollection.forEach(n=>n.classList.replace("text-white","text-cool-black"))}else{meganav.classList.replace("bg-white","bg-transparent");inverSignupBtnColors(false);invertMobleDropdownColor(false);invertTextCollection.forEach(n=>n.classList.replace("text-cool-black","text-white"))}},150);document.addEventListener("scroll",scrollHandler);return{teardown:()=>document.removeEventListener("scroll",scrollHandler)}};export default function Meganav({themeName,addSearchApiKey}){const controls=MeganavControl();const panelOpenControls=MobilePanelOpenClick();const panelCloseControls=MobilePanelCloseClick();const search=MeganavSearchAutocomplete(addSearchApiKey);const searchSuggestions=MeganavSearchSuggestions();const mobileDropdownControl=MeganavControlMobileDropdown({clearPanels:()=>[...panelOpenControls,...panelCloseControls].forEach(i=>i.clear())});const closeAll=()=>[mobileDropdownControl,searchSuggestions,...panelOpenControls,...panelCloseControls,...controls,...search].forEach(i=>i.clear());const teardowns=[documentScroll(themeName??null),documentClick(closeAll),windowOnBlur(closeAll),mobileDropdownControl,searchSuggestions,...controls,...panelOpenControls,...panelCloseControls,...search].map(i=>i.teardown);return()=>teardowns.forEach(teardown=>teardown())}
|
|
2
|
-
//# sourceMappingURL=component.js.map
|
package/core/Meganav.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import React,{useEffect,useState}from"react";import{connectState}from"./remote-data-store.js";import{selectSessionData}from"./remote-session-data.js";import Logo from"./Logo";import MeganavData from"./Meganav/component.json";import MeganavScripts from"./Meganav/component.js";import MeganavItemsDesktop from"./MeganavItemsDesktop";import MeganavItemsSignedIn from"./MeganavItemsSignedIn";import MeganavItemsMobile from"./MeganavItemsMobile";import Notice from"./Notice";import _absUrl from"./url-base.js";import MeganavContentProducts from"./MeganavContentProducts";import MeganavContentUseCases from"./MeganavContentUseCases";import MeganavContentCompany from"./MeganavContentCompany";import MeganavContentDevelopers from"./MeganavContentDevelopers";import MeganavSearch from"./MeganavSearch";const SignIn=({sessionState,theme,loginLink,absUrl,searchDataId})=>{return sessionState.signedIn?React.createElement(MeganavItemsSignedIn,{absUrl:absUrl,sessionState:sessionState,theme:theme,searchDataId:searchDataId}):React.createElement("ul",{className:"hidden md:flex items-center"},React.createElement("li",{className:"ui-meganav-item"},React.createElement("a",{href:absUrl("/contact"),className:`ui-meganav-link ${theme.textColor}`,"data-id":"meganav-link"},"Contact us")),React.createElement("li",{className:"ui-meganav-item"},React.createElement("a",{href:absUrl(loginLink),className:`ui-meganav-link mr-0 ${theme.textColor}`,"data-id":"meganav-link"},"Login")),React.createElement("li",{className:"ui-meganav-item"},React.createElement(MeganavSearch,{absUrl:absUrl,dataId:searchDataId})),React.createElement("li",{className:"ui-meganav-item"},React.createElement("a",{href:absUrl("/sign-up"),"data-id":"meganav-sign-up-btn",className:`ui-btn p-btn-small ${theme.buttonBackgroundColor} ${theme.buttonTextColor}`},"Sign up free")))};const SignInPlaceholder=()=>React.createElement("div",null);const panels={MeganavContentProducts,MeganavContentUseCases,MeganavContentCompany,MeganavContentDevelopers};const Meganav=({paths,themeName="white",notice,loginLink="/login",urlBase,addSearchApiKey,statusUrl,searchDataId})=>{const[sessionState,setSessionState]=useState();useEffect(()=>{connectState(selectSessionData,setSessionState)},[]);useEffect(()=>{const teardown=MeganavScripts({themeName,addSearchApiKey});return()=>teardown()},[sessionState]);const theme=MeganavData.themes[themeName];const absUrl=path=>_absUrl(path,urlBase);return React.createElement("nav",{className:`ui-meganav-wrapper ${theme.backgroundColor} ${theme.barShadow}`,"data-id":"meganav","aria-label":"Main"},notice&&React.createElement(Notice,{...notice.props,config:notice.config}),React.createElement("div",{className:"ui-meganav ui-grid-px"},React.createElement("div",{className:"mr-24"},React.createElement(Logo,{dataId:"meganav-logo",href:urlBase,logoUrl:paths?.logo})),React.createElement(MeganavItemsDesktop,{panels:panels,paths:paths,theme:theme,absUrl:absUrl,statusUrl:statusUrl}),sessionState?React.createElement(SignIn,{sessionState:sessionState,theme:theme,loginLink:loginLink,absUrl:absUrl,searchDataId:searchDataId}):React.createElement(SignInPlaceholder,null),React.createElement(MeganavItemsMobile,{panels:panels,sessionState:sessionState,paths:paths,theme:theme,loginLink:loginLink,absUrl:absUrl,statusUrl:statusUrl,searchDataId:searchDataId})))};export default Meganav;
|
|
2
|
-
//# sourceMappingURL=Meganav.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{queryIdAll}from"../dom-query";import{selectRecentBlogPosts}from"../remote-blogs-posts";import{connectState}from"../remote-data-store";const template=({link,title,pubDate})=>{const[li,a,heading,copy]=["li","a","p","p"].map(el=>document.createElement(el));a.href=link;a.classList.add("ui-meganav-media","group");heading.textContent=title;heading.classList.add("ui-meganav-media-heading");copy.textContent=pubDate;copy.classList.add("ui-meganav-media-copy");a.appendChild(heading);a.appendChild(copy);li.appendChild(a);return li};export default(()=>{connectState(selectRecentBlogPosts,recentBlogPosts=>{if(Array.isArray(recentBlogPosts)&&recentBlogPosts.length>0){const sections=queryIdAll("meganav-company-panel-blog-section");const containers=queryIdAll("meganav-company-panel-recent-blog-posts");Array.from(containers).forEach(container=>{const fragment=document.createDocumentFragment();recentBlogPosts.forEach(post=>fragment.appendChild(template(post)));container.appendChild(fragment)});Array.from(sections).forEach(section=>section.classList.remove("hidden"))}})});
|
|
2
|
-
//# sourceMappingURL=component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/MeganavBlogPostsList/component.js"],"sourcesContent":["import { queryIdAll } from \"../dom-query\";\nimport { selectRecentBlogPosts } from \"../remote-blogs-posts\";\nimport { connectState } from \"../remote-data-store\";\n\nconst template = ({ link, title, pubDate }) => {\n const [li, a, heading, copy] = [\"li\", \"a\", \"p\", \"p\"].map((el) =>\n document.createElement(el),\n );\n\n a.href = link;\n a.classList.add(\"ui-meganav-media\", \"group\");\n\n heading.textContent = title;\n heading.classList.add(\"ui-meganav-media-heading\");\n\n copy.textContent = pubDate;\n copy.classList.add(\"ui-meganav-media-copy\");\n\n a.appendChild(heading);\n a.appendChild(copy);\n li.appendChild(a);\n\n return li;\n};\n\nexport default () => {\n connectState(selectRecentBlogPosts, (recentBlogPosts) => {\n if (Array.isArray(recentBlogPosts) && recentBlogPosts.length > 0) {\n const sections = queryIdAll(\"meganav-company-panel-blog-section\");\n const containers = queryIdAll(\"meganav-company-panel-recent-blog-posts\");\n\n Array.from(containers).forEach((container) => {\n const fragment = document.createDocumentFragment();\n recentBlogPosts.forEach((post) => fragment.appendChild(template(post)));\n container.appendChild(fragment);\n });\n\n Array.from(sections).forEach((section) =>\n section.classList.remove(\"hidden\"),\n );\n }\n });\n};\n"],"names":["queryIdAll","selectRecentBlogPosts","connectState","template","link","title","pubDate","li","a","heading","copy","map","el","document","createElement","href","classList","add","textContent","appendChild","recentBlogPosts","Array","isArray","length","sections","containers","from","forEach","container","fragment","createDocumentFragment","post","section","remove"],"mappings":"AAAA,OAASA,UAAU,KAAQ,cAAe,AAC1C,QAASC,qBAAqB,KAAQ,uBAAwB,AAC9D,QAASC,YAAY,KAAQ,sBAAuB,CAEpD,MAAMC,SAAW,CAAC,CAAEC,IAAI,CAAEC,KAAK,CAAEC,OAAO,CAAE,IACxC,KAAM,CAACC,GAAIC,EAAGC,QAASC,KAAK,CAAG,CAAC,KAAM,IAAK,IAAK,IAAI,CAACC,GAAG,CAAC,AAACC,IACxDC,SAASC,aAAa,CAACF,IAGzBJ,CAAAA,EAAEO,IAAI,CAAGX,KACTI,EAAEQ,SAAS,CAACC,GAAG,CAAC,mBAAoB,QAEpCR,CAAAA,QAAQS,WAAW,CAAGb,MACtBI,QAAQO,SAAS,CAACC,GAAG,CAAC,2BAEtBP,CAAAA,KAAKQ,WAAW,CAAGZ,QACnBI,KAAKM,SAAS,CAACC,GAAG,CAAC,yBAEnBT,EAAEW,WAAW,CAACV,SACdD,EAAEW,WAAW,CAACT,MACdH,GAAGY,WAAW,CAACX,GAEf,OAAOD,EACT,CAEA,eAAe,CAAA,KACbL,aAAaD,sBAAuB,AAACmB,kBACnC,GAAIC,MAAMC,OAAO,CAACF,kBAAoBA,gBAAgBG,MAAM,CAAG,EAAG,CAChE,MAAMC,SAAWxB,WAAW,sCAC5B,MAAMyB,WAAazB,WAAW,2CAE9BqB,MAAMK,IAAI,CAACD,YAAYE,OAAO,CAAC,AAACC,YAC9B,MAAMC,SAAWhB,SAASiB,sBAAsB,GAChDV,gBAAgBO,OAAO,CAAC,AAACI,MAASF,SAASV,WAAW,CAAChB,SAAS4B,QAChEH,UAAUT,WAAW,CAACU,SACxB,GAEAR,MAAMK,IAAI,CAACF,UAAUG,OAAO,CAAC,AAACK,SAC5BA,QAAQhB,SAAS,CAACiB,MAAM,CAAC,UAE7B,CACF,EACF,CAAA,CAAE"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{queryId,queryIdAll}from"../dom-query";const MeganavControl=()=>{const controls=Array.from(queryIdAll("meganav-control"));const panels=Array.from(queryIdAll("meganav-panel"));const mdBreakpoint=getComputedStyle(document.documentElement).getPropertyValue("--bp-md");const hoverEnabled=()=>window.matchMedia(`(hover: hover) and (pointer: fine) and (min-width: ${mdBreakpoint})`).matches;const isSearchControl=node=>node.dataset.control==="search";const isSearchPanelOpen=()=>{const searchPanel=document.querySelector('[data-id="meganav-panel"]#panel-search');if(!searchPanel)return;return!searchPanel.classList.contains("invisible")};const controlsHaveFocus=()=>controls.some(control=>control===document.activeElement);const hover=(control,panel,open)=>{if(hoverEnabled()&&!controlsHaveFocus()&&!isSearchPanelOpen()){const classes=["invisible","visible"];panel.classList.replace(...open?classes:classes.reverse());control.setAttribute("aria-expanded",open);control.dataset.hover=open}};const mouseenterHandler=(control,panel)=>()=>hover(control,panel,true);const mouseleaveHandler=(control,panel)=>()=>hover(control,panel,false);const clickHandler=(control,panel)=>()=>{controls.forEach(node=>node!==control&&node.setAttribute("aria-expanded",false));panels.forEach(node=>node!==panel&&node.classList.replace("visible","invisible"));const ariaExpanded=control.getAttribute("aria-expanded");const openedByHover=control.dataset.hover==="true";if(ariaExpanded==="true"&&!openedByHover){control.setAttribute("aria-expanded",false);panel.classList.replace("visible","invisible")}else{control.setAttribute("aria-expanded",true);panel.classList.replace("invisible","visible")}if(openedByHover){control.dataset.hover=false}if(isSearchControl(control)){const searchInput=queryId("meganav-search-input",panel);if(!searchInput)return;searchInput.focus()}else{control.focus()}};return controls.map(control=>{const item=control.parentNode;const panel=document.querySelector(`#${control.getAttribute("aria-controls")}`);const click=clickHandler(control,panel);control.addEventListener("click",click);let mouseenter,mouseleave;if(!isSearchControl(control)){mouseenter=mouseenterHandler(control,panel);mouseleave=mouseleaveHandler(control,panel);item.addEventListener("mouseenter",mouseenter);item.addEventListener("mouseleave",mouseleave)}return[{teardown:()=>{if(mouseenter&&mouseleave){item.removeEventListener("mouseenter",mouseenter);item.removeEventListener("mouseleave",mouseleave)}control.removeEventListener("click",click)},clear:()=>{control.setAttribute("aria-expanded",false);panel.classList.replace("visible","invisible")}}]}).flat()};export default MeganavControl;
|
|
2
|
-
//# sourceMappingURL=component.js.map
|