@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.
- package/dist/avl/index.cjs +27 -37
- package/dist/avl/index.js +27 -37
- package/dist/components/index.cjs +27 -37
- package/dist/components/index.js +27 -37
- package/dist/components/organisms/ComponentPatterns.d.ts +52 -22
- package/dist/providers/index.cjs +27 -37
- package/dist/providers/index.js +27 -37
- package/dist/runtime/index.cjs +27 -37
- package/dist/runtime/index.js +27 -37
- package/package.json +4 -1
package/dist/components/index.js
CHANGED
|
@@ -6353,38 +6353,16 @@ var init_MapView = __esm({
|
|
|
6353
6353
|
}
|
|
6354
6354
|
});
|
|
6355
6355
|
function ButtonPattern({
|
|
6356
|
-
|
|
6357
|
-
variant = "primary",
|
|
6358
|
-
size = "md",
|
|
6359
|
-
disabled = false,
|
|
6356
|
+
action,
|
|
6360
6357
|
onClick,
|
|
6361
6358
|
event,
|
|
6362
6359
|
icon,
|
|
6363
|
-
iconPosition
|
|
6364
|
-
|
|
6360
|
+
iconPosition,
|
|
6361
|
+
...rest
|
|
6365
6362
|
}) {
|
|
6366
|
-
const
|
|
6367
|
-
const
|
|
6368
|
-
|
|
6369
|
-
if (eventName && !disabled) {
|
|
6370
|
-
emit(`UI:${eventName}`, {});
|
|
6371
|
-
}
|
|
6372
|
-
};
|
|
6373
|
-
return /* @__PURE__ */ jsxs(
|
|
6374
|
-
Button,
|
|
6375
|
-
{
|
|
6376
|
-
variant,
|
|
6377
|
-
size,
|
|
6378
|
-
disabled,
|
|
6379
|
-
onClick: handleClick,
|
|
6380
|
-
className,
|
|
6381
|
-
children: [
|
|
6382
|
-
icon && iconPosition === "left" && /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }),
|
|
6383
|
-
label,
|
|
6384
|
-
icon && iconPosition === "right" && /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" })
|
|
6385
|
-
]
|
|
6386
|
-
}
|
|
6387
|
-
);
|
|
6363
|
+
const resolvedAction = action ?? onClick ?? event;
|
|
6364
|
+
const iconProps = iconPosition === "right" ? { iconRight: icon } : { icon };
|
|
6365
|
+
return /* @__PURE__ */ jsx(Button, { ...rest, action: resolvedAction, ...iconProps });
|
|
6388
6366
|
}
|
|
6389
6367
|
function TextPattern({
|
|
6390
6368
|
content,
|
|
@@ -37113,11 +37091,13 @@ function enrichFormFields(fields, entityDef) {
|
|
|
37113
37091
|
}
|
|
37114
37092
|
function renderContainedPortal(slot, content, onDismiss) {
|
|
37115
37093
|
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss });
|
|
37094
|
+
const slotId = `slot-${slot}`;
|
|
37116
37095
|
switch (slot) {
|
|
37117
37096
|
case "modal":
|
|
37118
37097
|
return /* @__PURE__ */ jsx(
|
|
37119
37098
|
Box,
|
|
37120
37099
|
{
|
|
37100
|
+
id: slotId,
|
|
37121
37101
|
className: "absolute inset-0 z-50 flex items-start justify-center overflow-auto",
|
|
37122
37102
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)", paddingTop: "10%" },
|
|
37123
37103
|
onClick: onDismiss,
|
|
@@ -37154,6 +37134,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37154
37134
|
return /* @__PURE__ */ jsx(
|
|
37155
37135
|
Box,
|
|
37156
37136
|
{
|
|
37137
|
+
id: slotId,
|
|
37157
37138
|
className: "absolute inset-0 z-50 overflow-hidden",
|
|
37158
37139
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37159
37140
|
onClick: onDismiss,
|
|
@@ -37186,7 +37167,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37186
37167
|
}
|
|
37187
37168
|
);
|
|
37188
37169
|
case "toast":
|
|
37189
|
-
return /* @__PURE__ */ jsx(Box, { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37170
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37190
37171
|
Toast,
|
|
37191
37172
|
{
|
|
37192
37173
|
variant: content.props.variant ?? "info",
|
|
@@ -37199,6 +37180,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37199
37180
|
return /* @__PURE__ */ jsx(
|
|
37200
37181
|
Box,
|
|
37201
37182
|
{
|
|
37183
|
+
id: slotId,
|
|
37202
37184
|
className: "absolute inset-0 z-50 flex items-center justify-center overflow-auto",
|
|
37203
37185
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37204
37186
|
onClick: onDismiss,
|
|
@@ -37206,9 +37188,9 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37206
37188
|
}
|
|
37207
37189
|
);
|
|
37208
37190
|
case "center":
|
|
37209
|
-
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 }) });
|
|
37191
|
+
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 }) });
|
|
37210
37192
|
default:
|
|
37211
|
-
return slotContent;
|
|
37193
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent });
|
|
37212
37194
|
}
|
|
37213
37195
|
}
|
|
37214
37196
|
function UISlotComponent({
|
|
@@ -37327,12 +37309,14 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37327
37309
|
eventBus.clear(slot);
|
|
37328
37310
|
};
|
|
37329
37311
|
if (!portalRoot) return null;
|
|
37312
|
+
const slotId = `slot-${slot}`;
|
|
37330
37313
|
let wrapper;
|
|
37331
37314
|
switch (slot) {
|
|
37332
37315
|
case "modal":
|
|
37333
37316
|
wrapper = /* @__PURE__ */ jsx(Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: /* @__PURE__ */ jsx(
|
|
37334
37317
|
Box,
|
|
37335
37318
|
{
|
|
37319
|
+
id: slotId,
|
|
37336
37320
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37337
37321
|
"data-pattern": pattern,
|
|
37338
37322
|
"data-source-trait": sourceTrait,
|
|
@@ -37344,6 +37328,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37344
37328
|
wrapper = /* @__PURE__ */ jsx(Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsx(
|
|
37345
37329
|
Box,
|
|
37346
37330
|
{
|
|
37331
|
+
id: slotId,
|
|
37347
37332
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37348
37333
|
"data-pattern": pattern,
|
|
37349
37334
|
"data-source-trait": sourceTrait,
|
|
@@ -37355,6 +37340,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37355
37340
|
wrapper = /* @__PURE__ */ jsx(Box, { className: "fixed top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37356
37341
|
Box,
|
|
37357
37342
|
{
|
|
37343
|
+
id: slotId,
|
|
37358
37344
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37359
37345
|
"data-pattern": pattern,
|
|
37360
37346
|
"data-source-trait": sourceTrait,
|
|
@@ -37366,6 +37352,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37366
37352
|
wrapper = /* @__PURE__ */ jsx(
|
|
37367
37353
|
Box,
|
|
37368
37354
|
{
|
|
37355
|
+
id: slotId,
|
|
37369
37356
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37370
37357
|
"data-pattern": pattern,
|
|
37371
37358
|
"data-source-trait": sourceTrait,
|
|
@@ -37389,6 +37376,8 @@ function SlotPortal({
|
|
|
37389
37376
|
if (portalRoot) getOrCreatePortalRoot();
|
|
37390
37377
|
});
|
|
37391
37378
|
if (!portalRoot) return null;
|
|
37379
|
+
const slotId = `slot-${slot}`;
|
|
37380
|
+
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss });
|
|
37392
37381
|
let wrapper;
|
|
37393
37382
|
switch (slot) {
|
|
37394
37383
|
case "modal":
|
|
@@ -37399,7 +37388,7 @@ function SlotPortal({
|
|
|
37399
37388
|
onClose: onDismiss,
|
|
37400
37389
|
title: content.props.title,
|
|
37401
37390
|
size: content.props.size,
|
|
37402
|
-
children: /* @__PURE__ */ jsx(
|
|
37391
|
+
children: /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent })
|
|
37403
37392
|
}
|
|
37404
37393
|
);
|
|
37405
37394
|
break;
|
|
@@ -37412,12 +37401,12 @@ function SlotPortal({
|
|
|
37412
37401
|
title: content.props.title,
|
|
37413
37402
|
position: content.props.position ?? "right",
|
|
37414
37403
|
width: content.props.width,
|
|
37415
|
-
children: /* @__PURE__ */ jsx(
|
|
37404
|
+
children: /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent })
|
|
37416
37405
|
}
|
|
37417
37406
|
);
|
|
37418
37407
|
break;
|
|
37419
37408
|
case "toast":
|
|
37420
|
-
wrapper = /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsx(
|
|
37409
|
+
wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsx(
|
|
37421
37410
|
Toast,
|
|
37422
37411
|
{
|
|
37423
37412
|
variant: content.props.variant ?? "info",
|
|
@@ -37431,17 +37420,18 @@ function SlotPortal({
|
|
|
37431
37420
|
wrapper = /* @__PURE__ */ jsx(
|
|
37432
37421
|
Box,
|
|
37433
37422
|
{
|
|
37423
|
+
id: slotId,
|
|
37434
37424
|
className: "fixed inset-0 z-50 bg-foreground/50 flex items-center justify-center",
|
|
37435
37425
|
onClick: onDismiss,
|
|
37436
|
-
children: /* @__PURE__ */ jsx(Box, { onClick: (e) => e.stopPropagation(), children:
|
|
37426
|
+
children: /* @__PURE__ */ jsx(Box, { onClick: (e) => e.stopPropagation(), children: slotContent })
|
|
37437
37427
|
}
|
|
37438
37428
|
);
|
|
37439
37429
|
break;
|
|
37440
37430
|
case "center":
|
|
37441
|
-
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:
|
|
37431
|
+
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 }) });
|
|
37442
37432
|
break;
|
|
37443
37433
|
default:
|
|
37444
|
-
wrapper = /* @__PURE__ */ jsx(
|
|
37434
|
+
wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent });
|
|
37445
37435
|
}
|
|
37446
37436
|
return createPortal(wrapper, portalRoot);
|
|
37447
37437
|
}
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
*/
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import {
|
|
12
|
+
import type { EventKey, EventPayload } from '@almadar/core';
|
|
13
|
+
import { type ButtonProps } from '../atoms/Button';
|
|
13
14
|
import { type BadgeVariant } from '../atoms/Badge';
|
|
14
15
|
import { type AlertVariant } from '../molecules/Alert';
|
|
15
16
|
import { type MapViewProps } from '../molecules/MapView';
|
|
@@ -22,36 +23,54 @@ interface ClosedCircuitProps {
|
|
|
22
23
|
error?: Error | null;
|
|
23
24
|
entity?: string;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Props for {@link ButtonPattern}. A thin pass-through over the Button
|
|
28
|
+
* atom: accepts every Button prop plus wrapper-level aliases for the
|
|
29
|
+
* `.orb` schema convention (`action`/`event`/`onClick` as string
|
|
30
|
+
* event names, `iconPosition` for left/right icon placement).
|
|
31
|
+
*
|
|
32
|
+
* Anything not explicitly named is forwarded to `<Button>` via rest-spread,
|
|
33
|
+
* so a future Button prop lands automatically without needing a wrapper
|
|
34
|
+
* edit. This is the contract that fixes VG17: `action: EventKey` flows
|
|
35
|
+
* through to Button, which owns both `UI:{action}` emit AND the
|
|
36
|
+
* `data-testid="action-{NAME}"` attribute the verifier selects on.
|
|
37
|
+
*/
|
|
38
|
+
export interface ButtonPatternProps extends Omit<ButtonProps, 'onClick'>, ClosedCircuitProps {
|
|
39
|
+
/** Legacy alias for {@link ButtonProps.action} (string event name). */
|
|
40
|
+
onClick?: EventKey;
|
|
41
|
+
/** Legacy alias for {@link ButtonProps.action}. */
|
|
42
|
+
event?: EventKey;
|
|
43
|
+
/** Icon placement — maps to Button's `icon` (left) or `iconRight` (right). */
|
|
33
44
|
iconPosition?: 'left' | 'right';
|
|
34
|
-
className?: string;
|
|
35
45
|
}
|
|
36
46
|
/**
|
|
37
|
-
* Button pattern
|
|
47
|
+
* Button pattern — thin pass-through to the Button atom.
|
|
48
|
+
*
|
|
49
|
+
* Prior to VG17 this wrapper owned a local event-bus emit and
|
|
50
|
+
* hand-enumerated only a narrow slice of props, silently dropping
|
|
51
|
+
* every prop outside that list (including the Pre-Phase `action:
|
|
52
|
+
* EventKey`). The atom already handles emit + data-testid via its
|
|
53
|
+
* `action` prop, so the wrapper simply forwards everything.
|
|
38
54
|
*/
|
|
39
|
-
export declare function ButtonPattern({
|
|
55
|
+
export declare function ButtonPattern({ action, onClick, event, icon, iconPosition, ...rest }: ButtonPatternProps): React.ReactElement;
|
|
40
56
|
export declare namespace ButtonPattern {
|
|
41
57
|
var displayName: string;
|
|
42
58
|
}
|
|
43
|
-
export interface IconButtonPatternProps extends ClosedCircuitProps {
|
|
59
|
+
export interface IconButtonPatternProps extends Omit<ButtonProps, 'onClick'>, ClosedCircuitProps {
|
|
44
60
|
icon: string;
|
|
45
|
-
variant?: ButtonVariant;
|
|
46
|
-
size?: ButtonSize;
|
|
47
|
-
onClick?: string;
|
|
48
61
|
ariaLabel?: string;
|
|
49
|
-
|
|
62
|
+
/** Legacy alias for {@link ButtonProps.action}. */
|
|
63
|
+
onClick?: EventKey;
|
|
64
|
+
/** Legacy alias for {@link ButtonProps.action}. */
|
|
65
|
+
event?: EventKey;
|
|
50
66
|
}
|
|
51
67
|
/**
|
|
52
|
-
* Icon-only button pattern
|
|
68
|
+
* Icon-only button pattern — pass-through to the Button atom with a
|
|
69
|
+
* mandatory icon and optional aria-label. Same VG17 fix as
|
|
70
|
+
* {@link ButtonPattern}: `action` forwards to the atom, which owns the
|
|
71
|
+
* emit + data-testid.
|
|
53
72
|
*/
|
|
54
|
-
export declare function IconButtonPattern({
|
|
73
|
+
export declare function IconButtonPattern({ action, onClick, event, icon, ariaLabel, variant, ...rest }: IconButtonPatternProps): React.ReactElement;
|
|
55
74
|
export declare namespace IconButtonPattern {
|
|
56
75
|
var displayName: string;
|
|
57
76
|
}
|
|
@@ -59,13 +78,24 @@ export interface LinkPatternProps extends ClosedCircuitProps {
|
|
|
59
78
|
label: string;
|
|
60
79
|
href?: string;
|
|
61
80
|
external?: boolean;
|
|
62
|
-
|
|
81
|
+
/** Event key emitted on click (intercepts native navigation when set). */
|
|
82
|
+
action?: EventKey;
|
|
83
|
+
/** Legacy alias for action. */
|
|
84
|
+
onClick?: EventKey;
|
|
85
|
+
/** Legacy alias for action. */
|
|
86
|
+
event?: EventKey;
|
|
87
|
+
/** Payload for the dispatched event. */
|
|
88
|
+
actionPayload?: EventPayload;
|
|
63
89
|
className?: string;
|
|
64
90
|
}
|
|
65
91
|
/**
|
|
66
|
-
* Link pattern for navigation.
|
|
92
|
+
* Link pattern for navigation. When an event key is provided via
|
|
93
|
+
* `action` / `onClick` / `event`, intercepts the native `<a>`
|
|
94
|
+
* navigation and emits `UI:{action}` with the `href` in the payload.
|
|
95
|
+
* Sets `data-testid="action-{NAME}"` so the verifier's click-path
|
|
96
|
+
* gate can select it symmetrically with Button.
|
|
67
97
|
*/
|
|
68
|
-
export declare function LinkPattern({ label, href, external, onClick, className, }: LinkPatternProps): React.ReactElement;
|
|
98
|
+
export declare function LinkPattern({ label, href, external, action, onClick, event, actionPayload, className, }: LinkPatternProps): React.ReactElement;
|
|
69
99
|
export declare namespace LinkPattern {
|
|
70
100
|
var displayName: string;
|
|
71
101
|
}
|
package/dist/providers/index.cjs
CHANGED
|
@@ -8029,38 +8029,16 @@ var init_MapView = __esm({
|
|
|
8029
8029
|
}
|
|
8030
8030
|
});
|
|
8031
8031
|
function ButtonPattern({
|
|
8032
|
-
|
|
8033
|
-
variant = "primary",
|
|
8034
|
-
size = "md",
|
|
8035
|
-
disabled = false,
|
|
8032
|
+
action,
|
|
8036
8033
|
onClick,
|
|
8037
8034
|
event,
|
|
8038
8035
|
icon,
|
|
8039
|
-
iconPosition
|
|
8040
|
-
|
|
8036
|
+
iconPosition,
|
|
8037
|
+
...rest
|
|
8041
8038
|
}) {
|
|
8042
|
-
const
|
|
8043
|
-
const
|
|
8044
|
-
|
|
8045
|
-
if (eventName && !disabled) {
|
|
8046
|
-
emit(`UI:${eventName}`, {});
|
|
8047
|
-
}
|
|
8048
|
-
};
|
|
8049
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8050
|
-
Button,
|
|
8051
|
-
{
|
|
8052
|
-
variant,
|
|
8053
|
-
size,
|
|
8054
|
-
disabled,
|
|
8055
|
-
onClick: handleClick,
|
|
8056
|
-
className,
|
|
8057
|
-
children: [
|
|
8058
|
-
icon && iconPosition === "left" && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, size: "sm" }),
|
|
8059
|
-
label,
|
|
8060
|
-
icon && iconPosition === "right" && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, size: "sm" })
|
|
8061
|
-
]
|
|
8062
|
-
}
|
|
8063
|
-
);
|
|
8039
|
+
const resolvedAction = action ?? onClick ?? event;
|
|
8040
|
+
const iconProps = iconPosition === "right" ? { iconRight: icon } : { icon };
|
|
8041
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Button, { ...rest, action: resolvedAction, ...iconProps });
|
|
8064
8042
|
}
|
|
8065
8043
|
function TextPattern({
|
|
8066
8044
|
content,
|
|
@@ -37667,11 +37645,13 @@ function enrichFormFields(fields, entityDef) {
|
|
|
37667
37645
|
}
|
|
37668
37646
|
function renderContainedPortal(slot, content, onDismiss) {
|
|
37669
37647
|
const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
|
|
37648
|
+
const slotId = `slot-${slot}`;
|
|
37670
37649
|
switch (slot) {
|
|
37671
37650
|
case "modal":
|
|
37672
37651
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37673
37652
|
Box,
|
|
37674
37653
|
{
|
|
37654
|
+
id: slotId,
|
|
37675
37655
|
className: "absolute inset-0 z-50 flex items-start justify-center overflow-auto",
|
|
37676
37656
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)", paddingTop: "10%" },
|
|
37677
37657
|
onClick: onDismiss,
|
|
@@ -37708,6 +37688,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37708
37688
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37709
37689
|
Box,
|
|
37710
37690
|
{
|
|
37691
|
+
id: slotId,
|
|
37711
37692
|
className: "absolute inset-0 z-50 overflow-hidden",
|
|
37712
37693
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37713
37694
|
onClick: onDismiss,
|
|
@@ -37740,7 +37721,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37740
37721
|
}
|
|
37741
37722
|
);
|
|
37742
37723
|
case "toast":
|
|
37743
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37724
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37744
37725
|
Toast,
|
|
37745
37726
|
{
|
|
37746
37727
|
variant: content.props.variant ?? "info",
|
|
@@ -37753,6 +37734,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37753
37734
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37754
37735
|
Box,
|
|
37755
37736
|
{
|
|
37737
|
+
id: slotId,
|
|
37756
37738
|
className: "absolute inset-0 z-50 flex items-center justify-center overflow-auto",
|
|
37757
37739
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37758
37740
|
onClick: onDismiss,
|
|
@@ -37760,9 +37742,9 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37760
37742
|
}
|
|
37761
37743
|
);
|
|
37762
37744
|
case "center":
|
|
37763
|
-
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 }) });
|
|
37745
|
+
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 }) });
|
|
37764
37746
|
default:
|
|
37765
|
-
return slotContent;
|
|
37747
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent });
|
|
37766
37748
|
}
|
|
37767
37749
|
}
|
|
37768
37750
|
function UISlotComponent({
|
|
@@ -37881,12 +37863,14 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37881
37863
|
eventBus.clear(slot);
|
|
37882
37864
|
};
|
|
37883
37865
|
if (!portalRoot) return null;
|
|
37866
|
+
const slotId = `slot-${slot}`;
|
|
37884
37867
|
let wrapper;
|
|
37885
37868
|
switch (slot) {
|
|
37886
37869
|
case "modal":
|
|
37887
37870
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37888
37871
|
Box,
|
|
37889
37872
|
{
|
|
37873
|
+
id: slotId,
|
|
37890
37874
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37891
37875
|
"data-pattern": pattern,
|
|
37892
37876
|
"data-source-trait": sourceTrait,
|
|
@@ -37898,6 +37882,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37898
37882
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37899
37883
|
Box,
|
|
37900
37884
|
{
|
|
37885
|
+
id: slotId,
|
|
37901
37886
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37902
37887
|
"data-pattern": pattern,
|
|
37903
37888
|
"data-source-trait": sourceTrait,
|
|
@@ -37909,6 +37894,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37909
37894
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "fixed top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37910
37895
|
Box,
|
|
37911
37896
|
{
|
|
37897
|
+
id: slotId,
|
|
37912
37898
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37913
37899
|
"data-pattern": pattern,
|
|
37914
37900
|
"data-source-trait": sourceTrait,
|
|
@@ -37920,6 +37906,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37920
37906
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(
|
|
37921
37907
|
Box,
|
|
37922
37908
|
{
|
|
37909
|
+
id: slotId,
|
|
37923
37910
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37924
37911
|
"data-pattern": pattern,
|
|
37925
37912
|
"data-source-trait": sourceTrait,
|
|
@@ -37943,6 +37930,8 @@ function SlotPortal({
|
|
|
37943
37930
|
if (portalRoot) getOrCreatePortalRoot();
|
|
37944
37931
|
});
|
|
37945
37932
|
if (!portalRoot) return null;
|
|
37933
|
+
const slotId = `slot-${slot}`;
|
|
37934
|
+
const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
|
|
37946
37935
|
let wrapper;
|
|
37947
37936
|
switch (slot) {
|
|
37948
37937
|
case "modal":
|
|
@@ -37953,7 +37942,7 @@ function SlotPortal({
|
|
|
37953
37942
|
onClose: onDismiss,
|
|
37954
37943
|
title: content.props.title,
|
|
37955
37944
|
size: content.props.size,
|
|
37956
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37945
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent })
|
|
37957
37946
|
}
|
|
37958
37947
|
);
|
|
37959
37948
|
break;
|
|
@@ -37966,12 +37955,12 @@ function SlotPortal({
|
|
|
37966
37955
|
title: content.props.title,
|
|
37967
37956
|
position: content.props.position ?? "right",
|
|
37968
37957
|
width: content.props.width,
|
|
37969
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37958
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent })
|
|
37970
37959
|
}
|
|
37971
37960
|
);
|
|
37972
37961
|
break;
|
|
37973
37962
|
case "toast":
|
|
37974
|
-
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37963
|
+
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37975
37964
|
Toast,
|
|
37976
37965
|
{
|
|
37977
37966
|
variant: content.props.variant ?? "info",
|
|
@@ -37985,17 +37974,18 @@ function SlotPortal({
|
|
|
37985
37974
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(
|
|
37986
37975
|
Box,
|
|
37987
37976
|
{
|
|
37977
|
+
id: slotId,
|
|
37988
37978
|
className: "fixed inset-0 z-50 bg-foreground/50 flex items-center justify-center",
|
|
37989
37979
|
onClick: onDismiss,
|
|
37990
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { onClick: (e) => e.stopPropagation(), children:
|
|
37980
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { onClick: (e) => e.stopPropagation(), children: slotContent })
|
|
37991
37981
|
}
|
|
37992
37982
|
);
|
|
37993
37983
|
break;
|
|
37994
37984
|
case "center":
|
|
37995
|
-
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:
|
|
37985
|
+
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 }) });
|
|
37996
37986
|
break;
|
|
37997
37987
|
default:
|
|
37998
|
-
wrapper = /* @__PURE__ */ jsxRuntime.jsx(
|
|
37988
|
+
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent });
|
|
37999
37989
|
}
|
|
38000
37990
|
return reactDom.createPortal(wrapper, portalRoot);
|
|
38001
37991
|
}
|