@discuss-ds/ui 0.12.0 → 0.13.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,11 @@
1
1
  # @discuss-ds/ui
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#62](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/62) [`19d61b8`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/19d61b844cb1e3d8fb7c8e4c9ffebad3ad6fb823) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - `QuestionEditorCard` and `QuestionHeader` (editor mode): new optional `meta` prop shows content right beside the "Question N" tag, for example the time allowed for the question. No change unless `meta` is passed.
8
+
3
9
  ## 0.12.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -2658,7 +2658,7 @@ var import_react19 = require("@phosphor-icons/react");
2658
2658
  var import_jsx_runtime41 = require("react/jsx-runtime");
2659
2659
  var eyebrow = "text-ui-caption uppercase text-secondary-muted-foreground";
2660
2660
  var QuestionHeader = React40.forwardRef(
2661
- ({ className, number, title, required, error, onDismissError, editor, onTitleChange, actions, maxLength = 2e3, active, showCounter = true, dragHandleProps, ...props }, ref) => {
2661
+ ({ className, number, title, required, error, onDismissError, editor, onTitleChange, actions, meta, maxLength = 2e3, active, showCounter = true, dragHandleProps, ...props }, ref) => {
2662
2662
  const [draft, setDraft] = React40.useState(null);
2663
2663
  const label = String(number).padStart(2, "0");
2664
2664
  const showError = error !== void 0 && error !== false;
@@ -2667,33 +2667,36 @@ var QuestionHeader = React40.forwardRef(
2667
2667
  const count = (draft ?? text).length;
2668
2668
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { ref, className: cn("group/header flex w-full flex-col gap-2", className), ...props, children: [
2669
2669
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center justify-between", children: [
2670
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
2671
- "span",
2672
- {
2673
- "aria-label": dragHandleProps ? `Reorder question ${number}` : void 0,
2674
- ...dragHandleProps,
2675
- className: cn(
2676
- "group/handle inline-flex h-6 items-center gap-1 rounded-sm px-2.5 text-ui-caption hover:pl-1",
2677
- // Inside a QuestionEditorCard the tag takes its hover look whenever the card is hovered.
2678
- "group-hover/editor:pl-1",
2679
- 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",
2680
- dragHandleProps && "cursor-grab touch-none select-none focus-visible:pl-1",
2681
- dragHandleProps?.className
2682
- ),
2683
- children: [
2684
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2685
- import_react19.DotsSixVertical,
2686
- {
2687
- size: 16,
2688
- "aria-hidden": true,
2689
- className: "hidden shrink-0 group-hover/editor:block group-hover/handle:block group-focus-visible/handle:block"
2690
- }
2670
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
2671
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
2672
+ "span",
2673
+ {
2674
+ "aria-label": dragHandleProps ? `Reorder question ${number}` : void 0,
2675
+ ...dragHandleProps,
2676
+ className: cn(
2677
+ "group/handle inline-flex h-6 items-center gap-1 rounded-sm px-2.5 text-ui-caption hover:pl-1",
2678
+ // Inside a QuestionEditorCard the tag takes its hover look whenever the card is hovered.
2679
+ "group-hover/editor:pl-1",
2680
+ 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",
2681
+ dragHandleProps && "cursor-grab touch-none select-none focus-visible:pl-1",
2682
+ dragHandleProps?.className
2691
2683
  ),
2692
- "Question ",
2693
- number
2694
- ]
2695
- }
2696
- ),
2684
+ children: [
2685
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2686
+ import_react19.DotsSixVertical,
2687
+ {
2688
+ size: 16,
2689
+ "aria-hidden": true,
2690
+ className: "hidden shrink-0 group-hover/editor:block group-hover/handle:block group-focus-visible/handle:block"
2691
+ }
2692
+ ),
2693
+ "Question ",
2694
+ number
2695
+ ]
2696
+ }
2697
+ ),
2698
+ meta
2699
+ ] }),
2697
2700
  actions && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: cn(
2698
2701
  "flex items-center gap-2 opacity-0 transition-opacity group-focus-within/header:opacity-100 group-hover/header:opacity-100",
2699
2702
  // Inside a QuestionEditorCard, hovering or focusing anywhere on the card reveals them too.
@@ -2763,6 +2766,7 @@ var QuestionEditorCard = React41.forwardRef(
2763
2766
  onPaste,
2764
2767
  note,
2765
2768
  error,
2769
+ meta,
2766
2770
  dragHandleProps,
2767
2771
  children,
2768
2772
  ...props
@@ -2795,6 +2799,7 @@ var QuestionEditorCard = React41.forwardRef(
2795
2799
  active,
2796
2800
  showCounter: !!active,
2797
2801
  dragHandleProps,
2802
+ meta,
2798
2803
  maxLength,
2799
2804
  actions: actions ?? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
2800
2805
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(