@foris/avocado-suite 1.8.21 → 1.8.22
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/avocado-suite.es.js +15661 -12878
- package/dist/avocado-suite.umd.js +145 -143
- package/dist/components/data-card/DataCard.d.ts +2 -23
- package/dist/components/data-card/dataCard.types.d.ts +48 -0
- package/dist/components/data-card/v2/DataCard.d.ts +4 -0
- package/dist/components/data-card/v2/DataCard.test.d.ts +0 -0
- package/dist/components/data-card/v2/DataCardHeader.d.ts +15 -0
- package/dist/components/data-card/v2/dataCardStatus.d.ts +10 -0
- package/dist/components/previewer-markdown/PreviewerMarkdown.test.d.ts +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +3 -2
|
@@ -1,26 +1,5 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
type Variant = 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
4
|
-
type HeaderStatusColor = Extract<keyof typeof Color, 'palette_1_50' | 'palette_2_50' | 'palette_3_50' | 'palette_4_50' | 'palette_5_50' | 'palette_6_50' | 'palette_7_50' | 'palette_8_50' | 'palette_9_50' | 'palette_10_50' | 'palette_11_50' | 'palette_12_50' | 'palette_13_50' | 'palette_14_50' | 'palette_15_50' | 'palette_16_50' | 'palette_17_50' | 'palette_18_50'>;
|
|
5
|
-
interface DataCardProps {
|
|
6
|
-
/** Render content dataCard */
|
|
7
|
-
children?: React.ReactNode | string;
|
|
8
|
-
/** Overwrite className */
|
|
9
|
-
className?: string;
|
|
10
|
-
/** Render the description */
|
|
11
|
-
description?: string;
|
|
12
|
-
/** Set hasTopBar */
|
|
13
|
-
hasTopBar?: boolean;
|
|
14
|
-
/** Header status color */
|
|
15
|
-
headerStatusColor?: HeaderStatusColor;
|
|
16
|
-
/** Icon of the DataCard */
|
|
17
|
-
icon?: IconTypes;
|
|
18
|
-
/** Title of the DataCard */
|
|
19
|
-
title: string;
|
|
20
|
-
/** Use the variant of the DataCard */
|
|
21
|
-
variant: Variant;
|
|
22
|
-
/** Set content */
|
|
23
|
-
topContent?: React.ReactNode | string;
|
|
24
|
-
}
|
|
2
|
+
import type { DataCardProps } from './dataCard.types';
|
|
25
3
|
declare const DataCard: FC<DataCardProps>;
|
|
26
4
|
export default DataCard;
|
|
5
|
+
export type { DataCardProps, DataCardV1Props, DataCardV1Variant, DataCardV2Props, DataCardV2HeaderStyle, DataCardV2Status, DataCardPaletteIndex, HeaderStatusColor, } from './dataCard.types';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { IconTypes, Color } from '../../../../avocado-icons';
|
|
3
|
+
export type DataCardV1Variant = 'neutral' | 'info' | 'success' | 'warning' | 'error';
|
|
4
|
+
export type DataCardV2Status = 'neutral' | 'success' | 'informative' | 'warning' | 'negative';
|
|
5
|
+
export type DataCardV2HeaderStyle = 'basic' | 'icon' | 'pill';
|
|
6
|
+
export type DataCardPaletteIndex = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17;
|
|
7
|
+
export type HeaderStatusColor = Extract<keyof typeof Color, 'palette_1_50' | 'palette_2_50' | 'palette_3_50' | 'palette_4_50' | 'palette_5_50' | 'palette_6_50' | 'palette_7_50' | 'palette_8_50' | 'palette_9_50' | 'palette_10_50' | 'palette_11_50' | 'palette_12_50' | 'palette_13_50' | 'palette_14_50' | 'palette_15_50' | 'palette_16_50' | 'palette_17_50'>;
|
|
8
|
+
export type DataCardV1Props = {
|
|
9
|
+
version?: 'v1';
|
|
10
|
+
variant: DataCardV1Variant;
|
|
11
|
+
/** @deprecated v2: use `showBorder` */
|
|
12
|
+
hasTopBar?: boolean;
|
|
13
|
+
/** @deprecated v1 only — no v2 equivalent */
|
|
14
|
+
headerStatusColor?: HeaderStatusColor;
|
|
15
|
+
/** @deprecated v1 only — in v2, compose through `children` */
|
|
16
|
+
topContent?: ReactNode;
|
|
17
|
+
/** @deprecated v2: use `descriptionBottom` */
|
|
18
|
+
description?: string;
|
|
19
|
+
title: string;
|
|
20
|
+
icon?: IconTypes;
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
};
|
|
24
|
+
export type DataCardV2Base = {
|
|
25
|
+
version: 'v2';
|
|
26
|
+
status?: DataCardV2Status;
|
|
27
|
+
headerStyle?: DataCardV2HeaderStyle;
|
|
28
|
+
title?: string;
|
|
29
|
+
/** Accessible name when there is no `title` — required on interactive cards */
|
|
30
|
+
ariaLabel?: string;
|
|
31
|
+
descriptionTop?: string;
|
|
32
|
+
descriptionBottom?: string;
|
|
33
|
+
showBorder?: boolean;
|
|
34
|
+
/** Palette override for the top border. Implies the border, so `showBorder` is not needed. */
|
|
35
|
+
borderColor?: DataCardPaletteIndex;
|
|
36
|
+
icon?: IconTypes;
|
|
37
|
+
pillLabel?: string;
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
className?: string;
|
|
40
|
+
};
|
|
41
|
+
export type DataCardV2Props = DataCardV2Base & ({
|
|
42
|
+
onClick?: never;
|
|
43
|
+
disabled?: never;
|
|
44
|
+
} | {
|
|
45
|
+
onClick: () => void;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
});
|
|
48
|
+
export type DataCardProps = DataCardV1Props | DataCardV2Props;
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { IconTypes } from '../../../../../avocado-icons';
|
|
3
|
+
import type { DataCardV2HeaderStyle, DataCardV2Status } from '../dataCard.types';
|
|
4
|
+
type DataCardHeaderProps = {
|
|
5
|
+
headerStyle: DataCardV2HeaderStyle;
|
|
6
|
+
status: DataCardV2Status;
|
|
7
|
+
title?: string;
|
|
8
|
+
descriptionTop?: string;
|
|
9
|
+
descriptionBottom?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
icon?: IconTypes;
|
|
12
|
+
pillLabel?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const DataCardHeader: FC<DataCardHeaderProps>;
|
|
15
|
+
export default DataCardHeader;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IconTypes, Color } from '../../../../../avocado-icons';
|
|
2
|
+
import type { DataCardV2Status } from '../dataCard.types';
|
|
3
|
+
export declare const STATUS_ICON: Record<DataCardV2Status, {
|
|
4
|
+
name: IconTypes;
|
|
5
|
+
color: Color;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const PILL_COLORS: Record<DataCardV2Status, {
|
|
8
|
+
color: Color;
|
|
9
|
+
textColor: Color;
|
|
10
|
+
}>;
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export type { ButtonProps } from './components/button/Button';
|
|
|
69
69
|
export type { BreadcrumbItem } from './components/breadcrumbs/Breadcrumbs';
|
|
70
70
|
export type { CardAccordionProps } from './components/card-accordion/CardAccordion';
|
|
71
71
|
export type { CardNotificationProps } from './components/card-notification/CardNotification';
|
|
72
|
+
export type { DataCardProps, DataCardV1Props, DataCardV1Variant, DataCardV2Props, DataCardV2HeaderStyle, DataCardV2Status, DataCardPaletteIndex, HeaderStatusColor, } from './components/data-card/DataCard';
|
|
72
73
|
export type { DividerProps } from './components/divider/Divider';
|
|
73
74
|
export type { HeadingProps } from './components/heading/Heading';
|
|
74
75
|
export type { LinkProps } from './components/link/Link';
|