@geomak/ui 6.15.0 → 6.16.0
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/index.cjs +24 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -11
- package/dist/index.d.ts +23 -11
- package/dist/index.js +24 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -782,9 +782,16 @@ var Button = React20__default.default.forwardRef(function Button2({
|
|
|
782
782
|
});
|
|
783
783
|
Button.displayName = "Button";
|
|
784
784
|
var Button_default = Button;
|
|
785
|
+
var SIZE_MAP = {
|
|
786
|
+
sm: 400,
|
|
787
|
+
md: 600,
|
|
788
|
+
lg: 800,
|
|
789
|
+
xl: 1e3,
|
|
790
|
+
full: "calc(100vw - 2rem)"
|
|
791
|
+
};
|
|
785
792
|
function Modal({
|
|
786
793
|
width,
|
|
787
|
-
size,
|
|
794
|
+
size = "md",
|
|
788
795
|
isOpen = false,
|
|
789
796
|
onClose,
|
|
790
797
|
onOk,
|
|
@@ -797,7 +804,7 @@ function Modal({
|
|
|
797
804
|
className = ""
|
|
798
805
|
}) {
|
|
799
806
|
const reduced = framerMotion.useReducedMotion();
|
|
800
|
-
const maxWidth = width ?? size
|
|
807
|
+
const maxWidth = width ?? SIZE_MAP[size];
|
|
801
808
|
return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Root, { open: isOpen, onOpenChange: (open) => {
|
|
802
809
|
if (!open) onClose?.();
|
|
803
810
|
}, children: /* @__PURE__ */ jsxRuntime.jsxs(Dialog__namespace.Portal, { forceMount: true, children: [
|
|
@@ -865,12 +872,20 @@ function Modal({
|
|
|
865
872
|
) }) })
|
|
866
873
|
] }) });
|
|
867
874
|
}
|
|
875
|
+
var SIZE_MAP2 = {
|
|
876
|
+
sm: 280,
|
|
877
|
+
md: 320,
|
|
878
|
+
lg: 480,
|
|
879
|
+
xl: 640,
|
|
880
|
+
full: "calc(100vw - 1rem)"
|
|
881
|
+
};
|
|
868
882
|
function Drawer({
|
|
869
883
|
isOpen = false,
|
|
870
884
|
onClose,
|
|
871
885
|
hasFooter = true,
|
|
872
886
|
placement = "right",
|
|
873
|
-
|
|
887
|
+
size = "md",
|
|
888
|
+
width,
|
|
874
889
|
okText = "Ok",
|
|
875
890
|
cancelText = "Cancel",
|
|
876
891
|
onOk,
|
|
@@ -882,6 +897,8 @@ function Drawer({
|
|
|
882
897
|
const reduced = framerMotion.useReducedMotion();
|
|
883
898
|
const isRight = placement === "right";
|
|
884
899
|
const hiddenX = isRight ? "100%" : "-100%";
|
|
900
|
+
const resolvedWidth = width ?? SIZE_MAP2[size];
|
|
901
|
+
const widthCss = typeof resolvedWidth === "number" ? `${resolvedWidth}px` : resolvedWidth;
|
|
885
902
|
return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Root, { open: isOpen, onOpenChange: (open) => {
|
|
886
903
|
if (!open) onClose?.();
|
|
887
904
|
}, children: /* @__PURE__ */ jsxRuntime.jsxs(Dialog__namespace.Portal, { forceMount: true, children: [
|
|
@@ -899,7 +916,7 @@ function Drawer({
|
|
|
899
916
|
framerMotion.motion.div,
|
|
900
917
|
{
|
|
901
918
|
className: `fixed top-0 bottom-0 ${isRight ? "right-0" : "left-0"} z-modal flex flex-col bg-surface shadow-xl focus:outline-none ${className}`.trim(),
|
|
902
|
-
style: { width: `min(calc(100vw - 1rem), ${
|
|
919
|
+
style: { width: `min(calc(100vw - 1rem), ${widthCss})` },
|
|
903
920
|
initial: { x: reduced ? 0 : hiddenX, opacity: reduced ? 0 : 1 },
|
|
904
921
|
animate: { x: 0, opacity: 1 },
|
|
905
922
|
exit: { x: reduced ? 0 : hiddenX, opacity: reduced ? 0 : 1 },
|
|
@@ -2481,7 +2498,7 @@ function useNotification() {
|
|
|
2481
2498
|
danger: (props) => open({ type: "danger", ...props })
|
|
2482
2499
|
};
|
|
2483
2500
|
}
|
|
2484
|
-
var
|
|
2501
|
+
var SIZE_MAP3 = {
|
|
2485
2502
|
// xs is sized to fit beside button text (~14px) — async AutoComplete,
|
|
2486
2503
|
// Button loading prop, inline status badges, etc.
|
|
2487
2504
|
xs: { outer: "w-3.5 h-3.5", inner: "w-1.5 h-1.5", dot: "w-0.5 h-0.5", stroke: "border-[1.5px]", text: "text-[10px]" },
|
|
@@ -2498,7 +2515,7 @@ var letterVariants = {
|
|
|
2498
2515
|
visible: { opacity: 1, y: 0, transition: { duration: 0.22, ease: "easeOut" } }
|
|
2499
2516
|
};
|
|
2500
2517
|
function SpinnerCore({ size, color }) {
|
|
2501
|
-
const dims =
|
|
2518
|
+
const dims = SIZE_MAP3[size];
|
|
2502
2519
|
const ringColor = color ?? "var(--color-accent)";
|
|
2503
2520
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center justify-center", style: { color: ringColor }, children: [
|
|
2504
2521
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2537,7 +2554,7 @@ function LoadingSpinner({
|
|
|
2537
2554
|
}) {
|
|
2538
2555
|
const reduced = framerMotion.useReducedMotion();
|
|
2539
2556
|
const letters = prompt ? Array.from(prompt) : [];
|
|
2540
|
-
const dims =
|
|
2557
|
+
const dims = SIZE_MAP3[size];
|
|
2541
2558
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2542
2559
|
/* @__PURE__ */ jsxRuntime.jsx(SpinnerCore, { size, color: spinnerColor }),
|
|
2543
2560
|
letters.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|