@aic-kits/react 0.2.0 → 0.3.1

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,3 +1,8 @@
1
+ import { Size, Theme } from '../../theme';
2
+ /**
3
+ * Helper function to get the actual size value from theme or direct input.
4
+ */
5
+ export declare const getSizeValue: (theme: Theme, size: Size | string | number | undefined) => string;
1
6
  /**
2
7
  * Check if an art is an emoji
3
8
  */
@@ -32,119 +32,119 @@ declare const colors: {
32
32
  declare const spaces: {
33
33
  readonly m: {
34
34
  readonly property: "margin";
35
- readonly scale: "space";
35
+ readonly scale: "spaces";
36
36
  };
37
37
  readonly mt: {
38
38
  readonly property: "marginTop";
39
- readonly scale: "space";
39
+ readonly scale: "spaces";
40
40
  };
41
41
  readonly mb: {
42
42
  readonly property: "marginBottom";
43
- readonly scale: "space";
43
+ readonly scale: "spaces";
44
44
  };
45
45
  readonly ml: {
46
46
  readonly property: "marginLeft";
47
- readonly scale: "space";
47
+ readonly scale: "spaces";
48
48
  };
49
49
  readonly mr: {
50
50
  readonly property: "marginRight";
51
- readonly scale: "space";
51
+ readonly scale: "spaces";
52
52
  };
53
53
  readonly mx: {
54
54
  readonly property: "marginInline";
55
- readonly scale: "space";
55
+ readonly scale: "spaces";
56
56
  };
57
57
  readonly my: {
58
58
  readonly property: "marginBlock";
59
- readonly scale: "space";
59
+ readonly scale: "spaces";
60
60
  };
61
61
  readonly p: {
62
62
  readonly property: "padding";
63
- readonly scale: "space";
63
+ readonly scale: "spaces";
64
64
  };
65
65
  readonly pt: {
66
66
  readonly property: "paddingTop";
67
- readonly scale: "space";
67
+ readonly scale: "spaces";
68
68
  };
69
69
  readonly pb: {
70
70
  readonly property: "paddingBottom";
71
- readonly scale: "space";
71
+ readonly scale: "spaces";
72
72
  };
73
73
  readonly pl: {
74
74
  readonly property: "paddingLeft";
75
- readonly scale: "space";
75
+ readonly scale: "spaces";
76
76
  };
77
77
  readonly pr: {
78
78
  readonly property: "paddingRight";
79
- readonly scale: "space";
79
+ readonly scale: "spaces";
80
80
  };
81
81
  readonly px: {
82
82
  readonly property: "paddingInline";
83
- readonly scale: "space";
83
+ readonly scale: "spaces";
84
84
  };
85
85
  readonly py: {
86
86
  readonly property: "paddingBlock";
87
- readonly scale: "space";
87
+ readonly scale: "spaces";
88
88
  };
89
89
  readonly margin: {
90
90
  readonly property: "margin";
91
- readonly scale: "space";
91
+ readonly scale: "spaces";
92
92
  };
93
93
  readonly marginBottom: {
94
94
  readonly property: "marginBottom";
95
- readonly scale: "space";
95
+ readonly scale: "spaces";
96
96
  };
97
97
  readonly marginLeft: {
98
98
  readonly property: "marginLeft";
99
- readonly scale: "space";
99
+ readonly scale: "spaces";
100
100
  };
101
101
  readonly marginRight: {
102
102
  readonly property: "marginRight";
103
- readonly scale: "space";
103
+ readonly scale: "spaces";
104
104
  };
105
105
  readonly marginTop: {
106
106
  readonly property: "marginTop";
107
- readonly scale: "space";
107
+ readonly scale: "spaces";
108
108
  };
109
109
  readonly marginX: {
110
110
  readonly property: "marginInline";
111
- readonly scale: "space";
111
+ readonly scale: "spaces";
112
112
  };
113
113
  readonly marginY: {
114
114
  readonly property: "marginBlock";
115
- readonly scale: "space";
115
+ readonly scale: "spaces";
116
116
  };
117
117
  readonly padding: {
118
118
  readonly property: "padding";
119
- readonly scale: "space";
119
+ readonly scale: "spaces";
120
120
  };
121
121
  readonly paddingBottom: {
122
122
  readonly property: "paddingBottom";
123
- readonly scale: "space";
123
+ readonly scale: "spaces";
124
124
  };
125
125
  readonly paddingLeft: {
126
126
  readonly property: "paddingLeft";
127
- readonly scale: "space";
127
+ readonly scale: "spaces";
128
128
  };
129
129
  readonly paddingRight: {
130
130
  readonly property: "paddingRight";
131
- readonly scale: "space";
131
+ readonly scale: "spaces";
132
132
  };
133
133
  readonly paddingTop: {
134
134
  readonly property: "paddingTop";
135
- readonly scale: "space";
135
+ readonly scale: "spaces";
136
136
  };
137
137
  readonly paddingX: {
138
138
  readonly property: "paddingInline";
139
- readonly scale: "space";
139
+ readonly scale: "spaces";
140
140
  };
141
141
  readonly paddingY: {
142
142
  readonly property: "paddingBlock";
143
- readonly scale: "space";
143
+ readonly scale: "spaces";
144
144
  };
145
145
  readonly gap: {
146
146
  readonly property: "gap";
147
- readonly scale: "space";
147
+ readonly scale: "spaces";
148
148
  };
149
149
  };
150
150
  declare const radii: {
@@ -322,119 +322,119 @@ declare const config: {
322
322
  };
323
323
  readonly m: {
324
324
  readonly property: "margin";
325
- readonly scale: "space";
325
+ readonly scale: "spaces";
326
326
  };
327
327
  readonly mt: {
328
328
  readonly property: "marginTop";
329
- readonly scale: "space";
329
+ readonly scale: "spaces";
330
330
  };
331
331
  readonly mb: {
332
332
  readonly property: "marginBottom";
333
- readonly scale: "space";
333
+ readonly scale: "spaces";
334
334
  };
335
335
  readonly ml: {
336
336
  readonly property: "marginLeft";
337
- readonly scale: "space";
337
+ readonly scale: "spaces";
338
338
  };
339
339
  readonly mr: {
340
340
  readonly property: "marginRight";
341
- readonly scale: "space";
341
+ readonly scale: "spaces";
342
342
  };
343
343
  readonly mx: {
344
344
  readonly property: "marginInline";
345
- readonly scale: "space";
345
+ readonly scale: "spaces";
346
346
  };
347
347
  readonly my: {
348
348
  readonly property: "marginBlock";
349
- readonly scale: "space";
349
+ readonly scale: "spaces";
350
350
  };
351
351
  readonly p: {
352
352
  readonly property: "padding";
353
- readonly scale: "space";
353
+ readonly scale: "spaces";
354
354
  };
355
355
  readonly pt: {
356
356
  readonly property: "paddingTop";
357
- readonly scale: "space";
357
+ readonly scale: "spaces";
358
358
  };
359
359
  readonly pb: {
360
360
  readonly property: "paddingBottom";
361
- readonly scale: "space";
361
+ readonly scale: "spaces";
362
362
  };
363
363
  readonly pl: {
364
364
  readonly property: "paddingLeft";
365
- readonly scale: "space";
365
+ readonly scale: "spaces";
366
366
  };
367
367
  readonly pr: {
368
368
  readonly property: "paddingRight";
369
- readonly scale: "space";
369
+ readonly scale: "spaces";
370
370
  };
371
371
  readonly px: {
372
372
  readonly property: "paddingInline";
373
- readonly scale: "space";
373
+ readonly scale: "spaces";
374
374
  };
375
375
  readonly py: {
376
376
  readonly property: "paddingBlock";
377
- readonly scale: "space";
377
+ readonly scale: "spaces";
378
378
  };
379
379
  readonly margin: {
380
380
  readonly property: "margin";
381
- readonly scale: "space";
381
+ readonly scale: "spaces";
382
382
  };
383
383
  readonly marginBottom: {
384
384
  readonly property: "marginBottom";
385
- readonly scale: "space";
385
+ readonly scale: "spaces";
386
386
  };
387
387
  readonly marginLeft: {
388
388
  readonly property: "marginLeft";
389
- readonly scale: "space";
389
+ readonly scale: "spaces";
390
390
  };
391
391
  readonly marginRight: {
392
392
  readonly property: "marginRight";
393
- readonly scale: "space";
393
+ readonly scale: "spaces";
394
394
  };
395
395
  readonly marginTop: {
396
396
  readonly property: "marginTop";
397
- readonly scale: "space";
397
+ readonly scale: "spaces";
398
398
  };
399
399
  readonly marginX: {
400
400
  readonly property: "marginInline";
401
- readonly scale: "space";
401
+ readonly scale: "spaces";
402
402
  };
403
403
  readonly marginY: {
404
404
  readonly property: "marginBlock";
405
- readonly scale: "space";
405
+ readonly scale: "spaces";
406
406
  };
407
407
  readonly padding: {
408
408
  readonly property: "padding";
409
- readonly scale: "space";
409
+ readonly scale: "spaces";
410
410
  };
411
411
  readonly paddingBottom: {
412
412
  readonly property: "paddingBottom";
413
- readonly scale: "space";
413
+ readonly scale: "spaces";
414
414
  };
415
415
  readonly paddingLeft: {
416
416
  readonly property: "paddingLeft";
417
- readonly scale: "space";
417
+ readonly scale: "spaces";
418
418
  };
419
419
  readonly paddingRight: {
420
420
  readonly property: "paddingRight";
421
- readonly scale: "space";
421
+ readonly scale: "spaces";
422
422
  };
423
423
  readonly paddingTop: {
424
424
  readonly property: "paddingTop";
425
- readonly scale: "space";
425
+ readonly scale: "spaces";
426
426
  };
427
427
  readonly paddingX: {
428
428
  readonly property: "paddingInline";
429
- readonly scale: "space";
429
+ readonly scale: "spaces";
430
430
  };
431
431
  readonly paddingY: {
432
432
  readonly property: "paddingBlock";
433
- readonly scale: "space";
433
+ readonly scale: "spaces";
434
434
  };
435
435
  readonly gap: {
436
436
  readonly property: "gap";
437
- readonly scale: "space";
437
+ readonly scale: "spaces";
438
438
  };
439
439
  readonly bgColor: {
440
440
  readonly property: "backgroundColor";
@@ -3,7 +3,7 @@ import { BorderWidth, Color, Radius, Space } from '../../theme';
3
3
  import { ConfigType, FlexPropsKeyType } from './config';
4
4
  export interface ThemeScale {
5
5
  colors: Color;
6
- space: Space;
6
+ spaces: Space;
7
7
  radii: Radius;
8
8
  borderWidths: BorderWidth;
9
9
  }
@@ -1,8 +1,13 @@
1
- import { Color } from '../../theme/common';
1
+ import { BorderWidth, Color, Space } from '../../theme/common';
2
2
  type ButtonContainerProps = {
3
- backgroundColor: Color | 'disabled';
4
- borderRadius: string;
5
- disabled?: boolean;
3
+ $backgroundColor: Color | 'disabled';
4
+ $borderRadius: string;
5
+ $borderWidth: BorderWidth;
6
+ $disabled?: boolean;
7
+ $variant: 'solid' | 'outlined' | 'text';
8
+ $color: Color;
9
+ $paddingHorizontal?: Space;
10
+ $paddingVertical?: Space;
6
11
  };
7
12
  declare const StyledButtonContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('..').BoxProps & {
8
13
  ref?: import('react').ForwardedRef<HTMLDivElement>;
@@ -10,9 +15,10 @@ declare const StyledButtonContainer: import('styled-components/dist/types').ISty
10
15
  ref?: import('react').ForwardedRef<HTMLDivElement>;
11
16
  }) => ReturnType<({ children, style, "data-testid": testId, ...otherProps }: import('..').BoxProps, ref: import('react').ForwardedRef<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element>, keyof import('react').Component<any, {}, any>>;
12
17
  type ButtonTextProps = {
13
- themeColor: Color | 'disabled';
14
- themeTextColor?: Color;
15
- disabled?: boolean;
18
+ $themeColor: Color;
19
+ $themeTextColor?: Color;
20
+ $disabled?: boolean;
21
+ $variant: 'solid' | 'outlined' | 'text';
16
22
  };
17
23
  declare const StyledButtonText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('..').TextProps & {
18
24
  useRichText?: boolean;
@@ -20,7 +26,7 @@ declare const StyledButtonText: import('styled-components/dist/types').IStyledCo
20
26
  useRichText?: boolean;
21
27
  }) => import("react/jsx-runtime").JSX.Element, keyof import('react').Component<any, {}, any>>;
22
28
  type ButtonIconWrapperProps = {
23
- themePosition: 'left' | 'right';
29
+ $themePosition: 'left' | 'right';
24
30
  };
25
31
  declare const StyledButtonIconWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('..').BoxProps & {
26
32
  ref?: import('react').ForwardedRef<HTMLDivElement>;
@@ -1,54 +1,4 @@
1
1
  import { default as React } from 'react';
2
- import { Color } from '../../theme/common';
3
- export interface ButtonProps {
4
- /**
5
- * Disable state of button.
6
- */
7
- disabled?: boolean;
8
- /**
9
- * Places an icon within the button, before the button's text
10
- */
11
- icon?: React.ReactNode;
12
- /**
13
- * Visual color to apply to button.
14
- */
15
- color?: Color;
16
- /**
17
- * Visual color to apply to button's text.
18
- */
19
- textColor?: Color;
20
- /**
21
- * Loading state of button.
22
- */
23
- loading?: boolean;
24
- /**
25
- * Set the handler to handle click event.
26
- */
27
- onClick?: React.MouseEventHandler<HTMLDivElement>;
28
- /**
29
- * Places an icon within the button, after the button's text
30
- */
31
- rightIcon?: React.ReactNode;
32
- /**
33
- * Corner style of button.
34
- */
35
- corner?: 'circle' | 'rounded' | 'square';
36
- /**
37
- * Additional style.
38
- */
39
- style?: React.CSSProperties;
40
- /**
41
- * Testing id of the component.
42
- */
43
- 'data-testid'?: string;
44
- /**
45
- * Button text.
46
- */
47
- text: React.ReactNode;
48
- /**
49
- * For flex layout
50
- */
51
- flex?: number | string;
52
- }
53
- export declare const Button: ({ disabled, icon, color, textColor, loading, onClick, rightIcon, corner, style, "data-testid": testId, text, ...rest }: ButtonProps) => React.ReactElement;
2
+ import { ButtonProps } from './types';
3
+ export declare const Button: ({ disabled, icon, color, textColor, loading, onClick, rightIcon, corner, variant, style, "data-testid": testId, text, ...rest }: ButtonProps) => React.ReactElement;
54
4
  export * from './utils';
@@ -0,0 +1,60 @@
1
+ import { Color } from '../../theme';
2
+ export interface ButtonProps {
3
+ /**
4
+ * Disable state of button.
5
+ */
6
+ disabled?: boolean;
7
+ /**
8
+ * Places an icon within the button, before the button's text
9
+ */
10
+ icon?: React.ReactNode;
11
+ /**
12
+ * Visual color to apply to button.
13
+ * For 'solid' variant, sets background color.
14
+ * For 'outlined' variant, sets border and text color.
15
+ * For 'text' variant, sets text color.
16
+ */
17
+ color?: Color;
18
+ /**
19
+ * Visual color to apply to button's text.
20
+ * Overrides the default text color derived from the variant and color prop.
21
+ */
22
+ textColor?: Color;
23
+ /**
24
+ * Loading state of button.
25
+ */
26
+ loading?: boolean;
27
+ /**
28
+ * Set the handler to handle click event.
29
+ */
30
+ onClick?: React.MouseEventHandler<HTMLDivElement>;
31
+ /**
32
+ * Places an icon within the button, after the button's text
33
+ */
34
+ rightIcon?: React.ReactNode;
35
+ /**
36
+ * Corner style of button.
37
+ */
38
+ corner?: 'circle' | 'rounded' | 'square';
39
+ /**
40
+ * Button style variant.
41
+ * @default 'solid'
42
+ */
43
+ variant?: 'solid' | 'outlined' | 'text';
44
+ /**
45
+ * Additional style.
46
+ */
47
+ style?: React.CSSProperties;
48
+ /**
49
+ * Testing id of the component.
50
+ */
51
+ 'data-testid'?: string;
52
+ /**
53
+ * Button text.
54
+ */
55
+ text: React.ReactNode;
56
+ /**
57
+ * For flex layout
58
+ */
59
+ flex?: number | string;
60
+ }
@@ -1,3 +1,3 @@
1
1
  import { Theme } from '../../theme';
2
2
  import { Color } from '../../theme/common';
3
- export declare const getTextColor: (theme: Theme, backgroundColor: Color | "disabled", textColor?: Color) => string;
3
+ export declare const getTextColor: (theme: Theme, color: Color, textColor?: Color, variant?: "solid" | "outlined" | "text", disabled?: boolean) => string;
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { HeaderProps } from './types';
3
+ interface HeaderAuthProps {
4
+ isSignedIn?: boolean;
5
+ userProfile?: HeaderProps['userProfile'];
6
+ onSignInClick?: () => void;
7
+ onRegisterClick?: () => void;
8
+ onProfileClick?: () => void;
9
+ }
10
+ export declare const HeaderAuth: React.FC<HeaderAuthProps>;
11
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ interface HeaderLogoProps {
3
+ onLogoClick?: () => void;
4
+ }
5
+ export declare const HeaderLogo: React.FC<HeaderLogoProps>;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { NavItem } from './types';
3
+ interface HeaderNavProps {
4
+ navItems?: NavItem[];
5
+ onNavItemClick?: (item: NavItem) => void;
6
+ }
7
+ export declare const HeaderNav: React.FC<HeaderNavProps>;
8
+ export {};
@@ -2,3 +2,6 @@ import { default as React } from 'react';
2
2
  import { HeaderProps } from './types';
3
3
  export declare const Header: React.FC<HeaderProps>;
4
4
  export * from './types';
5
+ export * from './HeaderLogo';
6
+ export * from './HeaderNav';
7
+ export * from './HeaderAuth';
@@ -1,12 +1,12 @@
1
1
  import { Color, FontSize, FontWeight, Typeface } from '../../theme';
2
2
  interface StyledTextProps {
3
- themeFontSize: FontSize;
4
- themeFontWeight: FontWeight;
5
- themeColor: Color;
6
- themeTypeface: Typeface;
7
- textAlign?: 'left' | 'right' | 'center' | 'justify';
8
- textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase';
9
- textDecoration?: 'none' | 'underline' | 'line-through' | 'underline line-through';
3
+ $themeFontSize: FontSize;
4
+ $themeFontWeight: FontWeight;
5
+ $themeColor: Color;
6
+ $themeTypeface: Typeface;
7
+ $textAlign?: 'left' | 'right' | 'center' | 'justify';
8
+ $textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase';
9
+ $textDecoration?: 'none' | 'underline' | 'line-through' | 'underline line-through';
10
10
  }
11
11
  declare const StyledText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, StyledTextProps>> & string;
12
12
  export { StyledText };
@@ -1,11 +1,6 @@
1
1
  import { default as React } from 'react';
2
- import { TouchableHapticFeedbackType } from '../../theme';
3
2
  import { BoxProps } from '../Box';
4
3
  export interface TouchableProps extends React.HTMLAttributes<HTMLDivElement>, BoxProps {
5
- /**
6
- * Haptic feedback type (not used in web, but kept for API compatibility)
7
- */
8
- hapticFeedback?: TouchableHapticFeedbackType;
9
4
  /**
10
5
  * Touchable's content.
11
6
  */