@discuss-ds/ui 0.31.0 → 0.32.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @discuss-ds/ui
2
2
 
3
+ ## 0.32.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#119](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/119) [`15ebfed`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/15ebfed6c3ae07ffc4dd35477b21db154178b082) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - `StatCard` takes an optional `caption`: small muted text under the value that says what it refers to or breaks it down, such as "11 open-ended · 5 closed-ended". Without it the card is unchanged.
8
+
9
+ - [#120](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/120) [`019b943`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/019b94332ddcb818d0116aa87ce6d060991a2fdc) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - `ToastInline` takes an optional `actionsPlacement`: `"end"` (default, unchanged) keeps the actions after the message on the same line, `"bottom"` puts them under the message, for messages long enough to wrap.
10
+
11
+ - [#116](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/116) [`d197db4`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/d197db4524765401c77d60f54d20da020dcc8678) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - Question types now include `upload-video`, `upload-photo` and `upload-document`, each with its own icon (a video, an image, a document file) in `QuestionTypeIcon`, `QuestionNavItem` and `QuestionEditorCard`/`QuestionHeader` (the `questionType` prop). The generic `upload` type and its icon are unchanged, so nothing existing needs to change.
12
+
13
+ ### Patch Changes
14
+
15
+ - [#118](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/118) [`9aacac2`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/9aacac2c16147e393c89cc7c4ea696dc092b2c40) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - The `upload-video` question type now uses the video camera icon (Phosphor `VideoCamera`, the same glyph as `screen-recording`) and `upload-document` the file-with-text icon (Phosphor `FileText`), in `QuestionTypeIcon`, `QuestionNavItem` and `QuestionEditorCard`/`QuestionHeader`. `upload-photo` keeps the image icon.
16
+
3
17
  ## 0.31.0
4
18
 
5
19
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -2462,19 +2462,25 @@ var Toast = React34.forwardRef(
2462
2462
  Toast.displayName = "Toast";
2463
2463
  var ToastAction = import_radix_ui18.Toast.Action;
2464
2464
  var ToastInline = React34.forwardRef(
2465
- ({ className, variant = "info", actions, onClose, closeLabel = "Close", children, ...props }, ref) => {
2465
+ ({ className, variant = "info", actions, actionsPlacement = "end", onClose, closeLabel = "Close", children, ...props }, ref) => {
2466
2466
  const v = variant ?? "info";
2467
+ const below = actionsPlacement === "bottom" && !!actions;
2467
2468
  return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
2468
2469
  "div",
2469
2470
  {
2470
2471
  ref,
2471
2472
  role: v === "destructive" ? "alert" : "status",
2472
- className: cn("flex items-center gap-2 rounded-sm px-2 py-1.5", inlineVariants({ variant: v }), className),
2473
+ className: cn("flex gap-2 rounded-sm px-2 py-1.5", below ? "items-start" : "items-center", inlineVariants({ variant: v }), className),
2473
2474
  ...props,
2474
2475
  children: [
2475
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(VariantIcon, { variant: v === "neutral" ? "info" : v, size: 16 }),
2476
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "min-w-0 flex-1 text-body-small text-secondary-muted-foreground", children }),
2477
- actions && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions }),
2476
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: cn("inline-flex shrink-0", below && "mt-0.5"), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(VariantIcon, { variant: v === "neutral" ? "info" : v, size: 16 }) }),
2477
+ below ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
2478
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-body-small text-secondary-muted-foreground", children }),
2479
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center gap-2", children: actions })
2480
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
2481
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "min-w-0 flex-1 text-body-small text-secondary-muted-foreground", children }),
2482
+ actions && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
2483
+ ] }),
2478
2484
  onClose && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react17.X, { size: 16, "aria-hidden": true }) })
2479
2485
  ]
2480
2486
  }
@@ -2950,6 +2956,9 @@ var icons = {
2950
2956
  "select-multiple": import_react20.CheckSquare,
2951
2957
  ranking: import_react20.ListNumbers,
2952
2958
  upload: import_react20.FileArrowUp,
2959
+ "upload-video": import_react20.VideoCamera,
2960
+ "upload-photo": import_react20.Image,
2961
+ "upload-document": import_react20.FileText,
2953
2962
  rating: import_react20.StarHalf,
2954
2963
  "open-end": import_react20.ChatsCircle,
2955
2964
  "screen-recording": import_react20.VideoCamera
@@ -3915,12 +3924,13 @@ var statCardVariants = (0, import_class_variance_authority6.cva)("flex min-w-0 f
3915
3924
  defaultVariants: { variant: "default" }
3916
3925
  });
3917
3926
  var StatCard = React51.forwardRef(
3918
- ({ className, variant, label, value, icon, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { ref, className: cn(statCardVariants({ variant }), className), ...props, children: [
3927
+ ({ className, variant, label, value, icon, caption, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { ref, className: cn(statCardVariants({ variant }), className), ...props, children: [
3919
3928
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "truncate text-ui-caption text-secondary-muted-foreground", children: label }),
3920
3929
  /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("p", { className: "flex items-center gap-2 text-body-base text-surface-foreground", children: [
3921
3930
  icon && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { "aria-hidden": "true", className: "inline-flex size-6 shrink-0 items-center justify-center", children: icon }),
3922
3931
  value
3923
- ] })
3932
+ ] }),
3933
+ caption && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-ui-caption text-secondary-muted-foreground", children: caption })
3924
3934
  ] })
3925
3935
  );
3926
3936
  StatCard.displayName = "StatCard";