@mindly/ui-components 5.1.1 → 5.2.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 (32) hide show
  1. package/dist/cjs/configs/tailwind/colors.d.ts +8 -0
  2. package/dist/cjs/index.js +13 -4
  3. package/dist/cjs/lib2/shared/hooks/index.d.ts +1 -0
  4. package/dist/cjs/lib2/shared/hooks/useToastContext.d.ts +3 -0
  5. package/dist/cjs/lib2/shared/providers/ToastProvider/ToastProvider.d.ts +5 -0
  6. package/dist/cjs/lib2/shared/providers/ToastProvider/index.d.ts +1 -0
  7. package/dist/cjs/lib2/shared/providers/index.d.ts +1 -0
  8. package/dist/cjs/lib2/shared/ui/Toast/Toast.d.ts +4 -0
  9. package/dist/cjs/lib2/shared/ui/Toast/ToastCloseButton.d.ts +5 -0
  10. package/dist/cjs/lib2/shared/ui/Toast/ToastRegion.d.ts +3 -0
  11. package/dist/cjs/lib2/shared/ui/Toast/index.d.ts +2 -0
  12. package/dist/cjs/lib2/shared/ui/Toast/styles.d.ts +50 -0
  13. package/dist/cjs/lib2/shared/ui/Toast/types.d.ts +13 -0
  14. package/dist/cjs/lib2/shared/ui/index.d.ts +1 -0
  15. package/dist/esm/configs/tailwind/colors.d.ts +8 -0
  16. package/dist/esm/index.js +13 -4
  17. package/dist/esm/lib2/shared/hooks/index.d.ts +1 -0
  18. package/dist/esm/lib2/shared/hooks/useToastContext.d.ts +3 -0
  19. package/dist/esm/lib2/shared/providers/ToastProvider/ToastProvider.d.ts +5 -0
  20. package/dist/esm/lib2/shared/providers/ToastProvider/index.d.ts +1 -0
  21. package/dist/esm/lib2/shared/providers/index.d.ts +1 -0
  22. package/dist/esm/lib2/shared/ui/Toast/Toast.d.ts +4 -0
  23. package/dist/esm/lib2/shared/ui/Toast/ToastCloseButton.d.ts +5 -0
  24. package/dist/esm/lib2/shared/ui/Toast/ToastRegion.d.ts +3 -0
  25. package/dist/esm/lib2/shared/ui/Toast/index.d.ts +2 -0
  26. package/dist/esm/lib2/shared/ui/Toast/styles.d.ts +50 -0
  27. package/dist/esm/lib2/shared/ui/Toast/types.d.ts +13 -0
  28. package/dist/esm/lib2/shared/ui/index.d.ts +1 -0
  29. package/dist/index.d.ts +19 -1
  30. package/package.json +3 -1
  31. package/src/configs/tailwind/colors.ts +8 -0
  32. package/src/lib2/shared/css/tailwind.css +3 -1
@@ -2,3 +2,4 @@ export * from './use-dom-ref';
2
2
  export * from './use-event';
3
3
  export * from './useAutoFocus';
4
4
  export * from './useIsKeyboardShown';
5
+ export * from './useToastContext';
@@ -0,0 +1,3 @@
1
+ import { ToastState } from '@react-stately/toast';
2
+ import { MindlyToastProps } from '../ui/Toast/types';
3
+ export declare function useToastContext(): ToastState<MindlyToastProps>;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import { ToastState } from '@react-stately/toast';
3
+ import { MindlyToastProps, ToastProviderProps } from '../../ui/Toast/types';
4
+ export declare const ToastContext: React.Context<ToastState<MindlyToastProps> | undefined>;
5
+ export declare function ToastProvider({ children, ...props }: React.PropsWithChildren<ToastProviderProps>): JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './ToastProvider';
@@ -1 +1,2 @@
1
1
  export * from './ThemeProvider';
2
+ export * from './ToastProvider';
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import './Toast.css';
3
+ import { ToastProps } from './types';
4
+ export declare function Toast<T extends React.ReactNode>({ state, ...props }: ToastProps<T>): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import { AriaButtonProps } from 'react-aria';
3
+ export declare const ToastCloseButton: React.ForwardRefExoticComponent<AriaButtonProps<"button"> & {
4
+ className?: string | undefined;
5
+ } & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { ToastRegionProps } from './types';
3
+ export declare function ToastRegion<T extends React.ReactNode>({ state, ...props }: ToastRegionProps<T>): JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './Toast';
2
+ export * from './ToastRegion';
@@ -0,0 +1,50 @@
1
+ export declare const toastStyles: import("tailwind-variants").TVReturnType<{
2
+ type: {
3
+ success: "bg-badges-success-main";
4
+ error: "bg-color-info-red-not-red";
5
+ attention: "bg-badges-attention-main";
6
+ info: "bg-color-info-blue";
7
+ };
8
+ }, undefined, "toast fixed left-0 right-0 w-full h-[80px]", import("tailwind-variants/dist/config").TVConfig<{
9
+ type: {
10
+ success: "bg-badges-success-main";
11
+ error: "bg-color-info-red-not-red";
12
+ attention: "bg-badges-attention-main";
13
+ info: "bg-color-info-blue";
14
+ };
15
+ }, {
16
+ type: {
17
+ success: "bg-badges-success-main";
18
+ error: "bg-color-info-red-not-red";
19
+ attention: "bg-badges-attention-main";
20
+ info: "bg-color-info-blue";
21
+ };
22
+ }>, {
23
+ type: {
24
+ success: "bg-badges-success-main";
25
+ error: "bg-color-info-red-not-red";
26
+ attention: "bg-badges-attention-main";
27
+ info: "bg-color-info-blue";
28
+ };
29
+ }, undefined, import("tailwind-variants").TVReturnType<{
30
+ type: {
31
+ success: "bg-badges-success-main";
32
+ error: "bg-color-info-red-not-red";
33
+ attention: "bg-badges-attention-main";
34
+ info: "bg-color-info-blue";
35
+ };
36
+ }, undefined, "toast fixed left-0 right-0 w-full h-[80px]", import("tailwind-variants/dist/config").TVConfig<{
37
+ type: {
38
+ success: "bg-badges-success-main";
39
+ error: "bg-color-info-red-not-red";
40
+ attention: "bg-badges-attention-main";
41
+ info: "bg-color-info-blue";
42
+ };
43
+ }, {
44
+ type: {
45
+ success: "bg-badges-success-main";
46
+ error: "bg-color-info-red-not-red";
47
+ attention: "bg-badges-attention-main";
48
+ info: "bg-color-info-blue";
49
+ };
50
+ }>, unknown, unknown, undefined>>;
@@ -0,0 +1,13 @@
1
+ import { ToastState, ToastStateProps } from '@react-stately/toast';
2
+ import { AriaToastProps, AriaToastRegionProps } from '@react-aria/toast';
3
+ export type ToastProviderProps = ToastStateProps;
4
+ export type MindlyToastProps = {
5
+ type?: 'success' | 'error' | 'attention' | 'info';
6
+ text: string;
7
+ };
8
+ export interface ToastRegionProps<T> extends AriaToastRegionProps {
9
+ state: ToastState<T>;
10
+ }
11
+ export interface ToastProps<T> extends AriaToastProps<T> {
12
+ state: ToastState<T>;
13
+ }
@@ -14,3 +14,4 @@ export * from './Calendar';
14
14
  export * from './Textarea_v2';
15
15
  export * from './Rating';
16
16
  export * from './IconButton';
17
+ export * from './Toast';
@@ -11,6 +11,14 @@ declare const _default: {
11
11
  black: string;
12
12
  };
13
13
  };
14
+ info: {
15
+ red: {
16
+ not: {
17
+ red: string;
18
+ };
19
+ };
20
+ blue: string;
21
+ };
14
22
  };
15
23
  typography: {
16
24
  typography: {