@particle-academy/react-fancy 5.5.0 → 5.6.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/dist/index.cjs CHANGED
@@ -7020,6 +7020,73 @@ var Kbd = react.forwardRef(
7020
7020
  }
7021
7021
  );
7022
7022
  Kbd.displayName = "Kbd";
7023
+ var IndexList = react.forwardRef(
7024
+ ({ items, linkAs, className, ...props }, ref) => {
7025
+ const Link = linkAs ?? "a";
7026
+ return /* @__PURE__ */ jsxRuntime.jsx("ol", { ref, "data-react-fancy-index-list": "", className: cn("m-0 list-none p-0", className), ...props, children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs(
7027
+ "li",
7028
+ {
7029
+ "data-react-fancy-index-row": "",
7030
+ className: "relative flex items-baseline gap-4 border-b border-zinc-200 py-3 last:border-b-0 dark:border-zinc-800",
7031
+ children: [
7032
+ item.num != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-mono text-xs tabular-nums text-zinc-400 dark:text-zinc-500", children: item.num }),
7033
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate font-medium text-zinc-900 dark:text-zinc-100", children: item.href ? /* @__PURE__ */ jsxRuntime.jsx(
7034
+ Link,
7035
+ {
7036
+ href: item.href,
7037
+ className: "no-underline after:absolute after:inset-0 after:content-[''] hover:underline",
7038
+ children: item.title
7039
+ }
7040
+ ) : item.title }),
7041
+ item.meta != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 truncate text-sm text-zinc-500 dark:text-zinc-400", children: item.meta }),
7042
+ item.value != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto shrink-0 font-mono text-xs tabular-nums text-zinc-500 dark:text-zinc-400", children: item.value })
7043
+ ]
7044
+ },
7045
+ item.id ?? i
7046
+ )) });
7047
+ }
7048
+ );
7049
+ IndexList.displayName = "IndexList";
7050
+ var StatBand = react.forwardRef(
7051
+ ({ columns = 4, className, style, children, ...props }, ref) => {
7052
+ return /* @__PURE__ */ jsxRuntime.jsx(
7053
+ "div",
7054
+ {
7055
+ ref,
7056
+ "data-react-fancy-stat-band": "",
7057
+ className: cn("grid gap-6", className),
7058
+ style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`, ...style },
7059
+ ...props,
7060
+ children
7061
+ }
7062
+ );
7063
+ }
7064
+ );
7065
+ StatBand.displayName = "StatBand";
7066
+ var valueClasses = {
7067
+ sm: "text-xl",
7068
+ md: "text-3xl",
7069
+ lg: "text-5xl"
7070
+ };
7071
+ var StatRoot = react.forwardRef(
7072
+ ({ value, label, size = "md", className, children, ...props }, ref) => {
7073
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-react-fancy-stat": "", className: cn(className), ...props, children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7074
+ /* @__PURE__ */ jsxRuntime.jsx(
7075
+ "div",
7076
+ {
7077
+ className: cn(
7078
+ "font-semibold leading-none tracking-tight text-zinc-900 tabular-nums dark:text-zinc-100",
7079
+ valueClasses[size]
7080
+ ),
7081
+ children: value
7082
+ }
7083
+ ),
7084
+ label != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1.5 font-mono text-xs uppercase tracking-wide text-zinc-500 dark:text-zinc-400", children: label })
7085
+ ] }) });
7086
+ }
7087
+ );
7088
+ StatRoot.displayName = "Stat";
7089
+ var Stat = Object.assign(StatRoot, { Band: StatBand });
7023
7090
  var gapClasses2 = {
7024
7091
  sm: "gap-2",
7025
7092
  md: "gap-3",
@@ -16592,6 +16659,7 @@ exports.FormProvider = FormProvider;
16592
16659
  exports.Heading = Heading;
16593
16660
  exports.Icon = Icon;
16594
16661
  exports.ImageViewer = ImageViewer;
16662
+ exports.IndexList = IndexList;
16595
16663
  exports.Input = Input;
16596
16664
  exports.InputTag = InputTag;
16597
16665
  exports.Kanban = Kanban;
@@ -16622,6 +16690,8 @@ exports.Separator = Separator;
16622
16690
  exports.Sidebar = Sidebar;
16623
16691
  exports.Skeleton = Skeleton;
16624
16692
  exports.Slider = Slider;
16693
+ exports.Stat = Stat;
16694
+ exports.StatBand = StatBand;
16625
16695
  exports.StickyNote = StickyNote;
16626
16696
  exports.Switch = Switch;
16627
16697
  exports.Table = Table;