@foris/avocado-not-front 8.0.0 → 8.0.2
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-not-front/src/components/body/Body.d.ts +1 -0
- package/dist/avocado-not-front/src/components/contextual-navigation/ContextualNavigation.d.ts +9 -0
- package/dist/avocado-not-front/src/components/contextual-navigation/ContextualNavigation.test.d.ts +1 -0
- package/dist/avocado-not-front/src/components/contextual-navigation/useContextualNavigationActions.d.ts +7 -0
- package/dist/avocado-not-front/src/components/contextual-navigation/useContextualNavigationActions.test.d.ts +1 -0
- package/dist/avocado-not-front/src/components/file-upload/FileUpload.d.ts +9 -0
- package/dist/avocado-not-front/src/components/file-upload/FileUpload.test.d.ts +1 -0
- package/dist/avocado-not-front/src/components/file-upload/fileUploadRules.util.d.ts +5 -0
- package/dist/avocado-not-front/src/components/file-upload/fileUploadRules.util.test.d.ts +1 -0
- package/dist/avocado-not-front/src/components/file-upload/index.d.ts +1 -0
- package/dist/avocado-not-front/src/components/index.d.ts +2 -1
- package/dist/avocado-not-front/src/hooks/builder/useBuilder.d.ts +5 -1
- package/dist/avocado-not-front/src/types/builder.type.d.ts +3 -1
- package/dist/avocado-not-front/src/types/components.type.d.ts +31 -5
- package/dist/avocado-not-front.es.js +1240 -1142
- package/dist/avocado-not-front.umd.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -2,6 +2,7 @@ import type { FC, ReactNode } from 'react';
|
|
|
2
2
|
import type { ObjectNotFront } from '../../types';
|
|
3
3
|
interface BodyProps extends ObjectNotFront {
|
|
4
4
|
inputs: ReactNode[];
|
|
5
|
+
embedded?: boolean;
|
|
5
6
|
}
|
|
6
7
|
/**
|
|
7
8
|
* Body component that renders a list of dynamic components inside a section.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
|
+
import type { ContextualNavigationNotFrontProps } from '../../types';
|
|
3
|
+
export interface ContextualNavigationNotFrontExtendedProps extends ContextualNavigationNotFrontProps {
|
|
4
|
+
userFlow: string;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/** JSON adapter for the page `contextualNavigation` slot. */
|
|
8
|
+
declare const ContextualNavigationNotFront: FC<ContextualNavigationNotFrontExtendedProps>;
|
|
9
|
+
export default ContextualNavigationNotFront;
|
package/dist/avocado-not-front/src/components/contextual-navigation/ContextualNavigation.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MouseEvent } from 'react';
|
|
2
|
+
import type { ContextualNavigationNotFrontProps } from '../../types';
|
|
3
|
+
/** Maps JSON destinations to suite items and wires breadcrumb-style actions. */
|
|
4
|
+
export declare const useContextualNavigationActions: (userFlow: string, responseKey: string, sections?: ContextualNavigationNotFrontProps['sections']) => {
|
|
5
|
+
sections: ContextualNavigationItem[][];
|
|
6
|
+
onItemClick: (item: ContextualNavigationItem, event: MouseEvent<HTMLElement>) => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { FileUploadNotFrontProps } from '../../types';
|
|
3
|
+
interface FileUploadNotFrontExtendedProps extends FileUploadNotFrontProps {
|
|
4
|
+
userFlow: string;
|
|
5
|
+
pageId: string;
|
|
6
|
+
}
|
|
7
|
+
/** Binds suite FileUpload to `entries[responseKey]`; see `.agents/rules/packages/avocado-not-front.md`. */
|
|
8
|
+
declare const FileUploadNotFront: FC<FileUploadNotFrontExtendedProps>;
|
|
9
|
+
export default FileUploadNotFront;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FileUploadNotFront } from './FileUpload';
|
|
@@ -19,6 +19,7 @@ import ContentWrapper from './content-wrapper/ContentWrapper';
|
|
|
19
19
|
import DataCard from './data-card/DataCard';
|
|
20
20
|
import Divider from './divider/Divider';
|
|
21
21
|
import Drawer from './drawer/Drawer';
|
|
22
|
+
import FileUploadNotFront from './file-upload/FileUpload';
|
|
22
23
|
import DropdownButtonNotFront from './dropdown-button/DropdownButton';
|
|
23
24
|
import Header from './header/Header';
|
|
24
25
|
import HeaderNavigation from './header-navigation/HeaderNavigation';
|
|
@@ -41,4 +42,4 @@ import Toast from './toast/Toast';
|
|
|
41
42
|
import Tooltip from './tooltip/Tooltip';
|
|
42
43
|
import { NotFrontPage } from './not-front-page/NotFrontPage';
|
|
43
44
|
import { RenderNotFront, renderNotFront, extractNotFrontComponents } from './render-not-front';
|
|
44
|
-
export { Accordion, AIChatPanel, AIPromptCodeEditor, AISummaryCard, Body, Box, RadioGroupNotFront, StepperNotFront, ProgressBarNotFront, Breadcrumbs, Button, CardAccordion, CardNotFront, CardNotification, Chart, Checkbox, CodeEditor, ContentWrapper, DataCard, Divider, Drawer, DropdownButtonNotFront, Header, HeaderNavigation, Link, MenuNotFront, Modal, NotFrontPage, OverlayRenderer, RenderNotFront, renderNotFront, extractNotFrontComponents, Pill, PreviewerMarkdown, RoundButton, Row, Select, Spacing, Switch, Table, Tabs, Textarea, TextField, Toast, Tooltip, };
|
|
45
|
+
export { Accordion, AIChatPanel, AIPromptCodeEditor, AISummaryCard, Body, Box, RadioGroupNotFront, StepperNotFront, ProgressBarNotFront, Breadcrumbs, Button, CardAccordion, CardNotFront, CardNotification, Chart, Checkbox, CodeEditor, ContentWrapper, DataCard, Divider, Drawer, FileUploadNotFront, DropdownButtonNotFront, Header, HeaderNavigation, Link, MenuNotFront, Modal, NotFrontPage, OverlayRenderer, RenderNotFront, renderNotFront, extractNotFrontComponents, Pill, PreviewerMarkdown, RoundButton, Row, Select, Spacing, Switch, Table, Tabs, Textarea, TextField, Toast, Tooltip, };
|
|
@@ -7,6 +7,10 @@ import type { ObjectNotFront, ResolveComponentPropsMap } from '../../types';
|
|
|
7
7
|
* @param pageId - The current page identifier.
|
|
8
8
|
* @param type - Indicates whether to render a 'body', 'header'.
|
|
9
9
|
* @param notFrontObject - The configuration object containing component data.
|
|
10
|
+
* @param options.embedded - Renders the body without its own page padding.
|
|
10
11
|
* @returns A rendered Header, Body or Components with its child components or null if the type is unrecognized.
|
|
11
12
|
*/
|
|
12
|
-
export declare const useBuilder: (userFlow: string, pageId: string, type: 'body' | 'header', notFrontObject: ObjectNotFront | null, onResolveComponentProps
|
|
13
|
+
export declare const useBuilder: (userFlow: string, pageId: string, type: 'body' | 'header', notFrontObject: ObjectNotFront | null, { onResolveComponentProps, embedded, }?: {
|
|
14
|
+
onResolveComponentProps?: ResolveComponentPropsMap | undefined;
|
|
15
|
+
embedded?: boolean | undefined;
|
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HeaderNavigationNotFrontProps, NotFrontComponent } from './components.type';
|
|
1
|
+
import type { ContextualNavigationNotFrontProps, HeaderNavigationNotFrontProps, NotFrontComponent } from './components.type';
|
|
2
2
|
import type { NotFrontDataSource } from './componentsCore.type';
|
|
3
3
|
/**
|
|
4
4
|
* Interface for the configuration required to interact with the API.
|
|
@@ -62,6 +62,8 @@ export type PageContent = {
|
|
|
62
62
|
type: 'page';
|
|
63
63
|
/** Full-width navigation banner, rendered after an explicit legacy header and before the body. */
|
|
64
64
|
headerNavigation?: HeaderNavigationNotFrontProps | null;
|
|
65
|
+
/** Optional L2 sidebar navigation wrapping the built body. */
|
|
66
|
+
contextualNavigation?: ContextualNavigationNotFrontProps | null;
|
|
65
67
|
/**
|
|
66
68
|
* A collection of components to be rendered in the page.
|
|
67
69
|
* These components make up the structure of the page content.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccordionProps, ButtonProps, CardAccordionProps, CardNotificationProps, CheckboxProps, DataCardPaletteIndex, DataCardV2HeaderStyle, DataCardV2Status, DividerProps, DrawerProps, HeadingProps, HeaderNavigationVisual, LinkProps, ModalProps, PillProps, PreviewerMarkdownProps, RoundButtonProps, SelectProps, SwitchProps, TableColumn, TableProps, TabsProps, TextareaProps, TextFieldProps, TextProps } from '../../../avocado-suite';
|
|
1
|
+
import type { AccordionProps, ButtonProps, CardAccordionProps, CardNotificationProps, CheckboxProps, ContextualNavigationItem, DataCardPaletteIndex, DataCardV2HeaderStyle, DataCardV2Status, DividerProps, DrawerProps, DropzoneUploadStatus, FileUploadProps, HeadingProps, HeaderNavigationVisual, LinkProps, ModalProps, PillProps, PreviewerMarkdownProps, RoundButtonProps, SelectProps, SwitchProps, TableColumn, TableProps, TabsProps, TextareaProps, TextFieldProps, TextProps } from '../../../avocado-suite';
|
|
2
2
|
import type { AiAgentTheme, ChatPanelTranslations, SuggestionType, SupportedLocale } from '../../../ai-agent';
|
|
3
3
|
import type { TooltipCoverageConfig } from '../components/chart/chart.types';
|
|
4
4
|
import type { ChartSeriesConfig, ChartYAxisConfig } from '../components/chart/chart.types';
|
|
@@ -11,8 +11,8 @@ export interface BoxNotFrontProps extends NotFrontBaseProps {
|
|
|
11
11
|
component: 'box';
|
|
12
12
|
content: NotFrontComponent[];
|
|
13
13
|
}
|
|
14
|
-
/** Navigation action
|
|
15
|
-
export type
|
|
14
|
+
/** Navigation action shared by breadcrumbs and sidebar destinations; no action means inert. */
|
|
15
|
+
export type NotFrontNavigationAction = {
|
|
16
16
|
actionType?: never;
|
|
17
17
|
} | {
|
|
18
18
|
actionType: 'REDIRECT';
|
|
@@ -21,7 +21,9 @@ export type HeaderNavigationBreadcrumbNotFront = Pick<BreadcrumbsItemNotFront, '
|
|
|
21
21
|
actionType: 'GO_TO_NEXT_UI';
|
|
22
22
|
hashCode: string;
|
|
23
23
|
responseKey?: string;
|
|
24
|
-
}
|
|
24
|
+
};
|
|
25
|
+
/** Header breadcrumb using the existing breadcrumb field names. */
|
|
26
|
+
export type HeaderNavigationBreadcrumbNotFront = Pick<BreadcrumbsItemNotFront, 'title'> & NotFrontNavigationAction;
|
|
25
27
|
/** Serializable menu row, executed by the standard not-front button pipeline. */
|
|
26
28
|
export type ButtonActionFields = Pick<ButtonNotFrontProps, 'responseKey' | 'actionType' | 'dependencies'> & {
|
|
27
29
|
dataSource?: ButtonNotFrontProps['dataSource'];
|
|
@@ -47,6 +49,15 @@ export interface HeaderNavigationNotFrontProps extends NotFrontBaseProps {
|
|
|
47
49
|
/** Additional content such as a stepper. */
|
|
48
50
|
components?: NotFrontComponent[];
|
|
49
51
|
}
|
|
52
|
+
/** Serializable destination; `REDIRECT` becomes the suite item's `href`. */
|
|
53
|
+
export type ContextualNavigationItemNotFront = Omit<ContextualNavigationItem, 'href'> & NotFrontNavigationAction;
|
|
54
|
+
/** Page-slot sidebar navigation; not a `body.components` entry. */
|
|
55
|
+
export interface ContextualNavigationNotFrontProps extends NotFrontBaseProps {
|
|
56
|
+
sections: ContextualNavigationItemNotFront[][];
|
|
57
|
+
activeId?: string;
|
|
58
|
+
persistenceKey?: string;
|
|
59
|
+
ariaLabel?: string;
|
|
60
|
+
}
|
|
50
61
|
/**
|
|
51
62
|
* Interface for the props used in the ChartNotFront component.
|
|
52
63
|
*/
|
|
@@ -258,6 +269,20 @@ export interface DividerNotFrontProps extends NotFrontBaseProps, DividerProps {
|
|
|
258
269
|
/** Set the position vertical */
|
|
259
270
|
vertical?: boolean;
|
|
260
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Interface for the props used in the FileUploadNotFront component.
|
|
274
|
+
*/
|
|
275
|
+
export interface FileUploadNotFrontProps extends NotFrontBaseProps, Omit<FileUploadProps, 'file' | 'rules' | 'onFileChange' | 'onRemove' | 'onTemplateLinkClick' | 'templateHref' | 'disabled' | 'uploadStatus' | 'notificationVisible'> {
|
|
276
|
+
component: 'fileUpload';
|
|
277
|
+
rule1: string;
|
|
278
|
+
rule2?: string;
|
|
279
|
+
disabled?: boolean;
|
|
280
|
+
uploadStatus?: DropzoneUploadStatus;
|
|
281
|
+
notificationVisible?: boolean;
|
|
282
|
+
templateRedirectUrl?: string;
|
|
283
|
+
templateTarget?: '_blank' | '_self';
|
|
284
|
+
dependencies?: NotFrontDependency[];
|
|
285
|
+
}
|
|
261
286
|
/**
|
|
262
287
|
* Interface for the props used in the HeadingNotFront component.
|
|
263
288
|
*/
|
|
@@ -1356,7 +1381,7 @@ export interface AIPromptCodeEditorNotFrontProps extends NotFrontBaseProps {
|
|
|
1356
1381
|
/**
|
|
1357
1382
|
* Union type representing all possible NotFront component prop types.
|
|
1358
1383
|
*/
|
|
1359
|
-
export type NotFrontComponent = HeaderNavigationNotFrontProps | AccordionNotFrontProps | AIChatPanelNotFrontProps | AIPromptCodeEditorNotFrontProps | AISummaryCardNotFrontProps | BoxNotFrontProps | BreadcrumbsNotFrontProps | ButtonNotFrontProps | CardAccordionNotFrontProps | CardNotFrontProps | CardNotificationNotFrontProps | ChartNotFrontProps | CheckboxNotFrontProps | CodeEditorNotFrontProps | DataCardNotFrontProps | DividerNotFrontProps | DrawerNotFrontProps | DropdownButtonNotFrontProps | HeadingNotFrontProps | LinkNotFrontProps | MenuNotFrontProps | ModalNotFrontProps | PillNotFrontProps | PreviewerMarkdownNotFrontProps | RadioGroupNotFrontProps | RoundButtonNotFrontProps | RowNotFrontProps | SelectNotFrontProps | SpacingNotFrontProps | StepperNotFrontProps | ProgressBarNotFrontProps | SwitchNotFrontProps | TableNotFrontProps | TabsNotFrontProps | TextareaNotFrontProps | TextFieldNotFrontProps | TextNotFrontProps | ToastNotFrontProps | TooltipNotFrontProps;
|
|
1384
|
+
export type NotFrontComponent = HeaderNavigationNotFrontProps | AccordionNotFrontProps | AIChatPanelNotFrontProps | AIPromptCodeEditorNotFrontProps | AISummaryCardNotFrontProps | BoxNotFrontProps | BreadcrumbsNotFrontProps | ButtonNotFrontProps | CardAccordionNotFrontProps | CardNotFrontProps | CardNotificationNotFrontProps | ChartNotFrontProps | CheckboxNotFrontProps | CodeEditorNotFrontProps | DataCardNotFrontProps | DividerNotFrontProps | DrawerNotFrontProps | DropdownButtonNotFrontProps | FileUploadNotFrontProps | HeadingNotFrontProps | LinkNotFrontProps | MenuNotFrontProps | ModalNotFrontProps | PillNotFrontProps | PreviewerMarkdownNotFrontProps | RadioGroupNotFrontProps | RoundButtonNotFrontProps | RowNotFrontProps | SelectNotFrontProps | SpacingNotFrontProps | StepperNotFrontProps | ProgressBarNotFrontProps | SwitchNotFrontProps | TableNotFrontProps | TabsNotFrontProps | TextareaNotFrontProps | TextFieldNotFrontProps | TextNotFrontProps | ToastNotFrontProps | TooltipNotFrontProps;
|
|
1360
1385
|
/**
|
|
1361
1386
|
* Resolved props for ChatPanel when delegated via onResolveComponentProps.
|
|
1362
1387
|
* These are the props that the consumer receives to render ChatPanel externally.
|
|
@@ -1428,6 +1453,7 @@ export type NotFrontComponentTypeMap = {
|
|
|
1428
1453
|
divider: DividerNotFrontProps;
|
|
1429
1454
|
drawer: DrawerNotFrontProps;
|
|
1430
1455
|
dropdownButton: DropdownButtonNotFrontProps;
|
|
1456
|
+
fileUpload: FileUploadNotFrontProps;
|
|
1431
1457
|
heading: HeadingNotFrontProps;
|
|
1432
1458
|
link: LinkNotFrontProps;
|
|
1433
1459
|
menu: MenuNotFrontProps;
|