@mccaskie-labs/workbench-nudges 0.4.0 → 0.5.1
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/confirm.js +3 -1
- package/dist/styles.js +12 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @mccaskie-labs/workbench-nudges
|
|
2
2
|
|
|
3
|
+
## 0.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Short answers get sensible widths in every tool (Robert, 24 November 2026). A tool's own one-line fields for an email, a phone number, a date, a time, a small number, an amount or a postcode now carry workbench-ui's `wb-ui-size-<n>` class, so they are about as wide as what they hold instead of the full width, and never wider than their column. The "type this word to confirm" box in "Are you sure?" is as wide as its word. Names, addresses and other long text keep the full width. A project restyles the widths in project.css by the same class names. Needs workbench-ui 0.10.0 or later in the project, whose workbench.css carries the classes.
|
|
8
|
+
|
|
9
|
+
## 0.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- Every tool follows the project's look (docs/theming.md step 2, Robert, 24 November 2026). Each tool's colour, font and corner variables now default to the shared theme tokens with a Clean, light fallback (`--wb-booking-accent: var(--wb-accent, #2563eb)`), and tool colours with no token of their own (a recessed panel, a status mark, a tinted pill) are worked out from the tokens with `color-mix()`. So a page drawn with these tools takes the look in the project's workbench.css: light (Clean) by default, or whatever brand.json and project.css say. Breaking for a project page that relied on the old dark defaults: give brand.json the look you want, or set the tokens in project.css. Variable and class names are unchanged, so existing project.css overrides still win. workbench-ui: `styleProblems` refuses a tool's text, muted, surface, line, background, accent, focus, danger, success, warning, font or radius variable whose default doesn't read its token (email, PDF and image follow in step 3); the `wb-ui` class no longer forces dark, and Workbench's own pages (`STYLE`, `UI_CSS`) keep their dark values; `shell` with `stylesheets` (a project page) no longer says dark in its meta tag.
|
|
14
|
+
|
|
3
15
|
## 0.4.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/confirm.js
CHANGED
|
@@ -18,8 +18,10 @@ export function renderConfirm(o) {
|
|
|
18
18
|
const reason = o.reason
|
|
19
19
|
? `<label class="${p}-confirm-field"><span class="${p}-confirm-label">${esc(o.reason.label)}</span><input class="${p}-confirm-input" type="text" name="${esc(o.reason.name ?? "reason")}" maxlength="${o.reason.maxlength ?? 200}"${o.reason.required ? " required" : ""}></label>`
|
|
20
20
|
: "";
|
|
21
|
+
// The word box is as wide as the word (workbench-ui's wb-ui-size-<n>, in characters), not the width of the page.
|
|
22
|
+
const wordSize = o.type ? [5, 6, 8, 10, 12, 14, 16, 20, 24, 30, 40].find((n) => n > o.type.word.length) : undefined;
|
|
21
23
|
const type = o.type
|
|
22
|
-
? `<label class="${p}-confirm-field"><span class="${p}-confirm-label">${esc(o.type.label)}</span><input class="${p}-confirm-input" type="text" name="confirm_word" required pattern="${esc(pattern(o.type.word))}" autocomplete="off" autocapitalize="off" spellcheck="false"></label>`
|
|
24
|
+
? `<label class="${p}-confirm-field"><span class="${p}-confirm-label">${esc(o.type.label)}</span><input class="${p}-confirm-input${wordSize ? ` wb-ui-size-${wordSize}` : ""}" type="text" name="confirm_word" required pattern="${esc(pattern(o.type.word))}" autocomplete="off" autocapitalize="off" spellcheck="false"></label>`
|
|
23
25
|
: "";
|
|
24
26
|
return `<details class="${p}-confirm"${o.open ? " open" : ""}><summary class="${p}-confirm-open ${esc(o.askClass)}"><span class="${p}-confirm-ask">${esc(o.ask)}</span><span class="${p}-confirm-keep">${esc(o.no)}</span></summary><form class="${p}-confirm-form" method="post" action="${esc(o.endpoint)}">${hidden}<p class="${p}-confirm-question">${esc(o.question)}</p>${o.consequence ? `<p class="${p}-confirm-consequence">${esc(o.consequence)}</p>` : ""}${reason}${o.extra ?? ""}${type}<button class="${p}-confirm-yes" type="submit">${esc(o.yes)}</button></form></details>`;
|
|
25
27
|
}
|
package/dist/styles.js
CHANGED
|
@@ -18,19 +18,19 @@ export const NUDGE_STYLES = {
|
|
|
18
18
|
title: "Follow-up nudges",
|
|
19
19
|
prefix: "wb-nudge-",
|
|
20
20
|
variables: [
|
|
21
|
-
{ name: "--wb-nudge-text", value: "#
|
|
22
|
-
{ name: "--wb-nudge-muted", value: "#
|
|
23
|
-
{ name: "--wb-nudge-surface", value: "#
|
|
24
|
-
{ name: "--wb-nudge-sunk", value: "#
|
|
25
|
-
{ name: "--wb-nudge-line", value: "#
|
|
26
|
-
{ name: "--wb-nudge-due", value: "#
|
|
27
|
-
{ name: "--wb-nudge-taken", value: "#
|
|
28
|
-
{ name: "--wb-nudge-accent", value: "#
|
|
29
|
-
{ name: "--wb-nudge-on-accent", value: "#ffffff", about: "Text on the main button" },
|
|
30
|
-
{ name: "--wb-nudge-danger", value: "#
|
|
21
|
+
{ name: "--wb-nudge-text", value: "var(--wb-text, #1f2937)", about: "Text: the title, who it's for, the draft" },
|
|
22
|
+
{ name: "--wb-nudge-muted", value: "var(--wb-muted, #5b6472)", about: "Quieter text: the step, the empty list" },
|
|
23
|
+
{ name: "--wb-nudge-surface", value: "var(--wb-surface, #f7f8f8)", about: "Background of each nudge" },
|
|
24
|
+
{ name: "--wb-nudge-sunk", value: "color-mix(in srgb, var(--wb-background, #ffffff), var(--wb-text, #1f2937) 3%)", about: "Background of the list and the draft box" },
|
|
25
|
+
{ name: "--wb-nudge-line", value: "var(--wb-line, #d7d8db)", about: "Borders" },
|
|
26
|
+
{ name: "--wb-nudge-due", value: "var(--wb-warning, #a15c07)", about: "The edge of a due nudge and its reason" },
|
|
27
|
+
{ name: "--wb-nudge-taken", value: "var(--wb-warning, #a15c07)", about: "The edge of a nudge whose date was taken or has no draft" },
|
|
28
|
+
{ name: "--wb-nudge-accent", value: "var(--wb-accent, #2563eb)", about: "The main button: I sent it" },
|
|
29
|
+
{ name: "--wb-nudge-on-accent", value: "var(--wb-on-accent, #ffffff)", about: "Text on the main button" },
|
|
30
|
+
{ name: "--wb-nudge-danger", value: "var(--wb-danger, #b42318)", about: "The button that stops a follow-up after \"Are you sure?\"" },
|
|
31
31
|
{ name: "--wb-nudge-on-danger", value: "#ffffff", about: "Text on that button" },
|
|
32
|
-
{ name: "--wb-nudge-focus", value: "rgba(
|
|
33
|
-
{ name: "--wb-nudge-radius", value: "8px", about: "Corner rounding" },
|
|
32
|
+
{ name: "--wb-nudge-focus", value: "var(--wb-focus, rgba(37,99,235,0.4))", about: "The ring round a control with focus" },
|
|
33
|
+
{ name: "--wb-nudge-radius", value: "var(--wb-radius, 8px)", about: "Corner rounding" },
|
|
34
34
|
],
|
|
35
35
|
classes: [
|
|
36
36
|
{ name: "wb-nudge-list", element: "section", about: "The whole Waiting for you list", css: `color:${v("text")};background:${v("sunk")};padding:.75rem;border-radius:${v("radius")}` },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mccaskie-labs/workbench-nudges",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Follow-up nudges for Workbench apps: remind the business to follow up when a conversation goes quiet (\"no reply in 3 days\"), with the follow-up already drafted by the reply drafter when it comes due. One scan from the app's cron, quiet hours, at most three steps, and a daily email digest to the owner. Never messages the business's customer.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|