@getsoren/design-system 4.68.0 → 4.68.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.
@@ -1,16 +1,21 @@
1
1
  import { AutocompleteChangeReason, AutocompleteProps, AutocompleteRenderGroupParams, AutocompleteRenderOptionState, PopperProps, SxProps, TextFieldProps } from '@mui/material';
2
2
  import { HTMLAttributes, JSXElementConstructor, KeyboardEvent, ReactNode, Ref, SyntheticEvent } from 'react';
3
- interface ActionEndOption {
3
+ interface ActionOption {
4
4
  label?: ReactNode;
5
5
  onClick?: () => void;
6
6
  value?: unknown;
7
- isActionEndOption?: boolean;
7
+ isActionOption?: boolean;
8
+ isActionStartOption?: boolean;
8
9
  }
9
10
  export interface ApiAutocompleteProps<Value, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false> {
10
11
  /**
11
- * Action added in and of options
12
+ * Action row appended at the end of the options list
12
13
  */
13
- actionEndOption?: ActionEndOption;
14
+ actionEndOption?: ActionOption;
15
+ /**
16
+ * Action row pinned at the top of the options list (e.g. a "create new…" entry)
17
+ */
18
+ actionStartOption?: ActionOption;
14
19
  /** Replaces the default dropdown caret (e.g. a switcher's up/down chevrons). */
15
20
  popupIcon?: ReactNode;
16
21
  limitTags?: number;
@@ -22,7 +27,7 @@ export interface ApiAutocompleteProps<Value, Multiple extends boolean | undefine
22
27
  keyOptionLabel: string | string[];
23
28
  noOptionsText?: ReactNode;
24
29
  getOptionLabel?: (option: Value) => string;
25
- renderOption?: (props: HTMLAttributes<HTMLLIElement>, option: Value & ActionEndOption, state: AutocompleteRenderOptionState) => ReactNode;
30
+ renderOption?: (props: HTMLAttributes<HTMLLIElement>, option: Value & ActionOption, state: AutocompleteRenderOptionState) => ReactNode;
26
31
  searchKey?: string;
27
32
  required?: boolean;
28
33
  queryParams?: Record<string, unknown>;
@@ -86,5 +91,5 @@ export interface ApiAutocompleteProps<Value, Multiple extends boolean | undefine
86
91
  refetch: (refetchOptions?: Record<string, unknown>) => Promise<unknown>;
87
92
  };
88
93
  }
89
- declare const ApiAutocomplete: <Value extends Record<string | symbol, any>>({ actionEndOption, popupIcon, blurOnSelect, label, placeholder, name, slotProps, disableClearable, setSelectedValue, useQuery, noOptionsText, renderOption, getOptionLabel: getOptionLabelProp, keyOptionLabel, queryParams, openOnFocus, autoHighlight, queryParamsOnFocus, queryOptions, required, helperMessage, error, disabled, defaultValue, onFocus, onBlur, onChange, sx, renderInput, variant, InputProps, size, shrink, getOptionKey, width, limitTags, groupBy, disableCloseOnSelect, renderGroup, value, PopperComponent, ListboxProps, multiple, filterSelectedOptions, autoFocus, onKeyDown, onNoResults, endAdornment, inputSlotProps, inputRef, open, onOpen, onClose, searchKey, disableInputLoader, fetchOnFocus, filterOptions, getOptionImageSrc, }: ApiAutocompleteProps<Value>) => import("@emotion/react/jsx-runtime").JSX.Element;
94
+ declare const ApiAutocomplete: <Value extends Record<string | symbol, any>>({ actionEndOption, actionStartOption, popupIcon, blurOnSelect, label, placeholder, name, slotProps, disableClearable, setSelectedValue, useQuery, noOptionsText, renderOption, getOptionLabel: getOptionLabelProp, keyOptionLabel, queryParams, openOnFocus, autoHighlight, queryParamsOnFocus, queryOptions, required, helperMessage, error, disabled, defaultValue, onFocus, onBlur, onChange, sx, renderInput, variant, InputProps, size, shrink, getOptionKey, width, limitTags, groupBy, disableCloseOnSelect, renderGroup, value, PopperComponent, ListboxProps, multiple, filterSelectedOptions, autoFocus, onKeyDown, onNoResults, endAdornment, inputSlotProps, inputRef, open, onOpen, onClose, searchKey, disableInputLoader, fetchOnFocus, filterOptions, getOptionImageSrc, }: ApiAutocompleteProps<Value>) => import("@emotion/react/jsx-runtime").JSX.Element;
90
95
  export default ApiAutocomplete;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@getsoren/design-system",
3
3
  "description": "Design System React library",
4
4
  "sideEffects": false,
5
- "version": "4.68.0",
5
+ "version": "4.68.2",
6
6
  "license": "ISC",
7
7
  "type": "module",
8
8
  "types": "./dist/src/main.d.ts",