@solfacil/girassol 0.4.0 → 0.5.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.
@@ -1,9 +1,14 @@
1
- import type { Position, ToastContent, ToastOptions } from './types';
1
+ import type { ContentTostParams, Position, ToastOptionsLimited } from './types';
2
+ declare type createToastReturn = {
3
+ close: (id: number, position: Position) => void;
4
+ };
5
+ declare function clearAllToasts(): void;
2
6
  export declare function useToast(): {
3
- createToast: (content: string | ToastContent, options?: ToastOptions) => {
4
- close: () => void;
5
- };
6
- clearAllToasts: () => void;
7
+ createToast: (content: ContentTostParams, options?: ToastOptionsLimited | undefined) => createToastReturn;
8
+ createErrorToast: (content: ContentTostParams, options?: ToastOptionsLimited | undefined) => createToastReturn;
9
+ createSuccessToast: (content: ContentTostParams, options?: ToastOptionsLimited | undefined) => createToastReturn;
10
+ createInformativeToast: (content: ContentTostParams, options?: ToastOptionsLimited | undefined) => createToastReturn;
11
+ createWarningToast: (content: ContentTostParams, options?: ToastOptionsLimited | undefined) => createToastReturn;
12
+ clearAllToasts: typeof clearAllToasts;
7
13
  };
8
- declare function close(id: number, position: Position): void;
9
14
  export {};
@@ -1,9 +1,12 @@
1
1
  import type { VNode } from 'vue';
2
- export declare type ToastType = 'info' | 'danger' | 'warning' | 'success';
2
+ export declare type ToastType = 'informative' | 'error' | 'warning' | 'success';
3
3
  export declare type Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center';
4
4
  export interface ToastContent {
5
- title: string;
6
- description?: string;
5
+ type?: ToastType;
6
+ title?: string;
7
+ description: string;
8
+ actionText?: string;
9
+ onAction?: () => void;
7
10
  }
8
11
  export interface ToastOptions {
9
12
  type?: ToastType;
@@ -13,7 +16,17 @@ export interface ToastOptions {
13
16
  showCloseButton?: boolean;
14
17
  hideProgressBar?: boolean;
15
18
  onClose?: () => void;
16
- showOneToast?: boolean;
19
+ }
20
+ export interface ToastContentLimited {
21
+ type?: ToastType;
22
+ title?: string;
23
+ description: string;
24
+ actionText?: string;
25
+ onAction?: () => void;
26
+ }
27
+ export interface ToastOptionsLimited {
28
+ type?: ToastType;
29
+ timeout?: number;
17
30
  }
18
31
  export interface ToastObject {
19
32
  toastVNode: VNode;
@@ -21,3 +34,17 @@ export interface ToastObject {
21
34
  }
22
35
  export declare const TOAST_GAP = 12;
23
36
  export declare const DEFAULT_OPTIONS: ToastOptions;
37
+ export interface ToastComponent {
38
+ id: string | number;
39
+ type: ToastType;
40
+ visible?: boolean;
41
+ title?: ToastContent['title'];
42
+ description: ToastContent['description'];
43
+ actionText?: ToastContent['actionText'];
44
+ timeout: number;
45
+ offset: number;
46
+ onAction?: ToastOptions['onClose'];
47
+ hideProgress?: boolean;
48
+ showIcon?: boolean;
49
+ }
50
+ export declare type ContentTostParams = ToastContent | string;
@@ -294,7 +294,7 @@ export declare const components: {
294
294
  type: import("vue").PropType<string>;
295
295
  };
296
296
  size: {
297
- type: import("vue").PropType<"sm" | "md">;
297
+ type: import("vue").PropType<"small" | "medium">;
298
298
  } & {
299
299
  default: string;
300
300
  };
@@ -351,7 +351,7 @@ export declare const components: {
351
351
  type: import("vue").PropType<string>;
352
352
  };
353
353
  size: {
354
- type: import("vue").PropType<"sm" | "md">;
354
+ type: import("vue").PropType<"small" | "medium">;
355
355
  } & {
356
356
  default: string;
357
357
  };
@@ -394,7 +394,7 @@ export declare const components: {
394
394
  }>> & {
395
395
  "onUpdate:modelValue"?: ((event: string) => any) | undefined;
396
396
  }, {
397
- size: "sm" | "md";
397
+ size: "small" | "medium";
398
398
  error: string | null;
399
399
  resize: "none" | "both" | "horizontal" | "vertical";
400
400
  }>;
@@ -403,7 +403,7 @@ export declare const components: {
403
403
  $: import("vue").ComponentInternalInstance;
404
404
  $data: {};
405
405
  $props: Partial<{
406
- size: "sm" | "md";
406
+ size: "small" | "medium";
407
407
  error: string | null;
408
408
  }> & Omit<Readonly<import("vue").ExtractPropTypes<{
409
409
  label: {
@@ -426,7 +426,7 @@ export declare const components: {
426
426
  type: import("vue").PropType<string>;
427
427
  };
428
428
  size: {
429
- type: import("vue").PropType<"sm" | "md">;
429
+ type: import("vue").PropType<"small" | "medium">;
430
430
  } & {
431
431
  default: string;
432
432
  };
@@ -510,7 +510,7 @@ export declare const components: {
510
510
  type: import("vue").PropType<string>;
511
511
  };
512
512
  size: {
513
- type: import("vue").PropType<"sm" | "md">;
513
+ type: import("vue").PropType<"small" | "medium">;
514
514
  } & {
515
515
  default: string;
516
516
  };
@@ -562,7 +562,7 @@ export declare const components: {
562
562
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
563
563
  "update:modelValue": (event: string) => void;
564
564
  }, string, {
565
- size: "sm" | "md";
565
+ size: "small" | "medium";
566
566
  error: string | null;
567
567
  }> & {
568
568
  beforeCreate?: ((() => void) | (() => void)[]) | undefined;
@@ -605,7 +605,7 @@ export declare const components: {
605
605
  type: import("vue").PropType<string>;
606
606
  };
607
607
  size: {
608
- type: import("vue").PropType<"sm" | "md">;
608
+ type: import("vue").PropType<"small" | "medium">;
609
609
  } & {
610
610
  default: string;
611
611
  };
@@ -679,7 +679,7 @@ export declare const components: {
679
679
  type: import("vue").PropType<string>;
680
680
  };
681
681
  size: {
682
- type: import("vue").PropType<"sm" | "md">;
682
+ type: import("vue").PropType<"small" | "medium">;
683
683
  } & {
684
684
  default: string;
685
685
  };
@@ -731,7 +731,7 @@ export declare const components: {
731
731
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
732
732
  "update:modelValue": (event: string) => void;
733
733
  }, string, {
734
- size: "sm" | "md";
734
+ size: "small" | "medium";
735
735
  error: string | null;
736
736
  }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
737
737
  $slots: {
@@ -755,7 +755,7 @@ export declare const components: {
755
755
  default: boolean;
756
756
  };
757
757
  size: {
758
- type: import("vue").PropType<"sm" | "md">;
758
+ type: import("vue").PropType<"small" | "medium">;
759
759
  };
760
760
  name: {
761
761
  type: import("vue").PropType<string>;
@@ -807,7 +807,7 @@ export declare const components: {
807
807
  default: boolean;
808
808
  };
809
809
  size: {
810
- type: import("vue").PropType<"sm" | "md">;
810
+ type: import("vue").PropType<"small" | "medium">;
811
811
  };
812
812
  name: {
813
813
  type: import("vue").PropType<string>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@solfacil/girassol",
3
3
  "description": "Girassol design system",
4
- "version": "0.4.0",
4
+ "version": "0.5.0",
5
5
  "authors": [
6
6
  {
7
7
  "name": "Kevin Martin",
@@ -6,6 +6,8 @@ export default {
6
6
  intense: 0.6,
7
7
  medium: 0.32,
8
8
  light: 0.16,
9
+
10
+ none: 0,
9
11
  },
10
12
 
11
13
  boxShadow: {