@orangecheck/app-design 0.5.7 → 0.5.9

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.js CHANGED
@@ -412,16 +412,25 @@ function Field({ label, hint, optional, error, children, className, hideLabel, a
412
412
  "aria-describedby": describedBy,
413
413
  "aria-invalid": error ? true : void 0
414
414
  }) : children;
415
+ const hintNode = hint ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: hintId, className: "text-[0.8125rem] leading-snug text-muted-foreground", children: hint }) : null;
415
416
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
416
417
  /* @__PURE__ */ jsxRuntime.jsxs(Label, { htmlFor: id, className: hideLabel ? "sr-only" : "flex items-baseline gap-2", children: [
417
418
  label,
418
419
  optional ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.8125rem] font-normal text-muted-foreground", children: "Optional" }) : null
419
420
  ] }),
420
- action ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-start", children: [
421
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex-1 [&>*]:w-full", children: control }),
422
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: action })
423
- ] }) : control,
424
- hint ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: hintId, className: "text-[0.8125rem] leading-snug text-muted-foreground", children: hint }) : null,
421
+ action ? (
422
+ // The hint belongs to the input, so it sits under the input, not under the button.
423
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-start", children: [
424
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-2 [&>input]:w-full", children: [
425
+ control,
426
+ hintNode
427
+ ] }),
428
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: action })
429
+ ] })
430
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
431
+ control,
432
+ hintNode
433
+ ] }),
425
434
  error ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: errorId, role: "alert", className: "text-[0.8125rem] leading-snug text-destructive", children: error }) : null
426
435
  ] });
427
436
  }
@@ -2087,11 +2096,7 @@ function SplitBar({
2087
2096
  children: /* @__PURE__ */ jsxRuntime.jsxs(
2088
2097
  "span",
2089
2098
  {
2090
- className: cn(
2091
- "oca-tabular leading-none tracking-[-0.02em]",
2092
- // A small share gets a smaller figure, so it fits its segment at any width.
2093
- s.pct < 30 ? "text-[1.125rem] md:text-[1.375rem]" : "text-[1.25rem] md:text-[1.875rem]"
2094
- ),
2099
+ className: "oca-tabular text-[1.125rem] leading-none tracking-[-0.02em] md:text-[1.5rem]",
2095
2100
  children: [
2096
2101
  s.pct,
2097
2102
  "%"
@@ -2565,6 +2570,7 @@ function AppShell({
2565
2570
  nav,
2566
2571
  sections,
2567
2572
  activeSection,
2573
+ page: pageOverride,
2568
2574
  persistent = [],
2569
2575
  home = "/",
2570
2576
  account,
@@ -2579,8 +2585,11 @@ function AppShell({
2579
2585
  warnDuplicateLabels(groups);
2580
2586
  const page = activeItem(groups);
2581
2587
  const place = react.useMemo(
2582
- () => ({ section: current ? current.title ?? current.label : void 0, page: page?.label }),
2583
- [current, page?.label]
2588
+ () => ({
2589
+ section: current ? current.title ?? current.label : void 0,
2590
+ page: pageOverride ?? page?.label
2591
+ }),
2592
+ [current, page?.label, pageOverride]
2584
2593
  );
2585
2594
  const switcher = sections && current && sections.length > 1 ? /* @__PURE__ */ jsxRuntime.jsx(SectionSwitch, { sections, current, onNavigate: () => setOpen(false) }) : null;
2586
2595
  return /* @__PURE__ */ jsxRuntime.jsx(ShellContext.Provider, { value: place, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("min-h-dvh bg-background", className), children: [