@geomak/ui 7.2.0 → 7.2.2
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 +27 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -33
- package/dist/index.js.map +1 -1
- package/dist/styles.css +18 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5379,6 +5379,7 @@ function EditableCell({
|
|
|
5379
5379
|
"input",
|
|
5380
5380
|
{
|
|
5381
5381
|
autoFocus: true,
|
|
5382
|
+
size: 1,
|
|
5382
5383
|
defaultValue: value == null ? "" : String(value),
|
|
5383
5384
|
onBlur: (e) => commit(e.target.value),
|
|
5384
5385
|
onKeyDown: (e) => {
|
|
@@ -5391,7 +5392,7 @@ function EditableCell({
|
|
|
5391
5392
|
}
|
|
5392
5393
|
},
|
|
5393
5394
|
"aria-label": `Edit ${typeof col.label === "string" ? col.label : col.keyBind}`,
|
|
5394
|
-
className: "w-full rounded border border-accent bg-surface px-2 py-1 text-sm text-foreground outline-none"
|
|
5395
|
+
className: "box-border w-full min-w-0 rounded border border-accent bg-surface px-2 py-1 text-sm text-foreground outline-none"
|
|
5395
5396
|
}
|
|
5396
5397
|
);
|
|
5397
5398
|
}
|
|
@@ -5441,7 +5442,7 @@ function TableBody({
|
|
|
5441
5442
|
onClick: () => toggleRow(rowKey),
|
|
5442
5443
|
"aria-expanded": isExpanded,
|
|
5443
5444
|
"aria-label": isExpanded ? "Collapse row" : "Expand row",
|
|
5444
|
-
className: `w-9 h-9 inline-flex items-center justify-center rounded-md hover:
|
|
5445
|
+
className: `w-9 h-9 inline-flex items-center justify-center rounded-md text-foreground-muted hover:text-foreground transition-[transform,color] duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${isExpanded && !expandRow.collapseIcon ? "rotate-180" : ""}`,
|
|
5445
5446
|
children: isExpanded ? expandRow.collapseIcon ?? expandRow.expandIcon ?? DefaultExpandIcon : expandRow.expandIcon ?? DefaultExpandIcon
|
|
5446
5447
|
}
|
|
5447
5448
|
) }),
|
|
@@ -5477,29 +5478,18 @@ function Pagination({
|
|
|
5477
5478
|
onPageChange,
|
|
5478
5479
|
maxPage,
|
|
5479
5480
|
options,
|
|
5480
|
-
|
|
5481
|
-
|
|
5481
|
+
perPage,
|
|
5482
|
+
onPerPageChange
|
|
5482
5483
|
}) {
|
|
5483
5484
|
const picker = options.pickerOptions ?? DEFAULT_PICKER;
|
|
5484
|
-
const
|
|
5485
|
-
|
|
5486
|
-
);
|
|
5487
|
-
const [perPageKey, setPerPageKey] = useState(() => matchedOption?.key ?? picker[0]?.key);
|
|
5488
|
-
const displayPerPageKey = serverSide ? matchedOption?.key ?? perPageKey : perPageKey;
|
|
5489
|
-
useEffect(() => {
|
|
5490
|
-
if (serverSide && options.perPage != null) {
|
|
5491
|
-
const next = picker.find((o) => o.label === options.perPage || o.value === options.perPage);
|
|
5492
|
-
if (next) setPerPageKey(next.key);
|
|
5493
|
-
}
|
|
5494
|
-
}, [serverSide, options.perPage, picker]);
|
|
5495
|
-
const currentOpt = picker.find((o) => o.key === displayPerPageKey);
|
|
5496
|
-
const currentPerPageLabel = currentOpt?.label ?? currentOpt?.value ?? options.perPage ?? "";
|
|
5485
|
+
const currentOpt = picker.find((o) => o.value === perPage || o.label === perPage);
|
|
5486
|
+
const currentPerPageLabel = currentOpt?.label ?? currentOpt?.value ?? perPage ?? "";
|
|
5497
5487
|
const FOCUS = "focus-visible:!ring-0 focus-visible:!border-accent";
|
|
5498
5488
|
const navBtn = (icon, disabled, onClick, title) => /* @__PURE__ */ jsx(Button_default, { variant: "outline", size: "sm", disabled, onClick, icon, className: `w-7 !px-0 ${FOCUS}`, "aria-label": title, title });
|
|
5499
5489
|
const chevronRight = /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", 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: "M9 6l6 6-6 6" }) });
|
|
5500
5490
|
const doubleChevronRight = /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", 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: "M6 6l6 6-6 6M12 6l6 6-6 6" }) });
|
|
5501
5491
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-end gap-x-4 gap-y-3", children: [
|
|
5502
|
-
options.withPicker && /* @__PURE__ */ jsxs("div", { className: "mr-auto flex items-center gap-2", children: [
|
|
5492
|
+
options.withPicker !== false && /* @__PURE__ */ jsxs("div", { className: "mr-auto flex items-center gap-2", children: [
|
|
5503
5493
|
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap text-xs text-foreground-muted", children: "Rows per page" }),
|
|
5504
5494
|
/* @__PURE__ */ jsx(
|
|
5505
5495
|
MenuButton,
|
|
@@ -5512,10 +5502,7 @@ function Pagination({
|
|
|
5512
5502
|
items: picker.map((o) => ({
|
|
5513
5503
|
key: o.key,
|
|
5514
5504
|
label: String(o.label ?? o.value ?? o.key),
|
|
5515
|
-
onSelect: () =>
|
|
5516
|
-
if (!serverSide) setPerPageKey(o.key);
|
|
5517
|
-
onPerPageChange(o.label ?? o.value ?? o.key);
|
|
5518
|
-
}
|
|
5505
|
+
onSelect: () => onPerPageChange(o.value ?? o.label ?? o.key)
|
|
5519
5506
|
}))
|
|
5520
5507
|
}
|
|
5521
5508
|
)
|
|
@@ -5655,9 +5642,9 @@ function Table({
|
|
|
5655
5642
|
activePage,
|
|
5656
5643
|
onPageChange: handlePageChange,
|
|
5657
5644
|
maxPage: MAX_PAGE,
|
|
5645
|
+
perPage,
|
|
5658
5646
|
onPerPageChange: onPaginationChange,
|
|
5659
|
-
options: pagination
|
|
5660
|
-
serverSide: isServerSide
|
|
5647
|
+
options: pagination
|
|
5661
5648
|
}
|
|
5662
5649
|
);
|
|
5663
5650
|
return /* @__PURE__ */ jsxs("div", { className: `w-full h-max rounded-lg ${className}`.trim(), style, children: [
|
|
@@ -6841,13 +6828,19 @@ function PasswordStrength({
|
|
|
6841
6828
|
const matches = value.length > 0 && value === confirmValue;
|
|
6842
6829
|
return /* @__PURE__ */ jsxs("div", { className: cx("flex flex-col gap-2", className), style, "aria-live": "polite", children: [
|
|
6843
6830
|
!hideMeter && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6844
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-1", role: "meter", "aria-valuemin": 0, "aria-valuemax": 4, "aria-valuenow": score, "aria-label": "Password strength", children: [1, 2, 3, 4].map((seg) =>
|
|
6845
|
-
|
|
6846
|
-
{
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6831
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-1", role: "meter", "aria-valuemin": 0, "aria-valuemax": 4, "aria-valuenow": score, "aria-label": "Password strength", children: [1, 2, 3, 4].map((seg) => {
|
|
6832
|
+
const active = seg <= score;
|
|
6833
|
+
return /* @__PURE__ */ jsx("div", { className: "h-1.5 flex-1 overflow-hidden rounded-full bg-border", children: /* @__PURE__ */ jsx(
|
|
6834
|
+
"div",
|
|
6835
|
+
{
|
|
6836
|
+
className: cx(
|
|
6837
|
+
"h-full origin-left rounded-full transition-[transform,background-color] duration-300 ease-out motion-reduce:transition-none",
|
|
6838
|
+
score > 0 ? BAR_COLOR[score] : "bg-border"
|
|
6839
|
+
),
|
|
6840
|
+
style: { transform: `scaleX(${active ? 1 : 0})`, transitionDelay: active ? `${(seg - 1) * 70}ms` : "0ms" }
|
|
6841
|
+
}
|
|
6842
|
+
) }, seg);
|
|
6843
|
+
}) }),
|
|
6851
6844
|
label && /* @__PURE__ */ jsxs("p", { className: "text-xs", children: [
|
|
6852
6845
|
/* @__PURE__ */ jsx("span", { className: "text-foreground-muted", children: "Strength: " }),
|
|
6853
6846
|
/* @__PURE__ */ jsx("span", { className: cx("font-medium", TEXT_COLOR[score]), children: label })
|
|
@@ -6921,11 +6914,12 @@ function RadioTile({
|
|
|
6921
6914
|
value: opt.value,
|
|
6922
6915
|
disabled: opt.disabled,
|
|
6923
6916
|
className: cx(
|
|
6924
|
-
"group relative flex flex-col gap-1 rounded-xl border bg-surface text-left transition-
|
|
6917
|
+
"group relative flex flex-col gap-1 rounded-xl border bg-surface text-left transition-colors duration-150",
|
|
6925
6918
|
PAD2[size],
|
|
6926
6919
|
"border-border hover:border-border-strong",
|
|
6927
6920
|
"data-[state=checked]:border-accent data-[state=checked]:ring-1 data-[state=checked]:ring-accent",
|
|
6928
|
-
|
|
6921
|
+
// Keyboard focus only (no mouse-click flash); ring is instant, not animated.
|
|
6922
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface",
|
|
6929
6923
|
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
6930
6924
|
),
|
|
6931
6925
|
children: [
|