@cyber-harbour/ui 1.0.47 → 1.0.49

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.
@@ -705,6 +705,54 @@ export const lightThemePx: Theme = {
705
705
  foreground: '#E2E2E2E2',
706
706
  background: '#F3F3F3',
707
707
  },
708
+ tag: {
709
+ outlined: {
710
+ borderRadius: 50,
711
+ paddingBlock: 5,
712
+ paddingInline: 10,
713
+ borderWidth: 1,
714
+ color: {
715
+ default: '#535353',
716
+ primary: '#0042EC',
717
+ error: '#D82323',
718
+ success: '#38A473',
719
+ warning: '#DEB839',
720
+ disabled: '#ebebeb',
721
+ },
722
+ },
723
+ fill: {
724
+ borderRadius: 4,
725
+ paddingBlock: 5,
726
+ paddingInline: 10,
727
+ borderWidth: 0,
728
+ color: {
729
+ default: '#535353',
730
+ primary: '#0042EC',
731
+ error: '#D82323',
732
+ success: '#38A473',
733
+ warning: '#DEB839',
734
+ disabled: '#ebebeb',
735
+ },
736
+ },
737
+ },
738
+ alert: {
739
+ paddingBlock: 16,
740
+ paddingLeft: 16,
741
+ paddingRight: 44,
742
+ borderRadius: 5,
743
+ fontSize: 14,
744
+ gap: 12,
745
+ icon: {
746
+ width: 16,
747
+ height: 14,
748
+ paddingTop: 2,
749
+ },
750
+ color: {
751
+ icon: '#FDC700',
752
+ text: '#894B00',
753
+ background: '#FFFBE0',
754
+ },
755
+ },
708
756
  };
709
757
 
710
758
  export const lightTheme = convertPaletteToRem(lightThemePx, lightThemePx.baseSize) as DefaultTheme;
@@ -10,6 +10,9 @@ export type InputVariant = 'outlined' | 'empty';
10
10
  export type InputState = 'default' | 'focus' | 'error' | 'disabled';
11
11
  export type InputSize = 'empty' | 'small' | 'medium';
12
12
 
13
+ export type TagVariant = 'fill' | 'outlined';
14
+ export type TagColor = 'default' | 'primary' | 'error' | 'warning' | 'success' | 'disabled' | string;
15
+
13
16
  // Типи для spacing та breakpoints
14
17
  export type Breakpoint = 'xs' | 's' | 'm' | 'l' | 'xl';
15
18
 
@@ -57,6 +60,14 @@ export type InputSizeStyle = {
57
60
  lineHeight: number;
58
61
  };
59
62
 
63
+ export type TagElementStyle = {
64
+ paddingInline: number | string;
65
+ paddingBlock: number | string;
66
+ borderRadius: number | string;
67
+ borderWidth: number | string;
68
+ color: Record<TagColor, string>;
69
+ };
70
+
60
71
  // Тип для палітри
61
72
  export type Theme = {
62
73
  mode: 'light' | 'dark';
@@ -235,6 +246,25 @@ export type Theme = {
235
246
  foreground: string;
236
247
  background: string;
237
248
  };
249
+ tag: Record<TagVariant, TagElementStyle>;
250
+ alert: {
251
+ paddingBlock: number | string;
252
+ paddingLeft: number | string;
253
+ paddingRight: number | string;
254
+ borderRadius: number | string;
255
+ fontSize: number | string;
256
+ gap: number | string;
257
+ icon: {
258
+ width: number | string;
259
+ height: number | string;
260
+ paddingTop: number | string;
261
+ };
262
+ color: {
263
+ icon: string;
264
+ text: string;
265
+ background: string;
266
+ };
267
+ };
238
268
  };
239
269
 
240
270
  //TODO check and refactoring
@@ -173,3 +173,17 @@ export const getTypographyStyles = (theme: DefaultTheme, variant: string = 'body
173
173
  export const getBreakpoint = (theme: DefaultTheme, size: Breakpoint = 'm') => {
174
174
  return `@media (min-width: ${theme.breakpoints[size]}px)`;
175
175
  };
176
+
177
+ /**
178
+ * Функція для отримання rgba кольору з hex формату
179
+ */
180
+ export const hexToRgba = (hex: string, alpha: number): string => {
181
+ try {
182
+ const r = parseInt(hex.slice(1, 3), 16);
183
+ const g = parseInt(hex.slice(3, 5), 16);
184
+ const b = parseInt(hex.slice(5, 7), 16);
185
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
186
+ } catch {
187
+ return hex;
188
+ }
189
+ };