@discuss-ds/ui 0.14.1 → 0.16.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 +19 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +19 -7
- 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.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#70](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/70) [`d0d0a23`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/d0d0a23de66894ce7d569f13c5129faad72e83d9) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - QuestionOptionEditor: new optional `locked` prop keeps the label editable but removes the drag grip and the remove and add buttons, for editing a translation of options that are shared with the original. Nothing changes for existing callers.
|
|
8
|
+
|
|
9
|
+
## 0.15.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#68](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/68) [`0c09dcf`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/0c09dcf4cf733c71cefabd61a37e704fb59599b8) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - QuestionOptionEditor: new optional `dragHandleProps` makes the row's grip a drag handle for reordering options (grab cursor, focusable, labelled "Reorder option N"), and a new optional `lifted` prop gives the copy that follows the pointer its lifted look (shadow, grip showing). Nothing changes for existing callers: without the props the grip stays decorative.
|
|
14
|
+
|
|
3
15
|
## 0.14.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -3030,8 +3030,14 @@ var QuestionOtherOption = React44.forwardRef(
|
|
|
3030
3030
|
}
|
|
3031
3031
|
);
|
|
3032
3032
|
QuestionOtherOption.displayName = "QuestionOtherOption";
|
|
3033
|
-
function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className, kind, rank }) {
|
|
3033
|
+
function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className, kind, rank, dragHandleProps, lifted, locked }) {
|
|
3034
3034
|
const reveal = kind !== void 0;
|
|
3035
|
+
const gripProps = dragHandleProps ? {
|
|
3036
|
+
"aria-label": rank ? `Reorder option ${rank}` : "Reorder option",
|
|
3037
|
+
...dragHandleProps,
|
|
3038
|
+
className: cn("cursor-grab touch-none select-none", dragHandleProps.className)
|
|
3039
|
+
} : { "aria-hidden": true };
|
|
3040
|
+
const grip = dragHandleProps ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { ...gripProps, className: cn("shrink-0", gripProps.className), children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.DotsSixVertical, { size: 20, "aria-hidden": true, className: "text-surface-foreground" }) }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.DotsSixVertical, { size: 20, "aria-hidden": true, className: "shrink-0 text-surface-foreground" });
|
|
3035
3041
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cn("group/option flex w-full items-center gap-2", className), children: [
|
|
3036
3042
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3037
3043
|
"div",
|
|
@@ -3040,12 +3046,12 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
|
|
|
3040
3046
|
"flex h-11.5 min-w-0 flex-1 items-center gap-2 rounded-md border bg-surface px-4 py-2 focus-within:border-input-accent",
|
|
3041
3047
|
reveal ? (
|
|
3042
3048
|
// The border is always visible and does not change on hover; only the shadow lifts the row. The field being edited keeps the accent.
|
|
3043
|
-
"border-border group-hover/option:shadow-md group-focus-within/option:shadow-md"
|
|
3049
|
+
cn("border-border group-hover/option:shadow-md group-focus-within/option:shadow-md", lifted && "shadow-md")
|
|
3044
3050
|
) : "border-border hover:border-input hover:shadow-md"
|
|
3045
3051
|
),
|
|
3046
3052
|
children: [
|
|
3047
3053
|
kind === "rank" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
3048
|
-
|
|
3054
|
+
!locked && grip,
|
|
3049
3055
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3050
3056
|
"span",
|
|
3051
3057
|
{
|
|
@@ -3054,12 +3060,14 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
|
|
|
3054
3060
|
children: rank
|
|
3055
3061
|
}
|
|
3056
3062
|
)
|
|
3057
|
-
] }) : reveal ? /* @__PURE__ */ (0, import_jsx_runtime45.
|
|
3063
|
+
] }) : reveal && locked ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { "aria-hidden": "true", className: "relative flex size-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: cn("inline-flex size-4 border-2 border-input bg-surface", kind === "radio" ? "rounded-full" : "rounded-xxs") }) }) : reveal ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { ...gripProps, className: cn("relative flex size-5 shrink-0 items-center justify-center", gripProps.className), children: [
|
|
3058
3064
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3059
3065
|
"span",
|
|
3060
3066
|
{
|
|
3067
|
+
"aria-hidden": "true",
|
|
3061
3068
|
className: cn(
|
|
3062
3069
|
"inline-flex size-4 border-2 border-input bg-surface group-hover/option:hidden group-focus-within/option:hidden",
|
|
3070
|
+
lifted && "hidden",
|
|
3063
3071
|
kind === "radio" ? "rounded-full" : "rounded-xxs"
|
|
3064
3072
|
)
|
|
3065
3073
|
}
|
|
@@ -3068,10 +3076,14 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
|
|
|
3068
3076
|
import_react23.DotsSixVertical,
|
|
3069
3077
|
{
|
|
3070
3078
|
size: 20,
|
|
3071
|
-
|
|
3079
|
+
"aria-hidden": true,
|
|
3080
|
+
className: cn(
|
|
3081
|
+
"hidden shrink-0 text-surface-foreground group-hover/option:block group-focus-within/option:block",
|
|
3082
|
+
lifted && "block"
|
|
3083
|
+
)
|
|
3072
3084
|
}
|
|
3073
3085
|
)
|
|
3074
|
-
] }) :
|
|
3086
|
+
] }) : locked ? null : grip,
|
|
3075
3087
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3076
3088
|
"input",
|
|
3077
3089
|
{
|
|
@@ -3084,7 +3096,7 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
|
|
|
3084
3096
|
]
|
|
3085
3097
|
}
|
|
3086
3098
|
),
|
|
3087
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3099
|
+
!locked && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3088
3100
|
"div",
|
|
3089
3101
|
{
|
|
3090
3102
|
className: cn(
|