@almadar/ui 5.122.3 → 5.122.5

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.
@@ -5106,6 +5106,77 @@ var init_Dialog = __esm({
5106
5106
  Dialog.displayName = "Dialog";
5107
5107
  }
5108
5108
  });
5109
+ function isMotionEnabled() {
5110
+ if (typeof document === "undefined") return true;
5111
+ if (motionEnabledCache !== null) return motionEnabledCache;
5112
+ const v = getComputedStyle(document.documentElement).getPropertyValue("--motion-enable").trim().toLowerCase();
5113
+ motionEnabledCache = v !== "off";
5114
+ return motionEnabledCache;
5115
+ }
5116
+ function usePresence(show, opts) {
5117
+ const { animation, animate = true, onExited } = opts;
5118
+ const [mounted, setMounted] = React91.useState(show);
5119
+ const [exiting, setExiting] = React91.useState(false);
5120
+ const prev = React91.useRef(show);
5121
+ const onExitedRef = React91.useRef(onExited);
5122
+ onExitedRef.current = onExited;
5123
+ const safeTimer = React91.useRef(null);
5124
+ const clearSafe = React91.useCallback(() => {
5125
+ if (safeTimer.current) {
5126
+ clearTimeout(safeTimer.current);
5127
+ safeTimer.current = null;
5128
+ }
5129
+ }, []);
5130
+ const finishExit = React91.useCallback(() => {
5131
+ clearSafe();
5132
+ setExiting(false);
5133
+ setMounted(false);
5134
+ onExitedRef.current?.();
5135
+ }, [clearSafe]);
5136
+ React91.useLayoutEffect(() => {
5137
+ const moving = animate && isMotionEnabled();
5138
+ if (show && !prev.current) {
5139
+ setExiting(false);
5140
+ setMounted(true);
5141
+ } else if (!show && prev.current) {
5142
+ if (moving) {
5143
+ setExiting(true);
5144
+ clearSafe();
5145
+ safeTimer.current = setTimeout(finishExit, SAFE_EXIT_MS);
5146
+ } else {
5147
+ setMounted(false);
5148
+ setExiting(false);
5149
+ }
5150
+ }
5151
+ prev.current = show;
5152
+ }, [show, animate, clearSafe, finishExit]);
5153
+ React91.useEffect(() => () => clearSafe(), [clearSafe]);
5154
+ const disabled = !animate || !isMotionEnabled();
5155
+ const className = disabled ? "" : exiting ? `animate-${animation}-out` : `animate-${animation}-in`;
5156
+ const onAnimationEnd = React91.useCallback(
5157
+ (e) => {
5158
+ if (e.target !== e.currentTarget) return;
5159
+ if (exiting) finishExit();
5160
+ },
5161
+ [exiting, finishExit]
5162
+ );
5163
+ return { mounted, exiting, className, onAnimationEnd };
5164
+ }
5165
+ var SAFE_EXIT_MS, motionEnabledCache, Presence;
5166
+ var init_Presence = __esm({
5167
+ "components/core/atoms/Presence.tsx"() {
5168
+ "use client";
5169
+ init_cn();
5170
+ SAFE_EXIT_MS = 1e3;
5171
+ motionEnabledCache = null;
5172
+ Presence = ({ show, className, children, ...opts }) => {
5173
+ const { mounted, className: animClass, onAnimationEnd } = usePresence(show, opts);
5174
+ if (!mounted) return null;
5175
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(animClass, className), onAnimationEnd, children });
5176
+ };
5177
+ Presence.displayName = "Presence";
5178
+ }
5179
+ });
5109
5180
  var sizeClasses2, minWidthClasses, lookStyles, Modal;
5110
5181
  var init_Modal = __esm({
5111
5182
  "components/core/molecules/Modal.tsx"() {
@@ -5116,6 +5187,7 @@ var init_Modal = __esm({
5116
5187
  init_Typography();
5117
5188
  init_cn();
5118
5189
  init_useEventBus();
5190
+ init_Presence();
5119
5191
  sizeClasses2 = {
5120
5192
  sm: "max-w-md",
5121
5193
  md: "max-w-2xl",
@@ -5160,18 +5232,10 @@ var init_Modal = __esm({
5160
5232
  const [dragY, setDragY] = React91.useState(0);
5161
5233
  const dragStartY = React91.useRef(0);
5162
5234
  const isDragging = React91.useRef(false);
5163
- const [closing, setClosing] = React91.useState(false);
5164
- const wasOpenRef = React91.useRef(isOpen);
5165
- React91.useEffect(() => {
5166
- if (wasOpenRef.current && !isOpen) setClosing(true);
5167
- wasOpenRef.current = isOpen;
5168
- }, [isOpen]);
5169
- const handleAnimEnd = (e) => {
5170
- if (closing && e.target === e.currentTarget) {
5171
- setClosing(false);
5172
- onExited?.();
5173
- }
5174
- };
5235
+ const { mounted, exiting, onAnimationEnd: handleAnimEnd } = usePresence(isOpen, {
5236
+ animation: "modal",
5237
+ onExited
5238
+ });
5175
5239
  React91.useEffect(() => {
5176
5240
  if (isOpen) {
5177
5241
  previousActiveElement.current = document.activeElement;
@@ -5206,10 +5270,9 @@ var init_Modal = __esm({
5206
5270
  };
5207
5271
  }, [isOpen]);
5208
5272
  if (typeof document === "undefined") return null;
5209
- const renderOpen = isOpen || closing;
5210
- if (!renderOpen) return null;
5211
- const dialogAnim = closing ? "animate-modal-out" : "animate-modal-in";
5212
- const overlayAnim = closing ? "animate-overlay-out" : "animate-overlay-in";
5273
+ if (!mounted) return null;
5274
+ const dialogAnim = exiting ? "animate-modal-out" : "animate-modal-in";
5275
+ const overlayAnim = exiting ? "animate-overlay-out" : "animate-overlay-in";
5213
5276
  const handleClose = () => {
5214
5277
  if (closeEvent) eventBus.emit(`UI:${closeEvent}`, {});
5215
5278
  onClose();
@@ -5340,77 +5403,6 @@ var init_Modal = __esm({
5340
5403
  Modal.displayName = "Modal";
5341
5404
  }
5342
5405
  });
5343
- function isMotionEnabled() {
5344
- if (typeof document === "undefined") return true;
5345
- if (motionEnabledCache !== null) return motionEnabledCache;
5346
- const v = getComputedStyle(document.documentElement).getPropertyValue("--motion-enable").trim().toLowerCase();
5347
- motionEnabledCache = v !== "off";
5348
- return motionEnabledCache;
5349
- }
5350
- function usePresence(show, opts) {
5351
- const { animation, animate = true, onExited } = opts;
5352
- const [mounted, setMounted] = React91.useState(show);
5353
- const [exiting, setExiting] = React91.useState(false);
5354
- const prev = React91.useRef(show);
5355
- const onExitedRef = React91.useRef(onExited);
5356
- onExitedRef.current = onExited;
5357
- const safeTimer = React91.useRef(null);
5358
- const clearSafe = React91.useCallback(() => {
5359
- if (safeTimer.current) {
5360
- clearTimeout(safeTimer.current);
5361
- safeTimer.current = null;
5362
- }
5363
- }, []);
5364
- const finishExit = React91.useCallback(() => {
5365
- clearSafe();
5366
- setExiting(false);
5367
- setMounted(false);
5368
- onExitedRef.current?.();
5369
- }, [clearSafe]);
5370
- React91.useEffect(() => {
5371
- const moving = animate && isMotionEnabled();
5372
- if (show && !prev.current) {
5373
- setExiting(false);
5374
- setMounted(true);
5375
- } else if (!show && prev.current) {
5376
- if (moving) {
5377
- setExiting(true);
5378
- clearSafe();
5379
- safeTimer.current = setTimeout(finishExit, SAFE_EXIT_MS);
5380
- } else {
5381
- setMounted(false);
5382
- setExiting(false);
5383
- }
5384
- }
5385
- prev.current = show;
5386
- }, [show, animate, clearSafe, finishExit]);
5387
- React91.useEffect(() => () => clearSafe(), [clearSafe]);
5388
- const disabled = !animate || !isMotionEnabled();
5389
- const className = disabled ? "" : exiting ? `animate-${animation}-out` : `animate-${animation}-in`;
5390
- const onAnimationEnd = React91.useCallback(
5391
- (e) => {
5392
- if (e.target !== e.currentTarget) return;
5393
- if (exiting) finishExit();
5394
- },
5395
- [exiting, finishExit]
5396
- );
5397
- return { mounted, exiting, className, onAnimationEnd };
5398
- }
5399
- var SAFE_EXIT_MS, motionEnabledCache, Presence;
5400
- var init_Presence = __esm({
5401
- "components/core/atoms/Presence.tsx"() {
5402
- "use client";
5403
- init_cn();
5404
- SAFE_EXIT_MS = 1e3;
5405
- motionEnabledCache = null;
5406
- Presence = ({ show, className, children, ...opts }) => {
5407
- const { mounted, className: animClass, onAnimationEnd } = usePresence(show, opts);
5408
- if (!mounted) return null;
5409
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(animClass, className), onAnimationEnd, children });
5410
- };
5411
- Presence.displayName = "Presence";
5412
- }
5413
- });
5414
5406
  var Overlay;
5415
5407
  var init_Overlay = __esm({
5416
5408
  "components/core/atoms/Overlay.tsx"() {
package/dist/avl/index.js CHANGED
@@ -5060,6 +5060,77 @@ var init_Dialog = __esm({
5060
5060
  Dialog.displayName = "Dialog";
5061
5061
  }
5062
5062
  });
5063
+ function isMotionEnabled() {
5064
+ if (typeof document === "undefined") return true;
5065
+ if (motionEnabledCache !== null) return motionEnabledCache;
5066
+ const v = getComputedStyle(document.documentElement).getPropertyValue("--motion-enable").trim().toLowerCase();
5067
+ motionEnabledCache = v !== "off";
5068
+ return motionEnabledCache;
5069
+ }
5070
+ function usePresence(show, opts) {
5071
+ const { animation, animate = true, onExited } = opts;
5072
+ const [mounted, setMounted] = useState(show);
5073
+ const [exiting, setExiting] = useState(false);
5074
+ const prev = useRef(show);
5075
+ const onExitedRef = useRef(onExited);
5076
+ onExitedRef.current = onExited;
5077
+ const safeTimer = useRef(null);
5078
+ const clearSafe = useCallback(() => {
5079
+ if (safeTimer.current) {
5080
+ clearTimeout(safeTimer.current);
5081
+ safeTimer.current = null;
5082
+ }
5083
+ }, []);
5084
+ const finishExit = useCallback(() => {
5085
+ clearSafe();
5086
+ setExiting(false);
5087
+ setMounted(false);
5088
+ onExitedRef.current?.();
5089
+ }, [clearSafe]);
5090
+ useLayoutEffect(() => {
5091
+ const moving = animate && isMotionEnabled();
5092
+ if (show && !prev.current) {
5093
+ setExiting(false);
5094
+ setMounted(true);
5095
+ } else if (!show && prev.current) {
5096
+ if (moving) {
5097
+ setExiting(true);
5098
+ clearSafe();
5099
+ safeTimer.current = setTimeout(finishExit, SAFE_EXIT_MS);
5100
+ } else {
5101
+ setMounted(false);
5102
+ setExiting(false);
5103
+ }
5104
+ }
5105
+ prev.current = show;
5106
+ }, [show, animate, clearSafe, finishExit]);
5107
+ useEffect(() => () => clearSafe(), [clearSafe]);
5108
+ const disabled = !animate || !isMotionEnabled();
5109
+ const className = disabled ? "" : exiting ? `animate-${animation}-out` : `animate-${animation}-in`;
5110
+ const onAnimationEnd = useCallback(
5111
+ (e) => {
5112
+ if (e.target !== e.currentTarget) return;
5113
+ if (exiting) finishExit();
5114
+ },
5115
+ [exiting, finishExit]
5116
+ );
5117
+ return { mounted, exiting, className, onAnimationEnd };
5118
+ }
5119
+ var SAFE_EXIT_MS, motionEnabledCache, Presence;
5120
+ var init_Presence = __esm({
5121
+ "components/core/atoms/Presence.tsx"() {
5122
+ "use client";
5123
+ init_cn();
5124
+ SAFE_EXIT_MS = 1e3;
5125
+ motionEnabledCache = null;
5126
+ Presence = ({ show, className, children, ...opts }) => {
5127
+ const { mounted, className: animClass, onAnimationEnd } = usePresence(show, opts);
5128
+ if (!mounted) return null;
5129
+ return /* @__PURE__ */ jsx("div", { className: cn(animClass, className), onAnimationEnd, children });
5130
+ };
5131
+ Presence.displayName = "Presence";
5132
+ }
5133
+ });
5063
5134
  var sizeClasses2, minWidthClasses, lookStyles, Modal;
5064
5135
  var init_Modal = __esm({
5065
5136
  "components/core/molecules/Modal.tsx"() {
@@ -5070,6 +5141,7 @@ var init_Modal = __esm({
5070
5141
  init_Typography();
5071
5142
  init_cn();
5072
5143
  init_useEventBus();
5144
+ init_Presence();
5073
5145
  sizeClasses2 = {
5074
5146
  sm: "max-w-md",
5075
5147
  md: "max-w-2xl",
@@ -5114,18 +5186,10 @@ var init_Modal = __esm({
5114
5186
  const [dragY, setDragY] = useState(0);
5115
5187
  const dragStartY = useRef(0);
5116
5188
  const isDragging = useRef(false);
5117
- const [closing, setClosing] = useState(false);
5118
- const wasOpenRef = useRef(isOpen);
5119
- useEffect(() => {
5120
- if (wasOpenRef.current && !isOpen) setClosing(true);
5121
- wasOpenRef.current = isOpen;
5122
- }, [isOpen]);
5123
- const handleAnimEnd = (e) => {
5124
- if (closing && e.target === e.currentTarget) {
5125
- setClosing(false);
5126
- onExited?.();
5127
- }
5128
- };
5189
+ const { mounted, exiting, onAnimationEnd: handleAnimEnd } = usePresence(isOpen, {
5190
+ animation: "modal",
5191
+ onExited
5192
+ });
5129
5193
  useEffect(() => {
5130
5194
  if (isOpen) {
5131
5195
  previousActiveElement.current = document.activeElement;
@@ -5160,10 +5224,9 @@ var init_Modal = __esm({
5160
5224
  };
5161
5225
  }, [isOpen]);
5162
5226
  if (typeof document === "undefined") return null;
5163
- const renderOpen = isOpen || closing;
5164
- if (!renderOpen) return null;
5165
- const dialogAnim = closing ? "animate-modal-out" : "animate-modal-in";
5166
- const overlayAnim = closing ? "animate-overlay-out" : "animate-overlay-in";
5227
+ if (!mounted) return null;
5228
+ const dialogAnim = exiting ? "animate-modal-out" : "animate-modal-in";
5229
+ const overlayAnim = exiting ? "animate-overlay-out" : "animate-overlay-in";
5167
5230
  const handleClose = () => {
5168
5231
  if (closeEvent) eventBus.emit(`UI:${closeEvent}`, {});
5169
5232
  onClose();
@@ -5294,77 +5357,6 @@ var init_Modal = __esm({
5294
5357
  Modal.displayName = "Modal";
5295
5358
  }
5296
5359
  });
5297
- function isMotionEnabled() {
5298
- if (typeof document === "undefined") return true;
5299
- if (motionEnabledCache !== null) return motionEnabledCache;
5300
- const v = getComputedStyle(document.documentElement).getPropertyValue("--motion-enable").trim().toLowerCase();
5301
- motionEnabledCache = v !== "off";
5302
- return motionEnabledCache;
5303
- }
5304
- function usePresence(show, opts) {
5305
- const { animation, animate = true, onExited } = opts;
5306
- const [mounted, setMounted] = useState(show);
5307
- const [exiting, setExiting] = useState(false);
5308
- const prev = useRef(show);
5309
- const onExitedRef = useRef(onExited);
5310
- onExitedRef.current = onExited;
5311
- const safeTimer = useRef(null);
5312
- const clearSafe = useCallback(() => {
5313
- if (safeTimer.current) {
5314
- clearTimeout(safeTimer.current);
5315
- safeTimer.current = null;
5316
- }
5317
- }, []);
5318
- const finishExit = useCallback(() => {
5319
- clearSafe();
5320
- setExiting(false);
5321
- setMounted(false);
5322
- onExitedRef.current?.();
5323
- }, [clearSafe]);
5324
- useEffect(() => {
5325
- const moving = animate && isMotionEnabled();
5326
- if (show && !prev.current) {
5327
- setExiting(false);
5328
- setMounted(true);
5329
- } else if (!show && prev.current) {
5330
- if (moving) {
5331
- setExiting(true);
5332
- clearSafe();
5333
- safeTimer.current = setTimeout(finishExit, SAFE_EXIT_MS);
5334
- } else {
5335
- setMounted(false);
5336
- setExiting(false);
5337
- }
5338
- }
5339
- prev.current = show;
5340
- }, [show, animate, clearSafe, finishExit]);
5341
- useEffect(() => () => clearSafe(), [clearSafe]);
5342
- const disabled = !animate || !isMotionEnabled();
5343
- const className = disabled ? "" : exiting ? `animate-${animation}-out` : `animate-${animation}-in`;
5344
- const onAnimationEnd = useCallback(
5345
- (e) => {
5346
- if (e.target !== e.currentTarget) return;
5347
- if (exiting) finishExit();
5348
- },
5349
- [exiting, finishExit]
5350
- );
5351
- return { mounted, exiting, className, onAnimationEnd };
5352
- }
5353
- var SAFE_EXIT_MS, motionEnabledCache, Presence;
5354
- var init_Presence = __esm({
5355
- "components/core/atoms/Presence.tsx"() {
5356
- "use client";
5357
- init_cn();
5358
- SAFE_EXIT_MS = 1e3;
5359
- motionEnabledCache = null;
5360
- Presence = ({ show, className, children, ...opts }) => {
5361
- const { mounted, className: animClass, onAnimationEnd } = usePresence(show, opts);
5362
- if (!mounted) return null;
5363
- return /* @__PURE__ */ jsx("div", { className: cn(animClass, className), onAnimationEnd, children });
5364
- };
5365
- Presence.displayName = "Presence";
5366
- }
5367
- });
5368
5360
  var Overlay;
5369
5361
  var init_Overlay = __esm({
5370
5362
  "components/core/atoms/Overlay.tsx"() {
@@ -4122,7 +4122,7 @@ function usePresence(show, opts) {
4122
4122
  setMounted(false);
4123
4123
  onExitedRef.current?.();
4124
4124
  }, [clearSafe]);
4125
- React74.useEffect(() => {
4125
+ React74.useLayoutEffect(() => {
4126
4126
  const moving = animate && isMotionEnabled();
4127
4127
  if (show && !prev.current) {
4128
4128
  setExiting(false);
@@ -6122,6 +6122,7 @@ var init_Modal = __esm({
6122
6122
  init_Typography();
6123
6123
  init_cn();
6124
6124
  init_useEventBus();
6125
+ init_Presence();
6125
6126
  sizeClasses6 = {
6126
6127
  sm: "max-w-md",
6127
6128
  md: "max-w-2xl",
@@ -6166,18 +6167,10 @@ var init_Modal = __esm({
6166
6167
  const [dragY, setDragY] = React74.useState(0);
6167
6168
  const dragStartY = React74.useRef(0);
6168
6169
  const isDragging = React74.useRef(false);
6169
- const [closing, setClosing] = React74.useState(false);
6170
- const wasOpenRef = React74.useRef(isOpen);
6171
- React74.useEffect(() => {
6172
- if (wasOpenRef.current && !isOpen) setClosing(true);
6173
- wasOpenRef.current = isOpen;
6174
- }, [isOpen]);
6175
- const handleAnimEnd = (e) => {
6176
- if (closing && e.target === e.currentTarget) {
6177
- setClosing(false);
6178
- onExited?.();
6179
- }
6180
- };
6170
+ const { mounted, exiting, onAnimationEnd: handleAnimEnd } = usePresence(isOpen, {
6171
+ animation: "modal",
6172
+ onExited
6173
+ });
6181
6174
  React74.useEffect(() => {
6182
6175
  if (isOpen) {
6183
6176
  previousActiveElement.current = document.activeElement;
@@ -6212,10 +6205,9 @@ var init_Modal = __esm({
6212
6205
  };
6213
6206
  }, [isOpen]);
6214
6207
  if (typeof document === "undefined") return null;
6215
- const renderOpen = isOpen || closing;
6216
- if (!renderOpen) return null;
6217
- const dialogAnim = closing ? "animate-modal-out" : "animate-modal-in";
6218
- const overlayAnim = closing ? "animate-overlay-out" : "animate-overlay-in";
6208
+ if (!mounted) return null;
6209
+ const dialogAnim = exiting ? "animate-modal-out" : "animate-modal-in";
6210
+ const overlayAnim = exiting ? "animate-overlay-out" : "animate-overlay-in";
6219
6211
  const handleClose = () => {
6220
6212
  if (closeEvent) eventBus.emit(`UI:${closeEvent}`, {});
6221
6213
  onClose();
@@ -6389,7 +6389,7 @@ interface DataGridProps extends DataDndProps {
6389
6389
  */
6390
6390
  look?: "dense" | "spacious" | "striped" | "borderless" | "card-rows";
6391
6391
  }
6392
- declare function DataGrid({ entity, fields, columns, itemActions, maxInlineActions, scrollX, cols, gap, minCardWidth, className, isLoading, error, imageField, selectable, selectionEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, dragGroup, accepts, sortable, dropEvent, reorderEvent, positionEvent, dndItemIdField, dndRoot, look, }: DataGridProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element | null | undefined;
6392
+ declare function DataGrid({ entity, fields, columns, itemActions, maxInlineActions, scrollX, cols, gap, minCardWidth, className, isLoading, error, imageField, selectable, selectionEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, dragGroup, accepts, sortable, dropEvent, reorderEvent, positionEvent, dndItemIdField, dndRoot, look, }: DataGridProps): string | number | bigint | boolean | React__default.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
6393
6393
  declare namespace DataGrid {
6394
6394
  var displayName: string;
6395
6395
  }
@@ -6516,7 +6516,7 @@ interface DataListProps extends DataDndProps {
6516
6516
  */
6517
6517
  look?: "dense" | "spacious" | "striped" | "borderless" | "card-rows";
6518
6518
  }
6519
- declare function DataList({ entity, fields, columns, itemActions, maxInlineActions, itemClickEvent, gap, variant, groupBy, senderField, currentUser, className, isLoading, error, reorderable: _reorderable, reorderEvent: _reorderEvent, swipeLeftEvent: _swipeLeftEvent, swipeLeftActions: _swipeLeftActions, swipeRightEvent: _swipeRightEvent, swipeRightActions: _swipeRightActions, longPressEvent: _longPressEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, dragGroup, accepts, sortable: sortableProp, dropEvent, reorderEvent: dndReorderEvent, positionEvent, dndItemIdField, dndRoot, look, }: DataListProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element | null | undefined;
6519
+ declare function DataList({ entity, fields, columns, itemActions, maxInlineActions, itemClickEvent, gap, variant, groupBy, senderField, currentUser, className, isLoading, error, reorderable: _reorderable, reorderEvent: _reorderEvent, swipeLeftEvent: _swipeLeftEvent, swipeLeftActions: _swipeLeftActions, swipeRightEvent: _swipeRightEvent, swipeRightActions: _swipeRightActions, longPressEvent: _longPressEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, dragGroup, accepts, sortable: sortableProp, dropEvent, reorderEvent: dndReorderEvent, positionEvent, dndItemIdField, dndRoot, look, }: DataListProps): string | number | bigint | boolean | React__default.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
6520
6520
  declare namespace DataList {
6521
6521
  var displayName: string;
6522
6522
  }
@@ -6389,7 +6389,7 @@ interface DataGridProps extends DataDndProps {
6389
6389
  */
6390
6390
  look?: "dense" | "spacious" | "striped" | "borderless" | "card-rows";
6391
6391
  }
6392
- declare function DataGrid({ entity, fields, columns, itemActions, maxInlineActions, scrollX, cols, gap, minCardWidth, className, isLoading, error, imageField, selectable, selectionEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, dragGroup, accepts, sortable, dropEvent, reorderEvent, positionEvent, dndItemIdField, dndRoot, look, }: DataGridProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element | null | undefined;
6392
+ declare function DataGrid({ entity, fields, columns, itemActions, maxInlineActions, scrollX, cols, gap, minCardWidth, className, isLoading, error, imageField, selectable, selectionEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, dragGroup, accepts, sortable, dropEvent, reorderEvent, positionEvent, dndItemIdField, dndRoot, look, }: DataGridProps): string | number | bigint | boolean | React__default.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
6393
6393
  declare namespace DataGrid {
6394
6394
  var displayName: string;
6395
6395
  }
@@ -6516,7 +6516,7 @@ interface DataListProps extends DataDndProps {
6516
6516
  */
6517
6517
  look?: "dense" | "spacious" | "striped" | "borderless" | "card-rows";
6518
6518
  }
6519
- declare function DataList({ entity, fields, columns, itemActions, maxInlineActions, itemClickEvent, gap, variant, groupBy, senderField, currentUser, className, isLoading, error, reorderable: _reorderable, reorderEvent: _reorderEvent, swipeLeftEvent: _swipeLeftEvent, swipeLeftActions: _swipeLeftActions, swipeRightEvent: _swipeRightEvent, swipeRightActions: _swipeRightActions, longPressEvent: _longPressEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, dragGroup, accepts, sortable: sortableProp, dropEvent, reorderEvent: dndReorderEvent, positionEvent, dndItemIdField, dndRoot, look, }: DataListProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element | null | undefined;
6519
+ declare function DataList({ entity, fields, columns, itemActions, maxInlineActions, itemClickEvent, gap, variant, groupBy, senderField, currentUser, className, isLoading, error, reorderable: _reorderable, reorderEvent: _reorderEvent, swipeLeftEvent: _swipeLeftEvent, swipeLeftActions: _swipeLeftActions, swipeRightEvent: _swipeRightEvent, swipeRightActions: _swipeRightActions, longPressEvent: _longPressEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, dragGroup, accepts, sortable: sortableProp, dropEvent, reorderEvent: dndReorderEvent, positionEvent, dndItemIdField, dndRoot, look, }: DataListProps): string | number | bigint | boolean | React__default.JSX.Element | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | null | undefined;
6520
6520
  declare namespace DataList {
6521
6521
  var displayName: string;
6522
6522
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React74 from 'react';
3
- import React74__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, useState, Suspense, lazy, useSyncExternalStore, useLayoutEffect, useId } from 'react';
3
+ import React74__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, useState, useLayoutEffect, Suspense, lazy, useSyncExternalStore, useId } from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
6
  import { EventBusContext, useTraitScopeChain, useCurrentPagePath, useGameAudioContextOptional, useEntitySchemaOptional, TraitScopeProvider } from '@almadar/ui/providers';
@@ -4077,7 +4077,7 @@ function usePresence(show, opts) {
4077
4077
  setMounted(false);
4078
4078
  onExitedRef.current?.();
4079
4079
  }, [clearSafe]);
4080
- useEffect(() => {
4080
+ useLayoutEffect(() => {
4081
4081
  const moving = animate && isMotionEnabled();
4082
4082
  if (show && !prev.current) {
4083
4083
  setExiting(false);
@@ -6077,6 +6077,7 @@ var init_Modal = __esm({
6077
6077
  init_Typography();
6078
6078
  init_cn();
6079
6079
  init_useEventBus();
6080
+ init_Presence();
6080
6081
  sizeClasses6 = {
6081
6082
  sm: "max-w-md",
6082
6083
  md: "max-w-2xl",
@@ -6121,18 +6122,10 @@ var init_Modal = __esm({
6121
6122
  const [dragY, setDragY] = useState(0);
6122
6123
  const dragStartY = useRef(0);
6123
6124
  const isDragging = useRef(false);
6124
- const [closing, setClosing] = useState(false);
6125
- const wasOpenRef = useRef(isOpen);
6126
- useEffect(() => {
6127
- if (wasOpenRef.current && !isOpen) setClosing(true);
6128
- wasOpenRef.current = isOpen;
6129
- }, [isOpen]);
6130
- const handleAnimEnd = (e) => {
6131
- if (closing && e.target === e.currentTarget) {
6132
- setClosing(false);
6133
- onExited?.();
6134
- }
6135
- };
6125
+ const { mounted, exiting, onAnimationEnd: handleAnimEnd } = usePresence(isOpen, {
6126
+ animation: "modal",
6127
+ onExited
6128
+ });
6136
6129
  useEffect(() => {
6137
6130
  if (isOpen) {
6138
6131
  previousActiveElement.current = document.activeElement;
@@ -6167,10 +6160,9 @@ var init_Modal = __esm({
6167
6160
  };
6168
6161
  }, [isOpen]);
6169
6162
  if (typeof document === "undefined") return null;
6170
- const renderOpen = isOpen || closing;
6171
- if (!renderOpen) return null;
6172
- const dialogAnim = closing ? "animate-modal-out" : "animate-modal-in";
6173
- const overlayAnim = closing ? "animate-overlay-out" : "animate-overlay-in";
6163
+ if (!mounted) return null;
6164
+ const dialogAnim = exiting ? "animate-modal-out" : "animate-modal-in";
6165
+ const overlayAnim = exiting ? "animate-overlay-out" : "animate-overlay-in";
6174
6166
  const handleClose = () => {
6175
6167
  if (closeEvent) eventBus.emit(`UI:${closeEvent}`, {});
6176
6168
  onClose();