@geomak/ui 5.0.0 → 5.0.1
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 +25 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -22
- package/dist/index.js.map +1 -1
- package/dist/styles.css +21 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2837,7 +2837,7 @@ function NumberInput({
|
|
|
2837
2837
|
"div",
|
|
2838
2838
|
{
|
|
2839
2839
|
style,
|
|
2840
|
-
className: `flex items-center rounded-lg border ${hasError ? "border-status-error" : "border-border"} ${disabled ? "bg-surface-raised text-foreground-muted cursor-not-allowed" : "bg-surface text-foreground"} focus-within:ring-2 focus-within:ring-accent transition-colors`,
|
|
2840
|
+
className: `flex items-center rounded-lg border overflow-hidden ${hasError ? "border-status-error" : "border-border"} ${disabled ? "bg-surface-raised text-foreground-muted cursor-not-allowed" : "bg-surface text-foreground"} focus-within:ring-2 focus-within:ring-accent transition-colors`,
|
|
2841
2841
|
children: [
|
|
2842
2842
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2843
2843
|
"input",
|
|
@@ -3057,25 +3057,22 @@ function Switch({
|
|
|
3057
3057
|
uncheckedIcon
|
|
3058
3058
|
}) {
|
|
3059
3059
|
const id = React8.useId();
|
|
3060
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
}
|
|
3077
|
-
) })
|
|
3078
|
-
] });
|
|
3060
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: "flex items-center cursor-pointer select-none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3061
|
+
SwitchPrimitive__namespace.Root,
|
|
3062
|
+
{
|
|
3063
|
+
id,
|
|
3064
|
+
checked,
|
|
3065
|
+
onCheckedChange: (c) => onChange?.({ target: { checked: c } }),
|
|
3066
|
+
className: "relative inline-flex h-6 w-14 items-center rounded-full bg-foreground-secondary data-[state=checked]:bg-accent transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2",
|
|
3067
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3068
|
+
SwitchPrimitive__namespace.Thumb,
|
|
3069
|
+
{
|
|
3070
|
+
className: "pointer-events-none inline-flex h-8 w-8 items-center justify-center rounded-full bg-background text-foreground shadow transition-transform duration-200 data-[state=checked]:translate-x-[22px] data-[state=unchecked]:translate-x-[-4px]",
|
|
3071
|
+
children: checkedIcon && uncheckedIcon ? checked ? checkedIcon : uncheckedIcon : null
|
|
3072
|
+
}
|
|
3073
|
+
)
|
|
3074
|
+
}
|
|
3075
|
+
) }) });
|
|
3079
3076
|
}
|
|
3080
3077
|
function AutoComplete({
|
|
3081
3078
|
disabled,
|
|
@@ -3218,11 +3215,17 @@ function TreeSelect({
|
|
|
3218
3215
|
const [activeIndex, setActiveIndex] = React8.useState(0);
|
|
3219
3216
|
const listRef = React8.useRef(null);
|
|
3220
3217
|
const visible = React8.useMemo(() => flattenVisible(items, expanded), [items, expanded]);
|
|
3218
|
+
const didSyncOnOpenRef = React8.useRef(false);
|
|
3221
3219
|
React8.useEffect(() => {
|
|
3222
|
-
if (!open)
|
|
3220
|
+
if (!open) {
|
|
3221
|
+
didSyncOnOpenRef.current = false;
|
|
3222
|
+
return;
|
|
3223
|
+
}
|
|
3224
|
+
if (didSyncOnOpenRef.current) return;
|
|
3223
3225
|
const selectedIdx = visible.findIndex((v) => v.node.key === value);
|
|
3224
3226
|
setActiveIndex(selectedIdx >= 0 ? selectedIdx : 0);
|
|
3225
|
-
|
|
3227
|
+
didSyncOnOpenRef.current = true;
|
|
3228
|
+
}, [open, value]);
|
|
3226
3229
|
const selectedNode = React8.useMemo(
|
|
3227
3230
|
() => value != null ? findNodeByKey(items, value) : null,
|
|
3228
3231
|
[items, value]
|