@enonic/ui 1.0.1 → 1.0.3

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.
@@ -116,10 +116,9 @@ export declare const Combobox: {
116
116
  ({ className, ...props }: ComboboxToggleProps): ReactElement;
117
117
  displayName: string;
118
118
  };
119
- Apply: {
120
- ({ className, label, ...props }: ComboboxApplyProps): ReactElement | null;
121
- displayName: string;
122
- };
119
+ Apply: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<ComboboxApplyProps> & {
120
+ ref?: import('preact').Ref<HTMLButtonElement> | undefined;
121
+ }>;
123
122
  Portal: {
124
123
  ({ container, forceMount, children }: ComboboxPortalProps): ReactElement | null;
125
124
  displayName: string;
@@ -1,10 +1,18 @@
1
1
  import { ReactElement, ReactNode, RefObject } from 'react';
2
2
  export type ContentType = 'listbox' | 'tree' | 'auto';
3
+ export type ComboboxOpenOptions = {
4
+ restoreFocus?: boolean;
5
+ };
3
6
  export type ComboboxContextValue = {
4
7
  baseId: string;
8
+ contentRef: RefObject<HTMLDivElement>;
5
9
  controlRef: RefObject<HTMLDivElement> | null;
10
+ applyRef: RefObject<HTMLButtonElement>;
11
+ popupRef: RefObject<HTMLDivElement>;
12
+ restoreFocusOnCloseRef: RefObject<boolean>;
13
+ ignoreFocusExitCloseRef: RefObject<boolean>;
6
14
  open: boolean;
7
- setOpen: (next: boolean) => void;
15
+ setOpen: (next: boolean, options?: ComboboxOpenOptions) => void;
8
16
  closeOnBlur: boolean;
9
17
  inputValue: string;
10
18
  setInputValue: (value: string) => void;
@@ -9,7 +9,7 @@ export declare const IdProvider: {
9
9
  };
10
10
  /**
11
11
  * Prefix provided or generated id with a prefix from the context
12
- * @param providedId - The id to prefix. Will use `useId()` if not provided.
12
+ * @param providedId - The id to prefix. A unique id is generated when omitted.
13
13
  * @param prefix - A custom prefix used in addition to the one from context.
14
14
  * @returns The prefixed id
15
15
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic/ui",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Enonic UI Component Library",
5
5
  "author": "Enonic",
6
6
  "license": "Apache-2.0",