@cyber-harbour/ui 1.0.60 → 1.0.61

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.60",
3
+ "version": "1.0.61",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +1,12 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
- import { FabricComponent, createComponent, generatePropertySpaceStyle } from '../../Theme';
3
+ import {
4
+ FabricComponent,
5
+ StyledFabricComponent,
6
+ createComponent,
7
+ createStyledComponent,
8
+ generatePropertySpaceStyle,
9
+ } from '../../Theme';
4
10
  import { AlertIcon } from '../IconComponents';
5
11
 
6
12
  type AlertProps = FabricComponent<{
@@ -9,7 +15,7 @@ type AlertProps = FabricComponent<{
9
15
  }> &
10
16
  Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
11
17
 
12
- export const Alert = ({ title, note, ...props }: AlertProps) => {
18
+ export const Alert = createComponent<AlertProps>(({ title, note, ...props }) => {
13
19
  return (
14
20
  <StyledContainer {...props}>
15
21
  <IconWrapper>
@@ -21,7 +27,7 @@ export const Alert = ({ title, note, ...props }: AlertProps) => {
21
27
  </div>
22
28
  </StyledContainer>
23
29
  );
24
- };
30
+ });
25
31
 
26
32
  const IconWrapper = styled.div(
27
33
  ({ theme: { alert } }) => `
@@ -60,8 +66,8 @@ const Note = styled.p(
60
66
  `
61
67
  );
62
68
 
63
- const StyledContainer = createComponent(
64
- styled.div<FabricComponent>(
69
+ const StyledContainer = createStyledComponent(
70
+ styled.div<StyledFabricComponent>(
65
71
  ({ theme, py = theme.alert.paddingBlock, pl = theme.alert.paddingLeft, pr = theme.alert.paddingRight }) => {
66
72
  return `
67
73
  display: flex;
@@ -1,33 +1,35 @@
1
1
  import {
2
2
  ColorVariant,
3
3
  createComponent,
4
+ createStyledComponent,
4
5
  FabricComponent,
5
6
  generatePropertySpaceStyle,
6
7
  resolveThemeColor,
8
+ StyledFabricComponent,
7
9
  } from '../../Theme';
8
10
  import { styled } from 'styled-components';
9
11
 
10
- type BoxProps = FabricComponent<
11
- {
12
- children: any;
13
- element?: 'div' | 'section';
14
- hasBorder?: boolean;
15
- color?: ColorVariant | string;
16
- } & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
17
- >;
12
+ type BoxProps = {
13
+ children?: any;
14
+ element?: 'div' | 'section';
15
+ hasBorder?: boolean;
16
+ color?: ColorVariant | string;
17
+ } & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
18
18
 
19
- export const Box = ({ children, element = 'div', hasBorder = true, color, ...props }: BoxProps) => {
20
- return (
21
- <StyledBox as={element} $hasBorder={hasBorder} $color={color} {...props}>
22
- {children}
23
- </StyledBox>
24
- );
25
- };
19
+ export const Box = createComponent<BoxProps>(
20
+ ({ children, element = 'div', hasBorder = true, color, ...props }): any => {
21
+ return (
22
+ <StyledBox as={element} $hasBorder={hasBorder} $color={color} {...props}>
23
+ {children}
24
+ </StyledBox>
25
+ );
26
+ }
27
+ );
26
28
 
27
29
  type StyledProps = { $hasBorder: boolean; $color?: string };
28
30
 
29
- const StyledBox = createComponent(
30
- styled('div')<FabricComponent<StyledProps>>(
31
+ const StyledBox = createStyledComponent(
32
+ styled('div')<StyledFabricComponent<StyledProps>>(
31
33
  ({ theme, $hasBorder, $color, px = theme.box.padding, py = theme.box.padding }) => `
32
34
  ${generatePropertySpaceStyle(theme, 'padding-inline', px)}
33
35
  ${generatePropertySpaceStyle(theme, 'padding-block', py)}
@@ -8,11 +8,12 @@ import {
8
8
  getButtonSizeStyles,
9
9
  ButtonElementStyle,
10
10
  createComponent,
11
- FabricComponent,
12
11
  generatePropertySpaceStyle,
12
+ createStyledComponent,
13
+ StyledFabricComponent,
13
14
  } from '../../Theme';
14
15
 
15
- type BaseButtonProps = FabricComponent<{
16
+ type BaseButtonProps = {
16
17
  children?: any;
17
18
  variant?: ButtonVariant;
18
19
  color?: ButtonColor;
@@ -23,11 +24,10 @@ type BaseButtonProps = FabricComponent<{
23
24
  icon?: any;
24
25
  iconPosition?: 'left' | 'right';
25
26
  iconVariant?: 'filled' | 'empty';
26
- }>;
27
-
27
+ };
28
28
  export type ButtonProps = (
29
- | Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'>
30
- | Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'>
29
+ | Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children' | 'media'>
30
+ | Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'media'>
31
31
  ) &
32
32
  BaseButtonProps;
33
33
 
@@ -70,21 +70,22 @@ type StyledButtonProps = {
70
70
  $iconVariant: 'filled' | 'empty';
71
71
  };
72
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
- }) => {
86
- const sizes = getButtonSizeStyles(theme, $size);
87
- return `
73
+ const StyledButton = createStyledComponent(
74
+ styled.button<StyledFabricComponent<StyledButtonProps>>(
75
+ ({
76
+ $variant,
77
+ $color,
78
+ $size,
79
+ $disabled,
80
+ $fullWidth,
81
+ $iconPosition,
82
+ $iconVariant,
83
+ theme,
84
+ px = $variant !== 'empty' ? theme.button.sizes[$size].paddingInline : 0,
85
+ py = $variant !== 'empty' ? theme.button.sizes[$size].paddingBlock : 0,
86
+ }) => {
87
+ const sizes = getButtonSizeStyles(theme, $size);
88
+ return `
88
89
  ${getCss(getButtonStyles(theme, $variant, $color, 'default'))}
89
90
  font-size: ${sizes.fontSize};
90
91
  gap: ${sizes.gap};
@@ -155,39 +156,42 @@ const Btn = styled.button<FabricComponent<StyledButtonProps>>(
155
156
  : ``
156
157
  }
157
158
  `;
159
+ }
160
+ )
161
+ );
162
+
163
+ export const Button = createComponent<ButtonProps>(
164
+ ({
165
+ children,
166
+ variant = 'fill',
167
+ color = 'primary',
168
+ size = 'medium',
169
+ disabled = false,
170
+ fullWidth = false,
171
+ className,
172
+ icon,
173
+ iconPosition = 'left',
174
+ iconVariant = 'empty',
175
+ ...props
176
+ }) => {
177
+ return (
178
+ // @ts-ignore
179
+ <StyledButton
180
+ as={'href' in props ? 'a' : 'button'}
181
+ $variant={variant}
182
+ $color={color}
183
+ $size={size}
184
+ $disabled={disabled}
185
+ $fullWidth={fullWidth}
186
+ $iconPosition={iconPosition}
187
+ $iconVariant={iconVariant}
188
+ disabled={disabled}
189
+ className={className}
190
+ {...props}
191
+ >
192
+ {!!icon && <StyledIconWrapper>{icon}</StyledIconWrapper>}
193
+ {!!children && <ButtonTextContainer>{children}</ButtonTextContainer>}
194
+ </StyledButton>
195
+ );
158
196
  }
159
197
  );
160
- const StyledButton = createComponent(Btn);
161
-
162
- export const Button = ({
163
- children,
164
- variant = 'fill',
165
- color = 'primary',
166
- size = 'medium',
167
- disabled = false,
168
- fullWidth = false,
169
- className,
170
- icon,
171
- iconPosition = 'left',
172
- iconVariant = 'empty',
173
- ...props
174
- }: ButtonProps) => {
175
- return (
176
- <StyledButton
177
- as={'href' in props ? 'a' : 'button'}
178
- $variant={variant}
179
- $color={color}
180
- $size={size}
181
- $disabled={disabled}
182
- $fullWidth={fullWidth}
183
- $iconPosition={iconPosition}
184
- $iconVariant={iconVariant}
185
- disabled={disabled}
186
- className={className}
187
- {...props}
188
- >
189
- {!!icon && <StyledIconWrapper>{icon}</StyledIconWrapper>}
190
- {!!children && <ButtonTextContainer>{children}</ButtonTextContainer>}
191
- </StyledButton>
192
- );
193
- };
@@ -1,13 +1,12 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
- import { FabricComponent, createComponent, destructSpaceProps, pxToRem } from '../../Theme';
3
+ import { createComponent, createStyledComponent, destructSpaceProps, pxToRem } from '../../Theme';
4
4
 
5
- type CheckboxProps = FabricComponent<{
5
+ type CheckboxProps = {
6
6
  label?: any;
7
- }> &
8
- Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'>;
7
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'>;
9
8
 
10
- export const Checkbox = ({ label, className, disabled, ...props }: CheckboxProps) => {
9
+ export const Checkbox = createComponent<CheckboxProps>(({ label, className, disabled, ...props }) => {
11
10
  const spaceProps = destructSpaceProps(props);
12
11
  return (
13
12
  <StyledCheckbox className={className} $disabled={disabled} {...spaceProps}>
@@ -16,7 +15,7 @@ export const Checkbox = ({ label, className, disabled, ...props }: CheckboxProps
16
15
  {!!label && <LabelText>{label}</LabelText>}
17
16
  </StyledCheckbox>
18
17
  );
19
- };
18
+ });
20
19
 
21
20
  const CustomCheckbox = styled.div(
22
21
  ({ theme }) => `
@@ -48,7 +47,7 @@ const HiddenInput = styled.input`
48
47
  position: absolute;
49
48
  `;
50
49
 
51
- const StyledCheckbox = createComponent(
50
+ const StyledCheckbox = createStyledComponent(
52
51
  styled.label<{ $disabled?: boolean }>(({ theme, $disabled }) => {
53
52
  return `
54
53
  position: relative;
@@ -0,0 +1,13 @@
1
+ import ReactContentLoader, { IContentLoaderProps } from 'react-content-loader';
2
+ import { useTheme } from 'styled-components';
3
+
4
+ export interface ContentLoaderProps extends Omit<IContentLoaderProps, 'backgroundColor' | 'foregroundColor'> {
5
+ children?: any;
6
+ }
7
+
8
+ export const ContentLoader = (props: ContentLoaderProps) => {
9
+ const {
10
+ contentLoader: { foreground, background },
11
+ } = useTheme();
12
+ return <ReactContentLoader {...props} backgroundColor={background} foregroundColor={foreground} />;
13
+ };
@@ -0,0 +1 @@
1
+ export * from './ContentLoader';
@@ -1,6 +1,14 @@
1
1
  import { createPortal } from 'react-dom';
2
2
  import { styled } from 'styled-components';
3
- import { createComponent, FabricComponent, generatePropertySpaceStyle, propToRem, pxToRem } from '../../Theme';
3
+ import {
4
+ createComponent,
5
+ createStyledComponent,
6
+ FabricComponent,
7
+ generatePropertySpaceStyle,
8
+ propToRem,
9
+ pxToRem,
10
+ StyledFabricComponent,
11
+ } from '../../Theme';
4
12
  import { useBodyScrollLock } from '../../utils';
5
13
  import { useEffect, useRef } from 'react';
6
14
 
@@ -12,12 +20,12 @@ type DrawerProps = {
12
20
  width?: string | number;
13
21
  };
14
22
 
15
- export const Drawer = (props: DrawerProps) => {
23
+ export const Drawer = createComponent<DrawerProps>((props) => {
16
24
  useBodyScrollLock(props.isOpen);
17
25
 
18
26
  if (!props.isOpen) return null;
19
27
  return createPortal(<DrawerWithOutclick {...props} />, document.body);
20
- };
28
+ });
21
29
 
22
30
  const DrawerWithOutclick = ({ onClose, children, width, header }: DrawerProps) => {
23
31
  const drawerRef = useRef<HTMLDivElement>(null);
@@ -45,8 +53,8 @@ type DrawerHeaderProps = FabricComponent<{
45
53
  children?: any;
46
54
  }>;
47
55
 
48
- export const DrawerHeader: any = createComponent<DrawerHeaderProps>(
49
- styled.div<DrawerHeaderProps>(
56
+ export const DrawerHeader: any = createStyledComponent<DrawerHeaderProps>(
57
+ styled.div(
50
58
  ({ theme, p = theme.drawer.padding }) => `
51
59
  grid-area: drawer-header;
52
60
  ${generatePropertySpaceStyle(theme, 'padding', p)};
@@ -57,26 +65,33 @@ export const DrawerHeader: any = createComponent<DrawerHeaderProps>(
57
65
  }
58
66
  );
59
67
 
60
- type DrawerBodyProps = FabricComponent<{
68
+ type DrawerBodyProps = StyledFabricComponent<{
61
69
  children?: any;
62
70
  }>;
63
71
 
64
- export const DrawerBody: any = createComponent(
65
- styled.div<DrawerBodyProps>(
66
- ({ theme, px = theme.drawer.padding, pb = theme.drawer.padding }) => `
72
+ export const DrawerBody: any = createComponent<DrawerBodyProps>(
73
+ createStyledComponent<DrawerBodyProps>(
74
+ styled.div(
75
+ ({ theme, px = theme.drawer.padding, pb = theme.drawer.padding }) => `
67
76
  grid-area: drawer-body;
68
77
  max-height: 100%;
69
78
  overflow-y: auto;
70
79
  ${generatePropertySpaceStyle(theme, 'padding-inline', px)};
71
80
  ${generatePropertySpaceStyle(theme, 'padding-bottom', pb)};
72
81
  `
73
- ),
74
- {
75
- ignoreStyles: ['padding', 'padding-bottom'],
76
- }
82
+ ),
83
+ {
84
+ ignoreStyles: ['padding', 'padding-bottom'],
85
+ }
86
+ )
77
87
  );
78
88
 
79
- const StyledDrawer = styled.div<{ $header?: number; $width?: string | number }>(
89
+ type StyledDrawerProps = {
90
+ $header?: number;
91
+ $width?: string | number;
92
+ };
93
+
94
+ const StyledDrawer = styled.div<StyledDrawerProps>(
80
95
  ({ theme, $header, $width }) => `
81
96
  position: fixed;
82
97
  display: grid;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, forwardRef } from 'react';
2
- import { createComponent, FabricComponent } from '../../Theme';
2
+ import { createComponent, createStyledComponent, FabricComponent, StyledFabricComponent } from '../../Theme';
3
3
  import styled from 'styled-components';
4
4
 
5
5
  export type FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
@@ -23,46 +23,50 @@ export interface FlexContainerProps extends FabricComponent<Omit<React.HTMLAttri
23
23
  as?: any; // TODO: fix type to styled component or intrinsic element
24
24
  }
25
25
 
26
- export const FlexContainer: any = forwardRef<HTMLElement, FlexContainerProps>(function FlexContainer(
27
- {
28
- children,
29
- direction = 'row',
30
- wrap = 'nowrap',
31
- justify = 'flex-start',
32
- align = 'stretch',
33
- alignContent,
34
- gap,
35
- rowGap,
36
- columnGap,
37
- className,
38
- style,
39
- as = 'div',
40
- ...props
41
- },
42
- ref
43
- ) {
44
- return (
45
- <StyledFlexContainer
46
- as={as}
47
- $direction={direction}
48
- $wrap={wrap}
49
- $justify={justify}
50
- $align={align}
51
- $alignContent={alignContent}
52
- $gap={gap}
53
- $rowGap={rowGap}
54
- $columnGap={columnGap}
55
- className={className}
56
- style={style}
57
- ref={ref}
58
- {...props}
59
- >
60
- {children}
61
- </StyledFlexContainer>
62
- );
63
- });
26
+ export const FlexContainer = createComponent<FlexContainerProps, HTMLDivElement>(
27
+ forwardRef<HTMLDivElement, FlexContainerProps>(
28
+ (
29
+ {
30
+ children,
31
+ direction = 'row',
32
+ wrap = 'nowrap',
33
+ justify = 'flex-start',
34
+ align = 'stretch',
35
+ alignContent,
36
+ gap,
37
+ rowGap,
38
+ columnGap,
39
+ className,
40
+ style,
41
+ as = 'div',
42
+ ...props
43
+ },
44
+ ref
45
+ ) => {
46
+ return (
47
+ <StyledContainer
48
+ as={as}
49
+ $direction={direction}
50
+ $wrap={wrap}
51
+ $justify={justify}
52
+ $align={align}
53
+ $alignContent={alignContent}
54
+ $gap={gap}
55
+ $rowGap={rowGap}
56
+ $columnGap={columnGap}
57
+ className={className}
58
+ style={style}
59
+ ref={ref}
60
+ {...props}
61
+ >
62
+ {children}
63
+ </StyledContainer>
64
+ );
65
+ }
66
+ )
67
+ );
64
68
 
65
- interface StyledFlexContainerProps {
69
+ type StyledFlexContainerProps = StyledFabricComponent<{
66
70
  $direction: FlexDirection;
67
71
  $wrap: FlexWrap;
68
72
  $justify: FlexJustify;
@@ -71,9 +75,9 @@ interface StyledFlexContainerProps {
71
75
  $gap?: FlexGap;
72
76
  $rowGap?: FlexGap;
73
77
  $columnGap?: FlexGap;
74
- }
78
+ }>;
75
79
 
76
- const StyledContainer = styled.div<StyledFlexContainerProps>`
80
+ const StyledContainer = createStyledComponent<StyledFlexContainerProps>(styled.div`
77
81
  ${({ $direction, $wrap, $justify, $align, $alignContent, $gap, $rowGap, $columnGap }) => `
78
82
  display: flex;
79
83
  width: 100%;
@@ -87,6 +91,4 @@ const StyledContainer = styled.div<StyledFlexContainerProps>`
87
91
  ${$rowGap !== undefined ? `row-gap: ${typeof $rowGap === 'number' ? `${$rowGap}px` : $rowGap};` : ''}
88
92
  ${$columnGap !== undefined ? `column-gap: ${typeof $columnGap === 'number' ? `${$columnGap}px` : $columnGap};` : ''}
89
93
  `}
90
- `;
91
-
92
- const StyledFlexContainer = createComponent(StyledContainer);
94
+ `);
@@ -1,5 +1,6 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  import { styled } from 'styled-components';
3
+ import { createComponent } from '../../Theme';
3
4
 
4
5
  export type FlexItemGrow = number;
5
6
  export type FlexItemShrink = number;
@@ -18,32 +19,24 @@ export interface FlexItemProps {
18
19
  as?: any; //TODO: fix type to styled component or intrinsic element
19
20
  }
20
21
 
21
- export const FlexItem = ({
22
- children,
23
- grow,
24
- shrink,
25
- basis,
26
- align,
27
- order,
28
- className,
29
- style,
30
- as = 'div',
31
- }: FlexItemProps) => {
32
- return (
33
- <StyledFlexItem
34
- as={as}
35
- $grow={grow}
36
- $shrink={shrink}
37
- $basis={basis}
38
- $align={align}
39
- $order={order}
40
- className={className}
41
- style={style}
42
- >
43
- {children}
44
- </StyledFlexItem>
45
- );
46
- };
22
+ export const FlexItem = createComponent<FlexItemProps>(
23
+ ({ children, grow, shrink, basis, align, order, className, style, as = 'div' }) => {
24
+ return (
25
+ <StyledFlexItem
26
+ as={as}
27
+ $grow={grow}
28
+ $shrink={shrink}
29
+ $basis={basis}
30
+ $align={align}
31
+ $order={order}
32
+ className={className}
33
+ style={style}
34
+ >
35
+ {children}
36
+ </StyledFlexItem>
37
+ );
38
+ }
39
+ );
47
40
 
48
41
  interface StyledFlexItemProps {
49
42
  $grow?: FlexItemGrow;
@@ -1,6 +1,13 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
- import { FabricComponent, LabelSize, createComponent, generatePropertySpaceStyle, propToRem } from '../../Theme';
3
+ import {
4
+ FabricComponent,
5
+ LabelSize,
6
+ createComponent,
7
+ createStyledComponent,
8
+ generatePropertySpaceStyle,
9
+ propToRem,
10
+ } from '../../Theme';
4
11
 
5
12
  type LabelProps = FabricComponent<{
6
13
  label?: any;
@@ -22,40 +29,34 @@ type LabelDirection = {
22
29
  direction?: Omit<React.CSSProperties['flexDirection'], 'row' | 'row-reverse'>;
23
30
  };
24
31
 
25
- export const Label = ({
26
- label,
27
- helpText,
28
- children,
29
- direction = 'column',
30
- size = 'small',
31
- errorText,
32
- fullWidth,
33
- ...props
34
- }: LabelProps) => {
35
- const $isRow = direction === 'row' || direction === 'row-reverse';
36
- const $width = $isRow ? (props as LabelDirectionRaw).childrenWidth || '50%' : '100%';
32
+ export const Label = createComponent<LabelProps>(
33
+ ({ label, helpText, children, direction = 'column', size = 'small', errorText, fullWidth, ...props }) => {
34
+ const $isRow = direction === 'row' || direction === 'row-reverse';
35
+ const $width = $isRow ? (props as LabelDirectionRaw).childrenWidth || '50%' : '100%';
37
36
 
38
- return (
39
- <StyledLabel $size={size} $direction={direction} $fullWidth={fullWidth} $isRow={$isRow} {...props}>
40
- {Boolean(label || helpText) && (
41
- <LabelWrapper $width={$width}>
42
- {!!label && <LabelText $size={size}>{label}</LabelText>}
43
- {!!helpText && <HelpText $size={size}>{helpText}</HelpText>}
44
- </LabelWrapper>
45
- )}
46
- <Wrapper $width={$width}>
47
- {children}
48
- {!!errorText && <ErrorText $size={size}>{errorText}</ErrorText>}
49
- </Wrapper>
50
- </StyledLabel>
51
- );
52
- };
37
+ return (
38
+ <StyledLabel $size={size} $direction={direction} $fullWidth={fullWidth} $isRow={$isRow} {...props}>
39
+ {Boolean(label || helpText) && (
40
+ <LabelWrapper $width={$width}>
41
+ {!!label && <LabelText $size={size}>{label}</LabelText>}
42
+ {!!helpText && <HelpText $size={size}>{helpText}</HelpText>}
43
+ </LabelWrapper>
44
+ )}
45
+ <Wrapper $width={$width}>
46
+ {children}
47
+ {!!errorText && <ErrorText $size={size}>{errorText}</ErrorText>}
48
+ </Wrapper>
49
+ </StyledLabel>
50
+ );
51
+ }
52
+ );
53
53
 
54
54
  type StyledProps = {
55
55
  $size: LabelSize;
56
56
  $direction?: LabelDirection['direction'] | LabelDirectionRaw['direction'];
57
57
  $fullWidth?: boolean;
58
58
  $isRow: boolean;
59
+ children?: any;
59
60
  };
60
61
 
61
62
  type WrapperProps = { $width: number | string };
@@ -107,8 +108,8 @@ const ErrorText = styled.div<TextProps>(
107
108
  `
108
109
  );
109
110
 
110
- const StyledLabel = createComponent(
111
- styled.label<FabricComponent<StyledProps>>(
111
+ const StyledLabel = createStyledComponent<FabricComponent<StyledProps>>(
112
+ styled.label(
112
113
  ({
113
114
  theme,
114
115
  $direction = 'column',
@@ -1,4 +1,4 @@
1
- import { createComponent, FabricComponent } from '../../Theme';
1
+ import { createComponent, createStyledComponent, FabricComponent, StyledFabricComponent } from '../../Theme';
2
2
  import { styled } from 'styled-components';
3
3
 
4
4
  type LineProps = FabricComponent<
@@ -7,16 +7,16 @@ type LineProps = FabricComponent<
7
7
  } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'children'>
8
8
  >;
9
9
 
10
- export const Line = ({ direction = 'horizontal', ...props }: LineProps) => {
10
+ export const Line = createComponent<LineProps>(({ direction = 'horizontal', ...props }) => {
11
11
  return <StyledLine {...props} $direction={direction} />;
12
- };
12
+ });
13
13
 
14
14
  interface StyledLineProps {
15
15
  $direction: 'horizontal' | 'vertical';
16
16
  }
17
17
 
18
- const StyledLine = createComponent(
19
- styled.div<StyledLineProps>(
18
+ const StyledLine = createStyledComponent<StyledFabricComponent<StyledLineProps>>(
19
+ styled.div(
20
20
  ({ theme, $direction }) => `
21
21
  width: ${$direction === 'horizontal' ? '100%' : theme.line.size};
22
22
  height: ${$direction === 'vertical' ? '100%' : theme.line.size};