@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/providers/index.js
CHANGED
|
@@ -7984,38 +7984,16 @@ var init_MapView = __esm({
|
|
|
7984
7984
|
}
|
|
7985
7985
|
});
|
|
7986
7986
|
function ButtonPattern({
|
|
7987
|
-
|
|
7988
|
-
variant = "primary",
|
|
7989
|
-
size = "md",
|
|
7990
|
-
disabled = false,
|
|
7987
|
+
action,
|
|
7991
7988
|
onClick,
|
|
7992
7989
|
event,
|
|
7993
7990
|
icon,
|
|
7994
|
-
iconPosition
|
|
7995
|
-
|
|
7991
|
+
iconPosition,
|
|
7992
|
+
...rest
|
|
7996
7993
|
}) {
|
|
7997
|
-
const
|
|
7998
|
-
const
|
|
7999
|
-
|
|
8000
|
-
if (eventName && !disabled) {
|
|
8001
|
-
emit(`UI:${eventName}`, {});
|
|
8002
|
-
}
|
|
8003
|
-
};
|
|
8004
|
-
return /* @__PURE__ */ jsxs(
|
|
8005
|
-
Button,
|
|
8006
|
-
{
|
|
8007
|
-
variant,
|
|
8008
|
-
size,
|
|
8009
|
-
disabled,
|
|
8010
|
-
onClick: handleClick,
|
|
8011
|
-
className,
|
|
8012
|
-
children: [
|
|
8013
|
-
icon && iconPosition === "left" && /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }),
|
|
8014
|
-
label,
|
|
8015
|
-
icon && iconPosition === "right" && /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" })
|
|
8016
|
-
]
|
|
8017
|
-
}
|
|
8018
|
-
);
|
|
7994
|
+
const resolvedAction = action ?? onClick ?? event;
|
|
7995
|
+
const iconProps = iconPosition === "right" ? { iconRight: icon } : { icon };
|
|
7996
|
+
return /* @__PURE__ */ jsx(Button, { ...rest, action: resolvedAction, ...iconProps });
|
|
8019
7997
|
}
|
|
8020
7998
|
function TextPattern({
|
|
8021
7999
|
content,
|
|
@@ -37622,11 +37600,13 @@ function enrichFormFields(fields, entityDef) {
|
|
|
37622
37600
|
}
|
|
37623
37601
|
function renderContainedPortal(slot, content, onDismiss) {
|
|
37624
37602
|
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss });
|
|
37603
|
+
const slotId = `slot-${slot}`;
|
|
37625
37604
|
switch (slot) {
|
|
37626
37605
|
case "modal":
|
|
37627
37606
|
return /* @__PURE__ */ jsx(
|
|
37628
37607
|
Box,
|
|
37629
37608
|
{
|
|
37609
|
+
id: slotId,
|
|
37630
37610
|
className: "absolute inset-0 z-50 flex items-start justify-center overflow-auto",
|
|
37631
37611
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)", paddingTop: "10%" },
|
|
37632
37612
|
onClick: onDismiss,
|
|
@@ -37663,6 +37643,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37663
37643
|
return /* @__PURE__ */ jsx(
|
|
37664
37644
|
Box,
|
|
37665
37645
|
{
|
|
37646
|
+
id: slotId,
|
|
37666
37647
|
className: "absolute inset-0 z-50 overflow-hidden",
|
|
37667
37648
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37668
37649
|
onClick: onDismiss,
|
|
@@ -37695,7 +37676,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37695
37676
|
}
|
|
37696
37677
|
);
|
|
37697
37678
|
case "toast":
|
|
37698
|
-
return /* @__PURE__ */ jsx(Box, { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37679
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37699
37680
|
Toast,
|
|
37700
37681
|
{
|
|
37701
37682
|
variant: content.props.variant ?? "info",
|
|
@@ -37708,6 +37689,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37708
37689
|
return /* @__PURE__ */ jsx(
|
|
37709
37690
|
Box,
|
|
37710
37691
|
{
|
|
37692
|
+
id: slotId,
|
|
37711
37693
|
className: "absolute inset-0 z-50 flex items-center justify-center overflow-auto",
|
|
37712
37694
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37713
37695
|
onClick: onDismiss,
|
|
@@ -37715,9 +37697,9 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37715
37697
|
}
|
|
37716
37698
|
);
|
|
37717
37699
|
case "center":
|
|
37718
|
-
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 }) });
|
|
37700
|
+
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 }) });
|
|
37719
37701
|
default:
|
|
37720
|
-
return slotContent;
|
|
37702
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent });
|
|
37721
37703
|
}
|
|
37722
37704
|
}
|
|
37723
37705
|
function UISlotComponent({
|
|
@@ -37836,12 +37818,14 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37836
37818
|
eventBus.clear(slot);
|
|
37837
37819
|
};
|
|
37838
37820
|
if (!portalRoot) return null;
|
|
37821
|
+
const slotId = `slot-${slot}`;
|
|
37839
37822
|
let wrapper;
|
|
37840
37823
|
switch (slot) {
|
|
37841
37824
|
case "modal":
|
|
37842
37825
|
wrapper = /* @__PURE__ */ jsx(Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: /* @__PURE__ */ jsx(
|
|
37843
37826
|
Box,
|
|
37844
37827
|
{
|
|
37828
|
+
id: slotId,
|
|
37845
37829
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37846
37830
|
"data-pattern": pattern,
|
|
37847
37831
|
"data-source-trait": sourceTrait,
|
|
@@ -37853,6 +37837,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37853
37837
|
wrapper = /* @__PURE__ */ jsx(Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsx(
|
|
37854
37838
|
Box,
|
|
37855
37839
|
{
|
|
37840
|
+
id: slotId,
|
|
37856
37841
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37857
37842
|
"data-pattern": pattern,
|
|
37858
37843
|
"data-source-trait": sourceTrait,
|
|
@@ -37864,6 +37849,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37864
37849
|
wrapper = /* @__PURE__ */ jsx(Box, { className: "fixed top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37865
37850
|
Box,
|
|
37866
37851
|
{
|
|
37852
|
+
id: slotId,
|
|
37867
37853
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37868
37854
|
"data-pattern": pattern,
|
|
37869
37855
|
"data-source-trait": sourceTrait,
|
|
@@ -37875,6 +37861,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37875
37861
|
wrapper = /* @__PURE__ */ jsx(
|
|
37876
37862
|
Box,
|
|
37877
37863
|
{
|
|
37864
|
+
id: slotId,
|
|
37878
37865
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37879
37866
|
"data-pattern": pattern,
|
|
37880
37867
|
"data-source-trait": sourceTrait,
|
|
@@ -37898,6 +37885,8 @@ function SlotPortal({
|
|
|
37898
37885
|
if (portalRoot) getOrCreatePortalRoot();
|
|
37899
37886
|
});
|
|
37900
37887
|
if (!portalRoot) return null;
|
|
37888
|
+
const slotId = `slot-${slot}`;
|
|
37889
|
+
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss });
|
|
37901
37890
|
let wrapper;
|
|
37902
37891
|
switch (slot) {
|
|
37903
37892
|
case "modal":
|
|
@@ -37908,7 +37897,7 @@ function SlotPortal({
|
|
|
37908
37897
|
onClose: onDismiss,
|
|
37909
37898
|
title: content.props.title,
|
|
37910
37899
|
size: content.props.size,
|
|
37911
|
-
children: /* @__PURE__ */ jsx(
|
|
37900
|
+
children: /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent })
|
|
37912
37901
|
}
|
|
37913
37902
|
);
|
|
37914
37903
|
break;
|
|
@@ -37921,12 +37910,12 @@ function SlotPortal({
|
|
|
37921
37910
|
title: content.props.title,
|
|
37922
37911
|
position: content.props.position ?? "right",
|
|
37923
37912
|
width: content.props.width,
|
|
37924
|
-
children: /* @__PURE__ */ jsx(
|
|
37913
|
+
children: /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent })
|
|
37925
37914
|
}
|
|
37926
37915
|
);
|
|
37927
37916
|
break;
|
|
37928
37917
|
case "toast":
|
|
37929
|
-
wrapper = /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsx(
|
|
37918
|
+
wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsx(
|
|
37930
37919
|
Toast,
|
|
37931
37920
|
{
|
|
37932
37921
|
variant: content.props.variant ?? "info",
|
|
@@ -37940,17 +37929,18 @@ function SlotPortal({
|
|
|
37940
37929
|
wrapper = /* @__PURE__ */ jsx(
|
|
37941
37930
|
Box,
|
|
37942
37931
|
{
|
|
37932
|
+
id: slotId,
|
|
37943
37933
|
className: "fixed inset-0 z-50 bg-foreground/50 flex items-center justify-center",
|
|
37944
37934
|
onClick: onDismiss,
|
|
37945
|
-
children: /* @__PURE__ */ jsx(Box, { onClick: (e) => e.stopPropagation(), children:
|
|
37935
|
+
children: /* @__PURE__ */ jsx(Box, { onClick: (e) => e.stopPropagation(), children: slotContent })
|
|
37946
37936
|
}
|
|
37947
37937
|
);
|
|
37948
37938
|
break;
|
|
37949
37939
|
case "center":
|
|
37950
|
-
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:
|
|
37940
|
+
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 }) });
|
|
37951
37941
|
break;
|
|
37952
37942
|
default:
|
|
37953
|
-
wrapper = /* @__PURE__ */ jsx(
|
|
37943
|
+
wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent });
|
|
37954
37944
|
}
|
|
37955
37945
|
return createPortal(wrapper, portalRoot);
|
|
37956
37946
|
}
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -8166,38 +8166,16 @@ var init_MapView = __esm({
|
|
|
8166
8166
|
}
|
|
8167
8167
|
});
|
|
8168
8168
|
function ButtonPattern({
|
|
8169
|
-
|
|
8170
|
-
variant = "primary",
|
|
8171
|
-
size = "md",
|
|
8172
|
-
disabled = false,
|
|
8169
|
+
action,
|
|
8173
8170
|
onClick,
|
|
8174
8171
|
event,
|
|
8175
8172
|
icon,
|
|
8176
|
-
iconPosition
|
|
8177
|
-
|
|
8173
|
+
iconPosition,
|
|
8174
|
+
...rest
|
|
8178
8175
|
}) {
|
|
8179
|
-
const
|
|
8180
|
-
const
|
|
8181
|
-
|
|
8182
|
-
if (eventName && !disabled) {
|
|
8183
|
-
emit(`UI:${eventName}`, {});
|
|
8184
|
-
}
|
|
8185
|
-
};
|
|
8186
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8187
|
-
Button,
|
|
8188
|
-
{
|
|
8189
|
-
variant,
|
|
8190
|
-
size,
|
|
8191
|
-
disabled,
|
|
8192
|
-
onClick: handleClick,
|
|
8193
|
-
className,
|
|
8194
|
-
children: [
|
|
8195
|
-
icon && iconPosition === "left" && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, size: "sm" }),
|
|
8196
|
-
label,
|
|
8197
|
-
icon && iconPosition === "right" && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, size: "sm" })
|
|
8198
|
-
]
|
|
8199
|
-
}
|
|
8200
|
-
);
|
|
8176
|
+
const resolvedAction = action ?? onClick ?? event;
|
|
8177
|
+
const iconProps = iconPosition === "right" ? { iconRight: icon } : { icon };
|
|
8178
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Button, { ...rest, action: resolvedAction, ...iconProps });
|
|
8201
8179
|
}
|
|
8202
8180
|
function TextPattern({
|
|
8203
8181
|
content,
|
|
@@ -37239,11 +37217,13 @@ function enrichFormFields(fields, entityDef) {
|
|
|
37239
37217
|
}
|
|
37240
37218
|
function renderContainedPortal(slot, content, onDismiss) {
|
|
37241
37219
|
const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
|
|
37220
|
+
const slotId = `slot-${slot}`;
|
|
37242
37221
|
switch (slot) {
|
|
37243
37222
|
case "modal":
|
|
37244
37223
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37245
37224
|
Box,
|
|
37246
37225
|
{
|
|
37226
|
+
id: slotId,
|
|
37247
37227
|
className: "absolute inset-0 z-50 flex items-start justify-center overflow-auto",
|
|
37248
37228
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)", paddingTop: "10%" },
|
|
37249
37229
|
onClick: onDismiss,
|
|
@@ -37280,6 +37260,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37280
37260
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37281
37261
|
Box,
|
|
37282
37262
|
{
|
|
37263
|
+
id: slotId,
|
|
37283
37264
|
className: "absolute inset-0 z-50 overflow-hidden",
|
|
37284
37265
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37285
37266
|
onClick: onDismiss,
|
|
@@ -37312,7 +37293,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37312
37293
|
}
|
|
37313
37294
|
);
|
|
37314
37295
|
case "toast":
|
|
37315
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37296
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37316
37297
|
Toast,
|
|
37317
37298
|
{
|
|
37318
37299
|
variant: content.props.variant ?? "info",
|
|
@@ -37325,6 +37306,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37325
37306
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37326
37307
|
Box,
|
|
37327
37308
|
{
|
|
37309
|
+
id: slotId,
|
|
37328
37310
|
className: "absolute inset-0 z-50 flex items-center justify-center overflow-auto",
|
|
37329
37311
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37330
37312
|
onClick: onDismiss,
|
|
@@ -37332,9 +37314,9 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37332
37314
|
}
|
|
37333
37315
|
);
|
|
37334
37316
|
case "center":
|
|
37335
|
-
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 }) });
|
|
37317
|
+
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 }) });
|
|
37336
37318
|
default:
|
|
37337
|
-
return slotContent;
|
|
37319
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent });
|
|
37338
37320
|
}
|
|
37339
37321
|
}
|
|
37340
37322
|
function UISlotComponent({
|
|
@@ -37453,12 +37435,14 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37453
37435
|
eventBus.clear(slot);
|
|
37454
37436
|
};
|
|
37455
37437
|
if (!portalRoot) return null;
|
|
37438
|
+
const slotId = `slot-${slot}`;
|
|
37456
37439
|
let wrapper;
|
|
37457
37440
|
switch (slot) {
|
|
37458
37441
|
case "modal":
|
|
37459
37442
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37460
37443
|
Box,
|
|
37461
37444
|
{
|
|
37445
|
+
id: slotId,
|
|
37462
37446
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37463
37447
|
"data-pattern": pattern,
|
|
37464
37448
|
"data-source-trait": sourceTrait,
|
|
@@ -37470,6 +37454,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37470
37454
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37471
37455
|
Box,
|
|
37472
37456
|
{
|
|
37457
|
+
id: slotId,
|
|
37473
37458
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37474
37459
|
"data-pattern": pattern,
|
|
37475
37460
|
"data-source-trait": sourceTrait,
|
|
@@ -37481,6 +37466,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37481
37466
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "fixed top-4 right-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37482
37467
|
Box,
|
|
37483
37468
|
{
|
|
37469
|
+
id: slotId,
|
|
37484
37470
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37485
37471
|
"data-pattern": pattern,
|
|
37486
37472
|
"data-source-trait": sourceTrait,
|
|
@@ -37492,6 +37478,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37492
37478
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(
|
|
37493
37479
|
Box,
|
|
37494
37480
|
{
|
|
37481
|
+
id: slotId,
|
|
37495
37482
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37496
37483
|
"data-pattern": pattern,
|
|
37497
37484
|
"data-source-trait": sourceTrait,
|
|
@@ -37515,6 +37502,8 @@ function SlotPortal({
|
|
|
37515
37502
|
if (portalRoot) getOrCreatePortalRoot();
|
|
37516
37503
|
});
|
|
37517
37504
|
if (!portalRoot) return null;
|
|
37505
|
+
const slotId = `slot-${slot}`;
|
|
37506
|
+
const slotContent = /* @__PURE__ */ jsxRuntime.jsx(SlotContentRenderer, { content, onDismiss });
|
|
37518
37507
|
let wrapper;
|
|
37519
37508
|
switch (slot) {
|
|
37520
37509
|
case "modal":
|
|
@@ -37525,7 +37514,7 @@ function SlotPortal({
|
|
|
37525
37514
|
onClose: onDismiss,
|
|
37526
37515
|
title: content.props.title,
|
|
37527
37516
|
size: content.props.size,
|
|
37528
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37517
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent })
|
|
37529
37518
|
}
|
|
37530
37519
|
);
|
|
37531
37520
|
break;
|
|
@@ -37538,12 +37527,12 @@ function SlotPortal({
|
|
|
37538
37527
|
title: content.props.title,
|
|
37539
37528
|
position: content.props.position ?? "right",
|
|
37540
37529
|
width: content.props.width,
|
|
37541
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37530
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent })
|
|
37542
37531
|
}
|
|
37543
37532
|
);
|
|
37544
37533
|
break;
|
|
37545
37534
|
case "toast":
|
|
37546
|
-
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37535
|
+
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37547
37536
|
Toast,
|
|
37548
37537
|
{
|
|
37549
37538
|
variant: content.props.variant ?? "info",
|
|
@@ -37557,17 +37546,18 @@ function SlotPortal({
|
|
|
37557
37546
|
wrapper = /* @__PURE__ */ jsxRuntime.jsx(
|
|
37558
37547
|
Box,
|
|
37559
37548
|
{
|
|
37549
|
+
id: slotId,
|
|
37560
37550
|
className: "fixed inset-0 z-50 bg-foreground/50 flex items-center justify-center",
|
|
37561
37551
|
onClick: onDismiss,
|
|
37562
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { onClick: (e) => e.stopPropagation(), children:
|
|
37552
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { onClick: (e) => e.stopPropagation(), children: slotContent })
|
|
37563
37553
|
}
|
|
37564
37554
|
);
|
|
37565
37555
|
break;
|
|
37566
37556
|
case "center":
|
|
37567
|
-
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:
|
|
37557
|
+
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 }) });
|
|
37568
37558
|
break;
|
|
37569
37559
|
default:
|
|
37570
|
-
wrapper = /* @__PURE__ */ jsxRuntime.jsx(
|
|
37560
|
+
wrapper = /* @__PURE__ */ jsxRuntime.jsx(Box, { id: slotId, children: slotContent });
|
|
37571
37561
|
}
|
|
37572
37562
|
return reactDom.createPortal(wrapper, portalRoot);
|
|
37573
37563
|
}
|
package/dist/runtime/index.js
CHANGED
|
@@ -8121,38 +8121,16 @@ var init_MapView = __esm({
|
|
|
8121
8121
|
}
|
|
8122
8122
|
});
|
|
8123
8123
|
function ButtonPattern({
|
|
8124
|
-
|
|
8125
|
-
variant = "primary",
|
|
8126
|
-
size = "md",
|
|
8127
|
-
disabled = false,
|
|
8124
|
+
action,
|
|
8128
8125
|
onClick,
|
|
8129
8126
|
event,
|
|
8130
8127
|
icon,
|
|
8131
|
-
iconPosition
|
|
8132
|
-
|
|
8128
|
+
iconPosition,
|
|
8129
|
+
...rest
|
|
8133
8130
|
}) {
|
|
8134
|
-
const
|
|
8135
|
-
const
|
|
8136
|
-
|
|
8137
|
-
if (eventName && !disabled) {
|
|
8138
|
-
emit(`UI:${eventName}`, {});
|
|
8139
|
-
}
|
|
8140
|
-
};
|
|
8141
|
-
return /* @__PURE__ */ jsxs(
|
|
8142
|
-
Button,
|
|
8143
|
-
{
|
|
8144
|
-
variant,
|
|
8145
|
-
size,
|
|
8146
|
-
disabled,
|
|
8147
|
-
onClick: handleClick,
|
|
8148
|
-
className,
|
|
8149
|
-
children: [
|
|
8150
|
-
icon && iconPosition === "left" && /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }),
|
|
8151
|
-
label,
|
|
8152
|
-
icon && iconPosition === "right" && /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" })
|
|
8153
|
-
]
|
|
8154
|
-
}
|
|
8155
|
-
);
|
|
8131
|
+
const resolvedAction = action ?? onClick ?? event;
|
|
8132
|
+
const iconProps = iconPosition === "right" ? { iconRight: icon } : { icon };
|
|
8133
|
+
return /* @__PURE__ */ jsx(Button, { ...rest, action: resolvedAction, ...iconProps });
|
|
8156
8134
|
}
|
|
8157
8135
|
function TextPattern({
|
|
8158
8136
|
content,
|
|
@@ -37194,11 +37172,13 @@ function enrichFormFields(fields, entityDef) {
|
|
|
37194
37172
|
}
|
|
37195
37173
|
function renderContainedPortal(slot, content, onDismiss) {
|
|
37196
37174
|
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss });
|
|
37175
|
+
const slotId = `slot-${slot}`;
|
|
37197
37176
|
switch (slot) {
|
|
37198
37177
|
case "modal":
|
|
37199
37178
|
return /* @__PURE__ */ jsx(
|
|
37200
37179
|
Box,
|
|
37201
37180
|
{
|
|
37181
|
+
id: slotId,
|
|
37202
37182
|
className: "absolute inset-0 z-50 flex items-start justify-center overflow-auto",
|
|
37203
37183
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)", paddingTop: "10%" },
|
|
37204
37184
|
onClick: onDismiss,
|
|
@@ -37235,6 +37215,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37235
37215
|
return /* @__PURE__ */ jsx(
|
|
37236
37216
|
Box,
|
|
37237
37217
|
{
|
|
37218
|
+
id: slotId,
|
|
37238
37219
|
className: "absolute inset-0 z-50 overflow-hidden",
|
|
37239
37220
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37240
37221
|
onClick: onDismiss,
|
|
@@ -37267,7 +37248,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37267
37248
|
}
|
|
37268
37249
|
);
|
|
37269
37250
|
case "toast":
|
|
37270
|
-
return /* @__PURE__ */ jsx(Box, { className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37251
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, className: "absolute top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37271
37252
|
Toast,
|
|
37272
37253
|
{
|
|
37273
37254
|
variant: content.props.variant ?? "info",
|
|
@@ -37280,6 +37261,7 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37280
37261
|
return /* @__PURE__ */ jsx(
|
|
37281
37262
|
Box,
|
|
37282
37263
|
{
|
|
37264
|
+
id: slotId,
|
|
37283
37265
|
className: "absolute inset-0 z-50 flex items-center justify-center overflow-auto",
|
|
37284
37266
|
style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
|
|
37285
37267
|
onClick: onDismiss,
|
|
@@ -37287,9 +37269,9 @@ function renderContainedPortal(slot, content, onDismiss) {
|
|
|
37287
37269
|
}
|
|
37288
37270
|
);
|
|
37289
37271
|
case "center":
|
|
37290
|
-
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 }) });
|
|
37272
|
+
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 }) });
|
|
37291
37273
|
default:
|
|
37292
|
-
return slotContent;
|
|
37274
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent });
|
|
37293
37275
|
}
|
|
37294
37276
|
}
|
|
37295
37277
|
function UISlotComponent({
|
|
@@ -37408,12 +37390,14 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37408
37390
|
eventBus.clear(slot);
|
|
37409
37391
|
};
|
|
37410
37392
|
if (!portalRoot) return null;
|
|
37393
|
+
const slotId = `slot-${slot}`;
|
|
37411
37394
|
let wrapper;
|
|
37412
37395
|
switch (slot) {
|
|
37413
37396
|
case "modal":
|
|
37414
37397
|
wrapper = /* @__PURE__ */ jsx(Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: /* @__PURE__ */ jsx(
|
|
37415
37398
|
Box,
|
|
37416
37399
|
{
|
|
37400
|
+
id: slotId,
|
|
37417
37401
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37418
37402
|
"data-pattern": pattern,
|
|
37419
37403
|
"data-source-trait": sourceTrait,
|
|
@@ -37425,6 +37409,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37425
37409
|
wrapper = /* @__PURE__ */ jsx(Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsx(
|
|
37426
37410
|
Box,
|
|
37427
37411
|
{
|
|
37412
|
+
id: slotId,
|
|
37428
37413
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37429
37414
|
"data-pattern": pattern,
|
|
37430
37415
|
"data-source-trait": sourceTrait,
|
|
@@ -37436,6 +37421,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37436
37421
|
wrapper = /* @__PURE__ */ jsx(Box, { className: "fixed top-4 right-4 z-50", children: /* @__PURE__ */ jsx(
|
|
37437
37422
|
Box,
|
|
37438
37423
|
{
|
|
37424
|
+
id: slotId,
|
|
37439
37425
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37440
37426
|
"data-pattern": pattern,
|
|
37441
37427
|
"data-source-trait": sourceTrait,
|
|
@@ -37447,6 +37433,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
37447
37433
|
wrapper = /* @__PURE__ */ jsx(
|
|
37448
37434
|
Box,
|
|
37449
37435
|
{
|
|
37436
|
+
id: slotId,
|
|
37450
37437
|
className: cn("ui-slot", `ui-slot-${slot}`, className),
|
|
37451
37438
|
"data-pattern": pattern,
|
|
37452
37439
|
"data-source-trait": sourceTrait,
|
|
@@ -37470,6 +37457,8 @@ function SlotPortal({
|
|
|
37470
37457
|
if (portalRoot) getOrCreatePortalRoot();
|
|
37471
37458
|
});
|
|
37472
37459
|
if (!portalRoot) return null;
|
|
37460
|
+
const slotId = `slot-${slot}`;
|
|
37461
|
+
const slotContent = /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss });
|
|
37473
37462
|
let wrapper;
|
|
37474
37463
|
switch (slot) {
|
|
37475
37464
|
case "modal":
|
|
@@ -37480,7 +37469,7 @@ function SlotPortal({
|
|
|
37480
37469
|
onClose: onDismiss,
|
|
37481
37470
|
title: content.props.title,
|
|
37482
37471
|
size: content.props.size,
|
|
37483
|
-
children: /* @__PURE__ */ jsx(
|
|
37472
|
+
children: /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent })
|
|
37484
37473
|
}
|
|
37485
37474
|
);
|
|
37486
37475
|
break;
|
|
@@ -37493,12 +37482,12 @@ function SlotPortal({
|
|
|
37493
37482
|
title: content.props.title,
|
|
37494
37483
|
position: content.props.position ?? "right",
|
|
37495
37484
|
width: content.props.width,
|
|
37496
|
-
children: /* @__PURE__ */ jsx(
|
|
37485
|
+
children: /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent })
|
|
37497
37486
|
}
|
|
37498
37487
|
);
|
|
37499
37488
|
break;
|
|
37500
37489
|
case "toast":
|
|
37501
|
-
wrapper = /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsx(
|
|
37490
|
+
wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, className: cn("fixed z-50", getToastPosition(position)), children: /* @__PURE__ */ jsx(
|
|
37502
37491
|
Toast,
|
|
37503
37492
|
{
|
|
37504
37493
|
variant: content.props.variant ?? "info",
|
|
@@ -37512,17 +37501,18 @@ function SlotPortal({
|
|
|
37512
37501
|
wrapper = /* @__PURE__ */ jsx(
|
|
37513
37502
|
Box,
|
|
37514
37503
|
{
|
|
37504
|
+
id: slotId,
|
|
37515
37505
|
className: "fixed inset-0 z-50 bg-foreground/50 flex items-center justify-center",
|
|
37516
37506
|
onClick: onDismiss,
|
|
37517
|
-
children: /* @__PURE__ */ jsx(Box, { onClick: (e) => e.stopPropagation(), children:
|
|
37507
|
+
children: /* @__PURE__ */ jsx(Box, { onClick: (e) => e.stopPropagation(), children: slotContent })
|
|
37518
37508
|
}
|
|
37519
37509
|
);
|
|
37520
37510
|
break;
|
|
37521
37511
|
case "center":
|
|
37522
|
-
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:
|
|
37512
|
+
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 }) });
|
|
37523
37513
|
break;
|
|
37524
37514
|
default:
|
|
37525
|
-
wrapper = /* @__PURE__ */ jsx(
|
|
37515
|
+
wrapper = /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent });
|
|
37526
37516
|
}
|
|
37527
37517
|
return createPortal(wrapper, portalRoot);
|
|
37528
37518
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/ui",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"description": "React UI components, hooks, and providers for Almadar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/components/index.js",
|
|
@@ -152,6 +152,8 @@
|
|
|
152
152
|
},
|
|
153
153
|
"devDependencies": {
|
|
154
154
|
"@almadar/eslint-plugin": ">=2.3.0",
|
|
155
|
+
"@react-three/drei": "^10.7.7",
|
|
156
|
+
"@react-three/fiber": "^9.6.0",
|
|
155
157
|
"@react-three/postprocessing": "3.0.4",
|
|
156
158
|
"@storybook/addon-docs": "^10.2.6",
|
|
157
159
|
"@storybook/addon-links": "^10.2.6",
|
|
@@ -185,6 +187,7 @@
|
|
|
185
187
|
"react-router-dom": "^7.13.0",
|
|
186
188
|
"storybook": "^10.2.6",
|
|
187
189
|
"tailwindcss": "^3.4.0",
|
|
190
|
+
"three": "^0.160.1",
|
|
188
191
|
"tsup": "^8.0.0",
|
|
189
192
|
"tsx": "^4.7.0",
|
|
190
193
|
"typescript": "^5.4.0",
|