@hoddy-ui/core 1.0.13 → 1.0.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoddy-ui/core",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Core rich react native components written in typescript",
5
5
  "main": "index.ts",
6
6
  "repository": {
@@ -17,6 +17,10 @@ const lightColors = {
17
17
  },
18
18
  };
19
19
 
20
+ let extraColors: extraColorTypes = {};
21
+
22
+ export const setExtraColors = (c: extraColorTypes) => (extraColors = c);
23
+
20
24
  const darkColors = {
21
25
  black: {
22
26
  1: "#fff",
@@ -37,104 +41,83 @@ const darkColors = {
37
41
  light: "#fff",
38
42
  dark: "#ddd",
39
43
  text: "#000",
44
+ ...extraColors?.dark?.dark,
40
45
  },
41
46
  light: {
42
47
  main: "#111",
43
48
  light: "#555",
44
49
  dark: "#333",
45
50
  text: "#fff",
46
- },
47
- grey: {
48
- dark: "#d0d8d8",
49
- main: "#e4e0e4",
51
+ ...extraColors?.dark?.light,
50
52
  },
51
53
  textSecondary: {
52
54
  main: "#666",
53
- },
54
- secondary: {
55
- main: "#a00",
56
- light: "#a33",
57
- dark: "#900",
55
+ light: "#777",
56
+ dark: "#444",
58
57
  text: "#fff",
58
+ ...extraColors?.dark?.textSecondary,
59
59
  },
60
- purple: {
61
- main: "#815",
62
- light: "#f4d",
63
- dark: "#a06",
64
- text: "#fff",
65
- },
66
- };
67
-
68
- let extraColors: extraColorTypes = {
69
- dark: {},
70
- light: {},
71
60
  };
72
61
 
73
- export const setExtraColors = (c: extraColorTypes) => (extraColors = c);
74
-
75
62
  export default function colors(theme: ThemeTypes) {
76
63
  const dynamicColors = theme === "dark" ? darkColors : lightColors;
77
64
  return {
65
+ ...extraColors[theme],
78
66
  primary: {
79
67
  main: "#f80",
80
68
  light: "#FEFFD3",
81
69
  dark: "#fa0",
82
- orange: "#F68B1E",
83
70
  text: "#fff",
71
+ ...extraColors?.light?.primary,
84
72
  },
85
73
  secondary: {
86
74
  main: "#f11",
87
75
  light: "#f43",
88
76
  dark: "#d00",
89
77
  text: "#fff",
90
- },
91
- purple: {
92
- main: "#a09",
93
- light: "#f4d",
94
- dark: "#a06",
95
- text: "#fff",
78
+ ...extraColors?.light?.secondary,
96
79
  },
97
80
  light: {
98
81
  main: "#fff",
99
82
  light: "#fff",
100
83
  dark: "#ddd",
101
84
  text: "#000",
85
+ ...extraColors?.light?.light,
102
86
  },
103
87
  dark: {
104
88
  main: "#000",
105
89
  light: "#777",
106
90
  dark: "#111",
107
91
  text: "#fff",
108
- mid: "#f2f3f4",
92
+ ...extraColors?.light?.dark,
109
93
  },
110
94
  textSecondary: {
111
95
  main: "#aaa",
112
- mid: "#9ab",
113
- dark: "#678",
114
- darkBlue: "#123",
96
+ light: "#bbb",
97
+ dark: "#777",
98
+ text: "#123",
99
+ ...extraColors?.light?.textSecondary,
115
100
  },
116
101
  blue: {
117
102
  main: "#09F",
118
103
  light: "#39f",
119
104
  dark: "#028",
120
105
  text: "#fff",
121
- navy: "#071440",
122
- soft: "#EBF2FF",
106
+ ...extraColors?.light?.blue,
123
107
  },
124
108
  info: {
125
109
  main: "#09f",
126
110
  light: "#3af",
127
111
  dark: "#08a",
128
112
  text: "#fff",
113
+ ...extraColors?.light?.info,
129
114
  },
130
115
  success: {
131
116
  main: "#0a4",
132
117
  text: "#fff",
133
118
  light: "#5c3",
134
119
  dark: "#062",
135
-
136
- green: "#49D3BA",
137
- lighter: "#00A86B",
120
+ ...extraColors?.light?.success,
138
121
  },
139
122
 
140
123
  warning: {
@@ -142,21 +125,15 @@ export default function colors(theme: ThemeTypes) {
142
125
  light: "#fc7",
143
126
  dark: "#f90",
144
127
  text: "#fff",
128
+ ...extraColors?.light?.warning,
145
129
  },
146
130
  error: {
147
131
  main: "#D22",
148
132
  text: "#fff",
149
133
  light: "#f43",
150
134
  dark: "#a20",
151
- red: "#D92D20",
152
- soft: "#fee",
153
- bold: "#d22",
154
- },
155
- grey: {
156
- dark: "#101828",
157
- main: "#344054",
135
+ ...extraColors?.light?.error,
158
136
  },
159
137
  ...dynamicColors,
160
- ...extraColors[theme],
161
138
  };
162
139
  }
package/src/types.ts CHANGED
@@ -22,20 +22,20 @@ export type colorTypes =
22
22
  | "textSecondary";
23
23
 
24
24
  export type extraColorTypes = {
25
- dark: {
25
+ dark?: {
26
26
  [key: string]: {
27
- main: string;
28
- light: string;
29
- dark: string;
30
- text: string;
27
+ main?: string;
28
+ light?: string;
29
+ dark?: string;
30
+ text?: string;
31
31
  };
32
32
  };
33
- light: {
33
+ light?: {
34
34
  [key: string]: {
35
- main: string;
36
- light: string;
37
- dark: string;
38
- text: string;
35
+ main?: string;
36
+ light?: string;
37
+ dark?: string;
38
+ text?: string;
39
39
  };
40
40
  };
41
41
  };