@amboss/design-system 3.20.2 → 3.20.4

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.
@@ -15,9 +15,11 @@ type BottomToolbarConfig = {
15
15
  leftContent?: ReactElement;
16
16
  rightContent?: ReactElement;
17
17
  };
18
- type PromptInputSharedProps = {
18
+ export type PromptInputProps = {
19
19
  "data-e2e-test-id"?: string;
20
20
  /** Currently shows send button processing state */
21
+ bottomToolbar?: BottomToolbarConfig;
22
+ sendButtonProps?: SendButtonProps;
21
23
  isProcessing?: boolean;
22
24
  clearButtonAriaLabel?: string;
23
25
  hint?: ReactElement;
@@ -36,16 +38,29 @@ type PromptInputSharedProps = {
36
38
  /** Renders an icon to the left inside the textarea */
37
39
  leftIcon?: IconName;
38
40
  } & Omit<PromptTextAreaProps, "isCollapsed" | "isAutocompleteListOpen" | "selectedListItem" | "hasLeftIcon"> & Pick<AutocompleteListProps, "autocompleteListItems" | "autocompleteListFooter" | "portalContainer">;
39
- type PromptInputWithToolbarProps = PromptInputSharedProps & {
40
- bottomToolbar: BottomToolbarConfig;
41
+ declare const PromptInputComponent: React.ForwardRefExoticComponent<{
42
+ "data-e2e-test-id"?: string;
43
+ /** Currently shows send button processing state */
44
+ bottomToolbar?: BottomToolbarConfig;
41
45
  sendButtonProps?: SendButtonProps;
42
- };
43
- type PromptInputWithoutToolbarProps = PromptInputSharedProps & {
44
- bottomToolbar?: undefined;
45
- sendButtonProps?: never;
46
- };
47
- export type PromptInputProps = PromptInputWithToolbarProps | PromptInputWithoutToolbarProps;
48
- declare const PromptInputComponent: React.ForwardRefExoticComponent<PromptInputProps & React.RefAttributes<HTMLTextAreaElement>>;
46
+ isProcessing?: boolean;
47
+ clearButtonAriaLabel?: string;
48
+ hint?: ReactElement;
49
+ /** Shows in the clear button space in empty state */
50
+ emptyStateTopRightContent?: ReactElement;
51
+ onClear: () => void;
52
+ /** Called when user selects (or rejects) a list item from autocomplete list */
53
+ onComplete?: ({ value, category, evt, index, }: {
54
+ value: ListItemValue;
55
+ category?: string;
56
+ evt?: SyntheticEvent;
57
+ index?: number;
58
+ }) => void;
59
+ /** Called on Enter key to submit the form */
60
+ onEnterKey: () => void;
61
+ /** Renders an icon to the left inside the textarea */
62
+ leftIcon?: IconName;
63
+ } & Omit<PromptTextAreaProps, "selectedListItem" | "isAutocompleteListOpen" | "isCollapsed" | "hasLeftIcon"> & Pick<AutocompleteListProps, "portalContainer" | "autocompleteListItems" | "autocompleteListFooter"> & React.RefAttributes<HTMLTextAreaElement>>;
49
64
  declare const SuggestionButton: React.ForwardRefExoticComponent<Omit<PolymorphicComponentPropsWithRef<React.ElementType<any, keyof React.JSX.IntrinsicElements>, Omit<ButtonProps, "ref" | "size" | "variant">>, "ref"> & React.RefAttributes<unknown>>;
50
65
  export declare const PromptInput: typeof PromptInputComponent & {
51
66
  SuggestionButton: typeof SuggestionButton;