@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.d.cts
CHANGED
|
@@ -2134,8 +2134,17 @@ interface RadioGroupProps {
|
|
|
2134
2134
|
onChange?: (value: string) => void;
|
|
2135
2135
|
name?: string;
|
|
2136
2136
|
label?: React$1.ReactNode;
|
|
2137
|
-
/**
|
|
2138
|
-
|
|
2137
|
+
/**
|
|
2138
|
+
* Option arrangement. `'vertical'` (default) stacks options in a column;
|
|
2139
|
+
* `'horizontal'` lays them in a row. Named `layout` for consistency with
|
|
2140
|
+
* the other inputs.
|
|
2141
|
+
*/
|
|
2142
|
+
layout?: 'vertical' | 'horizontal';
|
|
2143
|
+
/**
|
|
2144
|
+
* Where each option's label sits relative to its radio dot.
|
|
2145
|
+
* `'right'` (default) → dot then label; `'left'` → label then dot.
|
|
2146
|
+
*/
|
|
2147
|
+
labelPosition?: 'left' | 'right';
|
|
2139
2148
|
/** Size preset — controls the dot + text size. Default `'md'`. */
|
|
2140
2149
|
size?: FieldSize;
|
|
2141
2150
|
disabled?: boolean;
|
|
@@ -2165,7 +2174,7 @@ interface RadioGroupProps {
|
|
|
2165
2174
|
* />
|
|
2166
2175
|
* ```
|
|
2167
2176
|
*/
|
|
2168
|
-
declare function RadioGroup({ options, value, defaultValue, onChange, name, label,
|
|
2177
|
+
declare function RadioGroup({ options, value, defaultValue, onChange, name, label, layout, labelPosition, size, disabled, required, errorMessage, }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
2169
2178
|
|
|
2170
2179
|
interface SwitchInputProps {
|
|
2171
2180
|
checked?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -2134,8 +2134,17 @@ interface RadioGroupProps {
|
|
|
2134
2134
|
onChange?: (value: string) => void;
|
|
2135
2135
|
name?: string;
|
|
2136
2136
|
label?: React$1.ReactNode;
|
|
2137
|
-
/**
|
|
2138
|
-
|
|
2137
|
+
/**
|
|
2138
|
+
* Option arrangement. `'vertical'` (default) stacks options in a column;
|
|
2139
|
+
* `'horizontal'` lays them in a row. Named `layout` for consistency with
|
|
2140
|
+
* the other inputs.
|
|
2141
|
+
*/
|
|
2142
|
+
layout?: 'vertical' | 'horizontal';
|
|
2143
|
+
/**
|
|
2144
|
+
* Where each option's label sits relative to its radio dot.
|
|
2145
|
+
* `'right'` (default) → dot then label; `'left'` → label then dot.
|
|
2146
|
+
*/
|
|
2147
|
+
labelPosition?: 'left' | 'right';
|
|
2139
2148
|
/** Size preset — controls the dot + text size. Default `'md'`. */
|
|
2140
2149
|
size?: FieldSize;
|
|
2141
2150
|
disabled?: boolean;
|
|
@@ -2165,7 +2174,7 @@ interface RadioGroupProps {
|
|
|
2165
2174
|
* />
|
|
2166
2175
|
* ```
|
|
2167
2176
|
*/
|
|
2168
|
-
declare function RadioGroup({ options, value, defaultValue, onChange, name, label,
|
|
2177
|
+
declare function RadioGroup({ options, value, defaultValue, onChange, name, label, layout, labelPosition, size, disabled, required, errorMessage, }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
2169
2178
|
|
|
2170
2179
|
interface SwitchInputProps {
|
|
2171
2180
|
checked?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -2330,7 +2330,7 @@ function Dropdown({
|
|
|
2330
2330
|
"aria-invalid": hasError || void 0,
|
|
2331
2331
|
"aria-describedby": hasError ? errorId : void 0,
|
|
2332
2332
|
style,
|
|
2333
|
-
className: `flex items-center justify-between gap-
|
|
2333
|
+
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 })}`,
|
|
2334
2334
|
tabIndex: disabled ? -1 : 0,
|
|
2335
2335
|
onKeyDown: (e) => {
|
|
2336
2336
|
if (disabled) return;
|
|
@@ -2340,31 +2340,25 @@ function Dropdown({
|
|
|
2340
2340
|
}
|
|
2341
2341
|
},
|
|
2342
2342
|
children: [
|
|
2343
|
-
/* @__PURE__ */ jsx(
|
|
2344
|
-
|
|
2343
|
+
/* @__PURE__ */ 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__ */ jsx("span", { className: "text-foreground-muted text-sm", children: placeholder }) : Array.isArray(value) ? value.map((val) => /* @__PURE__ */ jsx(
|
|
2344
|
+
Tag,
|
|
2345
2345
|
{
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
disabled,
|
|
2360
|
-
removeLabel: `Remove ${labelFor(value)}`,
|
|
2361
|
-
onRemove: () => removeSelected(value),
|
|
2362
|
-
children: labelFor(value)
|
|
2363
|
-
}
|
|
2364
|
-
)
|
|
2346
|
+
disabled,
|
|
2347
|
+
removeLabel: `Remove ${labelFor(val)}`,
|
|
2348
|
+
onRemove: () => removeSelected(val),
|
|
2349
|
+
children: labelFor(val)
|
|
2350
|
+
},
|
|
2351
|
+
String(val)
|
|
2352
|
+
)) : /* @__PURE__ */ jsx(
|
|
2353
|
+
Tag,
|
|
2354
|
+
{
|
|
2355
|
+
disabled,
|
|
2356
|
+
removeLabel: `Remove ${labelFor(value)}`,
|
|
2357
|
+
onRemove: () => removeSelected(value),
|
|
2358
|
+
children: labelFor(value)
|
|
2365
2359
|
}
|
|
2366
|
-
),
|
|
2367
|
-
/* @__PURE__ */ jsx("div", { className: `flex-shrink-0
|
|
2360
|
+
) }),
|
|
2361
|
+
/* @__PURE__ */ jsx("div", { className: `flex-shrink-0 text-foreground-muted transition-transform duration-200 ${open ? "rotate-180" : "rotate-0"}`, "aria-hidden": "true", children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) })
|
|
2368
2362
|
]
|
|
2369
2363
|
}
|
|
2370
2364
|
) }),
|
|
@@ -3622,7 +3616,8 @@ function RadioGroup({
|
|
|
3622
3616
|
onChange,
|
|
3623
3617
|
name,
|
|
3624
3618
|
label,
|
|
3625
|
-
|
|
3619
|
+
layout = "vertical",
|
|
3620
|
+
labelPosition = "right",
|
|
3626
3621
|
size = "md",
|
|
3627
3622
|
disabled,
|
|
3628
3623
|
required,
|
|
@@ -3631,6 +3626,7 @@ function RadioGroup({
|
|
|
3631
3626
|
const errorId = useId();
|
|
3632
3627
|
const groupId = useId();
|
|
3633
3628
|
const hasError = errorMessage != null;
|
|
3629
|
+
const labelFirst = labelPosition === "left";
|
|
3634
3630
|
return /* @__PURE__ */ jsx(
|
|
3635
3631
|
Field,
|
|
3636
3632
|
{
|
|
@@ -3651,44 +3647,51 @@ function RadioGroup({
|
|
|
3651
3647
|
required,
|
|
3652
3648
|
"aria-invalid": hasError || void 0,
|
|
3653
3649
|
"aria-describedby": hasError ? errorId : void 0,
|
|
3654
|
-
orientation,
|
|
3655
|
-
className:
|
|
3650
|
+
orientation: layout,
|
|
3651
|
+
className: layout === "horizontal" ? "flex flex-row flex-wrap gap-5" : "flex flex-col gap-3",
|
|
3656
3652
|
children: options.map((opt) => {
|
|
3657
3653
|
const itemId = `${groupId}-${opt.value}`;
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3654
|
+
const dot = /* @__PURE__ */ jsx(
|
|
3655
|
+
RadioGroupPrimitive.Item,
|
|
3656
|
+
{
|
|
3657
|
+
id: itemId,
|
|
3658
|
+
value: opt.value,
|
|
3659
|
+
disabled: opt.disabled,
|
|
3660
|
+
className: [
|
|
3661
|
+
DOT_SIZE[size],
|
|
3662
|
+
"mt-0.5 flex-shrink-0 rounded-full border bg-surface transition-colors duration-150",
|
|
3663
|
+
"border-border-strong",
|
|
3664
|
+
"hover:border-accent",
|
|
3665
|
+
"data-[state=checked]:border-accent",
|
|
3666
|
+
// Border-only focus, consistent with the fields.
|
|
3667
|
+
"focus:outline-none focus-visible:border-accent",
|
|
3668
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
3669
|
+
].join(" "),
|
|
3670
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ jsx("span", { className: "block h-1/2 w-1/2 rounded-full bg-accent" }) })
|
|
3671
|
+
}
|
|
3672
|
+
);
|
|
3673
|
+
const labelEl = /* @__PURE__ */ jsxs(
|
|
3674
|
+
"label",
|
|
3675
|
+
{
|
|
3676
|
+
htmlFor: itemId,
|
|
3677
|
+
className: [
|
|
3678
|
+
"select-none",
|
|
3679
|
+
opt.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
3680
|
+
labelFirst ? "text-right" : ""
|
|
3681
|
+
].filter(Boolean).join(" "),
|
|
3682
|
+
children: [
|
|
3683
|
+
/* @__PURE__ */ jsx("span", { className: `block ${TEXT_SIZE[size]} text-foreground`, children: opt.label }),
|
|
3684
|
+
opt.description && /* @__PURE__ */ jsx("span", { className: "block text-xs text-foreground-secondary mt-0.5", children: opt.description })
|
|
3685
|
+
]
|
|
3686
|
+
}
|
|
3687
|
+
);
|
|
3688
|
+
return /* @__PURE__ */ jsx("div", { className: "flex items-start gap-2.5", children: labelFirst ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3689
|
+
labelEl,
|
|
3690
|
+
dot
|
|
3691
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3692
|
+
dot,
|
|
3693
|
+
labelEl
|
|
3694
|
+
] }) }, opt.value);
|
|
3692
3695
|
})
|
|
3693
3696
|
}
|
|
3694
3697
|
)
|
|
@@ -4419,11 +4422,11 @@ function DatePicker({
|
|
|
4419
4422
|
};
|
|
4420
4423
|
const displayValue = value ? format(value) : "";
|
|
4421
4424
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
4422
|
-
/* @__PURE__ */ jsxs("div", { className: `flex ${layout === "vertical" ? "flex-col gap-1" : "flex-row items-
|
|
4425
|
+
/* @__PURE__ */ jsxs("div", { className: `flex ${layout === "vertical" ? "flex-col gap-1.5" : "flex-row items-start gap-3"}`, children: [
|
|
4423
4426
|
label && /* @__PURE__ */ jsx(
|
|
4424
4427
|
"label",
|
|
4425
4428
|
{
|
|
4426
|
-
className:
|
|
4429
|
+
className: `text-sm font-medium select-none text-foreground ${layout === "horizontal" ? "mt-2 flex-shrink-0 whitespace-nowrap" : ""}`,
|
|
4427
4430
|
htmlFor,
|
|
4428
4431
|
children: label
|
|
4429
4432
|
}
|
|
@@ -5079,10 +5082,11 @@ function OtpInput({
|
|
|
5079
5082
|
className: [
|
|
5080
5083
|
BOX_SIZE[size],
|
|
5081
5084
|
"text-center font-medium rounded-lg border bg-surface text-foreground",
|
|
5082
|
-
"transition-[border-color
|
|
5085
|
+
"transition-[border-color] duration-150",
|
|
5083
5086
|
hasError ? "border-status-error" : "border-border",
|
|
5084
5087
|
"hover:border-border-strong",
|
|
5085
|
-
|
|
5088
|
+
// Border-only focus, consistent with every field (no clip-prone ring).
|
|
5089
|
+
"focus:outline-none focus:border-accent",
|
|
5086
5090
|
"disabled:bg-surface-raised disabled:text-foreground-muted disabled:cursor-not-allowed"
|
|
5087
5091
|
].join(" ")
|
|
5088
5092
|
}
|