@hexdspace/react 0.1.25 → 0.1.26

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1579,7 +1579,8 @@ var dialogPanelVariants = cva2(
1579
1579
  "fixed left-1/2 top-1/2",
1580
1580
  "-translate-x-1/2 -translate-y-1/2",
1581
1581
  "w-[min(92vw,var(--dialog-width))]",
1582
- "pointer-events-auto"
1582
+ "pointer-events-auto",
1583
+ "focus:outline-none focus-visible:outline-none"
1583
1584
  )
1584
1585
  );
1585
1586
  var dialogOverlayClass = cn("fixed inset-0 bg-[color:var(--overlay)]");
@@ -1732,6 +1733,7 @@ function Dialog({
1732
1733
  }, [isOpen]);
1733
1734
  const overlayClassName = cn(dialogOverlayClass);
1734
1735
  const surfaceClassName = cn(dialogSurfaceVariants({ chrome }));
1736
+ const panelRef = React3.useRef(null);
1735
1737
  return /* @__PURE__ */ jsxs3(DialogPrimitive.Root, { open: open2, defaultOpen, onOpenChange: handleOpenChange, modal, children: [
1736
1738
  trigger ? /* @__PURE__ */ jsx7(DialogPrimitive.Trigger, { asChild: true, children: trigger }) : null,
1737
1739
  /* @__PURE__ */ jsx7(DialogPrimitive.Portal, { forceMount: true, children: /* @__PURE__ */ jsx7(AnimatePresence, { children: isOpen ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
@@ -1760,11 +1762,19 @@ function Dialog({
1760
1762
  onEscapeKeyDown: (event) => {
1761
1763
  if (!dismissible) event.preventDefault();
1762
1764
  },
1765
+ onOpenAutoFocus: (event) => {
1766
+ event.preventDefault();
1767
+ requestAnimationFrame(() => {
1768
+ panelRef.current?.focus();
1769
+ });
1770
+ },
1763
1771
  ...props,
1764
1772
  children: /* @__PURE__ */ jsx7(
1765
1773
  motion.div,
1766
1774
  {
1767
1775
  className: cn(dialogPanelVariants(), className),
1776
+ ref: panelRef,
1777
+ tabIndex: -1,
1768
1778
  style: {
1769
1779
  ...style,
1770
1780
  zIndex,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexdspace/react",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",