@eldrajs/ui 0.3.7 → 0.3.9
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 +6 -0
- package/LICENSE-country-flag-icons +25 -0
- package/README.md +274 -66
- package/dist/CountryFlag-DOa8lOHp.js +71 -0
- package/dist/PhoneInput-CX83wgD0.js +695 -0
- package/dist/{VariantPicker-Cr_AkX47.js → VariantPicker-BqLbiONX.js} +122 -2302
- package/dist/components/chip/Chip.vue.d.ts +9 -0
- package/dist/components/dialog/Dialog.vue.d.ts +9 -0
- package/dist/components/drawer/Drawer.vue.d.ts +9 -0
- package/dist/components/filter-panel/FilterGroup.vue.d.ts +9 -0
- package/dist/components/filter-panel/FilterPanel.vue.d.ts +9 -0
- package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +9 -0
- package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +9 -0
- package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +9 -0
- package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +9 -0
- package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +9 -0
- package/dist/components/lightbox/Lightbox.vue.d.ts +9 -0
- package/dist/components/nav-menu/NavMenu.vue.d.ts +9 -0
- package/dist/components/pagination/Pagination.vue.d.ts +9 -0
- package/dist/components/range-slider/RangeSlider.vue.d.ts +9 -0
- package/dist/components/search-bar/SearchBar.vue.d.ts +9 -0
- package/dist/components/search-modal/SearchModal.vue.d.ts +9 -0
- package/dist/components/select/MultiSelect.vue.d.ts +10 -0
- package/dist/components/select/Select.vue.d.ts +9 -0
- package/dist/components/select/types.d.ts +7 -1
- package/dist/components/site-form/SiteForm.vue.d.ts +9 -0
- package/dist/components/toast/Toast.vue.d.ts +9 -0
- package/dist/components/toast/Toaster.vue.d.ts +9 -0
- package/dist/components.css +64 -0
- package/dist/flag/CountryFlag.vue.d.ts +9 -0
- package/dist/flag/flags.d.ts +8 -0
- package/dist/flag/index.d.ts +9 -0
- package/dist/flag.js +1 -0
- package/dist/index.js +4 -2
- package/dist/messages/en-US.d.ts +21 -0
- package/dist/messages/is-IS.js +10 -1
- package/dist/phone/PhoneInput.vue.d.ts +221 -0
- package/dist/phone/caret.d.ts +14 -0
- package/dist/phone/examples.d.ts +2 -0
- package/dist/phone/index.d.ts +13 -0
- package/dist/phone/phone.d.ts +62 -0
- package/dist/phone/phoneFlagData.d.ts +2 -0
- package/dist/phone/rule.d.ts +22 -0
- package/dist/phone/types.d.ts +63 -0
- package/dist/phone/vee-validate/FieldPhoneInput.vue.d.ts +24 -0
- package/dist/phone/vee-validate/index.d.ts +3 -0
- package/dist/phone/vee-validate/types.d.ts +3 -0
- package/dist/phone/vee-validate.js +96 -0
- package/dist/phone.js +3 -0
- package/dist/phoneFlagData-D9dDT2uC.js +261 -0
- package/dist/resolver.d.ts +15 -2
- package/dist/resolver.js +26 -4
- package/dist/style.css +64 -0
- package/dist/useEldraScope-BDbGzt7R.js +32 -0
- package/dist/useFieldControl-D1j54YON.js +273 -0
- package/dist/{useMessages-DOHGfip_.js → useMessages-CkhrRmu7.js} +22 -1
- package/dist/usePopover-ECHpsSRF.js +2199 -0
- package/dist/utilities.css +37 -0
- package/dist/vee-validate.js +7 -273
- package/dist/vue-i18n.js +4 -1
- package/package.json +23 -2
package/README.md
CHANGED
|
@@ -24,6 +24,8 @@ Peer: **`vue ^3.5`**. The floor is 3.5, not 3.4: every control's ids come from `
|
|
|
24
24
|
added in 3.5, so on 3.4 the install succeeds and the first control to mount throws
|
|
25
25
|
`useId is not a function`. `vee-validate ^4.12` is an **optional** peer — only the `./vee-validate`
|
|
26
26
|
entry needs it, and nothing else in the package imports it.
|
|
27
|
+
`libphonenumber-js ^1.13` is an **optional** peer in the same way: only the [`./phone`](#phone)
|
|
28
|
+
entries need it.
|
|
27
29
|
|
|
28
30
|
## Styles
|
|
29
31
|
|
|
@@ -173,72 +175,73 @@ Every component supports all five of these; none hard-codes anything a store mig
|
|
|
173
175
|
token, a component-specific corner radius. Each one is documented on the component's own
|
|
174
176
|
Storybook docs page; the variables currently declared:
|
|
175
177
|
|
|
176
|
-
| Component
|
|
177
|
-
|
|
|
178
|
-
| `Accordion`
|
|
179
|
-
| `AccordionItem`
|
|
180
|
-
| `Avatar`
|
|
181
|
-
| `AvatarGroup`
|
|
182
|
-
| `Badge`
|
|
183
|
-
| `Breadcrumb`
|
|
184
|
-
| `Button`
|
|
185
|
-
| `ButtonGroup`
|
|
186
|
-
| `Carousel`
|
|
187
|
-
| `Checkbox`
|
|
188
|
-
| `CheckboxGroup`
|
|
189
|
-
| `Chip`
|
|
190
|
-
| `ChipGroup`
|
|
191
|
-
| `Container`
|
|
192
|
-
| `ContentCard`
|
|
193
|
-
| `CurrencyInput`
|
|
194
|
-
| `Dialog`
|
|
195
|
-
| `Drawer`
|
|
196
|
-
| `EditorPlaceholder`
|
|
197
|
-
| `EmptyState`
|
|
198
|
-
| `FeatureCard`
|
|
199
|
-
| `FieldWrapper`
|
|
200
|
-
| `FilterPanel`
|
|
201
|
-
| `FormLayout`
|
|
202
|
-
| `Icon`
|
|
203
|
-
| `Image`
|
|
204
|
-
| `Input`
|
|
205
|
-
| `Lightbox`
|
|
206
|
-
| `Link`
|
|
207
|
-
| `LoadMore`
|
|
208
|
-
| `LogoItem`
|
|
209
|
-
| `NavMenu`
|
|
210
|
-
| `Notice`
|
|
211
|
-
| `MultiSelect`
|
|
212
|
-
| `Pagination`
|
|
213
|
-
| `
|
|
214
|
-
| `
|
|
215
|
-
| `
|
|
216
|
-
| `
|
|
217
|
-
| `
|
|
218
|
-
| `
|
|
219
|
-
| `
|
|
220
|
-
| `
|
|
221
|
-
| `
|
|
222
|
-
| `
|
|
223
|
-
| `
|
|
224
|
-
| `
|
|
225
|
-
| `
|
|
226
|
-
| `
|
|
227
|
-
| `
|
|
228
|
-
| `
|
|
229
|
-
| `
|
|
230
|
-
| `
|
|
231
|
-
| `
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
238
|
-
| `
|
|
239
|
-
| `
|
|
240
|
-
| `
|
|
241
|
-
| `
|
|
178
|
+
| Component | CSS variables |
|
|
179
|
+
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
180
|
+
| `Accordion` | none — the top divider is a stock `border-t`, no per-component variable |
|
|
181
|
+
| `AccordionItem` | `--eldra-accordion-title-line` (default `1.4`) — the label's line ratio, no token of its own |
|
|
182
|
+
| `Avatar` | `--eldra-avatar-initials-size-{sm,md,lg,xl}` (defaults `0.76rem`/`0.95rem`/`1.33rem`/`2.28rem`, "38% of diameter" — no token of its own), `--eldra-avatar-initials-tracking` (default `0.02em`), `--eldra-avatar-icon-size-{sm,md,lg,xl}` (defaults `0.857rem`/`1.071rem`/`1.5rem`/`2.571rem`, the spec's own lg number scaled proportionally to the other three diameters) |
|
|
183
|
+
| `AvatarGroup` | none — the overlap and stack order are plain Tailwind, no per-component variable |
|
|
184
|
+
| `Badge` | `--eldra-badge-line-height` (default `1`) — the badge text's line ratio, no token of its own |
|
|
185
|
+
| `Breadcrumb` | none — the collapse threshold reads `--container-tablet` (`Container`'s own 48rem gutter breakpoint), and the link/ellipsis boxes reuse `target-min`/`eldra-link-radius`/`radius-sm`, no per-component variable of its own |
|
|
186
|
+
| `Button` | `--eldra-button-radius` (default `var(--eldra-radius-md)`), `--eldra-button-border-width` (default `1px`; the height stays the same, and an attached `ButtonGroup` overlaps by this width), `--eldra-button-line-height` (default `1.2`), `--eldra-button-font-size-lg` (default `1.0625rem`, the one button size with no type token of its own) |
|
|
187
|
+
| `ButtonGroup` | none — reads only the shared tokens from layer 1 |
|
|
188
|
+
| `Carousel` | `--eldra-carousel-per-view-base`/`-md`/`-lg` (bound as an inline style on the track by `carouselPerViewStyle`, resolved into `--eldra-carousel-per-view` per container-query breakpoint by the `eldra-carousel-track` utility, no default of its own — a slide with none set stays full width) and `--eldra-carousel-gap` (default `var(--eldra-space-4)`), both read by the `eldra-carousel-slide` utility's width formula; `--eldra-carousel-dot-size` (default `0.5rem`) and `--eldra-carousel-dot-ring` (default `1.5px`), read by `eldra-carousel-dot`; `--eldra-carousel-bleed` (default `0px`) — the inline gutter the track bleeds out to, as its own padding, the negative margin that cancels that padding and its scroll padding at once, each `max()`-ed with the focus ring's reach so a bleed never costs the ring the room the track reserves for it (set it per breakpoint through `classes.track`, never a `px-*`/`-mx-*`/`scroll-px-*` utility of your own — those replace the reservation on that axis instead of composing with it) |
|
|
189
|
+
| `Checkbox` | `--eldra-checkbox-radius` (default `var(--eldra-radius-sm)`), `--eldra-checkbox-border-width` (default `1.5px`), `--eldra-checkbox-border-width-invalid` (default `2px`) |
|
|
190
|
+
| `CheckboxGroup` | none — reads only the shared tokens from layer 1 |
|
|
191
|
+
| `Chip` | none — the selected/hover fills are `color-mix()` over shared `--eldra-color-*` tokens, no per-component variable |
|
|
192
|
+
| `ChipGroup` | none — reads only the shared tokens from layer 1 |
|
|
193
|
+
| `Container` | none — the gutter widths (`--eldra-gutter-{mobile,tablet,desktop}`) are shared tokens, also read by `Section`; the three finite `width` values likewise read the shared `--eldra-container-{narrow,content,wide}` tokens directly, through `Container`'s own `eldra-container-{narrow,content,wide}` utilities rather than Tailwind's `max-w-narrow`/`-content`/`-wide` — see the Deviations entry below |
|
|
194
|
+
| `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 |
|
|
195
|
+
| `CurrencyInput` | `UnitInput`'s exactly (it renders a `UnitInput` with `isCurrency` always on) — see the `UnitInput` row |
|
|
196
|
+
| `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 |
|
|
197
|
+
| `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)`) |
|
|
198
|
+
| `EditorPlaceholder` | `--eldra-editor-placeholder-border-width` (default `1.5px`) — the dashed boundary's width, distinct from `EmptyState`'s own stock `border` (1px) |
|
|
199
|
+
| `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 |
|
|
200
|
+
| `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 |
|
|
201
|
+
| `FieldWrapper` | `--eldra-field-note-line-height` (default `1.45`) — the line the help and error text share |
|
|
202
|
+
| `FilterPanel` | `--eldra-filter-subheading-tracking` (default `0.06em`, a size-system sub-heading's letter spacing — the overline token's own 0.12em pushes "SOCKS (EU)" onto two lines in a 15rem sidebar), `--eldra-filter-swatch-edge-width` (default `1px`) and `--eldra-filter-swatch-ring-width` (default `1.5px`) for a colour swatch's edge and the ring it gains when picked, and `--eldra-filter-histogram-bar-min` / `--eldra-filter-histogram-bar-radius` (defaults `2px` / `1px`) for one histogram bar's minimum height and its two top corners. Everything else is a shared token or comes from the components it composes (`Checkbox`, `Switch`, `Chip`, `Badge`, `Input`, `Button`, `CurrencyInput`, `RangeSlider`), each restyled through its own row |
|
|
203
|
+
| `FormLayout` | `--eldra-form-summary-radius` (default `var(--eldra-radius-md)`) — the status summary box's corner radius |
|
|
204
|
+
| `Icon` | none — reads only the shared tokens from layer 1 |
|
|
205
|
+
| `Image` | `--eldra-image-hatch-gap` (default `0.75rem`) — the live "No image" placeholder's diagonal-line repeat distance |
|
|
206
|
+
| `Input` | `--eldra-input-radius` (default `var(--eldra-radius-md)`), `--eldra-control-font-size` (default `0.9375rem`), `--eldra-control-font-size-mobile` (default `1rem`), `--eldra-control-line-height` (default `1.5rem`), `--eldra-field-border-width` (default `1px`) |
|
|
207
|
+
| `Lightbox` | none of its own — the entrance keyframe (`eldra-lightbox-in`) and every size are either shared tokens or literal component-specific classes (`px-16`, `size-11`/`max-md:size-11`), the same "no dedicated variable" shape as `AvatarGroup`/`ButtonGroup` |
|
|
208
|
+
| `Link` | `--eldra-link-radius` (default `2px`) — the focus ring's corner radius on every variant |
|
|
209
|
+
| `LoadMore` | none — the status/meter/button sizes all reuse shared tokens (`text-body-sm`, `control-h`, `text-button-md`), no per-component variable |
|
|
210
|
+
| `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`) |
|
|
211
|
+
| `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 |
|
|
212
|
+
| `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 |
|
|
213
|
+
| `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 |
|
|
214
|
+
| `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 |
|
|
215
|
+
| `PhoneInput` (`@eldrajs/ui/phone`) | `--eldra-phone-flag-radius` (default `2px`), `--eldra-phone-flag-border` (the flag's hairline; default `var(--eldra-color-border)`), `--eldra-phone-flag-fill` (shown until the artwork has loaded; default `var(--eldra-color-surface-strong)`); the box is `Input`'s (`--eldra-input-radius`, `--eldra-field-border-width`, the `--eldra-control-*` type variables) and the country list is `Select`'s panel (every `--eldra-select-panel-*` variable) |
|
|
216
|
+
| `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 |
|
|
217
|
+
| `Price` | `--eldra-price-current-sm-size` (default `0.9375rem`), `--eldra-price-current-lg-size` (default `1.5rem`) — only `sm`/`lg` need one: `md`'s current price inherits the surrounding text, and `compareAt`/`from`/`unit` scale off whichever size the root sets (`0.9em`, a literal ratio the spec itself gives, and a fixed `0.8125rem`), so neither needs a variable of its own |
|
|
218
|
+
| `ProductCard` | none of its own — it composes `Image`/`Badge`/`StockBadge`/`Price`/`Button`, each restyled through its own row above |
|
|
219
|
+
| `QuantityStepper` | `--eldra-stepper-radius` (default `var(--eldra-radius-md)`) |
|
|
220
|
+
| `Radio` | the radio circle reads `--eldra-checkbox-border-width`/`-invalid`, shared with `Checkbox` and `RadioGroup` |
|
|
221
|
+
| `RadioGroup` | `--eldra-radio-card-border-width` (default `1px`) and `--eldra-radio-card-radius` (default `radius-md`) for the card boundary; `--eldra-checkbox-border-width`/`-invalid` for the radio circle itself, shared with `Checkbox` |
|
|
222
|
+
| `RangeSlider` | `--eldra-range-thumb-size` (default `1.25rem`), `--eldra-range-thumb-border-width` (default `1.5px`), `--eldra-range-thumb-halo` (default `0.25rem`, the hover/dragging ring drawn outside the thumb) and `--eldra-range-track-height` (default `0.375rem`), read by the `eldra-range-thumb`/`-track`/`-gutter` utilities — the gutter that keeps a thumb, its focus ring **and** its pointer target inside the control is the larger of the ring's reach and half the target, `calc()`-ed from those variables (and switched on the same 48rem container edge the target is), so enlarging any of them moves the reservation with it |
|
|
223
|
+
| `Rating` | none — the half-star overlay (`eldra-rating-half`) is a fixed `clip-path`, no per-component variable |
|
|
224
|
+
| `SearchBar` | `--eldra-search-panel-max-height` (default `32rem`, clamped to `70vh`), `--eldra-search-text-line`, `--eldra-search-empty-line`, `--eldra-search-kbd-line`, `--eldra-input-radius`, `--eldra-field-border-width`, `--eldra-z-popover`, and `--eldra-popover-origin` (set by the panel itself from the placement it resolved to: `top left` below the field, `bottom left` above it); and `Select`'s `--eldra-select-panel-background`/`-border`/`-text`/`-muted`/`-active` (same defaults) for the results panel's surface, edge and hairlines, rows and chips, headings, minor rows, icons and no-results advice, and the active row and chip fill |
|
|
225
|
+
| `SearchModal` | `--eldra-search-modal-width` (default `40rem`), `--eldra-search-modal-max-height` (default `40rem`) — both clamped to the viewport inside their own utility, which also carries the full-screen-below-a-48rem-_viewport_ media query; `--eldra-search-modal-field-size` (default `1.0625rem`), `--eldra-search-modal-foot-size`/`-line` (defaults `0.75rem`/`1.4`), `--eldra-search-modal-kbd-size` (default `0.6875rem`) — none with a token of their own; plus everything `SearchBar`'s reused `SearchResultsPanel` reads (`--eldra-search-text-line`, `--eldra-search-empty-line`, `--eldra-control-line-height`) |
|
|
226
|
+
| `Section` | none — the vertical rhythm (`--eldra-section-{sm,md,lg}`) and the gutters it shares with `Container` are shared tokens |
|
|
227
|
+
| `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 |
|
|
228
|
+
| `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)) |
|
|
229
|
+
| `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) |
|
|
230
|
+
| `Spinner` | none — it is drawn in `currentColor` and sized by a class on the component (1.125rem without one) |
|
|
231
|
+
| `StepIndicator` | none — reads only the shared tokens from layer 1 |
|
|
232
|
+
| `StockBadge` | `--eldra-stock-status-line` (default `1.4`) — the status line text's line ratio, no token of its own |
|
|
233
|
+
| `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) |
|
|
234
|
+
| `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) |
|
|
235
|
+
| `TabPanel` | none — reads only the shared tokens from layer 1 |
|
|
236
|
+
| `TablerIcon` | none — reads only the shared tokens from layer 1, the same as `Icon` |
|
|
237
|
+
| `Tabs` | none — reads only the shared tokens from layer 1; the `eldra-scrollbar-hide` utility the tab list uses has no variable of its own. The pills list's own padding, the negative margin that cancels it and its scroll padding are all `calc(var(--eldra-focus-offset) + var(--eldra-focus-width))` — the focus ring's own reach, so raising either ring token widens the room the scrolling list keeps for a focused pill's ring instead of letting it clip (the underline variant reserves nothing: its tabs ring _inside_ their own box, per the design spec, and padding that list vertically would push its hairline off the tabs). Set a gutter through `classes.list` only if it is wider than that reach — a `px-*`/`-mx-*`/`scroll-px-*` utility of your own replaces the reservation on that axis rather than composing with it, the way `--eldra-carousel-bleed` does for the carousel |
|
|
238
|
+
| `Textarea` | `--eldra-textarea-radius` (default `var(--eldra-radius-md)`), `--eldra-textarea-min-height` (set from the `minHeight` prop, default `5rem`), `--eldra-counter-line-height` (default `1.5`) |
|
|
239
|
+
| `Toast` | `--eldra-toast-title-size` (default `0.9375rem`), `--eldra-toast-title-line` (default `1.4`) — the title's own size/line, sitting between two type-scale steps with no token of its own |
|
|
240
|
+
| `Toaster` | `--eldra-toast-width` (default `24rem`) — the fixed region's own width, always capped at `100vw - 2rem` inside the utility itself, the same shape as `Dialog`'s own width variables |
|
|
241
|
+
| `Tooltip` | `--eldra-tooltip-arrow-size` (default `0.3125rem`) — the arrow's side length, no token of its own; `--eldra-z-popover` (default `30`), shared with the popover panels |
|
|
242
|
+
| `UnitInput` | `Input`'s exactly, because it draws `Input`'s box: `--eldra-input-radius`, `--eldra-control-font-size`, `--eldra-control-font-size-mobile`, `--eldra-control-line-height`, `--eldra-field-border-width` (`CurrencyInput` is a `UnitInput`, so the same) |
|
|
243
|
+
| `VariantPicker` | `--eldra-variant-legend-line` (default `1.4`), `--eldra-variant-pill-border-width` (default `1px`), `--eldra-variant-pill-selected-color` (default `var(--eldra-color-text)`), `--eldra-variant-pill-radius` (default `var(--eldra-radius-md)`), `--eldra-variant-swatch-ring-width` (default `2px`), `--eldra-variant-swatch-edge-width` (default `1px`) |
|
|
244
|
+
| `VisuallyHidden` | none — reads only the shared tokens from layer 1 (it renders no visible box at all) |
|
|
242
245
|
|
|
243
246
|
Every component this package ships has a row above; `src/__tests__/readmeCoverage.spec.ts`
|
|
244
247
|
fails the build if `src/componentNames.ts` gains a name this table has not. "None" means the
|
|
@@ -1063,6 +1066,10 @@ EldraUiResolver({ prefix: 'Acme' }); // <AcmeButton> instead
|
|
|
1063
1066
|
Eldra library and its own resolver. Pass `{ prefix: 'Ui' }` yourself if a consumer genuinely wants
|
|
1064
1067
|
that name — the package itself never implies it.
|
|
1065
1068
|
|
|
1069
|
+
`<EldraPhoneInput>` resolves too, from `@eldrajs/ui/phone` instead of the root (the list is
|
|
1070
|
+
`phoneComponentNames`, exported beside `componentNames`). That entry needs the optional
|
|
1071
|
+
`libphonenumber-js` peer, so the tag only works in an app that has installed it.
|
|
1072
|
+
|
|
1066
1073
|
## `./vee-validate`
|
|
1067
1074
|
|
|
1068
1075
|
Everything above is validation-agnostic: `FieldWrapper` takes an `error` string, `Input` takes
|
|
@@ -1265,6 +1272,193 @@ status region are the ones documented above. It adds:
|
|
|
1265
1272
|
never visible: replacing the form with a confirmation, or navigating, stays the page's job (spec
|
|
1266
1273
|
"Form layout" → States, Success). An explicit `statusMessage` wins over it.
|
|
1267
1274
|
|
|
1275
|
+
<a id="phone"></a>
|
|
1276
|
+
|
|
1277
|
+
## `./flag`
|
|
1278
|
+
|
|
1279
|
+
`@eldrajs/ui/flag` is a country's flag by its ISO 3166-1 alpha-2 code, for a country select, an
|
|
1280
|
+
address or a language switch. It needs no peer. It is an entry of its own because of its artwork,
|
|
1281
|
+
which the root entry never reaches.
|
|
1282
|
+
|
|
1283
|
+
```vue
|
|
1284
|
+
<script setup lang="ts">
|
|
1285
|
+
import { CountryFlag } from '@eldrajs/ui/flag';
|
|
1286
|
+
</script>
|
|
1287
|
+
|
|
1288
|
+
<template>
|
|
1289
|
+
<!-- Beside the country's name: decorative, the name says it. -->
|
|
1290
|
+
<span class="flex items-center gap-2"><CountryFlag country="NO" /> Norway</span>
|
|
1291
|
+
<!-- On its own: give it a name. -->
|
|
1292
|
+
<CountryFlag country="NO" label="Norway" />
|
|
1293
|
+
</template>
|
|
1294
|
+
```
|
|
1295
|
+
|
|
1296
|
+
| Prop | Type | What it does |
|
|
1297
|
+
| --------- | -------- | -------------------------------------------------------------------------------- |
|
|
1298
|
+
| `country` | `string` | The two-letter code, in either case. A code with no flag keeps the empty box |
|
|
1299
|
+
| `label` | `string` | Makes the flag an image with this name (`role="img"`). Without it, `aria-hidden` |
|
|
1300
|
+
|
|
1301
|
+
The flag is 1.25 × 0.875rem (3:2); a `class` of your own sizes it differently. Its corner, hairline
|
|
1302
|
+
and loading fill are the `--eldra-phone-flag-*` variables under Customisation, the ones
|
|
1303
|
+
`PhoneInput`'s flags use. The artwork is
|
|
1304
|
+
[country-flag-icons](https://gitlab.com/catamphetamine/country-flag-icons) (MIT;
|
|
1305
|
+
`LICENSE-country-flag-icons` ships in the package), one lazy chunk of about 46 kB gzipped that is
|
|
1306
|
+
fetched when the first flag mounts in a browser and shared with `@eldrajs/ui/phone`. Until it
|
|
1307
|
+
arrives, and in server-rendered HTML, a flag is an empty box of the same size, so nothing moves.
|
|
1308
|
+
`preloadCountryFlags()` fetches it sooner. With the resolver, `<EldraCountryFlag>` imports from
|
|
1309
|
+
this entry.
|
|
1310
|
+
|
|
1311
|
+
## `./phone`
|
|
1312
|
+
|
|
1313
|
+
`@eldrajs/ui/phone` is a phone number field with its country inside it. It is an entry of its own
|
|
1314
|
+
because it is the only part of the package that needs
|
|
1315
|
+
[`libphonenumber-js`](https://gitlab.com/catamphetamine/libphonenumber-js): an app that never
|
|
1316
|
+
imports this entry never installs or bundles it (a test proves it, in the source graph and in
|
|
1317
|
+
`dist/`).
|
|
1318
|
+
|
|
1319
|
+
```bash
|
|
1320
|
+
pnpm add libphonenumber-js # optional peer, ^1.13
|
|
1321
|
+
```
|
|
1322
|
+
|
|
1323
|
+
```vue
|
|
1324
|
+
<script setup lang="ts">
|
|
1325
|
+
import { FieldWrapper } from '@eldrajs/ui';
|
|
1326
|
+
import { PhoneInput } from '@eldrajs/ui/phone';
|
|
1327
|
+
import { ref } from 'vue';
|
|
1328
|
+
|
|
1329
|
+
const phone = ref(''); // '+3545812345'
|
|
1330
|
+
</script>
|
|
1331
|
+
|
|
1332
|
+
<template>
|
|
1333
|
+
<FieldWrapper label="Phone number">
|
|
1334
|
+
<PhoneInput v-model="phone" default-country="IS" :preferred-countries="['IS']" />
|
|
1335
|
+
</FieldWrapper>
|
|
1336
|
+
</template>
|
|
1337
|
+
```
|
|
1338
|
+
|
|
1339
|
+
**Anatomy.** One field box holding a country button (flag, dialling code, chevron) and the number
|
|
1340
|
+
`<input type="tel">`. The button opens the country list under the whole field, as wide as it: a
|
|
1341
|
+
search field, then the countries, each with its flag, name and dialling code. Parts (`data-part`,
|
|
1342
|
+
each a `classes` key except `root`): `root`, `field`, `countryButton`, `flag`, `callingCode`,
|
|
1343
|
+
`chevron`, `control`, and the list's `panel`, `search`, `listbox`, `group`, `groupLabel`, `option`,
|
|
1344
|
+
`optionLabel`, `optionMeta`, `optionCheck`, `empty`. The list is the panel `Select` opens, built
|
|
1345
|
+
from the same parts, so it is styled by the same variables.
|
|
1346
|
+
|
|
1347
|
+
**Properties**
|
|
1348
|
+
|
|
1349
|
+
| Prop | Type | Default | |
|
|
1350
|
+
| ------------------------------------------ | ---------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1351
|
+
| `modelValue` | `string` | `''` | The whole number in E.164 (`+3545812345`). `''` while the field holds no digit; the dialling code and the digits so far while the number is incomplete, so a rule can judge it at any moment |
|
|
1352
|
+
| `country` | `string` | | The chosen country, ISO 3166-1 alpha-2. `v-model:country` follows it |
|
|
1353
|
+
| `defaultCountry` | `string` | see right | Where the field starts when `country` is not bound and the value does not say: the shop's own country. Without it, the first of `preferredCountries`, then of `countries`, then `US` |
|
|
1354
|
+
| `preferredCountries` | `string[]` | | Listed first, under "Suggested", in this order |
|
|
1355
|
+
| `countries` | `string[]` | every country | The only countries offered, and the only ones a typed `+` may switch to |
|
|
1356
|
+
| `locale` | `string` | `provideEldraUiLocale`'s | The locale countries are named and sorted in |
|
|
1357
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | `Input`'s heights |
|
|
1358
|
+
| `name` | `string` | | Posts the E.164 value under this name, through a hidden input |
|
|
1359
|
+
| `placeholder` | `string \| false` | an example number | A number the chosen country could have; `false` for none |
|
|
1360
|
+
| `autocomplete` | `string` | `'tel-national'` | |
|
|
1361
|
+
| `id`, `invalid`, `describedBy`, `required` | | the `FieldWrapper`'s | As on `Input` |
|
|
1362
|
+
| `readonly` | `boolean` | `false` | The number can be read and copied; the list does not open and the chevron is not drawn |
|
|
1363
|
+
| `disabled` | `boolean` | `false` | |
|
|
1364
|
+
| `messages`, `classes` | | | As on every component |
|
|
1365
|
+
|
|
1366
|
+
**Events**: `update:modelValue`, `update:country`, `change` (after every edit and every change of
|
|
1367
|
+
country: `{ e164, country, callingCode, nationalNumber, valid }`), `focus`, `blur`, `open`, `close`.
|
|
1368
|
+
**Slots**: `flag` (`{ country }`), drawn in the button and on every row in place of the built-in
|
|
1369
|
+
artwork. **Exposed**: `control` (the number `<input>`), `focus()`, `country`.
|
|
1370
|
+
|
|
1371
|
+
**Behaviour**
|
|
1372
|
+
|
|
1373
|
+
- The field shows the national number only, spaced the way the chosen country writes it, re-spaced
|
|
1374
|
+
on every keystroke. The caret stays with what was typed: it is put back after the same number of
|
|
1375
|
+
digits, so typing or deleting in the middle of a number does not send it to the end.
|
|
1376
|
+
- Typing or pasting a number that starts with `+` picks the country by itself. As soon as the
|
|
1377
|
+
dialling code is complete, the `+` and the code leave the text and the button shows them.
|
|
1378
|
+
- A dialling code several countries share (`+1` is 25 countries, `+44` four) keeps the current
|
|
1379
|
+
country when it is one of them and otherwise takes the country the code belongs to; once the
|
|
1380
|
+
digits say which country the number is in, the country follows them.
|
|
1381
|
+
- Choosing a country from the list keeps the digits, re-spaces them and moves focus to the number.
|
|
1382
|
+
- The list is `preferredCountries` first, then every other country from A to Z in the locale's own
|
|
1383
|
+
order, each listed once. Search finds a country by name (case and accents ignored), by dialling
|
|
1384
|
+
code with or without the `+`, or by ISO code; with no match it says so in text.
|
|
1385
|
+
- Spacing is the phone library's. Some countries are only spaced when the number is typed with its
|
|
1386
|
+
national prefix: a British `7400123456` stays unspaced, `07400 123456` is spaced. Both are the
|
|
1387
|
+
same E.164 value. A value bound from outside is shown in full national form.
|
|
1388
|
+
- Country names come from `Intl.DisplayNames` through `@eldrajs/sdk/format/display-names`, so
|
|
1389
|
+
Icelandic names are right on runtimes that ship without Icelandic.
|
|
1390
|
+
|
|
1391
|
+
**States**: empty (an example number as placeholder), focused, filled, invalid, read-only,
|
|
1392
|
+
disabled, list open. One focus ring, around the whole box: while the number or the button has
|
|
1393
|
+
keyboard focus, and while the list is open.
|
|
1394
|
+
|
|
1395
|
+
**Keyboard**
|
|
1396
|
+
|
|
1397
|
+
| Key | On | Does |
|
|
1398
|
+
| ---------------------------------------- | ---------------- | ------------------------------------------------------------------------ |
|
|
1399
|
+
| `Tab` | | The country button, then the number |
|
|
1400
|
+
| `Enter`, `Space`, `ArrowDown`, `ArrowUp` | the button | Opens the list; focus moves to its search field |
|
|
1401
|
+
| a letter or digit | the button | Opens the list with that character as the search |
|
|
1402
|
+
| `ArrowDown` / `ArrowUp` | the search field | Moves through the countries (`PageUp`/`PageDown` by ten) |
|
|
1403
|
+
| `Enter` | the search field | Chooses the active country; focus moves to the number |
|
|
1404
|
+
| `Escape` | the search field | Clears the search; pressed again, closes and returns focus to the button |
|
|
1405
|
+
| `Tab` | the search field | Closes the list |
|
|
1406
|
+
|
|
1407
|
+
**Accessibility.** The number is a native `<input type="tel">`, named by the `FieldWrapper`'s
|
|
1408
|
+
`<label for>` (or an `aria-label` of your own). The country button is a `combobox` with
|
|
1409
|
+
`aria-haspopup="listbox"`, named "Country: Iceland, +354" (`phoneCountry`); the list is a `listbox`
|
|
1410
|
+
named "Country" (`phoneCountryList`), its rows `option`s with `aria-selected`, the search field a
|
|
1411
|
+
`combobox` that owns `aria-activedescendant`. Flags are decorative (`aria-hidden`): the name and
|
|
1412
|
+
the code are always in text, so the country is never told by a flag alone.
|
|
1413
|
+
|
|
1414
|
+
**Flags.** The artwork is [country-flag-icons](https://gitlab.com/catamphetamine/country-flag-icons)
|
|
1415
|
+
(MIT; `LICENSE-country-flag-icons` ships in the package), copied into the package by
|
|
1416
|
+
`pnpm --filter @eldrajs/ui build-phone-flags`. It is one lazy chunk (about 46 kB gzipped), fetched
|
|
1417
|
+
when the first `PhoneInput` mounts in a browser; until then a flag is an empty box of the same
|
|
1418
|
+
size, so nothing moves. `preloadPhoneFlags()` fetches it sooner. The flag itself is `CountryFlag`
|
|
1419
|
+
from [`./flag`](#flag), for use outside the field.
|
|
1420
|
+
|
|
1421
|
+
**Helpers**, from the same entry: `isValidPhone(value, country?)`, `parsePhone(value, country?)`
|
|
1422
|
+
(`{ e164, country, callingCode, nationalNumber, national, valid } | null`), `phoneCountries()`,
|
|
1423
|
+
`phoneCallingCode(country)`, `phoneCountryName(country, locale)`, `phoneExample(country)` and
|
|
1424
|
+
`phoneRule(options)`. Validity is the phone library's `min` metadata: landlines and mobiles both
|
|
1425
|
+
pass, and a number is refused when its length or its prefix is not one the country uses.
|
|
1426
|
+
|
|
1427
|
+
### With vee-validate
|
|
1428
|
+
|
|
1429
|
+
`@eldrajs/ui/phone/vee-validate` exports `FieldPhoneInput` and `phoneRule`. It is not part of
|
|
1430
|
+
`@eldrajs/ui/vee-validate`, which must load in an app that has not installed `libphonenumber-js`.
|
|
1431
|
+
|
|
1432
|
+
```vue
|
|
1433
|
+
<Form aria-label="Contact details" @submit="save">
|
|
1434
|
+
<template #default="{ errors }">
|
|
1435
|
+
<FieldWrapper label="Phone number" :error="errors.phone">
|
|
1436
|
+
<FieldPhoneInput name="phone" default-country="IS" />
|
|
1437
|
+
</FieldWrapper>
|
|
1438
|
+
</template>
|
|
1439
|
+
</Form>
|
|
1440
|
+
```
|
|
1441
|
+
|
|
1442
|
+
`FieldPhoneInput` takes every `PhoneInput` prop and the `Field*` binding props (`name`, `path`,
|
|
1443
|
+
`rules`, `label`, and the three [validation props](#when-a-field-validates) with the typed-control
|
|
1444
|
+
defaults: it validates when the field is left and on submit, not while a number is typed). With no
|
|
1445
|
+
`rules` it checks the number against the country the field is on and shows "Enter a valid phone
|
|
1446
|
+
number for Iceland." (`phoneInvalid`, the country named in the field's locale). An empty field
|
|
1447
|
+
passes; add a required rule where the number is required. `rules` replaces the built-in check, so
|
|
1448
|
+
combine the two yourself:
|
|
1449
|
+
|
|
1450
|
+
```ts
|
|
1451
|
+
import { phoneRule } from '@eldrajs/ui/phone/vee-validate';
|
|
1452
|
+
|
|
1453
|
+
const valid = phoneRule({ country: () => country.value, locale: 'is-IS', messages: isIS });
|
|
1454
|
+
const rules = (value: unknown) => (value ? valid(value) : 'Enter your phone number.');
|
|
1455
|
+
```
|
|
1456
|
+
|
|
1457
|
+
`phoneRule` imports nothing from vee-validate: it returns `true` or the message, so it serves a
|
|
1458
|
+
form `validationSchema`, zod's `refine`, or a check of your own. Its messages (`phoneInvalid`,
|
|
1459
|
+
`phoneInvalidNumber`) are part of the message set, so they translate through
|
|
1460
|
+
[`./vue-i18n`](#with-vue-i18n) like every other one.
|
|
1461
|
+
|
|
1268
1462
|
## Accessibility and testing
|
|
1269
1463
|
|
|
1270
1464
|
Every component in this package ships, as part of being done, not as an add-on:
|
|
@@ -1315,6 +1509,11 @@ during development, outside this repository's own history.
|
|
|
1315
1509
|
Things this package ships that design spec 1 does not name at all. Each is listed here so a reader
|
|
1316
1510
|
comparing the package against the spec can tell an addition from a drift.
|
|
1317
1511
|
|
|
1512
|
+
- **`PhoneInput`** (`@eldrajs/ui/phone`, WS-1006): a phone number field with a country picker, as-you-type
|
|
1513
|
+
spacing and per-country validation. The spec has no phone field; its anatomy, properties, states,
|
|
1514
|
+
keyboard and accessibility are written up under [`./phone`](#phone) above. Two utilities came
|
|
1515
|
+
with it: `eldra-focus-has-open` (the focus ring while a popup opened from inside the element is
|
|
1516
|
+
open) and `eldra-phone-flag`.
|
|
1318
1517
|
- **Wrapper hooks** (operator decision, 2026-11-08): options that let the private component library
|
|
1319
1518
|
render these components as designed instead of keeping copies of them. Each is opt-in, and output
|
|
1320
1519
|
is unchanged without it; see the changelog for the details. `Input`/`Textarea`: exposed `control`
|
|
@@ -2517,6 +2716,15 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
|
|
|
2517
2716
|
consumer owns the remove control then: render it only while `removable` (false when `disabled` or
|
|
2518
2717
|
`readonly`), as a real `<button type="button">` named `removeLabel` ("Remove <label>"), calling
|
|
2519
2718
|
`remove`, which deselects and returns focus to the trigger.
|
|
2719
|
+
- **`MultiSelect` can offer "Select all" (`selectAll`).** Not in the spec's footer ("live count ·
|
|
2720
|
+
Clear · Done"), and on by default: a multi-select without it makes a long list a chore, and
|
|
2721
|
+
`:select-all="false"` leaves it out. A link button before Clear adds every enabled
|
|
2722
|
+
option the list is showing to the selection: all of them, or only a search's matches, whatever
|
|
2723
|
+
the render batch has drawn so far. Values already chosen keep their place and the new ones
|
|
2724
|
+
follow in list order; disabled options are never touched. It is the footer's first tab stop, so
|
|
2725
|
+
the `Tab` walk the spec describes runs Select all, Clear, Done. It fires `change` once, keeps the
|
|
2726
|
+
popover open and returns focus as Clear does, and is disabled when there is nothing left to
|
|
2727
|
+
add. Part `footerSelectAll`, message `selectAll`.
|
|
2520
2728
|
- **`MultiSelect`'s tags can sit inside the field (`tagPlacement: 'inside'`).** The field then
|
|
2521
2729
|
draws the trigger box (the `field` part) and wraps the tags and the trigger, growing a row at a
|
|
2522
2730
|
time; the trigger is the rest of the last row, or a row of its own, and the panel matches the
|