@eldrajs/ui 0.3.5 → 0.3.7
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 +9 -0
- package/README.md +182 -35
- package/dist/{VariantPicker-BjM-PmXb.js → VariantPicker-Cr_AkX47.js} +117 -44
- package/dist/componentNames.d.ts +1 -1
- package/dist/components/badge/StockBadge.vue.d.ts +1 -1
- package/dist/components/chip/Chip.vue.d.ts +2 -0
- package/dist/components/dialog/Dialog.vue.d.ts +2 -0
- package/dist/components/drawer/Drawer.vue.d.ts +4 -0
- package/dist/components/drawer/types.d.ts +15 -1
- package/dist/components/drawer/useDrawerDrag.d.ts +20 -0
- package/dist/components/filter-panel/FilterGroup.vue.d.ts +2 -0
- package/dist/components/filter-panel/FilterPanel.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +2 -0
- package/dist/components/lightbox/Lightbox.vue.d.ts +2 -0
- package/dist/components/nav-menu/NavMenu.vue.d.ts +2 -0
- package/dist/components/notice/Notice.vue.d.ts +28 -0
- package/dist/components/notice/types.d.ts +38 -0
- package/dist/components/pagination/Pagination.vue.d.ts +2 -0
- package/dist/components/price/Price.vue.d.ts +1 -1
- package/dist/components/product-card/ProductCard.vue.d.ts +1 -1
- package/dist/components/radio/RadioGroup.vue.d.ts +4 -0
- package/dist/components/radio/recipes.d.ts +4 -2
- package/dist/components/radio/types.d.ts +8 -1
- package/dist/components/range-slider/RangeSlider.vue.d.ts +2 -0
- package/dist/components/search-bar/SearchBar.vue.d.ts +2 -0
- package/dist/components/search-modal/SearchModal.vue.d.ts +2 -0
- package/dist/components/select/MultiSelect.vue.d.ts +2 -0
- package/dist/components/select/Select.vue.d.ts +2 -0
- package/dist/components/site-form/SiteForm.vue.d.ts +2 -0
- package/dist/components/spinner/Spinner.vue.d.ts +4 -1
- package/dist/components/spinner/types.d.ts +9 -0
- package/dist/components/step-indicator/StepIndicator.vue.d.ts +7 -0
- package/dist/components/step-indicator/types.d.ts +30 -0
- package/dist/components/toast/Toast.vue.d.ts +2 -0
- package/dist/components/toast/Toaster.vue.d.ts +2 -0
- package/dist/components.css +231 -8
- package/dist/icons/paths.d.ts +8 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +912 -315
- package/dist/messages/en-US.d.ts +8 -0
- package/dist/messages/is-IS.js +3 -1
- package/dist/resolver.js +3 -0
- package/dist/style.css +231 -8
- package/dist/{useMessages-B5nzZghs.js → useMessages-DOHGfip_.js} +9 -1
- package/dist/utilities.css +100 -0
- package/dist/vee-validate/FieldCheckbox.vue.d.ts +5 -1
- package/dist/vee-validate/FieldCheckboxGroup.vue.d.ts +5 -1
- package/dist/vee-validate/FieldCurrencyInput.vue.d.ts +5 -1
- package/dist/vee-validate/FieldInput.vue.d.ts +5 -1
- package/dist/vee-validate/FieldMultiSelect.vue.d.ts +5 -1
- package/dist/vee-validate/FieldQuantityStepper.vue.d.ts +5 -1
- package/dist/vee-validate/FieldRadioGroup.vue.d.ts +5 -1
- package/dist/vee-validate/FieldSearchBar.vue.d.ts +5 -1
- package/dist/vee-validate/FieldSelect.vue.d.ts +5 -1
- package/dist/vee-validate/FieldSwitch.vue.d.ts +5 -1
- package/dist/vee-validate/FieldTextarea.vue.d.ts +5 -1
- package/dist/vee-validate/FieldUnitInput.vue.d.ts +5 -1
- package/dist/vee-validate/FieldVariantPicker.vue.d.ts +5 -1
- package/dist/vee-validate/context.d.ts +32 -7
- package/dist/vee-validate/index.d.ts +8 -5
- package/dist/vee-validate/types.d.ts +26 -0
- package/dist/vee-validate/useFieldControl.d.ts +59 -10
- package/dist/vee-validate.js +258 -74
- package/dist/vue-i18n.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
7
7
|
|
|
8
8
|
### Added
|
|
9
9
|
|
|
10
|
+
- **`validateOnMount`, `validateOnBlur` and `validateOnValueUpdate` on every `Field*`**, deciding per field when it validates: on mount (default `false`; the message is shown at once), on blur (default `true`), and on every value change once touched or submitted (default `false` for a typed control, `true` for a choice control). A submit always validates every field. They hold with `rules` on the field and with a `validationSchema` on the `Form` alike. `FIELD_VALIDATION_DEFAULTS`, `FIELD_CHOICE_VALIDATION_DEFAULTS` and `FIELD_VALIDATION_PROPS` are exported from `@eldrajs/ui/vee-validate`, and `FIELD_ONLY` now includes the three names.
|
|
11
|
+
- **`Notice`** — an inline message that stays in the page flow: `tone` (`info`, `success`, `warning`, `danger`; `data-tone` on the root), `title`, `text` / default slot, a default icon per tone (`icon` replaces it, `null` removes it), `headingLevel`, an `actions` slot and `classes`. `role="status"` for `info`, `success` and `warning`, `role="alert"` for `danger`; `announce: false` drops the role. New types `NoticeProps`, `NoticePart`, `NoticeTone`; `<EldraNotice>` through the resolver.
|
|
12
|
+
- **`StepIndicator`** — a non-interactive ordered list of steps: `steps` (`{ label, description? }`), `current` (index from 0), `orientation` (`horizontal`, `vertical`) and `classes`. `aria-current="step"` on the current step, "(completed)" / "(not started)" in visually hidden text on the others. New messages `stepCompleted`, `stepNotStarted`; new types `StepIndicatorProps`, `StepIndicatorStep`, `StepIndicatorOrientation`, `StepIndicatorState`, `StepIndicatorPart`; `<EldraStepIndicator>` through the resolver.
|
|
13
|
+
- **`RadioGroup` cards take a leading icon or logo**: `icon` on an option (a decorative 1.25rem icon between the radio and the title) and a `leading` slot (`{ option }`, for a logo or any other content; it wins over `icon`), centred against the title and the hint together. Cards only. New part `leading`. A card with neither renders as before.
|
|
14
|
+
- **`Spinner`** is exported: the circle `Button` and `LoadMore` draw, for a wait outside them. Decorative unless `label` names it (`role="img"`); 1.125rem unless a size class on it says otherwise. New type `SpinnerProps`; `<EldraSpinner>` through the resolver.
|
|
10
15
|
- **`Skeleton`'s `box` variant and `height` prop**: one plain shimmering shape that is the component itself, sized by `width` / `height` or by classes on it (`<Skeleton variant="box" width="12rem" height="3rem" />`, `<Skeleton variant="box" class="h-24 rounded-full" />`). Unsized, it is full width and `--eldra-skeleton-box-height` tall (default `1rem`).
|
|
11
16
|
- **`Skeleton` CSS variables**: `--eldra-skeleton-line-height`, `--eldra-skeleton-line-gap` and `--eldra-skeleton-title-height` size the `text` and `title` rows (defaults `0.875rem`, `0.3rem`, `1.5rem`, as before); `--eldra-skeleton-color`, `--eldra-skeleton-highlight` and `--eldra-skeleton-duration` set the fill, the glare and the shimmer's cycle. They apply to `Price`'s loading state too.
|
|
12
17
|
- **`--eldra-button-border-width`** (default `1px`) sets the border width of every `Button` variant except `link`, at the same height; an attached `ButtonGroup` overlaps its buttons by the same width, so they still share one line.
|
|
@@ -46,6 +51,8 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
46
51
|
- **`NavMenu`** — the header navigation: top-level links, and buttons opening a `dropdown` panel or a `mega` panel of columns (entries with `description`, `badge`, `current`, `newTab`). Disclosure pattern: `Enter`/`Space` open, `Tab` walks through, `Escape` closes and returns focus, an outside click or focus leaving closes, one panel at a time; plus the APG arrow keys (`←`/`→`/`Home`/`End` along the bar, `↓`/`↑` into and through a panel, never wrapping). Optional `openOnHover`, opening after a 150ms rest and closing 150ms after the pointer leaves; a closing panel fades out. Below `collapseBelow` (default `lg`; also `md`, `xl`, the container breakpoints `@tablet`/`@content`/`@wide`, `never` and `always`) it becomes a menu button and a left `Drawer` with accordion rows. Takes a resolved Studio link tree as it is. `variant`: `ghost` (default; text colour with a fill on hover and while open) or `muted` (muted text turning the text colour on hover, while open and on the current page, no fill), for the bar and its panels alike. `linkAs`, `classes`, slots `panelItem`/`groupHeading`/`panelFooter`/`toggle`/`drawerFooter`, `v-model` (open panel) and `v-model:drawerOpen`, exposed `close()`. New messages `navMenuLabel`, `navMenuOpen`, `navMenuDrawer`, `navMenuOverview`; new CSS variables `--eldra-nav-menu-offset`, `--eldra-nav-menu-dropdown-min`/`-max`, `--eldra-nav-menu-column-min`.
|
|
47
52
|
- **`NavMenu`'s phone menu**: `drawerLayout` (`accordion`, the default, or `sections`, each panel listed open under its label, the new `drawerSectionHeading` part naming its list, group headings kept where a panel has them); `drawerItems`, the drawer's own entries when they differ from the bar's (a mega panel's area pages, a bar panel's footer links as rows); the `drawerHeader` slot (`{ close }`) for a logo and a call to action in the drawer's header row; the `triggerIcon` slot (`{ item, open }`) replacing the panel buttons' chevron, still turned over while open; `placement` (`bar` or `drawer`) in the `panelItem` and `groupHeading` slot props; new parts `drawerRoot`, `drawerHeader`, `drawerClose`, `drawerBody`, `drawerSectionHeading`. New types `NavMenuDrawerLayout`, `NavMenuPlacement`, `NavMenuPanelPart`, `NavMenuDrawerPanelPart`, `NavMenuPanelItemSlotProps`, `NavMenuGroupHeadingSlotProps`.
|
|
48
53
|
- **`Drawer`'s `header` slot**: content for the header row, after the title and before the close button.
|
|
54
|
+
- **`Drawer` swipes closed** (`swipe`, default `true`): a side drawer follows a drag toward its edge after `--eldra-drawer-swipe-threshold` (default `24px`), by the header with a mouse or pen and from anywhere with a finger, and closes past 35% or on a flick, else springs back; the backdrop fades with the drag. `close` fires with the new reason `"swipe"`.
|
|
55
|
+
- **`Drawer`'s `mobileSheet`** (default `false`): below a 48rem viewport, a bottom sheet of its content's height (up to `--eldra-drawer-sheet-gap`, default `3rem`, from the top) with rounded top corners (`--eldra-drawer-sheet-radius`) and a grab handle (new `handle` part, `--eldra-drawer-handle-color`), dragged down by the handle, the header, or the body once it is scrolled to the top.
|
|
49
56
|
- **`@eldrajs/ui/components.css`** — `style.css` without Tailwind's preflight, whose reset reached every element on the page (rich-text headings, lists, links and paragraphs lost their browser defaults). Same theme and utilities; the reset only touches elements inside a component: every component's outermost element, and every panel, bubble or toast region it teleports, now carries the public `data-eldra-ui` marker, and the reset reaches those and the `data-part` elements within them, so a site's own `data-part` elements (Ark UI and Zag included) keep their defaults. `Rating`'s stars, `FilterPanel`'s colour ring, `SearchBar`'s no-results text and `SearchModal`'s key hints no longer lean on the global reset, so they draw the same under either stylesheet.
|
|
50
57
|
- **`zoomSizes(sizes, zoom)`** — multiplies every length in an `<img sizes>` list by `zoom`, keeping its media conditions (`(min-width: 1024px) 50vw, 100vw` at zoom 3 is `(min-width: 1024px) calc(50vw * 3), calc(100vw * 3)`); a zoom of 1 or less, `auto` and a size-less condition are left as given. What `Image` now does to its own `sizes`, for a renderer that draws a zoomed crop itself.
|
|
51
58
|
- **`Breadcrumb`'s `structuredData` prop** (default `true`, so nothing changes by default). `false` omits the component's own `BreadcrumbList` JSON-LD `<script>`, for a page whose theme already writes one at page level (`@eldrajs/theme-core`'s `buildBreadcrumbLd`); two on one page is duplicate markup.
|
|
@@ -72,6 +79,8 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
72
79
|
|
|
73
80
|
### Changed
|
|
74
81
|
|
|
82
|
+
- **`@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.
|
|
83
|
+
- **`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.
|
|
75
84
|
- **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.
|
|
76
85
|
- **`Dialog` focuses itself on open, not its first control**, from the keyboard as from a tap, so a form dialog no longer opens with the caret (and, on leaving it, the blur validation) in its first field. `Tab` reaches the first control; mark a field `autofocus` to focus it instead. `useDialog` takes the same behaviour as `focusFirstControl: false`; `Drawer`, `Lightbox` and `SearchModal` are unchanged.
|
|
77
86
|
- **The focus ring moves out from the border as it fades in**, instead of fading in at full size: at rest it is a 1px transparent band against the border, and on focus it travels out past the 2px `focus-inner` infill to the 2px ring, over `duration-base`. The end state is unchanged. Drawn with `box-shadow` spreads, which render at fractional sizes, so the move is smooth.
|
package/README.md
CHANGED
|
@@ -192,7 +192,7 @@ Every component supports all five of these; none hard-codes anything a store mig
|
|
|
192
192
|
| `ContentCard` | `--eldra-content-card-title-size` (default `1.25rem`) and `--eldra-content-card-title-line` (default `1.3`) — the title's own size and line ratio, no token of its own; `--eldra-content-card-excerpt-size` (default `0.9375rem`) and `--eldra-content-card-excerpt-line` (default `1.5`) — the excerpt's own size and line ratio, shared by `FeatureCard`'s `body` (`text-content-card-excerpt` in `tailwind.css`), since both read the same spec number |
|
|
193
193
|
| `CurrencyInput` | `UnitInput`'s exactly (it renders a `UnitInput` with `isCurrency` always on) — see the `UnitInput` row |
|
|
194
194
|
| `Dialog` | `--eldra-dialog-title-size` (default `1.25rem`), `--eldra-dialog-title-line` (default `1.3`) — the title's own size/line, no token of its own; `--eldra-dialog-width` (default `32rem`), `--eldra-dialog-width-sm` (default `24rem`) — the panel's own width, always capped at the dialog's padded width (the viewport less `2rem`) inside the utility itself; `--eldra-dialog-max-height` (default `none`: a tall panel grows and the dialog scrolls like a page; set it to cap the panel and scroll the body inside it instead); the `eldra-dialog-fullscreen` utility pins the panel to the viewport edges with the body scrolling between header and footer, for a consumer to put under a viewport variant (`classes.panel: 'max-md:eldra-dialog-fullscreen'`); `--eldra-dialog-background` (default `var(--color-background)`), `--eldra-dialog-border` (default `var(--color-border)`), `--eldra-dialog-text` (default `var(--color-text)`, also the close button's hover and press tint), `--eldra-dialog-muted` (default `var(--color-muted)`, the description) and `--eldra-dialog-backdrop` (default `var(--color-overlay)`) — the chrome's own colours, read by the dialog's parts only, so setting them on the `<dialog>` (`class`) recolours it without re-theming the slotted content the way redefining `--eldra-color-*` there would |
|
|
195
|
-
| `Drawer` | `--eldra-drawer-title-size` (default `1.25rem`), `--eldra-drawer-title-line` (default `1.3`) — the title's own size/line, no token of its own (the same numbers as `Dialog`'s, but its own variable pair); `--eldra-drawer-width` (default `28rem`) — the panel's own maximum width, capped at the viewport inside the utility itself, which also carries the full-screen-below-a-48rem-_viewport_ media query; `--eldra-drawer-header-height` (default `4rem`) — the header row's least height, with `--eldra-drawer-header-padding` (default `var(--eldra-space-4)`) — its top and bottom padding, `0px` to centre the row's content in exactly that height, such as a site header's; `--eldra-drawer-gutter` (default `1.5rem`) — the header's, body's and footer's side padding. The device's safe areas (`env(safe-area-inset-*)`) are added around both, so a full-screen drawer clears a notch and the home indicator on a page with `viewport-fit=cover`
|
|
195
|
+
| `Drawer` | `--eldra-drawer-title-size` (default `1.25rem`), `--eldra-drawer-title-line` (default `1.3`) — the title's own size/line, no token of its own (the same numbers as `Dialog`'s, but its own variable pair); `--eldra-drawer-width` (default `28rem`) — the panel's own maximum width, capped at the viewport inside the utility itself, which also carries the full-screen-below-a-48rem-_viewport_ media query; `--eldra-drawer-header-height` (default `4rem`) — the header row's least height, with `--eldra-drawer-header-padding` (default `var(--eldra-space-4)`) — its top and bottom padding, `0px` to centre the row's content in exactly that height, such as a site header's; `--eldra-drawer-gutter` (default `1.5rem`) — the header's, body's and footer's side padding. The device's safe areas (`env(safe-area-inset-*)`) are added around both, so a full-screen drawer clears a notch and the home indicator on a page with `viewport-fit=cover`; `--eldra-drawer-slide` (default `2rem`), `--eldra-drawer-enter-duration` (default `400ms`), `--eldra-drawer-exit-duration` (default `260ms`) — the panel's slide and fade in and out; `--eldra-drawer-swipe-threshold` (default `24px`) — how far a side swipe travels before the panel follows; with `mobileSheet`, `--eldra-drawer-sheet-gap` (default `3rem`), `--eldra-drawer-sheet-radius` (default `var(--eldra-radius-xl)`) and `--eldra-drawer-handle-color` (default `var(--eldra-color-border-strong)`) |
|
|
196
196
|
| `EditorPlaceholder` | `--eldra-editor-placeholder-border-width` (default `1.5px`) — the dashed boundary's width, distinct from `EmptyState`'s own stock `border` (1px) |
|
|
197
197
|
| `EmptyState` | `--eldra-empty-state-title-size` (default `1.25rem`) and `--eldra-empty-state-title-line` (default `1.3`) — the title's own size and line ratio, no token of its own |
|
|
198
198
|
| `FeatureCard` | Shares `ContentCard`'s `--eldra-content-card-excerpt-size`/`-line` for its own `body` text (`text-content-card-excerpt`); its `title` reads `text-h4` directly, no variable of its own |
|
|
@@ -207,6 +207,7 @@ Every component supports all five of these; none hard-codes anything a store mig
|
|
|
207
207
|
| `LoadMore` | none — the status/meter/button sizes all reuse shared tokens (`text-body-sm`, `control-h`, `text-button-md`), no per-component variable |
|
|
208
208
|
| `LogoItem` | `--eldra-logo-image-max-height` (default `2.5rem`), `--eldra-logo-image-max-width` (default `9rem`) — the logo image's contain box; `--eldra-logo-wordmark-size` (default `1.25rem`) — the wordmark fallback's font size (its weight, line-height and letter-spacing reuse `h2`/`h3` tokens directly, see `text-logo-wordmark` in `tailwind.css`) |
|
|
209
209
|
| `NavMenu` | `--eldra-nav-menu-offset` (default `var(--eldra-space-2)`) — the gap between the bar and a panel, drawn as the panel's own top padding so a hovering pointer never leaves the menu; `--eldra-nav-menu-dropdown-min`/`-max` (defaults `14rem`/`24rem`, capped at `100vw - 2rem`) — a dropdown panel's width; `--eldra-nav-menu-column-min` (default `12rem`) — the narrowest a mega panel's column gets before the grid wraps (`classes.columns: 'grid-cols-5'` fixes the count instead). `--eldra-nav-menu-drawer-row-height` (default `3.5rem`) — every top-level row in the drawer, link, accordion row or section heading; `--eldra-nav-menu-drawer-indent` (default `var(--eldra-space-4)`) — how far a panel's links sit in from their row. The drawer itself and the badges are `Drawer` and `Badge`, each restyled through its own row |
|
|
210
|
+
| `Notice` | none — the three coloured tones tint their fill and border with `color-mix()` over the shared `--eldra-color-success`/`-warning`/`-danger` and `--eldra-color-background` tokens, no per-component variable |
|
|
210
211
|
| `MultiSelect` | everything `Select` reads, plus `--eldra-select-pill-line` (the "+N" pill's line box) and `--eldra-checkbox-radius`/`--eldra-checkbox-border-width`, shared with `Checkbox` so a consumer restyles both at once; the tags' own colours `--eldra-select-tag-background` (default `var(--color-surface-strong)`), `--eldra-select-tag-text` (default `var(--color-text)`, also the remove button's hover colour and tint) and `--eldra-select-tag-muted` (default `var(--color-muted)`, the remove button at rest) — read by the tag and remove-button parts only, so `Chip` and a `tag` slot's content keep the theme |
|
|
211
212
|
| `Pagination` | none — every size (the 2.5rem page link/`control-h` previous-next, the `target-touch` compact arrows, the 0.9375rem `text-control` compact status) reuses a shared token or a shared arbitrary spacing multiple, no per-component variable |
|
|
212
213
|
| `Popover` | `--eldra-z-popover` (default `30`), shared with the other popover panels; `--eldra-popover-background` (default `var(--color-background)`), `--eldra-popover-border` (default `var(--color-border)`) and `--eldra-popover-text` (no default: unset, the panel inherits its colour as before) — the panel chrome's own colours, read by the `panel` part only, so setting them recolours it without re-theming the slotted content the way redefining `--eldra-color-*` there would. No size variable: it has no fixed size to clamp, unlike `Select`'s panel |
|
|
@@ -223,6 +224,8 @@ Every component supports all five of these; none hard-codes anything a store mig
|
|
|
223
224
|
| `Select` | `--eldra-select-panel-max-height` (default `20rem`), `--eldra-select-panel-max-width` (default `22rem`, clamped to `90vw`), `--eldra-z-popover` (default `30`), `--eldra-field-radius`, `--eldra-field-border-width`, `--eldra-select-group-tracking`, `--eldra-select-option-line`, `--eldra-select-swatch-edge`, the `--eldra-select-match-*` trio, and `--eldra-popover-origin` (`top left` / `bottom left`, set by the panel from the placement it resolved to); and the panel chrome's own colours, the `--eldra-select-panel-*` family `MultiSelect` and `SearchBar` read too: `--eldra-select-panel-background` (default `var(--color-background)`; the panel, `MultiSelect`'s footer and an unchosen option box), `--eldra-select-panel-border` (default `var(--color-border)`; the panel's edge, the search field's divider, group and create-row hairlines, the footer's top line), `--eldra-select-panel-text` (default `var(--color-text)` on the search field, the option and create rows; unset, the panel itself inherits its colour as before), `--eldra-select-panel-muted` (default `var(--color-muted)`; the search icon and placeholder, group headings, disabled rows, hints, untoned meta, the empty and loading rows, the footer count), `--eldra-select-panel-active` (default `var(--color-surface-strong)`; the active row's fill), `--eldra-select-panel-check` (the selected mark: default `var(--color-text)` for `Select`'s check, `var(--color-primary)` for `MultiSelect`'s filled box), `--eldra-select-panel-check-contrast` (default `var(--color-primary-contrast)`, `MultiSelect`'s tick) and `--eldra-select-panel-check-border` (default `var(--color-border-strong)`, an unchosen box's edge) — read by the panel's parts only, so setting them on `:root` or the teleport target recolours the panel without re-theming slotted option content the way redefining `--eldra-color-*` there would |
|
|
224
225
|
| `SiteForm` | none of its own: it composes `FormLayout`, `FieldWrapper`, `Input`, `Textarea`, `Select`, `Checkbox` and `Button`, each restyled through its own row; its `classes` reach their parts (see [Site forms](#site-forms)) |
|
|
225
226
|
| `Skeleton` | `--eldra-skeleton-line-height` (default `0.875rem`) and `--eldra-skeleton-line-gap` (default `0.3rem`, above and below) for `text` rows, `--eldra-skeleton-title-height` (default `1.5rem`), `--eldra-skeleton-box-height` (default `1rem`, an unsized `box`), `--eldra-skeleton-color` (default `surface-strong`, the shape's fill), `--eldra-skeleton-highlight` (default `background` at 60%, the glare) and `--eldra-skeleton-duration` (default `3s`, one sweep and its rest; the sweep is its first 60%); `width` still sets an inline style (see the Deviations entry) |
|
|
227
|
+
| `Spinner` | none — it is drawn in `currentColor` and sized by a class on the component (1.125rem without one) |
|
|
228
|
+
| `StepIndicator` | none — reads only the shared tokens from layer 1 |
|
|
226
229
|
| `StockBadge` | `--eldra-stock-status-line` (default `1.4`) — the status line text's line ratio, no token of its own |
|
|
227
230
|
| `Switch` | `--eldra-switch-radius` (default `var(--eldra-radius-full)`), `--eldra-switch-track-border-width` (default `1.5px`), `--eldra-switch-thumb-offset` (default `0.1875rem`, the thumb's rest inset from the track's start edge) |
|
|
228
231
|
| `Tab` | none — reads only the shared tokens from layer 1, plus `VariantPicker`'s `text-variant-pill` type style (no per-component variable of its own; see that component's row) |
|
|
@@ -996,9 +999,8 @@ Four things follow from the move, and each is a real consequence rather than a d
|
|
|
996
999
|
`transform`, `filter`, `perspective`, `backdrop-filter`, `contain: paint/layout/strict/content`
|
|
997
1000
|
or `will-change` on any of those: `position: fixed` then resolves against **that element**, not
|
|
998
1001
|
the viewport, and its `overflow` clips the panel exactly like any other ancestor. This package's
|
|
999
|
-
own `Drawer`
|
|
1000
|
-
|
|
1001
|
-
`Drawer` needs the same care as any other transformed ancestor. Point `teleport` at something
|
|
1002
|
+
own `Drawer` moves its panel with `translate` while it opens, closes and is dragged, and
|
|
1003
|
+
`translate` makes an element a containing block too: point `teleport` at something
|
|
1002
1004
|
plain, or leave it at `body`.
|
|
1003
1005
|
- **Custom properties are no longer inherited from around the control.** Set `--eldra-*` overrides
|
|
1004
1006
|
on `:root` (which is what [Customisation](#customisation) asks for anyway), not on a wrapper
|
|
@@ -1110,11 +1112,66 @@ Vue refuses a `v-slot` on a component that also has named slot templates as chil
|
|
|
1110
1112
|
go in an explicit `<template #default="{ errors }">` whenever there is an actions row — which there
|
|
1111
1113
|
almost always is.
|
|
1112
1114
|
|
|
1113
|
-
`errors` is keyed by each field's `name`, and holds only the messages
|
|
1114
|
-
**
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
`isSubmitting` and `submitCount`.
|
|
1115
|
+
`errors` is keyed by each field's `name`, and holds only the messages the fields are currently
|
|
1116
|
+
**showing**: each `Field*` reports the message it shows, and `errors` (and the error summary) is
|
|
1117
|
+
that report. So the wrapper, the control's own `aria-invalid` and the summary cannot disagree about
|
|
1118
|
+
whether a field is in error, and they change at the same moment. The other default-slot props are
|
|
1119
|
+
`values`, `meta`, `isSubmitting` and `submitCount`.
|
|
1120
|
+
|
|
1121
|
+
### When a field validates
|
|
1122
|
+
|
|
1123
|
+
Three boolean props on every `Field*` decide it, field by field:
|
|
1124
|
+
|
|
1125
|
+
| Prop | Default | What it does |
|
|
1126
|
+
| ----------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1127
|
+
| `validateOnBlur` | `true` | Validates the field when it loses focus and shows or clears its message then. `false`: a blur only marks the field touched. |
|
|
1128
|
+
| `validateOnValueUpdate` | `false` typed, `true` choice (below) | Validates on every change of the value; the message follows each change once the field has been touched or the form submitted. |
|
|
1129
|
+
| `validateOnMount` | `false` | Validates as soon as the field mounts **and shows the message at once**, without waiting for a blur or a submit (an edit form over stored data). |
|
|
1130
|
+
|
|
1131
|
+
Submitting the form always validates every field and shows every result, whatever the props say.
|
|
1132
|
+
|
|
1133
|
+
`validateOnValueUpdate` has two defaults, by the kind of control:
|
|
1134
|
+
|
|
1135
|
+
| Kind | Components | `validateOnValueUpdate` | Why |
|
|
1136
|
+
| ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1137
|
+
| Typed | `FieldInput`, `FieldTextarea`, `FieldCurrencyInput`, `FieldUnitInput`, `FieldSearchBar` | `false` | The value is built up one keystroke at a time, so validating each change would judge a half-typed value. |
|
|
1138
|
+
| Choice | `FieldCheckbox`, `FieldCheckboxGroup`, `FieldRadioGroup`, `FieldSwitch`, `FieldSelect`, `FieldMultiSelect`, `FieldVariantPicker`, `FieldQuantityStepper` | `true` | One click or selection is the whole value, often with no blur after it: a box that only validated on blur would go on saying "required" after it had been ticked. |
|
|
1139
|
+
|
|
1140
|
+
`FieldQuantityStepper` is a choice although it has a text field: a `QuantityStepper` writes its
|
|
1141
|
+
value only when a typed number is committed (on blur or `Enter`) or a button is pressed, never per
|
|
1142
|
+
keystroke, so every change it reports is a complete quantity.
|
|
1143
|
+
|
|
1144
|
+
So in a typed field, **typing never changes what the customer sees**: no message appears while a
|
|
1145
|
+
value is being typed, and a message already showing stays until the field is left or the form is
|
|
1146
|
+
submitted. A choice field answers the click: once it has been touched or the form submitted, its
|
|
1147
|
+
message appears or goes with each change. Every default can be overridden per field:
|
|
1148
|
+
|
|
1149
|
+
```vue
|
|
1150
|
+
<!-- Typed default: on blur, and on submit. -->
|
|
1151
|
+
<FieldInput name="email" type="email" />
|
|
1152
|
+
|
|
1153
|
+
<!-- Live: as the default, plus every change once the field is touched or the form submitted. -->
|
|
1154
|
+
<FieldInput name="email" type="email" validate-on-value-update />
|
|
1155
|
+
|
|
1156
|
+
<!-- Submit only: nothing until the form is submitted, and nothing again until the next submit. -->
|
|
1157
|
+
<FieldInput name="email" type="email" :validate-on-blur="false" />
|
|
1158
|
+
|
|
1159
|
+
<!-- Choice default: live. Turn it off to make a checkbox wait for a blur or a submit. -->
|
|
1160
|
+
<FieldCheckbox name="terms" :validate-on-value-update="false">I agree</FieldCheckbox>
|
|
1161
|
+
```
|
|
1162
|
+
|
|
1163
|
+
The same holds with `rules` on the field and with a `validationSchema` on the `Form`. A field
|
|
1164
|
+
holds the message it shows and changes it only at its own moments, because vee-validate's own
|
|
1165
|
+
error state can move at others: with a form-level schema, validating one field revalidates every
|
|
1166
|
+
field that has been validated before, so another field's blur would otherwise clear or change the
|
|
1167
|
+
message under a field that is still being typed in. A server error (`apiErrors`) is the exception
|
|
1168
|
+
in both directions: it shows at once, and goes the moment its own field is edited.
|
|
1169
|
+
|
|
1170
|
+
`validateOnValueUpdate` is vee-validate's own `useField` option and is read once, when the field is
|
|
1171
|
+
set up; the other two are read each time. There is no form-level switch: set the props per field.
|
|
1172
|
+
`FIELD_VALIDATION_DEFAULTS` (typed), `FIELD_CHOICE_VALIDATION_DEFAULTS` (choice) and
|
|
1173
|
+
`FIELD_VALIDATION_PROPS` are exported beside `FIELD_ONLY` for a wrapper of your own built on
|
|
1174
|
+
`useFieldControl`.
|
|
1118
1175
|
|
|
1119
1176
|
Three of the controls own an `error` prop of their own — `FieldRadioGroup`, `FieldCheckboxGroup`
|
|
1120
1177
|
and `FieldQuantityStepper` — and those draw their message themselves **only outside** a
|
|
@@ -1274,6 +1331,79 @@ comparing the package against the spec can tell an addition from a drift.
|
|
|
1274
1331
|
`tagPlacement: 'inside'` with `maxTagRows`, and `maxSummary: 'fit'`. `Tab`: `disabled`.
|
|
1275
1332
|
`Switch`: `thumb`/`trackStart`/`trackEnd` slots, `invalid`. `Checkbox`: box alone without a
|
|
1276
1333
|
label. `Button`: pressed fill on `ghost`, a static string `as` tag, `keepNameWhileLoading`.
|
|
1334
|
+
- **`Notice`, `StepIndicator` and an exported `Spinner`** (operator decision, 2026-11-15, for
|
|
1335
|
+
Eldra's hosted checkout; none is in spec 1, and none holds checkout wording or data). Each is
|
|
1336
|
+
written up here in the spec's own section shape, since the spec has no section to point at.
|
|
1337
|
+
|
|
1338
|
+
**`Notice`** — a message that stays in the page flow: guidance beside a form, or the outcome of
|
|
1339
|
+
something the visitor did. Not a `Toast` (which floats, times out and lives in a `Toaster`'s live
|
|
1340
|
+
region), not an `EmptyState` (a whole region with nothing to show), not a field error
|
|
1341
|
+
(`FieldWrapper`). No close button and no focus movement.
|
|
1342
|
+
|
|
1343
|
+
- _Anatomy_: `root` · `icon` (optional, first in the row) · `content` holding `title` (optional),
|
|
1344
|
+
`text` (the body) and `actions` (optional row of buttons or links).
|
|
1345
|
+
- _Properties_: `tone` (`info` default, `success`, `warning`, `danger`; also `data-tone` on the
|
|
1346
|
+
root), `title`, `text`, `icon` (a component replaces the tone's default, `null` removes it),
|
|
1347
|
+
`headingLevel` (2–6: the title becomes a heading; otherwise a `<p>`), `announce` (default
|
|
1348
|
+
`true`), `classes`. Slots: `default` (body, over `text`), `title`, `actions`.
|
|
1349
|
+
- _Sizes_: padding 0.75rem block / 1rem inline, 0.75rem gap, `radius-md`, 1px border, no shadow;
|
|
1350
|
+
icon 1.25rem at stroke 1.75, nudged 0.125rem down; title and body 0.875rem (`text-body-sm`), the
|
|
1351
|
+
title weight 600; actions 0.5rem below the body, 0.75rem apart.
|
|
1352
|
+
- _States_: `info` is `surface` with a `border` hairline and a `text` icon. The other three fill
|
|
1353
|
+
with their colour role mixed 92% toward `background`, border the same role mixed 60% toward
|
|
1354
|
+
`background`, icon in the full role colour; title and body are `text` on every tone. Default
|
|
1355
|
+
icons: `info-circle`, `circle-check`, `alert-triangle`, `alert-circle` (`Toast`'s own four), so
|
|
1356
|
+
colour is never the only signal (1.4.1).
|
|
1357
|
+
- _Keyboard_: none of its own. `Tab` reaches whatever the `actions` slot or the body holds, in
|
|
1358
|
+
document order.
|
|
1359
|
+
- _Accessibility_: `info`, `success` and `warning` are `role="status"` (polite); `danger` is
|
|
1360
|
+
`role="alert"` (assertive) — the same split `Toast` makes. `announce: false` drops the role,
|
|
1361
|
+
for a notice inside an element that is already a live region (two nested regions announce
|
|
1362
|
+
twice) or one that is static page content from the first render. Icons are `aria-hidden`.
|
|
1363
|
+
|
|
1364
|
+
**`StepIndicator`** — an ordered list showing how far something has come. It reports only: no
|
|
1365
|
+
step is a link or a button. Steps a visitor moves between are `Tabs`.
|
|
1366
|
+
|
|
1367
|
+
- _Anatomy_: `root` (an `<ol>`) · `step` (an `<li>`) holding `marker` and `content`; `content`
|
|
1368
|
+
holds `label` (with `labelIcon`, the check before a done label when horizontal, and `status`,
|
|
1369
|
+
the visually hidden state) and `description` (optional secondary line: a date, a place).
|
|
1370
|
+
- _Properties_: `steps` (`{ label, description? }[]`), `current` (index from 0; `steps.length`
|
|
1371
|
+
marks every step done, a negative number every step upcoming), `orientation` (`horizontal`
|
|
1372
|
+
default, `vertical`; also `data-orientation`), `classes`. Each step carries `data-state`
|
|
1373
|
+
(`done`, `current`, `upcoming`). Attributes reach the `<ol>`: name it with `aria-label`.
|
|
1374
|
+
- _Sizes_: horizontal — equal columns (`minmax(0, 1fr)` each) 0.5rem apart, marker a 0.25rem
|
|
1375
|
+
full-radius bar across the column, 0.5rem above the text. Vertical — steps 0.75rem apart, marker
|
|
1376
|
+
a 1.25rem circle 0.625rem before the text. Label 0.875rem, description 0.8125rem
|
|
1377
|
+
(`text-caption`); check 1rem (horizontal) or 0.875rem (in the circle) at stroke 2.25.
|
|
1378
|
+
- _States_: done — marker `primary`, label `text` weight 400, with a check (before the label
|
|
1379
|
+
when horizontal, inside the circle when vertical). Current — marker `primary` (vertical: a
|
|
1380
|
+
`primary-contrast` dot inside), label `text` weight 600. Upcoming — marker `border` (vertical:
|
|
1381
|
+
an empty `border-strong` ring), label `muted`, no icon. Every marker keeps a border, so it
|
|
1382
|
+
survives forced colours.
|
|
1383
|
+
- _Keyboard_: none. Nothing in it is focusable; `Tab` passes over it.
|
|
1384
|
+
- _Accessibility_: a real `<ol>`, so the count and each position are announced.
|
|
1385
|
+
`aria-current="step"` on the current step; the other two say "(completed)" / "(not started)"
|
|
1386
|
+
in visually hidden text after the label (`messages.stepCompleted`, `messages.stepNotStarted`).
|
|
1387
|
+
Markers and icons are `aria-hidden`. State never rests on colour alone: check, weight, or
|
|
1388
|
+
neither.
|
|
1389
|
+
|
|
1390
|
+
**`Spinner`** — the circle `Button`, `LoadMore`, `Price` and `StockBadge` already drew, exported
|
|
1391
|
+
for a wait that is not inside one of them. One prop, `label`: without it the spinner is
|
|
1392
|
+
decorative (`aria-hidden`), with it `role="img"` named by the label — `Icon`'s own rule. It is
|
|
1393
|
+
never a live region; the busy region around it announces the wait. 1.125rem unless a size class
|
|
1394
|
+
on the component says otherwise (the class replaces the default through `mergeClass`), drawn in
|
|
1395
|
+
`currentColor`. Turning every 700ms; a pulse instead under reduced motion.
|
|
1396
|
+
|
|
1397
|
+
- **`RadioGroup` cards' leading part** (operator decision, 2026-11-15): `icon` on an option and a
|
|
1398
|
+
`leading` slot (`{ option }`), for an icon or a logo between the radio and the title — the spec's
|
|
1399
|
+
card anatomy has radio, title, hint and meta only. Cards only, like `meta`. An option with an
|
|
1400
|
+
`icon`, or any option once the slot is given, takes a fourth grid column
|
|
1401
|
+
(`auto auto 1fr auto`): the `leading` part sits in column 2, centred against the title and the
|
|
1402
|
+
hint together (it spans both rows when there is a hint), and the hint and meta move one column
|
|
1403
|
+
on. A card with neither keeps its three columns and renders exactly as before. The part is
|
|
1404
|
+
inside the option's `<label>`, so a click on it selects the option; the `icon` is drawn
|
|
1405
|
+
`aria-hidden` at 1.25rem / stroke 1.75, and a logo in the slot that only repeats the title
|
|
1406
|
+
should be `alt=""`. Nothing about the keyboard changes.
|
|
1277
1407
|
- **`SiteForm` and `useSiteForm`**: a form from the platform's Forms API, drawn from its public
|
|
1278
1408
|
definition with this package's own controls, checked by the platform's rules and submitted
|
|
1279
1409
|
through `@eldrajs/sdk`. The spec has form controls and a form layout but no platform form; see
|
|
@@ -1591,8 +1721,8 @@ children?, layout?, groups? }`, one level of children. Children sharing a `group
|
|
|
1591
1721
|
While it is on, the value keeps its text and its place, dimmed to `--eldra-revalidating-opacity`
|
|
1592
1722
|
(a shared token, default `0.75`, applied through the `eldra-revalidating` utility — per value part,
|
|
1593
1723
|
never on the root, because CSS opacity composites and a dimmed root would take the spinner down
|
|
1594
|
-
with it); a `1em` spinner — the same shape `Button` draws,
|
|
1595
|
-
|
|
1724
|
+
with it); a `1em` spinner — the same shape `Button` draws, the package's own `Spinner`
|
|
1725
|
+
— is drawn beside it; the root carries `aria-busy="true"`; and a visually hidden
|
|
1596
1726
|
`aria-live="polite"` region reads `messages.updatingPrice` / `messages.updatingStock`.
|
|
1597
1727
|
|
|
1598
1728
|
**The spinner reserves no space at all.** It is a flex item of width `0` whose negative
|
|
@@ -2521,15 +2651,15 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
2521
2651
|
wrapper is in the root entry and cannot know about vee-validate, and a control cannot write to
|
|
2522
2652
|
the wrapper that provides its context — so `Form`'s default slot carries `errors`, keyed by field
|
|
2523
2653
|
`name`, and the wrapper is bound to it (`:error="errors.email"`). It carries only the messages
|
|
2524
|
-
|
|
2525
|
-
|
|
2654
|
+
the fields are currently showing — each `Field*` reports its own — so the wrapper and the
|
|
2655
|
+
control's `aria-invalid` cannot disagree.
|
|
2526
2656
|
- **`Form` adds `successMessage`, which is not in the spec's Form layout property table.** The
|
|
2527
2657
|
spec's Success state asks for the confirmation to be "announced in a polite live region", and
|
|
2528
2658
|
`FormLayout` already has that region (`statusMessage`) — `successMessage` is simply the half a
|
|
2529
2659
|
form component can own: it fills the region once a submit passes validation. The visible half —
|
|
2530
2660
|
replacing the form or navigating — stays the page's. An explicit `statusMessage` wins over it.
|
|
2531
|
-
- **A server error shows immediately, without waiting for a blur or a submit.**
|
|
2532
|
-
|
|
2661
|
+
- **A server error shows immediately, without waiting for a blur or a submit.** A rule message
|
|
2662
|
+
waits for one of those so it does not appear under a half-typed value; an `apiErrors` entry is
|
|
2533
2663
|
the answer to a submit that has already happened, so there is nothing left to wait for — and a
|
|
2534
2664
|
form rendered with errors from an earlier round trip would otherwise show none of them.
|
|
2535
2665
|
- **`FieldSearchBar` takes neither an `id` nor a `name` from the field.** A `SearchBar` sets its
|
|
@@ -2547,11 +2677,17 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
2547
2677
|
validate in the browser. `action` and `method` are still forwarded (they are `FormLayout`'s
|
|
2548
2678
|
props), and the hidden native `<select>` inside every `Select` still carries its value — so a
|
|
2549
2679
|
scripting-free post is one `FormLayout` away, without this entry.
|
|
2550
|
-
- **
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2680
|
+
- **A field validates on blur from the start, not only "for fields that were invalid after the
|
|
2681
|
+
first submit"** (operator decision, 2026-11-15). The spec's rule is "Validate on submit, then on
|
|
2682
|
+
blur for fields that were invalid after the first submit"; here every `Field*` validates on blur
|
|
2683
|
+
by default (`validateOnBlur`), before a first submit too. A typed field never validates while
|
|
2684
|
+
typing unless `validateOnValueUpdate` is set; a choice field (a checkbox, a select) validates on
|
|
2685
|
+
each change by default. Until 0.3.x a field revalidated on every change and its message
|
|
2686
|
+
followed each keystroke once it had been touched. See [When a field validates](#when-a-field-validates).
|
|
2687
|
+
- **Fields can be revalidated while submitting.** The spec's Submitting state says the fields "stay
|
|
2688
|
+
editable but aren't re-validated". A blur still validates its field while a submit is in flight
|
|
2689
|
+
(and a `validateOnValueUpdate` field still follows its value): suppressing that would leave a
|
|
2690
|
+
field edited mid-flight with a message that no longer matches its value.
|
|
2555
2691
|
- **A `group` `FieldWrapper` renders `tabindex="-1"` on its `<fieldset>`.** Not in the spec's
|
|
2556
2692
|
anatomy; it is what makes an error summary's link land. A group has no single control, so the
|
|
2557
2693
|
summary points `#<id>` at the fieldset itself, and a browser moves focus to a fragment's target
|
|
@@ -3050,18 +3186,30 @@ null>`, not a Vue `InjectionKey`, despite matching this package's `*_KEY` naming
|
|
|
3050
3186
|
click" — with no exception column the way the shared modal rules' "unless the dialog holds
|
|
3051
3187
|
unsaved input" gives `Dialog`. `useDialog`'s `dismissable` option is simply never passed, which
|
|
3052
3188
|
defaults to `true`.
|
|
3053
|
-
- **`Drawer`
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3189
|
+
- **`Drawer` slides its panel a short way, not the whole drawer from off-screen, and also leaves
|
|
3190
|
+
that way.** The spec asks for a slide from the edge; a full-width slide reads as a page change on
|
|
3191
|
+
a wide screen, so the panel enters from `--eldra-drawer-slide` (default `2rem`) toward its edge
|
|
3192
|
+
while it fades in over `--eldra-drawer-enter-duration` (400ms), and leaves the same way over
|
|
3193
|
+
`--eldra-drawer-exit-duration` (260ms), on one curve (`cubic-bezier(0.32, 0.72, 0, 1)`). It is a
|
|
3194
|
+
CSS transition (`@starting-style`, with `display` and `overlay` kept for the exit) in the
|
|
3195
|
+
`eldra-drawer-motion` utility, on the panel rather than the root, so the `::backdrop` fades on its
|
|
3196
|
+
own and its opacity can follow a drag (`--eldra-drawer-drag`). Under reduced motion the panel
|
|
3197
|
+
only fades, over `duration-base`, linear, the same as `Dialog`'s reduced entrance. A swipe that
|
|
3198
|
+
closes the drawer takes the panel the rest of the way off its edge, at the speed it was let go.
|
|
3199
|
+
- **`Drawer` swipes closed, `swipe` (default `true`).** A side drawer follows a drag toward its own
|
|
3200
|
+
edge once the pointer has moved `--eldra-drawer-swipe-threshold` (default `24px`) that way and
|
|
3201
|
+
more along than across, so a stray movement or a scroll never moves it; a mouse or pen drags by
|
|
3202
|
+
the header (text in the body stays selectable), a finger from anywhere that is not a control or a
|
|
3203
|
+
sideways scroller. Let go past 35% of the panel, or flicked, it closes with the reason
|
|
3204
|
+
`"swipe"`; otherwise it springs back. Dragged back past its resting position, it stays there. Keyboard users close it
|
|
3205
|
+
with `Escape` or the close button, as before; a keyboard drag would only be a slower `Escape`.
|
|
3206
|
+
- **`Drawer`'s `mobileSheet` (default `false`) is a bottom sheet below a 48rem viewport**, not the
|
|
3207
|
+
full-screen panel: content height up to `--eldra-drawer-sheet-gap` (default `3rem`) from the top,
|
|
3208
|
+
rounded top corners (`--eldra-drawer-sheet-radius`, default `radius-xl`), a grab handle (the
|
|
3209
|
+
`handle` part, `aria-hidden`: the close button and `Escape` are the accessible way out,
|
|
3210
|
+
`--eldra-drawer-handle-color`). It rises from the bottom and is dragged down by its handle and
|
|
3211
|
+
header after 4px, or by its body when the body is scrolled to the top, the way a native sheet
|
|
3212
|
+
takes over a scroll. Off by default because a full-screen drawer is the spec's mobile variant.
|
|
3065
3213
|
- **`Drawer`'s close button aria-label is a function of whichever prop names the drawer, not a
|
|
3066
3214
|
fixed string.** The design spec's own Accessibility notes give three different literal labels
|
|
3067
3215
|
for the one control ("Close cart", "Close menu", "Close filters"), which this package cannot know
|
|
@@ -3074,9 +3222,8 @@ null>`, not a Vue `InjectionKey`, despite matching this package's `*_KEY` naming
|
|
|
3074
3222
|
own convention every stateful component in this package shares) replaces `open`/`openChange`;
|
|
3075
3223
|
`close(reason)` fires with `"escape"`/`"backdrop"`/`"button"`/an action value, the identical shape
|
|
3076
3224
|
`Dialog`'s own `close` event already uses, rather than a bare `close` with no reason. There is no
|
|
3077
|
-
`afterLeave`:
|
|
3078
|
-
|
|
3079
|
-
as `close` would tell a consumer nothing `close` does not already.
|
|
3225
|
+
`afterLeave`: `close` fires when the drawer starts to leave, and nothing in the exit transition is
|
|
3226
|
+
a consumer's to wait for. `close` also takes `"swipe"`.
|
|
3080
3227
|
- **`Tooltip`'s bubble stays mounted permanently, unlike every other teleported panel in this
|
|
3081
3228
|
package.** `Select`/`MultiSelect`/`SearchBar` mount their panel fresh on every open (`v-if` on
|
|
3082
3229
|
the `<Teleport>`), so `animate-eldra-popover-in`'s keyframe replays each time. The spec's own
|