pangea-lib 1.19.19 → 2.0.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,2 +1 @@
1
- @require './breakpoints.styl'
2
- @require './colors.styl'
1
+ @require './breakpoints.styl'
@@ -0,0 +1,3 @@
1
+ import { Colors } from './colors.types';
2
+
3
+ export declare const allColors: Colors;
@@ -0,0 +1,3 @@
1
+ import { Color, ColorAlpha } from './colors.types';
2
+
3
+ export declare function rgba(color: Color, colorAlpha: ColorAlpha): string;
@@ -0,0 +1,96 @@
1
+ import { Color, ColorName, Colors } from './colors.types';
2
+
3
+ export declare const useColorsStore: import('pinia').StoreDefinition<"pga-colors", import('pinia')._UnwrapAll<Pick<{
4
+ colors: import('vue').Ref<{
5
+ firstLight: Color;
6
+ secondLight: Color;
7
+ thirdLight: Color;
8
+ firstLightBackground: Color;
9
+ secondLightBackground: Color;
10
+ thirdLightBackground: Color;
11
+ firstDark: Color;
12
+ secondDark: Color;
13
+ thirdDark: Color;
14
+ firstDarkBackground: Color;
15
+ secondDarkBackground: Color;
16
+ thirdDarkBackground: Color;
17
+ primary: Color;
18
+ secondary: Color;
19
+ success: Color;
20
+ warning: Color;
21
+ danger: Color;
22
+ dark: Color;
23
+ light: Color;
24
+ red: Color;
25
+ purple: Color;
26
+ sky: Color;
27
+ beige: Color;
28
+ info: Color;
29
+ link: Color;
30
+ error: Color;
31
+ }>;
32
+ setColor: (colorName: ColorName, newColor: Color) => void;
33
+ setColors: (newColors: Colors) => void;
34
+ }, "colors">>, Pick<{
35
+ colors: import('vue').Ref<{
36
+ firstLight: Color;
37
+ secondLight: Color;
38
+ thirdLight: Color;
39
+ firstLightBackground: Color;
40
+ secondLightBackground: Color;
41
+ thirdLightBackground: Color;
42
+ firstDark: Color;
43
+ secondDark: Color;
44
+ thirdDark: Color;
45
+ firstDarkBackground: Color;
46
+ secondDarkBackground: Color;
47
+ thirdDarkBackground: Color;
48
+ primary: Color;
49
+ secondary: Color;
50
+ success: Color;
51
+ warning: Color;
52
+ danger: Color;
53
+ dark: Color;
54
+ light: Color;
55
+ red: Color;
56
+ purple: Color;
57
+ sky: Color;
58
+ beige: Color;
59
+ info: Color;
60
+ link: Color;
61
+ error: Color;
62
+ }>;
63
+ setColor: (colorName: ColorName, newColor: Color) => void;
64
+ setColors: (newColors: Colors) => void;
65
+ }, never>, Pick<{
66
+ colors: import('vue').Ref<{
67
+ firstLight: Color;
68
+ secondLight: Color;
69
+ thirdLight: Color;
70
+ firstLightBackground: Color;
71
+ secondLightBackground: Color;
72
+ thirdLightBackground: Color;
73
+ firstDark: Color;
74
+ secondDark: Color;
75
+ thirdDark: Color;
76
+ firstDarkBackground: Color;
77
+ secondDarkBackground: Color;
78
+ thirdDarkBackground: Color;
79
+ primary: Color;
80
+ secondary: Color;
81
+ success: Color;
82
+ warning: Color;
83
+ danger: Color;
84
+ dark: Color;
85
+ light: Color;
86
+ red: Color;
87
+ purple: Color;
88
+ sky: Color;
89
+ beige: Color;
90
+ info: Color;
91
+ link: Color;
92
+ error: Color;
93
+ }>;
94
+ setColor: (colorName: ColorName, newColor: Color) => void;
95
+ setColors: (newColors: Colors) => void;
96
+ }, "setColor" | "setColors">>;
@@ -0,0 +1,12 @@
1
+ export type ColorAlpha = number;
2
+ export type ColorRgb = `rgb(${number}, ${number}, ${number})`;
3
+ export type ColorRgba = `rgba(${number}, ${number}, ${number}, ${number})`;
4
+ export type ColorHex = `#${string}`;
5
+ export type Color = ColorRgb | ColorRgba | ColorHex;
6
+ export type ColorNameApp = 'firstLight' | 'secondLight' | 'thirdLight' | 'firstLightBackground' | 'secondLightBackground' | 'thirdLightBackground' | 'firstDark' | 'secondDark' | 'thirdDark' | 'firstDarkBackground' | 'secondDarkBackground' | 'thirdDarkBackground';
7
+ export type ColorNameCustom = 'primary' | 'secondary';
8
+ export type ColorNameDistinctive = 'success' | 'warning' | 'danger' | 'dark' | 'light' | 'red' | 'purple' | 'sky' | 'beige';
9
+ export type ColorNameInformative = 'info' | 'link' | 'error';
10
+ export type ColorNameUnique = ColorNameCustom | ColorNameDistinctive;
11
+ export type ColorName = ColorNameApp | ColorNameCustom | ColorNameDistinctive | ColorNameInformative;
12
+ export type Colors = Record<ColorName, Color>;
@@ -0,0 +1,6 @@
1
+ import { storeToRefs } from 'pinia';
2
+ import { rgba } from './colors.helpers';
3
+ import { useColorsStore } from './colors.store';
4
+
5
+ export { storeToRefs, rgba, useColorsStore };
6
+ export * from './colors.types';
@@ -1,7 +1,9 @@
1
+ import { ColorNameUnique } from '../colors';
2
+
1
3
  declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
2
- color: "dark" | "light" | "danger" | "warning" | "success" | "red" | "purple" | "sky" | "beige";
4
+ color: ColorNameUnique;
3
5
  }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
- color: "dark" | "light" | "danger" | "warning" | "success" | "red" | "purple" | "sky" | "beige";
6
+ color: ColorNameUnique;
5
7
  }>>>, {}, {}>, {
6
8
  default?(_: {}): any;
7
9
  }>;
@@ -1,9 +1,11 @@
1
+ import { ColorNameUnique } from '../colors';
2
+
1
3
  declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
4
  isLoading?: boolean;
3
5
  numberToDisplay?: number;
4
6
  href?: string;
5
7
  target?: string;
6
- type?: "dark" | "light" | "danger" | "warning" | "success" | "purple" | "sky" | "link" | "primary" | "secondary";
8
+ type?: "link" | ColorNameUnique;
7
9
  size?: "s" | "xs" | "m" | "l";
8
10
  paddingY?: string;
9
11
  paddingX?: string;
@@ -20,7 +22,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
20
22
  numberToDisplay?: number;
21
23
  href?: string;
22
24
  target?: string;
23
- type?: "dark" | "light" | "danger" | "warning" | "success" | "purple" | "sky" | "link" | "primary" | "secondary";
25
+ type?: "link" | ColorNameUnique;
24
26
  size?: "s" | "xs" | "m" | "l";
25
27
  paddingY?: string;
26
28
  paddingX?: string;
@@ -34,7 +36,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
34
36
  size: string;
35
37
  }>>>, {
36
38
  size: "s" | "xs" | "m" | "l";
37
- type: "dark" | "light" | "danger" | "warning" | "success" | "purple" | "sky" | "link" | "primary" | "secondary";
39
+ type: "link" | ColorNameUnique;
38
40
  isLoading: boolean;
39
41
  href: string;
40
42
  target: string;
@@ -1,10 +1,10 @@
1
1
  declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
2
- type: "danger" | "success";
2
+ type: "success" | "danger";
3
3
  informationCardTitle: string;
4
4
  informationCardDescription?: string;
5
5
  isLoading?: boolean;
6
6
  }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
7
- type: "danger" | "success";
7
+ type: "success" | "danger";
8
8
  informationCardTitle: string;
9
9
  informationCardDescription?: string;
10
10
  isLoading?: boolean;
@@ -1,30 +1,31 @@
1
- type SelectorItem<ID = string> = {
2
- id: ID;
3
- label: string;
1
+ import { Id, TextProp } from '../types';
2
+
3
+ type SelectorItem = {
4
+ id: Id;
5
+ label: TextProp;
4
6
  };
5
- type SelectorItems<ID = string> = SelectorItem<ID>[];
6
7
  declare const _default: import('vue').DefineComponent<{
7
8
  itemSelectedId: {
8
9
  required: true;
9
- type: import('vue').PropType<string>;
10
+ type: import('vue').PropType<any>;
10
11
  };
11
12
  label: {
12
- type: import('vue').PropType<string>;
13
+ type: import('vue').PropType<TextProp>;
13
14
  };
14
15
  items: {
15
- type: import('vue').PropType<SelectorItems<string>>;
16
+ type: import('vue').PropType<SelectorItem[]>;
16
17
  required: true;
17
18
  };
18
19
  }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
19
20
  itemSelectedId: {
20
21
  required: true;
21
- type: import('vue').PropType<string>;
22
+ type: import('vue').PropType<any>;
22
23
  };
23
24
  label: {
24
- type: import('vue').PropType<string>;
25
+ type: import('vue').PropType<TextProp>;
25
26
  };
26
27
  items: {
27
- type: import('vue').PropType<SelectorItems<string>>;
28
+ type: import('vue').PropType<SelectorItem[]>;
28
29
  required: true;
29
30
  };
30
31
  }>>, {}, {}>;
@@ -1,9 +1,9 @@
1
- import { Text } from '../../types/index';
1
+ import { TextProp } from '../../types/index';
2
2
 
3
3
  declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
4
- text: Text;
4
+ text: TextProp;
5
5
  }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
6
- text: Text;
6
+ text: TextProp;
7
7
  }>>>, {}, {}>;
8
8
  export default _default;
9
9
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,4 +1,4 @@
1
- import { Text } from '../../types/index';
1
+ import { TextProp } from '../../types/index';
2
2
 
3
3
  declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
4
4
  modelValue: {
@@ -10,7 +10,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
10
10
  required: true;
11
11
  };
12
12
  emptyOptionsMsg: {
13
- type: import('vue').PropType<Text>;
13
+ type: import('vue').PropType<TextProp>;
14
14
  };
15
15
  disabled: {
16
16
  type: import('vue').PropType<boolean>;
@@ -25,7 +25,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
25
25
  required: true;
26
26
  };
27
27
  emptyOptionsMsg: {
28
- type: import('vue').PropType<Text>;
28
+ type: import('vue').PropType<TextProp>;
29
29
  };
30
30
  disabled: {
31
31
  type: import('vue').PropType<boolean>;
@@ -1,10 +1,7 @@
1
- import { Color } from './types';
1
+ import { Colors } from './colors/colors.types';
2
2
 
3
3
  export type PangeaOptions = {
4
- colors?: {
5
- first?: Color;
6
- second?: Color;
7
- };
4
+ colors?: Partial<Colors>;
8
5
  };
9
6
  declare const pangeaOptions: PangeaOptions;
10
7
  export default pangeaOptions;
@@ -1,4 +1 @@
1
- import { Color, ColorAlpha } from '../types';
2
-
3
1
  export declare function animation(element: string, animation: string, prefix?: string): Promise<unknown>;
4
- export declare function rgba(color: Color, colorAlpha: ColorAlpha): string;
@@ -1,8 +1,9 @@
1
- import { PangeaOptions } from './default-pangea-options';
2
1
  import { App } from 'vue';
2
+ import { PangeaOptions } from './default-pangea-options';
3
3
 
4
4
  declare const _default: (app: App, userOptions?: PangeaOptions) => void;
5
5
  export default _default;
6
+ export * from './colors';
6
7
  export * from './helpers';
7
8
  export * from './i18n';
8
9
  export * from './types';
@@ -1,10 +1,9 @@
1
1
  export * from './chart';
2
- export * from './color';
3
2
  export * from './icon';
4
3
  export * from './image';
5
4
  export * from './populate';
6
- export type ID = string;
5
+ export type Id = any;
7
6
  export type ConstructorParams<T> = {
8
7
  [K in keyof T]?: T[K];
9
8
  };
10
- export type Text = string | (() => string);
9
+ export type TextProp = string | (() => string);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pangea-lib",
3
3
  "description": "",
4
- "version": "1.19.19",
4
+ "version": "2.0.1",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -51,6 +51,7 @@
51
51
  "chart.js": "^4.4.3",
52
52
  "click-outside-vue3": "^4.0.1",
53
53
  "moment": "^2.30.1",
54
+ "pangea-helpers": "^1.3.1",
54
55
  "pinia": "^2.1.7",
55
56
  "pinia-plugin-persistedstate": "^3.2.1",
56
57
  "sanitize.css": "^13.0.0",
@@ -1,31 +0,0 @@
1
- // light
2
- $primaryLightColor = #000000
3
- $secondaryLightColor = #585858
4
- $tertiaryLightColor = #9B9B9B
5
- $primaryLightBackgroundColor = #ffffff
6
- $secondaryLightBackgroundColor = #efefef
7
- $tertiaryLightBackgroundColor = #ddd
8
- // dark
9
- $primaryDarkColor = rgba(255, 255, 255, 0.9)
10
- $secondaryDarkColor = rgba(215, 215, 215, 0.75)
11
- $tertiaryDarkColor = rgba(175, 175, 175, 0.6)
12
- $primaryDarkBackgroundColor = #1a1a1a
13
- $secondaryDarkBackgroundColor = #242424
14
- $tertiaryDarkBackgroundColor = #5e5e5e
15
- // unique
16
- $firstColor = #218c5a
17
- $secondColor = #218c5a
18
-
19
- $successColor = #95CD41
20
- $warningColor = #FFBD35
21
- $dangerColor = #FF5959
22
- $darkColor = #1E1E1E
23
- $lightColor = #F0F0F0
24
- $redColor = #DE4795
25
- $purpleColor = #7746DB
26
- $skyColor = #1AB8C3
27
- $beigeColor = #FDF5E6
28
-
29
- $infoColor = #54B4D3
30
- $linkColor = #0064FF
31
- $errorColor = rgba(225, 21, 21, 0.912)
@@ -1,5 +0,0 @@
1
- export type ColorAlpha = number;
2
- export type ColorRgb = `rgb(${number}, ${number}, ${number})`;
3
- export type ColorRgba = `rgba(${number}, ${number}, ${number}, ${number})`;
4
- export type ColorHex = `#${string}`;
5
- export type Color = ColorRgb | ColorRgba | ColorHex;