@eldrajs/ui 0.3.11 → 0.3.12

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
@@ -87,6 +87,7 @@ Release-please writes the generated notes from commit messages and does not repl
87
87
 
88
88
  ### Changed
89
89
 
90
+ - **`Autocomplete` shows a single suggestion whose label is exactly the text.** It kept the panel closed for it; shown, the row confirms what was typed, and the panel is there again when the field is focused again.
90
91
  - **`@eldrajs/ui/vee-validate`: typed fields no longer revalidate while typing.** A `Field*` used to validate on every change of its value, so once it had been touched (or the form submitted) its message followed each keystroke. `FieldInput`, `FieldTextarea`, `FieldCurrencyInput`, `FieldUnitInput` and `FieldSearchBar` now validate when they lose focus and when the form is submitted, and never in between: while a value is being typed no message appears, and a message already showing stays until the next blur or submit. The choice controls (`FieldCheckbox`, `FieldCheckboxGroup`, `FieldRadioGroup`, `FieldSwitch`, `FieldSelect`, `FieldMultiSelect`, `FieldVariantPicker`, `FieldQuantityStepper`) keep validating on each change. The `Form`'s error summary and `errors` slot prop now change at the same moments as the fields. Set `validate-on-value-update` on a typed field to get the old live behaviour back.
91
92
  - **`Drawer` opens and closes with a short slide and fade of its panel** instead of sliding the whole viewport-wide root in, and no longer closes instantly. Tune it with `--eldra-drawer-slide` (default `2rem`), `--eldra-drawer-enter-duration` (400ms) and `--eldra-drawer-exit-duration` (260ms); reduced motion fades only. The `animate-eldra-drawer-in-*` classes are no longer on the root.
92
93
  - **The skeleton shimmer is slower and softer**: one sweep over the first 1.8s of a 3s cycle, eased at both ends, then a rest, with the glare a soft band rather than a wash the width of the shape. It was a 1.4s `ease-out` sweep, back to back.
package/README.md CHANGED
@@ -1538,8 +1538,8 @@ disabled? }[]`, supplied by the consumer for the text now in the field; the comp
1538
1538
  2.25rem minimum, the description on a second line in `text-caption`), exactly as wide as the
1539
1539
  field; the footer is a `text-caption` line above a 1px hairline, padding 0.5rem 0.75rem.
1540
1540
  - _States_: the panel shows while the field has focus, the text is at least `minLength` long and
1541
- there is a suggestion to show. It is closed with no suggestions (there is no "no results" row)
1542
- and for a single suggestion whose label is exactly the text. After a selection, `Escape`, `Tab`
1541
+ there is a suggestion to show. It is closed with no suggestions (there is no "no results" row);
1542
+ a single suggestion whose label is exactly the text shows, as a confirmation. After a selection, `Escape`, `Tab`
1543
1543
  or a press outside it stays closed, whatever `suggestions` holds, until the text is typed in
1544
1544
  again, the field is focused again, or an arrow key asks for it. While `loading`, an open panel
1545
1545
  keeps its rows (`aria-busy` on the list) even if `suggestions` is emptied, a closed one stays
@@ -641,9 +641,7 @@ var Autocomplete_default = /* @__PURE__ */ defineComponent({
641
641
  const dismissed = ref(false);
642
642
  /** The rows on screen. `props.suggestions`, except while a wait holds the previous ones. */
643
643
  const rows = shallowRef(props.suggestions);
644
- /** A single suggestion that says exactly what the field already says offers nothing. */
645
- const onlyRepeatsText = computed(() => rows.value.length === 1 && rows.value[0]?.label === model.value);
646
- const canShow = computed(() => !props.disabled && !props.readonly && model.value.length >= props.minLength && rows.value.length > 0 && !onlyRepeatsText.value);
644
+ const canShow = computed(() => !props.disabled && !props.readonly && model.value.length >= props.minLength && rows.value.length > 0);
647
645
  const wantsOpen = computed(() => focused.value && !dismissed.value && canShow.value);
648
646
  /** True while the panel is being closed because `wantsOpen` turned false, not by the person. */
649
647
  let closingForConditions = false;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { $ as FIELD_KEY, A as ICON_STROKE_WIDTH$6, G as FIELD_SEARCH_APPEARANCE, I as FIELD_CLEAR_BUTTON_BOX, K as FIELD_SIZE, N as FIELD_BASE, R as FIELD_DISABLED, V as FIELD_LIVE, _ as useFloating, a as CURRENCY_KEY, c as provideEldraUiCurrency, d as useEldraUiLocale, et as mergeClass, f as Spinner_default, g as useTeleportTarget, h as topLayerDialog, k as ICON_SIZE_CLASS, l as provideEldraUiLocale, m as useOverlay, n as matchRange, nt as joinIds, o as DEFAULT_UI_LOCALE, p as usePopover, rt as useUiId, s as LOCALE_KEY, tt as useControllableModel, u as useEldraUiCurrency, v as normalizeText, y as useListbox } from "./useOptionList-CPHHDvPF.js";
2
2
  import { n as provideEldraScope, r as useEldraScope, t as ELDRA_SCOPE_KEY } from "./useEldraScope-BDbGzt7R.js";
3
- import { $ as defaultCharacterMeaning, A as defaultUnitFormat, B as CheckboxGroup_default, C as Switch_default, D as createNumberFormat, E as UnitInput_default, F as parseLocaleNumber, G as Button_default, H as VisuallyHidden_default, I as useHeadingTag, J as FORM_SUBMITTING_KEY, K as Icon_default, L as TAG_FILL, M as formatNumber, N as formatUnit, O as currencyFractionDigits, P as localeSeparators, Q as applyMask, R as TAG_SHAPE, S as focusInvalid, T as CurrencyInput_default, U as RequiredMark_default, V as Checkbox_default, W as FieldError_default, X as Input_default, Y as Autocomplete_default, Z as useSlotPresence, _ as optionCursor, a as claimShortcut, b as MultiSelect_default, c as SearchResultsPanel_default, d as INPUT, et as stripMask, f as PLAIN_BOX_ONLY, g as labelRecipe, h as dotRecipe, i as SearchBar_default, j as formatCurrency, k as currencySymbol, l as RadioGroup_default, m as PLAIN_OPTION, n as Textarea_default, o as ownsShortcut, p as PLAIN_COLUMNS, q as FORM_LAYOUT_KEY, r as Select_default, s as releaseShortcut, t as VariantPicker_default, u as HINT, v as radioRecipe, w as filterNumericBeforeInput, x as FormLayout_default, y as QuantityStepper_default, z as tagPadding } from "./VariantPicker-CKDdeFmV.js";
3
+ import { $ as defaultCharacterMeaning, A as defaultUnitFormat, B as CheckboxGroup_default, C as Switch_default, D as createNumberFormat, E as UnitInput_default, F as parseLocaleNumber, G as Button_default, H as VisuallyHidden_default, I as useHeadingTag, J as FORM_SUBMITTING_KEY, K as Icon_default, L as TAG_FILL, M as formatNumber, N as formatUnit, O as currencyFractionDigits, P as localeSeparators, Q as applyMask, R as TAG_SHAPE, S as focusInvalid, T as CurrencyInput_default, U as RequiredMark_default, V as Checkbox_default, W as FieldError_default, X as Input_default, Y as Autocomplete_default, Z as useSlotPresence, _ as optionCursor, a as claimShortcut, b as MultiSelect_default, c as SearchResultsPanel_default, d as INPUT, et as stripMask, f as PLAIN_BOX_ONLY, g as labelRecipe, h as dotRecipe, i as SearchBar_default, j as formatCurrency, k as currencySymbol, l as RadioGroup_default, m as PLAIN_OPTION, n as Textarea_default, o as ownsShortcut, p as PLAIN_COLUMNS, q as FORM_LAYOUT_KEY, r as Select_default, s as releaseShortcut, t as VariantPicker_default, u as HINT, v as radioRecipe, w as filterNumericBeforeInput, x as FormLayout_default, y as QuantityStepper_default, z as tagPadding } from "./VariantPicker-9sOtHHEk.js";
4
4
  import { i as enUS, n as provideEldraUiMessages, r as useMessages, t as MESSAGES_KEY } from "./useMessages-CYnyGVRG.js";
5
5
  import { Comment, Fragment, Teleport, Text, Transition, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, isRef, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, onServerPrefetch, onUnmounted, onUpdated, openBlock, provide, reactive, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRef, toValue, unref, useAttrs, useId, useSlots, useTemplateRef, vModelText, vShow, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
6
6
  import { dateTimeFormat } from "@eldrajs/sdk/format/date";
@@ -1,4 +1,4 @@
1
- import { B as CheckboxGroup_default, C as Switch_default, E as UnitInput_default, S as focusInvalid, T as CurrencyInput_default, V as Checkbox_default, X as Input_default, Y as Autocomplete_default, b as MultiSelect_default, i as SearchBar_default, l as RadioGroup_default, n as Textarea_default, r as Select_default, t as VariantPicker_default, x as FormLayout_default, y as QuantityStepper_default } from "./VariantPicker-CKDdeFmV.js";
1
+ import { B as CheckboxGroup_default, C as Switch_default, E as UnitInput_default, S as focusInvalid, T as CurrencyInput_default, V as Checkbox_default, X as Input_default, Y as Autocomplete_default, b as MultiSelect_default, i as SearchBar_default, l as RadioGroup_default, n as Textarea_default, r as Select_default, t as VariantPicker_default, x as FormLayout_default, y as QuantityStepper_default } from "./VariantPicker-9sOtHHEk.js";
2
2
  import { r as useMessages } from "./useMessages-CYnyGVRG.js";
3
3
  import { a as useControlProps, c as FIELD_ANCHORS_KEY, i as FIELD_VALIDATION_PROPS, l as FIELD_MESSAGES_KEY, n as FIELD_ONLY, o as useFieldControl, r as FIELD_VALIDATION_DEFAULTS, s as API_ERRORS_KEY, t as FIELD_CHOICE_VALIDATION_DEFAULTS } from "./useFieldControl-CGH6GEWM.js";
4
4
  import { r as useEldraScope } from "./useEldraScope-BDbGzt7R.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eldrajs/ui",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
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",