@almadar/ui 3.5.0 → 3.5.2

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.
@@ -11041,38 +11041,16 @@ var init_MapView = __esm({
11041
11041
  }
11042
11042
  });
11043
11043
  function ButtonPattern({
11044
- label,
11045
- variant = "primary",
11046
- size = "md",
11047
- disabled = false,
11044
+ action,
11048
11045
  onClick,
11049
11046
  event,
11050
11047
  icon,
11051
- iconPosition = "left",
11052
- className
11048
+ iconPosition,
11049
+ ...rest
11053
11050
  }) {
11054
- const { emit } = useEventBus();
11055
- const eventName = onClick ?? event;
11056
- const handleClick = () => {
11057
- if (eventName && !disabled) {
11058
- emit(`UI:${eventName}`, {});
11059
- }
11060
- };
11061
- return /* @__PURE__ */ jsxRuntime.jsxs(
11062
- Button,
11063
- {
11064
- variant,
11065
- size,
11066
- disabled,
11067
- onClick: handleClick,
11068
- className,
11069
- children: [
11070
- icon && iconPosition === "left" && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, size: "sm" }),
11071
- label,
11072
- icon && iconPosition === "right" && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, size: "sm" })
11073
- ]
11074
- }
11075
- );
11051
+ const resolvedAction = action ?? onClick ?? event;
11052
+ const iconProps = iconPosition === "right" ? { iconRight: icon } : { icon };
11053
+ return /* @__PURE__ */ jsxRuntime.jsx(Button, { ...rest, action: resolvedAction, ...iconProps });
11076
11054
  }
11077
11055
  function TextPattern({
11078
11056
  content,
@@ -46194,11 +46172,13 @@ function enrichFormFields(fields, entityDef) {
46194
46172
  }
46195
46173
  function renderContainedPortal(slot, content, onDismiss) {
46196
46174
  const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
46175
+ const slotId = `slot-${slot}`;
46197
46176
  switch (slot) {
46198
46177
  case "modal":
46199
46178
  return /* @__PURE__ */ jsxRuntime.jsx(
46200
46179
  Box,
46201
46180
  {
46181
+ id: slotId,
46202
46182
  className: "absolute inset-0 z-50 flex items-start justify-center overflow-auto",
46203
46183
  style: { backgroundColor: "rgba(0, 0, 0, 0.5)", paddingTop: "10%" },
46204
46184
  onClick: onDismiss,
@@ -46235,6 +46215,7 @@ function renderContainedPortal(slot, content, onDismiss) {
46235
46215
  return /* @__PURE__ */ jsxRuntime.jsx(
46236
46216
  Box,
46237
46217
  {
46218
+ id: slotId,
46238
46219
  className: "absolute inset-0 z-50 overflow-hidden",
46239
46220
  style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
46240
46221
  onClick: onDismiss,
@@ -46267,7 +46248,7 @@ function renderContainedPortal(slot, content, onDismiss) {
46267
46248
  }
46268
46249
  );
46269
46250
  case "toast":
46270
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
46251
+ return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
46271
46252
  Toast,
46272
46253
  {
46273
46254
  variant: content.props.variant ?? "info",
@@ -46280,6 +46261,7 @@ function renderContainedPortal(slot, content, onDismiss) {
46280
46261
  return /* @__PURE__ */ jsxRuntime.jsx(
46281
46262
  Box,
46282
46263
  {
46264
+ id: slotId,
46283
46265
  className: "absolute inset-0 z-50 flex items-center justify-center overflow-auto",
46284
46266
  style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
46285
46267
  onClick: onDismiss,
@@ -46287,9 +46269,9 @@ function renderContainedPortal(slot, content, onDismiss) {
46287
46269
  }
46288
46270
  );
46289
46271
  case "center":
46290
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
46272
+ return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
46291
46273
  default:
46292
- return slotContent;
46274
+ return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent });
46293
46275
  }
46294
46276
  }
46295
46277
  function UISlotComponent({
@@ -46408,12 +46390,14 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
46408
46390
  eventBus.clear(slot);
46409
46391
  };
46410
46392
  if (!portalRoot) return null;
46393
+ const slotId = `slot-${slot}`;
46411
46394
  let wrapper;
46412
46395
  switch (slot) {
46413
46396
  case "modal":
46414
46397
  wrapper = /* @__PURE__ */ jsxRuntime.jsx(Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: /* @__PURE__ */ jsxRuntime.jsx(
46415
46398
  Box,
46416
46399
  {
46400
+ id: slotId,
46417
46401
  className: cn("ui-slot", `ui-slot-${slot}`, className),
46418
46402
  "data-pattern": pattern,
46419
46403
  "data-source-trait": sourceTrait,
@@ -46425,6 +46409,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
46425
46409
  wrapper = /* @__PURE__ */ jsxRuntime.jsx(Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsxRuntime.jsx(
46426
46410
  Box,
46427
46411
  {
46412
+ id: slotId,
46428
46413
  className: cn("ui-slot", `ui-slot-${slot}`, className),
46429
46414
  "data-pattern": pattern,
46430
46415
  "data-source-trait": sourceTrait,
@@ -46436,6 +46421,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
46436
46421
  wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "fixed top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
46437
46422
  Box,
46438
46423
  {
46424
+ id: slotId,
46439
46425
  className: cn("ui-slot", `ui-slot-${slot}`, className),
46440
46426
  "data-pattern": pattern,
46441
46427
  "data-source-trait": sourceTrait,
@@ -46447,6 +46433,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
46447
46433
  wrapper = /* @__PURE__ */ jsxRuntime.jsx(
46448
46434
  Box,
46449
46435
  {
46436
+ id: slotId,
46450
46437
  className: cn("ui-slot", `ui-slot-${slot}`, className),
46451
46438
  "data-pattern": pattern,
46452
46439
  "data-source-trait": sourceTrait,
@@ -46470,6 +46457,8 @@ function SlotPortal({
46470
46457
  if (portalRoot) getOrCreatePortalRoot();
46471
46458
  });
46472
46459
  if (!portalRoot) return null;
46460
+ const slotId = `slot-${slot}`;
46461
+ const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
46473
46462
  let wrapper;
46474
46463
  switch (slot) {
46475
46464
  case "modal":
@@ -46480,7 +46469,7 @@ function SlotPortal({
46480
46469
  onClose: onDismiss,
46481
46470
  title: content.props.title,
46482
46471
  size: content.props.size,
46483
- children: /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss })
46472
+ children: /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent })
46484
46473
  }
46485
46474
  );
46486
46475
  break;
@@ -46493,12 +46482,12 @@ function SlotPortal({
46493
46482
  title: content.props.title,
46494
46483
  position: content.props.position ?? "right",
46495
46484
  width: content.props.width,
46496
- children: /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss })
46485
+ children: /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent })
46497
46486
  }
46498
46487
  );
46499
46488
  break;
46500
46489
  case "toast":
46501
- wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsxRuntime.jsx(
46490
+ wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsxRuntime.jsx(
46502
46491
  Toast,
46503
46492
  {
46504
46493
  variant: content.props.variant ?? "info",
@@ -46512,17 +46501,18 @@ function SlotPortal({
46512
46501
  wrapper = /* @__PURE__ */ jsxRuntime.jsx(
46513
46502
  Box,
46514
46503
  {
46504
+ id: slotId,
46515
46505
  className: "fixed inset-0 z-50 bg-foreground/50 flex items-center justify-center",
46516
46506
  onClick: onDismiss,
46517
- children: /* @__PURE__ */ jsxRuntime.jsx(Box, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss }) })
46507
+ children: /* @__PURE__ */ jsxRuntime.jsx(Box, { onClick: (e) => e.stopPropagation(), children: slotContent })
46518
46508
  }
46519
46509
  );
46520
46510
  break;
46521
46511
  case "center":
46522
- wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pointer-events-auto", children: /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss }) }) });
46512
+ wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "pointer-events-auto", children: slotContent }) });
46523
46513
  break;
46524
46514
  default:
46525
- wrapper = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
46515
+ wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent });
46526
46516
  }
46527
46517
  return reactDom.createPortal(wrapper, portalRoot);
46528
46518
  }
package/dist/avl/index.js CHANGED
@@ -10995,38 +10995,16 @@ var init_MapView = __esm({
10995
10995
  }
10996
10996
  });
10997
10997
  function ButtonPattern({
10998
- label,
10999
- variant = "primary",
11000
- size = "md",
11001
- disabled = false,
10998
+ action,
11002
10999
  onClick,
11003
11000
  event,
11004
11001
  icon,
11005
- iconPosition = "left",
11006
- className
11002
+ iconPosition,
11003
+ ...rest
11007
11004
  }) {
11008
- const { emit } = useEventBus();
11009
- const eventName = onClick ?? event;
11010
- const handleClick = () => {
11011
- if (eventName && !disabled) {
11012
- emit(`UI:${eventName}`, {});
11013
- }
11014
- };
11015
- return /* @__PURE__ */ jsxs(
11016
- Button,
11017
- {
11018
- variant,
11019
- size,
11020
- disabled,
11021
- onClick: handleClick,
11022
- className,
11023
- children: [
11024
- icon && iconPosition === "left" && /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }),
11025
- label,
11026
- icon && iconPosition === "right" && /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" })
11027
- ]
11028
- }
11029
- );
11005
+ const resolvedAction = action ?? onClick ?? event;
11006
+ const iconProps = iconPosition === "right" ? { iconRight: icon } : { icon };
11007
+ return /* @__PURE__ */ jsx(Button, { ...rest, action: resolvedAction, ...iconProps });
11030
11008
  }
11031
11009
  function TextPattern({
11032
11010
  content,
@@ -46148,11 +46126,13 @@ function enrichFormFields(fields, entityDef) {
46148
46126
  }
46149
46127
  function renderContainedPortal(slot, content, onDismiss) {
46150
46128
  const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss });
46129
+ const slotId = `slot-${slot}`;
46151
46130
  switch (slot) {
46152
46131
  case "modal":
46153
46132
  return /* @__PURE__ */ jsx(
46154
46133
  Box,
46155
46134
  {
46135
+ id: slotId,
46156
46136
  className: "absolute inset-0 z-50 flex items-start justify-center overflow-auto",
46157
46137
  style: { backgroundColor: "rgba(0, 0, 0, 0.5)", paddingTop: "10%" },
46158
46138
  onClick: onDismiss,
@@ -46189,6 +46169,7 @@ function renderContainedPortal(slot, content, onDismiss) {
46189
46169
  return /* @__PURE__ */ jsx(
46190
46170
  Box,
46191
46171
  {
46172
+ id: slotId,
46192
46173
  className: "absolute inset-0 z-50 overflow-hidden",
46193
46174
  style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
46194
46175
  onClick: onDismiss,
@@ -46221,7 +46202,7 @@ function renderContainedPortal(slot, content, onDismiss) {
46221
46202
  }
46222
46203
  );
46223
46204
  case "toast":
46224
- return /* @__PURE__ */ jsx(Box, { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
46205
+ return /* @__PURE__ */ jsx(Box, { id: slotId, className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
46225
46206
  Toast,
46226
46207
  {
46227
46208
  variant: content.props.variant ?? "info",
@@ -46234,6 +46215,7 @@ function renderContainedPortal(slot, content, onDismiss) {
46234
46215
  return /* @__PURE__ */ jsx(
46235
46216
  Box,
46236
46217
  {
46218
+ id: slotId,
46237
46219
  className: "absolute inset-0 z-50 flex items-center justify-center overflow-auto",
46238
46220
  style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
46239
46221
  onClick: onDismiss,
@@ -46241,9 +46223,9 @@ function renderContainedPortal(slot, content, onDismiss) {
46241
46223
  }
46242
46224
  );
46243
46225
  case "center":
46244
- return /* @__PURE__ */ jsx(Box, { className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
46226
+ return /* @__PURE__ */ jsx(Box, { id: slotId, className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
46245
46227
  default:
46246
- return slotContent;
46228
+ return /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent });
46247
46229
  }
46248
46230
  }
46249
46231
  function UISlotComponent({
@@ -46362,12 +46344,14 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
46362
46344
  eventBus.clear(slot);
46363
46345
  };
46364
46346
  if (!portalRoot) return null;
46347
+ const slotId = `slot-${slot}`;
46365
46348
  let wrapper;
46366
46349
  switch (slot) {
46367
46350
  case "modal":
46368
46351
  wrapper = /* @__PURE__ */ jsx(Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: /* @__PURE__ */ jsx(
46369
46352
  Box,
46370
46353
  {
46354
+ id: slotId,
46371
46355
  className: cn("ui-slot", `ui-slot-${slot}`, className),
46372
46356
  "data-pattern": pattern,
46373
46357
  "data-source-trait": sourceTrait,
@@ -46379,6 +46363,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
46379
46363
  wrapper = /* @__PURE__ */ jsx(Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsx(
46380
46364
  Box,
46381
46365
  {
46366
+ id: slotId,
46382
46367
  className: cn("ui-slot", `ui-slot-${slot}`, className),
46383
46368
  "data-pattern": pattern,
46384
46369
  "data-source-trait": sourceTrait,
@@ -46390,6 +46375,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
46390
46375
  wrapper = /* @__PURE__ */ jsx(Box, { className: "fixed top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
46391
46376
  Box,
46392
46377
  {
46378
+ id: slotId,
46393
46379
  className: cn("ui-slot", `ui-slot-${slot}`, className),
46394
46380
  "data-pattern": pattern,
46395
46381
  "data-source-trait": sourceTrait,
@@ -46401,6 +46387,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
46401
46387
  wrapper = /* @__PURE__ */ jsx(
46402
46388
  Box,
46403
46389
  {
46390
+ id: slotId,
46404
46391
  className: cn("ui-slot", `ui-slot-${slot}`, className),
46405
46392
  "data-pattern": pattern,
46406
46393
  "data-source-trait": sourceTrait,
@@ -46424,6 +46411,8 @@ function SlotPortal({
46424
46411
  if (portalRoot) getOrCreatePortalRoot();
46425
46412
  });
46426
46413
  if (!portalRoot) return null;
46414
+ const slotId = `slot-${slot}`;
46415
+ const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss });
46427
46416
  let wrapper;
46428
46417
  switch (slot) {
46429
46418
  case "modal":
@@ -46434,7 +46423,7 @@ function SlotPortal({
46434
46423
  onClose: onDismiss,
46435
46424
  title: content.props.title,
46436
46425
  size: content.props.size,
46437
- children: /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss })
46426
+ children: /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent })
46438
46427
  }
46439
46428
  );
46440
46429
  break;
@@ -46447,12 +46436,12 @@ function SlotPortal({
46447
46436
  title: content.props.title,
46448
46437
  position: content.props.position ?? "right",
46449
46438
  width: content.props.width,
46450
- children: /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss })
46439
+ children: /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent })
46451
46440
  }
46452
46441
  );
46453
46442
  break;
46454
46443
  case "toast":
46455
- wrapper = /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsx(
46444
+ wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsx(
46456
46445
  Toast,
46457
46446
  {
46458
46447
  variant: content.props.variant ?? "info",
@@ -46466,17 +46455,18 @@ function SlotPortal({
46466
46455
  wrapper = /* @__PURE__ */ jsx(
46467
46456
  Box,
46468
46457
  {
46458
+ id: slotId,
46469
46459
  className: "fixed inset-0 z-50 bg-foreground/50 flex items-center justify-center",
46470
46460
  onClick: onDismiss,
46471
- children: /* @__PURE__ */ jsx(Box, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss }) })
46461
+ children: /* @__PURE__ */ jsx(Box, { onClick: (e) => e.stopPropagation(), children: slotContent })
46472
46462
  }
46473
46463
  );
46474
46464
  break;
46475
46465
  case "center":
46476
- wrapper = /* @__PURE__ */ jsx(Box, { className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto", children: /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss }) }) });
46466
+ wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto", children: slotContent }) });
46477
46467
  break;
46478
46468
  default:
46479
- wrapper = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss });
46469
+ wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent });
46480
46470
  }
46481
46471
  return createPortal(wrapper, portalRoot);
46482
46472
  }
@@ -6398,38 +6398,16 @@ var init_MapView = __esm({
6398
6398
  }
6399
6399
  });
6400
6400
  function ButtonPattern({
6401
- label,
6402
- variant = "primary",
6403
- size = "md",
6404
- disabled = false,
6401
+ action,
6405
6402
  onClick,
6406
6403
  event,
6407
6404
  icon,
6408
- iconPosition = "left",
6409
- className
6405
+ iconPosition,
6406
+ ...rest
6410
6407
  }) {
6411
- const { emit } = useEventBus();
6412
- const eventName = onClick ?? event;
6413
- const handleClick = () => {
6414
- if (eventName && !disabled) {
6415
- emit(`UI:${eventName}`, {});
6416
- }
6417
- };
6418
- return /* @__PURE__ */ jsxRuntime.jsxs(
6419
- exports.Button,
6420
- {
6421
- variant,
6422
- size,
6423
- disabled,
6424
- onClick: handleClick,
6425
- className,
6426
- children: [
6427
- icon && iconPosition === "left" && /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: icon, size: "sm" }),
6428
- label,
6429
- icon && iconPosition === "right" && /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: icon, size: "sm" })
6430
- ]
6431
- }
6432
- );
6408
+ const resolvedAction = action ?? onClick ?? event;
6409
+ const iconProps = iconPosition === "right" ? { iconRight: icon } : { icon };
6410
+ return /* @__PURE__ */ jsxRuntime.jsx(exports.Button, { ...rest, action: resolvedAction, ...iconProps });
6433
6411
  }
6434
6412
  function TextPattern({
6435
6413
  content,
@@ -37158,11 +37136,13 @@ function enrichFormFields(fields, entityDef) {
37158
37136
  }
37159
37137
  function renderContainedPortal(slot, content, onDismiss) {
37160
37138
  const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
37139
+ const slotId = `slot-${slot}`;
37161
37140
  switch (slot) {
37162
37141
  case "modal":
37163
37142
  return /* @__PURE__ */ jsxRuntime.jsx(
37164
37143
  exports.Box,
37165
37144
  {
37145
+ id: slotId,
37166
37146
  className: "absolute inset-0 z-50 flex items-start justify-center overflow-auto",
37167
37147
  style: { backgroundColor: "rgba(0, 0, 0, 0.5)", paddingTop: "10%" },
37168
37148
  onClick: onDismiss,
@@ -37199,6 +37179,7 @@ function renderContainedPortal(slot, content, onDismiss) {
37199
37179
  return /* @__PURE__ */ jsxRuntime.jsx(
37200
37180
  exports.Box,
37201
37181
  {
37182
+ id: slotId,
37202
37183
  className: "absolute inset-0 z-50 overflow-hidden",
37203
37184
  style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
37204
37185
  onClick: onDismiss,
@@ -37231,7 +37212,7 @@ function renderContainedPortal(slot, content, onDismiss) {
37231
37212
  }
37232
37213
  );
37233
37214
  case "toast":
37234
- return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
37215
+ return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { id: slotId, className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
37235
37216
  exports.Toast,
37236
37217
  {
37237
37218
  variant: content.props.variant ?? "info",
@@ -37244,6 +37225,7 @@ function renderContainedPortal(slot, content, onDismiss) {
37244
37225
  return /* @__PURE__ */ jsxRuntime.jsx(
37245
37226
  exports.Box,
37246
37227
  {
37228
+ id: slotId,
37247
37229
  className: "absolute inset-0 z-50 flex items-center justify-center overflow-auto",
37248
37230
  style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
37249
37231
  onClick: onDismiss,
@@ -37251,9 +37233,9 @@ function renderContainedPortal(slot, content, onDismiss) {
37251
37233
  }
37252
37234
  );
37253
37235
  case "center":
37254
- return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
37236
+ return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { id: slotId, className: "absolute inset-0 z-50 flex items-center justify-center pointer-events-none overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "pointer-events-auto max-h-full overflow-auto", children: slotContent }) });
37255
37237
  default:
37256
- return slotContent;
37238
+ return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { id: slotId, children: slotContent });
37257
37239
  }
37258
37240
  }
37259
37241
  function UISlotComponent({
@@ -37372,12 +37354,14 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
37372
37354
  eventBus.clear(slot);
37373
37355
  };
37374
37356
  if (!portalRoot) return null;
37357
+ const slotId = `slot-${slot}`;
37375
37358
  let wrapper;
37376
37359
  switch (slot) {
37377
37360
  case "modal":
37378
37361
  wrapper = /* @__PURE__ */ jsxRuntime.jsx(exports.Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: /* @__PURE__ */ jsxRuntime.jsx(
37379
37362
  exports.Box,
37380
37363
  {
37364
+ id: slotId,
37381
37365
  className: cn("ui-slot", `ui-slot-${slot}`, className),
37382
37366
  "data-pattern": pattern,
37383
37367
  "data-source-trait": sourceTrait,
@@ -37389,6 +37373,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
37389
37373
  wrapper = /* @__PURE__ */ jsxRuntime.jsx(exports.Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsxRuntime.jsx(
37390
37374
  exports.Box,
37391
37375
  {
37376
+ id: slotId,
37392
37377
  className: cn("ui-slot", `ui-slot-${slot}`, className),
37393
37378
  "data-pattern": pattern,
37394
37379
  "data-source-trait": sourceTrait,
@@ -37400,6 +37385,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
37400
37385
  wrapper = /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "fixed top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
37401
37386
  exports.Box,
37402
37387
  {
37388
+ id: slotId,
37403
37389
  className: cn("ui-slot", `ui-slot-${slot}`, className),
37404
37390
  "data-pattern": pattern,
37405
37391
  "data-source-trait": sourceTrait,
@@ -37411,6 +37397,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
37411
37397
  wrapper = /* @__PURE__ */ jsxRuntime.jsx(
37412
37398
  exports.Box,
37413
37399
  {
37400
+ id: slotId,
37414
37401
  className: cn("ui-slot", `ui-slot-${slot}`, className),
37415
37402
  "data-pattern": pattern,
37416
37403
  "data-source-trait": sourceTrait,
@@ -37434,6 +37421,8 @@ function SlotPortal({
37434
37421
  if (portalRoot) getOrCreatePortalRoot();
37435
37422
  });
37436
37423
  if (!portalRoot) return null;
37424
+ const slotId = `slot-${slot}`;
37425
+ const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
37437
37426
  let wrapper;
37438
37427
  switch (slot) {
37439
37428
  case "modal":
@@ -37444,7 +37433,7 @@ function SlotPortal({
37444
37433
  onClose: onDismiss,
37445
37434
  title: content.props.title,
37446
37435
  size: content.props.size,
37447
- children: /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss })
37436
+ children: /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { id: slotId, children: slotContent })
37448
37437
  }
37449
37438
  );
37450
37439
  break;
@@ -37457,12 +37446,12 @@ function SlotPortal({
37457
37446
  title: content.props.title,
37458
37447
  position: content.props.position ?? "right",
37459
37448
  width: content.props.width,
37460
- children: /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss })
37449
+ children: /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { id: slotId, children: slotContent })
37461
37450
  }
37462
37451
  );
37463
37452
  break;
37464
37453
  case "toast":
37465
- wrapper = /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsxRuntime.jsx(
37454
+ wrapper = /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { id: slotId, className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsxRuntime.jsx(
37466
37455
  exports.Toast,
37467
37456
  {
37468
37457
  variant: content.props.variant ?? "info",
@@ -37476,17 +37465,18 @@ function SlotPortal({
37476
37465
  wrapper = /* @__PURE__ */ jsxRuntime.jsx(
37477
37466
  exports.Box,
37478
37467
  {
37468
+ id: slotId,
37479
37469
  className: "fixed inset-0 z-50 bg-foreground/50 flex items-center justify-center",
37480
37470
  onClick: onDismiss,
37481
- children: /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss }) })
37471
+ children: /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { onClick: (e) => e.stopPropagation(), children: slotContent })
37482
37472
  }
37483
37473
  );
37484
37474
  break;
37485
37475
  case "center":
37486
- wrapper = /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "pointer-events-auto", children: /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss }) }) });
37476
+ wrapper = /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { id: slotId, className: "fixed inset-0 z-50 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "pointer-events-auto", children: slotContent }) });
37487
37477
  break;
37488
37478
  default:
37489
- wrapper = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
37479
+ wrapper = /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { id: slotId, children: slotContent });
37490
37480
  }
37491
37481
  return reactDom.createPortal(wrapper, portalRoot);
37492
37482
  }