@discuss-ds/ui 0.22.0 → 0.24.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 +12 -0
- package/dist/index.cjs +15 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +15 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @discuss-ds/ui
|
|
2
2
|
|
|
3
|
+
## 0.24.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#90](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/90) [`e939c7a`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/e939c7a960bbb9a18ef12cf1775004b63ccdc533) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - `StatCard`: new `success` (green) and `destructive` (red) variants next to `warning`, for stats that report a good or bad state, such as an issue count. Existing variants are unchanged.
|
|
8
|
+
|
|
9
|
+
## 0.23.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#88](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/88) [`cfc8630`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/cfc86301c4dec947b5201d340e681292a4155dac) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - `QuestionNavItem` and `QuestionEditorCard`: new optional `hovered` prop that shows the hover look without the pointer (the nav row's soft fill and drag grip; the card's lift, revealed actions and grip), for mirroring a hover that happens elsewhere, such as over the same question's row or card. Off by default; nothing changes unless it is set.
|
|
14
|
+
|
|
3
15
|
## 0.22.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -2758,7 +2758,7 @@ var QuestionHeader = React40.forwardRef(
|
|
|
2758
2758
|
className: cn(
|
|
2759
2759
|
"group/handle inline-flex h-6 items-center gap-1 rounded-sm px-2.5 text-ui-caption",
|
|
2760
2760
|
// The tag makes room for the grip on hover, and inside a QuestionEditorCard whenever the card is hovered.
|
|
2761
|
-
showDragHandle && "hover:pl-1 group-hover/editor:pl-1",
|
|
2761
|
+
showDragHandle && "hover:pl-1 group-hover/editor:pl-1 group-data-[hovered]/editor:pl-1",
|
|
2762
2762
|
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",
|
|
2763
2763
|
dragHandleProps && "cursor-grab touch-none select-none",
|
|
2764
2764
|
dragHandleProps && showDragHandle && "focus-visible:pl-1",
|
|
@@ -2770,7 +2770,7 @@ var QuestionHeader = React40.forwardRef(
|
|
|
2770
2770
|
{
|
|
2771
2771
|
size: 16,
|
|
2772
2772
|
"aria-hidden": true,
|
|
2773
|
-
className: "hidden shrink-0 group-hover/editor:block group-hover/handle:block group-focus-visible/handle:block"
|
|
2773
|
+
className: "hidden shrink-0 group-hover/editor:block group-data-[hovered]/editor:block group-hover/handle:block group-focus-visible/handle:block"
|
|
2774
2774
|
}
|
|
2775
2775
|
),
|
|
2776
2776
|
"Question ",
|
|
@@ -2783,7 +2783,7 @@ var QuestionHeader = React40.forwardRef(
|
|
|
2783
2783
|
actions && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: cn(
|
|
2784
2784
|
"flex items-center gap-2 opacity-0 transition-opacity group-focus-within/header:opacity-100 group-hover/header:opacity-100",
|
|
2785
2785
|
// Inside a QuestionEditorCard, hovering or focusing anywhere on the card reveals them too.
|
|
2786
|
-
"group-focus-within/editor:opacity-100 group-hover/editor:opacity-100"
|
|
2786
|
+
"group-focus-within/editor:opacity-100 group-hover/editor:opacity-100 group-data-[hovered]/editor:opacity-100"
|
|
2787
2787
|
), children: actions })
|
|
2788
2788
|
] }),
|
|
2789
2789
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
@@ -2838,6 +2838,7 @@ var QuestionEditorCard = React41.forwardRef(
|
|
|
2838
2838
|
title,
|
|
2839
2839
|
onTitleChange,
|
|
2840
2840
|
active,
|
|
2841
|
+
hovered,
|
|
2841
2842
|
maxLength,
|
|
2842
2843
|
countLabel,
|
|
2843
2844
|
actions,
|
|
@@ -2861,13 +2862,14 @@ var QuestionEditorCard = React41.forwardRef(
|
|
|
2861
2862
|
{
|
|
2862
2863
|
ref,
|
|
2863
2864
|
className: cn("group/editor flex w-full items-start gap-2", className),
|
|
2865
|
+
"data-hovered": hovered ? "" : void 0,
|
|
2864
2866
|
...props,
|
|
2865
2867
|
children: [
|
|
2866
2868
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
2867
2869
|
"div",
|
|
2868
2870
|
{
|
|
2869
2871
|
className: cn(
|
|
2870
|
-
"flex w-full max-w-200 flex-col overflow-hidden rounded-xl border bg-surface transition-shadow group-hover/editor:shadow-lg group-focus-within/editor:shadow-lg",
|
|
2872
|
+
"flex w-full max-w-200 flex-col overflow-hidden rounded-xl border bg-surface transition-shadow group-hover/editor:shadow-lg group-focus-within/editor:shadow-lg group-data-[hovered]/editor:shadow-lg",
|
|
2871
2873
|
active ? "border-accent" : "border-border"
|
|
2872
2874
|
),
|
|
2873
2875
|
children: [
|
|
@@ -2962,7 +2964,7 @@ var QuestionEditorCard = React41.forwardRef(
|
|
|
2962
2964
|
size: "icon-sm",
|
|
2963
2965
|
"aria-label": "Ask AI",
|
|
2964
2966
|
onClick: onAskAi,
|
|
2965
|
-
className: "shrink-0 opacity-0 transition-opacity group-hover/editor:opacity-100 group-focus-within/editor:opacity-100 focus-visible:opacity-100",
|
|
2967
|
+
className: "shrink-0 opacity-0 transition-opacity group-hover/editor:opacity-100 group-focus-within/editor:opacity-100 group-data-[hovered]/editor:opacity-100 focus-visible:opacity-100",
|
|
2966
2968
|
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react20.Sparkle, { size: 16, "aria-hidden": true })
|
|
2967
2969
|
}
|
|
2968
2970
|
)
|
|
@@ -2999,7 +3001,7 @@ function QuestionTypeIcon({ type, size = 22.5, className, ...props }) {
|
|
|
2999
3001
|
// src/components/Question Types/QuestionNavItem.tsx
|
|
3000
3002
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3001
3003
|
var QuestionNavItem = React43.forwardRef(
|
|
3002
|
-
({ className, questionType = "select-one", selected, error, asChild, showDragHandle = true, children, ...props }, ref) => {
|
|
3004
|
+
({ className, questionType = "select-one", selected, error, asChild, showDragHandle = true, hovered, children, ...props }, ref) => {
|
|
3003
3005
|
const Comp = asChild ? import_radix_ui21.Slot.Root : "button";
|
|
3004
3006
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3005
3007
|
Comp,
|
|
@@ -3007,6 +3009,7 @@ var QuestionNavItem = React43.forwardRef(
|
|
|
3007
3009
|
ref,
|
|
3008
3010
|
type: asChild ? void 0 : "button",
|
|
3009
3011
|
"aria-current": selected ? "true" : void 0,
|
|
3012
|
+
"data-hovered": hovered ? "" : void 0,
|
|
3010
3013
|
className: cn(
|
|
3011
3014
|
"group/nav flex h-9.5 w-full max-w-106.5 items-center gap-2 rounded-sm border bg-surface p-2 text-left text-body-small text-surface-foreground transition-colors focus-visible:outline-none",
|
|
3012
3015
|
error ? ["hover:bg-destructive-soft focus-visible:border-destructive", selected ? "border-destructive" : "border-border"] : [
|
|
@@ -3014,13 +3017,14 @@ var QuestionNavItem = React43.forwardRef(
|
|
|
3014
3017
|
"hover:bg-accent-soft focus-visible:border-input-accent",
|
|
3015
3018
|
selected ? "border-input-accent" : "border-border"
|
|
3016
3019
|
],
|
|
3020
|
+
hovered && (error ? "bg-destructive-soft" : "bg-accent-soft"),
|
|
3017
3021
|
className
|
|
3018
3022
|
),
|
|
3019
3023
|
...props,
|
|
3020
3024
|
children: [
|
|
3021
3025
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { "aria-hidden": "true", className: "relative flex size-4 shrink-0 items-center justify-center", children: [
|
|
3022
|
-
showDragHandle && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.DotsSixVertical, { size: 16, className: "hidden group-hover/nav:block" }),
|
|
3023
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: showDragHandle ? "group-hover/nav:hidden" : void 0, children: error ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Warning, { size: 16, className: "text-destructive-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3026
|
+
showDragHandle && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.DotsSixVertical, { size: 16, className: "hidden group-hover/nav:block group-data-[hovered]/nav:block" }),
|
|
3027
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: showDragHandle ? "group-hover/nav:hidden group-data-[hovered]/nav:hidden" : void 0, children: error ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react22.Warning, { size: 16, className: "text-destructive-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3024
3028
|
QuestionTypeIcon,
|
|
3025
3029
|
{
|
|
3026
3030
|
type: questionType,
|
|
@@ -3565,7 +3569,9 @@ var statCardVariants = (0, import_class_variance_authority6.cva)("flex min-w-0 f
|
|
|
3565
3569
|
default: "border-border bg-transparent",
|
|
3566
3570
|
// A card tinted with the secondary background and no border, for stats on a white panel.
|
|
3567
3571
|
subtle: "border-transparent bg-secondary",
|
|
3568
|
-
warning: "border-warning-soft-border bg-warning-soft"
|
|
3572
|
+
warning: "border-warning-soft-border bg-warning-soft",
|
|
3573
|
+
success: "border-success-soft-border bg-success-soft",
|
|
3574
|
+
destructive: "border-destructive-soft-border bg-destructive-soft"
|
|
3569
3575
|
}
|
|
3570
3576
|
},
|
|
3571
3577
|
defaultVariants: { variant: "default" }
|