@discuss-ds/ui 0.25.0 → 0.27.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,17 @@
1
1
  # @discuss-ds/ui
2
2
 
3
+ ## 0.27.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#98](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/98) [`9c29e17`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/9c29e17ecae358617451931fd003d6406c894c74) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - `QuestionOptionEditor` takes optional `removeDisabled` and `addDisabled` props that disable its trash and add (+) buttons, for example at a question's minimum or maximum number of options. Without them nothing changes.
8
+
9
+ ## 0.26.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#96](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/96) [`b7cb516`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/b7cb516418206054de5f26c4c10d2fb3e7e9edb5) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - `ToastInline` takes an optional `actions` slot (for example a ghost "Dismiss" and an outline "Fix" `Button size="sm"`) shown after the message, and a new quiet `variant="neutral"` (secondary background, standard border) for suggestions. Existing variants and the `onClose` button are unchanged.
14
+
3
15
  ## 0.25.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -2260,6 +2260,18 @@ var toastVariants = (0, import_class_variance_authority4.cva)("border", {
2260
2260
  },
2261
2261
  defaultVariants: { variant: "info" }
2262
2262
  });
2263
+ var inlineVariants = (0, import_class_variance_authority4.cva)("border", {
2264
+ variants: {
2265
+ variant: {
2266
+ neutral: "border-border bg-secondary",
2267
+ info: "border-info-border bg-surface",
2268
+ success: "border-success-soft-border bg-success-soft",
2269
+ warning: "border-warning-soft-border bg-warning-soft",
2270
+ destructive: "border-destructive-soft-border bg-destructive-soft"
2271
+ }
2272
+ },
2273
+ defaultVariants: { variant: "info" }
2274
+ });
2263
2275
  var iconColour = {
2264
2276
  info: "text-surface-foreground",
2265
2277
  success: "text-success-soft-foreground",
@@ -2324,18 +2336,19 @@ var Toast = React33.forwardRef(
2324
2336
  Toast.displayName = "Toast";
2325
2337
  var ToastAction = import_radix_ui17.Toast.Action;
2326
2338
  var ToastInline = React33.forwardRef(
2327
- ({ className, variant = "info", onClose, closeLabel = "Close", children, ...props }, ref) => {
2339
+ ({ className, variant = "info", actions, onClose, closeLabel = "Close", children, ...props }, ref) => {
2328
2340
  const v = variant ?? "info";
2329
2341
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2330
2342
  "div",
2331
2343
  {
2332
2344
  ref,
2333
2345
  role: v === "destructive" ? "alert" : "status",
2334
- className: cn("flex items-center gap-2 rounded-sm px-2 py-1.5", toastVariants({ variant: v }), className),
2346
+ className: cn("flex items-center gap-2 rounded-sm px-2 py-1.5", inlineVariants({ variant: v }), className),
2335
2347
  ...props,
2336
2348
  children: [
2337
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(VariantIcon, { variant: v, size: 16 }),
2349
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(VariantIcon, { variant: v === "neutral" ? "info" : v, size: 16 }),
2338
2350
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "min-w-0 flex-1 text-body-small text-secondary-muted-foreground", children }),
2351
+ actions && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions }),
2339
2352
  onClose && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react16.X, { size: 16, "aria-hidden": true }) })
2340
2353
  ]
2341
2354
  }
@@ -3155,7 +3168,7 @@ var QuestionOtherOption = React44.forwardRef(
3155
3168
  }
3156
3169
  );
3157
3170
  QuestionOtherOption.displayName = "QuestionOtherOption";
3158
- function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className, kind, rank, dragHandleProps, lifted, locked }) {
3171
+ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked }) {
3159
3172
  const reveal = kind !== void 0;
3160
3173
  const gripProps = dragHandleProps ? {
3161
3174
  "aria-label": rank ? `Reorder option ${rank}` : "Reorder option",
@@ -3229,8 +3242,8 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
3229
3242
  reveal && "opacity-0 transition-opacity group-hover/option:opacity-100 group-focus-within/option:opacity-100"
3230
3243
  ),
3231
3244
  children: [
3232
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": "Remove option", onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Trash, { size: 16, "aria-hidden": true }) }),
3233
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": "Add option", onClick: onAdd, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Plus, { size: 16, "aria-hidden": true }) })
3245
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Button, { type: "button", variant: "destructive", size: "icon-sm", "aria-label": "Remove option", disabled: removeDisabled, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Trash, { size: 16, "aria-hidden": true }) }),
3246
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": "Add option", disabled: addDisabled, onClick: onAdd, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Plus, { size: 16, "aria-hidden": true }) })
3234
3247
  ]
3235
3248
  }
3236
3249
  )