0.11.4 • Published 8 months ago

@snack-uikit/toaster v0.11.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

Toaster

Installation

npm i @snack-uikit/toaster

Changelog

Usage

import { toaster } from '@snack-uikit/toaster';

// create userAction toast
const userActionId = await toaster.userAction.success({ label, id });

// create systemEvent toast
const systemEventId = await toaster.systemEvent.success({ title, description, id });

// update userAction toast
toaster.userAction.update.error(userActionId, { label: 'new text' });

// update systemEvent toast
toaster.systemEvent.update.error(systemEventId, {
    title: 'new text',
    description: 'new description',
});

// dismiss userAction toast
toaster.userAction.dismiss(userActionId);

// dismiss systemEvent toast
toaster.systemEvent.dismiss(systemEventId);

Props

type ToastUserActionLink = {
  text: string;
  href: string;
  onClick?(e: MouseEvent<HTMLAnchorElement>): void;
};

type ToastUserActionProps = Partial<RtToastContentProps> &
  WithSupportProps<{
    label: string;
    link?: ToastUserActionLink;
    className?: string;
    onClose(id?: string | number): void;
  }>;

type ToastSystemEventLink = {
  text: string;
  href: string;
  onClick?(e: MouseEvent<HTMLAnchorElement>): void;
};

type ToastSystemEventProps = Partial<RtToastContentProps> &
  WithSupportProps<{
    title: string;
    description?: string;
    link?: ToastSystemEventLink;
    progressBar?: boolean;
    closable?: boolean;
    className?: string;
    onCloseClick?(e: MouseEvent<HTMLButtonElement>, close?: () => void): void;
    onClose(id?: string | number): void;
  }>;

TODO

  • Translations
0.8.9

1 year ago

0.8.8

1 year ago

0.8.5

1 year ago

0.8.4

1 year ago

0.8.7

1 year ago

0.8.6

1 year ago

0.9.4

11 months ago

0.9.3

11 months ago

0.10.1

10 months ago

0.10.0

11 months ago

0.8.3

1 year ago

0.8.2

1 year ago

0.11.0

9 months ago

0.11.1

9 months ago

0.11.2

9 months ago

0.11.3

8 months ago

0.11.4

8 months ago

0.9.0

11 months ago

0.9.2

11 months ago

0.9.1

11 months ago

0.8.12

12 months ago

0.8.11

12 months ago

0.8.14

11 months ago

0.8.13

12 months ago

0.8.10

1 year ago

0.8.19

11 months ago

0.8.16

11 months ago

0.8.15

11 months ago

0.8.18

11 months ago

0.8.17

11 months ago

0.7.0

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago

0.6.27

1 year ago

0.6.26

1 year ago

0.6.21

2 years ago

0.6.20

2 years ago

0.6.23

2 years ago

0.6.22

2 years ago

0.6.25

1 year ago

0.6.24

1 year ago

0.6.18

2 years ago

0.6.17

2 years ago

0.6.19

2 years ago

0.6.16

2 years ago

0.6.15

2 years ago

0.6.14

2 years ago

0.6.13

2 years ago

0.6.12

2 years ago

0.6.11

2 years ago

0.6.10

2 years ago

0.6.9

2 years ago

0.6.8

2 years ago

0.6.7

2 years ago

0.6.6

2 years ago

0.6.5

2 years ago

0.6.4

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.5

2 years ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago