@discuss-ds/ui 0.9.0 → 0.9.1

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.d.cts CHANGED
@@ -586,7 +586,7 @@ interface MediaInfoProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'tit
586
586
  }
587
587
  declare function MediaInfo({ name, details, onRemove, removeLabel, large, className, ...props }: MediaInfoProps): React.JSX.Element;
588
588
  interface ImagePreviewProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
589
- /** The image (an `<img>` filling the area). Leave empty for the placeholder fill. */
589
+ /** The image (an `<img>`). The preview area is as tall as the image at full width, up to 336px. Leave empty for the fixed-height placeholder fill. */
590
590
  children?: React.ReactNode;
591
591
  name: string;
592
592
  details?: string[];
package/dist/index.d.ts CHANGED
@@ -586,7 +586,7 @@ interface MediaInfoProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'tit
586
586
  }
587
587
  declare function MediaInfo({ name, details, onRemove, removeLabel, large, className, ...props }: MediaInfoProps): React.JSX.Element;
588
588
  interface ImagePreviewProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
589
- /** The image (an `<img>` filling the area). Leave empty for the placeholder fill. */
589
+ /** The image (an `<img>`). The preview area is as tall as the image at full width, up to 336px. Leave empty for the fixed-height placeholder fill. */
590
590
  children?: React.ReactNode;
591
591
  name: string;
592
592
  details?: string[];
package/dist/index.js CHANGED
@@ -2249,7 +2249,17 @@ function MediaInfo({ name, details, onRemove, removeLabel, large, className, ...
2249
2249
  }
2250
2250
  var ImagePreview = React37.forwardRef(
2251
2251
  ({ className, children, name, details, onRemove, ...props }, ref) => /* @__PURE__ */ jsxs27("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border", className), ...props, children: [
2252
- /* @__PURE__ */ jsx38("div", { className: "flex h-84 w-full items-center justify-center bg-accent-soft [&>img]:size-full [&>img]:object-contain", children }),
2252
+ /* @__PURE__ */ jsx38(
2253
+ "div",
2254
+ {
2255
+ className: cn(
2256
+ "flex w-full items-center justify-center bg-accent-soft",
2257
+ // With an image the area hugs it (full width, its own height, at most 336px tall); the empty placeholder keeps the fixed height.
2258
+ children ? "[&>img]:block [&>img]:h-auto [&>img]:max-h-84 [&>img]:w-full [&>img]:object-contain" : "h-84"
2259
+ ),
2260
+ children
2261
+ }
2262
+ ),
2253
2263
  /* @__PURE__ */ jsx38(MediaInfo, { name, details, onRemove, large: true })
2254
2264
  ] })
2255
2265
  );