@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 CHANGED
@@ -5416,6 +5416,7 @@ function EditableCell({
5416
5416
  "input",
5417
5417
  {
5418
5418
  autoFocus: true,
5419
+ size: 1,
5419
5420
  defaultValue: value == null ? "" : String(value),
5420
5421
  onBlur: (e) => commit(e.target.value),
5421
5422
  onKeyDown: (e) => {
@@ -5428,7 +5429,7 @@ function EditableCell({
5428
5429
  }
5429
5430
  },
5430
5431
  "aria-label": `Edit ${typeof col.label === "string" ? col.label : col.keyBind}`,
5431
- className: "w-full rounded border border-accent bg-surface px-2 py-1 text-sm text-foreground outline-none"
5432
+ className: "box-border w-full min-w-0 rounded border border-accent bg-surface px-2 py-1 text-sm text-foreground outline-none"
5432
5433
  }
5433
5434
  );
5434
5435
  }
@@ -5478,7 +5479,7 @@ function TableBody({
5478
5479
  onClick: () => toggleRow(rowKey),
5479
5480
  "aria-expanded": isExpanded,
5480
5481
  "aria-label": isExpanded ? "Collapse row" : "Expand row",
5481
- className: `w-9 h-9 inline-flex items-center justify-center rounded-md hover:bg-background transition-transform duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${isExpanded && !expandRow.collapseIcon ? "rotate-180" : ""}`,
5482
+ 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" : ""}`,
5482
5483
  children: isExpanded ? expandRow.collapseIcon ?? expandRow.expandIcon ?? DefaultExpandIcon : expandRow.expandIcon ?? DefaultExpandIcon
5483
5484
  }
5484
5485
  ) }),
@@ -5514,29 +5515,18 @@ function Pagination({
5514
5515
  onPageChange,
5515
5516
  maxPage,
5516
5517
  options,
5517
- onPerPageChange,
5518
- serverSide = false
5518
+ perPage,
5519
+ onPerPageChange
5519
5520
  }) {
5520
5521
  const picker = options.pickerOptions ?? DEFAULT_PICKER;
5521
- const matchedOption = picker.find(
5522
- (o) => o.label === options.perPage || o.value === options.perPage
5523
- );
5524
- const [perPageKey, setPerPageKey] = React29.useState(() => matchedOption?.key ?? picker[0]?.key);
5525
- const displayPerPageKey = serverSide ? matchedOption?.key ?? perPageKey : perPageKey;
5526
- React29.useEffect(() => {
5527
- if (serverSide && options.perPage != null) {
5528
- const next = picker.find((o) => o.label === options.perPage || o.value === options.perPage);
5529
- if (next) setPerPageKey(next.key);
5530
- }
5531
- }, [serverSide, options.perPage, picker]);
5532
- const currentOpt = picker.find((o) => o.key === displayPerPageKey);
5533
- const currentPerPageLabel = currentOpt?.label ?? currentOpt?.value ?? options.perPage ?? "";
5522
+ const currentOpt = picker.find((o) => o.value === perPage || o.label === perPage);
5523
+ const currentPerPageLabel = currentOpt?.label ?? currentOpt?.value ?? perPage ?? "";
5534
5524
  const FOCUS = "focus-visible:!ring-0 focus-visible:!border-accent";
5535
5525
  const navBtn = (icon, disabled, onClick, title) => /* @__PURE__ */ jsxRuntime.jsx(Button_default, { variant: "outline", size: "sm", disabled, onClick, icon, className: `w-7 !px-0 ${FOCUS}`, "aria-label": title, title });
5536
5526
  const chevronRight = /* @__PURE__ */ jsxRuntime.jsx("svg", { "aria-hidden": "true", 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: "M9 6l6 6-6 6" }) });
5537
5527
  const doubleChevronRight = /* @__PURE__ */ jsxRuntime.jsx("svg", { "aria-hidden": "true", 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: "M6 6l6 6-6 6M12 6l6 6-6 6" }) });
5538
5528
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-end gap-x-4 gap-y-3", children: [
5539
- options.withPicker && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mr-auto flex items-center gap-2", children: [
5529
+ options.withPicker !== false && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mr-auto flex items-center gap-2", children: [
5540
5530
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap text-xs text-foreground-muted", children: "Rows per page" }),
5541
5531
  /* @__PURE__ */ jsxRuntime.jsx(
5542
5532
  MenuButton,
@@ -5549,10 +5539,7 @@ function Pagination({
5549
5539
  items: picker.map((o) => ({
5550
5540
  key: o.key,
5551
5541
  label: String(o.label ?? o.value ?? o.key),
5552
- onSelect: () => {
5553
- if (!serverSide) setPerPageKey(o.key);
5554
- onPerPageChange(o.label ?? o.value ?? o.key);
5555
- }
5542
+ onSelect: () => onPerPageChange(o.value ?? o.label ?? o.key)
5556
5543
  }))
5557
5544
  }
5558
5545
  )
@@ -5692,9 +5679,9 @@ function Table({
5692
5679
  activePage,
5693
5680
  onPageChange: handlePageChange,
5694
5681
  maxPage: MAX_PAGE,
5682
+ perPage,
5695
5683
  onPerPageChange: onPaginationChange,
5696
- options: pagination,
5697
- serverSide: isServerSide
5684
+ options: pagination
5698
5685
  }
5699
5686
  );
5700
5687
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `w-full h-max rounded-lg ${className}`.trim(), style, children: [
@@ -6878,13 +6865,19 @@ function PasswordStrength({
6878
6865
  const matches = value.length > 0 && value === confirmValue;
6879
6866
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("flex flex-col gap-2", className), style, "aria-live": "polite", children: [
6880
6867
  !hideMeter && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6881
- /* @__PURE__ */ jsxRuntime.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) => /* @__PURE__ */ jsxRuntime.jsx(
6882
- "span",
6883
- {
6884
- className: cx("h-1.5 flex-1 rounded-full transition-colors duration-200", seg <= score ? BAR_COLOR[score] : "bg-border")
6885
- },
6886
- seg
6887
- )) }),
6868
+ /* @__PURE__ */ jsxRuntime.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) => {
6869
+ const active = seg <= score;
6870
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 flex-1 overflow-hidden rounded-full bg-border", children: /* @__PURE__ */ jsxRuntime.jsx(
6871
+ "div",
6872
+ {
6873
+ className: cx(
6874
+ "h-full origin-left rounded-full transition-[transform,background-color] duration-300 ease-out motion-reduce:transition-none",
6875
+ score > 0 ? BAR_COLOR[score] : "bg-border"
6876
+ ),
6877
+ style: { transform: `scaleX(${active ? 1 : 0})`, transitionDelay: active ? `${(seg - 1) * 70}ms` : "0ms" }
6878
+ }
6879
+ ) }, seg);
6880
+ }) }),
6888
6881
  label && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs", children: [
6889
6882
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-muted", children: "Strength: " }),
6890
6883
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx("font-medium", TEXT_COLOR[score]), children: label })
@@ -6958,11 +6951,12 @@ function RadioTile({
6958
6951
  value: opt.value,
6959
6952
  disabled: opt.disabled,
6960
6953
  className: cx(
6961
- "group relative flex flex-col gap-1 rounded-xl border bg-surface text-left transition-all duration-150",
6954
+ "group relative flex flex-col gap-1 rounded-xl border bg-surface text-left transition-colors duration-150",
6962
6955
  PAD2[size],
6963
6956
  "border-border hover:border-border-strong",
6964
6957
  "data-[state=checked]:border-accent data-[state=checked]:ring-1 data-[state=checked]:ring-accent",
6965
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
6958
+ // Keyboard focus only (no mouse-click flash); ring is instant, not animated.
6959
+ "focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface",
6966
6960
  "disabled:cursor-not-allowed disabled:opacity-50"
6967
6961
  ),
6968
6962
  children: [