@particle-academy/react-fancy 3.5.0 → 4.0.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.
package/README.md CHANGED
@@ -57,7 +57,7 @@ Add the `@source` directive to your main CSS file so Tailwind v4 scans the compo
57
57
  Then import and use components:
58
58
 
59
59
  ```tsx
60
- import { Action, Input, Modal, Dropdown } from "@particle-academy/react-fancy";
60
+ import { Button, Input, Modal, Dropdown } from "@particle-academy/react-fancy";
61
61
  import "@particle-academy/react-fancy/styles.css";
62
62
  ```
63
63
 
@@ -82,7 +82,8 @@ npx vite build # Build demo app (verifies imports work)
82
82
 
83
83
  | Component | Description | Docs |
84
84
  |-----------|-------------|------|
85
- | Action | Button with colors, states, icons, emoji, avatar, badge, sort control | [docs](docs/Action.md) |
85
+ | Button | Button with colors, states, icons, emoji, avatar, badge, sort control | [docs](docs/Button.md) |
86
+ | ~~Action~~ | Deprecated alias of `Button` (kept for backward compatibility) | [docs](docs/Action.md) |
86
87
  | Carousel | Slide carousel with directional/wizard variants, autoplay, loop | [docs](docs/Carousel.md) |
87
88
  | ColorPicker | Native color input with swatch preview, hex display, presets | [docs](docs/ColorPicker.md) |
88
89
  | Emoji | Emoji renderer from slugs | [docs](docs/Emoji.md) |
@@ -240,7 +241,7 @@ src/
240
241
 
241
242
  - `Size` — `"xs" | "sm" | "md" | "lg" | "xl"`
242
243
  - `Color` — Full Tailwind color palette (17 colors)
243
- - `ActionColor` — Subset of 10 standalone colors used by Action and friends
244
+ - `ButtonColor` — Subset of 10 standalone colors used by `Button` and friends (legacy alias: `ActionColor`)
244
245
  - `Variant` — `"solid" | "outline" | "ghost" | "soft"`
245
246
  - `Placement` — `"top" | "bottom" | "left" | "right"` + start/end variants
246
247
 
package/dist/index.cjs CHANGED
@@ -2344,7 +2344,7 @@ function parseSortOrder(sort) {
2344
2344
  }
2345
2345
  return valid;
2346
2346
  }
2347
- var Action = react.forwardRef(
2347
+ var Button = react.forwardRef(
2348
2348
  ({
2349
2349
  children,
2350
2350
  className,
@@ -2507,12 +2507,13 @@ var Action = react.forwardRef(
2507
2507
  trailingElements
2508
2508
  ] });
2509
2509
  const safeHref = sanitizeHref(href);
2510
- const buttonEl = safeHref && !disabled ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: safeHref, className: classes, "data-react-fancy-action": "", children: content }) : /* @__PURE__ */ jsxRuntime.jsx(
2510
+ const buttonEl = safeHref && !disabled ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: safeHref, className: classes, "data-react-fancy-button": "", "data-react-fancy-action": "", children: content }) : /* @__PURE__ */ jsxRuntime.jsx(
2511
2511
  "button",
2512
2512
  {
2513
2513
  ref,
2514
2514
  className: classes,
2515
2515
  disabled: disabled || loading,
2516
+ "data-react-fancy-button": "",
2516
2517
  "data-react-fancy-action": "",
2517
2518
  ...props,
2518
2519
  children: content
@@ -2576,7 +2577,8 @@ var Action = react.forwardRef(
2576
2577
  return buttonEl;
2577
2578
  }
2578
2579
  );
2579
- Action.displayName = "Action";
2580
+ Button.displayName = "Button";
2581
+ var Action = Button;
2580
2582
  function useControllableState(controlledValue, defaultValue, onChange) {
2581
2583
  const [uncontrolledValue, setUncontrolledValue] = react.useState(defaultValue);
2582
2584
  const isControlled = controlledValue !== void 0;
@@ -12260,7 +12262,7 @@ function ReasonTag({
12260
12262
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] uppercase tracking-wider text-zinc-400", children: "sources" }),
12261
12263
  /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "mt-0.5 space-y-0.5 text-[12px]", children: sources.map((s, i) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: s.href ? /* @__PURE__ */ jsxRuntime.jsx("a", { className: "text-violet-600 hover:underline", href: s.href, children: s.label }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-zinc-600 dark:text-zinc-300", children: s.label }) }, i)) })
12262
12264
  ] }),
12263
- onFollowUp && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end pt-1", children: /* @__PURE__ */ jsxRuntime.jsx(Action, { size: "sm", variant: "ghost", onClick: onFollowUp, children: "ask follow-up" }) })
12265
+ onFollowUp && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end pt-1", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", variant: "ghost", onClick: onFollowUp, children: "ask follow-up" }) })
12264
12266
  ] }) })
12265
12267
  ] });
12266
12268
  }
@@ -12700,7 +12702,7 @@ function PromptInput({
12700
12702
  ] }),
12701
12703
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 border-t border-zinc-200 bg-zinc-50/60 px-3 py-2 dark:border-zinc-800 dark:bg-zinc-900/40", children: [
12702
12704
  /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: "Drop files here, or click", children: /* @__PURE__ */ jsxRuntime.jsx(
12703
- Action,
12705
+ Button,
12704
12706
  {
12705
12707
  variant: "ghost",
12706
12708
  size: "sm",
@@ -12733,7 +12735,7 @@ function PromptInput({
12733
12735
  " ",
12734
12736
  "to send"
12735
12737
  ] }),
12736
- /* @__PURE__ */ jsxRuntime.jsx(Action, { color: "violet", size: "sm", onClick: submit, children: "send \u2192" })
12738
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { color: "violet", size: "sm", onClick: submit, children: "send \u2192" })
12737
12739
  ] })
12738
12740
  ] })
12739
12741
  ]
@@ -13351,7 +13353,7 @@ function Wand({
13351
13353
  ] })
13352
13354
  ] }),
13353
13355
  actions.map((a) => /* @__PURE__ */ jsxRuntime.jsxs(
13354
- Action,
13356
+ Button,
13355
13357
  {
13356
13358
  size: "sm",
13357
13359
  variant: "ghost",
@@ -13438,6 +13440,7 @@ exports.Avatar = Avatar;
13438
13440
  exports.Badge = Badge;
13439
13441
  exports.Brand = Brand;
13440
13442
  exports.Breadcrumbs = Breadcrumbs;
13443
+ exports.Button = Button;
13441
13444
  exports.Calendar = Calendar;
13442
13445
  exports.Callout = Callout;
13443
13446
  exports.Card = Card;