@royaloperahouse/harmonic 0.6.1 → 0.6.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.
@@ -0,0 +1 @@
1
+ export declare function useFocusTrap(containerRef: React.RefObject<HTMLElement>, onEscape?: () => void): void;
@@ -79,6 +79,10 @@ export interface ISearchProps {
79
79
  * Additional CSS class names to apply to the navigation component.
80
80
  */
81
81
  className?: string;
82
+ /**
83
+ * Reference to the search icon element for focusing
84
+ */
85
+ ref?: React.Ref<HTMLButtonElement>;
82
86
  }
83
87
  export interface INavigationWrapperProps {
84
88
  /**
@@ -145,6 +149,10 @@ export interface INavTopProps {
145
149
  * Additional CSS class names to apply to the navigation component.
146
150
  */
147
151
  className?: string;
152
+ /**
153
+ * Search button ref for focus management
154
+ */
155
+ searchButtonRef?: React.Ref<HTMLButtonElement>;
148
156
  }
149
157
  export interface IMenuOptionProps {
150
158
  /**
@@ -205,6 +213,10 @@ export interface ISearchBarProps {
205
213
  * Function to be called when is closed
206
214
  */
207
215
  onClose?: (e?: React.MouseEvent) => void;
216
+ /**
217
+ * Reference to the input element for focusing
218
+ */
219
+ inputRef?: React.RefObject<HTMLInputElement>;
208
220
  /**
209
221
  * Additional CSS class names to apply to the navigation component.
210
222
  */
@@ -285,6 +285,10 @@ export interface IControlledDropdownProps {
285
285
  * Callback called when main link or option are focused
286
286
  */
287
287
  onFocus?: () => void;
288
+ /**
289
+ * Callback called when focus leaves element
290
+ */
291
+ onFocusLeave?: () => void;
288
292
  /**
289
293
  * Callback called when main link or last option lose focus
290
294
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@royaloperahouse/harmonic",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "author": "Royal Opera House",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",