@eldrajs/ui 0.3.8 → 0.3.10

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.
Files changed (76) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE-country-flag-icons +1 -1
  3. package/README.md +93 -4
  4. package/dist/CountryFlag-DOa8lOHp.js +71 -0
  5. package/dist/{PhoneInput-CYGpERg4.js → PhoneInput-BVH32MEg.js} +8 -62
  6. package/dist/{VariantPicker-D_Gg80So.js → VariantPicker-CKDdeFmV.js} +2962 -2531
  7. package/dist/componentNames.d.ts +1 -1
  8. package/dist/components/autocomplete/Autocomplete.vue.d.ts +216 -0
  9. package/dist/components/autocomplete/types.d.ts +50 -0
  10. package/dist/components/button/Button.vue.d.ts +4 -4
  11. package/dist/components/card/ContentCard.vue.d.ts +1 -1
  12. package/dist/components/carousel/Carousel.vue.d.ts +1 -1
  13. package/dist/components/checkbox/Checkbox.vue.d.ts +3 -3
  14. package/dist/components/chip/Chip.vue.d.ts +3 -1
  15. package/dist/components/container/Container.vue.d.ts +1 -1
  16. package/dist/components/dialog/Dialog.vue.d.ts +2 -0
  17. package/dist/components/drawer/Drawer.vue.d.ts +5 -3
  18. package/dist/components/field-wrapper/FieldWrapper.vue.d.ts +1 -1
  19. package/dist/components/filter-panel/FilterGroup.vue.d.ts +2 -0
  20. package/dist/components/filter-panel/FilterPanel.vue.d.ts +6 -4
  21. package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +2 -0
  22. package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +2 -0
  23. package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +3 -1
  24. package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +2 -0
  25. package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +2 -0
  26. package/dist/components/form-layout/FormLayout.vue.d.ts +2 -2
  27. package/dist/components/image/Image.vue.d.ts +3 -3
  28. package/dist/components/input/Input.vue.d.ts +7 -7
  29. package/dist/components/lightbox/Lightbox.vue.d.ts +3 -1
  30. package/dist/components/nav-menu/NavMenu.vue.d.ts +5 -3
  31. package/dist/components/pagination/Pagination.vue.d.ts +4 -2
  32. package/dist/components/popover/Popover.vue.d.ts +3 -3
  33. package/dist/components/quantity-stepper/QuantityStepper.vue.d.ts +2 -2
  34. package/dist/components/radio/Radio.vue.d.ts +1 -1
  35. package/dist/components/range-slider/RangeSlider.vue.d.ts +3 -1
  36. package/dist/components/search-bar/SearchBar.vue.d.ts +5 -3
  37. package/dist/components/search-bar/SearchResultsPanel.vue.d.ts +1 -1
  38. package/dist/components/search-modal/SearchModal.vue.d.ts +4 -2
  39. package/dist/components/select/MultiSelect.vue.d.ts +13 -10
  40. package/dist/components/select/Select.vue.d.ts +13 -11
  41. package/dist/components/select/SelectPanel.vue.d.ts +1 -1
  42. package/dist/components/select/types.d.ts +7 -1
  43. package/dist/components/site-form/SiteForm.vue.d.ts +2 -0
  44. package/dist/components/skeleton/Skeleton.vue.d.ts +1 -1
  45. package/dist/components/switch/Switch.vue.d.ts +1 -1
  46. package/dist/components/textarea/Textarea.vue.d.ts +3 -3
  47. package/dist/components/toast/Toast.vue.d.ts +3 -1
  48. package/dist/components/toast/Toaster.vue.d.ts +2 -0
  49. package/dist/components/unit-input/UnitInput.vue.d.ts +6 -6
  50. package/dist/{phone/PhoneFlag.vue.d.ts → flag/CountryFlag.vue.d.ts} +3 -0
  51. package/dist/flag/flags.d.ts +8 -0
  52. package/dist/flag/index.d.ts +9 -0
  53. package/dist/flag.js +1 -0
  54. package/dist/index.d.ts +2 -0
  55. package/dist/index.js +5 -4
  56. package/dist/messages/en-US.d.ts +4 -0
  57. package/dist/messages/is-IS.js +2 -0
  58. package/dist/phone/PhoneInput.vue.d.ts +8 -6
  59. package/dist/phone/index.d.ts +1 -1
  60. package/dist/phone/vee-validate.js +4 -4
  61. package/dist/phone.js +3 -1
  62. package/dist/resolver.d.ts +8 -2
  63. package/dist/resolver.js +14 -2
  64. package/dist/useEldraScope-BDbGzt7R.js +32 -0
  65. package/dist/{useFieldControl-D_b9SC9s.js → useFieldControl-CGH6GEWM.js} +2 -2
  66. package/dist/{useMessages-DQQPh1P_.js → useMessages-CYnyGVRG.js} +4 -0
  67. package/dist/{usePopover-4CQR2hB5.js → useOptionList-CPHHDvPF.js} +1477 -1506
  68. package/dist/vee-validate/FieldAutocomplete.vue.d.ts +20 -0
  69. package/dist/vee-validate/Form.vue.d.ts +2 -2
  70. package/dist/vee-validate/index.d.ts +3 -2
  71. package/dist/vee-validate/types.d.ts +4 -1
  72. package/dist/vee-validate/useFieldControl.d.ts +1 -1
  73. package/dist/vee-validate.js +73 -5
  74. package/dist/vue-i18n.js +1 -1
  75. package/package.json +6 -2
  76. package/dist/phone/flags.d.ts +0 -8
package/CHANGELOG.md CHANGED
@@ -7,6 +7,10 @@ Release-please writes the generated notes from commit messages and does not repl
7
7
 
8
8
  ### Added
9
9
 
10
+ - **`Autocomplete`** — a free-text field with a list of suggestions under it: an `Input` (same box, sizes, states, clear button and `FieldWrapper` wiring) that is an ARIA combobox with list autocomplete. `suggestions` (`{ value, label, description?, disabled? }[]`) are supplied by the consumer for the text now in the field; `loading`, `minLength` (default `1`), `messages`, `classes`, and `Input`'s `size`, `id`, `name`, `placeholder`, `autocomplete`, `inputmode`, `leadingIcon`, `clearable`, `invalid`, `describedBy`, `required`, `readonly`, `disabled`. The value is always the text: choosing a row emits `update:modelValue` with its `label`, then `select` with the suggestion, and anything else may be typed and kept. Slots `option` (`{ suggestion, active }`) and `footer`, plus `Input`'s three. With no suggestions the panel is closed. New parts `busy`, `panel`, `listbox`, `option`, `optionLabel`, `optionDescription`, `footer`; new message `suggestions` ("Suggestions" / "Tillögur"), also through `@eldrajs/ui/vue-i18n`; new types `AutocompleteProps`, `AutocompleteSuggestion`, `AutocompletePart`, `AutocompleteOptionSlotProps`; `<EldraAutocomplete>` through the resolver.
11
+ - **`FieldAutocomplete`** in `@eldrajs/ui/vee-validate` — `Autocomplete` bound to a vee-validate field, with the typed-control validation defaults. New type `FieldAutocompleteProps`.
12
+ - **`MultiSelect` `selectAll`** adds a "Select all" button to the footer, before Clear. It adds every enabled option the list is showing to the selection, so with a search typed it selects the matches only, and it is disabled once they are all selected. New part `footerSelectAll` and message `selectAll` ("Select all" / "Velja allt"). On by default: an existing `MultiSelect` gains the button; `:select-all="false"` leaves it out.
13
+ - **`@eldrajs/ui/flag`** — `CountryFlag`, the flag `PhoneInput` draws, for use on its own: `<CountryFlag country="NO" />` beside a country's name in a select, an address or a language switch (decorative), or with `label` as a named image. No peer dependency. The artwork is the same lazy chunk `@eldrajs/ui/phone` loads, fetched when the first flag mounts; `preloadCountryFlags()` fetches it sooner. `<EldraCountryFlag>` resolves from this entry (`flagComponentNames` in `@eldrajs/ui/resolver`). `preloadPhoneFlags` stays in `@eldrajs/ui/phone`, as the same function.
10
14
  - **`@eldrajs/ui/phone`** — `PhoneInput`, a phone number field with its country inside it: a country button (flag, dialling code) that opens a searchable country list under the field (`preferredCountries` first, then A to Z; found by name, dialling code or ISO code), and a number spaced the way the country writes it as it is typed, with the caret kept in place. `modelValue` is the number in E.164; `v-model:country`, `defaultCountry`, `countries`, `locale`, `size`, `name` (posts the E.164 value), `placeholder` (an example number by default), a `flag` slot and a `change` event (`{ e164, country, callingCode, nationalNumber, valid }`). Typing or pasting a number that starts with `+` picks the country. Also exported: `isValidPhone`, `parsePhone`, `phoneRule`, `phoneCountries`, `phoneCallingCode`, `phoneCountryName`, `phoneExample`, `preloadPhoneFlags`. `libphonenumber-js ^1.13` is a new optional peer, imported by this entry only; the flags (country-flag-icons, MIT) are one lazy chunk. `<EldraPhoneInput>` through the resolver, from `@eldrajs/ui/phone` (`phoneComponentNames`).
11
15
  - **`@eldrajs/ui/phone/vee-validate`** — `FieldPhoneInput`, `PhoneInput` bound to a vee-validate field with the typed-control validation defaults; with no `rules` it checks the number against the country the field is on. `phoneRule({ country, locale, messages })` returns `true` or a message naming the country.
12
16
  - **Messages** `phoneCountry`, `phoneCountryList`, `phoneSearch`, `phoneSuggested`, `phoneAllCountries`, `phoneNoMatch`, `phoneInvalid` and `phoneInvalidNumber`, in English and Icelandic and through `@eldrajs/ui/vue-i18n`.
@@ -164,6 +168,7 @@ Release-please writes the generated notes from commit messages and does not repl
164
168
 
165
169
  ### Fixed
166
170
 
171
+ - **`Input` follows a `leadingIcon`, `prefix` or `suffix` slot given or taken away after mount.** The end padding and the slot's row were decided from the slots the field was mounted with, so a `<template #suffix v-if="…">` toggled later was not drawn.
167
172
  - **A press on empty space in a `FieldWrapper` blurs the focused input again**, as on any other empty space. 0.3.4 cancelled that press, which kept the focus in the input; that change is reverted.
168
173
  - **A field's 2px error boundary no longer splits into two lines at 90%, 110% or 125% zoom.** `Input`, `Textarea`, `UnitInput`, `Select`, `MultiSelect` (and `SearchBar`, `CurrencyInput` through them) draw the second line as the focus ring's resting band in `danger`, a `box-shadow` against the outside of the border, instead of a pseudo-element inset on the field's root. `eldra-field-invalid` now sits on the control (the input, textarea, select trigger, or the `MultiSelect` field holding inside tags), and `--eldra-field-invalid-radius` is gone. On focus the line moves out to become the focus ring.
169
174
  - **`scoped.css` leaves a `Popover` or `Tooltip` trigger to the consumer.** The root is the slot host (`data-eldra-slot`) while the trigger is filled, so the consumer's own element keeps its border, padding and background instead of the kit's reset and utilities.
@@ -1,4 +1,4 @@
1
- The country flags drawn by PhoneInput (dist/phoneFlagData-*.js) are copied from
1
+ The country flags drawn by CountryFlag and PhoneInput (dist/phoneFlagData-*.js) are copied from
2
2
  country-flag-icons 1.6.20 (https://gitlab.com/catamphetamine/country-flag-icons), under:
3
3
 
4
4
  (The MIT License)
package/README.md CHANGED
@@ -179,6 +179,7 @@ Every component supports all five of these; none hard-codes anything a store mig
179
179
  | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
180
180
  | `Accordion` | none — the top divider is a stock `border-t`, no per-component variable |
181
181
  | `AccordionItem` | `--eldra-accordion-title-line` (default `1.4`) — the label's line ratio, no token of its own |
182
+ | `Autocomplete` | `Input`'s exactly for the field, because it renders an `Input`; the panel reads `Select`'s `--eldra-select-panel-max-height` (default `20rem`), the `--eldra-select-panel-*` colours and `--eldra-z-popover` (default `30`), and is as wide as the field |
182
183
  | `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
184
  | `AvatarGroup` | none — the overlap and stack order are plain Tailwind, no per-component variable |
184
185
  | `Badge` | `--eldra-badge-line-height` (default `1`) — the badge text's line ratio, no token of its own |
@@ -1031,7 +1032,8 @@ Four things follow from the move, and each is a real consequence rather than a d
1031
1032
  anything carrying `data-eldra-overlay-owner="<the panel's id>"` — so a control of your own puts
1032
1033
  its trigger-side buttons in the walk by marking them the way `MultiSelect`'s clear button does.
1033
1034
 
1034
- `teleport` is a prop on `Select`, `MultiSelect` and `SearchBar`, and an option on `usePopover`:
1035
+ `teleport` is a prop on `Select`, `MultiSelect` and `SearchBar`, and an option on `usePopover`
1036
+ (`Autocomplete` always teleports its panel):
1035
1037
  `true` (default), a CSS selector string for a target of your own, or `false` to keep the old
1036
1038
  in-place `absolute` rendering when you know nothing above the control clips or stacks over it.
1037
1039
  `Tooltip` has no `teleport` prop — it always teleports (`fixed` strategy, same target resolution),
@@ -1081,7 +1083,7 @@ the root entry loads fine without it (a test proves both, in the source graph an
1081
1083
  pnpm add vee-validate # optional peer, ^4.12
1082
1084
  ```
1083
1085
 
1084
- It exports `Form`, twelve `Field*` components, `API_ERRORS_KEY` and the `useFieldControl`
1086
+ It exports `Form`, fourteen `Field*` components, `API_ERRORS_KEY` and the `useFieldControl`
1085
1087
  composable they are all built on.
1086
1088
 
1087
1089
  ### The `FieldWrapper` pattern
@@ -1141,7 +1143,7 @@ Submitting the form always validates every field and shows every result, whateve
1141
1143
 
1142
1144
  | Kind | Components | `validateOnValueUpdate` | Why |
1143
1145
  | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1144
- | 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. |
1146
+ | Typed | `FieldInput`, `FieldTextarea`, `FieldCurrencyInput`, `FieldUnitInput`, `FieldSearchBar`, `FieldAutocomplete` | `false` | The value is built up one keystroke at a time, so validating each change would judge a half-typed value. |
1145
1147
  | 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. |
1146
1148
 
1147
1149
  `FieldQuantityStepper` is a choice although it has a text field: a `QuantityStepper` writes its
@@ -1190,6 +1192,7 @@ and `FieldQuantityStepper` — and those draw their message themselves **only ou
1190
1192
  | ---------------------- | ----------------- | ----------------------------------------------------------------------------- |
1191
1193
  | `FieldInput` | `Input` | `string` |
1192
1194
  | `FieldTextarea` | `Textarea` | `string` |
1195
+ | `FieldAutocomplete` | `Autocomplete` | `string` (the text in the field, typed or written by a chosen suggestion) |
1193
1196
  | `FieldUnitInput` | `UnitInput` | `number \| null` (`null` is an empty field) |
1194
1197
  | `FieldCurrencyInput` | `CurrencyInput` | `number \| null` (`null` is an empty field) |
1195
1198
  | `FieldCheckbox` | `Checkbox` | `boolean` (one consent box) |
@@ -1274,6 +1277,40 @@ status region are the ones documented above. It adds:
1274
1277
 
1275
1278
  <a id="phone"></a>
1276
1279
 
1280
+ ## `./flag`
1281
+
1282
+ `@eldrajs/ui/flag` is a country's flag by its ISO 3166-1 alpha-2 code, for a country select, an
1283
+ address or a language switch. It needs no peer. It is an entry of its own because of its artwork,
1284
+ which the root entry never reaches.
1285
+
1286
+ ```vue
1287
+ <script setup lang="ts">
1288
+ import { CountryFlag } from '@eldrajs/ui/flag';
1289
+ </script>
1290
+
1291
+ <template>
1292
+ <!-- Beside the country's name: decorative, the name says it. -->
1293
+ <span class="flex items-center gap-2"><CountryFlag country="NO" /> Norway</span>
1294
+ <!-- On its own: give it a name. -->
1295
+ <CountryFlag country="NO" label="Norway" />
1296
+ </template>
1297
+ ```
1298
+
1299
+ | Prop | Type | What it does |
1300
+ | --------- | -------- | -------------------------------------------------------------------------------- |
1301
+ | `country` | `string` | The two-letter code, in either case. A code with no flag keeps the empty box |
1302
+ | `label` | `string` | Makes the flag an image with this name (`role="img"`). Without it, `aria-hidden` |
1303
+
1304
+ The flag is 1.25 × 0.875rem (3:2); a `class` of your own sizes it differently. Its corner, hairline
1305
+ and loading fill are the `--eldra-phone-flag-*` variables under Customisation, the ones
1306
+ `PhoneInput`'s flags use. The artwork is
1307
+ [country-flag-icons](https://gitlab.com/catamphetamine/country-flag-icons) (MIT;
1308
+ `LICENSE-country-flag-icons` ships in the package), one lazy chunk of about 46 kB gzipped that is
1309
+ fetched when the first flag mounts in a browser and shared with `@eldrajs/ui/phone`. Until it
1310
+ arrives, and in server-rendered HTML, a flag is an empty box of the same size, so nothing moves.
1311
+ `preloadCountryFlags()` fetches it sooner. With the resolver, `<EldraCountryFlag>` imports from
1312
+ this entry.
1313
+
1277
1314
  ## `./phone`
1278
1315
 
1279
1316
  `@eldrajs/ui/phone` is a phone number field with its country inside it. It is an entry of its own
@@ -1381,7 +1418,8 @@ the code are always in text, so the country is never told by a flag alone.
1381
1418
  (MIT; `LICENSE-country-flag-icons` ships in the package), copied into the package by
1382
1419
  `pnpm --filter @eldrajs/ui build-phone-flags`. It is one lazy chunk (about 46 kB gzipped), fetched
1383
1420
  when the first `PhoneInput` mounts in a browser; until then a flag is an empty box of the same
1384
- size, so nothing moves. `preloadPhoneFlags()` fetches it sooner.
1421
+ size, so nothing moves. `preloadPhoneFlags()` fetches it sooner. The flag itself is `CountryFlag`
1422
+ from [`./flag`](#flag), for use outside the field.
1385
1423
 
1386
1424
  **Helpers**, from the same entry: `isValidPhone(value, country?)`, `parsePhone(value, country?)`
1387
1425
  (`{ e164, country, callingCode, nationalNumber, national, valid } | null`), `phoneCountries()`,
@@ -1479,6 +1517,48 @@ comparing the package against the spec can tell an addition from a drift.
1479
1517
  keyboard and accessibility are written up under [`./phone`](#phone) above. Two utilities came
1480
1518
  with it: `eldra-focus-has-open` (the focus ring while a popup opened from inside the element is
1481
1519
  open) and `eldra-phone-flag`.
1520
+ - **`Autocomplete`** (WS-1039; not in spec 1): a free-text field with a list of suggestions under
1521
+ it, for a value that is still text once it is chosen: a street address, a company name. It is
1522
+ written up here in the spec's own section shape, since the spec has no section to point at. Not a
1523
+ `Select` (whose value must be one of its options) and not a `SearchBar` (a search landmark whose
1524
+ rows navigate).
1525
+
1526
+ - _Anatomy_: `Input`'s parts (`root`, `leadingIcon`, `prefix`, `control`, `clearButton`,
1527
+ `suffix`) · `busy` (the spinner, in the suffix row) · `panel` holding `listbox`, its `option`
1528
+ rows (`optionLabel`, `optionDescription`) and `footer` (optional).
1529
+ - _Properties_: `modelValue` (the text), `suggestions` (`{ value, label, description?,
1530
+ disabled? }[]`, supplied by the consumer for the text now in the field; the component filters
1531
+ nothing), `loading`, `minLength` (default `1`), `messages`, `classes`, and `Input`'s `size`,
1532
+ `id`, `name`, `placeholder`, `autocomplete`, `inputmode`, `leadingIcon`, `clearable`,
1533
+ `invalid`, `describedBy`, `required`, `readonly`, `disabled`. Events: `update:modelValue`,
1534
+ `select` (the chosen suggestion; `update:modelValue` with its `label` fires just before),
1535
+ `clear`, `focus`, `blur`. Slots: `option` (`{ suggestion, active }`), `footer`, and `Input`'s
1536
+ `leadingIcon`, `prefix`, `suffix`.
1537
+ - _Sizes_: the field is `Input`'s. The panel is `Select`'s (0.25rem under the field, option rows
1538
+ 2.25rem minimum, the description on a second line in `text-caption`), exactly as wide as the
1539
+ field; the footer is a `text-caption` line above a 1px hairline, padding 0.5rem 0.75rem.
1540
+ - _States_: the panel shows while the field has focus, the text is at least `minLength` long and
1541
+ there is a suggestion to show. It is closed with no suggestions (there is no "no results" row)
1542
+ and for a single suggestion whose label is exactly the text. After a selection, `Escape`, `Tab`
1543
+ or a press outside it stays closed, whatever `suggestions` holds, until the text is typed in
1544
+ again, the field is focused again, or an arrow key asks for it. While `loading`, an open panel
1545
+ keeps its rows (`aria-busy` on the list) even if `suggestions` is emptied, a closed one stays
1546
+ closed, and a spinner shows in the field once the wait has lasted 300ms. Active row:
1547
+ `Select`'s active fill. Disabled row: `muted`, skipped by the arrows, not chosen by a press.
1548
+ A disabled or read-only field never opens.
1549
+ - _Keyboard_: no row is active when the panel opens, so `Enter` submits the surrounding form as
1550
+ in a plain input. `ArrowDown` / `ArrowUp` move through the rows without wrapping (from none:
1551
+ the first / the last) and reopen a dismissed panel; `PageDown` / `PageUp` move by ten; `Enter`
1552
+ on an active row chooses it and does not submit; `Escape` closes and keeps the text; `Tab`
1553
+ closes without choosing and moves on. `Home`, `End`, `Space` and every printable key are the
1554
+ text field's.
1555
+ - _Accessibility_: the field is `role="combobox"` with `aria-autocomplete="list"`,
1556
+ `aria-expanded`, `aria-controls` (while open) and `aria-activedescendant` (while a row is
1557
+ active); focus never leaves it. The list is `role="listbox"` named by `messages.suggestions`
1558
+ ("Suggestions"); rows are `role="option"` with `aria-selected="true"` on the active one and
1559
+ `aria-disabled` on a disabled one. The consumer's `autocomplete` token is kept as given. The
1560
+ footer is not in the `Tab` walk: `Tab` closes the panel, so keep it to text.
1561
+
1482
1562
  - **Wrapper hooks** (operator decision, 2026-11-08): options that let the private component library
1483
1563
  render these components as designed instead of keeping copies of them. Each is opt-in, and output
1484
1564
  is unchanged without it; see the changelog for the details. `Input`/`Textarea`: exposed `control`
@@ -2681,6 +2761,15 @@ aria-busy aria-label="Loading product"`, `ContentCard`'s loading root now matche
2681
2761
  consumer owns the remove control then: render it only while `removable` (false when `disabled` or
2682
2762
  `readonly`), as a real `<button type="button">` named `removeLabel` ("Remove <label>"), calling
2683
2763
  `remove`, which deselects and returns focus to the trigger.
2764
+ - **`MultiSelect` can offer "Select all" (`selectAll`).** Not in the spec's footer ("live count ·
2765
+ Clear · Done"), and on by default: a multi-select without it makes a long list a chore, and
2766
+ `:select-all="false"` leaves it out. A link button before Clear adds every enabled
2767
+ option the list is showing to the selection: all of them, or only a search's matches, whatever
2768
+ the render batch has drawn so far. Values already chosen keep their place and the new ones
2769
+ follow in list order; disabled options are never touched. It is the footer's first tab stop, so
2770
+ the `Tab` walk the spec describes runs Select all, Clear, Done. It fires `change` once, keeps the
2771
+ popover open and returns focus as Clear does, and is disabled when there is nothing left to
2772
+ add. Part `footerSelectAll`, message `selectAll`.
2684
2773
  - **`MultiSelect`'s tags can sit inside the field (`tagPlacement: 'inside'`).** The field then
2685
2774
  draws the trigger box (the `field` part) and wraps the tags and the trigger, growing a row at a
2686
2775
  time; the trigger is the rest of the last row, or a row of its own, and the panel matches the
@@ -0,0 +1,71 @@
1
+ import { r as useEldraScope } from "./useEldraScope-BDbGzt7R.js";
2
+ import { computed, createElementBlock, defineComponent, mergeProps, onMounted, openBlock, shallowRef, unref } from "vue";
3
+ // src/flag/flags.ts
4
+ /**
5
+ * The flag artwork is 46 kB gzipped, so it is one lazy chunk, fetched when the first `CountryFlag`
6
+ * (or `PhoneInput`, which draws them) mounts in a browser and shared by every one after it. Until
7
+ * it arrives a flag is an empty box of the same size, so nothing moves when it does. A server
8
+ * render never loads it: the server and the client's first render both draw the empty box, and
9
+ * agree.
10
+ */
11
+ var flags = shallowRef(null);
12
+ var loading;
13
+ /** Loads the flags. Safe to call more than once, and ahead of a flag to draw it sooner. */
14
+ function preloadCountryFlags() {
15
+ loading ??= import("./phoneFlagData-D9dDT2uC.js").then((module) => {
16
+ flags.value = module.default;
17
+ }, () => {
18
+ loading = void 0;
19
+ });
20
+ return loading;
21
+ }
22
+ /** A country's flag once the chunk is in; reactive, so a flag drawn before then fills in. */
23
+ function countryFlag(country) {
24
+ const entry = flags.value?.[country.toUpperCase()];
25
+ if (entry === void 0) return void 0;
26
+ const cut = entry.indexOf("|");
27
+ return {
28
+ viewBox: entry.slice(0, cut),
29
+ body: entry.slice(cut + 1)
30
+ };
31
+ }
32
+ // src/flag/CountryFlag.vue?vue&type=script&setup=true&lang.ts
33
+ var _hoisted_1 = ["data-eldra-scope"];
34
+ // src/flag/CountryFlag.vue
35
+ var CountryFlag_default = /* @__PURE__ */ defineComponent({
36
+ __name: "CountryFlag",
37
+ props: {
38
+ country: {},
39
+ label: {}
40
+ },
41
+ setup(__props) {
42
+ const props = __props;
43
+ const eldra = useEldraScope();
44
+ onMounted(() => {
45
+ preloadCountryFlags();
46
+ });
47
+ const art = computed(() => countryFlag(props.country));
48
+ const drawn = computed(() => art.value === void 0 ? {} : {
49
+ viewBox: art.value.viewBox,
50
+ innerHTML: art.value.body
51
+ });
52
+ const named = computed(() => props.label === void 0 || props.label === "" ? { "aria-hidden": "true" } : {
53
+ role: "img",
54
+ "aria-label": props.label
55
+ });
56
+ return (_ctx, _cache) => {
57
+ return openBlock(), createElementBlock("svg", mergeProps({
58
+ "data-eldra-ui": "",
59
+ "data-eldra-scope": unref(eldra).scope,
60
+ "data-part": "flag",
61
+ class: "eldra:h-3.5 eldra:w-5 eldra:shrink-0 eldra:eldra-phone-flag",
62
+ preserveAspectRatio: "none",
63
+ focusable: "false"
64
+ }, {
65
+ ...named.value,
66
+ ...drawn.value
67
+ }), null, 16, _hoisted_1);
68
+ };
69
+ }
70
+ });
71
+ export { preloadCountryFlags as n, CountryFlag_default as t };
@@ -1,6 +1,8 @@
1
- import { $ as useEldraScope, G as FIELD_KEY, P as FIELD_TEXT, W as useEldraUiLocale, X as useControllableModel, c as useOptionList, d as SelectPanel_default, et as joinIds, k as FIELD_RADIUS, t as usePopover, tt as useUiId, u as useListbox } from "./usePopover-4CQR2hB5.js";
2
- import { i as enUS, r as useMessages } from "./useMessages-DQQPh1P_.js";
3
- import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, mergeProps, nextTick, normalizeClass, onMounted, openBlock, ref, renderSlot, shallowRef, toDisplayString, toValue, unref, watch, withCtx } from "vue";
1
+ import { $ as FIELD_KEY, W as FIELD_RADIUS, Y as FIELD_TEXT, d as useEldraUiLocale, i as SelectPanel_default, nt as joinIds, p as usePopover, r as useOptionList, rt as useUiId, tt as useControllableModel, y as useListbox } from "./useOptionList-CPHHDvPF.js";
2
+ import { r as useEldraScope } from "./useEldraScope-BDbGzt7R.js";
3
+ import { i as enUS, r as useMessages } from "./useMessages-CYnyGVRG.js";
4
+ import { t as CountryFlag_default } from "./CountryFlag-DOa8lOHp.js";
5
+ import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, mergeProps, nextTick, normalizeClass, onMounted, openBlock, ref, renderSlot, toDisplayString, toValue, unref, watch, withCtx } from "vue";
4
6
  import { comparator } from "@eldrajs/sdk/format";
5
7
  import { AsYouType, Metadata, getCountries, getCountryCallingCode, getExampleNumber, isSupportedCountry, parseIncompletePhoneNumber, parsePhoneNumberFromString } from "libphonenumber-js/min";
6
8
  import examples from "libphonenumber-js/mobile/examples";
@@ -46,34 +48,6 @@ function phoneExample(country) {
46
48
  if (!isSupportedCountry(country)) return void 0;
47
49
  return getExampleNumber(country, examples)?.formatNational();
48
50
  }
49
- // src/phone/flags.ts
50
- /**
51
- * The flag artwork is 46 kB gzipped, so it is one lazy chunk, fetched when the first `PhoneInput`
52
- * mounts in a browser and shared by every one after it. Until it arrives a flag is an empty box of
53
- * the same size, so nothing moves when it does. A server render never loads it: the server and the
54
- * client's first render both draw the empty box, and agree.
55
- */
56
- var flags = shallowRef(null);
57
- var loading;
58
- /** Loads the flags. Safe to call more than once, and ahead of a `PhoneInput` to draw them sooner. */
59
- function preloadPhoneFlags() {
60
- loading ??= import("./phoneFlagData-D9dDT2uC.js").then((module) => {
61
- flags.value = module.default;
62
- }, () => {
63
- loading = void 0;
64
- });
65
- return loading;
66
- }
67
- /** A country's flag once the chunk is in; reactive, so a flag drawn before then fills in. */
68
- function phoneFlag(country) {
69
- const entry = flags.value?.[country];
70
- if (entry === void 0) return void 0;
71
- const cut = entry.indexOf("|");
72
- return {
73
- viewBox: entry.slice(0, cut),
74
- body: entry.slice(cut + 1)
75
- };
76
- }
77
51
  // src/phone/phone.ts
78
52
  /**
79
53
  * Everything `@eldrajs/ui/phone` knows about phone numbers, with no Vue in it. This file and
@@ -196,33 +170,6 @@ function readPhone(value, country, allowed = () => true) {
196
170
  };
197
171
  return state;
198
172
  }
199
- // src/phone/PhoneFlag.vue?vue&type=script&setup=true&lang.ts
200
- var _hoisted_1$1 = ["data-eldra-scope"];
201
- // src/phone/PhoneFlag.vue
202
- var PhoneFlag_default = /* @__PURE__ */ defineComponent({
203
- __name: "PhoneFlag",
204
- props: { country: {} },
205
- setup(__props) {
206
- const props = __props;
207
- const eldra = useEldraScope();
208
- const art = computed(() => phoneFlag(props.country));
209
- const drawn = computed(() => art.value === void 0 ? {} : {
210
- viewBox: art.value.viewBox,
211
- innerHTML: art.value.body
212
- });
213
- return (_ctx, _cache) => {
214
- return openBlock(), createElementBlock("svg", mergeProps({
215
- "data-eldra-ui": "",
216
- "data-eldra-scope": unref(eldra).scope,
217
- "data-part": "flag",
218
- class: "eldra:h-3.5 eldra:w-5 eldra:shrink-0 eldra:eldra-phone-flag",
219
- preserveAspectRatio: "none",
220
- "aria-hidden": "true",
221
- focusable: "false"
222
- }, drawn.value), null, 16, _hoisted_1$1);
223
- };
224
- }
225
- });
226
173
  // src/phone/rule.ts
227
174
  /** A country's name in `locale` (`IS`, `is-IS` → `Ísland`); the code itself when it has none. */
228
175
  function phoneCountryName(country, locale) {
@@ -429,7 +376,6 @@ var PhoneInput_default = /* @__PURE__ */ defineComponent({
429
376
  });
430
377
  onMounted(() => {
431
378
  if (props.country !== void 0 && props.country !== country.value) emit("update:country", country.value);
432
- preloadPhoneFlags();
433
379
  });
434
380
  const controlRef = ref(null);
435
381
  function onInput(event) {
@@ -620,7 +566,7 @@ var PhoneInput_default = /* @__PURE__ */ defineComponent({
620
566
  createElementVNode("span", {
621
567
  "data-eldra-slot": unref(eldra).slotHost("flag"),
622
568
  class: "eldra:flex eldra:shrink-0"
623
- }, [renderSlot(_ctx.$slots, "flag", { country: country.value }, () => [createVNode(PhoneFlag_default, {
569
+ }, [renderSlot(_ctx.$slots, "flag", { country: country.value }, () => [createVNode(CountryFlag_default, {
624
570
  country: country.value,
625
571
  class: normalizeClass(__props.classes?.flag)
626
572
  }, null, 8, ["country", "class"])])], 8, _hoisted_3),
@@ -705,7 +651,7 @@ var PhoneInput_default = /* @__PURE__ */ defineComponent({
705
651
  onKeydown: unref(listbox).onKeydown
706
652
  }, {
707
653
  optionContent: withCtx(({ option, match }) => [
708
- renderSlot(_ctx.$slots, "flag", { country: option.value }, () => [createVNode(PhoneFlag_default, {
654
+ renderSlot(_ctx.$slots, "flag", { country: option.value }, () => [createVNode(CountryFlag_default, {
709
655
  country: option.value,
710
656
  class: normalizeClass(__props.classes?.flag)
711
657
  }, null, 8, ["country", "class"])]),
@@ -746,4 +692,4 @@ var PhoneInput_default = /* @__PURE__ */ defineComponent({
746
692
  };
747
693
  }
748
694
  });
749
- export { parsePhone as a, preloadPhoneFlags as c, isValidPhone as i, phoneExample as l, phoneCountryName as n, phoneCallingCode as o, phoneRule as r, phoneCountries as s, PhoneInput_default as t };
695
+ export { parsePhone as a, phoneExample as c, isValidPhone as i, phoneCountryName as n, phoneCallingCode as o, phoneRule as r, phoneCountries as s, PhoneInput_default as t };