@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.
@@ -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, className: userClassName, children, style, ref, ...props }: IconButtonProps): import("react").JSX.Element;
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 backgroundClasses: Record<SurfaceBackground, string>;
15
- export declare const paddingPresetClasses: Record<SurfacePadding, string>;
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 alignClasses: {
5
- readonly start: "items-start";
6
- readonly center: "items-center";
7
- readonly end: "items-end";
8
- readonly stretch: "items-stretch";
9
- readonly baseline: "items-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 justifyClasses: {
12
- readonly start: "justify-start";
13
- readonly center: "justify-center";
14
- readonly end: "justify-end";
15
- readonly between: "justify-between";
16
- readonly around: "justify-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 overflowClasses: {
19
- readonly hidden: "overflow-hidden";
20
- readonly auto: "overflow-auto";
21
- readonly visible: "overflow-visible";
22
- readonly scroll: "overflow-scroll";
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 alignClasses;
50
- justify?: keyof typeof justifyClasses;
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?: keyof typeof overflowClasses;
56
- overflowY?: keyof typeof overflowYClasses;
57
- width?: keyof typeof widthClasses;
58
- height?: keyof typeof heightClasses;
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 borderSideClasses;
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
- export declare function resolveLayoutClasses(props: LayoutProps): string;
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
- import type { WidgetView } from '../../types';
3
- export interface ShellTabBarProps {
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 radiusClasses: Record<RadiusToken, string>;
8
- export declare const textToneClasses: Record<TextTone, string>;
9
- export declare const textLeadingClasses: Record<TextLeading, string>;
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;