@aic-kits/react 0.5.0 → 0.7.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/Accordion/Accordion.d.ts +2 -0
- package/dist/components/Accordion/AccordionContent.d.ts +7 -0
- package/dist/components/Accordion/AccordionHeader.d.ts +9 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Accordion/types.d.ts +27 -0
- package/dist/components/Box/StyledBox.d.ts +4 -0
- package/dist/components/Box/config.d.ts +1 -1
- package/dist/components/Carousel/CarouselItems.d.ts +1 -2
- package/dist/components/List/index.d.ts +2 -41
- package/dist/components/List/types.d.ts +40 -0
- package/dist/components/List/utils.d.ts +12 -0
- package/dist/components/Touchable/types.d.ts +10 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.cjs +62 -63
- package/dist/index.js +2889 -2644
- package/dist/theme/common/spaces.d.ts +1 -1
- package/dist/theme/components/accordion.d.ts +22 -0
- package/dist/theme/components/index.d.ts +3 -0
- package/package.json +2 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface AccordionContentProps {
|
|
3
|
+
renderContent: () => React.ReactNode;
|
|
4
|
+
isExpanded: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function AccordionContent({ renderContent, isExpanded, }: AccordionContentProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface AccordionHeaderProps {
|
|
3
|
+
renderHeader: (isExpanded: boolean) => React.ReactNode;
|
|
4
|
+
isExpanded: boolean;
|
|
5
|
+
onToggle: () => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function AccordionHeader({ renderHeader, isExpanded, onToggle, disabled, }: AccordionHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BoxProps } from '../Box';
|
|
3
|
+
export interface AccordionProps extends BoxProps {
|
|
4
|
+
/**
|
|
5
|
+
* Function to render the header content.
|
|
6
|
+
* Receives an `isExpanded` boolean.
|
|
7
|
+
*/
|
|
8
|
+
renderHeader: (isExpanded: boolean) => React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Function to render the collapsible content.
|
|
11
|
+
*/
|
|
12
|
+
renderContent: () => React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Initial expanded state.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
initialExpanded?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Callback fired when the expanded state changes.
|
|
20
|
+
*/
|
|
21
|
+
onExpandedChange?: (isExpanded: boolean) => void;
|
|
22
|
+
/**
|
|
23
|
+
* If true, the accordion will be disabled and cannot be toggled.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}
|
|
@@ -48,5 +48,9 @@ export declare const genBoxStyle: (theme: Theme, props: StyleProps & CSSStylePro
|
|
|
48
48
|
mixBlendMode?: import("csstype").Property.MixBlendMode | undefined;
|
|
49
49
|
isolation?: import("csstype").Property.Isolation | undefined;
|
|
50
50
|
zIndex?: import("csstype").Property.ZIndex | undefined;
|
|
51
|
+
marginInline?: import("csstype").Property.MarginInline<string | number> | undefined;
|
|
52
|
+
marginBlock?: import("csstype").Property.MarginBlock<string | number> | undefined;
|
|
53
|
+
paddingInline?: import("csstype").Property.PaddingInline<string | number> | undefined;
|
|
54
|
+
paddingBlock?: import("csstype").Property.PaddingBlock<string | number> | undefined;
|
|
51
55
|
};
|
|
52
56
|
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 & CSSStyleProps & CustomBoxProps>> & string;
|
|
@@ -465,7 +465,7 @@ declare const config: {
|
|
|
465
465
|
readonly scale: "colors";
|
|
466
466
|
};
|
|
467
467
|
};
|
|
468
|
-
export declare const cssPropsKey: readonly ["alignContent", "alignItems", "alignSelf", "display", "flex", "flexBasis", "flexDirection", "flexGrow", "flexShrink", "flexWrap", "justifyContent", "position", "top", "right", "bottom", "left", "overflow", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight", "opacity", "cursor", "transition", "transform", "animation", "willChange", "pointerEvents", "userSelect", "resize", "boxShadow", "textShadow", "filter", "backdropFilter", "mixBlendMode", "isolation", "zIndex"];
|
|
468
|
+
export declare const cssPropsKey: readonly ["alignContent", "alignItems", "alignSelf", "display", "flex", "flexBasis", "flexDirection", "flexGrow", "flexShrink", "flexWrap", "justifyContent", "position", "top", "right", "bottom", "left", "overflow", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight", "opacity", "cursor", "transition", "transform", "animation", "willChange", "pointerEvents", "userSelect", "resize", "boxShadow", "textShadow", "filter", "backdropFilter", "mixBlendMode", "isolation", "zIndex", "marginInline", "marginBlock", "paddingInline", "paddingBlock"];
|
|
469
469
|
export declare const customBoxPropsKey: readonly ["absoluteFill", "fullWidth", "fullHeight", "fw", "fh"];
|
|
470
470
|
export type ColorPropsKeyType = keyof typeof colors;
|
|
471
471
|
export type SpacePropsKeyType = keyof typeof spaces;
|
|
@@ -2,10 +2,9 @@ import { Space } from '../../theme';
|
|
|
2
2
|
import { CarouselProps } from './types';
|
|
3
3
|
export declare const scrollAnimation: import('styled-components/dist/models/Keyframes').default;
|
|
4
4
|
interface CarouselItemsProps<T> extends Pick<CarouselProps<T>, 'autoScroll' | 'itemSpacing' | 'items' | 'renderItem' | 'keyExtractor'> {
|
|
5
|
-
isScrolling: boolean;
|
|
6
5
|
itemSpacing: Space | undefined;
|
|
7
6
|
itemsWrapperRef: React.RefObject<HTMLDivElement | null>;
|
|
8
7
|
activeIndex: number;
|
|
9
8
|
}
|
|
10
|
-
export declare function CarouselItems<T>({
|
|
9
|
+
export declare function CarouselItems<T>({ itemSpacing, itemsWrapperRef, items, renderItem, keyExtractor, autoScroll, activeIndex, }: CarouselItemsProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
export {};
|
|
@@ -1,45 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export interface ListProps<T = any> extends BoxProps {
|
|
5
|
-
/**
|
|
6
|
-
* The data array to be rendered
|
|
7
|
-
*/
|
|
8
|
-
data?: T[];
|
|
9
|
-
/**
|
|
10
|
-
* Function to render an item from the data array
|
|
11
|
-
*/
|
|
12
|
-
renderItem?: (item: T, index: number) => React.ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Optional key extractor function
|
|
15
|
-
*/
|
|
16
|
-
keyExtractor?: (item: T, index: number) => string;
|
|
17
|
-
/**
|
|
18
|
-
* Component to render when the list is empty
|
|
19
|
-
*/
|
|
20
|
-
ListEmptyComponent?: React.ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* Component to render at the top of the list
|
|
23
|
-
*/
|
|
24
|
-
ListHeaderComponent?: React.ReactNode;
|
|
25
|
-
/**
|
|
26
|
-
* Component to render at the bottom of the list
|
|
27
|
-
*/
|
|
28
|
-
ListFooterComponent?: React.ReactNode;
|
|
29
|
-
/**
|
|
30
|
-
* Component to render between each item
|
|
31
|
-
*/
|
|
32
|
-
ItemSeparatorComponent?: React.ReactNode;
|
|
33
|
-
/**
|
|
34
|
-
* Gap between items (overrides the theme gap)
|
|
35
|
-
*/
|
|
36
|
-
itemGap?: Space;
|
|
37
|
-
/**
|
|
38
|
-
* Additional props
|
|
39
|
-
*/
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
}
|
|
42
|
-
declare function InternalList<T>({ data, renderItem, keyExtractor, ListEmptyComponent, ListHeaderComponent, ListFooterComponent, ItemSeparatorComponent, itemGap, ...rest }: ListProps<T>, ref: React.Ref<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
import { ListProps } from './types';
|
|
3
|
+
declare function InternalList<T>(props: ListProps<T>, ref: React.Ref<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
43
4
|
export declare const List: <T>(props: ListProps<T> & {
|
|
44
5
|
ref?: React.Ref<HTMLDivElement>;
|
|
45
6
|
}) => ReturnType<typeof InternalList>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Space } from '../../theme/common';
|
|
2
|
+
import { BoxProps } from '../Box';
|
|
3
|
+
export interface ListProps<T = any> extends BoxProps {
|
|
4
|
+
/**
|
|
5
|
+
* The data array to be rendered
|
|
6
|
+
*/
|
|
7
|
+
data?: T[];
|
|
8
|
+
/**
|
|
9
|
+
* Function to render an item from the data array
|
|
10
|
+
*/
|
|
11
|
+
renderItem?: (item: T, index: number) => React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Optional key extractor function
|
|
14
|
+
*/
|
|
15
|
+
keyExtractor?: (item: T, index: number) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Component to render when the list is empty
|
|
18
|
+
*/
|
|
19
|
+
ListEmptyComponent?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Component to render at the top of the list
|
|
22
|
+
*/
|
|
23
|
+
ListHeaderComponent?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Component to render at the bottom of the list
|
|
26
|
+
*/
|
|
27
|
+
ListFooterComponent?: React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Component to render between each item
|
|
30
|
+
*/
|
|
31
|
+
ItemSeparatorComponent?: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Gap between items (overrides the theme gap)
|
|
34
|
+
*/
|
|
35
|
+
itemGap?: Space;
|
|
36
|
+
/**
|
|
37
|
+
* Additional props
|
|
38
|
+
*/
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BoxProps } from '../Box';
|
|
2
|
+
import { ListProps } from './types';
|
|
3
|
+
declare const contentPropsKeys: (keyof BoxProps)[];
|
|
4
|
+
/**
|
|
5
|
+
* Separates ListProps into props for the outer container and inner content Box.
|
|
6
|
+
*/
|
|
7
|
+
export declare function splitListProps<T>(props: ListProps<T>): {
|
|
8
|
+
listProps: Omit<ListProps<T>, keyof BoxProps>;
|
|
9
|
+
contentProps: Pick<BoxProps, (typeof contentPropsKeys)[number]>;
|
|
10
|
+
containerProps: Omit<BoxProps, (typeof contentPropsKeys)[number]>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -13,4 +13,14 @@ export interface TouchableProps extends React.HTMLAttributes<HTMLDivElement>, Bo
|
|
|
13
13
|
* Testing id of the component.
|
|
14
14
|
*/
|
|
15
15
|
'data-testid'?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Toggle the scale animation of the component.
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
useScaleAnimation?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Toggle the opacity animation of the component.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
useOpacityAnimation?: boolean;
|
|
16
26
|
}
|