@eldrajs/ui 0.3.12 → 0.3.13
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 +2 -0
- package/dist/{VariantPicker-9sOtHHEk.js → VariantPicker-CHaKOzYT.js} +1 -1
- package/dist/components.css +4 -0
- package/dist/composables/dialogStack.d.ts +2 -1
- package/dist/index.js +45 -5
- package/dist/style.css +4 -0
- package/dist/vee-validate.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -169,6 +169,8 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
169
169
|
|
|
170
170
|
### Fixed
|
|
171
171
|
|
|
172
|
+
- **`SearchModal` shows its results in Safari, and long results scroll.** The results area took no height in Safari, so the dialog drew only the field and the footer. In every browser, results taller than the dialog's max height were cut off instead of scrolling. The `results` part is now a flex column sized by its content (`flex-auto`, was `flex-1`), and the panel inside it fills it and scrolls (`flex-auto`, was `h-full`).
|
|
173
|
+
- **Opening a `Dialog`, `Drawer`, `Lightbox` or `SearchModal` no longer shifts the page sideways.** The scroll lock hid the page's scrollbar and the content widened into its space; `<html>` is now padded on the right by the scrollbar's width while a modal is open, added to any padding it already has and restored on close. Nothing changes with overlay scrollbars or on a page that does not scroll. An element with `position: fixed` and `right: 0` still spans the freed strip.
|
|
172
174
|
- **`Input` follows a `leadingIcon`, `prefix` or `suffix` slot given or taken away after mount.** The end padding and the slot's row were decided from the slots the field was mounted with, so a `<template #suffix v-if="…">` toggled later was not drawn.
|
|
173
175
|
- **A press on empty space in a `FieldWrapper` blurs the focused input again**, as on any other empty space. 0.3.4 cancelled that press, which kept the focus in the input; that change is reverted.
|
|
174
176
|
- **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.
|
|
@@ -6076,7 +6076,7 @@ var SearchResultsPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
6076
6076
|
* class list for a `teleport: false` search bar; the inline `position` from `useFloating` (`fixed`
|
|
6077
6077
|
* once teleported) is on the element and wins over it either way.
|
|
6078
6078
|
*/
|
|
6079
|
-
const panelClass = computed(() => [props.flat ? ["eldra:flex eldra:h-
|
|
6079
|
+
const panelClass = computed(() => [props.flat ? ["eldra:flex eldra:min-h-0 eldra:flex-auto eldra:flex-col eldra:overflow-y-auto eldra:overscroll-contain eldra:p-2", "eldra:text-[color:var(--eldra-select-panel-text)]"] : [
|
|
6080
6080
|
"eldra:absolute eldra:z-popover eldra:flex eldra:flex-col eldra:overflow-y-auto eldra:overscroll-contain eldra:p-1.5",
|
|
6081
6081
|
"eldra:eldra-search-panel-height",
|
|
6082
6082
|
"eldra:rounded-lg eldra:border eldra:shadow-md",
|
package/dist/components.css
CHANGED
|
@@ -31,7 +31,8 @@ export declare const TOAST_HOST_KEY: Ref<HTMLDialogElement | null>;
|
|
|
31
31
|
*
|
|
32
32
|
* The *first* claim (the stack going from empty to non-empty) locks the page's scroll (`<html>`
|
|
33
33
|
* gets `overflow: hidden`, the shared modal rule: "While any modal surface is open … the root
|
|
34
|
-
* element does not scroll")
|
|
34
|
+
* element does not scroll"), padding `<html>` by the scrollbar's width so nothing shifts — later
|
|
35
|
+
* pushes leave it locked, already true. `TOAST_HOST_KEY` always
|
|
35
36
|
* points at the new top.
|
|
36
37
|
*/
|
|
37
38
|
export declare function openDialog(dialog: HTMLDialogElement): void;
|
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-
|
|
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-CHaKOzYT.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";
|
|
@@ -4047,16 +4047,48 @@ var ContentCard_default = /* @__PURE__ */ defineComponent({
|
|
|
4047
4047
|
var stack = [];
|
|
4048
4048
|
/** The `<html>` inline `overflow` this module overwrote, restored when the lock is released. */
|
|
4049
4049
|
var previousHtmlOverflow = null;
|
|
4050
|
+
/** The `<html>` inline `padding-right` this module overwrote, restored when the lock is released. */
|
|
4051
|
+
var previousHtmlPaddingRight = null;
|
|
4052
|
+
/**
|
|
4053
|
+
* The width the root's classic scrollbar takes from the viewport, `0` when there is none to take:
|
|
4054
|
+
* a page short enough not to scroll, or a platform drawing overlay scrollbars (macOS's default,
|
|
4055
|
+
* every phone) that never take layout space. A `clientWidth` of `0` means no layout at all (a
|
|
4056
|
+
* DOM-less test environment), not a scrollbar as wide as the window.
|
|
4057
|
+
*/
|
|
4058
|
+
function rootScrollbarWidth(html) {
|
|
4059
|
+
if (html.clientWidth === 0) return 0;
|
|
4060
|
+
return Math.max(0, window.innerWidth - html.clientWidth);
|
|
4061
|
+
}
|
|
4062
|
+
/**
|
|
4063
|
+
* `overflow: hidden` on `<html>` removes a classic scrollbar, and the page's content widens into the
|
|
4064
|
+
* space it leaves — everything centred or right-aligned jumps sideways the moment a modal opens and
|
|
4065
|
+
* back when it closes. The lock pads `<html>` on the right by exactly the scrollbar's width for as
|
|
4066
|
+
* long as it holds, so the content box stays where it was.
|
|
4067
|
+
*
|
|
4068
|
+
* Padding rather than `scrollbar-gutter: stable`: a gutter keeps the strip but leaves it empty, so
|
|
4069
|
+
* the dialog's `::backdrop` stops short of the right edge and a right-hand `Drawer` docks against
|
|
4070
|
+
* the gutter instead of the window's edge, an undimmed bar beside it. Padding sits inside `<html>`'s
|
|
4071
|
+
* box, which the top layer covers whole.
|
|
4072
|
+
*/
|
|
4050
4073
|
function lockScroll() {
|
|
4051
4074
|
if (typeof document === "undefined") return;
|
|
4052
4075
|
const html = document.documentElement;
|
|
4076
|
+
const scrollbarWidth = rootScrollbarWidth(html);
|
|
4053
4077
|
previousHtmlOverflow = html.style.overflow;
|
|
4078
|
+
previousHtmlPaddingRight = html.style.paddingRight;
|
|
4079
|
+
if (scrollbarWidth > 0) {
|
|
4080
|
+
const padding = Number.parseFloat(getComputedStyle(html).paddingRight) || 0;
|
|
4081
|
+
html.style.paddingRight = `${padding + scrollbarWidth}px`;
|
|
4082
|
+
}
|
|
4054
4083
|
html.style.overflow = "hidden";
|
|
4055
4084
|
}
|
|
4056
4085
|
function unlockScroll() {
|
|
4057
4086
|
if (typeof document === "undefined") return;
|
|
4058
|
-
document.documentElement
|
|
4087
|
+
const html = document.documentElement;
|
|
4088
|
+
html.style.overflow = previousHtmlOverflow ?? "";
|
|
4089
|
+
html.style.paddingRight = previousHtmlPaddingRight ?? "";
|
|
4059
4090
|
previousHtmlOverflow = null;
|
|
4091
|
+
previousHtmlPaddingRight = null;
|
|
4060
4092
|
}
|
|
4061
4093
|
/**
|
|
4062
4094
|
* The DOM element a `Toaster` should render its live region into while a modal dialog is open, or
|
|
@@ -4090,7 +4122,8 @@ var TOAST_HOST_KEY = shallowRef(null);
|
|
|
4090
4122
|
*
|
|
4091
4123
|
* The *first* claim (the stack going from empty to non-empty) locks the page's scroll (`<html>`
|
|
4092
4124
|
* gets `overflow: hidden`, the shared modal rule: "While any modal surface is open … the root
|
|
4093
|
-
* element does not scroll")
|
|
4125
|
+
* element does not scroll"), padding `<html>` by the scrollbar's width so nothing shifts — later
|
|
4126
|
+
* pushes leave it locked, already true. `TOAST_HOST_KEY` always
|
|
4094
4127
|
* points at the new top.
|
|
4095
4128
|
*/
|
|
4096
4129
|
function openDialog(dialog) {
|
|
@@ -13747,8 +13780,15 @@ var SearchModal_default = /* @__PURE__ */ defineComponent({
|
|
|
13747
13780
|
]);
|
|
13748
13781
|
/** The frame's own bounding box around the reused panel (spec → Sizes, Panel row: "fills the
|
|
13749
13782
|
* remaining height and scrolls") — distinct from that panel's own `panel` part, the scrollable box
|
|
13750
|
-
* inside it.
|
|
13751
|
-
|
|
13783
|
+
* inside it.
|
|
13784
|
+
*
|
|
13785
|
+
* `flex-auto`, not `flex-1`: the dialog has a `max-height` but no height on desktop, and Safari sizes
|
|
13786
|
+
* a `flex-basis: 0%` item in a column of indefinite height to nothing — the dialog drew the field
|
|
13787
|
+
* and the footer with no results between them. A content basis grows to the content and shrinks
|
|
13788
|
+
* under the max (`min-h-0`). It is a flex column itself so the panel inside shrinks to it and
|
|
13789
|
+
* scrolls, which a `height: 100%` against this box's indefinite height never did in any browser:
|
|
13790
|
+
* long results were clipped at the max with no way to reach them. */
|
|
13791
|
+
const resultsClass = computed(() => ["eldra:flex eldra:min-h-0 eldra:flex-auto eldra:flex-col eldra:overflow-hidden", props.classes?.results]);
|
|
13752
13792
|
/** "Foot | padding 0.625rem 1rem, gap 0.5rem 1.25rem … 1px border above … hidden [below 48rem]." */
|
|
13753
13793
|
const footerClass = computed(() => [
|
|
13754
13794
|
"eldra:hidden eldra:items-center eldra:gap-x-5 eldra:gap-y-2 eldra:border-t eldra:border-border eldra:bg-surface eldra:px-4 eldra:py-2.5 eldra:md:flex",
|
package/dist/style.css
CHANGED
package/dist/vee-validate.js
CHANGED
|
@@ -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-
|
|
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-CHaKOzYT.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.
|
|
3
|
+
"version": "0.3.13",
|
|
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",
|