@geomak/ui 5.5.2 → 5.5.3
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 +69 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +69 -65
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -9
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2365,7 +2365,7 @@ function Dropdown({
|
|
|
2365
2365
|
"aria-invalid": hasError || void 0,
|
|
2366
2366
|
"aria-describedby": hasError ? errorId : void 0,
|
|
2367
2367
|
style,
|
|
2368
|
-
className: `flex items-center justify-between gap-
|
|
2368
|
+
className: `flex items-center justify-between gap-2 cursor-pointer select-none min-h-[36px] px-3 py-1.5 ${!style?.width ? "min-w-[200px]" : ""} ${fieldShell({ size, hasError, disabled, sized: false })}`,
|
|
2369
2369
|
tabIndex: disabled ? -1 : 0,
|
|
2370
2370
|
onKeyDown: (e) => {
|
|
2371
2371
|
if (disabled) return;
|
|
@@ -2375,31 +2375,25 @@ function Dropdown({
|
|
|
2375
2375
|
}
|
|
2376
2376
|
},
|
|
2377
2377
|
children: [
|
|
2378
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2379
|
-
|
|
2378
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0 flex flex-wrap items-center gap-1.5", children: !value || Array.isArray(value) && value.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-muted text-sm", children: placeholder }) : Array.isArray(value) ? value.map((val) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2379
|
+
Tag,
|
|
2380
2380
|
{
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
disabled,
|
|
2395
|
-
removeLabel: `Remove ${labelFor(value)}`,
|
|
2396
|
-
onRemove: () => removeSelected(value),
|
|
2397
|
-
children: labelFor(value)
|
|
2398
|
-
}
|
|
2399
|
-
)
|
|
2381
|
+
disabled,
|
|
2382
|
+
removeLabel: `Remove ${labelFor(val)}`,
|
|
2383
|
+
onRemove: () => removeSelected(val),
|
|
2384
|
+
children: labelFor(val)
|
|
2385
|
+
},
|
|
2386
|
+
String(val)
|
|
2387
|
+
)) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2388
|
+
Tag,
|
|
2389
|
+
{
|
|
2390
|
+
disabled,
|
|
2391
|
+
removeLabel: `Remove ${labelFor(value)}`,
|
|
2392
|
+
onRemove: () => removeSelected(value),
|
|
2393
|
+
children: labelFor(value)
|
|
2400
2394
|
}
|
|
2401
|
-
),
|
|
2402
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex-shrink-0
|
|
2395
|
+
) }),
|
|
2396
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex-shrink-0 text-foreground-muted transition-transform duration-200 ${open ? "rotate-180" : "rotate-0"}`, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) })
|
|
2403
2397
|
]
|
|
2404
2398
|
}
|
|
2405
2399
|
) }),
|
|
@@ -3657,7 +3651,8 @@ function RadioGroup({
|
|
|
3657
3651
|
onChange,
|
|
3658
3652
|
name,
|
|
3659
3653
|
label,
|
|
3660
|
-
|
|
3654
|
+
layout = "vertical",
|
|
3655
|
+
labelPosition = "right",
|
|
3661
3656
|
size = "md",
|
|
3662
3657
|
disabled,
|
|
3663
3658
|
required,
|
|
@@ -3666,6 +3661,7 @@ function RadioGroup({
|
|
|
3666
3661
|
const errorId = React8.useId();
|
|
3667
3662
|
const groupId = React8.useId();
|
|
3668
3663
|
const hasError = errorMessage != null;
|
|
3664
|
+
const labelFirst = labelPosition === "left";
|
|
3669
3665
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3670
3666
|
Field,
|
|
3671
3667
|
{
|
|
@@ -3686,44 +3682,51 @@ function RadioGroup({
|
|
|
3686
3682
|
required,
|
|
3687
3683
|
"aria-invalid": hasError || void 0,
|
|
3688
3684
|
"aria-describedby": hasError ? errorId : void 0,
|
|
3689
|
-
orientation,
|
|
3690
|
-
className:
|
|
3685
|
+
orientation: layout,
|
|
3686
|
+
className: layout === "horizontal" ? "flex flex-row flex-wrap gap-5" : "flex flex-col gap-3",
|
|
3691
3687
|
children: options.map((opt) => {
|
|
3692
3688
|
const itemId = `${groupId}-${opt.value}`;
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3689
|
+
const dot = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3690
|
+
RadioGroupPrimitive__namespace.Item,
|
|
3691
|
+
{
|
|
3692
|
+
id: itemId,
|
|
3693
|
+
value: opt.value,
|
|
3694
|
+
disabled: opt.disabled,
|
|
3695
|
+
className: [
|
|
3696
|
+
DOT_SIZE[size],
|
|
3697
|
+
"mt-0.5 flex-shrink-0 rounded-full border bg-surface transition-colors duration-150",
|
|
3698
|
+
"border-border-strong",
|
|
3699
|
+
"hover:border-accent",
|
|
3700
|
+
"data-[state=checked]:border-accent",
|
|
3701
|
+
// Border-only focus, consistent with the fields.
|
|
3702
|
+
"focus:outline-none focus-visible:border-accent",
|
|
3703
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
3704
|
+
].join(" "),
|
|
3705
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block h-1/2 w-1/2 rounded-full bg-accent" }) })
|
|
3706
|
+
}
|
|
3707
|
+
);
|
|
3708
|
+
const labelEl = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3709
|
+
"label",
|
|
3710
|
+
{
|
|
3711
|
+
htmlFor: itemId,
|
|
3712
|
+
className: [
|
|
3713
|
+
"select-none",
|
|
3714
|
+
opt.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
3715
|
+
labelFirst ? "text-right" : ""
|
|
3716
|
+
].filter(Boolean).join(" "),
|
|
3717
|
+
children: [
|
|
3718
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `block ${TEXT_SIZE[size]} text-foreground`, children: opt.label }),
|
|
3719
|
+
opt.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-xs text-foreground-secondary mt-0.5", children: opt.description })
|
|
3720
|
+
]
|
|
3721
|
+
}
|
|
3722
|
+
);
|
|
3723
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-start gap-2.5", children: labelFirst ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3724
|
+
labelEl,
|
|
3725
|
+
dot
|
|
3726
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3727
|
+
dot,
|
|
3728
|
+
labelEl
|
|
3729
|
+
] }) }, opt.value);
|
|
3727
3730
|
})
|
|
3728
3731
|
}
|
|
3729
3732
|
)
|
|
@@ -4454,11 +4457,11 @@ function DatePicker({
|
|
|
4454
4457
|
};
|
|
4455
4458
|
const displayValue = value ? format(value) : "";
|
|
4456
4459
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
4457
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex ${layout === "vertical" ? "flex-col gap-1" : "flex-row items-
|
|
4460
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex ${layout === "vertical" ? "flex-col gap-1.5" : "flex-row items-start gap-3"}`, children: [
|
|
4458
4461
|
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4459
4462
|
"label",
|
|
4460
4463
|
{
|
|
4461
|
-
className:
|
|
4464
|
+
className: `text-sm font-medium select-none text-foreground ${layout === "horizontal" ? "mt-2 flex-shrink-0 whitespace-nowrap" : ""}`,
|
|
4462
4465
|
htmlFor,
|
|
4463
4466
|
children: label
|
|
4464
4467
|
}
|
|
@@ -5114,10 +5117,11 @@ function OtpInput({
|
|
|
5114
5117
|
className: [
|
|
5115
5118
|
BOX_SIZE[size],
|
|
5116
5119
|
"text-center font-medium rounded-lg border bg-surface text-foreground",
|
|
5117
|
-
"transition-[border-color
|
|
5120
|
+
"transition-[border-color] duration-150",
|
|
5118
5121
|
hasError ? "border-status-error" : "border-border",
|
|
5119
5122
|
"hover:border-border-strong",
|
|
5120
|
-
|
|
5123
|
+
// Border-only focus, consistent with every field (no clip-prone ring).
|
|
5124
|
+
"focus:outline-none focus:border-accent",
|
|
5121
5125
|
"disabled:bg-surface-raised disabled:text-foreground-muted disabled:cursor-not-allowed"
|
|
5122
5126
|
].join(" ")
|
|
5123
5127
|
}
|