@cntrl-site/components 1.0.66 → 1.0.67-alpha.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.
@@ -0,0 +1,102 @@
1
+ import { CommonComponentProps } from '../props';
2
+ import { TextStyles } from '../utils/textStylesToCss';
3
+ type BurgerEffect = 'fade' | 'left' | 'top' | 'right' | 'bottom';
4
+ type BurgerType = 'a' | 'b' | 'c';
5
+ type BurgerLogo = {
6
+ mode?: 'On' | 'Off';
7
+ icon?: string | null;
8
+ };
9
+ type BurgerLink = {
10
+ mode?: 'page' | 'url';
11
+ page?: string;
12
+ url?: string;
13
+ label?: string;
14
+ anchor?: string;
15
+ openIn?: string;
16
+ showIn?: string;
17
+ };
18
+ type BurgerTextOrientation = 'vertical' | 'horizontal';
19
+ type BurgerPosition = 'left-top' | 'center-top' | 'right-top' | 'left-center' | 'center-center' | 'right-center' | 'left-bottom' | 'center-bottom' | 'right-bottom';
20
+ type BurgerSettings = {
21
+ type?: BurgerType;
22
+ link?: BurgerLink[];
23
+ socialLink?: string[];
24
+ logo?: BurgerLogo | null;
25
+ logoMaxWidth?: number;
26
+ panelHeight?: number;
27
+ panelColor?: string;
28
+ position?: BurgerPosition;
29
+ horizontalAlign?: 'left' | 'center' | 'right';
30
+ verticalAlign?: 'top' | 'center' | 'bottom';
31
+ textOrientation?: BurgerTextOrientation;
32
+ iconColor?: string;
33
+ iconSize?: number;
34
+ iconAnimation?: 'a';
35
+ linkColor?: string;
36
+ socialIconColor?: string;
37
+ menuBackgroundColor?: string;
38
+ overlayColor?: string;
39
+ closeButtonColor?: string;
40
+ effect?: BurgerEffect;
41
+ menuWidth?: number;
42
+ textWidth?: number;
43
+ navTextWidth?: number;
44
+ gap?: number;
45
+ navGap?: number;
46
+ navPaddingRight?: number;
47
+ textPaddingLeft?: number;
48
+ textPaddingRight?: number;
49
+ textPaddingTop?: number;
50
+ textPaddingBottom?: number;
51
+ fontFamily?: string;
52
+ fontSettings?: {
53
+ fontWeight?: number;
54
+ fontStyle?: string;
55
+ };
56
+ fontSize?: number;
57
+ lineHeight?: number;
58
+ letterSpacing?: number;
59
+ wordSpacing?: number;
60
+ textAlign?: TextStyles['textAlign'];
61
+ textAppearance?: TextStyles['textAppearance'];
62
+ stateOverrides?: Record<string, Partial<Record<'iconColor' | 'closeButtonColor' | 'linkColor' | 'socialIconColor' | 'menuBackgroundColor' | 'overlayColor' | 'panelColor', string>>>;
63
+ navigationStateOverrides?: BurgerNavigationStateOverrides;
64
+ };
65
+ type BurgerNavigationState = 'default' | 'onScroll';
66
+ declare const NAVIGATION_STATE_PROPERTIES: readonly ["panelHeight", "logoMaxWidth", "iconSize", "navGap", "navPaddingRight", "navTextWidth", "fontSize", "lineHeight", "letterSpacing", "wordSpacing", "textAppearance"];
67
+ type BurgerNavigationStateProperty = typeof NAVIGATION_STATE_PROPERTIES[number];
68
+ type BurgerNavigationStateOverrides = Partial<Record<Exclude<BurgerNavigationState, 'default'>, Pick<BurgerSettings, BurgerNavigationStateProperty>>>;
69
+ type BurgerPageRef = {
70
+ id: string;
71
+ slug: string;
72
+ };
73
+ export declare function applyBurgerSettingsChange(nextSettings: BurgerSettings, prevSettings: BurgerSettings): BurgerSettings;
74
+ export type BurgerLinkNavigateEvent = {
75
+ mode: 'page' | 'url';
76
+ href: string;
77
+ page?: string;
78
+ url?: string;
79
+ anchor?: string;
80
+ target?: '_blank';
81
+ };
82
+ type BurgerProps = {
83
+ settings: BurgerSettings;
84
+ content?: unknown;
85
+ isEditor?: boolean;
86
+ isEditMode?: boolean;
87
+ isPreviewMode?: boolean;
88
+ activeEvent?: string;
89
+ /**
90
+ * Set by a navigation wrapper that decides when the bar counts as scrolled, e.g. the
91
+ * `switch` position, which only flips once the page is scrolled past the whole bar.
92
+ * When it is omitted the component watches the page scroll itself.
93
+ */
94
+ navigationState?: BurgerNavigationState;
95
+ portalId?: string;
96
+ layoutId?: string;
97
+ pages?: BurgerPageRef[];
98
+ onLinkNavigate?: (event: BurgerLinkNavigateEvent) => void;
99
+ onUpdateSettings?: (settings: BurgerSettings) => void;
100
+ } & CommonComponentProps;
101
+ export declare function Burger({ settings: settingsProp, isEditor, isEditMode, isPreviewMode, activeEvent, navigationState: controlledNavigationState, layoutId, pages, onLinkNavigate, onUpdateSettings, }: BurgerProps): import("react/jsx-runtime").JSX.Element;
102
+ export {};