@hexdspace/react 0.1.19 → 0.1.21

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.
@@ -143,64 +143,6 @@
143
143
  }
144
144
  }
145
145
 
146
- @keyframes dialog-overlay-in {
147
- from {
148
- opacity: 0;
149
- }
150
- to {
151
- opacity: 1;
152
- }
153
- }
154
-
155
- @keyframes dialog-overlay-out {
156
- from {
157
- opacity: 1;
158
- }
159
- to {
160
- opacity: 0;
161
- }
162
- }
163
-
164
- @keyframes dialog-fade-in {
165
- from {
166
- opacity: 0;
167
- }
168
- to {
169
- opacity: 1;
170
- }
171
- }
172
-
173
- @keyframes dialog-fade-out {
174
- from {
175
- opacity: 1;
176
- }
177
- to {
178
- opacity: 0;
179
- }
180
- }
181
-
182
- @keyframes dialog-surface-in {
183
- from {
184
- opacity: 0;
185
- transform: translateY(1.25rem);
186
- }
187
- to {
188
- opacity: 1;
189
- transform: translateY(0);
190
- }
191
- }
192
-
193
- @keyframes dialog-surface-out {
194
- from {
195
- opacity: 1;
196
- transform: translateY(0);
197
- }
198
- to {
199
- opacity: 0;
200
- transform: translateY(1.25rem);
201
- }
202
- }
203
-
204
146
  :root .prose code {
205
147
  background: rgba(0, 0, 0, 0.08);
206
148
  padding: 3px 3px 0;
package/dist/index.js CHANGED
@@ -1586,7 +1586,7 @@ var dialogSurfaceVariants = cva2("dialog-surface relative overflow-hidden", {
1586
1586
  }
1587
1587
  });
1588
1588
  function DialogContent({ className, ...props }) {
1589
- return /* @__PURE__ */ jsx7("div", { className: cn("DialogContent p-6", className), ...props });
1589
+ return /* @__PURE__ */ jsx7("div", { className: cn("p-6", className), ...props });
1590
1590
  }
1591
1591
  function AutoHeight({
1592
1592
  children,
@@ -1640,8 +1640,7 @@ function AutoHeight({
1640
1640
  transition: { duration: durationSeconds, ease: "easeOut" },
1641
1641
  style: {
1642
1642
  maxHeight: "calc(100vh - 4rem)",
1643
- overflow: "auto",
1644
- willChange: "height"
1643
+ overflow: "auto"
1645
1644
  },
1646
1645
  children: /* @__PURE__ */ jsx7("div", { ref, style: { boxSizing: "border-box" }, children })
1647
1646
  }
@@ -1695,12 +1694,10 @@ function Dialog({
1695
1694
  const isControlled = open2 !== void 0;
1696
1695
  const [uncontrolledOpen, setUncontrolledOpen] = React2.useState(defaultOpen ?? false);
1697
1696
  const isOpen = isControlled ? open2 : uncontrolledOpen;
1698
- const prevOpenRef = React2.useRef(false);
1699
- const [contentCycle, setContentCycle] = React2.useState(0);
1700
1697
  const [surfaceReady, setSurfaceReady] = React2.useState(false);
1701
1698
  const [overlayReady, setOverlayReady] = React2.useState(false);
1702
1699
  const Template = template;
1703
- const motionDuration = useMotionDuration("--motion-fast", 0.16);
1700
+ const motionDuration = useMotionDuration("--motion-med", 0.16);
1704
1701
  const handleOpenChange = (nextOpen) => {
1705
1702
  if (!isControlled) setUncontrolledOpen(nextOpen);
1706
1703
  onOpenChange?.(nextOpen);
@@ -1721,16 +1718,6 @@ function Dialog({
1721
1718
  },
1722
1719
  [onResolve]
1723
1720
  );
1724
- React2.useEffect(() => {
1725
- const wasOpen = prevOpenRef.current;
1726
- prevOpenRef.current = Boolean(isOpen);
1727
- if (isOpen && !wasOpen) {
1728
- setContentCycle((value) => value + 1);
1729
- setSurfaceReady(false);
1730
- setOverlayReady(false);
1731
- return;
1732
- }
1733
- }, [isOpen]);
1734
1721
  const handleAutoHeightReady = React2.useCallback(() => {
1735
1722
  if (!isOpen) return;
1736
1723
  requestAnimationFrame(() => {
@@ -1738,7 +1725,7 @@ function Dialog({
1738
1725
  setOverlayReady(true);
1739
1726
  });
1740
1727
  }, [isOpen]);
1741
- const overlayClassName = cn("DialogOverlay", dialogOverlayClass);
1728
+ const overlayClassName = cn(dialogOverlayClass);
1742
1729
  const surfaceClassName = cn(dialogSurfaceVariants({ chrome }));
1743
1730
  return /* @__PURE__ */ jsxs3(DialogPrimitive.Root, { open: open2, defaultOpen, onOpenChange: handleOpenChange, modal, children: [
1744
1731
  trigger ? /* @__PURE__ */ jsx7(DialogPrimitive.Trigger, { asChild: true, children: trigger }) : null,
@@ -1749,16 +1736,8 @@ function Dialog({
1749
1736
  className: overlayClassName,
1750
1737
  style: { zIndex: zIndex - 1 },
1751
1738
  variants: {
1752
- open: {
1753
- opacity: 1,
1754
- pointerEvents: "auto",
1755
- transition: { duration: motionDuration, ease: "easeOut" }
1756
- },
1757
- closed: {
1758
- opacity: 0,
1759
- pointerEvents: "none",
1760
- transition: { duration: motionDuration, ease: "easeOut" }
1761
- }
1739
+ open: { opacity: 1, pointerEvents: "auto", transition: { duration: motionDuration, ease: "easeOut" } },
1740
+ closed: { opacity: 0, pointerEvents: "none", transition: { duration: motionDuration, ease: "easeOut" } }
1762
1741
  },
1763
1742
  initial: "closed",
1764
1743
  animate: overlayReady ? "open" : "closed",
@@ -1780,23 +1759,15 @@ function Dialog({
1780
1759
  children: /* @__PURE__ */ jsx7(
1781
1760
  motion.div,
1782
1761
  {
1783
- className: cn("DialogContent", dialogPanelVariants(), className),
1762
+ className: cn(dialogPanelVariants(), className),
1784
1763
  style: {
1785
1764
  ...style,
1786
1765
  zIndex,
1787
1766
  "--dialog-width": `${maxWidthPx}px`
1788
1767
  },
1789
1768
  variants: {
1790
- open: {
1791
- opacity: 1,
1792
- pointerEvents: "auto",
1793
- transition: { duration: motionDuration, ease: "easeOut" }
1794
- },
1795
- closed: {
1796
- opacity: 0,
1797
- pointerEvents: "none",
1798
- transition: { duration: motionDuration, ease: "easeIn" }
1799
- }
1769
+ open: { opacity: 1, pointerEvents: "auto", transition: { duration: motionDuration, ease: "easeOut" } },
1770
+ closed: { opacity: 0, pointerEvents: "none", transition: { duration: motionDuration, ease: "easeIn" } }
1800
1771
  },
1801
1772
  initial: "open",
1802
1773
  animate: "open",
@@ -1805,18 +1776,9 @@ function Dialog({
1805
1776
  motion.div,
1806
1777
  {
1807
1778
  className: surfaceClassName,
1808
- style: { willChange: "transform" },
1809
1779
  variants: {
1810
- open: {
1811
- opacity: 1,
1812
- y: 0,
1813
- transition: { duration: motionDuration, ease: "easeOut" }
1814
- },
1815
- closed: {
1816
- opacity: 0,
1817
- y: 20,
1818
- transition: { duration: motionDuration, ease: "easeIn" }
1819
- }
1780
+ open: { opacity: 1, y: 0, transition: { duration: motionDuration, ease: "easeOut" } },
1781
+ closed: { opacity: 0, y: 20, transition: { duration: motionDuration, ease: "easeIn" } }
1820
1782
  },
1821
1783
  initial: "closed",
1822
1784
  animate: surfaceReady ? "open" : "closed",
@@ -1836,7 +1798,6 @@ function Dialog({
1836
1798
  AutoHeight,
1837
1799
  {
1838
1800
  onReady: handleAutoHeightReady,
1839
- resetKey: contentCycle,
1840
1801
  durationSeconds: motionDuration,
1841
1802
  children: /* @__PURE__ */ jsx7(
1842
1803
  Template,
@@ -1882,6 +1843,7 @@ var CustomDialog = (props) => {
1882
1843
  const p = props.payload ?? { children: /* @__PURE__ */ jsx9("div", { children: "Empty custom dialog" }) };
1883
1844
  return /* @__PURE__ */ jsxs5(DialogContent, { children: [
1884
1845
  /* @__PURE__ */ jsx9(DialogPrimitive3.Title, { className: "sr-only", children: p.title ?? "Dialog" }),
1846
+ /* @__PURE__ */ jsx9(DialogPrimitive3.Description, { "aria-describedby": void 0 }),
1885
1847
  p.children
1886
1848
  ] });
1887
1849
  };
@@ -2547,7 +2509,7 @@ import { Tooltip as TooltipPrimitive } from "radix-ui";
2547
2509
  import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
2548
2510
  var tooltipContentBase = cn(
2549
2511
  "panel shadow-none px-4 py-2.5 text-xs z-5000 select-none",
2550
- "origin-center will-change-[transform,opacity]",
2512
+ "origin-center",
2551
2513
  "[--tooltip-x:0px] [--tooltip-y:4px]",
2552
2514
  "data-[side=bottom]:[--tooltip-y:-4px]",
2553
2515
  "data-[side=left]:[--tooltip-x:4px] data-[side=left]:[--tooltip-y:0px]",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexdspace/react",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -38,7 +38,7 @@
38
38
  "@tanstack/react-query": "^5.90.11",
39
39
  "lucide-react": "^0.555.0",
40
40
  "radix-ui": "^1.4.3",
41
- "react": "^20.2.3",
41
+ "react": "^19.2.3",
42
42
  "react-dom": "^19.2.3",
43
43
  "react-router-dom": "^7.10.1",
44
44
  "react-toastify": "^11.0.5"