@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.
- package/dist/index.d.mts +59 -4
- package/dist/index.d.ts +59 -4
- package/dist/index.js +236 -149
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +197 -110
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Core/Alert/Alert.tsx +81 -0
- package/src/Core/Alert/index.ts +1 -0
- package/src/Core/Box/Box.tsx +10 -4
- package/src/Core/Button/Button.tsx +22 -13
- package/src/Core/Flex/FlexContainer.tsx +5 -2
- package/src/Core/IconComponents/AlertIcon.tsx +1 -1
- package/src/Core/Line/Line.tsx +4 -2
- package/src/Core/Tag/Tag.tsx +143 -0
- package/src/Core/Tag/index.ts +1 -0
- package/src/Core/Typography/Typography.tsx +12 -7
- package/src/Core/index.ts +2 -0
- package/src/Layouts/Container/Container.tsx +8 -5
- package/src/Theme/componentFabric.ts +68 -45
- package/src/Theme/themes/dark.ts +48 -0
- package/src/Theme/themes/light.ts +48 -0
- package/src/Theme/types.ts +30 -0
- package/src/Theme/utils.ts +14 -0
|
@@ -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;
|
package/src/Theme/types.ts
CHANGED
|
@@ -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
|
package/src/Theme/utils.ts
CHANGED
|
@@ -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
|
+
};
|