@apia/components 3.0.21 → 3.0.23

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/index.d.ts CHANGED
@@ -200,6 +200,9 @@ declare const Modal: React__default.ForwardRefExoticComponent<{
200
200
  } & Pick<IDialogHeader, "hideCloseButton"> & React__default.RefAttributes<HTMLDivElement>>;
201
201
 
202
202
  type TOpenModal = Pick<TModal, 'NavBar' | 'Portal' | 'children' | 'className' | 'hideCloseButton' | 'initialFocusGetter' | 'initialFocusConfiguration' | 'maxWidth' | 'noHeader' | 'onExited' | 'shouldCloseOnEsc' | 'shouldCloseOnOverlayClick' | 'size' | 'stretch' | 'title' | 'variant' | 'draggable' | 'onClose' | 'onDragStart' | 'defaultPosition'> & {
203
+ /**
204
+ * This id may be used to close the modal.
205
+ */
203
206
  id?: string;
204
207
  children?: React__default.ReactNode;
205
208
  confirmProps?: Omit<IConfirm, 'onConfirmOk' | 'onConfirmCancel' | 'children'>;
@@ -236,6 +239,7 @@ declare class ApiaUtilModalHandler {
236
239
  declare class ApiaUtilModals {
237
240
  #private;
238
241
  constructor();
242
+ close(id: string): void;
239
243
  open(props: TOpenModal): ApiaUtilModalHandler;
240
244
  Component: () => React$1.JSX.Element;
241
245
  }
@@ -626,6 +630,7 @@ type TSubmenu = {
626
630
  items: TMenuItems;
627
631
  };
628
632
  type TMenuItem = (MenuItemProps & {
633
+ icon?: TIconName;
629
634
  key: string;
630
635
  }) | 'separator' | TSubmenu;
631
636
  type TMenuItems = TMenuItem[];
@@ -1792,5 +1797,95 @@ declare const SortableList: ((props: {
1792
1797
  displayName: string;
1793
1798
  };
1794
1799
 
1795
- export { Accordion, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, AutoEllipsis, Autocomplete, type AutocompleteCmpProps, AutocompleteController, type AutocompleteOption, type AutocompleteProps, AutogrowTextarea, BaseButton, CalendarModal, Captcha, Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DefaultAccordionItemButton, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, FieldErrorMessage, FieldLabel, type IAccordionItemButton, type IAccordionItemProps, type IAccordionProps, type IAlert, type IApiaFilter, type ICalendarModal, type IConfirm, type IDialogButtonBar, type IDialogHeader, type IField, type IFieldErrorMessage, type IIconInput, type IOverlay, type IRequiredMark, type IResponsiveComponent, type ISimpleButton, IconButton, IconInput, IconsList, LabelBox, LinearLoader, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, Modal, NumberInput, Overlay, ProgressBar, RequiredMark, ScreenLocker, SimpleButton, SortableList, SortableListItem, type TAccordionHandler, type TAccordionItemButton, type TApiaButtonType, type TApiaIconButton, type TCheckbox, type TDateProps, type TFieldLabel, type TGetTabsController, type TIcon, type TIconButton, type TIconRenderer, type TIconSize, type TIconsList, type TListbox, type TMenuItem, type TModal, type TModalSize, type TNumberInput, type TNumberInputChangeEvent, type TOnClickNode, type TOnConfirmSelection, type TOnSelectionChange, type TOpenModal, type TSubmenu, type TTab, type TTabLabelRenderer as TTabRenderer, type TToolbarIconButton as TToolDefinition, type TTooltip, type TUseModalConfiguration, Tab, Tabs, TabsContent, TabsController, TabsList, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, makeResponsiveComponent, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useModal, useModalContext, useOtherTagButton };
1800
+ type TMessageType = 'user' | 'system' | 'warning' | 'error' | 'information' | 'response' | 'multipleChoice' | 'customMessage';
1801
+ interface IAttachment {
1802
+ name: string;
1803
+ id: string;
1804
+ value: string;
1805
+ description?: string;
1806
+ }
1807
+ type TChatControllerState = {
1808
+ isLoading: boolean;
1809
+ canRecord: boolean;
1810
+ canAttach: boolean;
1811
+ maxAttachmentsSize: number;
1812
+ messages: ChatMessage[];
1813
+ currentMessage: ChatMessage;
1814
+ };
1815
+ interface MessageCallbackProps {
1816
+ message: ChatMessage;
1817
+ }
1818
+ type MessageSubmitCallback = (props: MessageCallbackProps) => unknown;
1819
+
1820
+ declare class ChatMessage {
1821
+ message: ReactNode;
1822
+ messageType: TMessageType;
1823
+ attachments: IAttachment[];
1824
+ reference: ReactNode;
1825
+ id: number;
1826
+ constructor(message?: ReactNode, messageType?: TMessageType, attachments?: IAttachment[], reference?: ReactNode);
1827
+ clone: () => ChatMessage;
1828
+ removeAttachment(attachment: IAttachment): void;
1829
+ addAttachmentDescription(attachment: IAttachment, description: string): void;
1830
+ }
1831
+
1832
+ declare const AutoscrollContainer: ({ children }: {
1833
+ children: ReactNode;
1834
+ }) => React$1.JSX.Element;
1835
+
1836
+ declare class ChatController<T extends Record<string, unknown> = Record<string, unknown>> {
1837
+ private onMessageSubmit;
1838
+ currentIndex: number;
1839
+ state: TChatControllerState & T;
1840
+ private internalAudioRecorder;
1841
+ private internalCameraRecorder;
1842
+ private maxId;
1843
+ audioRecorder: {
1844
+ start: () => void;
1845
+ stop: () => Promise<void>;
1846
+ record: number;
1847
+ state: _apia_util.AudioRecorderState;
1848
+ };
1849
+ constructor(props: Partial<TChatControllerState & T>, onMessageSubmit: MessageSubmitCallback);
1850
+ removeMessage(idx: number): void;
1851
+ addMessage(message: ChatMessage): void;
1852
+ clearHistory(): void;
1853
+ clearMessage(): void;
1854
+ removeAttachment(attachment: IAttachment): void;
1855
+ private handleSubmit;
1856
+ private isForHistory;
1857
+ private canGoNext;
1858
+ private canGoPrev;
1859
+ nextMessage(): void;
1860
+ prevMessage(): void;
1861
+ protected getAdditionalProps(): Partial<MessageCallbackProps>;
1862
+ History: (() => React$1.JSX.Element) & {
1863
+ displayName: string;
1864
+ };
1865
+ Attachments: (() => React$1.JSX.Element) & {
1866
+ displayName: string;
1867
+ };
1868
+ TextArea: (() => React$1.JSX.Element) & {
1869
+ displayName: string;
1870
+ };
1871
+ Renderer: () => React$1.JSX.Element;
1872
+ }
1873
+
1874
+ declare class FloatingChatController extends ChatController<{
1875
+ isVisible: boolean;
1876
+ }> {
1877
+ private modalTitle?;
1878
+ constructor(props: Partial<TChatControllerState>, onMessageSubmit: MessageSubmitCallback, modalTitle?: string | undefined);
1879
+ open(onClose: () => unknown): void;
1880
+ Window: (() => React$1.JSX.Element | null) & {
1881
+ displayName: string;
1882
+ };
1883
+ }
1884
+
1885
+ declare function getBase64FromFile(f: File): Promise<string>;
1886
+ declare function getBase64FromBlob(b: Blob): Promise<string>;
1887
+ declare function getFileExtension(name: string): string | undefined;
1888
+ declare function isImage(base64: string): boolean;
1889
+
1890
+ export { Accordion, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, AutoEllipsis, Autocomplete, type AutocompleteCmpProps, AutocompleteController, type AutocompleteOption, type AutocompleteProps, AutogrowTextarea, AutoscrollContainer, BaseButton, CalendarModal, Captcha, ChatController, ChatMessage, Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DefaultAccordionItemButton, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, FieldErrorMessage, FieldLabel, FloatingChatController, type IAccordionItemButton, type IAccordionItemProps, type IAccordionProps, type IAlert, type IApiaFilter, type IAttachment, type ICalendarModal, type IConfirm, type IDialogButtonBar, type IDialogHeader, type IField, type IFieldErrorMessage, type IIconInput, type IOverlay, type IRequiredMark, type IResponsiveComponent, type ISimpleButton, IconButton, IconInput, IconsList, LabelBox, LinearLoader, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, type MessageCallbackProps, type MessageSubmitCallback, Modal, NumberInput, Overlay, ProgressBar, RequiredMark, ScreenLocker, SimpleButton, SortableList, SortableListItem, type TAccordionHandler, type TAccordionItemButton, type TApiaButtonType, type TApiaIconButton, type TChatControllerState, type TCheckbox, type TDateProps, type TFieldLabel, type TGetTabsController, type TIcon, type TIconButton, type TIconRenderer, type TIconSize, type TIconsList, type TListbox, type TMenuItem, type TMessageType, type TModal, type TModalSize, type TNumberInput, type TNumberInputChangeEvent, type TOnClickNode, type TOnConfirmSelection, type TOnSelectionChange, type TOpenModal, type TSubmenu, type TTab, type TTabLabelRenderer as TTabRenderer, type TToolbarIconButton as TToolDefinition, type TTooltip, type TUseModalConfiguration, Tab, Tabs, TabsContent, TabsController, TabsList, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, WaiTypeAhead, getBase64FromBlob, getBase64FromFile, getFieldErrorStyles, getFieldTouchedStyles, getFileExtension, importComponent, isImage, makeResponsiveComponent, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useModal, useModalContext, useOtherTagButton };
1796
1891
  //# sourceMappingURL=index.d.ts.map