@dloizides/ui-layout 1.28.5 → 1.30.0

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/CHANGELOG.md CHANGED
@@ -1,6 +1,26 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## 1.30.0
5
+
6
+ ### Added
7
+
8
+ - `ModalDropdown` `menuHeading`: a visible, non-focusable heading (role heading) at the top of the open
9
+ menu or modal; it also becomes the menu's accessible name. KEFI-EDITOR-HEADER-1 "Compact the landing editor header".
10
+
11
+ ## 1.29.0
12
+
13
+ ### Added
14
+
15
+ - `Modal` `initialFocusTestID`: the testID of the control focused when the dialog opens (web), for
16
+ FOCUS-1 "Every screen names its initial focus". `useFocusTrap` takes it as an optional 3rd argument.
17
+
18
+ ### Fixed
19
+
20
+ - `useFocusTrap` no longer steals focus from a child that set `autoFocus`: the first-focusable
21
+ fallback runs only when focus is not already inside the dialog (kefi-web create-attendee modal
22
+ opened on its close button). Focus restore on close skips an element that lives inside the dialog.
23
+
4
24
  ## 1.26.3
5
25
 
6
26
  ### Fixed
package/dist/index.d.mts CHANGED
@@ -320,8 +320,10 @@ interface ModalDropdownProps<T> {
320
320
  * control, so screen readers do not announce it.
321
321
  */
322
322
  showHamburger?: boolean;
323
+ /** Visible, non-focusable heading at the top of the open menu; it also names the menu. */
324
+ menuHeading?: string;
323
325
  }
324
- declare const ModalDropdown: <T extends string | number>({ testID, accessibilityLabel, accessibilityHint, value, options, onChange, variant, renderTrigger, optionTestID, menuMinWidth, showCaret, showHamburger, }: ModalDropdownProps<T>) => React.ReactElement;
326
+ declare const ModalDropdown: <T extends string | number>({ testID, accessibilityLabel, accessibilityHint, value, options, onChange, variant, renderTrigger, optionTestID, menuMinWidth, showCaret, showHamburger, menuHeading, }: ModalDropdownProps<T>) => React.ReactElement;
325
327
 
326
328
  /**
327
329
  * ModalShell — a slide-up full-screen modal with a themed header (title + close button)
@@ -397,8 +399,10 @@ interface ModalProps {
397
399
  testID?: string;
398
400
  /** Accessible name of the dialog. Falls back to `title`, then the neutral "dialog" key. */
399
401
  accessibilityLabel?: string;
402
+ /** testID of the control focused on open (web). Default: an autoFocus child, else the first focusable. */
403
+ initialFocusTestID?: string;
400
404
  }
401
- declare const Modal: ({ visible, onClose, title, children, footer, size, showClose, testID, accessibilityLabel, }: ModalProps) => React.ReactElement;
405
+ declare const Modal: ({ visible, onClose, title, children, footer, size, showClose, testID, accessibilityLabel, initialFocusTestID, }: ModalProps) => React.ReactElement;
402
406
 
403
407
  /**
404
408
  * ConfirmDialog — a confirm/cancel popup built ON {@link Modal}, for the "are you sure?" moment.
@@ -768,7 +772,7 @@ interface VersionResponse {
768
772
  */
769
773
  declare function useApiCommit(apiBaseUrl?: string, fetchImpl?: typeof fetch): string | undefined;
770
774
 
771
- declare function useFocusTrap(containerRef: RefObject<View | null>, enabled: boolean): void;
775
+ declare function useFocusTrap(containerRef: RefObject<View | null>, enabled: boolean, initialFocusTestID?: string): void;
772
776
 
773
777
  /** Default testIDs — match the apps' existing values so Playwright selectors keep working. */
774
778
  declare const LAYOUT_TEST_IDS: {
package/dist/index.d.ts CHANGED
@@ -320,8 +320,10 @@ interface ModalDropdownProps<T> {
320
320
  * control, so screen readers do not announce it.
321
321
  */
322
322
  showHamburger?: boolean;
323
+ /** Visible, non-focusable heading at the top of the open menu; it also names the menu. */
324
+ menuHeading?: string;
323
325
  }
324
- declare const ModalDropdown: <T extends string | number>({ testID, accessibilityLabel, accessibilityHint, value, options, onChange, variant, renderTrigger, optionTestID, menuMinWidth, showCaret, showHamburger, }: ModalDropdownProps<T>) => React.ReactElement;
326
+ declare const ModalDropdown: <T extends string | number>({ testID, accessibilityLabel, accessibilityHint, value, options, onChange, variant, renderTrigger, optionTestID, menuMinWidth, showCaret, showHamburger, menuHeading, }: ModalDropdownProps<T>) => React.ReactElement;
325
327
 
326
328
  /**
327
329
  * ModalShell — a slide-up full-screen modal with a themed header (title + close button)
@@ -397,8 +399,10 @@ interface ModalProps {
397
399
  testID?: string;
398
400
  /** Accessible name of the dialog. Falls back to `title`, then the neutral "dialog" key. */
399
401
  accessibilityLabel?: string;
402
+ /** testID of the control focused on open (web). Default: an autoFocus child, else the first focusable. */
403
+ initialFocusTestID?: string;
400
404
  }
401
- declare const Modal: ({ visible, onClose, title, children, footer, size, showClose, testID, accessibilityLabel, }: ModalProps) => React.ReactElement;
405
+ declare const Modal: ({ visible, onClose, title, children, footer, size, showClose, testID, accessibilityLabel, initialFocusTestID, }: ModalProps) => React.ReactElement;
402
406
 
403
407
  /**
404
408
  * ConfirmDialog — a confirm/cancel popup built ON {@link Modal}, for the "are you sure?" moment.
@@ -768,7 +772,7 @@ interface VersionResponse {
768
772
  */
769
773
  declare function useApiCommit(apiBaseUrl?: string, fetchImpl?: typeof fetch): string | undefined;
770
774
 
771
- declare function useFocusTrap(containerRef: RefObject<View | null>, enabled: boolean): void;
775
+ declare function useFocusTrap(containerRef: RefObject<View | null>, enabled: boolean, initialFocusTestID?: string): void;
772
776
 
773
777
  /** Default testIDs — match the apps' existing values so Playwright selectors keep working. */
774
778
  declare const LAYOUT_TEST_IDS: {