@panphora/bevel 0.3.1 → 0.3.2

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/bevel.js CHANGED
@@ -717,10 +717,10 @@
717
717
  setExpanded(root, true);
718
718
  if (!root.matches(".bevel-combobox__listbox") && (source !== "external" || !document.activeElement || document.activeElement === document.body)) {
719
719
  let interrupted = false;
720
- const interrupt = () => { interrupted = true; };
721
- document.addEventListener("keydown", interrupt, true); document.addEventListener("pointerdown", interrupt, true);
720
+ const interrupt = () => { interrupted = true; }, focusInside = event => { if (root.contains(event.target)) interrupted = true; };
721
+ document.addEventListener("keydown", interrupt, true); document.addEventListener("pointerdown", interrupt, true); document.addEventListener("focusin", focusInside, true);
722
722
  requestAnimationFrame(() => {
723
- document.removeEventListener("keydown", interrupt, true); document.removeEventListener("pointerdown", interrupt, true);
723
+ document.removeEventListener("keydown", interrupt, true); document.removeEventListener("pointerdown", interrupt, true); document.removeEventListener("focusin", focusInside, true);
724
724
  if (!interrupted) (root.querySelector("[autofocus]") || focusable(root))?.focus();
725
725
  });
726
726
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panphora/bevel",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Beveled controls in an editorial page. One stylesheet, one script, no build.",
5
5
  "license": "MIT-0",
6
6
  "author": "David Miranda",
package/react/README.md CHANGED
@@ -64,6 +64,8 @@ Field and Form retain native name, form, reset, validity and submission behavior
64
64
 
65
65
  `AppShell.SidebarToggle` is labelled Collapse sidebar or Expand sidebar unless you pass `label`. In classic markup, `data-bevel-label-collapse` and `data-bevel-label-expand` on the `[data-bevel-shell-collapse]` button replace those two labels.
66
66
 
67
+ Base UI defaults `closeOnClick` to `false` on `Menu.RadioItem`, `Menu.CheckboxItem` and `Menu.LinkItem`, while `Menu.Item` defaults to `true`. When picking a radio item, client-routed link, download link or new-tab link should dismiss the popup instead of leaving `aria-expanded="true"` on the trigger, pass `closeOnClick` at the call site rather than changing Bevel's `Menu` wrapper, and assert in tests that the menu closed.
68
+
67
69
  ## Dialogs
68
70
 
69
71
  ```tsx
@@ -118,6 +120,8 @@ FilterBuilder edits a draft and validates before Apply. Its shared filter model
118
120
 
119
121
  Sortable uses stable string IDs and supports pointer movement and arrows/Home/End. SplitPanes uses a percentage ratio, measured pixel minimums, a keyboard separator and mobile stacking. Escape or pointer cancellation discards the preview. KanbanBoard receives ordered column card IDs and immutable card records. Its inspector, editor, checklist, archive controls and explicit Move operation use application callbacks. Filtered boards disable ambiguous dragging while preserving explicit moves. Supply `today` as an ISO date when due styling is needed. New cards, checklist items, filter rules and accepted uploads receive random UUIDs that remain independent of React tree IDs after reload.
120
122
 
123
+ In native HTML5 drag and drop (including `FileTree` and `useFileTreeOutsideDrop`), Chrome intersects the source's `effectAllowed` with the target's `dropEffect` and silently cancels the drop with `dragend.dropEffect === "none"` when they do not overlap, even after `dragover` calls `preventDefault()`. Set `dropEffect = transfer.types.includes('Files') ? 'copy' : 'move'` on the drop target instead of hardcoding one value, and verify drop wiring with real pointer input in a browser because synthetic jsdom `DataTransfer` tests skip effect negotiation.
124
+
121
125
  ## Forms, drafts and feedback
122
126
 
123
127
  `FormErrorSummary` accepts ordered `{ id, message }` errors. `nativeFormErrors(form)` collects invalid controls with stable IDs from that form. Increment `focusToken` for each failed submission to focus the summary, or pass `focus="first-field"`. Rendering existing server errors alone does not move focus. Error links retain the control's existing descriptions.
@@ -130,6 +134,10 @@ SaveStatus receives explicit clean/dirty/saving/saved/error state. A new eventKe
130
134
 
131
135
  Tooltip follows [Base UI's visual hint contract](https://base-ui.com/react/components/tooltip). Give its trigger a matching accessible name. Put essential descriptions in inline text or Popover; Tooltip.Popup does not add a tooltip role or an automatic accessible description.
132
136
 
137
+ `<Field.Error>{problem}</Field.Error>` renders nothing unless `match` is passed, because Base UI otherwise gates it on native browser validity failures and ignores custom validation state. Always render custom field errors as `<Field.Error match role="alert">{problem}</Field.Error>` so the message mounts and wires `aria-describedby`, and test validation by asserting the error is present for bad input rather than absent for good input.
138
+
139
+ A `Toast` with `priority: 'high'` sets `aria-hidden="true"` on its popup until focused, so `getByRole` queries for `dialog` or `alertdialog` find nothing even while the toast is visible on screen (`priority: 'high'` also leaves auto-dismiss unchanged, gated on timeout greater than zero). Assert high-priority toast messages through the separate `role="alert"` live region rendered by the provider.
140
+
133
141
  ## Optional integrations and recipes
134
142
 
135
143
  These entries are excluded from the root barrel and basic component graphs. They accept consumer supplied peers and do not fetch or install them.