@design-system-rte/react 0.16.0 → 1.0.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.
package/README.md CHANGED
@@ -32,4 +32,4 @@
32
32
 
33
33
  4. **Use Components:**
34
34
 
35
- Implement the different components as documented in the [Storybook](https://opensource.rte-france.com/design-system-rte/?path=/docs/react_button--docs) provided with the library.
35
+ Implement the different components as documented in the [Storybook](https://opensource.rte-france.com/design-system-rte/?path=/docs/react_composants-button--docs) provided with the library.
@@ -0,0 +1,6 @@
1
+ import { ToastProps as coreToastProps } from '../../../../core/components/toast/toast.interface';
2
+ interface ToastProps extends coreToastProps, React.HTMLAttributes<HTMLDivElement> {
3
+ showActionButton?: boolean;
4
+ }
5
+ declare const Toast: import('react').ForwardRefExoticComponent<ToastProps & import('react').RefAttributes<HTMLDivElement>>;
6
+ export default Toast;
@@ -0,0 +1,6 @@
1
+ declare const useHandleQueueChanges: (id: string, isOpen: boolean) => {
2
+ isInternalOpen: boolean;
3
+ hideToast: () => void;
4
+ showToast: () => void;
5
+ };
6
+ export default useHandleQueueChanges;
@@ -0,0 +1,10 @@
1
+ import { ToastDuration } from '../../../../../core/components/toast/toast.interface';
2
+ type TimeoutProperties = {
3
+ shouldStartTimer: boolean;
4
+ duration: ToastDuration;
5
+ };
6
+ declare const useHandleTimer: ({ shouldStartTimer, duration }: TimeoutProperties, callback: () => void) => {
7
+ initializeTimer: () => void;
8
+ removeTimer: () => void;
9
+ };
10
+ export default useHandleTimer;
@@ -0,0 +1,17 @@
1
+ export type InputToast = {
2
+ id: string;
3
+ hasActionButton: boolean;
4
+ type: "info" | "success" | "warning" | "error" | "neutral";
5
+ };
6
+ export type ToastQueueItem = {
7
+ id: string;
8
+ priority: number;
9
+ isOpen?: boolean;
10
+ };
11
+ export declare const ToastQueueContext: import('react').Context<{
12
+ addToQueue: (toast: InputToast) => void;
13
+ removeFromQueue: (id: string) => void;
14
+ isFirstInQueue: (id: string) => boolean;
15
+ isInQueue: (id: string) => boolean;
16
+ queue: ToastQueueItem[];
17
+ } | null>;
@@ -0,0 +1,4 @@
1
+ declare const ToastQueueProvider: ({ children }: {
2
+ children: React.ReactNode;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default ToastQueueProvider;
@@ -0,0 +1,8 @@
1
+ export declare const useToastQueueContext: () => {
2
+ addToQueue: (toast: import('./ToastQueueContext').InputToast) => void;
3
+ removeFromQueue: (id: string) => void;
4
+ isFirstInQueue: (id: string) => boolean;
5
+ isInQueue: (id: string) => boolean;
6
+ queue: import('./ToastQueueContext').ToastQueueItem[];
7
+ };
8
+ export default useToastQueueContext;
package/dist/index.d.ts CHANGED
@@ -23,5 +23,7 @@ import { default as SplitButton } from './components/splitButton/SplitButton.tsx
23
23
  import { default as Switch } from './components/switch/Switch.tsx';
24
24
  import { default as Textarea } from './components/textarea/Textarea.tsx';
25
25
  import { default as TextInput } from './components/textInput/TextInput.tsx';
26
+ import { default as Toast } from './components/toast/Toast.tsx';
27
+ import { default as ToastQueueProvider } from './components/toast/toastQueue/ToastQueueProvider.tsx';
26
28
  import { default as Tooltip } from './components/tooltip/Tooltip.tsx';
27
- export { Button, Grid, Checkbox, CheckboxGroup, Link, RadioButton, RadioButtonGroup, Icon, IconButton, IconButtonToggle, SplitButton, Tooltip, TextInput, Chip, Badge, Textarea, Divider, Switch, SegmentedControl, Breadcrumbs, Banner, Popover, Modal, SideNav, BaseSideNav, Card, };
29
+ export { Button, Grid, Checkbox, CheckboxGroup, Link, RadioButton, RadioButtonGroup, Icon, IconButton, IconButtonToggle, SplitButton, Tooltip, TextInput, Chip, Badge, Textarea, Divider, Switch, SegmentedControl, Breadcrumbs, Banner, Popover, Modal, SideNav, BaseSideNav, Card, Toast, ToastQueueProvider, };