@cyber-harbour/ui 1.0.17 → 1.0.18

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,77 +1,16 @@
1
- import 'styled-components';
2
- import { CSSProperties, DefaultTheme } from 'styled-components';
3
-
4
- type ThemeColors = DefaultTheme['colors'];
5
- type ColorCategory = keyof ThemeColors;
6
-
7
- export type NestedColorPaths =
8
- | keyof Pick<ThemeColors, 'background' | 'disable'>
9
- | `${Extract<ColorCategory, 'primary'>}.${keyof ThemeColors['primary']}`
10
- | `${Extract<ColorCategory, 'text'>}.${keyof ThemeColors['text']}`
11
- | `${Extract<ColorCategory, 'stroke'>}.${keyof ThemeColors['stroke']}`;
12
-
13
- export type ColorVariant = NestedColorPaths;
14
-
15
- // Typography variants type
16
- export type TypographyVariant = 'h1' | 'h2' | 'h3' | 'body';
17
-
18
- declare module 'styled-components' {
19
- export interface DefaultTheme {
20
- colors: {
21
- background: CSSProperties['color'];
22
- primary: {
23
- main: CSSProperties['color'];
24
- light: CSSProperties['color'];
25
- lighter: CSSProperties['color'];
26
- lightest: CSSProperties['color'];
27
- lightest2: CSSProperties['color'];
28
- };
29
- text: {
30
- main: CSSProperties['color'];
31
- light: CSSProperties['color'];
32
- lighter: CSSProperties['color'];
33
- invert: CSSProperties['color'];
34
- };
35
- stroke: {
36
- main: CSSProperties['color'];
37
- light: CSSProperties['color'];
38
- lighter: CSSProperties['color'];
39
- };
40
- disable: string;
41
- chart: {
42
- changelog: [
43
- CSSProperties['color'],
44
- CSSProperties['color'],
45
- CSSProperties['color'],
46
- CSSProperties['color'],
47
- CSSProperties['color']
48
- ];
49
- };
50
- };
51
- type: 'light' | 'dark';
52
- typography: {
53
- fontFamily: CSSProperties['fontFamily'];
54
- lineHeight: CSSProperties['lineHeight'];
55
- h1: CSSProperties['fontSize'];
56
- h2: CSSProperties['fontSize'];
57
- h3: CSSProperties['fontSize'];
58
- body: CSSProperties['fontSize'];
59
- };
60
- }
61
- }
1
+ import { DefaultTheme } from 'styled-components/dist/types';
62
2
 
63
- // Common typography configuration for both themes
64
- const typography = {
65
- fontFamily: 'Arial, sans-serif',
66
- lineHeight: '1.49',
67
- h1: '22px',
68
- h2: '16px',
69
- h3: '14px',
70
- body: '12px',
71
- };
3
+ import 'styled-components';
4
+ import { convertPaletteToRem } from './utils';
5
+ import { Theme } from './types';
72
6
 
73
- const lightTheme: DefaultTheme = {
74
- type: 'light',
7
+ /**
8
+ * Палітра, що містить як кольори, так і розміри в px
9
+ * Кольори взято з теми, розміри будуть автоматично конвертовані в rem
10
+ */
11
+ export const lightThemePx: Theme = {
12
+ mode: 'light',
13
+ // Секція кольорів з теми
75
14
  colors: {
76
15
  background: '#ffffff',
77
16
  primary: {
@@ -79,7 +18,7 @@ const lightTheme: DefaultTheme = {
79
18
  light: '#80A0F5',
80
19
  lighter: '#E5ECFD',
81
20
  lightest: '#F3F7FF',
82
- lightest2: 'rgba(0, 66, 236. 0.05)',
21
+ lightest2: 'rgba(0, 66, 236, 0.05)',
83
22
  },
84
23
  text: {
85
24
  main: '#101010',
@@ -93,41 +32,452 @@ const lightTheme: DefaultTheme = {
93
32
  lighter: '#F3F3F3',
94
33
  },
95
34
  disable: '#FAFAFA',
96
- chart: {
97
- changelog: ['#E8E8E8', '#93E7A2', '#219846', '#216825', '#27E334'],
35
+ success: '#27AE60',
36
+ error: '#FF3B30',
37
+ warning: '#F2994A',
38
+ info: '#2F80ED',
39
+ },
40
+ // Типографія
41
+ typography: {
42
+ fontFamily:
43
+ 'Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;',
44
+ lineHeight: 1.49,
45
+ // Розміри текстових елементів
46
+ variants: {
47
+ h1: {
48
+ fontSize: 22,
49
+ },
50
+ h2: {
51
+ fontSize: 16,
52
+ },
53
+ h3: {
54
+ fontSize: 14,
55
+ },
56
+ body: {
57
+ fontSize: 12,
58
+ },
98
59
  },
99
60
  },
100
- typography,
101
- };
102
-
103
- const darkTheme: DefaultTheme = {
104
- type: 'dark',
105
- colors: {
106
- background: '#1a1a1a',
107
- primary: {
108
- main: '#66b3ff',
109
- light: '#3399ff',
110
- lighter: '#E3E8FD',
111
- lightest: '#F3F7FF',
112
- lightest2: 'rgba(0, 66, 236. 0.05)',
61
+ breakpoints: {
62
+ xs: 320,
63
+ s: 576,
64
+ m: 768,
65
+ l: 992,
66
+ xl: 1200,
67
+ },
68
+ zIndex: {
69
+ dropdown: 1000,
70
+ sticky: 1020,
71
+ fixed: 1030,
72
+ backdrop: 1040,
73
+ modal: 1050,
74
+ popover: 1060,
75
+ tooltip: 1070,
76
+ },
77
+ button: {
78
+ // Варіанти кнопок з кольорами
79
+ fill: {
80
+ default: {
81
+ // колір default
82
+ default: {
83
+ background: '#E8EAEE',
84
+ text: '#101010',
85
+ border: ' #E8EAEE',
86
+ boxShadow: 'none',
87
+ },
88
+ hover: {
89
+ background: '#E5ECFD',
90
+ text: '#101010',
91
+ border: ' #E5ECFD',
92
+ boxShadow: 'none',
93
+ },
94
+ active: {
95
+ background: '#E5ECFD',
96
+ text: '#101010',
97
+ border: ' #E5ECFD',
98
+ boxShadow: 'none',
99
+ },
100
+ disabled: {
101
+ background: '#EBEBEB',
102
+ text: '#99989C',
103
+ border: ' #EBEBEB',
104
+ boxShadow: 'none',
105
+ },
106
+ },
107
+ primary: {
108
+ // колір primary
109
+ default: {
110
+ background: '#0042EC',
111
+ text: '#FFFFFF',
112
+ border: ' #0042EC',
113
+ boxShadow: 'none',
114
+ },
115
+ hover: {
116
+ background: '#4D7BF2',
117
+ text: '#FFFFFF',
118
+ border: ' #4D7BF2',
119
+ boxShadow: 'none',
120
+ },
121
+ active: {
122
+ background: '#4D7BF2',
123
+ text: '#FFFFFF',
124
+ border: ' #4D7BF2',
125
+ boxShadow: 'none',
126
+ },
127
+ disabled: {
128
+ background: '#99989C',
129
+ text: '#FFFFFF',
130
+ border: ' #E5ECFD',
131
+ boxShadow: 'none',
132
+ },
133
+ },
134
+ //default as secondary
135
+ secondary: {
136
+ // колір default
137
+ default: {
138
+ background: '#E8EAEE',
139
+ text: '#101010',
140
+ border: ' #E8EAEE',
141
+ boxShadow: 'none',
142
+ },
143
+ hover: {
144
+ background: '#E5ECFD',
145
+ text: '#101010',
146
+ border: ' #E5ECFD',
147
+ boxShadow: 'none',
148
+ },
149
+ active: {
150
+ background: '#E5ECFD',
151
+ text: '#101010',
152
+ border: ' #E5ECFD',
153
+ boxShadow: 'none',
154
+ },
155
+ disabled: {
156
+ background: '#EBEBEB',
157
+ text: '#99989C',
158
+ border: ' #EBEBEB',
159
+ boxShadow: 'none',
160
+ },
161
+ },
162
+ error: {
163
+ // колір error
164
+ default: {
165
+ background: '#C93939',
166
+ text: '#FFFFFF',
167
+ border: ' #C93939',
168
+ boxShadow: 'none',
169
+ },
170
+ hover: {
171
+ background: '#C53939',
172
+ text: '#FFFFFF',
173
+ border: ' #C53939',
174
+ boxShadow: 'none',
175
+ },
176
+ active: {
177
+ background: '#C53939',
178
+ text: '#FFFFFF',
179
+ border: ' #C53939',
180
+ boxShadow: 'none',
181
+ },
182
+ disabled: {
183
+ background: '#FFCCCB',
184
+ text: '#FFFFFF',
185
+ border: ' #FFCCCB',
186
+ boxShadow: 'none',
187
+ },
188
+ },
189
+ },
190
+ outlined: {
191
+ default: {
192
+ // колір default
193
+ default: {
194
+ background: 'transparent',
195
+ text: '#101010',
196
+ border: ' #EBEBEB',
197
+ boxShadow: 'none',
198
+ },
199
+ hover: {
200
+ background: '#E5ECFD',
201
+ text: '#101010',
202
+ border: ' #EBEBEB',
203
+ boxShadow: 'none',
204
+ },
205
+ active: {
206
+ background: '#E5ECFD',
207
+ text: '#101010',
208
+ border: ' #EBEBEB',
209
+ boxShadow: 'none',
210
+ },
211
+ disabled: {
212
+ background: 'transparent',
213
+ text: '#99989C',
214
+ border: ' #EBEBEB',
215
+ boxShadow: 'none',
216
+ },
217
+ },
218
+ primary: {
219
+ // колір primary
220
+ default: {
221
+ background: 'transparent',
222
+ text: '#0042EC',
223
+ border: ' #0042EC',
224
+ boxShadow: 'none',
225
+ },
226
+ hover: {
227
+ background: '#E5ECFD',
228
+ text: '#0042EC',
229
+ border: ' #0042EC',
230
+ boxShadow: 'none',
231
+ },
232
+ active: {
233
+ background: '#E5ECFD',
234
+ text: '#0042EC',
235
+ border: ' #0042EC',
236
+ boxShadow: 'none',
237
+ },
238
+ disabled: {
239
+ background: 'transparent',
240
+ text: '#99989C',
241
+ border: ' #99989C',
242
+ boxShadow: 'none',
243
+ },
244
+ },
245
+ secondary: {
246
+ // колір secondary
247
+ default: {
248
+ background: 'transparent',
249
+ text: '#0042EC',
250
+ border: ' #EBEBEB',
251
+ boxShadow: 'none',
252
+ },
253
+ hover: {
254
+ background: '#E5ECFD',
255
+ text: '#0042EC',
256
+ border: ' #EBEBEB',
257
+ boxShadow: 'none',
258
+ },
259
+ active: {
260
+ background: '#E5ECFD',
261
+ text: '#0042EC',
262
+ border: ' #EBEBEB',
263
+ boxShadow: 'none',
264
+ },
265
+ disabled: {
266
+ background: 'transparent',
267
+ text: '#99989C',
268
+ border: ' #EBEBEB',
269
+ boxShadow: 'none',
270
+ },
271
+ },
272
+ error: {
273
+ // колір error
274
+ default: {
275
+ background: 'transparent',
276
+ text: '#C93939',
277
+ border: ' #C93939',
278
+ boxShadow: 'none',
279
+ },
280
+ hover: {
281
+ background: '#FCF5F5',
282
+ text: '#C93939',
283
+ border: ' #C93939',
284
+ boxShadow: 'none',
285
+ },
286
+ active: {
287
+ background: '#FCF5F5',
288
+ text: '#C93939',
289
+ border: ' #C93939',
290
+ boxShadow: 'none',
291
+ },
292
+ disabled: {
293
+ background: 'transparent',
294
+ text: '#99989C',
295
+ border: ' #99989C',
296
+ boxShadow: 'none',
297
+ },
298
+ },
299
+ },
300
+ empty: {
301
+ default: {
302
+ // колір default
303
+ default: {
304
+ background: 'transparent',
305
+ text: '#101010',
306
+ border: 'transparent',
307
+ boxShadow: 'none',
308
+ },
309
+ hover: {
310
+ background: 'transparent',
311
+ text: '#80A0F5',
312
+ border: 'transparent',
313
+ boxShadow: 'none',
314
+ },
315
+ active: {
316
+ background: 'transparent',
317
+ text: '#80A0F5',
318
+ border: 'transparent',
319
+ boxShadow: 'none',
320
+ },
321
+ disabled: {
322
+ background: 'transparent',
323
+ text: '#99989C',
324
+ border: 'transparent',
325
+ boxShadow: 'none',
326
+ },
327
+ },
328
+ primary: {
329
+ // колір primary
330
+ default: {
331
+ background: 'transparent',
332
+ text: '#0042EC',
333
+ border: 'transparent',
334
+ boxShadow: 'none',
335
+ },
336
+ hover: {
337
+ background: 'transparent',
338
+ text: '#80A0F5',
339
+ border: 'transparent',
340
+ boxShadow: 'none',
341
+ },
342
+ active: {
343
+ background: 'transparent',
344
+ text: '#80A0F5',
345
+ border: 'transparent',
346
+ boxShadow: 'none',
347
+ },
348
+ disabled: {
349
+ background: 'transparent',
350
+ text: '#99989C',
351
+ border: 'transparent',
352
+ boxShadow: 'none',
353
+ },
354
+ },
355
+ //default as secondary
356
+ secondary: {
357
+ // колір default
358
+ default: {
359
+ background: 'transparent',
360
+ text: '#101010',
361
+ border: 'transparent',
362
+ boxShadow: 'none',
363
+ },
364
+ hover: {
365
+ background: 'rgba(0, 0, 0, 0.05)',
366
+ text: '#101010',
367
+ border: 'transparent',
368
+ boxShadow: 'none',
369
+ },
370
+ active: {
371
+ background: 'rgba(0, 0, 0, 0.1)',
372
+ text: '#101010',
373
+ border: 'transparent',
374
+ boxShadow: 'none',
375
+ },
376
+ disabled: {
377
+ background: 'transparent',
378
+ text: '#99989C',
379
+ border: 'transparent',
380
+ boxShadow: 'none',
381
+ },
382
+ },
383
+ error: {
384
+ // колір error
385
+ default: {
386
+ background: 'transparent',
387
+ text: '#C93939',
388
+ border: 'transparent',
389
+ boxShadow: 'none',
390
+ },
391
+ hover: {
392
+ background: 'transparent',
393
+ text: '#FCF5F5',
394
+ border: 'transparent',
395
+ boxShadow: 'none',
396
+ },
397
+ active: {
398
+ background: 'transparent',
399
+ text: '#FCF5F5',
400
+ border: 'transparent',
401
+ boxShadow: 'none',
402
+ },
403
+ disabled: {
404
+ background: 'transparent',
405
+ text: '#99989C',
406
+ border: 'transparent',
407
+ boxShadow: 'none',
408
+ },
409
+ },
410
+ },
411
+ // Розміри кнопок
412
+ sizes: {
413
+ small: {
414
+ fontSize: 14,
415
+ iconSize: 16,
416
+ paddingInline: 10,
417
+ paddingBlock: 10,
418
+ borderRadius: 5,
419
+ borderWidth: 1,
420
+ gap: 10,
421
+ },
422
+ medium: {
423
+ fontSize: 16,
424
+ iconSize: 16,
425
+ paddingInline: 10,
426
+ paddingBlock: 10,
427
+ borderRadius: 5,
428
+ borderWidth: 1,
429
+ gap: 10,
430
+ },
113
431
  },
432
+ },
433
+
434
+ // Компонент Sidebar
435
+ sidebar: {
436
+ background: '#FFFFFF',
437
+ width: 224,
438
+ collapsedWidth: 65,
114
439
  text: {
115
- main: '#ffffff',
116
- light: '#CDCDCD',
117
- lighter: '#959595',
118
- invert: '#101010',
440
+ default: '#101010',
441
+ active: '#0042EC',
442
+ hover: '#535353',
119
443
  },
120
- stroke: {
121
- main: '#DEDEDE',
122
- light: '#E8E8E8',
123
- lighter: '#F3F3F3',
444
+ item: {
445
+ default: {
446
+ background: 'transparent',
447
+ border: 'transparent',
448
+ padding: '10px 16px',
449
+ height: 40,
450
+ },
451
+ active: {
452
+ background: '#F3F7FF',
453
+ borderLeft: '2px solid #0042EC',
454
+ padding: '10px 16px',
455
+ height: 40,
456
+ },
457
+ hover: {
458
+ background: '#F3F3F3',
459
+ border: 'transparent',
460
+ padding: '10px 16px',
461
+ height: 40,
462
+ },
463
+ },
464
+ section: {
465
+ background: 'transparent',
466
+ padding: '16px 16px 8px',
467
+ title: {
468
+ color: '#99989C',
469
+ fontSize: '12px',
470
+ fontWeight: 600,
471
+ },
124
472
  },
125
- disable: '#474747',
126
- chart: {
127
- changelog: ['#93E7A2', '#E8E8E8', '#219846', '#216825', '#27E334'],
473
+ delimeter: {
474
+ color: '#EBEBEB',
475
+ thickness: 1,
476
+ margin: '8px 0',
128
477
  },
129
478
  },
130
- typography,
131
479
  };
132
480
 
133
- export { lightTheme, darkTheme };
481
+ // Конвертуємо всі розміри з px в rem
482
+ export const lightTheme = convertPaletteToRem(lightThemePx) as DefaultTheme;
483
+ export const darkTheme = convertPaletteToRem(lightThemePx) as DefaultTheme;