sellmate-design-system-react 1.1.3 → 1.2.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.
@@ -5,6 +5,7 @@ export interface SActionModalButton {
5
5
  color?: SButtonColor;
6
6
  outline?: boolean;
7
7
  size?: SButtonSize;
8
+ disabled?: boolean;
8
9
  onClick?: () => void;
9
10
  }
10
11
  export interface SActionModalProps {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { createContext, forwardRef, useState, useCallback, useRef, useContext } from 'react';
2
+ import { createContext, forwardRef, useState, useRef, useCallback, useContext } from 'react';
3
3
  import * as RDialog from '@radix-ui/react-dialog';
4
4
  import { clsx } from 'clsx';
5
5
  import { extendTailwindMerge } from 'tailwind-merge';
@@ -3087,6 +3087,7 @@ function SModalContainer({
3087
3087
  style
3088
3088
  }) {
3089
3089
  const [shaking, setShaking] = useState(false);
3090
+ const contentRef = useRef(null);
3090
3091
  const [portalContainer, setPortalContainer] = useState(null);
3091
3092
  const triggerShake = useCallback(() => {
3092
3093
  setShaking(false);
@@ -3101,7 +3102,12 @@ function SModalContainer({
3101
3102
  /* @__PURE__ */ jsx("div", { className: "pointer-events-none fixed inset-0 z-[1001] flex items-center justify-center", children: /* @__PURE__ */ jsxs(
3102
3103
  RDialog.Content,
3103
3104
  {
3105
+ ref: contentRef,
3104
3106
  className: "pointer-events-auto outline-none data-[state=open]:animate-modal-in data-[state=closed]:animate-modal-out",
3107
+ onOpenAutoFocus: (e) => {
3108
+ e.preventDefault();
3109
+ contentRef.current?.focus({ preventScroll: true });
3110
+ },
3105
3111
  onEscapeKeyDown: guardClose,
3106
3112
  onPointerDownOutside: guardClose,
3107
3113
  onInteractOutside: guardClose,
@@ -3349,6 +3355,7 @@ function SActionModal({
3349
3355
  color: button.color ?? "primary",
3350
3356
  outline: button.outline,
3351
3357
  size: button.size ?? "md",
3358
+ disabled: button.disabled,
3352
3359
  onClick: () => {
3353
3360
  button.onClick?.();
3354
3361
  onOpenChange?.(false);