@discuss-ds/ui 0.4.1 → 0.5.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.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#27](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/27) [`1a4ff8c`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/1a4ff8c0c8b485a7edaf27bd0d327a9005f902e7) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - `QuestionHeader` and `QuestionEditorCard` get an optional `dragHandleProps` that turns the "Question N" tag into a drag handle. It is spread onto the tag, so it accepts what a drag-and-drop library provides (`ref`, `role`, `tabIndex`, pointer and keyboard listeners, aria attributes). With it the tag shows a grab cursor, is keyboard focusable, shows the grip icon on focus and is labelled "Reorder question N". Without it nothing changes.
8
+
9
+ `ActivityStructure`: the card corner radius is now 16px (was 24px) to match the question cards, and the title uses the primary foreground colour.
10
+
11
+ ## 0.4.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [#25](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/25) [`457bb65`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/457bb65f54ca262e0338b0b271b5535926bb7b66) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - `ActivityStructure`: the summary card no longer has a border (it keeps its white surface and rounded corners).
16
+
3
17
  ## 0.4.1
4
18
 
5
19
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -2649,7 +2649,7 @@ var import_react19 = require("@phosphor-icons/react");
2649
2649
  var import_jsx_runtime41 = require("react/jsx-runtime");
2650
2650
  var eyebrow = "text-ui-caption uppercase text-secondary-muted-foreground";
2651
2651
  var QuestionHeader = React40.forwardRef(
2652
- ({ className, number, title, required, error, onDismissError, editor, onTitleChange, actions, maxLength = 2e3, active, showCounter = true, ...props }, ref) => {
2652
+ ({ className, number, title, required, error, onDismissError, editor, onTitleChange, actions, maxLength = 2e3, active, showCounter = true, dragHandleProps, ...props }, ref) => {
2653
2653
  const [draft, setDraft] = React40.useState(null);
2654
2654
  const label = String(number).padStart(2, "0");
2655
2655
  const showError = error !== void 0 && error !== false;
@@ -2661,12 +2661,23 @@ var QuestionHeader = React40.forwardRef(
2661
2661
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
2662
2662
  "span",
2663
2663
  {
2664
+ "aria-label": dragHandleProps ? `Reorder question ${number}` : void 0,
2665
+ ...dragHandleProps,
2664
2666
  className: cn(
2665
2667
  "group/handle inline-flex h-6 items-center gap-1 rounded-sm px-2.5 text-ui-caption hover:pl-1",
2666
- active ? "bg-accent-soft text-accent-soft-foreground" : "bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground"
2668
+ active ? "bg-accent-soft text-accent-soft-foreground" : "bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5 text-surface-foreground",
2669
+ dragHandleProps && "cursor-grab touch-none select-none focus-visible:pl-1",
2670
+ dragHandleProps?.className
2667
2671
  ),
2668
2672
  children: [
2669
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react19.DotsSixVertical, { size: 16, "aria-hidden": true, className: "hidden shrink-0 group-hover/handle:block" }),
2673
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2674
+ import_react19.DotsSixVertical,
2675
+ {
2676
+ size: 16,
2677
+ "aria-hidden": true,
2678
+ className: "hidden shrink-0 group-hover/handle:block group-focus-visible/handle:block"
2679
+ }
2680
+ ),
2670
2681
  "Question ",
2671
2682
  number
2672
2683
  ]
@@ -2736,6 +2747,7 @@ var QuestionEditorCard = React41.forwardRef(
2736
2747
  onAdd,
2737
2748
  onPaste,
2738
2749
  note,
2750
+ dragHandleProps,
2739
2751
  children,
2740
2752
  ...props
2741
2753
  }, ref) => {
@@ -2766,6 +2778,7 @@ var QuestionEditorCard = React41.forwardRef(
2766
2778
  onTitleChange,
2767
2779
  active,
2768
2780
  showCounter: !!active,
2781
+ dragHandleProps,
2769
2782
  maxLength,
2770
2783
  actions: actions ?? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
2771
2784
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
@@ -3398,10 +3411,10 @@ var ActivityStructure = React51.forwardRef(
3398
3411
  "section",
3399
3412
  {
3400
3413
  ref,
3401
- className: cn("flex w-full max-w-96.5 flex-col gap-4 rounded-2xl border border-border bg-surface p-4", className),
3414
+ className: cn("flex w-full max-w-96.5 flex-col gap-4 rounded-xl bg-surface p-4", className),
3402
3415
  ...props,
3403
3416
  children: [
3404
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h3", { className: "text-heading-h3 text-surface-foreground", children: title }),
3417
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h3", { className: "text-heading-h3 text-primary", children: title }),
3405
3418
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "grid grid-cols-2 gap-3", children: stats.map(({ id, ...stat }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StatCard, { ...stat }, id)) }),
3406
3419
  sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex flex-col gap-2", children: [
3407
3420
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h4", { className: "text-heading-h4 text-surface-foreground", children: heading }),