@discuss-ds/ui 0.9.0 → 0.9.2

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[];
@@ -784,7 +784,7 @@ interface RatingScaleProps extends Omit<React.ComponentPropsWithoutRef<typeof To
784
784
  declare const RatingScale: React.ForwardRefExoticComponent<RatingScaleProps & React.RefAttributes<HTMLDivElement>>;
785
785
 
786
786
  interface StimulusCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
787
- /** Image shown in the 80px thumbnail. Without one the thumbnail shows `icon` on a neutral fill. */
787
+ /** Image shown in the square thumbnail (92-240px, as tall as the text). Without one the thumbnail shows `icon` on a neutral fill. */
788
788
  thumbnail?: string;
789
789
  /** Alt text for `thumbnail`. Leave empty when the caption already describes the image. */
790
790
  thumbnailAlt?: 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[];
@@ -784,7 +784,7 @@ interface RatingScaleProps extends Omit<React.ComponentPropsWithoutRef<typeof To
784
784
  declare const RatingScale: React.ForwardRefExoticComponent<RatingScaleProps & React.RefAttributes<HTMLDivElement>>;
785
785
 
786
786
  interface StimulusCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
787
- /** Image shown in the 80px thumbnail. Without one the thumbnail shows `icon` on a neutral fill. */
787
+ /** Image shown in the square thumbnail (92-240px, as tall as the text). Without one the thumbnail shows `icon` on a neutral fill. */
788
788
  thumbnail?: string;
789
789
  /** Alt text for `thumbnail`. Leave empty when the caption already describes the image. */
790
790
  thumbnailAlt?: 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
  );
@@ -3052,7 +3062,7 @@ RatingScale.displayName = "RatingScale";
3052
3062
  import * as React47 from "react";
3053
3063
  import { Image as ImageIcon2, ImageBroken, Trash as Trash5 } from "@phosphor-icons/react";
3054
3064
  import { jsx as jsx48, jsxs as jsxs34 } from "react/jsx-runtime";
3055
- var MIN_THUMBNAIL = 80;
3065
+ var MIN_THUMBNAIL = 92;
3056
3066
  var MAX_THUMBNAIL = 240;
3057
3067
  var StimulusCard = React47.forwardRef(
3058
3068
  ({
@@ -3092,7 +3102,7 @@ var StimulusCard = React47.forwardRef(
3092
3102
  {
3093
3103
  ref,
3094
3104
  "data-status": error ? "error" : "default",
3095
- className: cn("flex min-h-21.5 w-full items-center gap-4 rounded-md border border-border p-0.5 pr-4", className),
3105
+ className: cn("flex min-h-24.5 w-full items-center gap-4 rounded-md border border-border p-0.5 pr-4", className),
3096
3106
  ...props,
3097
3107
  children: [
3098
3108
  /* @__PURE__ */ jsxs34("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [