@eldrajs/ui 0.3.3 → 0.3.4

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 CHANGED
@@ -151,6 +151,7 @@ Release-please writes the generated notes from commit messages and does not repl
151
151
 
152
152
  ### Fixed
153
153
 
154
+ - **A press on a `FieldWrapper`'s bare frame** (the gap between the label and the control, or the box around the control) no longer moves the caret or the focus. In a modal `Dialog` it used to leave a blinking caret in the input while the dialog kept the focus, so typing did nothing; elsewhere it focused the input. The label still focuses it.
154
155
  - **A field's 2px error boundary no longer splits into two lines at 90%, 110% or 125% zoom.** `Input`, `Textarea`, `UnitInput`, `Select`, `MultiSelect` (and `SearchBar`, `CurrencyInput` through them) draw the second line as the focus ring's resting band in `danger`, a `box-shadow` against the outside of the border, instead of a pseudo-element inset on the field's root. `eldra-field-invalid` now sits on the control (the input, textarea, select trigger, or the `MultiSelect` field holding inside tags), and `--eldra-field-invalid-radius` is gone. On focus the line moves out to become the focus ring.
155
156
  - **`scoped.css` leaves a `Popover` or `Tooltip` trigger to the consumer.** The root is the slot host (`data-eldra-slot`) while the trigger is filled, so the consumer's own element keeps its border, padding and background instead of the kit's reset and utilities.
156
157
  - **`Popover` finds its trigger inside a fragment**, so a wrapper can forward its own `<slot>` into `trigger`.
package/dist/index.js CHANGED
@@ -5413,6 +5413,13 @@ var FieldWrapper_default = /* @__PURE__ */ defineComponent({
5413
5413
  * apart later. It carries no `data-part`, because it is not one of the spec's parts.
5414
5414
  */
5415
5415
  const LabelAndControl = (_props, { slots: own }) => isInline.value ? h("div", { class: GROUP_INLINE }, own.default?.()) : own.default?.() ?? [];
5416
+ const controlEl = ref(null);
5417
+ function onFramePress(event) {
5418
+ const root = event.currentTarget;
5419
+ const target = event.target;
5420
+ const isInlineBox = target.parentElement === root && !target.hasAttribute("data-part");
5421
+ if (target === root || target === controlEl.value || isInlineBox) event.preventDefault();
5422
+ }
5416
5423
  /** In an inline row the error and the foot take a full-width row of their own, below the button. */
5417
5424
  const labelClass = computed(() => mergeClass([LABEL_TYPE, "eldra:mb-0.5"], props.classes?.label));
5418
5425
  const legendClass = computed(() => [
@@ -5451,7 +5458,7 @@ var FieldWrapper_default = /* @__PURE__ */ defineComponent({
5451
5458
  tabindex: __props.group ? -1 : void 0,
5452
5459
  "aria-describedby": __props.group ? describedBy.value : void 0,
5453
5460
  "aria-invalid": __props.group && hasError.value ? "true" : void 0
5454
- }, forwardedAttrs.value), {
5461
+ }, forwardedAttrs.value, { onMousedown: onFramePress }), {
5455
5462
  default: withCtx(() => [
5456
5463
  createVNode(LabelAndControl, null, {
5457
5464
  default: withCtx(() => [hasLabel.value ? (openBlock(), createBlock(resolveDynamicComponent(__props.group ? "legend" : "label"), {
@@ -5483,6 +5490,8 @@ var FieldWrapper_default = /* @__PURE__ */ defineComponent({
5483
5490
  "data-part",
5484
5491
  "class"
5485
5492
  ])) : createCommentVNode("", true), createElementVNode("div", {
5493
+ ref_key: "controlEl",
5494
+ ref: controlEl,
5486
5495
  "data-eldra-slot": unref(eldra).slotHost("default"),
5487
5496
  "data-part": "control",
5488
5497
  class: normalizeClass(controlClass.value)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eldrajs/ui",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Accessible Vue 3 core components for Eldra storefronts: buttons, forms, selects, cards, overlays and navigation, themed through CSS design tokens.",
5
5
  "keywords": [
6
6
  "accessible",