@cyber-harbour/ui 1.0.48 → 1.0.50

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": "@cyber-harbour/ui",
3
- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,81 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { FabricComponent, createComponent, generatePropertySpaceStyle } from '../../Theme';
4
+ import { AlertIcon } from '../IconComponents';
5
+
6
+ type AlertProps = FabricComponent<{
7
+ title?: any;
8
+ note?: any;
9
+ }> &
10
+ Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
11
+
12
+ export const Alert = ({ title, note, ...props }: AlertProps) => {
13
+ return (
14
+ <StyledContainer {...props}>
15
+ <IconWrapper>
16
+ <AlertIcon />
17
+ </IconWrapper>
18
+ <div>
19
+ {!!title && <Title>{title}</Title>}
20
+ {!!note && <Note>{note}</Note>}
21
+ </div>
22
+ </StyledContainer>
23
+ );
24
+ };
25
+
26
+ const IconWrapper = styled.div(
27
+ ({ theme: { alert } }) => `
28
+ flex-shrink: 0;
29
+ color: ${alert.color.icon};
30
+ padding-top: ${alert.icon.paddingTop};
31
+ svg {
32
+ width: ${alert.icon.width};
33
+ height: ${alert.icon.height};
34
+ display: block;
35
+ }
36
+ `
37
+ );
38
+
39
+ const Title = styled.h3(
40
+ ({ theme: { alert } }) => `
41
+ margin: 0;
42
+ padding: 0;
43
+ font-size: ${alert.fontSize};
44
+ line-height: 1.2;
45
+ font-weight: 700;
46
+ color: ${alert.color.text};
47
+ &:not(:last-child) {
48
+ margin-bottom: 8px;
49
+ }
50
+ `
51
+ );
52
+ const Note = styled.p(
53
+ ({ theme: { alert } }) => `
54
+ margin: 0;
55
+ padding: 0;
56
+ word-break: break-word;
57
+ font-size: ${alert.fontSize};
58
+ color: ${alert.color.text};
59
+ line-height: 1.5;
60
+ `
61
+ );
62
+
63
+ const StyledContainer = createComponent(
64
+ styled.div<FabricComponent>(
65
+ ({ theme, py = theme.alert.paddingBlock, pl = theme.alert.paddingLeft, pr = theme.alert.paddingRight }) => {
66
+ return `
67
+ display: flex;
68
+ align-items: flex-start;
69
+ justify-content: flex-start;
70
+ flex-wrap: nowrap;
71
+ gap: ${theme.alert.gap};
72
+ background-color: ${theme.alert.color.background};
73
+ border-radius: ${theme.alert.borderRadius};
74
+ ${generatePropertySpaceStyle(theme, 'padding-block', py)};
75
+ ${generatePropertySpaceStyle(theme, 'padding-right', pr)};
76
+ ${generatePropertySpaceStyle(theme, 'padding-left', pl)};
77
+ `;
78
+ }
79
+ ),
80
+ { ignoreStyles: ['padding-block', 'padding-right', 'padding-left'] }
81
+ );
@@ -0,0 +1 @@
1
+ export * from './Alert';
@@ -1,4 +1,4 @@
1
- import { createComponent, FabricComponent } from '../../Theme';
1
+ import { createComponent, FabricComponent, generatePropertySpaceStyle } from '../../Theme';
2
2
  import { styled } from 'styled-components';
3
3
 
4
4
  type BoxProps = FabricComponent<
@@ -11,13 +11,19 @@ export const Box = ({ children, ...props }: BoxProps) => {
11
11
  return <StyledBox {...props}>{children}</StyledBox>;
12
12
  };
13
13
 
14
- const StyledBox = styled(createComponent('div'))(
15
- ({ theme }) => `
16
- padding: ${theme.box.padding};
14
+ const StyledBox = createComponent(
15
+ styled('div')<FabricComponent>(
16
+ ({ theme, px = theme.box.padding, py = theme.box.padding }) => `
17
+ ${generatePropertySpaceStyle(theme, 'padding-inline', px)}
18
+ ${generatePropertySpaceStyle(theme, 'padding-block', py)}
17
19
  border-radius: ${theme.box.borderRadius};
18
20
  background-color: ${theme.box.background};
19
21
  border-width: ${theme.box.border.width};
20
22
  border-style: ${theme.box.border.style};
21
23
  border-color: ${theme.box.border.color};
22
24
  `
25
+ ),
26
+ {
27
+ ignoreStyles: ['padding-inline', 'padding-block'],
28
+ }
23
29
  );
@@ -9,6 +9,7 @@ import {
9
9
  ButtonElementStyle,
10
10
  createComponent,
11
11
  FabricComponent,
12
+ generatePropertySpaceStyle,
12
13
  } from '../../Theme';
13
14
 
14
15
  type BaseButtonProps = FabricComponent<{
@@ -59,7 +60,7 @@ const StyledIconWrapper = styled.span`
59
60
  justify-content: center;
60
61
  `;
61
62
 
62
- const StyledButton = styled(createComponent('button'))<{
63
+ type StyledButtonProps = {
63
64
  $variant: ButtonVariant;
64
65
  $color: ButtonColor;
65
66
  $size: ButtonSize;
@@ -67,21 +68,28 @@ const StyledButton = styled(createComponent('button'))<{
67
68
  $fullWidth: boolean;
68
69
  $iconPosition: 'left' | 'right';
69
70
  $iconVariant: 'filled' | 'empty';
70
- }>`
71
- ${({ $variant, $color, $size, $disabled, $fullWidth, $iconPosition, $iconVariant, theme, ...props }) => {
71
+ };
72
+
73
+ const Btn = styled.button<FabricComponent<StyledButtonProps>>(
74
+ ({
75
+ $variant,
76
+ $color,
77
+ $size,
78
+ $disabled,
79
+ $fullWidth,
80
+ $iconPosition,
81
+ $iconVariant,
82
+ theme,
83
+ px = $variant !== 'empty' ? theme.button.sizes[$size].paddingInline : 0,
84
+ py = $variant !== 'empty' ? theme.button.sizes[$size].paddingBlock : 0,
85
+ }) => {
72
86
  const sizes = getButtonSizeStyles(theme, $size);
73
87
  return `
74
88
  ${getCss(getButtonStyles(theme, $variant, $color, 'default'))}
75
89
  font-size: ${sizes.fontSize};
76
90
  gap: ${sizes.gap};
77
- ${
78
- $variant !== 'empty'
79
- ? `
80
- ${!props.py ? `padding-block: ${sizes.paddingBlock};` : ''}
81
- ${!props.px ? `padding-inline: ${sizes.paddingInline};` : ''}
82
- `
83
- : ''
84
- }
91
+ ${generatePropertySpaceStyle(theme, 'padding-block', py)};
92
+ ${generatePropertySpaceStyle(theme, 'padding-inline', px)};
85
93
  border-radius: ${sizes.borderRadius};
86
94
  border-width: ${sizes.borderWidth};
87
95
  border-style: solid;
@@ -147,8 +155,9 @@ const StyledButton = styled(createComponent('button'))<{
147
155
  : ``
148
156
  }
149
157
  `;
150
- }}
151
- `;
158
+ }
159
+ );
160
+ const StyledButton = createComponent(Btn);
152
161
 
153
162
  export const Button = ({
154
163
  children,
@@ -1,4 +1,5 @@
1
1
  import { CSSProperties, forwardRef } from 'react';
2
+ import { createComponent, FabricComponent } from '../../Theme';
2
3
  import styled from 'styled-components';
3
4
 
4
5
  export type FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
@@ -7,7 +8,7 @@ export type FlexJustify = 'flex-start' | 'flex-end' | 'center' | 'space-between'
7
8
  export type FlexAlign = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
8
9
  export type FlexGap = string | number;
9
10
 
10
- export interface FlexContainerProps {
11
+ export interface FlexContainerProps extends FabricComponent<Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>> {
11
12
  children: any;
12
13
  direction?: FlexDirection;
13
14
  wrap?: FlexWrap;
@@ -36,6 +37,7 @@ export const FlexContainer: any = forwardRef<HTMLElement, FlexContainerProps>(fu
36
37
  className,
37
38
  style,
38
39
  as = 'div',
40
+ ...props
39
41
  },
40
42
  ref
41
43
  ) {
@@ -53,6 +55,7 @@ export const FlexContainer: any = forwardRef<HTMLElement, FlexContainerProps>(fu
53
55
  className={className}
54
56
  style={style}
55
57
  ref={ref}
58
+ {...props}
56
59
  >
57
60
  {children}
58
61
  </StyledFlexContainer>
@@ -70,7 +73,7 @@ interface StyledFlexContainerProps {
70
73
  $columnGap?: FlexGap;
71
74
  }
72
75
 
73
- const StyledFlexContainer = styled.div<StyledFlexContainerProps>`
76
+ const StyledContainer = styled.div<StyledFlexContainerProps>`
74
77
  ${({ $direction, $wrap, $justify, $align, $alignContent, $gap, $rowGap, $columnGap }) => `
75
78
  display: flex;
76
79
  width: 100%;
@@ -85,3 +88,5 @@ const StyledFlexContainer = styled.div<StyledFlexContainerProps>`
85
88
  ${$columnGap !== undefined ? `column-gap: ${typeof $columnGap === 'number' ? `${$columnGap}px` : $columnGap};` : ''}
86
89
  `}
87
90
  `;
91
+
92
+ const StyledFlexContainer = createComponent(StyledContainer);
@@ -6,7 +6,7 @@ interface AlertIconProps extends SVGProps<SVGSVGElement> {
6
6
 
7
7
  export const AlertIcon = ({ fill = 'currentColor', ...props }: AlertIconProps) => {
8
8
  return (
9
- <svg width="17" height="15" viewBox="0 0 17 15" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
9
+ <svg viewBox="0 0 17 15" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
10
10
  <path
11
11
  fillRule="evenodd"
12
12
  clipRule="evenodd"
@@ -15,10 +15,12 @@ interface StyledLineProps {
15
15
  $direction: 'horizontal' | 'vertical';
16
16
  }
17
17
 
18
- const StyledLine = styled(createComponent('div'))<StyledLineProps>(
19
- ({ theme, $direction }) => `
18
+ const StyledLine = createComponent(
19
+ styled.div<StyledLineProps>(
20
+ ({ theme, $direction }) => `
20
21
  width: ${$direction === 'horizontal' ? '100%' : theme.line.size};
21
22
  height: ${$direction === 'vertical' ? '100%' : theme.line.size};
22
23
  background-color: ${theme.line.color};
23
24
  `
25
+ )
24
26
  );
@@ -1,6 +1,13 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
- import { FabricComponent, createComponent, TagVariant, TagColor, hexToRgba } from '../../Theme';
3
+ import {
4
+ FabricComponent,
5
+ createComponent,
6
+ TagVariant,
7
+ TagColor,
8
+ hexToRgba,
9
+ generatePropertySpaceStyle,
10
+ } from '../../Theme';
4
11
  import { CrossIcon } from '../IconComponents';
5
12
 
6
13
  type TagProps = FabricComponent<{
@@ -81,7 +88,7 @@ const DeleteButton = styled.button`
81
88
  }
82
89
  `;
83
90
 
84
- const StyledContainer = styled(createComponent<StyledProps>('div'))(
91
+ const Container = styled.div<FabricComponent<StyledProps>>(
85
92
  ({
86
93
  theme,
87
94
  $variant,
@@ -95,8 +102,6 @@ const StyledContainer = styled(createComponent<StyledProps>('div'))(
95
102
  display: inline-flex;
96
103
  align-items: center;
97
104
  justify-content: center;
98
- padding-block: 0;
99
- padding-inline: 0;
100
105
  min-width: 0;
101
106
  border-width: ${theme.tag[$variant].borderWidth};
102
107
  border-style: solid;
@@ -106,8 +111,8 @@ const StyledContainer = styled(createComponent<StyledProps>('div'))(
106
111
  color: ${color};
107
112
 
108
113
  ${Content} {
109
- padding-block: ${py};
110
- padding-inline: ${px};
114
+ ${generatePropertySpaceStyle(theme, 'padding-block', py)};
115
+ ${generatePropertySpaceStyle(theme, 'padding-inline', px)};
111
116
  color: ${color};
112
117
  ${
113
118
  $clickable
@@ -122,8 +127,9 @@ const StyledContainer = styled(createComponent<StyledProps>('div'))(
122
127
  }
123
128
  }
124
129
  ${DeleteButton} {
125
- padding-right: ${px};
126
- padding-block: ${py};
130
+ ${generatePropertySpaceStyle(theme, 'padding-block', py)};
131
+ ${generatePropertySpaceStyle(theme, 'padding-right', px)};
132
+
127
133
  &:hover {
128
134
  color: ${hexToRgba(color, 0.7)};
129
135
  }
@@ -131,3 +137,7 @@ const StyledContainer = styled(createComponent<StyledProps>('div'))(
131
137
  `;
132
138
  }
133
139
  );
140
+
141
+ const StyledContainer = createComponent(Container, {
142
+ ignoreStyles: ['padding-block', 'padding-inline'],
143
+ });
@@ -13,26 +13,31 @@ type TypographyProps = FabricComponent<{
13
13
  color?: ColorVariant | string;
14
14
  className?: string;
15
15
  ellipsis?: boolean;
16
- }>;
16
+ }> &
17
+ Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
17
18
 
18
- // Create a styled component that can be dynamically rendered as different HTML elements
19
- const StyledTypography = styled(createComponent('div'))<{
19
+ type StyledProps = {
20
20
  $variant: TypographyVariant;
21
21
  $weight?: CSSProperties['fontWeight'];
22
22
  $style?: CSSProperties['fontStyle'];
23
23
  $color?: ColorVariant | string;
24
24
  $ellipsis?: boolean;
25
- }>(({ theme, $variant, $color, $weight = '400', $style = 'initial', $ellipsis }) => {
26
- // Resolve color from theme if it's a theme color path, or use the direct color value
25
+ };
26
+
27
+ // Create a styled component that can be dynamically rendered as different HTML elements
28
+ const StyledTypography = createComponent(
29
+ styled('div')<StyledProps>(({ theme, $variant, $color, $weight = '400', $style = 'initial', $ellipsis }) => {
30
+ // Resolve color from theme if it's a theme color path, or use the direct color value
27
31
 
28
- return `
32
+ return `
29
33
  font-size: ${theme.typography.variants[$variant].fontSize};
30
34
  font-weight: ${$weight};
31
35
  font-style: ${$style};
32
36
  color: ${resolveThemeColor(theme, $color) || theme.colors.text.main};
33
37
  ${$ellipsis ? 'overflow: hidden; text-overflow: ellipsis; white-space: nowrap;' : ''}
34
38
  `;
35
- });
39
+ })
40
+ );
36
41
 
37
42
  export const Typography = ({
38
43
  variant = 'body',
package/src/Core/index.ts CHANGED
@@ -15,3 +15,4 @@ export * from './Box';
15
15
  export * from './Line';
16
16
  export * from './EmptyData';
17
17
  export * from './Tag';
18
+ export * from './Alert';
@@ -1,4 +1,4 @@
1
- import { createComponent, FabricComponent, pxToRem } from '../../Theme';
1
+ import { createComponent, FabricComponent, generatePropertySpaceStyle, pxToRem } from '../../Theme';
2
2
  import { styled } from 'styled-components';
3
3
 
4
4
  type ContainerProps = FabricComponent<{
@@ -14,11 +14,14 @@ export const Container = ({ maxWidth, ...props }: ContainerProps) => {
14
14
  return <StyledContainer {...props} $maxWidth={maxWidth} />;
15
15
  };
16
16
 
17
- const StyledContainer = styled(createComponent<StyledContainerProps>('div'))(({ theme, $maxWidth }) => {
18
- return `
19
- padding-inline: ${pxToRem(20, theme.baseSize)};
17
+ const StyledContainer = createComponent(
18
+ styled.div<FabricComponent<StyledContainerProps>>(({ theme, $maxWidth, px = 20 }) => {
19
+ return `
20
+ ${generatePropertySpaceStyle(theme, 'padding-inline', px)}
20
21
  width: 100%;
21
22
  min-width: 0;
22
23
  max-width: ${typeof $maxWidth === 'number' ? pxToRem($maxWidth, theme.baseSize) : $maxWidth || '100%'};
23
24
  `;
24
- });
25
+ }),
26
+ { ignoreStyles: ['padding-inline'] }
27
+ );
@@ -1,4 +1,5 @@
1
- import styled, { css, WebTarget } from 'styled-components';
1
+ import styled, { css, IStyledComponent, DefaultTheme, WebTarget } from 'styled-components';
2
+ import { pxToRem } from './utils';
2
3
 
3
4
  type MarginProps = {
4
5
  m?: string | number; // margin
@@ -19,52 +20,74 @@ type MarginProps = {
19
20
 
20
21
  export type FabricComponent<T = object> = T & MarginProps;
21
22
 
22
- const marginStyles = css<FabricComponent>((props) => {
23
- return `
24
- ${props.m ? `margin: ${typeof props.m === 'number' ? `${props.m}px` : props.m};` : ''}
25
- ${props.mt ? `margin-top: ${typeof props.mt === 'number' ? `${props.mt}px` : props.mt};` : ''}
26
- ${props.mr ? `margin-right: ${typeof props.mr === 'number' ? `${props.mr}px` : props.mr};` : ''}
27
- ${props.mb ? `margin-bottom: ${typeof props.mb === 'number' ? `${props.mb}px` : props.mb};` : ''}
28
- ${props.ml ? `margin-left: ${typeof props.ml === 'number' ? `${props.ml}px` : props.ml};` : ''}
29
- ${
30
- props.mx
31
- ? `margin-left: ${typeof props.mx === 'number' ? `${props.mx}px` : props.mx}; margin-right: ${
32
- typeof props.mx === 'number' ? `${props.mx}px` : props.mx
33
- };`
34
- : ''
35
- }
36
- ${
37
- props.my
38
- ? `margin-top: ${typeof props.my === 'number' ? `${props.my}px` : props.my}; margin-bottom: ${
39
- typeof props.my === 'number' ? `${props.my}px` : props.my
40
- };`
41
- : ''
42
- }
43
- ${props.p ? `padding: ${typeof props.p === 'number' ? `${props.p}px` : props.p};` : ''}
44
- ${props.pt ? `padding-top: ${typeof props.pt === 'number' ? `${props.pt}px` : props.pt};` : ''}
45
- ${props.pr ? `padding-right: ${typeof props.pr === 'number' ? `${props.pr}px` : props.pr};` : ''}
46
- ${props.pb ? `padding-bottom: ${typeof props.pb === 'number' ? `${props.pb}px` : props.pb};` : ''}
47
- ${props.pl ? `padding-left: ${typeof props.pl === 'number' ? `${props.pl}px` : props.pl};` : ''}
48
- ${
49
- props.px
50
- ? `padding-left: ${typeof props.px === 'number' ? `${props.px}px` : props.px}; padding-right: ${
51
- typeof props.px === 'number' ? `${props.px}px` : props.px
52
- };`
53
- : ''
54
- }
55
- ${
56
- props.py
57
- ? `padding-top: ${typeof props.py === 'number' ? `${props.py}px` : props.py}; padding-bottom: ${
58
- typeof props.py === 'number' ? `${props.py}px` : props.py
59
- };`
60
- : ''
61
- }
23
+ const marginStyles = ({ ignoreStyles }: FabricComponentOptions = {}) =>
24
+ css<FabricComponent>(({ theme, ...props }) => {
25
+ return `
26
+ ${generatePropertySpaceStyle(theme, 'margin', props.m, ignoreStyles)}
27
+ ${generatePropertySpaceStyle(theme, 'margin-top', props.mt, ignoreStyles)}
28
+ ${generatePropertySpaceStyle(theme, 'margin-right', props.mr, ignoreStyles)}
29
+ ${generatePropertySpaceStyle(theme, 'margin-bottom', props.mb, ignoreStyles)}
30
+ ${generatePropertySpaceStyle(theme, 'margin-left', props.ml, ignoreStyles)}
31
+ ${generatePropertySpaceStyle(theme, 'margin-inline', props.mx, ignoreStyles)}
32
+ ${generatePropertySpaceStyle(theme, 'margin-block', props.my, ignoreStyles)}
33
+ `;
34
+ });
62
35
 
36
+ const paddingStyles = ({ ignoreStyles }: FabricComponentOptions = {}) =>
37
+ css<FabricComponent>(({ theme, ...props }) => {
38
+ return `
39
+ ${generatePropertySpaceStyle(theme, 'padding', props.p, ignoreStyles)}
40
+ ${generatePropertySpaceStyle(theme, 'padding-top', props.pt, ignoreStyles)}
41
+ ${generatePropertySpaceStyle(theme, 'padding-right', props.pr, ignoreStyles)}
42
+ ${generatePropertySpaceStyle(theme, 'padding-bottom', props.pb, ignoreStyles)}
43
+ ${generatePropertySpaceStyle(theme, 'padding-left', props.pl, ignoreStyles)}
44
+ ${generatePropertySpaceStyle(theme, 'padding-inline', props.px, ignoreStyles)}
45
+ ${generatePropertySpaceStyle(theme, 'padding-block', props.py, ignoreStyles)}
63
46
  `;
64
- });
47
+ });
48
+
49
+ type GeneratedFabricMarginProperties =
50
+ | 'margin'
51
+ | 'margin-top'
52
+ | 'margin-right'
53
+ | 'margin-bottom'
54
+ | 'margin-left'
55
+ | 'margin-inline'
56
+ | 'margin-block'
57
+ | 'padding'
58
+ | 'padding-top'
59
+ | 'padding-right'
60
+ | 'padding-bottom'
61
+ | 'padding-left'
62
+ | 'padding-inline'
63
+ | 'padding-block';
64
+
65
+ export const generatePropertySpaceStyle = (
66
+ theme: DefaultTheme,
67
+ property: GeneratedFabricMarginProperties,
68
+ value?: string | number,
69
+ ignoredOptions?: GeneratedFabricMarginProperties[]
70
+ ) => {
71
+ if (ignoredOptions && ignoredOptions.includes(property)) {
72
+ return '';
73
+ }
74
+ if (value !== undefined) {
75
+ const t = typeof value === 'number';
76
+ return `${property}: ${typeof value === 'number' ? `${pxToRem(value, theme.baseSize)}` : value};`;
77
+ }
78
+ return '';
79
+ };
80
+
81
+ type FabricComponentOptions = {
82
+ ignoreStyles?: GeneratedFabricMarginProperties[] | undefined; // Ignore margin styles
83
+ };
65
84
 
66
- export const createComponent = <T = object>(element: WebTarget) => {
67
- return styled(element)<FabricComponent<T>>`
68
- ${marginStyles};
85
+ export const createComponent = <T extends object = {}>(
86
+ component: React.ComponentType<T>,
87
+ options?: FabricComponentOptions
88
+ ) => {
89
+ return styled(component)<T & FabricComponent>`
90
+ ${marginStyles(options)}
91
+ ${paddingStyles(options)}
69
92
  `;
70
93
  };
@@ -719,6 +719,8 @@ export const darkThemePx: Theme = {
719
719
  success: '#38A473',
720
720
  warning: '#DEB839',
721
721
  disabled: '#ebebeb',
722
+ text: '#FFFFFF',
723
+ orange: '#d3741b',
722
724
  },
723
725
  },
724
726
  fill: {
@@ -733,9 +735,29 @@ export const darkThemePx: Theme = {
733
735
  success: '#38A473',
734
736
  warning: '#DEB839',
735
737
  disabled: '#ebebeb',
738
+ text: '#FFFFFF',
739
+ orange: '#d3741b',
736
740
  },
737
741
  },
738
742
  },
743
+ alert: {
744
+ paddingBlock: 16,
745
+ paddingLeft: 16,
746
+ paddingRight: 44,
747
+ borderRadius: 5,
748
+ fontSize: 14,
749
+ gap: 12,
750
+ icon: {
751
+ width: 16,
752
+ height: 14,
753
+ paddingTop: 2,
754
+ },
755
+ color: {
756
+ icon: '#FDC700',
757
+ text: '#894B00',
758
+ background: '#FFFBE0',
759
+ },
760
+ },
739
761
  };
740
762
 
741
763
  export const darkTheme = convertPaletteToRem(darkThemePx, darkThemePx.baseSize) as DefaultTheme;
@@ -718,6 +718,8 @@ export const lightThemePx: Theme = {
718
718
  success: '#38A473',
719
719
  warning: '#DEB839',
720
720
  disabled: '#ebebeb',
721
+ text: '#101010',
722
+ orange: '#d3741b',
721
723
  },
722
724
  },
723
725
  fill: {
@@ -732,9 +734,29 @@ export const lightThemePx: Theme = {
732
734
  success: '#38A473',
733
735
  warning: '#DEB839',
734
736
  disabled: '#ebebeb',
737
+ text: '#101010',
738
+ orange: '#d3741b',
735
739
  },
736
740
  },
737
741
  },
742
+ alert: {
743
+ paddingBlock: 16,
744
+ paddingLeft: 16,
745
+ paddingRight: 44,
746
+ borderRadius: 5,
747
+ fontSize: 14,
748
+ gap: 12,
749
+ icon: {
750
+ width: 16,
751
+ height: 14,
752
+ paddingTop: 2,
753
+ },
754
+ color: {
755
+ icon: '#FDC700',
756
+ text: '#894B00',
757
+ background: '#FFFBE0',
758
+ },
759
+ },
738
760
  };
739
761
 
740
762
  export const lightTheme = convertPaletteToRem(lightThemePx, lightThemePx.baseSize) as DefaultTheme;
@@ -11,7 +11,16 @@ export type InputState = 'default' | 'focus' | 'error' | 'disabled';
11
11
  export type InputSize = 'empty' | 'small' | 'medium';
12
12
 
13
13
  export type TagVariant = 'fill' | 'outlined';
14
- export type TagColor = 'default' | 'primary' | 'error' | 'warning' | 'success' | 'disabled' | string;
14
+ export type TagColor =
15
+ | 'default'
16
+ | 'primary'
17
+ | 'error'
18
+ | 'warning'
19
+ | 'success'
20
+ | 'disabled'
21
+ | 'text'
22
+ | 'orange'
23
+ | string;
15
24
 
16
25
  // Типи для spacing та breakpoints
17
26
  export type Breakpoint = 'xs' | 's' | 'm' | 'l' | 'xl';
@@ -247,6 +256,24 @@ export type Theme = {
247
256
  background: string;
248
257
  };
249
258
  tag: Record<TagVariant, TagElementStyle>;
259
+ alert: {
260
+ paddingBlock: number | string;
261
+ paddingLeft: number | string;
262
+ paddingRight: number | string;
263
+ borderRadius: number | string;
264
+ fontSize: number | string;
265
+ gap: number | string;
266
+ icon: {
267
+ width: number | string;
268
+ height: number | string;
269
+ paddingTop: number | string;
270
+ };
271
+ color: {
272
+ icon: string;
273
+ text: string;
274
+ background: string;
275
+ };
276
+ };
250
277
  };
251
278
 
252
279
  //TODO check and refactoring