@dinofront/design_system 1.14.0 → 1.15.1

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.
@@ -1,3 +1,3 @@
1
1
  import { SnackbarContextValue, SnackbarProviderProps } from './Snackbar.types';
2
2
  export declare function useSnackbar(): SnackbarContextValue;
3
- export declare function SnackbarProvider({ children, dataTestId }: SnackbarProviderProps): import("react").JSX.Element;
3
+ export declare function SnackbarProvider({ children, dataTestId, position: defaultPosition, }: SnackbarProviderProps): import("react").JSX.Element;
@@ -1,14 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { BaseProps } from '../../types';
3
3
  export type SnackbarVariant = 'success' | 'warning' | 'danger' | 'info' | 'neutral';
4
- /**
5
- * A single toast entry. `dataTestId` is optional per-toast so callers can
6
- * tag a specific `show()` call for e2e selection (there's no other prop
7
- * surface to hang a QA hook off — the toast itself is never a
8
- * consumer-authored JSX element, just a data object passed to `show()`).
9
- */
4
+ export type SnackbarPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
10
5
  export interface SnackbarItem extends BaseProps {
11
6
  id: string;
7
+ /** Overrides the provider's `position` for this toast only. */
8
+ position?: SnackbarPosition;
12
9
  message: ReactNode;
13
10
  variant?: SnackbarVariant;
14
11
  duration?: number;
@@ -25,4 +22,6 @@ export interface SnackbarContextValue {
25
22
  }
26
23
  export interface SnackbarProviderProps extends BaseProps {
27
24
  children: ReactNode;
25
+ /** Default position for toasts that don't set their own. Defaults to `bottom-center`. */
26
+ position?: SnackbarPosition;
28
27
  }
@@ -1,2 +1,2 @@
1
1
  export { SnackbarProvider, useSnackbar } from './Snackbar';
2
- export type { SnackbarVariant, SnackbarItem, SnackbarContextValue, SnackbarProviderProps, } from './Snackbar.types';
2
+ export type { SnackbarVariant, SnackbarItem, SnackbarPosition, SnackbarContextValue, SnackbarProviderProps, } from './Snackbar.types';