@trackunit/ui-design-tokens 0.0.70 → 0.0.73
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/index.cjs +725 -731
- package/index.js +725 -731
- package/package.json +1 -1
- package/src/index.d.ts +9 -10
- package/src/tokens/borderRadius.d.ts +14 -14
- package/src/tokens/chartColorsDefault.d.ts +7 -7
- package/src/tokens/colors/color.d.ts +35 -35
- package/src/tokens/colors/colors.d.ts +21 -21
- package/src/tokens/colors/index.d.ts +4 -4
- package/src/tokens/colors/tailwindPalette.d.ts +270 -270
- package/src/tokens/colors/trackunitPalette.d.ts +833 -833
- package/src/tokens/elevation.d.ts +27 -27
- package/src/tokens/screenSize.d.ts +12 -12
- package/src/tokens/size.d.ts +51 -51
- package/src/tokens/typography.d.ts +60 -59
- package/src/tokens/utils/colorVariableToCss.d.ts +12 -12
- package/src/tokens/utils/getHEX.d.ts +10 -10
- package/src/tokens/utils/getValuesFromDesignToken.d.ts +5 -5
- package/src/tokens/zIndex.d.ts +17 -17
- package/src/tokens/tokens.d.ts +0 -13
package/index.js
CHANGED
|
@@ -1,758 +1,752 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A collection of all the tokens related to border radius in the theme.
|
|
3
|
-
*/
|
|
4
|
-
const themeBorderRadius = {
|
|
5
|
-
none: "0",
|
|
6
|
-
sm: "0.125rem",
|
|
7
|
-
DEFAULT: "0.25rem",
|
|
8
|
-
md: "0.375rem",
|
|
9
|
-
lg: "0.5rem",
|
|
10
|
-
xl: "0.75rem",
|
|
11
|
-
"2xl": "1rem",
|
|
12
|
-
"3xl": "1.5rem",
|
|
13
|
-
full: "9999px",
|
|
1
|
+
/**
|
|
2
|
+
* A collection of all the tokens related to border radius in the theme.
|
|
3
|
+
*/
|
|
4
|
+
const themeBorderRadius = {
|
|
5
|
+
none: "0",
|
|
6
|
+
sm: "0.125rem",
|
|
7
|
+
DEFAULT: "0.25rem",
|
|
8
|
+
md: "0.375rem",
|
|
9
|
+
lg: "0.5rem",
|
|
10
|
+
xl: "0.75rem",
|
|
11
|
+
"2xl": "1rem",
|
|
12
|
+
"3xl": "1.5rem",
|
|
13
|
+
full: "9999px",
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
const DEFAULT_CHART_COLORS = [
|
|
17
|
-
"#2580C7",
|
|
18
|
-
"#36A2DA",
|
|
19
|
-
"#3FBCEA",
|
|
20
|
-
"#06708D",
|
|
21
|
-
"#01B7A9",
|
|
22
|
-
"#A2DEDA",
|
|
23
|
-
"#F9E9A0",
|
|
24
|
-
"#FDD008",
|
|
25
|
-
"#FBB385",
|
|
26
|
-
"#FF7373",
|
|
27
|
-
"#E6BCF3",
|
|
28
|
-
"#9D96F5",
|
|
29
|
-
"#8378EA",
|
|
30
|
-
"#96BFFF",
|
|
31
|
-
"#979A9A",
|
|
32
|
-
"#0065E5",
|
|
33
|
-
"#FF5A5A",
|
|
34
|
-
"#00A658",
|
|
35
|
-
"#5AC8fA",
|
|
36
|
-
"#5E5CE6",
|
|
37
|
-
"#2066FF",
|
|
38
|
-
"#FF9500",
|
|
39
|
-
"#E2E8F0",
|
|
40
|
-
];
|
|
41
|
-
/**
|
|
42
|
-
* Re-ordered chart colors to ensure that adjacent colors are visually different.
|
|
43
|
-
*
|
|
44
|
-
* @returns {string[]} The reordered chart colors.
|
|
45
|
-
*/
|
|
46
|
-
const getReorderedChartColors = () => [
|
|
47
|
-
// DO NOT reorder the colors, or add new colors in the middle of the array until you verify that adjacent colors are visually different.
|
|
48
|
-
// If you want to add a new color, you should almost always add it at the end of the array.
|
|
49
|
-
DEFAULT_CHART_COLORS[0],
|
|
50
|
-
DEFAULT_CHART_COLORS[4],
|
|
51
|
-
DEFAULT_CHART_COLORS[7],
|
|
52
|
-
DEFAULT_CHART_COLORS[9],
|
|
53
|
-
DEFAULT_CHART_COLORS[12],
|
|
54
|
-
DEFAULT_CHART_COLORS[5],
|
|
55
|
-
DEFAULT_CHART_COLORS[6],
|
|
56
|
-
DEFAULT_CHART_COLORS[8],
|
|
57
|
-
DEFAULT_CHART_COLORS[10],
|
|
58
|
-
DEFAULT_CHART_COLORS[1],
|
|
59
|
-
DEFAULT_CHART_COLORS[11],
|
|
60
|
-
DEFAULT_CHART_COLORS[3],
|
|
61
|
-
DEFAULT_CHART_COLORS[2],
|
|
62
|
-
DEFAULT_CHART_COLORS[13],
|
|
63
|
-
DEFAULT_CHART_COLORS[22],
|
|
16
|
+
const DEFAULT_CHART_COLORS = [
|
|
17
|
+
"#2580C7",
|
|
18
|
+
"#36A2DA",
|
|
19
|
+
"#3FBCEA",
|
|
20
|
+
"#06708D",
|
|
21
|
+
"#01B7A9",
|
|
22
|
+
"#A2DEDA",
|
|
23
|
+
"#F9E9A0",
|
|
24
|
+
"#FDD008",
|
|
25
|
+
"#FBB385",
|
|
26
|
+
"#FF7373",
|
|
27
|
+
"#E6BCF3",
|
|
28
|
+
"#9D96F5",
|
|
29
|
+
"#8378EA",
|
|
30
|
+
"#96BFFF",
|
|
31
|
+
"#979A9A",
|
|
32
|
+
"#0065E5",
|
|
33
|
+
"#FF5A5A",
|
|
34
|
+
"#00A658",
|
|
35
|
+
"#5AC8fA",
|
|
36
|
+
"#5E5CE6",
|
|
37
|
+
"#2066FF",
|
|
38
|
+
"#FF9500",
|
|
39
|
+
"#E2E8F0",
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Re-ordered chart colors to ensure that adjacent colors are visually different.
|
|
43
|
+
*
|
|
44
|
+
* @returns {string[]} The reordered chart colors.
|
|
45
|
+
*/
|
|
46
|
+
const getReorderedChartColors = () => [
|
|
47
|
+
// DO NOT reorder the colors, or add new colors in the middle of the array until you verify that adjacent colors are visually different.
|
|
48
|
+
// If you want to add a new color, you should almost always add it at the end of the array.
|
|
49
|
+
DEFAULT_CHART_COLORS[0],
|
|
50
|
+
DEFAULT_CHART_COLORS[4],
|
|
51
|
+
DEFAULT_CHART_COLORS[7],
|
|
52
|
+
DEFAULT_CHART_COLORS[9],
|
|
53
|
+
DEFAULT_CHART_COLORS[12],
|
|
54
|
+
DEFAULT_CHART_COLORS[5],
|
|
55
|
+
DEFAULT_CHART_COLORS[6],
|
|
56
|
+
DEFAULT_CHART_COLORS[8],
|
|
57
|
+
DEFAULT_CHART_COLORS[10],
|
|
58
|
+
DEFAULT_CHART_COLORS[1],
|
|
59
|
+
DEFAULT_CHART_COLORS[11],
|
|
60
|
+
DEFAULT_CHART_COLORS[3],
|
|
61
|
+
DEFAULT_CHART_COLORS[2],
|
|
62
|
+
DEFAULT_CHART_COLORS[13],
|
|
63
|
+
DEFAULT_CHART_COLORS[22],
|
|
64
64
|
];
|
|
65
65
|
|
|
66
|
-
/**
|
|
67
|
-
* Convert a css custom property from our design tokens to a useable css string.
|
|
68
|
-
*
|
|
69
|
-
* Our custom properties are saved as "rrr ggg bbb" rather than a full css color.
|
|
70
|
-
*
|
|
71
|
-
* This allows us to modify them with opacity values and more.
|
|
72
|
-
*
|
|
73
|
-
* @param variable CSS custom property for color
|
|
74
|
-
* @example "--color-primart-400" --> "rgb(var(--color-primary-400) / var(--tw-bg-opacity)))"
|
|
75
|
-
* @returns {string} Full css for using the color
|
|
76
|
-
*/
|
|
77
|
-
function colorVariableToCss(variable) {
|
|
78
|
-
return `rgb(var(${variable}) / var(--tw-bg-opacity))`;
|
|
66
|
+
/**
|
|
67
|
+
* Convert a css custom property from our design tokens to a useable css string.
|
|
68
|
+
*
|
|
69
|
+
* Our custom properties are saved as "rrr ggg bbb" rather than a full css color.
|
|
70
|
+
*
|
|
71
|
+
* This allows us to modify them with opacity values and more.
|
|
72
|
+
*
|
|
73
|
+
* @param variable CSS custom property for color
|
|
74
|
+
* @example "--color-primart-400" --> "rgb(var(--color-primary-400) / var(--tw-bg-opacity)))"
|
|
75
|
+
* @returns {string} Full css for using the color
|
|
76
|
+
*/
|
|
77
|
+
function colorVariableToCss(variable) {
|
|
78
|
+
return `rgb(var(${variable}) / var(--tw-bg-opacity))`;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
function componentToHex(c) {
|
|
82
|
-
if (c === null || c === undefined) {
|
|
83
|
-
return "00";
|
|
84
|
-
}
|
|
85
|
-
const hex = c.toString(16);
|
|
86
|
-
return hex.length === 1 ? "0" + hex : hex;
|
|
87
|
-
}
|
|
88
|
-
function rgbToHex(r, g, b) {
|
|
89
|
-
if (isNaN(r) || isNaN(g) || isNaN(b)) {
|
|
90
|
-
return "#000000";
|
|
91
|
-
}
|
|
92
|
-
return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Returns the HEX color based on a Color from the theme.
|
|
96
|
-
* Reads the RGB value from the underlying CSS variable and convert to HEX.
|
|
97
|
-
*
|
|
98
|
-
* Example: color("PRIMARY", 500, "HEX") -> #3b82f6
|
|
99
|
-
*
|
|
100
|
-
* @param variable A color from the `colors` object of the Theme
|
|
101
|
-
* @returns {string} HEX color
|
|
102
|
-
*/
|
|
103
|
-
const getHEX = (variable) => {
|
|
104
|
-
var _a, _b;
|
|
105
|
-
const regex = /rgb\(var\((.*?)\) \/ var\(--tw-bg-opacity\)\)/g;
|
|
106
|
-
const root = document.documentElement;
|
|
107
|
-
const match = regex.exec(variable);
|
|
108
|
-
const colorValue = getComputedStyle(root).getPropertyValue((_b = (_a = match === null || match === void 0 ? void 0 : match[1]) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : variable);
|
|
109
|
-
const RGB = colorValue
|
|
110
|
-
.trim()
|
|
111
|
-
.split(" ")
|
|
112
|
-
.map(channel => Number(channel));
|
|
113
|
-
return rgbToHex(RGB[0], RGB[1], RGB[2]);
|
|
81
|
+
function componentToHex(c) {
|
|
82
|
+
if (c === null || c === undefined) {
|
|
83
|
+
return "00";
|
|
84
|
+
}
|
|
85
|
+
const hex = c.toString(16);
|
|
86
|
+
return hex.length === 1 ? "0" + hex : hex;
|
|
87
|
+
}
|
|
88
|
+
function rgbToHex(r, g, b) {
|
|
89
|
+
if (isNaN(r) || isNaN(g) || isNaN(b)) {
|
|
90
|
+
return "#000000";
|
|
91
|
+
}
|
|
92
|
+
return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Returns the HEX color based on a Color from the theme.
|
|
96
|
+
* Reads the RGB value from the underlying CSS variable and convert to HEX.
|
|
97
|
+
*
|
|
98
|
+
* Example: color("PRIMARY", 500, "HEX") -> #3b82f6
|
|
99
|
+
*
|
|
100
|
+
* @param variable A color from the `colors` object of the Theme
|
|
101
|
+
* @returns {string} HEX color
|
|
102
|
+
*/
|
|
103
|
+
const getHEX = (variable) => {
|
|
104
|
+
var _a, _b;
|
|
105
|
+
const regex = /rgb\(var\((.*?)\) \/ var\(--tw-bg-opacity\)\)/g;
|
|
106
|
+
const root = document.documentElement;
|
|
107
|
+
const match = regex.exec(variable);
|
|
108
|
+
const colorValue = getComputedStyle(root).getPropertyValue((_b = (_a = match === null || match === void 0 ? void 0 : match[1]) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : variable);
|
|
109
|
+
const RGB = colorValue
|
|
110
|
+
.trim()
|
|
111
|
+
.split(" ")
|
|
112
|
+
.map(channel => Number(channel));
|
|
113
|
+
return rgbToHex(RGB[0], RGB[1], RGB[2]);
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
-
/**
|
|
117
|
-
* The Tailwind color palette.
|
|
118
|
-
* Contains the full tailwind default color theme.
|
|
119
|
-
*/
|
|
120
|
-
const tailwindPalette = {
|
|
121
|
-
slate: {
|
|
122
|
-
50: "248 250 252",
|
|
123
|
-
100: "241 245 249",
|
|
124
|
-
200: "226 232 240",
|
|
125
|
-
300: "203 213 225",
|
|
126
|
-
400: "148 163 184",
|
|
127
|
-
500: "100 116 139",
|
|
128
|
-
600: "71 85 105",
|
|
129
|
-
700: "51 65 85",
|
|
130
|
-
800: "30 41 59",
|
|
131
|
-
900: "15 23 42",
|
|
132
|
-
},
|
|
133
|
-
gray: {
|
|
134
|
-
50: "249 250 251",
|
|
135
|
-
100: "243 244 246",
|
|
136
|
-
200: "229 231 235",
|
|
137
|
-
300: "209 213 219",
|
|
138
|
-
400: "156 163 175",
|
|
139
|
-
500: "107 114 128",
|
|
140
|
-
600: "75 85 99",
|
|
141
|
-
700: "55 65 81",
|
|
142
|
-
800: "31 41 55",
|
|
143
|
-
900: "17 24 39",
|
|
144
|
-
},
|
|
145
|
-
zinc: {
|
|
146
|
-
50: "250 250 250",
|
|
147
|
-
100: "244 244 245",
|
|
148
|
-
200: "228 228 231",
|
|
149
|
-
300: "212 212 216",
|
|
150
|
-
400: "161 161 170",
|
|
151
|
-
500: "113 113 122",
|
|
152
|
-
600: "82 82 91",
|
|
153
|
-
700: "63 63 70",
|
|
154
|
-
800: "39 39 42",
|
|
155
|
-
900: "24 24 27",
|
|
156
|
-
},
|
|
157
|
-
neutral: {
|
|
158
|
-
50: "250 250 250",
|
|
159
|
-
100: "245 245 245",
|
|
160
|
-
200: "229 229 229",
|
|
161
|
-
300: "212 212 212",
|
|
162
|
-
400: "163 163 163",
|
|
163
|
-
500: "115 115 115",
|
|
164
|
-
600: "82 82 82",
|
|
165
|
-
700: "64 64 64",
|
|
166
|
-
800: "38 38 38",
|
|
167
|
-
900: "23 23 23",
|
|
168
|
-
},
|
|
169
|
-
stone: {
|
|
170
|
-
50: "250 250 249",
|
|
171
|
-
100: "245 245 244",
|
|
172
|
-
200: "231 229 228",
|
|
173
|
-
300: "214 211 209",
|
|
174
|
-
400: "168 162 158",
|
|
175
|
-
500: "120 113 108",
|
|
176
|
-
600: "87 83 78",
|
|
177
|
-
700: "68 64 60",
|
|
178
|
-
800: "41 37 36",
|
|
179
|
-
900: "28 25 23",
|
|
180
|
-
},
|
|
181
|
-
red: {
|
|
182
|
-
50: "254 242 242",
|
|
183
|
-
100: "254 226 226",
|
|
184
|
-
200: "254 202 202",
|
|
185
|
-
300: "252 165 165",
|
|
186
|
-
400: "248 113 113",
|
|
187
|
-
500: "239 68 68",
|
|
188
|
-
600: "220 38 38",
|
|
189
|
-
700: "185 28 28",
|
|
190
|
-
800: "153 27 27",
|
|
191
|
-
900: "127 29 29",
|
|
192
|
-
},
|
|
193
|
-
orange: {
|
|
194
|
-
50: "255 247 237",
|
|
195
|
-
100: "255 237 213",
|
|
196
|
-
200: "254 215 170",
|
|
197
|
-
300: "253 186 116",
|
|
198
|
-
400: "251 146 60",
|
|
199
|
-
500: "249 115 22",
|
|
200
|
-
600: "234 88 12",
|
|
201
|
-
700: "194 65 12",
|
|
202
|
-
800: "154 52 18",
|
|
203
|
-
900: "124 45 18",
|
|
204
|
-
},
|
|
205
|
-
amber: {
|
|
206
|
-
50: "255 251 235",
|
|
207
|
-
100: "254 243 199",
|
|
208
|
-
200: "253 230 138",
|
|
209
|
-
300: "252 211 77",
|
|
210
|
-
400: "251 191 36",
|
|
211
|
-
500: "245 158 11",
|
|
212
|
-
600: "217 119 6",
|
|
213
|
-
700: "180 83 9",
|
|
214
|
-
800: "146 64 14",
|
|
215
|
-
900: "120 53 15",
|
|
216
|
-
},
|
|
217
|
-
yellow: {
|
|
218
|
-
50: "254 252 232",
|
|
219
|
-
100: "254 249 195",
|
|
220
|
-
200: "254 240 138",
|
|
221
|
-
300: "253 224 71",
|
|
222
|
-
400: "250 204 21",
|
|
223
|
-
500: "234 179 8",
|
|
224
|
-
600: "202 138 4",
|
|
225
|
-
700: "161 98 7",
|
|
226
|
-
800: "133 77 14",
|
|
227
|
-
900: "113 63 18",
|
|
228
|
-
},
|
|
229
|
-
lime: {
|
|
230
|
-
50: "247 254 231",
|
|
231
|
-
100: "236 252 203",
|
|
232
|
-
200: "217 249 157",
|
|
233
|
-
300: "190 242 100",
|
|
234
|
-
400: "163 230 53",
|
|
235
|
-
500: "132 204 22",
|
|
236
|
-
600: "101 163 13",
|
|
237
|
-
700: "77 124 15",
|
|
238
|
-
800: "63 98 18",
|
|
239
|
-
900: "54 83 20",
|
|
240
|
-
},
|
|
241
|
-
green: {
|
|
242
|
-
50: "240 253 244",
|
|
243
|
-
100: "220 252 231",
|
|
244
|
-
200: "187 247 208",
|
|
245
|
-
300: "134 239 172",
|
|
246
|
-
400: "74 222 128",
|
|
247
|
-
500: "34 197 94",
|
|
248
|
-
600: "22 163 74",
|
|
249
|
-
700: "21 128 61",
|
|
250
|
-
800: "22 101 52",
|
|
251
|
-
900: "20 83 45",
|
|
252
|
-
},
|
|
253
|
-
emerald: {
|
|
254
|
-
50: "236 253 245",
|
|
255
|
-
100: "209 250 229",
|
|
256
|
-
200: "167 243 208",
|
|
257
|
-
300: "110 231 183",
|
|
258
|
-
400: "52 211 153",
|
|
259
|
-
500: "16 185 129",
|
|
260
|
-
600: "5 150 105",
|
|
261
|
-
700: "4 120 87",
|
|
262
|
-
800: "6 95 70",
|
|
263
|
-
900: "6 78 59",
|
|
264
|
-
},
|
|
265
|
-
teal: {
|
|
266
|
-
50: "240 253 250",
|
|
267
|
-
100: "204 251 241",
|
|
268
|
-
200: "153 246 228",
|
|
269
|
-
300: "94 234 212",
|
|
270
|
-
400: "45 212 191",
|
|
271
|
-
500: "20 184 166",
|
|
272
|
-
600: "13 148 136",
|
|
273
|
-
700: "15 118 110",
|
|
274
|
-
800: "17 94 89",
|
|
275
|
-
900: "19 78 74",
|
|
276
|
-
},
|
|
277
|
-
cyan: {
|
|
278
|
-
50: "236 254 255",
|
|
279
|
-
100: "207 250 254",
|
|
280
|
-
200: "165 243 252",
|
|
281
|
-
300: "103 232 249",
|
|
282
|
-
400: "34 211 238",
|
|
283
|
-
500: "6 182 212",
|
|
284
|
-
600: "8 145 178",
|
|
285
|
-
700: "14 116 144",
|
|
286
|
-
800: "21 94 117",
|
|
287
|
-
900: "22 78 99",
|
|
288
|
-
},
|
|
289
|
-
sky: {
|
|
290
|
-
50: "240 249 255",
|
|
291
|
-
100: "224 242 254",
|
|
292
|
-
200: "186 230 253",
|
|
293
|
-
300: "125 211 252",
|
|
294
|
-
400: "56 189 248",
|
|
295
|
-
500: "14 165 233",
|
|
296
|
-
600: "2 132 199",
|
|
297
|
-
700: "3 105 161",
|
|
298
|
-
800: "7 89 133",
|
|
299
|
-
900: "12 74 110",
|
|
300
|
-
},
|
|
301
|
-
blue: {
|
|
302
|
-
50: "239 246 255",
|
|
303
|
-
100: "219 234 254",
|
|
304
|
-
200: "191 219 254",
|
|
305
|
-
300: "147 197 253",
|
|
306
|
-
400: "96 165 250",
|
|
307
|
-
500: "59 130 246",
|
|
308
|
-
600: "37 99 235",
|
|
309
|
-
700: "29 78 216",
|
|
310
|
-
800: "30 64 175",
|
|
311
|
-
900: "30 58 138",
|
|
312
|
-
},
|
|
313
|
-
indigo: {
|
|
314
|
-
50: "238 242 255",
|
|
315
|
-
100: "224 231 255",
|
|
316
|
-
200: "199 210 254",
|
|
317
|
-
300: "165 180 252",
|
|
318
|
-
400: "129 140 248",
|
|
319
|
-
500: "99 102 241",
|
|
320
|
-
600: "79 70 229",
|
|
321
|
-
700: "67 56 202",
|
|
322
|
-
800: "55 48 163",
|
|
323
|
-
900: "49 46 129",
|
|
324
|
-
},
|
|
325
|
-
violet: {
|
|
326
|
-
50: "245 243 255",
|
|
327
|
-
100: "237 233 254",
|
|
328
|
-
200: "221 214 254",
|
|
329
|
-
300: "196 181 253",
|
|
330
|
-
400: "167 139 250",
|
|
331
|
-
500: "139 92 246",
|
|
332
|
-
600: "124 58 237",
|
|
333
|
-
700: "109 40 217",
|
|
334
|
-
800: "91 33 182",
|
|
335
|
-
900: "76 29 149",
|
|
336
|
-
},
|
|
337
|
-
purple: {
|
|
338
|
-
50: "250 245 255",
|
|
339
|
-
100: "243 232 255",
|
|
340
|
-
200: "233 213 255",
|
|
341
|
-
300: "216 180 254",
|
|
342
|
-
400: "192 132 252",
|
|
343
|
-
500: "168 85 247",
|
|
344
|
-
600: "147 51 234",
|
|
345
|
-
700: "126 34 206",
|
|
346
|
-
800: "107 33 168",
|
|
347
|
-
900: "88 28 135",
|
|
348
|
-
},
|
|
349
|
-
fuchsia: {
|
|
350
|
-
50: "253 244 255",
|
|
351
|
-
100: "250 232 255",
|
|
352
|
-
200: "245 208 254",
|
|
353
|
-
300: "240 171 252",
|
|
354
|
-
400: "232 121 249",
|
|
355
|
-
500: "217 70 239",
|
|
356
|
-
600: "192 38 211",
|
|
357
|
-
700: "162 28 175",
|
|
358
|
-
800: "134 25 143",
|
|
359
|
-
900: "112 26 117",
|
|
360
|
-
},
|
|
361
|
-
pink: {
|
|
362
|
-
50: "253 242 248",
|
|
363
|
-
100: "252 231 243",
|
|
364
|
-
200: "251 207 232",
|
|
365
|
-
300: "249 168 212",
|
|
366
|
-
400: "244 114 182",
|
|
367
|
-
500: "236 72 153",
|
|
368
|
-
600: "219 39 119",
|
|
369
|
-
700: "190 24 93",
|
|
370
|
-
800: "157 23 77",
|
|
371
|
-
900: "131 24 67",
|
|
372
|
-
},
|
|
373
|
-
rose: {
|
|
374
|
-
50: "255 241 242",
|
|
375
|
-
100: "255 228 230",
|
|
376
|
-
200: "254 205 211",
|
|
377
|
-
300: "253 164 175",
|
|
378
|
-
400: "251 113 133",
|
|
379
|
-
500: "244 63 94",
|
|
380
|
-
600: "225 29 72",
|
|
381
|
-
700: "190 18 60",
|
|
382
|
-
800: "159 18 57",
|
|
383
|
-
900: "136 19 55",
|
|
384
|
-
},
|
|
116
|
+
/**
|
|
117
|
+
* The Tailwind color palette.
|
|
118
|
+
* Contains the full tailwind default color theme.
|
|
119
|
+
*/
|
|
120
|
+
const tailwindPalette = {
|
|
121
|
+
slate: {
|
|
122
|
+
50: "248 250 252",
|
|
123
|
+
100: "241 245 249",
|
|
124
|
+
200: "226 232 240",
|
|
125
|
+
300: "203 213 225",
|
|
126
|
+
400: "148 163 184",
|
|
127
|
+
500: "100 116 139",
|
|
128
|
+
600: "71 85 105",
|
|
129
|
+
700: "51 65 85",
|
|
130
|
+
800: "30 41 59",
|
|
131
|
+
900: "15 23 42",
|
|
132
|
+
},
|
|
133
|
+
gray: {
|
|
134
|
+
50: "249 250 251",
|
|
135
|
+
100: "243 244 246",
|
|
136
|
+
200: "229 231 235",
|
|
137
|
+
300: "209 213 219",
|
|
138
|
+
400: "156 163 175",
|
|
139
|
+
500: "107 114 128",
|
|
140
|
+
600: "75 85 99",
|
|
141
|
+
700: "55 65 81",
|
|
142
|
+
800: "31 41 55",
|
|
143
|
+
900: "17 24 39",
|
|
144
|
+
},
|
|
145
|
+
zinc: {
|
|
146
|
+
50: "250 250 250",
|
|
147
|
+
100: "244 244 245",
|
|
148
|
+
200: "228 228 231",
|
|
149
|
+
300: "212 212 216",
|
|
150
|
+
400: "161 161 170",
|
|
151
|
+
500: "113 113 122",
|
|
152
|
+
600: "82 82 91",
|
|
153
|
+
700: "63 63 70",
|
|
154
|
+
800: "39 39 42",
|
|
155
|
+
900: "24 24 27",
|
|
156
|
+
},
|
|
157
|
+
neutral: {
|
|
158
|
+
50: "250 250 250",
|
|
159
|
+
100: "245 245 245",
|
|
160
|
+
200: "229 229 229",
|
|
161
|
+
300: "212 212 212",
|
|
162
|
+
400: "163 163 163",
|
|
163
|
+
500: "115 115 115",
|
|
164
|
+
600: "82 82 82",
|
|
165
|
+
700: "64 64 64",
|
|
166
|
+
800: "38 38 38",
|
|
167
|
+
900: "23 23 23",
|
|
168
|
+
},
|
|
169
|
+
stone: {
|
|
170
|
+
50: "250 250 249",
|
|
171
|
+
100: "245 245 244",
|
|
172
|
+
200: "231 229 228",
|
|
173
|
+
300: "214 211 209",
|
|
174
|
+
400: "168 162 158",
|
|
175
|
+
500: "120 113 108",
|
|
176
|
+
600: "87 83 78",
|
|
177
|
+
700: "68 64 60",
|
|
178
|
+
800: "41 37 36",
|
|
179
|
+
900: "28 25 23",
|
|
180
|
+
},
|
|
181
|
+
red: {
|
|
182
|
+
50: "254 242 242",
|
|
183
|
+
100: "254 226 226",
|
|
184
|
+
200: "254 202 202",
|
|
185
|
+
300: "252 165 165",
|
|
186
|
+
400: "248 113 113",
|
|
187
|
+
500: "239 68 68",
|
|
188
|
+
600: "220 38 38",
|
|
189
|
+
700: "185 28 28",
|
|
190
|
+
800: "153 27 27",
|
|
191
|
+
900: "127 29 29",
|
|
192
|
+
},
|
|
193
|
+
orange: {
|
|
194
|
+
50: "255 247 237",
|
|
195
|
+
100: "255 237 213",
|
|
196
|
+
200: "254 215 170",
|
|
197
|
+
300: "253 186 116",
|
|
198
|
+
400: "251 146 60",
|
|
199
|
+
500: "249 115 22",
|
|
200
|
+
600: "234 88 12",
|
|
201
|
+
700: "194 65 12",
|
|
202
|
+
800: "154 52 18",
|
|
203
|
+
900: "124 45 18",
|
|
204
|
+
},
|
|
205
|
+
amber: {
|
|
206
|
+
50: "255 251 235",
|
|
207
|
+
100: "254 243 199",
|
|
208
|
+
200: "253 230 138",
|
|
209
|
+
300: "252 211 77",
|
|
210
|
+
400: "251 191 36",
|
|
211
|
+
500: "245 158 11",
|
|
212
|
+
600: "217 119 6",
|
|
213
|
+
700: "180 83 9",
|
|
214
|
+
800: "146 64 14",
|
|
215
|
+
900: "120 53 15",
|
|
216
|
+
},
|
|
217
|
+
yellow: {
|
|
218
|
+
50: "254 252 232",
|
|
219
|
+
100: "254 249 195",
|
|
220
|
+
200: "254 240 138",
|
|
221
|
+
300: "253 224 71",
|
|
222
|
+
400: "250 204 21",
|
|
223
|
+
500: "234 179 8",
|
|
224
|
+
600: "202 138 4",
|
|
225
|
+
700: "161 98 7",
|
|
226
|
+
800: "133 77 14",
|
|
227
|
+
900: "113 63 18",
|
|
228
|
+
},
|
|
229
|
+
lime: {
|
|
230
|
+
50: "247 254 231",
|
|
231
|
+
100: "236 252 203",
|
|
232
|
+
200: "217 249 157",
|
|
233
|
+
300: "190 242 100",
|
|
234
|
+
400: "163 230 53",
|
|
235
|
+
500: "132 204 22",
|
|
236
|
+
600: "101 163 13",
|
|
237
|
+
700: "77 124 15",
|
|
238
|
+
800: "63 98 18",
|
|
239
|
+
900: "54 83 20",
|
|
240
|
+
},
|
|
241
|
+
green: {
|
|
242
|
+
50: "240 253 244",
|
|
243
|
+
100: "220 252 231",
|
|
244
|
+
200: "187 247 208",
|
|
245
|
+
300: "134 239 172",
|
|
246
|
+
400: "74 222 128",
|
|
247
|
+
500: "34 197 94",
|
|
248
|
+
600: "22 163 74",
|
|
249
|
+
700: "21 128 61",
|
|
250
|
+
800: "22 101 52",
|
|
251
|
+
900: "20 83 45",
|
|
252
|
+
},
|
|
253
|
+
emerald: {
|
|
254
|
+
50: "236 253 245",
|
|
255
|
+
100: "209 250 229",
|
|
256
|
+
200: "167 243 208",
|
|
257
|
+
300: "110 231 183",
|
|
258
|
+
400: "52 211 153",
|
|
259
|
+
500: "16 185 129",
|
|
260
|
+
600: "5 150 105",
|
|
261
|
+
700: "4 120 87",
|
|
262
|
+
800: "6 95 70",
|
|
263
|
+
900: "6 78 59",
|
|
264
|
+
},
|
|
265
|
+
teal: {
|
|
266
|
+
50: "240 253 250",
|
|
267
|
+
100: "204 251 241",
|
|
268
|
+
200: "153 246 228",
|
|
269
|
+
300: "94 234 212",
|
|
270
|
+
400: "45 212 191",
|
|
271
|
+
500: "20 184 166",
|
|
272
|
+
600: "13 148 136",
|
|
273
|
+
700: "15 118 110",
|
|
274
|
+
800: "17 94 89",
|
|
275
|
+
900: "19 78 74",
|
|
276
|
+
},
|
|
277
|
+
cyan: {
|
|
278
|
+
50: "236 254 255",
|
|
279
|
+
100: "207 250 254",
|
|
280
|
+
200: "165 243 252",
|
|
281
|
+
300: "103 232 249",
|
|
282
|
+
400: "34 211 238",
|
|
283
|
+
500: "6 182 212",
|
|
284
|
+
600: "8 145 178",
|
|
285
|
+
700: "14 116 144",
|
|
286
|
+
800: "21 94 117",
|
|
287
|
+
900: "22 78 99",
|
|
288
|
+
},
|
|
289
|
+
sky: {
|
|
290
|
+
50: "240 249 255",
|
|
291
|
+
100: "224 242 254",
|
|
292
|
+
200: "186 230 253",
|
|
293
|
+
300: "125 211 252",
|
|
294
|
+
400: "56 189 248",
|
|
295
|
+
500: "14 165 233",
|
|
296
|
+
600: "2 132 199",
|
|
297
|
+
700: "3 105 161",
|
|
298
|
+
800: "7 89 133",
|
|
299
|
+
900: "12 74 110",
|
|
300
|
+
},
|
|
301
|
+
blue: {
|
|
302
|
+
50: "239 246 255",
|
|
303
|
+
100: "219 234 254",
|
|
304
|
+
200: "191 219 254",
|
|
305
|
+
300: "147 197 253",
|
|
306
|
+
400: "96 165 250",
|
|
307
|
+
500: "59 130 246",
|
|
308
|
+
600: "37 99 235",
|
|
309
|
+
700: "29 78 216",
|
|
310
|
+
800: "30 64 175",
|
|
311
|
+
900: "30 58 138",
|
|
312
|
+
},
|
|
313
|
+
indigo: {
|
|
314
|
+
50: "238 242 255",
|
|
315
|
+
100: "224 231 255",
|
|
316
|
+
200: "199 210 254",
|
|
317
|
+
300: "165 180 252",
|
|
318
|
+
400: "129 140 248",
|
|
319
|
+
500: "99 102 241",
|
|
320
|
+
600: "79 70 229",
|
|
321
|
+
700: "67 56 202",
|
|
322
|
+
800: "55 48 163",
|
|
323
|
+
900: "49 46 129",
|
|
324
|
+
},
|
|
325
|
+
violet: {
|
|
326
|
+
50: "245 243 255",
|
|
327
|
+
100: "237 233 254",
|
|
328
|
+
200: "221 214 254",
|
|
329
|
+
300: "196 181 253",
|
|
330
|
+
400: "167 139 250",
|
|
331
|
+
500: "139 92 246",
|
|
332
|
+
600: "124 58 237",
|
|
333
|
+
700: "109 40 217",
|
|
334
|
+
800: "91 33 182",
|
|
335
|
+
900: "76 29 149",
|
|
336
|
+
},
|
|
337
|
+
purple: {
|
|
338
|
+
50: "250 245 255",
|
|
339
|
+
100: "243 232 255",
|
|
340
|
+
200: "233 213 255",
|
|
341
|
+
300: "216 180 254",
|
|
342
|
+
400: "192 132 252",
|
|
343
|
+
500: "168 85 247",
|
|
344
|
+
600: "147 51 234",
|
|
345
|
+
700: "126 34 206",
|
|
346
|
+
800: "107 33 168",
|
|
347
|
+
900: "88 28 135",
|
|
348
|
+
},
|
|
349
|
+
fuchsia: {
|
|
350
|
+
50: "253 244 255",
|
|
351
|
+
100: "250 232 255",
|
|
352
|
+
200: "245 208 254",
|
|
353
|
+
300: "240 171 252",
|
|
354
|
+
400: "232 121 249",
|
|
355
|
+
500: "217 70 239",
|
|
356
|
+
600: "192 38 211",
|
|
357
|
+
700: "162 28 175",
|
|
358
|
+
800: "134 25 143",
|
|
359
|
+
900: "112 26 117",
|
|
360
|
+
},
|
|
361
|
+
pink: {
|
|
362
|
+
50: "253 242 248",
|
|
363
|
+
100: "252 231 243",
|
|
364
|
+
200: "251 207 232",
|
|
365
|
+
300: "249 168 212",
|
|
366
|
+
400: "244 114 182",
|
|
367
|
+
500: "236 72 153",
|
|
368
|
+
600: "219 39 119",
|
|
369
|
+
700: "190 24 93",
|
|
370
|
+
800: "157 23 77",
|
|
371
|
+
900: "131 24 67",
|
|
372
|
+
},
|
|
373
|
+
rose: {
|
|
374
|
+
50: "255 241 242",
|
|
375
|
+
100: "255 228 230",
|
|
376
|
+
200: "254 205 211",
|
|
377
|
+
300: "253 164 175",
|
|
378
|
+
400: "251 113 133",
|
|
379
|
+
500: "244 63 94",
|
|
380
|
+
600: "225 29 72",
|
|
381
|
+
700: "190 18 60",
|
|
382
|
+
800: "159 18 57",
|
|
383
|
+
900: "136 19 55",
|
|
384
|
+
},
|
|
385
385
|
};
|
|
386
386
|
|
|
387
|
-
/**
|
|
388
|
-
* The general color palette
|
|
389
|
-
* Should be available in most if not all colored components
|
|
390
|
-
*/
|
|
391
|
-
const generalPalette = {
|
|
392
|
-
PRIMARY: tailwindPalette.blue,
|
|
393
|
-
SECONDARY: tailwindPalette.slate,
|
|
394
|
-
ACCENT: tailwindPalette.cyan,
|
|
395
|
-
NEUTRAL: tailwindPalette.neutral,
|
|
396
|
-
BLACK: { DEFAULT: "26 27 28" },
|
|
397
|
-
WHITE: { DEFAULT: "255 255 255" },
|
|
398
|
-
};
|
|
399
|
-
/**
|
|
400
|
-
* The intent color palette
|
|
401
|
-
* Should be available for most colored components such as "Button", "Alert", "Indicator", "Badge"
|
|
402
|
-
*/
|
|
403
|
-
const intentPalette = {
|
|
404
|
-
INFO: tailwindPalette.blue,
|
|
405
|
-
SUCCESS: tailwindPalette.green,
|
|
406
|
-
WARNING: tailwindPalette.amber,
|
|
407
|
-
DANGER: tailwindPalette.red,
|
|
408
|
-
};
|
|
409
|
-
/**
|
|
410
|
-
* The Criticality color palette
|
|
411
|
-
* Should be available in any component that could be used to display the criticality of an asset or event
|
|
412
|
-
*/
|
|
413
|
-
const criticalityPalette = {
|
|
414
|
-
GOOD: tailwindPalette.emerald,
|
|
415
|
-
LOW: tailwindPalette.amber,
|
|
416
|
-
CRITICAL: tailwindPalette.red,
|
|
417
|
-
};
|
|
418
|
-
/**
|
|
419
|
-
* The Activity color palette
|
|
420
|
-
* Should be available in any component that could be used to display the Activity state of an asset
|
|
421
|
-
*/
|
|
422
|
-
const activityPalette = {
|
|
423
|
-
WORKING: tailwindPalette.blue,
|
|
424
|
-
IDLE: tailwindPalette.orange,
|
|
425
|
-
STOPPED: tailwindPalette.violet,
|
|
426
|
-
UNKNOWN: tailwindPalette.neutral,
|
|
427
|
-
MOVING: { DEFAULT: "230 144 177" },
|
|
428
|
-
ACTIVE: { DEFAULT: "63 219 147" },
|
|
429
|
-
};
|
|
430
|
-
/**
|
|
431
|
-
* The Utilization color palette
|
|
432
|
-
* Should be available in any component that could be used to display the Activity state of an asset
|
|
433
|
-
*/
|
|
434
|
-
const utilizationPalette = {
|
|
435
|
-
UNUSED: { 300: tailwindPalette.red["300"], 400: tailwindPalette.red["400"] },
|
|
436
|
-
UTILIZED: { 400: tailwindPalette.blue["400"], 600: tailwindPalette.blue["600"] },
|
|
437
|
-
HEAVILY_UTILIZED: { 300: tailwindPalette.amber["300"], 500: tailwindPalette.amber["500"] },
|
|
438
|
-
};
|
|
439
|
-
/**
|
|
440
|
-
* The Rental status color palette
|
|
441
|
-
* Should be available in any component that could be used to display the rental status of an asset
|
|
442
|
-
*/
|
|
443
|
-
const rentalStatusPalette = {
|
|
444
|
-
ON_RENT: { 100: "223 244 254", 600: "90 200 250" },
|
|
445
|
-
RETURNED: { 100: "230 202 255", 600: "176 90 255" },
|
|
446
|
-
AVAILABLE: { 100: "206 255 232", 600: "0 166 88" },
|
|
447
|
-
PICKUP_READY: { 100: "255 236 209", 600: "255 149 0" },
|
|
448
|
-
TRANSFER: { 100: "255 248 217", 600: "253 208 8" },
|
|
449
|
-
IN_REPAIR: { 100: "255 233 233", 600: "255 90 90" },
|
|
450
|
-
OTHER_RENTAL_STATUS: { 100: "238 239 239", 600: "151 154 154" },
|
|
451
|
-
};
|
|
452
|
-
/**
|
|
453
|
-
* Colors of the different site types.
|
|
454
|
-
*
|
|
455
|
-
* The generator has an issue with underscores in variant names, which is why they are not used below.
|
|
456
|
-
*/
|
|
457
|
-
const sitesPalette = {
|
|
458
|
-
SITE: {
|
|
459
|
-
AREA: tailwindPalette.blue["600"],
|
|
460
|
-
CLASSIC_POI: tailwindPalette.neutral["500"],
|
|
461
|
-
CLASSIC_ZONE: tailwindPalette.neutral["500"],
|
|
462
|
-
DEPOT: tailwindPalette.emerald["500"],
|
|
463
|
-
WORK_PLACE: tailwindPalette.violet["600"],
|
|
464
|
-
CONSTRUCTION_SITE: tailwindPalette.amber["500"],
|
|
465
|
-
UNKNOWN: tailwindPalette.neutral["500"],
|
|
466
|
-
},
|
|
467
|
-
};
|
|
468
|
-
/**
|
|
469
|
-
* Grouped Theme Colors
|
|
470
|
-
*/
|
|
471
|
-
const groupedPalettes = {
|
|
472
|
-
// General
|
|
473
|
-
GENERAL: generalPalette,
|
|
474
|
-
// UI Intent
|
|
475
|
-
INTENT: intentPalette,
|
|
476
|
-
// Asset Criticality
|
|
477
|
-
CRITICALITY: criticalityPalette,
|
|
478
|
-
// Activity
|
|
479
|
-
ACTIVITY: activityPalette,
|
|
480
|
-
// Utilization
|
|
481
|
-
UTILIZATION: utilizationPalette,
|
|
482
|
-
// Rental
|
|
483
|
-
RENTAL: rentalStatusPalette,
|
|
484
|
-
// Sites
|
|
485
|
-
SITES: sitesPalette,
|
|
486
|
-
};
|
|
487
|
-
/**
|
|
488
|
-
* The full theme color palette (flattened)
|
|
489
|
-
*/
|
|
387
|
+
/**
|
|
388
|
+
* The general color palette
|
|
389
|
+
* Should be available in most if not all colored components
|
|
390
|
+
*/
|
|
391
|
+
const generalPalette = {
|
|
392
|
+
PRIMARY: tailwindPalette.blue,
|
|
393
|
+
SECONDARY: tailwindPalette.slate,
|
|
394
|
+
ACCENT: tailwindPalette.cyan,
|
|
395
|
+
NEUTRAL: tailwindPalette.neutral,
|
|
396
|
+
BLACK: { DEFAULT: "26 27 28" },
|
|
397
|
+
WHITE: { DEFAULT: "255 255 255" },
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* The intent color palette
|
|
401
|
+
* Should be available for most colored components such as "Button", "Alert", "Indicator", "Badge"
|
|
402
|
+
*/
|
|
403
|
+
const intentPalette = {
|
|
404
|
+
INFO: tailwindPalette.blue,
|
|
405
|
+
SUCCESS: tailwindPalette.green,
|
|
406
|
+
WARNING: tailwindPalette.amber,
|
|
407
|
+
DANGER: tailwindPalette.red,
|
|
408
|
+
};
|
|
409
|
+
/**
|
|
410
|
+
* The Criticality color palette
|
|
411
|
+
* Should be available in any component that could be used to display the criticality of an asset or event
|
|
412
|
+
*/
|
|
413
|
+
const criticalityPalette = {
|
|
414
|
+
GOOD: tailwindPalette.emerald,
|
|
415
|
+
LOW: tailwindPalette.amber,
|
|
416
|
+
CRITICAL: tailwindPalette.red,
|
|
417
|
+
};
|
|
418
|
+
/**
|
|
419
|
+
* The Activity color palette
|
|
420
|
+
* Should be available in any component that could be used to display the Activity state of an asset
|
|
421
|
+
*/
|
|
422
|
+
const activityPalette = {
|
|
423
|
+
WORKING: tailwindPalette.blue,
|
|
424
|
+
IDLE: tailwindPalette.orange,
|
|
425
|
+
STOPPED: tailwindPalette.violet,
|
|
426
|
+
UNKNOWN: tailwindPalette.neutral,
|
|
427
|
+
MOVING: { DEFAULT: "230 144 177" },
|
|
428
|
+
ACTIVE: { DEFAULT: "63 219 147" },
|
|
429
|
+
};
|
|
430
|
+
/**
|
|
431
|
+
* The Utilization color palette
|
|
432
|
+
* Should be available in any component that could be used to display the Activity state of an asset
|
|
433
|
+
*/
|
|
434
|
+
const utilizationPalette = {
|
|
435
|
+
UNUSED: { 300: tailwindPalette.red["300"], 400: tailwindPalette.red["400"] },
|
|
436
|
+
UTILIZED: { 400: tailwindPalette.blue["400"], 600: tailwindPalette.blue["600"] },
|
|
437
|
+
HEAVILY_UTILIZED: { 300: tailwindPalette.amber["300"], 500: tailwindPalette.amber["500"] },
|
|
438
|
+
};
|
|
439
|
+
/**
|
|
440
|
+
* The Rental status color palette
|
|
441
|
+
* Should be available in any component that could be used to display the rental status of an asset
|
|
442
|
+
*/
|
|
443
|
+
const rentalStatusPalette = {
|
|
444
|
+
ON_RENT: { 100: "223 244 254", 600: "90 200 250" },
|
|
445
|
+
RETURNED: { 100: "230 202 255", 600: "176 90 255" },
|
|
446
|
+
AVAILABLE: { 100: "206 255 232", 600: "0 166 88" },
|
|
447
|
+
PICKUP_READY: { 100: "255 236 209", 600: "255 149 0" },
|
|
448
|
+
TRANSFER: { 100: "255 248 217", 600: "253 208 8" },
|
|
449
|
+
IN_REPAIR: { 100: "255 233 233", 600: "255 90 90" },
|
|
450
|
+
OTHER_RENTAL_STATUS: { 100: "238 239 239", 600: "151 154 154" },
|
|
451
|
+
};
|
|
452
|
+
/**
|
|
453
|
+
* Colors of the different site types.
|
|
454
|
+
*
|
|
455
|
+
* The generator has an issue with underscores in variant names, which is why they are not used below.
|
|
456
|
+
*/
|
|
457
|
+
const sitesPalette = {
|
|
458
|
+
SITE: {
|
|
459
|
+
AREA: tailwindPalette.blue["600"],
|
|
460
|
+
CLASSIC_POI: tailwindPalette.neutral["500"],
|
|
461
|
+
CLASSIC_ZONE: tailwindPalette.neutral["500"],
|
|
462
|
+
DEPOT: tailwindPalette.emerald["500"],
|
|
463
|
+
WORK_PLACE: tailwindPalette.violet["600"],
|
|
464
|
+
CONSTRUCTION_SITE: tailwindPalette.amber["500"],
|
|
465
|
+
UNKNOWN: tailwindPalette.neutral["500"],
|
|
466
|
+
},
|
|
467
|
+
};
|
|
468
|
+
/**
|
|
469
|
+
* Grouped Theme Colors
|
|
470
|
+
*/
|
|
471
|
+
const groupedPalettes = {
|
|
472
|
+
// General
|
|
473
|
+
GENERAL: generalPalette,
|
|
474
|
+
// UI Intent
|
|
475
|
+
INTENT: intentPalette,
|
|
476
|
+
// Asset Criticality
|
|
477
|
+
CRITICALITY: criticalityPalette,
|
|
478
|
+
// Activity
|
|
479
|
+
ACTIVITY: activityPalette,
|
|
480
|
+
// Utilization
|
|
481
|
+
UTILIZATION: utilizationPalette,
|
|
482
|
+
// Rental
|
|
483
|
+
RENTAL: rentalStatusPalette,
|
|
484
|
+
// Sites
|
|
485
|
+
SITES: sitesPalette,
|
|
486
|
+
};
|
|
487
|
+
/**
|
|
488
|
+
* The full theme color palette (flattened)
|
|
489
|
+
*/
|
|
490
490
|
const trackunitPalette = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, generalPalette), intentPalette), criticalityPalette), activityPalette), utilizationPalette), rentalStatusPalette), sitesPalette);
|
|
491
491
|
|
|
492
|
-
/**
|
|
493
|
-
* A collection of all the tokens related to the named colors in the default theme.
|
|
494
|
-
*/
|
|
495
|
-
/**
|
|
496
|
-
* An object of all the Trackunit Theme colors and their available variants.
|
|
497
|
-
* These colors does not include the default tailwind colors.
|
|
498
|
-
*/
|
|
499
|
-
const themeColors = {
|
|
500
|
-
PRIMARY: { name: "primary", variants: trackunitPalette.PRIMARY },
|
|
501
|
-
SECONDARY: { name: "secondary", variants: trackunitPalette.SECONDARY },
|
|
502
|
-
ACCENT: { name: "accent", variants: trackunitPalette.ACCENT },
|
|
503
|
-
NEUTRAL: { name: "neutral", variants: trackunitPalette.NEUTRAL },
|
|
504
|
-
BLACK: { name: "black", variants: trackunitPalette.BLACK, defaultVariant: "DEFAULT" },
|
|
505
|
-
WHITE: { name: "white", variants: trackunitPalette.WHITE, defaultVariant: "DEFAULT" },
|
|
506
|
-
INFO: { name: "info", variants: trackunitPalette.INFO },
|
|
507
|
-
SUCCESS: { name: "success", variants: trackunitPalette.SUCCESS },
|
|
508
|
-
WARNING: { name: "warning", variants: trackunitPalette.WARNING },
|
|
509
|
-
DANGER: { name: "danger", variants: trackunitPalette.DANGER },
|
|
510
|
-
GOOD: { name: "good", variants: trackunitPalette.GOOD },
|
|
511
|
-
LOW: { name: "low", variants: trackunitPalette.LOW },
|
|
512
|
-
CRITICAL: { name: "critical", variants: trackunitPalette.CRITICAL },
|
|
513
|
-
WORKING: { name: "working", variants: trackunitPalette.WORKING },
|
|
514
|
-
IDLE: { name: "idle", variants: trackunitPalette.IDLE },
|
|
515
|
-
STOPPED: { name: "stopped", variants: trackunitPalette.STOPPED },
|
|
516
|
-
ACTIVE: { name: "active", variants: trackunitPalette.ACTIVE, defaultVariant: "DEFAULT" },
|
|
517
|
-
MOVING: { name: "moving", variants: trackunitPalette.MOVING, defaultVariant: "DEFAULT" },
|
|
518
|
-
UNKNOWN: { name: "unknown", variants: trackunitPalette.UNKNOWN },
|
|
519
|
-
AVAILABLE: { name: "available", variants: trackunitPalette.AVAILABLE },
|
|
520
|
-
UNUSED: { name: "unused", variants: trackunitPalette.UNUSED },
|
|
521
|
-
UTILIZED: { name: "utilized", variants: trackunitPalette.UTILIZED },
|
|
522
|
-
HEAVILY_UTILIZED: { name: "heavily_utilized", variants: trackunitPalette.HEAVILY_UTILIZED },
|
|
523
|
-
IN_REPAIR: { name: "in_repair", variants: trackunitPalette.IN_REPAIR },
|
|
524
|
-
ON_RENT: { name: "on_rent", variants: trackunitPalette.ON_RENT },
|
|
525
|
-
OTHER_RENTAL_STATUS: { name: "other_rental_status", variants: trackunitPalette.OTHER_RENTAL_STATUS },
|
|
526
|
-
PICKUP_READY: { name: "pickup_ready", variants: trackunitPalette.PICKUP_READY },
|
|
527
|
-
RETURNED: { name: "returned", variants: trackunitPalette.RETURNED },
|
|
528
|
-
TRANSFER: { name: "transfer", variants: trackunitPalette.TRANSFER },
|
|
529
|
-
SITE: { name: "site", variants: trackunitPalette.SITE },
|
|
492
|
+
/**
|
|
493
|
+
* A collection of all the tokens related to the named colors in the default theme.
|
|
494
|
+
*/
|
|
495
|
+
/**
|
|
496
|
+
* An object of all the Trackunit Theme colors and their available variants.
|
|
497
|
+
* These colors does not include the default tailwind colors.
|
|
498
|
+
*/
|
|
499
|
+
const themeColors = {
|
|
500
|
+
PRIMARY: { name: "primary", variants: trackunitPalette.PRIMARY },
|
|
501
|
+
SECONDARY: { name: "secondary", variants: trackunitPalette.SECONDARY },
|
|
502
|
+
ACCENT: { name: "accent", variants: trackunitPalette.ACCENT },
|
|
503
|
+
NEUTRAL: { name: "neutral", variants: trackunitPalette.NEUTRAL },
|
|
504
|
+
BLACK: { name: "black", variants: trackunitPalette.BLACK, defaultVariant: "DEFAULT" },
|
|
505
|
+
WHITE: { name: "white", variants: trackunitPalette.WHITE, defaultVariant: "DEFAULT" },
|
|
506
|
+
INFO: { name: "info", variants: trackunitPalette.INFO },
|
|
507
|
+
SUCCESS: { name: "success", variants: trackunitPalette.SUCCESS },
|
|
508
|
+
WARNING: { name: "warning", variants: trackunitPalette.WARNING },
|
|
509
|
+
DANGER: { name: "danger", variants: trackunitPalette.DANGER },
|
|
510
|
+
GOOD: { name: "good", variants: trackunitPalette.GOOD },
|
|
511
|
+
LOW: { name: "low", variants: trackunitPalette.LOW },
|
|
512
|
+
CRITICAL: { name: "critical", variants: trackunitPalette.CRITICAL },
|
|
513
|
+
WORKING: { name: "working", variants: trackunitPalette.WORKING },
|
|
514
|
+
IDLE: { name: "idle", variants: trackunitPalette.IDLE },
|
|
515
|
+
STOPPED: { name: "stopped", variants: trackunitPalette.STOPPED },
|
|
516
|
+
ACTIVE: { name: "active", variants: trackunitPalette.ACTIVE, defaultVariant: "DEFAULT" },
|
|
517
|
+
MOVING: { name: "moving", variants: trackunitPalette.MOVING, defaultVariant: "DEFAULT" },
|
|
518
|
+
UNKNOWN: { name: "unknown", variants: trackunitPalette.UNKNOWN },
|
|
519
|
+
AVAILABLE: { name: "available", variants: trackunitPalette.AVAILABLE },
|
|
520
|
+
UNUSED: { name: "unused", variants: trackunitPalette.UNUSED },
|
|
521
|
+
UTILIZED: { name: "utilized", variants: trackunitPalette.UTILIZED },
|
|
522
|
+
HEAVILY_UTILIZED: { name: "heavily_utilized", variants: trackunitPalette.HEAVILY_UTILIZED },
|
|
523
|
+
IN_REPAIR: { name: "in_repair", variants: trackunitPalette.IN_REPAIR },
|
|
524
|
+
ON_RENT: { name: "on_rent", variants: trackunitPalette.ON_RENT },
|
|
525
|
+
OTHER_RENTAL_STATUS: { name: "other_rental_status", variants: trackunitPalette.OTHER_RENTAL_STATUS },
|
|
526
|
+
PICKUP_READY: { name: "pickup_ready", variants: trackunitPalette.PICKUP_READY },
|
|
527
|
+
RETURNED: { name: "returned", variants: trackunitPalette.RETURNED },
|
|
528
|
+
TRANSFER: { name: "transfer", variants: trackunitPalette.TRANSFER },
|
|
529
|
+
SITE: { name: "site", variants: trackunitPalette.SITE },
|
|
530
530
|
};
|
|
531
531
|
|
|
532
|
-
const outputOptions = ["HEX", "CSS"];
|
|
533
|
-
/**
|
|
534
|
-
*
|
|
535
|
-
Returns the color value in CSS or HEX format for a given theme color and variant.
|
|
536
|
-
*
|
|
537
|
-
@param ColorKey - A valid theme color name from the available ThemeColorKeys.
|
|
538
|
-
@param {unknown} [arg2] - An optional argument that can be either an OutputOptions or a variant value.
|
|
539
|
-
@param {unknown} [arg3] - An optional argument that can be either an OutputOptions or a variant value.
|
|
540
|
-
@returns {string} - Returns a string containing the color value in CSS or HEX format for the provided arguments.
|
|
541
|
-
*/
|
|
542
|
-
function color(ColorKey, arg2, arg3) {
|
|
543
|
-
var _a, _b;
|
|
544
|
-
const colorName = themeColors[ColorKey].name;
|
|
545
|
-
const colorVariants = themeColors[ColorKey].variants;
|
|
546
|
-
// defaultVariant or 600 or the "middel" value available.
|
|
547
|
-
const defaultVariant = (_b = (_a = themeColors[ColorKey].defaultVariant) !== null && _a !== void 0 ? _a :
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
}
|
|
570
|
-
|
|
532
|
+
const outputOptions = ["HEX", "CSS"];
|
|
533
|
+
/**
|
|
534
|
+
*
|
|
535
|
+
Returns the color value in CSS or HEX format for a given theme color and variant.
|
|
536
|
+
*
|
|
537
|
+
@param ColorKey - A valid theme color name from the available ThemeColorKeys.
|
|
538
|
+
@param {unknown} [arg2] - An optional argument that can be either an OutputOptions or a variant value.
|
|
539
|
+
@param {unknown} [arg3] - An optional argument that can be either an OutputOptions or a variant value.
|
|
540
|
+
@returns {string} - Returns a string containing the color value in CSS or HEX format for the provided arguments.
|
|
541
|
+
*/
|
|
542
|
+
function color(ColorKey, arg2, arg3) {
|
|
543
|
+
var _a, _b;
|
|
544
|
+
const colorName = themeColors[ColorKey].name;
|
|
545
|
+
const colorVariants = themeColors[ColorKey].variants;
|
|
546
|
+
// defaultVariant or 600 or the "middel" value available.
|
|
547
|
+
const defaultVariant = (_b = (_a = themeColors[ColorKey].defaultVariant) !== null && _a !== void 0 ? _a :
|
|
548
|
+
// @ts-ignore - suppressImplicitAnyIndexErrors
|
|
549
|
+
(colorVariants[600] && 600)) !== null && _b !== void 0 ? _b : Object.keys(colorVariants)[Math.floor(Object.keys(colorVariants).length / 2)];
|
|
550
|
+
let variant = defaultVariant;
|
|
551
|
+
let output = "CSS";
|
|
552
|
+
if (isOutputOption(arg2)) {
|
|
553
|
+
output = arg2;
|
|
554
|
+
}
|
|
555
|
+
else {
|
|
556
|
+
if (isOutputOption(arg3)) {
|
|
557
|
+
output = arg3;
|
|
558
|
+
}
|
|
559
|
+
if (isValidVariant(colorVariants, arg2)) {
|
|
560
|
+
variant = arg2;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
const variableName = `--color-${colorName}-${String(variant)}`.replace(/[^a-zA-Z0-9]/g, "-");
|
|
564
|
+
if (output === "CSS") {
|
|
565
|
+
return colorVariableToCss(variableName);
|
|
566
|
+
}
|
|
567
|
+
else if (output === "HEX") {
|
|
568
|
+
return getHEX(variableName);
|
|
569
|
+
}
|
|
570
|
+
return colorName;
|
|
571
|
+
}
|
|
572
|
+
const isOutputOption = (something) => typeof something === "string" && outputOptions.includes(something);
|
|
571
573
|
const isValidVariant = (availableVariants, something) => Boolean(availableVariants[something]);
|
|
572
574
|
|
|
573
|
-
/**
|
|
574
|
-
* A collection of all the tokens related to elevation in the theme.
|
|
575
|
-
*/
|
|
576
|
-
const themeBoxShadow = {
|
|
577
|
-
sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
578
|
-
DEFAULT: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
579
|
-
md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
580
|
-
lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
581
|
-
xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
582
|
-
"2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
583
|
-
inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
|
|
584
|
-
none: "none",
|
|
585
|
-
active: "0px 0px 1px 1px rgba(26, 27, 28, 0.13), 0px 1px 1px rgba(26, 27, 28, 0.15)",
|
|
586
|
-
};
|
|
587
|
-
/**
|
|
588
|
-
* Elevation is based on N100 with an alpha channel. E(X)A variants
|
|
589
|
-
* are for active versions(e.g. hover).
|
|
590
|
-
*/
|
|
591
|
-
const elevation = {
|
|
592
|
-
E05: themeBoxShadow.sm,
|
|
593
|
-
E10: themeBoxShadow.DEFAULT,
|
|
594
|
-
E10A: themeBoxShadow.md,
|
|
595
|
-
E20: themeBoxShadow.lg,
|
|
596
|
-
E30: themeBoxShadow.xl,
|
|
597
|
-
E40: themeBoxShadow["2xl"],
|
|
575
|
+
/**
|
|
576
|
+
* A collection of all the tokens related to elevation in the theme.
|
|
577
|
+
*/
|
|
578
|
+
const themeBoxShadow = {
|
|
579
|
+
sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
580
|
+
DEFAULT: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
581
|
+
md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
582
|
+
lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
583
|
+
xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
584
|
+
"2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
585
|
+
inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
|
|
586
|
+
none: "none",
|
|
587
|
+
active: "0px 0px 1px 1px rgba(26, 27, 28, 0.13), 0px 1px 1px rgba(26, 27, 28, 0.15)",
|
|
598
588
|
};
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
*
|
|
602
|
-
*/
|
|
603
|
-
const
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
"3xl": "1900px",
|
|
589
|
+
/**
|
|
590
|
+
* Elevation is based on N100 with an alpha channel. E(X)A variants
|
|
591
|
+
* are for active versions(e.g. hover).
|
|
592
|
+
*/
|
|
593
|
+
const elevation = {
|
|
594
|
+
E05: themeBoxShadow.sm,
|
|
595
|
+
E10: themeBoxShadow.DEFAULT,
|
|
596
|
+
E10A: themeBoxShadow.md,
|
|
597
|
+
E20: themeBoxShadow.lg,
|
|
598
|
+
E30: themeBoxShadow.xl,
|
|
599
|
+
E40: themeBoxShadow["2xl"],
|
|
611
600
|
};
|
|
612
601
|
|
|
613
|
-
/**
|
|
614
|
-
* A collection of all the tokens related to
|
|
615
|
-
*/
|
|
616
|
-
const
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
"
|
|
623
|
-
"
|
|
624
|
-
"3": "0.75rem",
|
|
625
|
-
"3.5": "0.875rem",
|
|
626
|
-
"4": "1rem",
|
|
627
|
-
"5": "1.25rem",
|
|
628
|
-
"6": "1.5rem",
|
|
629
|
-
"7": "1.75rem",
|
|
630
|
-
"8": "2rem",
|
|
631
|
-
"9": "2.25rem",
|
|
632
|
-
"10": "2.5rem",
|
|
633
|
-
"11": "2.75rem",
|
|
634
|
-
"12": "3rem",
|
|
635
|
-
"14": "3.5rem",
|
|
636
|
-
"16": "4rem",
|
|
637
|
-
"20": "5rem",
|
|
638
|
-
"24": "6rem",
|
|
639
|
-
"28": "7rem",
|
|
640
|
-
"32": "8rem",
|
|
641
|
-
"36": "9rem",
|
|
642
|
-
"40": "10rem",
|
|
643
|
-
"44": "11rem",
|
|
644
|
-
"48": "12rem",
|
|
645
|
-
"52": "13rem",
|
|
646
|
-
"56": "14rem",
|
|
647
|
-
"60": "15rem",
|
|
648
|
-
"64": "16rem",
|
|
649
|
-
"72": "18rem",
|
|
650
|
-
"80": "20rem",
|
|
651
|
-
"96": "24rem",
|
|
652
|
-
};
|
|
653
|
-
const size = {
|
|
654
|
-
none: themeSpacing[0],
|
|
655
|
-
tiny: themeSpacing[1],
|
|
656
|
-
mini: themeSpacing[2],
|
|
657
|
-
small: themeSpacing[3],
|
|
658
|
-
medium: themeSpacing[4],
|
|
659
|
-
large: themeSpacing[6],
|
|
660
|
-
giant: themeSpacing[8],
|
|
661
|
-
enormous: themeSpacing[10],
|
|
602
|
+
/**
|
|
603
|
+
* A collection of all the tokens related to screen size in the theme.
|
|
604
|
+
*/
|
|
605
|
+
const themeScreenSize = {
|
|
606
|
+
xs: "0px",
|
|
607
|
+
sm: "480px",
|
|
608
|
+
md: "768px",
|
|
609
|
+
lg: "1024px",
|
|
610
|
+
xl: "1200px",
|
|
611
|
+
"2xl": "1600px",
|
|
612
|
+
"3xl": "1900px",
|
|
662
613
|
};
|
|
663
614
|
|
|
664
|
-
/**
|
|
665
|
-
* A collection of all the tokens related to
|
|
666
|
-
*/
|
|
667
|
-
const
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
"
|
|
674
|
-
"
|
|
675
|
-
"
|
|
676
|
-
"
|
|
677
|
-
"
|
|
678
|
-
"
|
|
679
|
-
"
|
|
680
|
-
"
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
"
|
|
689
|
-
"
|
|
690
|
-
"
|
|
691
|
-
"
|
|
692
|
-
"
|
|
693
|
-
"
|
|
694
|
-
"
|
|
695
|
-
"
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
tertiary: themeFontSize.base,
|
|
714
|
-
subtitle: themeFontSize.base,
|
|
715
|
-
body: themeFontSize.sm,
|
|
716
|
-
small: themeFontSize.xs, // 12px
|
|
717
|
-
};
|
|
718
|
-
/**
|
|
719
|
-
* Primary font weights.
|
|
720
|
-
*/
|
|
721
|
-
const fontWeight = {
|
|
722
|
-
thin: themeFontWeight.thin,
|
|
723
|
-
extralight: themeFontWeight.extralight,
|
|
724
|
-
light: themeFontWeight.light,
|
|
725
|
-
normal: themeFontWeight.normal,
|
|
726
|
-
medium: themeFontWeight.medium,
|
|
727
|
-
bold: themeFontWeight.bold,
|
|
728
|
-
extrabold: themeFontWeight.extrabold,
|
|
729
|
-
black: themeFontWeight.black,
|
|
615
|
+
/**
|
|
616
|
+
* A collection of all the tokens related to sizes in the theme.
|
|
617
|
+
*/
|
|
618
|
+
const themeSpacing = {
|
|
619
|
+
px: "1px",
|
|
620
|
+
"0": "0px",
|
|
621
|
+
"0.5": "0.125rem",
|
|
622
|
+
"1": "0.25rem",
|
|
623
|
+
"1.5": "0.375rem",
|
|
624
|
+
"2": "0.5rem",
|
|
625
|
+
"2.5": "0.625rem",
|
|
626
|
+
"3": "0.75rem",
|
|
627
|
+
"3.5": "0.875rem",
|
|
628
|
+
"4": "1rem",
|
|
629
|
+
"5": "1.25rem",
|
|
630
|
+
"6": "1.5rem",
|
|
631
|
+
"7": "1.75rem",
|
|
632
|
+
"8": "2rem",
|
|
633
|
+
"9": "2.25rem",
|
|
634
|
+
"10": "2.5rem",
|
|
635
|
+
"11": "2.75rem",
|
|
636
|
+
"12": "3rem",
|
|
637
|
+
"14": "3.5rem",
|
|
638
|
+
"16": "4rem",
|
|
639
|
+
"20": "5rem",
|
|
640
|
+
"24": "6rem",
|
|
641
|
+
"28": "7rem",
|
|
642
|
+
"32": "8rem",
|
|
643
|
+
"36": "9rem",
|
|
644
|
+
"40": "10rem",
|
|
645
|
+
"44": "11rem",
|
|
646
|
+
"48": "12rem",
|
|
647
|
+
"52": "13rem",
|
|
648
|
+
"56": "14rem",
|
|
649
|
+
"60": "15rem",
|
|
650
|
+
"64": "16rem",
|
|
651
|
+
"72": "18rem",
|
|
652
|
+
"80": "20rem",
|
|
653
|
+
"96": "24rem",
|
|
654
|
+
};
|
|
655
|
+
const size = {
|
|
656
|
+
none: themeSpacing[0],
|
|
657
|
+
tiny: themeSpacing[1],
|
|
658
|
+
mini: themeSpacing[2],
|
|
659
|
+
small: themeSpacing[3],
|
|
660
|
+
medium: themeSpacing[4],
|
|
661
|
+
large: themeSpacing[6],
|
|
662
|
+
giant: themeSpacing[8],
|
|
663
|
+
enormous: themeSpacing[10],
|
|
730
664
|
};
|
|
731
665
|
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
666
|
+
/**
|
|
667
|
+
* A collection of all the tokens related to typography in the theme.
|
|
668
|
+
*/
|
|
669
|
+
const themeFontSize = {
|
|
670
|
+
xs: "0.75rem",
|
|
671
|
+
sm: "0.875rem",
|
|
672
|
+
base: "1rem",
|
|
673
|
+
lg: "1.125rem",
|
|
674
|
+
xl: "1.25rem",
|
|
675
|
+
"2xl": "1.5rem",
|
|
676
|
+
"3xl": "1.875rem",
|
|
677
|
+
"4xl": "2.25rem",
|
|
678
|
+
"5xl": "3rem",
|
|
679
|
+
"6xl": "3.75rem",
|
|
680
|
+
"7xl": "4.5rem",
|
|
681
|
+
"8xl": "6rem",
|
|
682
|
+
"9xl": "8rem",
|
|
683
|
+
};
|
|
684
|
+
const themeLineHeight = {
|
|
685
|
+
xs: "1rem",
|
|
686
|
+
sm: "1.25rem",
|
|
687
|
+
base: "1.5rem",
|
|
688
|
+
lg: "1.75rem",
|
|
689
|
+
xl: "1.75rem",
|
|
690
|
+
"2xl": "2rem",
|
|
691
|
+
"3xl": "2.25rem",
|
|
692
|
+
"4xl": "2.5rem",
|
|
693
|
+
"5xl": "2.75rem",
|
|
694
|
+
"6xl": "3rem",
|
|
695
|
+
"7xl": "3.25rem",
|
|
696
|
+
"8xl": "3.5rem",
|
|
697
|
+
"9xl": "3.75rem",
|
|
747
698
|
};
|
|
699
|
+
const themeFontWeight = {
|
|
700
|
+
thin: 100,
|
|
701
|
+
extralight: 200,
|
|
702
|
+
light: 300,
|
|
703
|
+
normal: 400,
|
|
704
|
+
medium: 500,
|
|
705
|
+
bold: 600,
|
|
706
|
+
extrabold: 700,
|
|
707
|
+
black: 800,
|
|
708
|
+
};
|
|
709
|
+
/**
|
|
710
|
+
* Based on a root size of 16px.
|
|
711
|
+
*/
|
|
712
|
+
const fontSize = {
|
|
713
|
+
primary: themeFontSize["3xl"],
|
|
714
|
+
secondary: themeFontSize.lg,
|
|
715
|
+
tertiary: themeFontSize.base,
|
|
716
|
+
subtitle: themeFontSize.base,
|
|
717
|
+
body: themeFontSize.sm,
|
|
718
|
+
small: themeFontSize.xs, // 12px
|
|
719
|
+
};
|
|
720
|
+
/**
|
|
721
|
+
* Primary font weights.
|
|
722
|
+
*/
|
|
723
|
+
const fontWeight = {
|
|
724
|
+
thin: themeFontWeight.thin,
|
|
725
|
+
extralight: themeFontWeight.extralight,
|
|
726
|
+
light: themeFontWeight.light,
|
|
727
|
+
normal: themeFontWeight.normal,
|
|
728
|
+
medium: themeFontWeight.medium,
|
|
729
|
+
bold: themeFontWeight.bold,
|
|
730
|
+
extrabold: themeFontWeight.extrabold,
|
|
731
|
+
black: themeFontWeight.black,
|
|
732
|
+
};
|
|
733
|
+
const fontFamily = `'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif`;
|
|
748
734
|
|
|
749
|
-
const
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
735
|
+
const themeZIndex = {
|
|
736
|
+
hidden: -1,
|
|
737
|
+
default: 1,
|
|
738
|
+
top: 5,
|
|
739
|
+
overlay: 10,
|
|
740
|
+
popover: 20,
|
|
741
|
+
toast: 100,
|
|
742
|
+
};
|
|
743
|
+
const zIndex = {
|
|
744
|
+
hidden: themeZIndex.hidden,
|
|
745
|
+
default: themeZIndex.default,
|
|
746
|
+
top: themeZIndex.top,
|
|
747
|
+
overlay: themeZIndex.overlay,
|
|
748
|
+
popover: themeZIndex.popover,
|
|
749
|
+
toast: themeZIndex.toast,
|
|
756
750
|
};
|
|
757
751
|
|
|
758
|
-
export { DEFAULT_CHART_COLORS, activityPalette, color, criticalityPalette, elevation, fontSize, fontWeight, generalPalette, getReorderedChartColors, groupedPalettes, intentPalette, rentalStatusPalette, sitesPalette, size, tailwindPalette, themeBorderRadius, themeBoxShadow, themeColors, themeFontSize, themeFontWeight, themeLineHeight, themeScreenSize, themeSpacing, themeZIndex,
|
|
752
|
+
export { DEFAULT_CHART_COLORS, activityPalette, color, criticalityPalette, elevation, fontFamily, fontSize, fontWeight, generalPalette, getReorderedChartColors, groupedPalettes, intentPalette, rentalStatusPalette, sitesPalette, size, tailwindPalette, themeBorderRadius, themeBoxShadow, themeColors, themeFontSize, themeFontWeight, themeLineHeight, themeScreenSize, themeSpacing, themeZIndex, trackunitPalette, utilizationPalette, zIndex };
|