@particle-academy/react-fancy 4.4.0 → 4.4.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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @particle-academy/react-fancy
2
2
 
3
+ [![Fancified](art/fancified.svg)](https://particle.academy)
4
+
3
5
  React UI component library for **Human+ UX** — controlled, agent-bridgeable primitives that humans and agents share. Every component exposes `value` / `onChange`, stable handles, and JSON-friendly props so MCP bridges can drive the UI without DOM scraping.
4
6
 
5
7
  ## Inertia.js integration
package/dist/index.cjs CHANGED
@@ -2539,9 +2539,14 @@ var Button = react.forwardRef(
2539
2539
  {
2540
2540
  "data-react-fancy-button-label": "",
2541
2541
  className: cn(
2542
- // min-w-0 lets the label shrink + wrap inside the flex row instead
2543
- // of overflowing and shoving the icon out of place.
2544
- "min-w-0",
2542
+ // A button label must stay on one line. When a host flex layout
2543
+ // squeezes the button, `whitespace-nowrap` keeps the label and any
2544
+ // trailing icon/arrow together instead of wrapping and stacking the
2545
+ // icon below it (the classic "send" over "→" break). `min-w-0` keeps
2546
+ // the span shrinkable so `truncate`/ellipsis still works; multi-line
2547
+ // wrapping is opt-in via `labelClassName` ("whitespace-normal") or
2548
+ // the `responsive` prop.
2549
+ "min-w-0 whitespace-nowrap",
2545
2550
  // `responsive` collapses to icon-only when squeezed, while keeping
2546
2551
  // the label readable to screen readers.
2547
2552
  responsive && "sr-only sm:not-sr-only",
@@ -5519,7 +5524,7 @@ function TableRow({
5519
5524
  hasTray && expanded && /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "bg-zinc-50/50 dark:bg-zinc-800/30", children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 999, children: tray }) })
5520
5525
  ] });
5521
5526
  }
5522
- function TableCell({ children, className, header }) {
5527
+ function TableCell({ children, className, header, ...rest }) {
5523
5528
  const Tag = header ? "th" : "td";
5524
5529
  return /* @__PURE__ */ jsxRuntime.jsx(
5525
5530
  Tag,
@@ -5530,6 +5535,7 @@ function TableCell({ children, className, header }) {
5530
5535
  header && "text-left font-medium text-zinc-500 dark:text-zinc-400",
5531
5536
  className
5532
5537
  ),
5538
+ ...rest,
5533
5539
  children
5534
5540
  }
5535
5541
  );
@@ -7925,7 +7931,8 @@ function ModalRoot({
7925
7931
  open,
7926
7932
  onClose,
7927
7933
  size = "md",
7928
- className
7934
+ className,
7935
+ ...rest
7929
7936
  }) {
7930
7937
  const panelRef = react.useRef(null);
7931
7938
  const close = react.useCallback(() => onClose(), [onClose]);
@@ -7966,6 +7973,7 @@ function ModalRoot({
7966
7973
  "data-react-fancy-modal": "",
7967
7974
  role: "dialog",
7968
7975
  "aria-modal": "true",
7976
+ ...rest,
7969
7977
  className: cn(
7970
7978
  "relative flex w-full flex-col overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-xl dark:border-zinc-700 dark:bg-zinc-900",
7971
7979
  SIZE_MAP[size],
@@ -8333,7 +8341,9 @@ function TabsTab({
8333
8341
  children,
8334
8342
  value,
8335
8343
  disabled = false,
8336
- className
8344
+ className,
8345
+ onClick,
8346
+ ...rest
8337
8347
  }) {
8338
8348
  const { activeTab, setActiveTab, variant } = useTabs();
8339
8349
  const isActive = activeTab === value;
@@ -8346,7 +8356,11 @@ function TabsTab({
8346
8356
  disabled,
8347
8357
  "aria-selected": isActive,
8348
8358
  tabIndex: isActive ? 0 : -1,
8349
- onClick: () => !disabled && setActiveTab(value),
8359
+ onClick: (e) => {
8360
+ if (!disabled) setActiveTab(value);
8361
+ onClick?.(e);
8362
+ },
8363
+ ...rest,
8350
8364
  className: cn(
8351
8365
  "text-sm font-medium transition-colors",
8352
8366
  disabled && "cursor-not-allowed opacity-50",
@@ -12914,13 +12928,14 @@ function PromptInput({
12914
12928
  {
12915
12929
  variant: "ghost",
12916
12930
  size: "sm",
12931
+ className: "shrink-0",
12917
12932
  onClick: () => {
12918
12933
  },
12919
12934
  children: "\u{1F4CE} attach"
12920
12935
  }
12921
12936
  ) }),
12922
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-2 flex items-center gap-1.5", children: [
12923
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-24 overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-700", children: /* @__PURE__ */ jsxRuntime.jsx(
12937
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-2 flex min-w-0 items-center gap-1.5 overflow-hidden", children: [
12938
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-24 shrink overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-700", children: /* @__PURE__ */ jsxRuntime.jsx(
12924
12939
  "div",
12925
12940
  {
12926
12941
  className: "h-full rounded-full transition-all",
@@ -12933,7 +12948,7 @@ function PromptInput({
12933
12948
  fmtTokens(budgetTokens)
12934
12949
  ] })
12935
12950
  ] }),
12936
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-auto flex items-center gap-2", children: [
12951
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
12937
12952
  showHint && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "hidden text-[10px] text-zinc-500 sm:inline", children: [
12938
12953
  /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: "rounded border border-zinc-300 bg-zinc-50 px-1 py-0.5 font-mono text-[9px] text-zinc-700 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-300", children: "\u2318" }),
12939
12954
  " ",
@@ -12943,7 +12958,7 @@ function PromptInput({
12943
12958
  " ",
12944
12959
  "to send"
12945
12960
  ] }),
12946
- /* @__PURE__ */ jsxRuntime.jsx(Button, { color: "violet", size: "sm", onClick: submit, children: "send \u2192" })
12961
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { color: "violet", size: "sm", className: "shrink-0", onClick: submit, children: "send \u2192" })
12947
12962
  ] })
12948
12963
  ] })
12949
12964
  ]