@firecms/ui 3.0.0-canary.254 → 3.0.0-canary.256
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 +122 -102
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +122 -102
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/components/BooleanSwitch.tsx +7 -3
- package/src/components/BooleanSwitchWithLabel.tsx +3 -3
- package/src/components/Dialog.tsx +12 -3
package/dist/index.umd.js
CHANGED
@@ -742,18 +742,22 @@
|
|
742
742
|
} else {
|
743
743
|
onValueChange?.(!value);
|
744
744
|
}
|
745
|
-
}, className: cls(size === "small" ? "w-[38px] h-[22px] min-w-[38px] min-h-[22px]" : "w-[42px] h-[26px] min-w-[42px] min-h-[26px]", "outline-none rounded-full relative shadow-sm", value ? disabled ? "bg-white bg-opacity-54 dark:bg-surface-accent-950 border-surface-accent-100 dark:border-surface-accent-700 ring-1 ring-surface-accent-200 dark:ring-surface-accent-700" : "ring-secondary ring-1 bg-secondary dark:bg-secondary" : "bg-white bg-opacity-54 dark:bg-surface-accent-900 ring-1 ring-surface-accent-200 dark:ring-surface-accent-700", className), ...props, children: [
|
745
|
+
}, className: cls(size === "smallest" ? "w-[34px] h-[18px] min-w-[34px] min-h-[18px]" : size === "small" ? "w-[38px] h-[22px] min-w-[38px] min-h-[22px]" : "w-[42px] h-[26px] min-w-[42px] min-h-[26px]", "outline-none rounded-full relative shadow-sm", value ? disabled ? "bg-white bg-opacity-54 dark:bg-surface-accent-950 border-surface-accent-100 dark:border-surface-accent-700 ring-1 ring-surface-accent-200 dark:ring-surface-accent-700" : "ring-secondary ring-1 bg-secondary dark:bg-secondary" : "bg-white bg-opacity-54 dark:bg-surface-accent-900 ring-1 ring-surface-accent-200 dark:ring-surface-accent-700", className), ...props, children: [
|
746
746
|
allowIndeterminate && (value === null || value === void 0) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cls("block rounded-full transition-transform duration-100 transform will-change-auto", disabled ? "bg-surface-accent-400 dark:bg-surface-accent-600" : "bg-surface-accent-400 dark:bg-surface-accent-600", {
|
747
747
|
"w-[21px] h-[10px]": size === "medium" || size === "large",
|
748
748
|
"w-[19px] h-[8px]": size === "small",
|
749
|
+
"w-[16px] h-[6px]": size === "smallest",
|
749
750
|
"translate-x-[10px]": size === "medium" || size === "large",
|
750
|
-
"translate-x-[9px]": size === "small"
|
751
|
+
"translate-x-[9px]": size === "small",
|
752
|
+
"translate-x-[8px]": size === "smallest"
|
751
753
|
}) }, "knob"),
|
752
754
|
!(allowIndeterminate && (value === null || value === void 0)) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cls("block rounded-full transition-transform duration-100 transform will-change-auto", disabled ? "bg-surface-accent-300 dark:bg-surface-accent-700" : value ? "bg-white" : "bg-surface-accent-600 dark:bg-surface-accent-400", {
|
753
755
|
"w-[21px] h-[21px]": size === "medium" || size === "large",
|
754
756
|
"w-[19px] h-[19px]": size === "small",
|
757
|
+
"w-[16px] h-[16px]": size === "smallest",
|
755
758
|
[value ? "translate-x-[19px]" : "translate-x-[3px]"]: size === "medium" || size === "large",
|
756
|
-
[value ? "translate-x-[17px]" : "translate-x-[2px]"]: size === "small"
|
759
|
+
[value ? "translate-x-[17px]" : "translate-x-[2px]"]: size === "small",
|
760
|
+
[value ? "translate-x-[16px]" : "translate-x-[1px]"]: size === "smallest"
|
757
761
|
}) }, "knob")
|
758
762
|
] });
|
759
763
|
});
|
@@ -785,7 +789,7 @@
|
|
785
789
|
"min-h-[32px]": size === "small",
|
786
790
|
"min-h-[42px]": size === "medium",
|
787
791
|
"min-h-[64px]": size === "large"
|
788
|
-
}, size === "small" ? "pl-2" : "pl-4", size === "small" ? "pr-4" : "pr-6", position === "end" ? "flex-row-reverse" : "flex-row", fullWidth ? "w-full" : "", className), onClick: disabled ? void 0 : (e) => {
|
792
|
+
}, size === "small" || size === "smallest" ? "pl-2" : "pl-4", size === "small" || size === "smallest" ? "pr-4" : "pr-6", position === "end" ? "flex-row-reverse" : "flex-row", fullWidth ? "w-full" : "", className), onClick: disabled ? void 0 : (e) => {
|
789
793
|
if (props.allowIndeterminate) {
|
790
794
|
if (value === null || value === void 0) onValueChange?.(true);
|
791
795
|
else if (value) onValueChange?.(false);
|
@@ -795,7 +799,7 @@
|
|
795
799
|
}
|
796
800
|
}, children: [
|
797
801
|
/* @__PURE__ */ jsxRuntime.jsx(BooleanSwitch, { value, ref: refInput, size, className: cls(invisible && focus ? focusedClasses : "", inputClassName), disabled, ...props }),
|
798
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cls("flex-grow", position === "end" ? "mr-4" : "ml-4", size === "small" ? "text-sm" : "text-base"), children: label })
|
802
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cls("flex-grow", position === "end" ? "mr-4" : "ml-4", size === "small" || size === "smallest" ? "text-sm" : "text-base"), children: label })
|
799
803
|
] });
|
800
804
|
};
|
801
805
|
const ButtonInner = React.forwardRef((t0, ref) => {
|
@@ -28007,7 +28011,7 @@
|
|
28007
28011
|
full: "max-w-full min-w-full w-full"
|
28008
28012
|
};
|
28009
28013
|
const Dialog = (t0) => {
|
28010
|
-
const $ = reactCompilerRuntime.c(
|
28014
|
+
const $ = reactCompilerRuntime.c(42);
|
28011
28015
|
const {
|
28012
28016
|
open,
|
28013
28017
|
onOpenChange,
|
@@ -28023,17 +28027,19 @@
|
|
28023
28027
|
onOpenAutoFocus,
|
28024
28028
|
onEscapeKeyDown,
|
28025
28029
|
onPointerDownOutside,
|
28026
|
-
onInteractOutside
|
28030
|
+
onInteractOutside,
|
28031
|
+
disableInitialFocus: t5
|
28027
28032
|
} = t0;
|
28028
28033
|
const fullWidth = t1 === void 0 ? true : t1;
|
28029
28034
|
const scrollable = t2 === void 0 ? true : t2;
|
28030
28035
|
const maxWidth = t3 === void 0 ? "lg" : t3;
|
28031
28036
|
const modal = t4 === void 0 ? true : t4;
|
28037
|
+
const disableInitialFocus = t5 === void 0 ? true : t5;
|
28032
28038
|
const [displayed, setDisplayed] = React.useState(false);
|
28033
|
-
let t5;
|
28034
28039
|
let t6;
|
28040
|
+
let t7;
|
28035
28041
|
if ($[0] !== open) {
|
28036
|
-
|
28042
|
+
t6 = () => {
|
28037
28043
|
if (!open) {
|
28038
28044
|
const timeout = setTimeout(() => {
|
28039
28045
|
setDisplayed(false);
|
@@ -28044,126 +28050,140 @@
|
|
28044
28050
|
return _temp$2;
|
28045
28051
|
}
|
28046
28052
|
};
|
28047
|
-
|
28053
|
+
t7 = [open];
|
28048
28054
|
$[0] = open;
|
28049
|
-
$[1] =
|
28050
|
-
$[2] =
|
28055
|
+
$[1] = t6;
|
28056
|
+
$[2] = t7;
|
28051
28057
|
} else {
|
28052
|
-
|
28053
|
-
|
28058
|
+
t6 = $[1];
|
28059
|
+
t7 = $[2];
|
28054
28060
|
}
|
28055
|
-
React.useEffect(
|
28056
|
-
const
|
28057
|
-
let
|
28061
|
+
React.useEffect(t6, t7);
|
28062
|
+
const t8 = displayed || open;
|
28063
|
+
let t9;
|
28058
28064
|
if ($[3] !== containerClassName) {
|
28059
|
-
|
28065
|
+
t9 = cls("fixed inset-0 z-30", containerClassName);
|
28060
28066
|
$[3] = containerClassName;
|
28061
|
-
$[4] =
|
28067
|
+
$[4] = t9;
|
28062
28068
|
} else {
|
28063
|
-
|
28069
|
+
t9 = $[4];
|
28064
28070
|
}
|
28065
|
-
const
|
28066
|
-
let
|
28067
|
-
if ($[5] !==
|
28068
|
-
|
28069
|
-
$[5] =
|
28070
|
-
$[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;
|
28071
28077
|
} else {
|
28072
|
-
|
28078
|
+
t11 = $[6];
|
28073
28079
|
}
|
28074
|
-
const
|
28075
|
-
let
|
28076
|
-
if ($[7] !==
|
28077
|
-
|
28078
|
-
pointerEvents:
|
28080
|
+
const t12 = displayed ? "auto" : "none";
|
28081
|
+
let t13;
|
28082
|
+
if ($[7] !== t12) {
|
28083
|
+
t13 = {
|
28084
|
+
pointerEvents: t12
|
28079
28085
|
};
|
28080
|
-
$[7] =
|
28081
|
-
$[8] =
|
28086
|
+
$[7] = t12;
|
28087
|
+
$[8] = t13;
|
28082
28088
|
} else {
|
28083
|
-
|
28089
|
+
t13 = $[8];
|
28084
28090
|
}
|
28085
|
-
let
|
28086
|
-
if ($[9] !==
|
28087
|
-
|
28088
|
-
$[9] =
|
28089
|
-
$[10] =
|
28090
|
-
$[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;
|
28091
28097
|
} else {
|
28092
|
-
|
28098
|
+
t14 = $[11];
|
28093
28099
|
}
|
28094
|
-
let
|
28095
|
-
if ($[12]
|
28096
|
-
|
28097
|
-
|
28098
|
-
|
28099
|
-
|
28100
|
-
|
28101
|
-
|
28102
|
-
|
28103
|
-
|
28104
|
-
const t18 = scrollable && "overflow-y-auto";
|
28105
|
-
const t19 = displayed && open ? "opacity-100" : "opacity-0";
|
28106
|
-
const t20 = maxWidth && !fullScreen ? widthClasses[maxWidth] : void 0;
|
28107
|
-
let t21;
|
28108
|
-
if ($[13] !== className || $[14] !== t15 || $[15] !== t16 || $[16] !== t17 || $[17] !== t18 || $[18] !== t19 || $[19] !== t20) {
|
28109
|
-
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);
|
28110
|
-
$[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;
|
28111
28110
|
$[14] = t15;
|
28112
|
-
$[15] = t16;
|
28113
|
-
$[16] = t17;
|
28114
|
-
$[17] = t18;
|
28115
|
-
$[18] = t19;
|
28116
|
-
$[19] = t20;
|
28117
|
-
$[20] = t21;
|
28118
28111
|
} else {
|
28119
|
-
|
28112
|
+
t15 = $[14];
|
28120
28113
|
}
|
28121
|
-
let
|
28122
|
-
if ($[
|
28123
|
-
|
28124
|
-
$[
|
28125
|
-
$[22] = t21;
|
28126
|
-
$[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;
|
28127
28118
|
} else {
|
28128
|
-
|
28119
|
+
t16 = $[15];
|
28129
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;
|
28130
28127
|
let t23;
|
28131
|
-
if ($[
|
28132
|
-
t23 =
|
28133
|
-
$[
|
28134
|
-
$[
|
28135
|
-
$[
|
28136
|
-
$[
|
28137
|
-
$[
|
28138
|
-
$[
|
28139
|
-
|
28140
|
-
|
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];
|
28141
28140
|
}
|
28142
28141
|
let t24;
|
28143
|
-
if ($[
|
28144
|
-
t24 = /* @__PURE__ */ jsxRuntime.jsx(
|
28145
|
-
|
28146
|
-
|
28147
|
-
]
|
28148
|
-
$[30] = t13;
|
28149
|
-
$[31] = t23;
|
28150
|
-
$[32] = t8;
|
28151
|
-
$[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;
|
28152
28147
|
} else {
|
28153
|
-
t24 = $[
|
28148
|
+
t24 = $[26];
|
28154
28149
|
}
|
28155
28150
|
let t25;
|
28156
|
-
if ($[
|
28157
|
-
t25 = /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.
|
28158
|
-
$[
|
28159
|
-
$[
|
28160
|
-
$[
|
28161
|
-
$[
|
28162
|
-
$[
|
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;
|
28163
28183
|
} else {
|
28164
|
-
|
28184
|
+
t27 = $[41];
|
28165
28185
|
}
|
28166
|
-
return
|
28186
|
+
return t27;
|
28167
28187
|
};
|
28168
28188
|
function _temp$2() {
|
28169
28189
|
}
|