@amboss/design-system 3.37.0 → 3.37.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,4 +1,4 @@
1
- import type { AriaAttributes } from "react";
1
+ import type { AriaAttributes, RefObject } from "react";
2
2
  import React from "react";
3
3
  import type { Property } from "csstype";
4
4
  import type { PortalProps } from "../../Portal/Portal";
@@ -50,6 +50,15 @@ type BaseProps = {
50
50
  isMaxWidthLimit?: boolean;
51
51
  size?: "m" | "l";
52
52
  closeButtonAriaLabel?: string;
53
+ /**
54
+ * Determines which element receives focus when the modal opens.
55
+ * - Pass a **RefObject** to focus a specific custom element.
56
+ * - Pass a string that will act as css selector to focus that specific element
57
+ * For and actionButton, secondaryButton, pass a ref to those elements and to this prop
58
+ * For closeButton focus, pass "[data-modal-close-btn]"
59
+ * - If **undefined**, focus falls back to the first focusable element in the modal.
60
+ */
61
+ initialFocus?: RefObject<HTMLElement | SVGElement> | string;
53
62
  } & Omit<AriaAttributes, "aria-label" | "aria-labelledby">;
54
63
  /** At least one of header, aria-label, or aria-labelledby must be provided for accessibility */
55
64
  type LabelProps = {
@@ -77,7 +86,7 @@ type ConditionalProps = {
77
86
  ImageComponent?: React.ElementType<any>;
78
87
  };
79
88
  export type ModalProps = BaseProps & LabelProps & ConditionalProps & Pick<PortalProps, "portalContainer">;
80
- export declare function Modal({ header, subHeader, labelHeader, children, imageUrl, ImageComponent, secondaryButton, cancelButtonLabel, isDismissible, isFullScreen, isMaxWidthLimit, actionButton, role, onAction, size, privateProps: { skipPortal, height, zeroPadding, tabbableOptions }, portalContainer, closeButtonAriaLabel, "data-e2e-test-id": dataE2eTestId, imageAlt, ...ariaAttributes }: ModalProps): React.ReactElement;
89
+ export declare function Modal({ header, subHeader, labelHeader, children, imageUrl, ImageComponent, secondaryButton, cancelButtonLabel, isDismissible, isFullScreen, isMaxWidthLimit, actionButton, role, onAction, size, privateProps: { skipPortal, height, zeroPadding, tabbableOptions }, portalContainer, closeButtonAriaLabel, "data-e2e-test-id": dataE2eTestId, imageAlt, initialFocus, ...ariaAttributes }: ModalProps): React.ReactElement;
81
90
  export declare namespace Modal {
82
91
  var Stack: ({ children, ...rest }: Omit<StackProps, "space">) => React.JSX.Element;
83
92
  var Text: ({ children, ...rest }: Omit<TextProps, "size" | "variant">) => React.JSX.Element;