@lukeashford/aurelius 2.6.0 → 2.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.
package/dist/index.mjs CHANGED
@@ -2,8 +2,10 @@
2
2
  import React from "react";
3
3
 
4
4
  // src/utils/cx.ts
5
- function cx(...classes) {
6
- return classes.filter(Boolean).join(" ");
5
+ import { twMerge } from "tailwind-merge";
6
+ import { clsx } from "clsx";
7
+ function cx(...inputs) {
8
+ return twMerge(clsx(inputs));
7
9
  }
8
10
 
9
11
  // src/components/Button.tsx
@@ -76,6 +78,7 @@ Input.displayName = "Input";
76
78
 
77
79
  // src/components/Card.tsx
78
80
  import React3 from "react";
81
+ import ReactPlayer from "react-player";
79
82
  import { Check } from "lucide-react";
80
83
  var VARIANT_STYLES = {
81
84
  default: "bg-charcoal shadow-sm border border-gold/30",
@@ -109,7 +112,13 @@ var CardBase = React3.forwardRef(
109
112
  ...props
110
113
  },
111
114
  children,
112
- selected && /* @__PURE__ */ React3.createElement("div", { className: "absolute top-3 right-3 flex items-center justify-center h-6 w-6 rounded-full bg-gold text-obsidian" }, /* @__PURE__ */ React3.createElement(Check, { className: "h-4 w-4" }))
115
+ selected && /* @__PURE__ */ React3.createElement(
116
+ "div",
117
+ {
118
+ className: "absolute top-3 right-3 flex items-center justify-center h-6 w-6 rounded-full bg-gold text-obsidian"
119
+ },
120
+ /* @__PURE__ */ React3.createElement(Check, { className: "h-4 w-4" })
121
+ )
113
122
  );
114
123
  }
115
124
  );
@@ -159,7 +168,16 @@ var CardFooter = React3.forwardRef(
159
168
  );
160
169
  CardFooter.displayName = "CardFooter";
161
170
  var CardMedia = React3.forwardRef(
162
- ({ src, alt = "", aspect = "video", position = "top", className, children, ...props }, ref) => {
171
+ ({
172
+ src,
173
+ alt = "",
174
+ aspect = "video",
175
+ position = "top",
176
+ isVideo = false,
177
+ className,
178
+ children,
179
+ ...props
180
+ }, ref) => {
163
181
  const aspectClass = {
164
182
  video: "aspect-video",
165
183
  square: "aspect-square",
@@ -170,7 +188,7 @@ var CardMedia = React3.forwardRef(
170
188
  {
171
189
  ref,
172
190
  className: cx(
173
- "overflow-hidden",
191
+ "overflow-hidden relative",
174
192
  aspectClass,
175
193
  position === "top" && "border-b border-ash",
176
194
  position === "bottom" && "border-t border-ash",
@@ -178,7 +196,16 @@ var CardMedia = React3.forwardRef(
178
196
  ),
179
197
  ...props
180
198
  },
181
- src ? /* @__PURE__ */ React3.createElement("img", { src, alt, className: "w-full h-full object-cover" }) : children
199
+ src ? isVideo ? /* @__PURE__ */ React3.createElement(
200
+ ReactPlayer,
201
+ {
202
+ src,
203
+ width: "100%",
204
+ height: "100%",
205
+ className: "absolute top-0 left-0",
206
+ controls: true
207
+ }
208
+ ) : /* @__PURE__ */ React3.createElement("img", { src, alt, className: "w-full h-full object-cover" }) : children
182
209
  );
183
210
  }
184
211
  );
@@ -3300,21 +3327,91 @@ var ImageCard = React45.forwardRef(
3300
3327
  },
3301
3328
  overlay
3302
3329
  )
3303
- ), (title || subtitle || children) && /* @__PURE__ */ React45.createElement("div", { className: cx("px-4 pt-4", contentClassName) }, title && /* @__PURE__ */ React45.createElement("h4", { className: "text-lg font-semibold leading-tight" }, title), subtitle && /* @__PURE__ */ React45.createElement("p", { className: "text-sm text-silver leading-normal" }, subtitle), children));
3330
+ ), (title || subtitle || children) && /* @__PURE__ */ React45.createElement("div", { className: cx("px-4 py-4", contentClassName) }, title && /* @__PURE__ */ React45.createElement("h4", { className: "text-lg font-semibold leading-tight" }, title), subtitle && /* @__PURE__ */ React45.createElement("p", { className: "text-sm text-silver leading-normal" }, subtitle), children));
3304
3331
  }
3305
3332
  );
3306
3333
  ImageCard.displayName = "ImageCard";
3307
3334
 
3308
- // src/components/SectionHeading.tsx
3335
+ // src/components/VideoCard.tsx
3309
3336
  import React46 from "react";
3337
+ import ReactPlayer2 from "react-player";
3338
+ var ASPECT_RATIO_PRESETS2 = {
3339
+ video: "16 / 9",
3340
+ cinema: "21 / 9",
3341
+ square: "1 / 1"
3342
+ };
3343
+ function resolveAspectRatio2(ratio) {
3344
+ if (ratio in ASPECT_RATIO_PRESETS2) {
3345
+ return ASPECT_RATIO_PRESETS2[ratio];
3346
+ }
3347
+ return ratio.replace("/", " / ");
3348
+ }
3349
+ var VideoCard = React46.forwardRef(
3350
+ ({
3351
+ src,
3352
+ title,
3353
+ subtitle,
3354
+ aspectRatio = "video",
3355
+ playing = false,
3356
+ controls = true,
3357
+ light = false,
3358
+ volume,
3359
+ muted = false,
3360
+ loop = false,
3361
+ mediaClassName,
3362
+ contentClassName,
3363
+ className,
3364
+ children,
3365
+ playerProps,
3366
+ ...props
3367
+ }, ref) => {
3368
+ const hasAspectRatio = aspectRatio !== void 0;
3369
+ return /* @__PURE__ */ React46.createElement(Card, { ref, className: cx("p-0 overflow-hidden group w-full", className), ...props }, /* @__PURE__ */ React46.createElement(
3370
+ "div",
3371
+ {
3372
+ className: cx(
3373
+ "relative bg-black overflow-hidden",
3374
+ mediaClassName
3375
+ ),
3376
+ style: { aspectRatio: resolveAspectRatio2(aspectRatio) }
3377
+ },
3378
+ /* @__PURE__ */ React46.createElement(
3379
+ ReactPlayer2,
3380
+ {
3381
+ src,
3382
+ playing,
3383
+ controls,
3384
+ light,
3385
+ volume,
3386
+ muted,
3387
+ loop,
3388
+ width: "100%",
3389
+ height: "100%",
3390
+ className: "absolute top-0 left-0",
3391
+ ...playerProps
3392
+ }
3393
+ )
3394
+ ), (title || subtitle || children) && /* @__PURE__ */ React46.createElement("div", { className: cx("px-4 py-4", contentClassName) }, title && /* @__PURE__ */ React46.createElement("h4", { className: "text-lg font-semibold leading-tight" }, title), subtitle && /* @__PURE__ */ React46.createElement(
3395
+ "p",
3396
+ {
3397
+ className: "text-sm text-silver leading-normal mt-1"
3398
+ },
3399
+ subtitle
3400
+ ), children));
3401
+ }
3402
+ );
3403
+ VideoCard.displayName = "VideoCard";
3404
+
3405
+ // src/components/SectionHeading.tsx
3406
+ import React47 from "react";
3310
3407
  var levelStyles = {
3311
3408
  h2: "text-2xl mb-4",
3312
3409
  h3: "text-xl mb-3"
3313
3410
  };
3314
- var SectionHeading = React46.forwardRef(
3411
+ var SectionHeading = React47.forwardRef(
3315
3412
  ({ level = "h2", children, className, ...rest }, ref) => {
3316
3413
  const Component = level;
3317
- return /* @__PURE__ */ React46.createElement(
3414
+ return /* @__PURE__ */ React47.createElement(
3318
3415
  Component,
3319
3416
  {
3320
3417
  ref,
@@ -3415,6 +3512,7 @@ export {
3415
3512
  Textarea,
3416
3513
  ToastProvider,
3417
3514
  Tooltip,
3515
+ VideoCard,
3418
3516
  useToast,
3419
3517
  version
3420
3518
  };