@pipelex/mthds-form 0.7.0 → 0.8.0

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.
@@ -75,7 +75,7 @@ var Switch = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
75
75
  SwitchPrimitives.Root,
76
76
  {
77
77
  className: cn(
78
- "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
78
+ "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
79
79
  className
80
80
  ),
81
81
  ...props,
@@ -247,9 +247,9 @@ function FieldShell({
247
247
  var fieldControlClass = cn(
248
248
  "w-full rounded-md border border-border bg-input text-sm text-foreground",
249
249
  "placeholder:text-muted-foreground/70 transition-colors",
250
- "focus-visible:outline-none focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/40",
250
+ "focus-visible:outline-hidden focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/40",
251
251
  "disabled:cursor-not-allowed disabled:opacity-50",
252
- "aria-[invalid=true]:border-destructive aria-[invalid=true]:ring-destructive/30"
252
+ "aria-invalid:border-destructive aria-invalid:ring-destructive/30"
253
253
  );
254
254
  function DateField({ field, value, onChange, id, error, disabled }) {
255
255
  const domId = useFieldDomId(id);
@@ -478,7 +478,7 @@ function FileField({
478
478
  type: "button",
479
479
  disabled: busy,
480
480
  onClick: () => setShowUrl(true),
481
- className: "inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50",
481
+ className: "flex w-fit items-center gap-1 font-mono text-[11px] text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50",
482
482
  children: [
483
483
  /* @__PURE__ */ jsx(Link2, { className: "h-3 w-3" }),
484
484
  s.pasteUrlInstead
@@ -588,7 +588,7 @@ var SelectTrigger = React2.forwardRef(({ className, children, ...props }, ref) =
588
588
  // Adapted from the registry to DESIGN.md ("Inputs"): the `--input` surface,
589
589
  // a hairline `--border`, and a border-color focus signal instead of the
590
590
  // upstream 2px focus ring ("No focus glow by default").
591
- "flex h-10 w-full items-center justify-between rounded-md border border-border bg-input px-3 py-2 text-sm transition-colors data-[placeholder]:text-muted-foreground focus:border-ring focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-destructive [&>span]:line-clamp-1",
591
+ "flex h-10 w-full items-center justify-between rounded-md border border-border bg-input px-3 py-2 text-sm transition-colors data-placeholder:text-muted-foreground focus:border-ring focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive [&>span]:line-clamp-1",
592
592
  className
593
593
  ),
594
594
  ...props,
@@ -624,7 +624,7 @@ var SelectContent = React2.forwardRef(({ className, children, position = "popper
624
624
  {
625
625
  ref,
626
626
  className: cn(
627
- "relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
627
+ "relative z-50 max-h-(--radix-select-content-available-height) min-w-32 overflow-y-auto overflow-x-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-select-content-transform-origin)",
628
628
  position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
629
629
  className
630
630
  ),
@@ -637,7 +637,7 @@ var SelectContent = React2.forwardRef(({ className, children, position = "popper
637
637
  {
638
638
  className: cn(
639
639
  "p-1",
640
- position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
640
+ position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"
641
641
  ),
642
642
  children
643
643
  }
@@ -661,7 +661,7 @@ var SelectItem = React2.forwardRef(({ className, children, ...props }, ref) => /
661
661
  {
662
662
  ref,
663
663
  className: cn(
664
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
664
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
665
665
  className
666
666
  ),
667
667
  ...props,
@@ -682,7 +682,7 @@ var SelectSeparator = React2.forwardRef(({ className, ...props }, ref) => /* @__
682
682
  ));
683
683
  SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
684
684
  var toggleVariants = cva(
685
- "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",
685
+ "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",
686
686
  {
687
687
  variants: {
688
688
  variant: {
@@ -932,7 +932,7 @@ function ProseField({ field, value, onChange, id, error, disabled }) {
932
932
  onChange: (e) => onChange(e.target.value === "" ? void 0 : e.target.value),
933
933
  className: cn(
934
934
  fieldControlClass,
935
- "min-h-[88px] resize-y px-3 py-2.5 leading-relaxed [field-sizing:content]"
935
+ "min-h-[88px] resize-y px-3 py-2.5 leading-relaxed field-sizing-content"
936
936
  )
937
937
  }
938
938
  )
@@ -946,7 +946,7 @@ function OptionalToggle({ count, expanded, onToggle, noun = "field" }) {
946
946
  {
947
947
  type: "button",
948
948
  onClick: onToggle,
949
- className: "inline-flex items-center gap-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground",
949
+ className: "flex w-fit items-center gap-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground",
950
950
  children: [
951
951
  expanded ? /* @__PURE__ */ jsx(Minus, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(Plus, { className: "h-3 w-3" }),
952
952
  expanded ? noun === "field" ? s.hideOptionalFields : s.hideOptionalInputs : noun === "field" ? s.optionalFieldsCount(count) : s.optionalInputsCount(count)
@@ -1533,7 +1533,7 @@ function Block({ token }) {
1533
1533
  // for no gain — the lines are prose, and prose wraps. Real code loses
1534
1534
  // its column alignment and keeps every character, which is the better
1535
1535
  // half of that trade at this width.
1536
- /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap break-words rounded-md border border-border bg-card/40 p-2.5 text-[12px]", children: /* @__PURE__ */ jsx("code", { children: code.text }) })
1536
+ /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap wrap-break-word rounded-md border border-border bg-card/40 p-2.5 text-[12px]", children: /* @__PURE__ */ jsx("code", { children: code.text }) })
1537
1537
  );
1538
1538
  }
1539
1539
  case "blockquote":
@@ -1659,7 +1659,7 @@ function Described({ description, children }) {
1659
1659
  "span",
1660
1660
  {
1661
1661
  tabIndex: 0,
1662
- className: "-mx-1 cursor-help rounded px-1 outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring",
1662
+ className: "-mx-1 cursor-help rounded px-1 outline-hidden transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring",
1663
1663
  children
1664
1664
  }
1665
1665
  ) }),
@@ -1713,7 +1713,7 @@ function stringifyValue(value) {
1713
1713
  function RawValue({ value, compact }) {
1714
1714
  const text = stringifyValue(value);
1715
1715
  if (text === void 0) return /* @__PURE__ */ jsx(Absent, {});
1716
- return compact ? /* @__PURE__ */ jsx("span", { title: text, className: "truncate font-mono text-[12px] text-foreground", children: text }) : /* @__PURE__ */ jsx("pre", { className: "overflow-x-auto whitespace-pre-wrap break-words rounded-md border border-border bg-card/40 px-2.5 py-1.5 font-mono text-[12px] leading-relaxed text-foreground", children: text });
1716
+ return compact ? /* @__PURE__ */ jsx("span", { title: text, className: "truncate font-mono text-[12px] text-foreground", children: text }) : /* @__PURE__ */ jsx("pre", { className: "overflow-x-auto whitespace-pre-wrap wrap-break-word rounded-md border border-border bg-card/40 px-2.5 py-1.5 font-mono text-[12px] leading-relaxed text-foreground", children: text });
1717
1717
  }
1718
1718
  function Scalar({ value, compact = false }) {
1719
1719
  if (value === null || value === void 0 || value === "") return /* @__PURE__ */ jsx(Absent, {});
@@ -1780,7 +1780,7 @@ function CopyButton({
1780
1780
  },
1781
1781
  ...title ? { title } : {},
1782
1782
  "aria-label": label,
1783
- className: "shrink-0 rounded p-0.5 text-muted-foreground hover:bg-card hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1",
1783
+ className: "shrink-0 rounded p-0.5 text-muted-foreground hover:bg-card hover:text-foreground focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1",
1784
1784
  children: copied ? /* @__PURE__ */ jsx(Check, { "aria-hidden": true, className: "size-3.5" }) : /* @__PURE__ */ jsx(Copy, { "aria-hidden": true, className: "size-3.5" })
1785
1785
  }
1786
1786
  );
@@ -1854,7 +1854,7 @@ function DocumentPreview({ url, name }) {
1854
1854
  title: name,
1855
1855
  loading: "lazy",
1856
1856
  referrerPolicy: "no-referrer",
1857
- className: "h-[28rem] w-full rounded-lg border border-border bg-card/40"
1857
+ className: "h-112 w-full rounded-lg border border-border bg-card/40"
1858
1858
  }
1859
1859
  );
1860
1860
  }
@@ -1888,7 +1888,7 @@ function DocumentValue({ value }) {
1888
1888
  type: "button",
1889
1889
  onClick: () => setOpen((current) => !current),
1890
1890
  "aria-expanded": open,
1891
- className: "flex shrink-0 items-center gap-1.5 rounded-md border border-border px-2 py-1 text-[12px] text-muted-foreground hover:bg-card hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1",
1891
+ className: "flex shrink-0 items-center gap-1.5 rounded-md border border-border px-2 py-1 text-[12px] text-muted-foreground hover:bg-card hover:text-foreground focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1",
1892
1892
  children: [
1893
1893
  open ? /* @__PURE__ */ jsx(EyeOff, { "aria-hidden": true, className: "size-3.5" }) : /* @__PURE__ */ jsx(Eye, { "aria-hidden": true, className: "size-3.5" }),
1894
1894
  s.preview
@@ -1941,7 +1941,7 @@ function ImageValue({
1941
1941
  // times that tall — a generated report image is the RESULT here,
1942
1942
  // not a decoration beside one, and it was unreadable at that size.
1943
1943
  // `object-contain` keeps the aspect ratio when the cap bites.
1944
- !inGallery && !compact && "max-h-[44rem] w-full rounded-lg border border-border object-contain"
1944
+ !inGallery && !compact && "max-h-176 w-full rounded-lg border border-border object-contain"
1945
1945
  )
1946
1946
  }
1947
1947
  )
@@ -2176,14 +2176,14 @@ function ObjectTable({
2176
2176
  /* @__PURE__ */ jsx("tbody", { children: items.map((item, index) => {
2177
2177
  const isOpen = expanded.has(index);
2178
2178
  return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs("tr", { className: "border-b border-border/60 last:border-b-0", children: [
2179
- canExpand && /* @__PURE__ */ jsx("td", { className: "px-1 align-top", children: /* @__PURE__ */ jsx(
2179
+ canExpand && /* @__PURE__ */ jsx("td", { className: "px-1 pt-px align-top", children: /* @__PURE__ */ jsx(
2180
2180
  "button",
2181
2181
  {
2182
2182
  type: "button",
2183
2183
  onClick: () => toggle(index),
2184
2184
  "aria-expanded": isOpen,
2185
2185
  "aria-label": s.toggleRowDetails(index + 1),
2186
- className: "mt-0.5 flex size-6 items-center justify-center rounded text-muted-foreground hover:bg-card hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1",
2186
+ className: "mt-0.5 flex size-6 items-center justify-center rounded text-muted-foreground hover:bg-card hover:text-foreground focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1",
2187
2187
  children: isOpen ? /* @__PURE__ */ jsx(ChevronDown, { "aria-hidden": true, className: "size-3.5" }) : /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": true, className: "size-3.5" })
2188
2188
  }
2189
2189
  ) }),
@@ -2343,7 +2343,7 @@ function ResultField({ field, value, depth = 0, hideLabel = false }) {
2343
2343
  // longest label left over.
2344
2344
  isInlineColumn(child) ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
2345
2345
  /* @__PURE__ */ jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsx(Label2, { field: child, describe: true }) }),
2346
- /* @__PURE__ */ jsx("div", { className: "min-w-0 text-right [&_[data-chips]]:justify-end", children: /* @__PURE__ */ jsx(LeafValue, { field: child, value: memberValue(child) }) })
2346
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 text-right **:data-chips:justify-end", children: /* @__PURE__ */ jsx(LeafValue, { field: child, value: memberValue(child) }) })
2347
2347
  ] }, child.name) : /* @__PURE__ */ jsx("div", { className: "col-span-2 min-w-0", children: /* @__PURE__ */ jsx(ResultField, { field: child, value: memberValue(child), depth: depth + 1 }) }, child.name)
2348
2348
  )
2349
2349
  )
@@ -2528,7 +2528,7 @@ function JsonView({ value }) {
2528
2528
  });
2529
2529
  },
2530
2530
  "aria-label": s.copyJson,
2531
- className: "absolute right-2 top-2 rounded border border-border bg-card p-1 text-muted-foreground hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1",
2531
+ className: "absolute right-2 top-2 rounded border border-border bg-card p-1 text-muted-foreground hover:text-foreground focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1",
2532
2532
  children: copied ? /* @__PURE__ */ jsx(Check, { "aria-hidden": true, className: "size-3.5" }) : /* @__PURE__ */ jsx(Copy, { "aria-hidden": true, className: "size-3.5" })
2533
2533
  }
2534
2534
  ),
@@ -2577,7 +2577,7 @@ function StuffViewer({
2577
2577
  onClick: () => void handleDownload(),
2578
2578
  disabled: saving,
2579
2579
  "aria-label": s.download,
2580
- className: "inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-[12px] text-muted-foreground hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 disabled:opacity-60",
2580
+ className: "inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-[12px] text-muted-foreground hover:text-foreground focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 disabled:opacity-60",
2581
2581
  children: [
2582
2582
  saving ? /* @__PURE__ */ jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx(Download, { className: "h-3.5 w-3.5" }),
2583
2583
  saving ? s.downloading : s.download
@@ -2597,7 +2597,7 @@ function StuffViewer({
2597
2597
  onClick: () => setView(id),
2598
2598
  "aria-pressed": view === id,
2599
2599
  className: cn(
2600
- "rounded px-2 py-0.5 text-[12px] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1",
2600
+ "rounded px-2 py-0.5 text-[12px] focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1",
2601
2601
  view === id ? "bg-card font-medium text-foreground" : "text-muted-foreground hover:text-foreground"
2602
2602
  ),
2603
2603
  children: label