@discuss-ds/ui 0.34.0 → 0.36.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 +17 -0
- package/dist/index.cjs +7 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/styles/globals.css +1 -0
- package/src/styles/overlayDestructive.test.ts +16 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @discuss-ds/ui
|
|
2
2
|
|
|
3
|
+
## 0.36.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#137](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/137) [`1c4573c`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/1c4573cab4cb9a4c6dc8a37993e92fa84f6a2634) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - New overlay token `overlay-destructive-20` (`--sys-color-overlay-destructive-20`, Tailwind `from-overlay-destructive-20`): the coral of the destructive text at 20% opacity. Use it only for the hover of a component that has the `destructive-soft` background (for example a clickable red badge). Nothing existing changes.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`1c4573c`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/1c4573cab4cb9a4c6dc8a37993e92fa84f6a2634)]:
|
|
12
|
+
- @discuss-ds/tokens@0.4.0
|
|
13
|
+
|
|
14
|
+
## 0.35.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [#135](https://github.com/TamyresLucas/Discuss-UI-Storybook/pull/135) [`7c03cee`](https://github.com/TamyresLucas/Discuss-UI-Storybook/commit/7c03ceec8cfd6c3ce6c8677499c254071184a559) Thanks [@TamyresLucas](https://github.com/TamyresLucas)! - `QuestionNavItem`: the `error` state now shows the exclamation circle (it was the triangle), and a new optional `warning` prop shows the exclamation triangle in the warning colour, with a soft warning hover fill and, when selected or focused, a border in the same colour as the icon. `error` wins when both are set. Nothing changes for rows that set neither.
|
|
19
|
+
|
|
3
20
|
## 0.34.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -3373,8 +3373,9 @@ var import_react23 = require("@phosphor-icons/react");
|
|
|
3373
3373
|
var import_radix_ui22 = require("radix-ui");
|
|
3374
3374
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3375
3375
|
var QuestionNavItem = React44.forwardRef(
|
|
3376
|
-
({ className, questionType = "select-one", selected, error, asChild, showDragHandle = true, hovered, children, ...props }, ref) => {
|
|
3376
|
+
({ className, questionType = "select-one", selected, error, warning, asChild, showDragHandle = true, hovered, children, ...props }, ref) => {
|
|
3377
3377
|
const Comp = asChild ? import_radix_ui22.Slot.Root : "button";
|
|
3378
|
+
const warn = !error && !!warning;
|
|
3378
3379
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3379
3380
|
Comp,
|
|
3380
3381
|
{
|
|
@@ -3384,19 +3385,19 @@ var QuestionNavItem = React44.forwardRef(
|
|
|
3384
3385
|
"data-hovered": hovered ? "" : void 0,
|
|
3385
3386
|
className: cn(
|
|
3386
3387
|
"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",
|
|
3387
|
-
error ? ["hover:bg-destructive-soft focus-visible:border-destructive", selected ? "border-destructive" : "border-border"] : [
|
|
3388
|
+
error ? ["hover:bg-destructive-soft focus-visible:border-destructive", selected ? "border-destructive" : "border-border"] : warn ? ["hover:bg-warning-soft focus-visible:border-warning-foreground", selected ? "border-warning-foreground" : "border-border"] : [
|
|
3388
3389
|
// Hover only changes the fill; the border stays as it is (default grey, or accent when selected).
|
|
3389
3390
|
"hover:bg-accent-soft focus-visible:border-input-accent",
|
|
3390
3391
|
selected ? "border-input-accent" : "border-border"
|
|
3391
3392
|
],
|
|
3392
|
-
hovered && (error ? "bg-destructive-soft" : "bg-accent-soft"),
|
|
3393
|
+
hovered && (error ? "bg-destructive-soft" : warn ? "bg-warning-soft" : "bg-accent-soft"),
|
|
3393
3394
|
className
|
|
3394
3395
|
),
|
|
3395
3396
|
...props,
|
|
3396
3397
|
children: [
|
|
3397
3398
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { "aria-hidden": "true", className: "relative flex size-4 shrink-0 items-center justify-center", children: [
|
|
3398
3399
|
showDragHandle && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.DotsSixVertical, { size: 16, className: "hidden group-hover/nav:block group-data-[hovered]/nav:block" }),
|
|
3399
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: showDragHandle ? "group-hover/nav:hidden group-data-[hovered]/nav:hidden" : void 0, children: error ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.
|
|
3400
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: showDragHandle ? "group-hover/nav:hidden group-data-[hovered]/nav:hidden" : void 0, children: error ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.WarningCircle, { size: 16, className: "text-destructive-foreground" }) : warn ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react23.Warning, { size: 16, className: "text-warning-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3400
3401
|
QuestionTypeIcon,
|
|
3401
3402
|
{
|
|
3402
3403
|
type: questionType,
|
|
@@ -3406,7 +3407,8 @@ var QuestionNavItem = React44.forwardRef(
|
|
|
3406
3407
|
) })
|
|
3407
3408
|
] }),
|
|
3408
3409
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "min-w-0 flex-1 truncate", children }),
|
|
3409
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "sr-only", children: ", has errors" })
|
|
3410
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "sr-only", children: ", has errors" }),
|
|
3411
|
+
warn && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "sr-only", children: ", has warnings" })
|
|
3410
3412
|
]
|
|
3411
3413
|
}
|
|
3412
3414
|
);
|