@wix/site-ui 1.185.0 → 1.186.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.
Files changed (47) hide show
  1. package/dist/1763.js +836 -0
  2. package/dist/2205.js +26 -0
  3. package/dist/2445.js +470 -0
  4. package/dist/285.js +1 -1
  5. package/dist/3485.js +4 -3
  6. package/dist/4863.js +61 -0
  7. package/dist/{4388.js → 487.js} +5 -57
  8. package/dist/5992.js +5 -471
  9. package/dist/6046.js +2 -26
  10. package/dist/6089.js +6 -3
  11. package/dist/6270.js +5 -3
  12. package/dist/6535.js +2 -1
  13. package/dist/6588.js +2 -1
  14. package/dist/6882.js +8 -4
  15. package/dist/6917.js +55 -0
  16. package/dist/7871.js +1 -1
  17. package/dist/8052.js +2 -1
  18. package/dist/8106.js +3 -2
  19. package/dist/8171.js +1 -1
  20. package/dist/8750.js +3 -2
  21. package/dist/8960.js +1 -1
  22. package/dist/904.js +1 -1
  23. package/dist/9352.js +2 -2
  24. package/dist/{880.js → 9369.js} +2 -60
  25. package/dist/Accordion/index.js +1 -1
  26. package/dist/Avatar/index.js +2 -1
  27. package/dist/Checkbox/index.js +2 -1
  28. package/dist/Collapsible/index.js +1 -1
  29. package/dist/Combobox/index.js +3 -2
  30. package/dist/ContextMenu/index.js +2 -2
  31. package/dist/Drawer/index.js +10 -836
  32. package/dist/Field/index.js +2 -1
  33. package/dist/Menu/index.js +3 -2
  34. package/dist/NavigationMenu/index.js +6 -3
  35. package/dist/Popover/index.js +5 -3
  36. package/dist/PreviewCard/index.js +5 -3
  37. package/dist/Radio/index.js +2 -1
  38. package/dist/Select/index.js +6 -3
  39. package/dist/Tabs/index.js +2 -1
  40. package/dist/Toast/index.css +111 -0
  41. package/dist/Toast/index.d.ts +846 -0
  42. package/dist/Toast/index.js +1204 -0
  43. package/dist/Tooltip/index.js +5 -3
  44. package/dist/index.d.ts +501 -0
  45. package/dist/index.js +1 -0
  46. package/package.json +2 -2
  47. /package/dist/{5992.js.LICENSE.txt → 2445.js.LICENSE.txt} +0 -0
@@ -5,9 +5,9 @@ import { Timeout, useTimeout } from "../42.js";
5
5
  import { useIsoLayoutEffect } from "../6499.js";
6
6
  import { useHoverFloatingInteraction, useHoverInteractionSharedState, getDelay } from "../3056.js";
7
7
  import { createChangeEventDetails } from "../4768.js";
8
- import { POPUP_COLLISION_AVOIDANCE, triggerOpenStateMapping, popupStateMapping, popupStateMapping_CommonTriggerDataAttributes } from "../4388.js";
8
+ import { popupStateMapping_CommonTriggerDataAttributes, popupStateMapping, triggerOpenStateMapping } from "../6917.js";
9
9
  import { getWindow, isElement } from "../3829.js";
10
- import { useDismiss, PopupTriggerMap, createSelector, fastComponent, fastComponentRef, ReactStore } from "../5992.js";
10
+ import { createSelector, fastComponent, fastComponentRef, ReactStore } from "../2445.js";
11
11
  import { useBaseUiId } from "../6046.js";
12
12
  import { useTriggerDataForwarding, usePopupInteractionProps, setOpenTriggerState, usePopupStore, useImplicitActiveTrigger, useOnFirstRender, useOpenStateTransitions, FOCUSABLE_POPUP_PROPS } from "../8106.js";
13
13
  import { useValueAsRef } from "../4707.js";
@@ -16,12 +16,14 @@ import { safePolygon, useHoverReferenceInteraction } from "../3670.js";
16
16
  import { useFocus } from "../904.js";
17
17
  import { imperativeAction, triggerFocus, escapeKey, disabled as reason_parts_disabled, triggerHover, triggerPress } from "../2418.js";
18
18
  import { isMouseLikePointerType } from "../6330.js";
19
+ import { POPUP_COLLISION_AVOIDANCE } from "../487.js";
19
20
  import { usePositioner, adaptiveOriginMiddleware_adaptiveOrigin, useAnchorPositioning, getDisabledMountTransitionStyles } from "../8750.js";
20
- import { transitionStatusMapping, useOpenChangeComplete } from "../880.js";
21
+ import { transitionStatusMapping, useOpenChangeComplete } from "../9369.js";
21
22
  import { usePopupViewport } from "../8171.js";
22
23
  import { useStableCallback } from "../7541.js";
23
24
  import { addEventListener } from "../4723.js";
24
25
  import { createPopupFloatingRootContext, popupStoreSelectors, createInitialPopupStoreState } from "../6535.js";
26
+ import { PopupTriggerMap, useDismiss } from "../5992.js";
25
27
  import { FloatingPortalLite_FloatingPortalLite } from "../8960.js";
26
28
  import * as __rspack_external_react from "react";
27
29
  import * as __rspack_external_react_dom_7136dc57 from "react-dom";
package/dist/index.d.ts CHANGED
@@ -77,6 +77,7 @@ import { FieldsetRootProps as FieldsetRootProps_2 } from '@base-ui/react';
77
77
  import { FieldValidityProps as FieldValidityProps_2 } from '@base-ui/react';
78
78
  import { FloatingRootContext as FloatingRootContext_2 } from '../../floating-ui-react/index.js';
79
79
  import { FloatingRootStore as FloatingRootStore_2 } from '../../floating-ui-react/components/FloatingRootStore.js';
80
+ import { ForwardRefExoticComponent } from 'react';
80
81
  import { HTMLProps as HTMLProps_2 } from '../../index.js';
81
82
  import { InputProps as InputProps_2 } from '@base-ui/react';
82
83
  import { InteractionType } from '@base-ui/utils/useEnhancedClickHandler';
@@ -133,6 +134,7 @@ import { RadioIndicatorProps as RadioIndicatorProps_2 } from '@base-ui/react';
133
134
  import * as React_2 from 'react';
134
135
  import { ReactStore } from '@base-ui/utils/store';
135
136
  import { Rect } from '@floating-ui/utils';
137
+ import { RefAttributes } from 'react';
136
138
  import { ScrollAreaContentProps as ScrollAreaContentProps_2 } from '@base-ui/react';
137
139
  import { ScrollAreaCornerProps as ScrollAreaCornerProps_2 } from '@base-ui/react';
138
140
  import { ScrollAreaRootProps as ScrollAreaRootProps_2 } from '@base-ui/react';
@@ -170,6 +172,9 @@ import { TabsPanelProps as TabsPanelProps_2 } from '@base-ui/react';
170
172
  import { TabsRootProps as TabsRootProps_2 } from '@base-ui/react';
171
173
  import { TabsTabProps as TabsTabProps_2 } from '@base-ui/react';
172
174
  import { Timeout } from '@base-ui/utils/useTimeout';
175
+ import { ToastRootProps as ToastRootProps_2 } from '@base-ui/react';
176
+ import { ToastTitleProps as ToastTitleProps_2 } from '@base-ui/react';
177
+ import { ToastViewportProps as ToastViewportProps_2 } from '@base-ui/react';
173
178
  import { ToolbarButtonProps as ToolbarButtonProps_2 } from '@base-ui/react';
174
179
  import { ToolbarGroupProps as ToolbarGroupProps_2 } from '@base-ui/react';
175
180
  import { ToolbarInputProps as ToolbarInputProps_2 } from '@base-ui/react';
@@ -1545,8 +1550,12 @@ declare const clearPress: "clear-press";
1545
1550
 
1546
1551
  declare function Close({ className, ...props }: WithStringClassName<Drawer_2.Close.Props>): JSX_2.Element;
1547
1552
 
1553
+ declare const CloseButton: React_2.ForwardRefExoticComponent<CloseProps & React_2.RefAttributes<HTMLButtonElement>>;
1554
+
1548
1555
  declare const closePress: "close-press";
1549
1556
 
1557
+ declare type CloseProps = Omit<WithStringClassName<React_2.ComponentPropsWithoutRef<typeof Toast_2.Close>>, 'children'>;
1558
+
1550
1559
  declare const closeWatcher: "close-watcher";
1551
1560
 
1552
1561
  export declare const Collapsible: {
@@ -3090,6 +3099,11 @@ declare function createPopoverHandle<Payload>(): PopoverHandle<Payload>;
3090
3099
  */
3091
3100
  declare function createPreviewCardHandle<Payload>(): PreviewCardHandle<Payload>;
3092
3101
 
3102
+ /**
3103
+ * Creates a new toast manager.
3104
+ */
3105
+ export declare function createToastManager<Data extends object = any>(): ToastManager<Data>;
3106
+
3093
3107
  /**
3094
3108
  * Creates a new handle to connect a Tooltip.Root with detached Tooltip.Trigger components.
3095
3109
  */
@@ -8744,6 +8758,12 @@ declare function Root_4<Value>({ className, size, style, ...props }: RootProps_2
8744
8758
 
8745
8759
  declare function Root_5<Value extends number | ReadonlyArray<number>>({ className, size, style, ...props }: RootProps_3<Value>): JSX_2.Element;
8746
8760
 
8761
+ declare const Root_6: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ToastRootProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
8762
+ className?: string;
8763
+ } & {
8764
+ skin?: string;
8765
+ } & React_2.RefAttributes<HTMLDivElement>>;
8766
+
8747
8767
  declare type RootOwnProps = Omit<React_2.ComponentProps<typeof Select.Root>, 'children'>;
8748
8768
 
8749
8769
  export declare type RootProps = WithStringClassName<React_2.ComponentPropsWithoutRef<typeof Checkbox_2.Root>> & {
@@ -12576,6 +12596,470 @@ export declare interface ThumbMetadata {
12576
12596
 
12577
12597
  declare function Title({ className, ...props }: WithStringClassName<Drawer_2.Title.Props>): JSX_2.Element;
12578
12598
 
12599
+ declare const Title_2: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ToastTitleProps_2, "ref"> & React_2.RefAttributes<HTMLHeadingElement>, "ref">, "className"> & {
12600
+ className?: string;
12601
+ } & React_2.RefAttributes<HTMLHeadingElement>>;
12602
+
12603
+ export declare const Toast: ToastNamespace;
12604
+
12605
+ export declare namespace Toast_2 {
12606
+ export {
12607
+ ToastProvider as Provider,
12608
+ ToastViewport as Viewport,
12609
+ ToastRoot as Root,
12610
+ ToastContent as Content,
12611
+ ToastDescription as Description,
12612
+ ToastTitle as Title,
12613
+ ToastClose as Close,
12614
+ ToastAction as Action,
12615
+ ToastPortal as Portal,
12616
+ ToastPositioner as Positioner,
12617
+ ToastArrow as Arrow,
12618
+ useToastManager,
12619
+ createToastManager
12620
+ }
12621
+ }
12622
+
12623
+ /**
12624
+ * Performs an action when clicked.
12625
+ * Renders a `<button>` element.
12626
+ *
12627
+ * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
12628
+ */
12629
+ export declare const ToastAction: React_2.ForwardRefExoticComponent<Omit<ToastActionProps, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
12630
+
12631
+ export declare namespace ToastAction {
12632
+ export type State = ToastActionState;
12633
+ export type Props = ToastActionProps;
12634
+ }
12635
+
12636
+ export declare interface ToastActionProps extends NativeButtonProps, BaseUIComponentProps<'button', ToastActionState> {}
12637
+
12638
+ export declare interface ToastActionState {
12639
+ /**
12640
+ * The type of the toast.
12641
+ */
12642
+ type: string | undefined;
12643
+ }
12644
+
12645
+ /**
12646
+ * Displays an element positioned against the toast anchor.
12647
+ * Renders a `<div>` element.
12648
+ *
12649
+ * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
12650
+ */
12651
+ export declare const ToastArrow: React_2.ForwardRefExoticComponent<Omit<ToastArrowProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
12652
+
12653
+ export declare namespace ToastArrow {
12654
+ export type State = ToastArrowState;
12655
+ export type Props = ToastArrowProps;
12656
+ }
12657
+
12658
+ export declare interface ToastArrowProps extends BaseUIComponentProps<'div', ToastArrowState> {}
12659
+
12660
+ export declare interface ToastArrowState {
12661
+ /**
12662
+ * The side of the anchor the component is placed on.
12663
+ */
12664
+ side: Side;
12665
+ /**
12666
+ * The alignment of the component relative to the anchor.
12667
+ */
12668
+ align: Align;
12669
+ /**
12670
+ * Whether the arrow cannot be centered on the anchor.
12671
+ */
12672
+ uncentered: boolean;
12673
+ }
12674
+
12675
+ /**
12676
+ * Closes the toast when clicked.
12677
+ * Renders a `<button>` element.
12678
+ *
12679
+ * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
12680
+ */
12681
+ export declare const ToastClose: React_2.ForwardRefExoticComponent<Omit<ToastCloseProps, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
12682
+
12683
+ export declare namespace ToastClose {
12684
+ export type State = ToastCloseState;
12685
+ export type Props = ToastCloseProps;
12686
+ }
12687
+
12688
+ export declare interface ToastCloseProps extends NativeButtonProps, BaseUIComponentProps<'button', ToastCloseState> {}
12689
+
12690
+ export declare interface ToastCloseState {
12691
+ /**
12692
+ * The type of the toast.
12693
+ */
12694
+ type: string | undefined;
12695
+ }
12696
+
12697
+ /**
12698
+ * A container for the contents of a toast.
12699
+ * Renders a `<div>` element.
12700
+ *
12701
+ * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
12702
+ */
12703
+ export declare const ToastContent: React_2.ForwardRefExoticComponent<Omit<ToastContentProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
12704
+
12705
+ export declare namespace ToastContent {
12706
+ export type State = ToastContentState;
12707
+ export type Props = ToastContentProps;
12708
+ }
12709
+
12710
+ export declare interface ToastContentProps extends BaseUIComponentProps<'div', ToastContentState> {}
12711
+
12712
+ export declare interface ToastContentState {
12713
+ /**
12714
+ * Whether the toast viewport is expanded.
12715
+ */
12716
+ expanded: boolean;
12717
+ /**
12718
+ * Whether the toast is behind the frontmost toast in the stack.
12719
+ */
12720
+ behind: boolean;
12721
+ }
12722
+
12723
+ /**
12724
+ * A description that describes the toast.
12725
+ * Can be used as the default message for the toast when no title is provided.
12726
+ * Renders a `<p>` element.
12727
+ *
12728
+ * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
12729
+ */
12730
+ export declare const ToastDescription: React_2.ForwardRefExoticComponent<Omit<ToastDescriptionProps, "ref"> & React_2.RefAttributes<HTMLParagraphElement>>;
12731
+
12732
+ export declare namespace ToastDescription {
12733
+ export type State = ToastDescriptionState;
12734
+ export type Props = ToastDescriptionProps;
12735
+ }
12736
+
12737
+ export declare interface ToastDescriptionProps extends BaseUIComponentProps<'p', ToastDescriptionState> {}
12738
+
12739
+ export declare interface ToastDescriptionState {
12740
+ /**
12741
+ * The type of the toast.
12742
+ */
12743
+ type: string | undefined;
12744
+ }
12745
+
12746
+ export declare interface ToastManager<Data extends object = any> {
12747
+ ' subscribe': (listener: (data: ToastManagerEvent) => void) => () => void;
12748
+ add: <T extends Data = Data>(options: ToastManagerAddOptions<T>) => string;
12749
+ close: (id?: string) => void;
12750
+ update: <T extends Data = Data>(id: string, updates: ToastManagerUpdateOptions<T>) => void;
12751
+ promise: <Value, T extends Data = Data>(promiseValue: Promise<Value>, options: ToastManagerPromiseOptions<Value, T>) => Promise<Value>;
12752
+ }
12753
+
12754
+ export declare interface ToastManagerAddOptions<Data extends object> extends Omit<ToastObject<Data>, 'id' | 'animation' | 'height' | 'ref' | 'limited' | 'updateKey'> {
12755
+ /**
12756
+ * The unique identifier for the toast. Adding a toast with an existing ID
12757
+ * updates it in place and refreshes its auto-dismiss timer.
12758
+ */
12759
+ id?: string | undefined;
12760
+ }
12761
+
12762
+ export declare interface ToastManagerEvent {
12763
+ action: 'add' | 'close' | 'update' | 'promise';
12764
+ options: any;
12765
+ }
12766
+
12767
+ export declare interface ToastManagerPositionerProps extends Omit<ToastPositionerProps, 'anchor' | 'toast'> {
12768
+ /**
12769
+ * An element to position the toast against.
12770
+ */
12771
+ anchor?: Element | null | undefined;
12772
+ }
12773
+
12774
+ export declare interface ToastManagerPromiseOptions<Value, Data extends object> {
12775
+ loading: string | ToastManagerUpdateOptions<Data>;
12776
+ success: string | ToastManagerUpdateOptions<Data> | ((result: Value) => string | ToastManagerUpdateOptions<Data>);
12777
+ error: string | ToastManagerUpdateOptions<Data> | ((error: any) => string | ToastManagerUpdateOptions<Data>);
12778
+ }
12779
+
12780
+ export declare interface ToastManagerUpdateOptions<Data extends object> extends Partial<Omit<ToastObject<Data>, 'id' | 'ref' | 'height' | 'transitionStatus' | 'limited' | 'updateKey'>> {}
12781
+
12782
+ declare type ToastNamespace = {
12783
+ Provider: typeof Toast_2.Provider;
12784
+ Portal: typeof Toast_2.Portal;
12785
+ Viewport: typeof Viewport;
12786
+ Root: typeof Root_6;
12787
+ Title: typeof Title_2;
12788
+ Close: typeof CloseButton;
12789
+ useToastManager: typeof Toast_2.useToastManager;
12790
+ };
12791
+
12792
+ export declare interface ToastObject<Data extends object> {
12793
+ /**
12794
+ * The unique identifier for the toast.
12795
+ */
12796
+ id: string;
12797
+ /**
12798
+ * The ref for the toast.
12799
+ */
12800
+ ref?: React_2.RefObject<HTMLElement | null> | undefined;
12801
+ /**
12802
+ * The title of the toast.
12803
+ */
12804
+ title?: React_2.ReactNode;
12805
+ /**
12806
+ * The type of the toast. Used to conditionally style the toast,
12807
+ * including conditionally rendering elements based on the type.
12808
+ */
12809
+ type?: string | undefined;
12810
+ /**
12811
+ * The description of the toast.
12812
+ */
12813
+ description?: React_2.ReactNode;
12814
+ /**
12815
+ * The amount of time (in ms) before the toast is auto dismissed.
12816
+ * A value of `0` will prevent the toast from being dismissed automatically.
12817
+ * @default 5000
12818
+ */
12819
+ timeout?: number | undefined;
12820
+ /**
12821
+ * The priority of the toast.
12822
+ * - `low` - The toast will be announced politely.
12823
+ * - `high` - The toast will be announced urgently.
12824
+ * @default 'low'
12825
+ */
12826
+ priority?: 'low' | 'high' | undefined;
12827
+ /**
12828
+ * The transition status of the toast.
12829
+ */
12830
+ transitionStatus?: 'starting' | 'ending' | undefined;
12831
+ /**
12832
+ * A counter that increments whenever the toast is updated or upserted.
12833
+ */
12834
+ updateKey?: number | undefined;
12835
+ /**
12836
+ * Determines if the toast was limited because the toast limit was exceeded.
12837
+ */
12838
+ limited?: boolean | undefined;
12839
+ /**
12840
+ * The height of the toast.
12841
+ */
12842
+ height?: number | undefined;
12843
+ /**
12844
+ * Callback function to be called when the toast is closed.
12845
+ */
12846
+ onClose?: (() => void) | undefined;
12847
+ /**
12848
+ * Callback function to be called when the toast is removed from the list after any animations are complete when closed.
12849
+ */
12850
+ onRemove?: (() => void) | undefined;
12851
+ /**
12852
+ * The props for the action button.
12853
+ */
12854
+ actionProps?: React_2.ComponentPropsWithoutRef<'button'> | undefined;
12855
+ /**
12856
+ * The props forwarded to the toast positioner element when rendering anchored toasts.
12857
+ */
12858
+ positionerProps?: ToastManagerPositionerProps | undefined;
12859
+ /**
12860
+ * Custom data for the toast.
12861
+ */
12862
+ data?: Data | undefined;
12863
+ }
12864
+
12865
+ /**
12866
+ * A portal element that moves the viewport to a different part of the DOM.
12867
+ * By default, the portal element is appended to `<body>`.
12868
+ * Renders a `<div>` element.
12869
+ *
12870
+ * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
12871
+ */
12872
+ export declare const ToastPortal: ForwardRefExoticComponent<Omit<FloatingPortalLite.Props<any>, "ref"> & RefAttributes<HTMLDivElement>>;
12873
+
12874
+ export declare namespace ToastPortal {
12875
+ export type State = ToastPortalState;
12876
+ export type Props = ToastPortalProps;
12877
+ }
12878
+
12879
+ export declare interface ToastPortalProps extends FloatingPortalLite.Props<ToastPortalState> {}
12880
+
12881
+ export declare interface ToastPortalState {}
12882
+
12883
+ /**
12884
+ * Positions the toast against the anchor.
12885
+ * Renders a `<div>` element.
12886
+ *
12887
+ * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
12888
+ */
12889
+ export declare const ToastPositioner: React_2.ForwardRefExoticComponent<Omit<ToastPositionerProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
12890
+
12891
+ export declare namespace ToastPositioner {
12892
+ export type State = ToastPositionerState;
12893
+ export type Props = ToastPositionerProps;
12894
+ }
12895
+
12896
+ export declare interface ToastPositionerProps extends BaseUIComponentProps<'div', ToastPositionerState>, Omit<UseAnchorPositioningSharedParameters, 'side' | 'anchor'> {
12897
+ /**
12898
+ * An element to position the toast against.
12899
+ */
12900
+ anchor?: Element | null | undefined;
12901
+ /**
12902
+ * Which side of the anchor element to align the toast against.
12903
+ * May automatically change to avoid collisions.
12904
+ * @default 'top'
12905
+ */
12906
+ side?: Side | undefined;
12907
+ /**
12908
+ * The toast object associated with the positioner.
12909
+ */
12910
+ toast: ToastObject<any>;
12911
+ }
12912
+
12913
+ export declare interface ToastPositionerState {
12914
+ /**
12915
+ * The side of the anchor the component is placed on.
12916
+ */
12917
+ side: Side;
12918
+ /**
12919
+ * The alignment of the component relative to the anchor.
12920
+ */
12921
+ align: Align;
12922
+ /**
12923
+ * Whether the anchor element is hidden.
12924
+ */
12925
+ anchorHidden: boolean;
12926
+ }
12927
+
12928
+ /**
12929
+ * Provides a context for creating and managing toasts.
12930
+ *
12931
+ * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
12932
+ */
12933
+ export declare const ToastProvider: React_2.FC<ToastProvider.Props>;
12934
+
12935
+ export declare namespace ToastProvider {
12936
+ export type State = ToastProviderState;
12937
+ export type Props = ToastProviderProps;
12938
+ }
12939
+
12940
+ export declare interface ToastProviderProps {
12941
+ children?: React_2.ReactNode;
12942
+ /**
12943
+ * The default amount of time (in ms) before a toast is auto dismissed.
12944
+ * A value of `0` will prevent the toast from being dismissed automatically.
12945
+ * @default 5000
12946
+ */
12947
+ timeout?: number | undefined;
12948
+ /**
12949
+ * The maximum number of toasts that can be displayed at once.
12950
+ * When the limit is reached, the oldest toast will be removed to make room for the new one.
12951
+ * @default 3
12952
+ */
12953
+ limit?: number | undefined;
12954
+ /**
12955
+ * A global manager for toasts to use outside of a React component.
12956
+ */
12957
+ toastManager?: ToastManager | undefined;
12958
+ }
12959
+
12960
+ export declare interface ToastProviderState {}
12961
+
12962
+ /**
12963
+ * Groups all parts of an individual toast.
12964
+ * Renders a `<div>` element.
12965
+ *
12966
+ * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
12967
+ */
12968
+ export declare const ToastRoot: React_2.ForwardRefExoticComponent<Omit<ToastRootProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
12969
+
12970
+ export declare namespace ToastRoot {
12971
+ export type ToastObject<Data extends object = any> = ToastRootToastObject<Data>;
12972
+ export type State = ToastRootState;
12973
+ export type Props = ToastRootProps;
12974
+ }
12975
+
12976
+ export declare interface ToastRootProps extends BaseUIComponentProps<'div', ToastRootState> {
12977
+ /**
12978
+ * The toast to render.
12979
+ */
12980
+ toast: ToastRootToastObject<any>;
12981
+ /**
12982
+ * Direction(s) in which the toast can be swiped to dismiss.
12983
+ * @default ['down', 'right']
12984
+ */
12985
+ swipeDirection?: 'up' | 'down' | 'left' | 'right' | ('up' | 'down' | 'left' | 'right')[] | undefined;
12986
+ }
12987
+
12988
+ export declare interface ToastRootState {
12989
+ /**
12990
+ * The transition status of the component.
12991
+ */
12992
+ transitionStatus: TransitionStatus;
12993
+ /**
12994
+ * Whether the toasts in the viewport are expanded.
12995
+ */
12996
+ expanded: boolean;
12997
+ /**
12998
+ * Whether the toast was limited because the toast limit was exceeded.
12999
+ */
13000
+ limited: boolean;
13001
+ /**
13002
+ * The type of the toast.
13003
+ */
13004
+ type: string | undefined;
13005
+ /**
13006
+ * Whether the toast is being swiped.
13007
+ */
13008
+ swiping: boolean;
13009
+ /**
13010
+ * The direction the toast is being swiped.
13011
+ */
13012
+ swipeDirection: 'up' | 'down' | 'left' | 'right' | undefined;
13013
+ }
13014
+
13015
+ export declare type ToastRootToastObject<Data extends object = any> = ToastObject<Data>;
13016
+
13017
+ /**
13018
+ * A title that labels the toast.
13019
+ * Renders an `<h2>` element.
13020
+ *
13021
+ * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
13022
+ */
13023
+ export declare const ToastTitle: React_2.ForwardRefExoticComponent<Omit<ToastTitleProps, "ref"> & React_2.RefAttributes<HTMLHeadingElement>>;
13024
+
13025
+ export declare namespace ToastTitle {
13026
+ export type State = ToastTitleState;
13027
+ export type Props = ToastTitleProps;
13028
+ }
13029
+
13030
+ export declare interface ToastTitleProps extends BaseUIComponentProps<'h2', ToastTitleState> {}
13031
+
13032
+ export declare interface ToastTitleState {
13033
+ /**
13034
+ * The type of the toast.
13035
+ */
13036
+ type: string | undefined;
13037
+ }
13038
+
13039
+ export declare type ToastType = 'status' | 'success' | 'error' | 'preview';
13040
+
13041
+ /**
13042
+ * A container viewport for toasts.
13043
+ * Renders a `<div>` element.
13044
+ *
13045
+ * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
13046
+ */
13047
+ export declare const ToastViewport: React_2.ForwardRefExoticComponent<Omit<ToastViewportProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
13048
+
13049
+ export declare namespace ToastViewport {
13050
+ export type State = ToastViewportState;
13051
+ export type Props = ToastViewportProps;
13052
+ }
13053
+
13054
+ export declare interface ToastViewportProps extends BaseUIComponentProps<'div', ToastViewportState> {}
13055
+
13056
+ export declare interface ToastViewportState {
13057
+ /**
13058
+ * Whether toasts are expanded in the viewport.
13059
+ */
13060
+ expanded: boolean;
13061
+ }
13062
+
12579
13063
  export declare const Toggle: React_2.ForwardRefExoticComponent<Omit<Omit<Toggle_2.Props<string> & React_2.RefAttributes<HTMLButtonElement>, "ref">, "className"> & {
12580
13064
  className?: string;
12581
13065
  } & React_2.RefAttributes<HTMLButtonElement>>;
@@ -13630,8 +14114,25 @@ declare interface UseRenderElementComponentProps<State> {
13630
14114
  style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
13631
14115
  }
13632
14116
 
14117
+ /**
14118
+ * Returns the array of toasts and methods to manage them.
14119
+ */
14120
+ export declare function useToastManager<Data extends object = any>(): UseToastManagerReturnValue<Data>;
14121
+
14122
+ export declare interface UseToastManagerReturnValue<Data extends object = any> {
14123
+ toasts: ToastObject<Data>[];
14124
+ add: <T extends Data = Data>(options: ToastManagerAddOptions<T>) => string;
14125
+ close: (toastId?: string) => void;
14126
+ update: <T extends Data = Data>(toastId: string, options: ToastManagerUpdateOptions<T>) => void;
14127
+ promise: <Value, T extends Data = Data>(promise: Promise<Value>, options: ToastManagerPromiseOptions<Value, T>) => Promise<Value>;
14128
+ }
14129
+
13633
14130
  declare type Variant = (typeof AccordionVariant)[keyof typeof AccordionVariant];
13634
14131
 
14132
+ declare const Viewport: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ToastViewportProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
14133
+ className?: string;
14134
+ } & React_2.RefAttributes<HTMLDivElement>>;
14135
+
13635
14136
  declare const wheel: "wheel";
13636
14137
 
13637
14138
  declare const windowResize: "window-resize";
package/dist/index.js CHANGED
@@ -38,6 +38,7 @@ export { Separator } from "./Separator/index.js";
38
38
  export { Slider, SliderSize } from "./Slider/index.js";
39
39
  export { Switch, SwitchSize } from "./Switch/index.js";
40
40
  export { TabListAlign, TabListUnderline, Tabs } from "./Tabs/index.js";
41
+ export { Toast } from "./Toast/index.js";
41
42
  export { Toggle } from "./Toggle/index.js";
42
43
  export { ToggleGroup } from "./ToggleGroup/index.js";
43
44
  export { Toolbar } from "./Toolbar/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/site-ui",
3
- "version": "1.185.0",
3
+ "version": "1.186.0",
4
4
  "description": "Pure UI components for the Wix site builder",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -94,5 +94,5 @@
94
94
  "registry": "https://registry.npmjs.org/",
95
95
  "access": "public"
96
96
  },
97
- "falconPackageHash": "f5092a62cc71fc5b7985ad1d2986b57b476c3bc67137c2e54de9e23d"
97
+ "falconPackageHash": "f117e7b877e63d067b4aa1914d80bc07ca17b68383f3c8c07b86c2ae"
98
98
  }