@marketrix.ai/widget 3.8.475 → 3.8.477
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/base/IconButton.d.ts +1 -3
- package/dist/src/components/base/Surface.d.ts +3 -3
- package/dist/src/components/base/layoutProps.d.ts +31 -43
- package/dist/src/components/blocks/Notifications.d.ts +29 -0
- package/dist/src/components/blocks/WidgetDialog.d.ts +6 -0
- package/dist/src/components/navigation/ShellTabBar.d.ts +2 -6
- package/dist/src/design-system/component-tokens.d.ts +3 -3
- package/dist/src/utils/widgetPositioning.d.ts +0 -5
- package/dist/widget.mjs +67 -57
- package/package.json +1 -4
- package/dist/src/components/blocks/NotificationToast.d.ts +0 -11
- package/dist/src/lib/utils.d.ts +0 -3
|
@@ -7,8 +7,6 @@ export interface IconButtonProps extends ComponentPropsWithRef<'button'> {
|
|
|
7
7
|
size?: IconButtonSize;
|
|
8
8
|
tone?: TextTone;
|
|
9
9
|
label: string;
|
|
10
|
-
/** @internal blocks/ only */
|
|
11
|
-
className?: string;
|
|
12
10
|
}
|
|
13
|
-
export declare function IconButton({ variant, size, tone, label, disabled,
|
|
11
|
+
export declare function IconButton({ variant, size, tone, label, disabled, children, style, ref, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
14
12
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ElementType } from 'react';
|
|
1
|
+
import { type CSSProperties, type ElementType } from 'react';
|
|
2
2
|
import type { ShadowToken } from '../../design-system/shadows';
|
|
3
3
|
import { type LayoutProps } from './layoutProps';
|
|
4
4
|
export type SurfaceBackground = 'default' | 'card';
|
|
@@ -11,6 +11,6 @@ export interface SurfaceProps extends LayoutProps, Omit<React.HTMLAttributes<HTM
|
|
|
11
11
|
/** @internal blocks/ only */
|
|
12
12
|
className?: string;
|
|
13
13
|
}
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
14
|
+
export declare const backgroundStyles: Record<SurfaceBackground, CSSProperties>;
|
|
15
|
+
export declare const paddingPresetStyles: Record<SurfacePadding, CSSProperties>;
|
|
16
16
|
export declare const Surface: import("react").ForwardRefExoticComponent<SurfaceProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1,43 +1,25 @@
|
|
|
1
1
|
import type { CSSProperties, ElementType } from 'react';
|
|
2
2
|
export type SpacingToken = 'none' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
3
|
export declare const SPACING_SCALE: Record<SpacingToken, string>;
|
|
4
|
-
declare const
|
|
5
|
-
readonly start: "
|
|
6
|
-
readonly center: "
|
|
7
|
-
readonly end: "
|
|
8
|
-
readonly stretch: "
|
|
9
|
-
readonly baseline: "
|
|
4
|
+
declare const ALIGN: {
|
|
5
|
+
readonly start: "flex-start";
|
|
6
|
+
readonly center: "center";
|
|
7
|
+
readonly end: "flex-end";
|
|
8
|
+
readonly stretch: "stretch";
|
|
9
|
+
readonly baseline: "baseline";
|
|
10
10
|
};
|
|
11
|
-
declare const
|
|
12
|
-
readonly start: "
|
|
13
|
-
readonly center: "
|
|
14
|
-
readonly end: "
|
|
15
|
-
readonly between: "
|
|
16
|
-
readonly around: "
|
|
11
|
+
declare const JUSTIFY: {
|
|
12
|
+
readonly start: "flex-start";
|
|
13
|
+
readonly center: "center";
|
|
14
|
+
readonly end: "flex-end";
|
|
15
|
+
readonly between: "space-between";
|
|
16
|
+
readonly around: "space-around";
|
|
17
17
|
};
|
|
18
|
-
declare const
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
};
|
|
24
|
-
declare const overflowYClasses: {
|
|
25
|
-
readonly hidden: "overflow-y-hidden";
|
|
26
|
-
readonly auto: "overflow-y-auto";
|
|
27
|
-
};
|
|
28
|
-
declare const widthClasses: {
|
|
29
|
-
readonly full: "w-full";
|
|
30
|
-
readonly auto: "w-auto";
|
|
31
|
-
};
|
|
32
|
-
declare const heightClasses: {
|
|
33
|
-
readonly full: "h-full";
|
|
34
|
-
readonly auto: "h-auto";
|
|
35
|
-
};
|
|
36
|
-
declare const borderSideClasses: {
|
|
37
|
-
readonly top: "border-t";
|
|
38
|
-
readonly bottom: "border-b";
|
|
39
|
-
readonly left: "border-l";
|
|
40
|
-
readonly right: "border-r";
|
|
18
|
+
declare const BORDER_SIDE: {
|
|
19
|
+
readonly top: "borderTopWidth";
|
|
20
|
+
readonly bottom: "borderBottomWidth";
|
|
21
|
+
readonly left: "borderLeftWidth";
|
|
22
|
+
readonly right: "borderRightWidth";
|
|
41
23
|
};
|
|
42
24
|
export interface LayoutProps {
|
|
43
25
|
padding?: SpacingToken;
|
|
@@ -46,24 +28,30 @@ export interface LayoutProps {
|
|
|
46
28
|
paddingTop?: SpacingToken;
|
|
47
29
|
paddingBottom?: SpacingToken;
|
|
48
30
|
gap?: SpacingToken;
|
|
49
|
-
align?: keyof typeof
|
|
50
|
-
justify?: keyof typeof
|
|
31
|
+
align?: keyof typeof ALIGN;
|
|
32
|
+
justify?: keyof typeof JUSTIFY;
|
|
51
33
|
grow?: boolean;
|
|
52
34
|
shrink?: boolean;
|
|
53
35
|
position?: 'relative' | 'absolute' | 'fixed' | 'sticky';
|
|
54
36
|
inset?: SpacingToken | '0';
|
|
55
|
-
overflow?:
|
|
56
|
-
overflowY?:
|
|
57
|
-
width?:
|
|
58
|
-
height?:
|
|
37
|
+
overflow?: 'hidden' | 'auto' | 'visible' | 'scroll';
|
|
38
|
+
overflowY?: 'hidden' | 'auto';
|
|
39
|
+
width?: 'full' | 'auto';
|
|
40
|
+
height?: 'full' | 'auto';
|
|
59
41
|
minWidth?: '0';
|
|
60
|
-
border?: boolean | keyof typeof
|
|
42
|
+
border?: boolean | keyof typeof BORDER_SIDE;
|
|
61
43
|
rounded?: boolean | 'none' | 'sm' | 'full' | 'lg' | 'theme' | 'md' | 'xl' | 'pill' | 'circle';
|
|
62
44
|
animate?: 'spin' | 'ping' | 'pulse' | 'fadeIn' | 'none';
|
|
63
45
|
hidden?: boolean;
|
|
64
46
|
as?: ElementType;
|
|
65
47
|
style?: CSSProperties;
|
|
66
48
|
}
|
|
67
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Layout props resolve to a style object rather than class names. As classes they were interpolated
|
|
51
|
+
* (`p-${token}`), which no scanner could see — a build-time safelist was the only thing keeping them
|
|
52
|
+
* alive, it emitted the whole 8x7 matrix whether used or not, and a missing entry failed silently at
|
|
53
|
+
* runtime. A style object makes every token work by construction and costs nothing per unused one.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveLayoutStyle(props: LayoutProps): CSSProperties;
|
|
68
56
|
export declare function stripLayoutProps<T extends LayoutProps>(props: T): Omit<T, keyof LayoutProps>;
|
|
69
57
|
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Toast } from '@base-ui/react/toast';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const GREETING_TIMEOUT_MS = 8000;
|
|
4
|
+
export interface NotificationProviderProps {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** The closed shadow root to portal into — a portal to document.body would leave the styles behind. */
|
|
7
|
+
container?: HTMLElement | null;
|
|
8
|
+
/** Raised above the launcher when the launcher sits at the bottom, so the two cannot overlap. */
|
|
9
|
+
offsetBottom?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The one notification surface. Base UI owns the live region, the dismiss timers, hover-to-pause and
|
|
13
|
+
* stacking; before this the widget announced nothing to a screen reader and ran its own setTimeout.
|
|
14
|
+
*/
|
|
15
|
+
export declare const NotificationProvider: React.FC<NotificationProviderProps>;
|
|
16
|
+
export declare const useNotifications: typeof Toast.useToastManager;
|
|
17
|
+
export interface WidgetNotificationsProps {
|
|
18
|
+
error?: string;
|
|
19
|
+
onClearError: () => void;
|
|
20
|
+
onRetry?: () => void;
|
|
21
|
+
greeting?: string;
|
|
22
|
+
greetingBody?: string;
|
|
23
|
+
onGreetingDismiss: () => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Drives the toasts from widget state. Both use a stable id, so `add` upserts and a re-render cannot
|
|
27
|
+
* stack duplicates of the same condition.
|
|
28
|
+
*/
|
|
29
|
+
export declare const WidgetNotifications: React.FC<WidgetNotificationsProps>;
|
|
@@ -7,5 +7,11 @@ export interface WidgetDialogProps {
|
|
|
7
7
|
onConfirm?: () => void;
|
|
8
8
|
confirmLabel?: string;
|
|
9
9
|
cancelLabel?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Where focus lands on close. Base UI's default restore is broken here: it descends
|
|
12
|
+
* `element.shadowRoot.activeElement`, which is null for a CLOSED root, so it records the shadow
|
|
13
|
+
* HOST and hands focus to a host-page element on close. Naming the target sidesteps that.
|
|
14
|
+
*/
|
|
15
|
+
finalFocusRef?: React.RefObject<HTMLElement | null>;
|
|
10
16
|
}
|
|
11
17
|
export declare const WidgetDialog: React.FC<WidgetDialogProps>;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
activeView: WidgetView;
|
|
5
|
-
onChange: (view: WidgetView) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const ShellTabBar: React.FC<ShellTabBarProps>;
|
|
2
|
+
/** Selection, roles, ids and arrow-key navigation come from Tabs.Root — see MessengerShell. */
|
|
3
|
+
export declare const ShellTabBar: React.FC;
|
|
@@ -4,9 +4,9 @@ export type RadiusToken = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'theme' | 'pill'
|
|
|
4
4
|
export type TextTone = 'default' | 'muted' | 'faint' | 'primary' | 'inherit';
|
|
5
5
|
export type TextLeading = 'tight' | 'snug' | 'normal' | 'relaxed';
|
|
6
6
|
export type NotificationTone = 'info' | 'error' | 'neutral';
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
7
|
+
export declare const RADIUS: Record<RadiusToken, string>;
|
|
8
|
+
export declare const TEXT_TONE: Record<TextTone, string>;
|
|
9
|
+
export declare const TEXT_LEADING: Record<TextLeading, string>;
|
|
10
10
|
export declare const TAB_BAR_HEIGHT = 48;
|
|
11
11
|
export declare const notificationToneStyles: Record<NotificationTone, {
|
|
12
12
|
background: string;
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { WidgetPosition } from '../types';
|
|
3
3
|
export declare const getCorner: (position: WidgetPosition) => {
|
|
4
|
-
readonly classes: "bottom-5 right-5";
|
|
5
4
|
readonly vertical: "bottom";
|
|
6
5
|
readonly horizontal: "right";
|
|
7
6
|
} | {
|
|
8
|
-
readonly classes: "bottom-5 left-5";
|
|
9
7
|
readonly vertical: "bottom";
|
|
10
8
|
readonly horizontal: "left";
|
|
11
9
|
} | {
|
|
12
|
-
readonly classes: "top-5 right-5";
|
|
13
10
|
readonly vertical: "top";
|
|
14
11
|
readonly horizontal: "right";
|
|
15
12
|
} | {
|
|
16
|
-
readonly classes: "top-5 left-5";
|
|
17
13
|
readonly vertical: "top";
|
|
18
14
|
readonly horizontal: "left";
|
|
19
15
|
};
|
|
20
16
|
export declare const isWidgetPosition: (value: unknown) => value is WidgetPosition;
|
|
21
|
-
export declare const getPositionClasses: (position: WidgetPosition) => string;
|
|
22
17
|
export declare const getPanelPositionStyle: (position: WidgetPosition) => React.CSSProperties;
|
|
23
18
|
export declare const getAnchorTopLeft: (position: WidgetPosition, vw: number, vh: number, w: number, h: number) => {
|
|
24
19
|
x: number;
|