@aic-kits/react 0.7.1 → 0.9.0
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/components/Art/EmojiArt.d.ts +1 -1
- package/dist/components/Art/IconArt.d.ts +5 -1
- package/dist/components/Art/types.d.ts +28 -12
- package/dist/components/Base/types.d.ts +10 -0
- package/dist/components/Base/utils.d.ts +5 -0
- package/dist/components/Button/StyledButton.d.ts +17 -4
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/types.d.ts +8 -2
- package/dist/components/Text/StyledText.d.ts +3 -1
- package/dist/components/Text/types.d.ts +4 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useMediaQuery.d.ts +7 -0
- package/dist/index.cjs +91 -72
- package/dist/index.js +3378 -3245
- package/dist/theme/common/scale.d.ts +1 -0
- package/dist/theme/common/sizes.d.ts +1 -1
- package/dist/theme/common/text.d.ts +11 -3
- package/dist/theme/components/base.d.ts +11 -0
- package/dist/theme/components/button.d.ts +13 -4
- package/package.json +2 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { EmojiArtProps } from './types';
|
|
3
|
-
export declare const EmojiArt: ({ art,
|
|
3
|
+
export declare const EmojiArt: ({ art, size, style, "data-testid": testId, ...rest }: EmojiArtProps) => React.ReactElement;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IconArtProps } from './types';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Renders a Phosphor icon within a layout Box.
|
|
5
|
+
* The specific icon is determined by the `art` prop (kebab-case name).
|
|
6
|
+
*/
|
|
7
|
+
export declare const IconArt: ({ art, size, color, weight, style, "data-testid": testId, ...rest }: IconArtProps) => React.ReactElement | null;
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
+
import { Icon, IconWeight } from '@phosphor-icons/react';
|
|
1
2
|
import { default as React } from 'react';
|
|
2
|
-
import { Size } from '../../theme/common';
|
|
3
|
+
import { Size, Color } from '../../theme/common';
|
|
3
4
|
import { BoxProps } from '../Box';
|
|
4
|
-
export interface
|
|
5
|
+
export interface WidthHeightProps {
|
|
5
6
|
/**
|
|
6
7
|
* Width of the art
|
|
7
8
|
*/
|
|
8
|
-
width?: string | number;
|
|
9
|
+
width?: Size | string | number;
|
|
9
10
|
/**
|
|
10
11
|
* Height of the art
|
|
11
12
|
*/
|
|
12
13
|
height?: Size | string | number;
|
|
14
|
+
}
|
|
15
|
+
export interface SizeProps {
|
|
16
|
+
/**
|
|
17
|
+
* Size of the art
|
|
18
|
+
*/
|
|
19
|
+
size?: Size | string | number;
|
|
20
|
+
}
|
|
21
|
+
export interface BaseArtProps extends Omit<BoxProps, 'width' | 'height'> {
|
|
13
22
|
/**
|
|
14
23
|
* Testing id of the component
|
|
15
24
|
*/
|
|
@@ -19,21 +28,28 @@ export interface BaseArtProps extends BoxProps {
|
|
|
19
28
|
*/
|
|
20
29
|
style?: React.CSSProperties;
|
|
21
30
|
}
|
|
22
|
-
export interface IconArtProps extends BaseArtProps {
|
|
31
|
+
export interface IconArtProps extends BaseArtProps, SizeProps {
|
|
23
32
|
/**
|
|
24
33
|
* Type of the art
|
|
25
34
|
*/
|
|
26
35
|
type?: 'icon';
|
|
27
36
|
/**
|
|
28
|
-
*
|
|
37
|
+
* Name of the Phosphor icon (e.g., 'house', 'heart', 'airplane-in-flight').
|
|
38
|
+
* Must be a valid key from the `phosphorIconMap`.
|
|
29
39
|
*/
|
|
30
|
-
art:
|
|
40
|
+
art: Icon;
|
|
41
|
+
/**
|
|
42
|
+
* Color of the icon. Can be a theme color key or any valid CSS color string.
|
|
43
|
+
* @default 'currentColor'
|
|
44
|
+
*/
|
|
45
|
+
color?: Color | string;
|
|
31
46
|
/**
|
|
32
|
-
*
|
|
47
|
+
* Icon weight (stroke style).
|
|
48
|
+
* @default 'regular'
|
|
33
49
|
*/
|
|
34
|
-
|
|
50
|
+
weight?: IconWeight;
|
|
35
51
|
}
|
|
36
|
-
export interface EmojiArtProps extends BaseArtProps {
|
|
52
|
+
export interface EmojiArtProps extends BaseArtProps, SizeProps {
|
|
37
53
|
/**
|
|
38
54
|
* Type of the art
|
|
39
55
|
*/
|
|
@@ -43,7 +59,7 @@ export interface EmojiArtProps extends BaseArtProps {
|
|
|
43
59
|
*/
|
|
44
60
|
art: string;
|
|
45
61
|
}
|
|
46
|
-
export interface SvgArtProps extends BaseArtProps {
|
|
62
|
+
export interface SvgArtProps extends BaseArtProps, WidthHeightProps {
|
|
47
63
|
/**
|
|
48
64
|
* Type of the art
|
|
49
65
|
*/
|
|
@@ -53,7 +69,7 @@ export interface SvgArtProps extends BaseArtProps {
|
|
|
53
69
|
*/
|
|
54
70
|
art: React.FunctionComponent<React.SVGAttributes<SVGElement>> | string;
|
|
55
71
|
}
|
|
56
|
-
export interface ImageArtProps extends BaseArtProps {
|
|
72
|
+
export interface ImageArtProps extends BaseArtProps, WidthHeightProps {
|
|
57
73
|
/**
|
|
58
74
|
* Type of the art
|
|
59
75
|
*/
|
|
@@ -63,7 +79,7 @@ export interface ImageArtProps extends BaseArtProps {
|
|
|
63
79
|
*/
|
|
64
80
|
art: string;
|
|
65
81
|
}
|
|
66
|
-
export interface BrandArtProps extends BaseArtProps {
|
|
82
|
+
export interface BrandArtProps extends BaseArtProps, WidthHeightProps {
|
|
67
83
|
/**
|
|
68
84
|
* Type of the art
|
|
69
85
|
*/
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Color } from '../../theme';
|
|
2
2
|
import { BoxProps } from '../Box';
|
|
3
3
|
import { HeaderProps } from '../Header/types';
|
|
4
|
+
/** Defines the layout mode for the content area on desktop screens. */
|
|
5
|
+
export type ContentLayoutMode = 'maxWidth' | 'padded';
|
|
4
6
|
export interface BaseProps extends BoxProps {
|
|
5
7
|
/**
|
|
6
8
|
* The background color of the Base component
|
|
@@ -12,4 +14,12 @@ export interface BaseProps extends BoxProps {
|
|
|
12
14
|
* Can provide a HeaderProps object to customize the header
|
|
13
15
|
*/
|
|
14
16
|
header?: HeaderProps | false;
|
|
17
|
+
/**
|
|
18
|
+
* Defines how the main content area is laid out on desktop screens.
|
|
19
|
+
* - `'maxWidth'`: Content is centered with a maximum width defined in the theme.
|
|
20
|
+
* - `'padded'`: Content uses horizontal padding defined in the theme.
|
|
21
|
+
* On mobile screens, content always uses mobile padding defined in the theme.
|
|
22
|
+
* @default 'maxWidth' (behavior might depend on theme defaults)
|
|
23
|
+
*/
|
|
24
|
+
contentLayoutMode?: ContentLayoutMode;
|
|
15
25
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BaseThemeConfig } from '../../theme';
|
|
2
|
+
import { BoxProps } from '../Box';
|
|
3
|
+
import { ContentLayoutMode } from './types';
|
|
4
|
+
export declare const getInnerBoxStyleProps: (isDesktop: boolean, contentLayoutMode: ContentLayoutMode, baseThemeConfig: BaseThemeConfig) => Pick<BoxProps, "px" | "maxWidth">;
|
|
5
|
+
export declare const getInnerBoxInlineStyle: (isDesktop: boolean, contentLayoutMode: ContentLayoutMode) => import('react').CSSProperties;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { BorderWidth, Color, Space } from '../../theme/common';
|
|
1
|
+
import { BorderWidth, Color, FontSize, Space, Size, FontWeight } from '../../theme/common';
|
|
2
|
+
import { ButtonSize } from '../../theme/components/button';
|
|
2
3
|
type ButtonContainerProps = {
|
|
3
4
|
$backgroundColor: Color | 'disabled';
|
|
4
5
|
$borderRadius: string;
|
|
@@ -6,8 +7,9 @@ type ButtonContainerProps = {
|
|
|
6
7
|
$disabled?: boolean;
|
|
7
8
|
$variant: 'solid' | 'outlined' | 'text';
|
|
8
9
|
$color: Color;
|
|
9
|
-
$paddingHorizontal
|
|
10
|
-
$paddingVertical
|
|
10
|
+
$paddingHorizontal: Space;
|
|
11
|
+
$paddingVertical: Space;
|
|
12
|
+
$size: ButtonSize;
|
|
11
13
|
};
|
|
12
14
|
declare const StyledButtonContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('..').BoxProps & {
|
|
13
15
|
ref?: import('react').ForwardedRef<HTMLDivElement>;
|
|
@@ -19,6 +21,8 @@ type ButtonTextProps = {
|
|
|
19
21
|
$themeTextColor?: Color;
|
|
20
22
|
$disabled?: boolean;
|
|
21
23
|
$variant: 'solid' | 'outlined' | 'text';
|
|
24
|
+
$themeFontSize: FontSize;
|
|
25
|
+
$themeFontWeight: FontWeight;
|
|
22
26
|
};
|
|
23
27
|
declare const StyledButtonText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('..').TextProps & {
|
|
24
28
|
useRichText?: boolean;
|
|
@@ -27,10 +31,19 @@ declare const StyledButtonText: import('styled-components/dist/types').IStyledCo
|
|
|
27
31
|
}) => import("react/jsx-runtime").JSX.Element, keyof import('react').Component<any, {}, any>>;
|
|
28
32
|
type ButtonIconWrapperProps = {
|
|
29
33
|
$themePosition: 'left' | 'right';
|
|
34
|
+
$iconSpacing: Space;
|
|
30
35
|
};
|
|
31
36
|
declare const StyledButtonIconWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('..').BoxProps & {
|
|
32
37
|
ref?: import('react').ForwardedRef<HTMLDivElement>;
|
|
33
38
|
}, ButtonIconWrapperProps>> & string & Omit<(props: import('..').BoxProps & {
|
|
34
39
|
ref?: import('react').ForwardedRef<HTMLDivElement>;
|
|
35
40
|
}) => 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>>;
|
|
36
|
-
|
|
41
|
+
type ButtonIconProps = {
|
|
42
|
+
$themeColor: Color;
|
|
43
|
+
$themeTextColor?: Color;
|
|
44
|
+
$disabled?: boolean;
|
|
45
|
+
$variant: 'solid' | 'outlined' | 'text';
|
|
46
|
+
$iconSize: Size;
|
|
47
|
+
};
|
|
48
|
+
declare const StyledButtonIcon: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('..').IconArtProps | import('..').EmojiArtProps | import('..').SvgArtProps | import('..').ImageArtProps | import('..').BrandArtProps, ButtonIconProps>> & string & Omit<(props: import('..').ArtProps) => React.ReactElement, keyof import('react').Component<any, {}, any>>;
|
|
49
|
+
export { StyledButtonContainer, StyledButtonText, StyledButtonIconWrapper, StyledButtonIcon, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
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;
|
|
3
|
+
export declare const Button: ({ disabled, icon, color, textColor, loading, onClick, rightIcon, corner, variant, size, style, "data-testid": testId, text, ...rest }: ButtonProps) => React.ReactElement;
|
|
4
4
|
export * from './utils';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Icon } from '@phosphor-icons/react';
|
|
1
2
|
import { Color } from '../../theme';
|
|
2
3
|
export interface ButtonProps {
|
|
3
4
|
/**
|
|
@@ -7,7 +8,7 @@ export interface ButtonProps {
|
|
|
7
8
|
/**
|
|
8
9
|
* Places an icon within the button, before the button's text
|
|
9
10
|
*/
|
|
10
|
-
icon?:
|
|
11
|
+
icon?: Icon;
|
|
11
12
|
/**
|
|
12
13
|
* Visual color to apply to button.
|
|
13
14
|
* For 'solid' variant, sets background color.
|
|
@@ -31,7 +32,7 @@ export interface ButtonProps {
|
|
|
31
32
|
/**
|
|
32
33
|
* Places an icon within the button, after the button's text
|
|
33
34
|
*/
|
|
34
|
-
rightIcon?:
|
|
35
|
+
rightIcon?: Icon;
|
|
35
36
|
/**
|
|
36
37
|
* Corner style of button.
|
|
37
38
|
*/
|
|
@@ -41,6 +42,11 @@ export interface ButtonProps {
|
|
|
41
42
|
* @default 'solid'
|
|
42
43
|
*/
|
|
43
44
|
variant?: 'solid' | 'outlined' | 'text';
|
|
45
|
+
/**
|
|
46
|
+
* Button size.
|
|
47
|
+
* @default 'md'
|
|
48
|
+
*/
|
|
49
|
+
size?: 'sm' | 'md' | 'lg';
|
|
44
50
|
/**
|
|
45
51
|
* Additional style.
|
|
46
52
|
*/
|
|
@@ -8,5 +8,7 @@ interface StyledTextProps {
|
|
|
8
8
|
$textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase';
|
|
9
9
|
$textDecoration?: 'none' | 'underline' | 'line-through' | 'underline line-through';
|
|
10
10
|
}
|
|
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>,
|
|
11
|
+
declare const StyledText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('styled-components/dist/types').Substitute<import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>>, {
|
|
12
|
+
as?: "p" | "span";
|
|
13
|
+
}>, StyledTextProps>> & string;
|
|
12
14
|
export { StyledText };
|
|
@@ -42,6 +42,10 @@ export interface TextProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
|
42
42
|
* Whether to render the text with rich text formatting.
|
|
43
43
|
*/
|
|
44
44
|
useRichText?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The tag to render the text in.
|
|
47
|
+
*/
|
|
48
|
+
as?: 'p' | 'span';
|
|
45
49
|
}
|
|
46
50
|
export interface TagStyle {
|
|
47
51
|
pattern: RegExp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useMediaQuery';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React hook that tracks state of a CSS media query.
|
|
3
|
+
*
|
|
4
|
+
* @param query - The media query string to watch (e.g., '(min-width: 768px)').
|
|
5
|
+
* @returns `true` if the media query matches, `false` otherwise.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useMediaQuery(query: string): boolean;
|