@firecms/ui 3.0.0-canary.255 → 3.0.0-canary.257
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/components/Dialog.d.ts +5 -1
- package/dist/index.es.js +113 -97
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +113 -97
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Dialog.tsx +12 -3
package/dist/index.umd.js
CHANGED
@@ -28011,7 +28011,7 @@
|
|
28011
28011
|
full: "max-w-full min-w-full w-full"
|
28012
28012
|
};
|
28013
28013
|
const Dialog = (t0) => {
|
28014
|
-
const $ = reactCompilerRuntime.c(
|
28014
|
+
const $ = reactCompilerRuntime.c(42);
|
28015
28015
|
const {
|
28016
28016
|
open,
|
28017
28017
|
onOpenChange,
|
@@ -28027,17 +28027,19 @@
|
|
28027
28027
|
onOpenAutoFocus,
|
28028
28028
|
onEscapeKeyDown,
|
28029
28029
|
onPointerDownOutside,
|
28030
|
-
onInteractOutside
|
28030
|
+
onInteractOutside,
|
28031
|
+
disableInitialFocus: t5
|
28031
28032
|
} = t0;
|
28032
28033
|
const fullWidth = t1 === void 0 ? true : t1;
|
28033
28034
|
const scrollable = t2 === void 0 ? true : t2;
|
28034
28035
|
const maxWidth = t3 === void 0 ? "lg" : t3;
|
28035
28036
|
const modal = t4 === void 0 ? true : t4;
|
28037
|
+
const disableInitialFocus = t5 === void 0 ? true : t5;
|
28036
28038
|
const [displayed, setDisplayed] = React.useState(false);
|
28037
|
-
let t5;
|
28038
28039
|
let t6;
|
28040
|
+
let t7;
|
28039
28041
|
if ($[0] !== open) {
|
28040
|
-
|
28042
|
+
t6 = () => {
|
28041
28043
|
if (!open) {
|
28042
28044
|
const timeout = setTimeout(() => {
|
28043
28045
|
setDisplayed(false);
|
@@ -28048,126 +28050,140 @@
|
|
28048
28050
|
return _temp$2;
|
28049
28051
|
}
|
28050
28052
|
};
|
28051
|
-
|
28053
|
+
t7 = [open];
|
28052
28054
|
$[0] = open;
|
28053
|
-
$[1] =
|
28054
|
-
$[2] =
|
28055
|
+
$[1] = t6;
|
28056
|
+
$[2] = t7;
|
28055
28057
|
} else {
|
28056
|
-
|
28057
|
-
|
28058
|
+
t6 = $[1];
|
28059
|
+
t7 = $[2];
|
28058
28060
|
}
|
28059
|
-
React.useEffect(
|
28060
|
-
const
|
28061
|
-
let
|
28061
|
+
React.useEffect(t6, t7);
|
28062
|
+
const t8 = displayed || open;
|
28063
|
+
let t9;
|
28062
28064
|
if ($[3] !== containerClassName) {
|
28063
|
-
|
28065
|
+
t9 = cls("fixed inset-0 z-30", containerClassName);
|
28064
28066
|
$[3] = containerClassName;
|
28065
|
-
$[4] =
|
28067
|
+
$[4] = t9;
|
28066
28068
|
} else {
|
28067
|
-
|
28069
|
+
t9 = $[4];
|
28068
28070
|
}
|
28069
|
-
const
|
28070
|
-
let
|
28071
|
-
if ($[5] !==
|
28072
|
-
|
28073
|
-
$[5] =
|
28074
|
-
$[6] =
|
28071
|
+
const t10 = displayed && open ? "opacity-100" : "opacity-0";
|
28072
|
+
let t11;
|
28073
|
+
if ($[5] !== t10) {
|
28074
|
+
t11 = cls("fixed inset-0 transition-opacity z-20 ease-in-out duration-200 bg-black bg-opacity-50 dark:bg-opacity-60 backdrop-blur-sm ", t10, "z-20 fixed top-0 left-0 w-full h-full flex justify-center items-center");
|
28075
|
+
$[5] = t10;
|
28076
|
+
$[6] = t11;
|
28075
28077
|
} else {
|
28076
|
-
|
28078
|
+
t11 = $[6];
|
28077
28079
|
}
|
28078
|
-
const
|
28079
|
-
let
|
28080
|
-
if ($[7] !==
|
28081
|
-
|
28082
|
-
pointerEvents:
|
28080
|
+
const t12 = displayed ? "auto" : "none";
|
28081
|
+
let t13;
|
28082
|
+
if ($[7] !== t12) {
|
28083
|
+
t13 = {
|
28084
|
+
pointerEvents: t12
|
28083
28085
|
};
|
28084
|
-
$[7] =
|
28085
|
-
$[8] =
|
28086
|
+
$[7] = t12;
|
28087
|
+
$[8] = t13;
|
28086
28088
|
} else {
|
28087
|
-
|
28089
|
+
t13 = $[8];
|
28088
28090
|
}
|
28089
|
-
let
|
28090
|
-
if ($[9] !==
|
28091
|
-
|
28092
|
-
$[9] =
|
28093
|
-
$[10] =
|
28094
|
-
$[11] =
|
28091
|
+
let t14;
|
28092
|
+
if ($[9] !== t11 || $[10] !== t13) {
|
28093
|
+
t14 = /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, { className: t11, style: t13 });
|
28094
|
+
$[9] = t11;
|
28095
|
+
$[10] = t13;
|
28096
|
+
$[11] = t14;
|
28095
28097
|
} else {
|
28096
|
-
|
28098
|
+
t14 = $[11];
|
28097
28099
|
}
|
28098
|
-
let
|
28099
|
-
if ($[12]
|
28100
|
-
|
28101
|
-
|
28102
|
-
|
28103
|
-
|
28104
|
-
|
28105
|
-
|
28106
|
-
|
28107
|
-
|
28108
|
-
const t18 = scrollable && "overflow-y-auto";
|
28109
|
-
const t19 = displayed && open ? "opacity-100" : "opacity-0";
|
28110
|
-
const t20 = maxWidth && !fullScreen ? widthClasses[maxWidth] : void 0;
|
28111
|
-
let t21;
|
28112
|
-
if ($[13] !== className || $[14] !== t15 || $[15] !== t16 || $[16] !== t17 || $[17] !== t18 || $[18] !== t19 || $[19] !== t20) {
|
28113
|
-
t21 = cls(paperMixin, "z-30", "relative", "outline-none focus:outline-none", t15, t16, "text-surface-accent-900 dark:text-white", "justify-center items-center", t17, "ease-in-out duration-200", t18, t19, t20, className);
|
28114
|
-
$[13] = className;
|
28100
|
+
let t15;
|
28101
|
+
if ($[12] !== disableInitialFocus || $[13] !== onOpenAutoFocus) {
|
28102
|
+
t15 = (e) => {
|
28103
|
+
if (disableInitialFocus) {
|
28104
|
+
e.preventDefault();
|
28105
|
+
}
|
28106
|
+
onOpenAutoFocus?.(e);
|
28107
|
+
};
|
28108
|
+
$[12] = disableInitialFocus;
|
28109
|
+
$[13] = onOpenAutoFocus;
|
28115
28110
|
$[14] = t15;
|
28116
|
-
$[15] = t16;
|
28117
|
-
$[16] = t17;
|
28118
|
-
$[17] = t18;
|
28119
|
-
$[18] = t19;
|
28120
|
-
$[19] = t20;
|
28121
|
-
$[20] = t21;
|
28122
28111
|
} else {
|
28123
|
-
|
28112
|
+
t15 = $[14];
|
28124
28113
|
}
|
28125
|
-
let
|
28126
|
-
if ($[
|
28127
|
-
|
28128
|
-
$[
|
28129
|
-
$[22] = t21;
|
28130
|
-
$[23] = t22;
|
28114
|
+
let t16;
|
28115
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
28116
|
+
t16 = cls("h-full outline-none flex justify-center items-center z-40 opacity-100 transition-all duration-200 ease-in-out");
|
28117
|
+
$[15] = t16;
|
28131
28118
|
} else {
|
28132
|
-
|
28119
|
+
t16 = $[15];
|
28133
28120
|
}
|
28121
|
+
const t17 = fullWidth && !fullScreen ? "w-11/12" : void 0;
|
28122
|
+
const t18 = fullHeight && !fullScreen ? "h-full" : void 0;
|
28123
|
+
const t19 = fullScreen ? "h-screen w-screen" : "max-h-[90vh] shadow-xl";
|
28124
|
+
const t20 = scrollable && "overflow-y-auto";
|
28125
|
+
const t21 = displayed && open ? "opacity-100" : "opacity-0";
|
28126
|
+
const t22 = maxWidth && !fullScreen ? widthClasses[maxWidth] : void 0;
|
28134
28127
|
let t23;
|
28135
|
-
if ($[
|
28136
|
-
t23 =
|
28137
|
-
$[
|
28138
|
-
$[
|
28139
|
-
$[
|
28140
|
-
$[
|
28141
|
-
$[
|
28142
|
-
$[
|
28143
|
-
|
28144
|
-
|
28128
|
+
if ($[16] !== className || $[17] !== t17 || $[18] !== t18 || $[19] !== t19 || $[20] !== t20 || $[21] !== t21 || $[22] !== t22) {
|
28129
|
+
t23 = cls(paperMixin, "z-30", "relative", "outline-none focus:outline-none", t17, t18, "text-surface-accent-900 dark:text-white", "justify-center items-center", t19, "ease-in-out duration-200", t20, t21, t22, className);
|
28130
|
+
$[16] = className;
|
28131
|
+
$[17] = t17;
|
28132
|
+
$[18] = t18;
|
28133
|
+
$[19] = t19;
|
28134
|
+
$[20] = t20;
|
28135
|
+
$[21] = t21;
|
28136
|
+
$[22] = t22;
|
28137
|
+
$[23] = t23;
|
28138
|
+
} else {
|
28139
|
+
t23 = $[23];
|
28145
28140
|
}
|
28146
28141
|
let t24;
|
28147
|
-
if ($[
|
28148
|
-
t24 = /* @__PURE__ */ jsxRuntime.jsx(
|
28149
|
-
|
28150
|
-
|
28151
|
-
]
|
28152
|
-
$[30] = t13;
|
28153
|
-
$[31] = t23;
|
28154
|
-
$[32] = t8;
|
28155
|
-
$[33] = t24;
|
28142
|
+
if ($[24] !== children || $[25] !== t23) {
|
28143
|
+
t24 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: t23, children });
|
28144
|
+
$[24] = children;
|
28145
|
+
$[25] = t23;
|
28146
|
+
$[26] = t24;
|
28156
28147
|
} else {
|
28157
|
-
t24 = $[
|
28148
|
+
t24 = $[26];
|
28158
28149
|
}
|
28159
28150
|
let t25;
|
28160
|
-
if ($[
|
28161
|
-
t25 = /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.
|
28162
|
-
$[
|
28163
|
-
$[
|
28164
|
-
$[
|
28165
|
-
$[
|
28166
|
-
$[
|
28151
|
+
if ($[27] !== onEscapeKeyDown || $[28] !== onInteractOutside || $[29] !== onPointerDownOutside || $[30] !== t15 || $[31] !== t24) {
|
28152
|
+
t25 = /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Content, { onEscapeKeyDown, onOpenAutoFocus: t15, onPointerDownOutside, onInteractOutside, className: t16, children: t24 });
|
28153
|
+
$[27] = onEscapeKeyDown;
|
28154
|
+
$[28] = onInteractOutside;
|
28155
|
+
$[29] = onPointerDownOutside;
|
28156
|
+
$[30] = t15;
|
28157
|
+
$[31] = t24;
|
28158
|
+
$[32] = t25;
|
28159
|
+
} else {
|
28160
|
+
t25 = $[32];
|
28161
|
+
}
|
28162
|
+
let t26;
|
28163
|
+
if ($[33] !== t14 || $[34] !== t25 || $[35] !== t9) {
|
28164
|
+
t26 = /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t9, children: [
|
28165
|
+
t14,
|
28166
|
+
t25
|
28167
|
+
] }) });
|
28168
|
+
$[33] = t14;
|
28169
|
+
$[34] = t25;
|
28170
|
+
$[35] = t9;
|
28171
|
+
$[36] = t26;
|
28172
|
+
} else {
|
28173
|
+
t26 = $[36];
|
28174
|
+
}
|
28175
|
+
let t27;
|
28176
|
+
if ($[37] !== modal || $[38] !== onOpenChange || $[39] !== t26 || $[40] !== t8) {
|
28177
|
+
t27 = /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { open: t8, modal, onOpenChange, children: t26 });
|
28178
|
+
$[37] = modal;
|
28179
|
+
$[38] = onOpenChange;
|
28180
|
+
$[39] = t26;
|
28181
|
+
$[40] = t8;
|
28182
|
+
$[41] = t27;
|
28167
28183
|
} else {
|
28168
|
-
|
28184
|
+
t27 = $[41];
|
28169
28185
|
}
|
28170
|
-
return
|
28186
|
+
return t27;
|
28171
28187
|
};
|
28172
28188
|
function _temp$2() {
|
28173
28189
|
}
|