@livx.cc/bare-v3 0.1.0-alpha.39 → 0.1.0-alpha.40

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.0-alpha.39",
2
+ "version": "0.1.0-alpha.40",
3
3
  "cssSha256": "d8da259da7aac4ff4c65150029fde71735d8628603359216cf86fb7047246a92",
4
4
  "classes": [
5
5
  "b3-accordion",
@@ -175,7 +175,7 @@
175
175
  "classes": [
176
176
  "b3-row"
177
177
  ],
178
- "guidance": "Use li inside ul/ol. Direct b3-row children remove native list indentation; ordinary prose lists keep it. The row supplies spacing/dividers; app code owns state, ordering and persistence.\n\nComposition: for a short label plus actions, use b3-row b3-split. For supporting notes, use the stacked example below: b3-row b3-stack stretches children and honors --b3-space; a nested b3-split holds primary metadata/value/actions, and the note gets the full width below. Avoid squeezing long notes beside fixed controls. Inset content only when adding an enclosing border/surface. Keep secondary actions readable and visually subordinate.\n\nLists: show useful rows before large summaries, with a short count and truthful empty state. Never invent user history. If reviewing is primary, use one disclosed add flow (native details/summary with b3-accordion); read form-composition.md. Task queues should show compact rows and reveal editing fields only for the edited item. Use existing disclosure/dialog semantics, not new density utilities. Check populated phone/desktop layouts, long notes and internal overflow.\n\nEditing: keep focused controls and caret/selection stable. Save drafts synchronously before replacing rows. Keep an edited row present while focus remains inside it, even if it stops matching a filter; read editable-filtered-rows.md for Tab/blur and exit timing. Give controls immutable identity independent of changing labels/actions: Edit → Done → Edit must reopen correctly. Preserve checkbox focus on completion; after deletion focus a surviving action or add control. Verify activeElement and persisted values, not just page width. Playground #row resets local state on reload.",
178
+ "guidance": "Use li inside ul/ol. Direct b3-row children remove native list indentation; ordinary prose lists keep it. The row supplies spacing/dividers; app code owns state, ordering and persistence.\n\nComposition: for a short label plus actions, use b3-row b3-split. For supporting notes, use the stacked example below: b3-row b3-stack stretches children and honors --b3-space; a nested b3-split holds primary metadata/value/actions, and the note gets the full width below. Avoid squeezing long notes beside fixed controls. Inset content only when adding an enclosing border/surface. Keep secondary actions readable and visually subordinate.\n\nLists: show useful rows before large summaries, with a short count and truthful empty state. Never invent user history. If reviewing is primary, use one disclosed add flow (native details/summary with b3-accordion); read form-composition.md. Task queues should show compact rows and reveal editing fields only for the edited item. Use existing disclosure/dialog semantics, not new density utilities. Check populated phone/desktop layouts, long notes and internal overflow.\n\nEditing: keep focused controls and caret/selection stable. Save drafts synchronously before replacing rows. Keep an edited row present while focus remains inside it, even if it stops matching a filter; read editable-filtered-rows.md for Tab/blur and exit timing. Give controls immutable identity independent of changing labels/actions: Edit → Done → Edit must reopen correctly. Checkbox completion: update the existing input/row and counts in place; never rebuild the list on change. If filtering hides the focused row, focus the next visible checkbox or stable add/filter control. See the concrete checkbox pattern in editable-filtered-rows.md. After deletion focus a surviving action or add control. Verify activeElement and persisted values, not just page width. Playground #row resets local state on reload.",
179
179
  "example": "<ul>\n <li class=\"b3-row b3-stack\" style=\"--b3-space:.5rem\">\n <div class=\"b3-split\">\n <strong>Groceries</strong>\n <div class=\"b3-cluster\">\n <strong>$12.50</strong>\n <button class=\"b3-button\" data-b3-emphasis=\"quiet\" aria-label=\"Details for groceries\">Details</button>\n </div>\n </div>\n <p class=\"b3-muted\">Weekly shop and supplies for the shared kitchen.</p>\n </li>\n</ul>"
180
180
  },
181
181
  {
@@ -29,6 +29,31 @@ list.addEventListener('focusout', event => {
29
29
 
30
30
  The timeout defers only filtering. Never defer validation, state updates or persistence to it. Preserve invalid or unfinished field text so users can correct it; do not normalize on every keystroke. In reactive UI, preserve stable row keys and the same focus policy.
31
31
 
32
+ ## Checkbox completion: update the existing row
33
+
34
+ Do not rebuild the list with `innerHTML` or `replaceChildren` on checkbox change: that removes the focused input, so the next Space/Tab starts from the page instead of the task. Keep the same checkbox node (stable keys in a framework). Commit the checked state, update counts and row styling in place, then apply the filter. When completion hides the focused row, move focus to the next visible checkbox, then the previous one, then a stable add/filter control. Do not steal focus for background updates.
35
+
36
+ Here `checkbox`, `row`, `list`, and `addControl` are existing DOM nodes. `commitChecked` and `updateCountsAndFilter` are app-owned functions; the latter updates text/hidden attributes without replacing rows. Commit before hiding; on failure roll back the checkbox and announce the error.
37
+
38
+ ```js
39
+ checkbox.addEventListener('change', () => {
40
+ const ownedFocus = row.contains(document.activeElement);
41
+ const rows = [...list.children];
42
+ const index = rows.indexOf(row);
43
+ commitChecked(row.dataset.id, checkbox.checked);
44
+ row.toggleAttribute('data-complete', checkbox.checked);
45
+ updateCountsAndFilter();
46
+ if (!ownedFocus || !row.hidden) return;
47
+ const neighbors = [...rows.slice(index + 1), ...rows.slice(0, index).reverse()];
48
+ const next = neighbors.filter(el => !el.hidden)
49
+ .map(el => el.querySelector('input[type="checkbox"]'))
50
+ .find(el => el && !el.disabled);
51
+ (next || addControl).focus();
52
+ });
53
+ ```
54
+
55
+ Check with real keyboard input: in All, focus a checkbox and press Space twice; the same input remains focused and toggles both times. In To do, completion hides that row and focus reaches a surviving checkbox; completing the final row reaches the add/filter control. Also verify persistence after reload. The playground's Lists → “Before you head out” demonstrates stable rows and filter fallback (local example state only).
56
+
32
57
  ## Explicit Save, Cancel and Delete
33
58
 
34
59
  Replacing an editor also removes its focused Save/Cancel button. Complete persistence and rendering/filtering first, then choose a connected, visible destination. On Save/Cancel prefer that row's new Edit button; if the row is hidden or removed, use a surviving row action or the stable add/filter control. Never select the row being deleted as its own fallback. Move focus only when the changed row owned it.
@@ -6,7 +6,7 @@ Composition: for a short label plus actions, use b3-row b3-split. For supporting
6
6
 
7
7
  Lists: show useful rows before large summaries, with a short count and truthful empty state. Never invent user history. If reviewing is primary, use one disclosed add flow (native details/summary with b3-accordion); read form-composition.md. Task queues should show compact rows and reveal editing fields only for the edited item. Use existing disclosure/dialog semantics, not new density utilities. Check populated phone/desktop layouts, long notes and internal overflow.
8
8
 
9
- Editing: keep focused controls and caret/selection stable. Save drafts synchronously before replacing rows. Keep an edited row present while focus remains inside it, even if it stops matching a filter; read editable-filtered-rows.md for Tab/blur and exit timing. Give controls immutable identity independent of changing labels/actions: Edit → Done → Edit must reopen correctly. Preserve checkbox focus on completion; after deletion focus a surviving action or add control. Verify activeElement and persisted values, not just page width. Playground #row resets local state on reload.
9
+ Editing: keep focused controls and caret/selection stable. Save drafts synchronously before replacing rows. Keep an edited row present while focus remains inside it, even if it stops matching a filter; read editable-filtered-rows.md for Tab/blur and exit timing. Give controls immutable identity independent of changing labels/actions: Edit → Done → Edit must reopen correctly. Checkbox completion: update the existing input/row and counts in place; never rebuild the list on change. If filtering hides the focused row, focus the next visible checkbox or stable add/filter control. See the concrete checkbox pattern in editable-filtered-rows.md. After deletion focus a surviving action or add control. Verify activeElement and persisted values, not just page width. Playground #row resets local state on reload.
10
10
 
11
11
  Classes: b3-row
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livx.cc/bare-v3",
3
- "version": "0.1.0-alpha.39",
3
+ "version": "0.1.0-alpha.40",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",