@seeqdev/qomponents 0.0.51 → 0.0.52

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.
@@ -41,4 +41,5 @@ export interface ModalProps {
41
41
  customHeader?: React.ReactElement;
42
42
  middleFooterSection?: React.ReactElement;
43
43
  customButtonVariant?: ButtonVariant;
44
+ keepFocusInsideModal?: boolean;
44
45
  }
package/dist/index.esm.js CHANGED
@@ -13966,7 +13966,7 @@ const DialogTitle = React__default.forwardRef(({ className, ...props }, ref) =>
13966
13966
  DialogTitle.displayName = $5d3850c4d0b4e6c7$export$f99233281efd08a0.displayName;
13967
13967
  const DialogDescription = React__default.forwardRef(({ className, ...props }, ref) => (React__default.createElement($5d3850c4d0b4e6c7$export$393edc798c47379d, { ref: ref, className: `text-sm text-muted-foreground ${className}`, ...props })));
13968
13968
  DialogDescription.displayName = $5d3850c4d0b4e6c7$export$393edc798c47379d.displayName;
13969
- const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, subtitle, children, open = false, onClose, customButton = false, customButtonLabel = 'Back', onClickCustomButton, submitButtonLabel = 'Submit', cancelButtonLabel = 'Cancel', disableSubmitButton = false, stopPropagationSubmitButton = false, onSubmit, isTitleEditable = false, onTitleChanged, inputExtraClassNames, hideCloseIcon = false, size = 'xl', titleIconPosition = 'left', hideFooterButtons = false, hideSubmitButton = false, hideCancelButton = false, testId = 'modal', modalFooter, dialogClassName, titlePlaceholder, titleRequired, titleError, submitButtonTooltip, cancelButtonTooltip, disableCustomButton, customHeader, middleFooterSection = React__default.createElement(React__default.Fragment, null), customButtonVariant = 'outline', }) => {
13969
+ const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, subtitle, children, open = false, onClose, customButton = false, customButtonLabel = 'Back', onClickCustomButton, submitButtonLabel = 'Submit', cancelButtonLabel = 'Cancel', disableSubmitButton = false, stopPropagationSubmitButton = false, onSubmit, isTitleEditable = false, onTitleChanged, inputExtraClassNames, hideCloseIcon = false, size = 'xl', titleIconPosition = 'left', hideFooterButtons = false, hideSubmitButton = false, hideCancelButton = false, testId = 'modal', modalFooter, dialogClassName, titlePlaceholder, titleRequired, titleError, submitButtonTooltip, cancelButtonTooltip, disableCustomButton, customHeader, middleFooterSection = React__default.createElement(React__default.Fragment, null), customButtonVariant = 'outline', keepFocusInsideModal = true, }) => {
13970
13970
  // the Dialog is adding pointerEvents: none to body and the dropdowns from the modal does not work anymore
13971
13971
  useEffect(() => {
13972
13972
  if (open) {
@@ -14008,7 +14008,7 @@ const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, sub
14008
14008
  titleIcon && titleIconPosition === 'right' ?
14009
14009
  React__default.createElement("div", { className: "tw-flex tw-ml-4" }, titleIconElement) : React__default.createElement(React__default.Fragment, null)));
14010
14010
  };
14011
- return open ? (React__default.createElement(Dialog, { open: true, onOpenChange: onClose, modal: false },
14011
+ return open ? (React__default.createElement(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal },
14012
14012
  React__default.createElement(DialogContent, { onPointerDownOutside: (e) => e.preventDefault(), "data-testid": testId, className: classNames(`modalContent tw-w-full !tw-p-0 tw-border-none tw-shadow-none dark:tw-text-sq-dark-text !tw-gap-0`, {
14013
14013
  'tw-max-w-xs': size === 'xs',
14014
14014
  'tw-max-w-sm': size === 'sm',