@particle-academy/react-fancy 5.1.0 → 5.3.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
@@ -6224,7 +6224,20 @@ var sizeClasses3 = {
6224
6224
  md: "text-base",
6225
6225
  lg: "text-lg",
6226
6226
  xl: "text-2xl",
6227
- "2xl": "text-4xl"
6227
+ "2xl": "text-4xl",
6228
+ // Display steps. Each is the next Tailwind size up, continuing the ramp.
6229
+ "3xl": "text-5xl",
6230
+ "4xl": "text-6xl",
6231
+ "5xl": "text-7xl",
6232
+ "6xl": "text-8xl",
6233
+ "7xl": "text-9xl"
6234
+ };
6235
+ var trackingClasses = {
6236
+ "3xl": "tracking-tight",
6237
+ "4xl": "tracking-tight",
6238
+ "5xl": "tracking-tighter",
6239
+ "6xl": "tracking-tighter",
6240
+ "7xl": "tracking-tighter"
6228
6241
  };
6229
6242
  var weightClasses = {
6230
6243
  normal: "font-normal",
@@ -6249,6 +6262,7 @@ var Heading = react.forwardRef(
6249
6262
  className: cn(
6250
6263
  "text-zinc-900 dark:text-zinc-100",
6251
6264
  sizeClasses3[size],
6265
+ trackingClasses[size],
6252
6266
  weightClasses[weight],
6253
6267
  className
6254
6268
  ),
@@ -7028,6 +7042,66 @@ var CardFooter = react.forwardRef(
7028
7042
  }
7029
7043
  );
7030
7044
  CardFooter.displayName = "CardFooter";
7045
+ var CardMedia = react.forwardRef(
7046
+ ({
7047
+ src,
7048
+ alt = "",
7049
+ ratio = "16/9",
7050
+ height,
7051
+ background,
7052
+ objectPosition = "center",
7053
+ loading = "lazy",
7054
+ topLeft,
7055
+ topRight,
7056
+ bottomLeft,
7057
+ bottomRight,
7058
+ className,
7059
+ style,
7060
+ children,
7061
+ ...props
7062
+ }, ref) => {
7063
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7064
+ "div",
7065
+ {
7066
+ ref,
7067
+ "data-react-fancy-card-media": "",
7068
+ className: cn(
7069
+ "relative overflow-hidden rounded-t-lg",
7070
+ // Card's `padding` prop pads EVERY direct div child
7071
+ // (`[&>div]:px-4 …`), which would inset the media and break the
7072
+ // flush-to-the-edge look every caller wants. `!` wins regardless of
7073
+ // stylesheet order, which plain `p-0` would not.
7074
+ "!px-0 !py-0",
7075
+ className
7076
+ ),
7077
+ style: {
7078
+ ...height === void 0 ? { aspectRatio: ratio } : { height },
7079
+ ...background ? { background } : null,
7080
+ ...style
7081
+ },
7082
+ ...props,
7083
+ children: [
7084
+ src ? /* @__PURE__ */ jsxRuntime.jsx(
7085
+ "img",
7086
+ {
7087
+ src,
7088
+ alt,
7089
+ loading,
7090
+ className: "absolute inset-0 h-full w-full object-cover",
7091
+ style: { objectPosition }
7092
+ }
7093
+ ) : null,
7094
+ children,
7095
+ topLeft ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 top-2 z-10", children: topLeft }) : null,
7096
+ topRight ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-2 top-2 z-10", children: topRight }) : null,
7097
+ bottomLeft ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute bottom-2 left-2 z-10", children: bottomLeft }) : null,
7098
+ bottomRight ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute bottom-2 right-2 z-10", children: bottomRight }) : null
7099
+ ]
7100
+ }
7101
+ );
7102
+ }
7103
+ );
7104
+ CardMedia.displayName = "CardMedia";
7031
7105
  var variantClasses = {
7032
7106
  outlined: "border border-zinc-200 dark:border-zinc-700",
7033
7107
  elevated: "shadow-md border border-zinc-100 dark:border-zinc-800",
@@ -7043,6 +7117,7 @@ var CardRoot = react.forwardRef(
7043
7117
  ({
7044
7118
  variant = "outlined",
7045
7119
  padding = "md",
7120
+ interactive = false,
7046
7121
  className,
7047
7122
  children,
7048
7123
  ...props
@@ -7055,6 +7130,10 @@ var CardRoot = react.forwardRef(
7055
7130
  className: cn(
7056
7131
  "rounded-lg bg-white dark:bg-zinc-900",
7057
7132
  variantClasses[variant],
7133
+ // `overflow-hidden` is part of `interactive` rather than always-on:
7134
+ // clipping unconditionally would cut off popovers and dropdowns that
7135
+ // legitimately overflow a static card.
7136
+ interactive && "overflow-hidden transition hover:-translate-y-0.5 hover:shadow-lg hover:border-zinc-300 dark:hover:border-zinc-600",
7058
7137
  paddingClasses[padding],
7059
7138
  className
7060
7139
  ),
@@ -7066,6 +7145,7 @@ var CardRoot = react.forwardRef(
7066
7145
  );
7067
7146
  CardRoot.displayName = "Card";
7068
7147
  var Card = Object.assign(CardRoot, {
7148
+ Media: CardMedia,
7069
7149
  Header: CardHeader,
7070
7150
  Body: CardBody,
7071
7151
  Footer: CardFooter