@aic-kits/react 0.29.6 → 0.29.9
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/LICENSE.md +5 -5
- package/dist/components/Box/StyledBox.d.ts +2 -2
- package/dist/components/Box/types.d.ts +20 -3
- package/dist/components/Button/types.d.ts +15 -1
- package/dist/components/Touchable/index.d.ts +1 -1
- package/dist/components/Touchable/types.d.ts +20 -5
- package/dist/index.cjs +90 -90
- package/dist/index.js +6317 -6081
- package/package.json +2 -2
package/LICENSE.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Theme } from '../../theme';
|
|
2
2
|
import { ConfigType } from './config';
|
|
3
|
-
import { CustomBoxProps, CSSStyleProps, StyleProps } from './types';
|
|
3
|
+
import { CustomBoxProps, CSSStyleProps, StyleProps, BoxProps } from './types';
|
|
4
4
|
export declare const getThemeValue: (theme: Theme, key: keyof StyleProps, props: StyleProps) => {
|
|
5
5
|
[x: string]: import('../..').WithResponsiveValue<string>;
|
|
6
6
|
} | {
|
|
@@ -9,4 +9,4 @@ export declare const getThemeValue: (theme: Theme, key: keyof StyleProps, props:
|
|
|
9
9
|
export declare const mapStylePropToThemeValue: (theme: Theme, props: StyleProps) => {};
|
|
10
10
|
export declare const configKeys: Array<keyof ConfigType>;
|
|
11
11
|
export declare const genBoxStyle: (theme: Theme, props: StyleProps & CSSStyleProps & CustomBoxProps) => import('styled-components').RuleSet<object>;
|
|
12
|
-
export declare const StyledBox: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyleProps & import('../..').WithResponsive<Pick<import('react').CSSProperties, "filter" | "opacity" | "width" | "height" | "minWidth" | "maxWidth" | "minHeight" | "maxHeight" | "display" | "alignItems" | "alignContent" | "justifyContent" | "flexWrap" | "flexDirection" | "flex" | "flexGrow" | "flexShrink" | "flexBasis" | "alignSelf" | "position" | "top" | "right" | "bottom" | "left" | "overflow" | "cursor" | "transition" | "transform" | "animation" | "willChange" | "pointerEvents" | "userSelect" | "resize" | "boxShadow" | "textShadow" | "backdropFilter" | "mixBlendMode" | "isolation" | "zIndex" | "marginInline" | "marginBlock" | "paddingInline" | "paddingBlock" | "whiteSpace" | "textOverflow" | "overflowY" | "overflowX">> & CustomBoxProps>> & string;
|
|
12
|
+
export declare const StyledBox: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyleProps & import('../..').WithResponsive<Pick<import('react').CSSProperties, "filter" | "opacity" | "width" | "height" | "minWidth" | "maxWidth" | "minHeight" | "maxHeight" | "display" | "alignItems" | "alignContent" | "justifyContent" | "flexWrap" | "flexDirection" | "flex" | "flexGrow" | "flexShrink" | "flexBasis" | "alignSelf" | "position" | "top" | "right" | "bottom" | "left" | "overflow" | "cursor" | "transition" | "transform" | "animation" | "willChange" | "pointerEvents" | "userSelect" | "resize" | "boxShadow" | "textShadow" | "backdropFilter" | "mixBlendMode" | "isolation" | "zIndex" | "marginInline" | "marginBlock" | "paddingInline" | "paddingBlock" | "whiteSpace" | "textOverflow" | "overflowY" | "overflowX">> & CustomBoxProps & BoxProps>> & string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties, HTMLAttributes } from 'react';
|
|
1
|
+
import { CSSProperties, HTMLAttributes, AnchorHTMLAttributes, ElementType } from 'react';
|
|
2
2
|
import { BorderWidth, Color, Radius, Space } from '../../theme';
|
|
3
3
|
import { WithResponsive, WithResponsiveValue } from '../../utils';
|
|
4
4
|
import { ConfigType, CSSPropsKeyType } from './config';
|
|
@@ -37,7 +37,10 @@ export interface CustomBoxProps extends WithResponsive<{
|
|
|
37
37
|
fh?: boolean;
|
|
38
38
|
}> {
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Base props that are common to all Box variants
|
|
42
|
+
*/
|
|
43
|
+
export interface BaseBoxProps {
|
|
41
44
|
/**
|
|
42
45
|
* Box's content.
|
|
43
46
|
*/
|
|
@@ -51,6 +54,20 @@ export interface BoxHTMLProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
51
54
|
*/
|
|
52
55
|
'data-testid'?: string;
|
|
53
56
|
}
|
|
54
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Complete Box component props (div by default, anchor optional)
|
|
59
|
+
*/
|
|
60
|
+
export interface BoxProps extends StyleProps, CSSStyleProps, CustomBoxProps, BaseBoxProps, Omit<HTMLAttributes<HTMLElement>, keyof BaseBoxProps>, Partial<AnchorHTMLAttributes<HTMLElement>> {
|
|
61
|
+
/**
|
|
62
|
+
* Tell `Box` to render a different underlying element (e.g. `'a'`).
|
|
63
|
+
* By default, it renders a `<div>`.
|
|
64
|
+
*/
|
|
65
|
+
as?: string | ElementType;
|
|
55
66
|
}
|
|
67
|
+
export type BoxDivProps = Omit<BoxProps, keyof AnchorHTMLAttributes<HTMLElement>>;
|
|
68
|
+
export type BoxAnchorProps = BoxProps & {
|
|
69
|
+
as: 'a';
|
|
70
|
+
href: string;
|
|
71
|
+
};
|
|
72
|
+
export type BoxElementProps = BoxDivProps | BoxAnchorProps;
|
|
56
73
|
export {};
|
|
@@ -2,7 +2,7 @@ import { Icon } from '@phosphor-icons/react';
|
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
import { ButtonCorner, ButtonSize, ButtonVariant, Color } from '../../theme';
|
|
4
4
|
import { BoxProps } from '../Box';
|
|
5
|
-
interface
|
|
5
|
+
interface ButtonSpecificProps {
|
|
6
6
|
/**
|
|
7
7
|
* Disable state of button.
|
|
8
8
|
*/
|
|
@@ -57,6 +57,19 @@ interface ButtonBaseProps extends BoxProps {
|
|
|
57
57
|
* Testing id of the component.
|
|
58
58
|
*/
|
|
59
59
|
'data-testid'?: string;
|
|
60
|
+
/**
|
|
61
|
+
* When provided, the button will render as an anchor link (`<a>`),
|
|
62
|
+
* delegating the behavior to the underlying `Touchable` component.
|
|
63
|
+
*/
|
|
64
|
+
href?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Target attribute for the anchor tag (e.g., `_blank`). Only used when `href` is provided.
|
|
67
|
+
*/
|
|
68
|
+
target?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Rel attribute for the anchor tag (e.g., `noopener noreferrer`). Only used when `href` is provided.
|
|
71
|
+
*/
|
|
72
|
+
rel?: string;
|
|
60
73
|
}
|
|
61
74
|
type ButtonContentProps = {
|
|
62
75
|
icon: Icon;
|
|
@@ -65,5 +78,6 @@ type ButtonContentProps = {
|
|
|
65
78
|
icon?: Icon;
|
|
66
79
|
text: React.ReactNode;
|
|
67
80
|
};
|
|
81
|
+
type ButtonBaseProps = BoxProps & ButtonSpecificProps;
|
|
68
82
|
export type ButtonProps = ButtonBaseProps & ButtonContentProps;
|
|
69
83
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ForwardedRef } from 'react';
|
|
2
2
|
import { TouchableProps } from './types';
|
|
3
|
-
declare function PlainTouchable({ children, onClick, style, useScaleAnimation, useOpacityAnimation, 'data-testid': testId, ...props }: TouchableProps, ref: ForwardedRef<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function PlainTouchable({ children, onClick, style, useScaleAnimation, useOpacityAnimation, href, target, rel, 'data-testid': testId, ...props }: TouchableProps, ref: ForwardedRef<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const Touchable: (props: TouchableProps & {
|
|
5
5
|
ref?: ForwardedRef<HTMLDivElement>;
|
|
6
6
|
}) => ReturnType<typeof PlainTouchable>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
2
2
|
import { BoxProps } from '../Box';
|
|
3
|
-
export
|
|
3
|
+
export type TouchableProps = BoxProps & {
|
|
4
4
|
/**
|
|
5
5
|
* Touchable's content.
|
|
6
6
|
*/
|
|
7
|
-
children?:
|
|
7
|
+
children?: ReactNode;
|
|
8
8
|
/**
|
|
9
9
|
* Additional styles.
|
|
10
10
|
*/
|
|
11
|
-
style?:
|
|
11
|
+
style?: CSSProperties;
|
|
12
12
|
/**
|
|
13
13
|
* Testing id of the component.
|
|
14
14
|
*/
|
|
@@ -23,4 +23,19 @@ export interface TouchableProps extends React.HTMLAttributes<HTMLDivElement>, Bo
|
|
|
23
23
|
* @default true
|
|
24
24
|
*/
|
|
25
25
|
useOpacityAnimation?: boolean;
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* URL to navigate to when the touchable is clicked.
|
|
28
|
+
* When provided, renders as an anchor tag.
|
|
29
|
+
*/
|
|
30
|
+
href?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Target attribute for the anchor tag.
|
|
33
|
+
* Only used when href is provided.
|
|
34
|
+
*/
|
|
35
|
+
target?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Rel attribute for the anchor tag.
|
|
38
|
+
* Only used when href is provided.
|
|
39
|
+
*/
|
|
40
|
+
rel?: string;
|
|
41
|
+
};
|