@eldrajs/ui 0.3.7 → 0.3.8

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 (56) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE-country-flag-icons +25 -0
  3. package/README.md +230 -66
  4. package/dist/PhoneInput-CYGpERg4.js +749 -0
  5. package/dist/{VariantPicker-Cr_AkX47.js → VariantPicker-D_Gg80So.js} +88 -2302
  6. package/dist/components/chip/Chip.vue.d.ts +8 -0
  7. package/dist/components/dialog/Dialog.vue.d.ts +8 -0
  8. package/dist/components/drawer/Drawer.vue.d.ts +8 -0
  9. package/dist/components/filter-panel/FilterGroup.vue.d.ts +8 -0
  10. package/dist/components/filter-panel/FilterPanel.vue.d.ts +8 -0
  11. package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +8 -0
  12. package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +8 -0
  13. package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +8 -0
  14. package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +8 -0
  15. package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +8 -0
  16. package/dist/components/lightbox/Lightbox.vue.d.ts +8 -0
  17. package/dist/components/nav-menu/NavMenu.vue.d.ts +8 -0
  18. package/dist/components/pagination/Pagination.vue.d.ts +8 -0
  19. package/dist/components/range-slider/RangeSlider.vue.d.ts +8 -0
  20. package/dist/components/search-bar/SearchBar.vue.d.ts +8 -0
  21. package/dist/components/search-modal/SearchModal.vue.d.ts +8 -0
  22. package/dist/components/select/MultiSelect.vue.d.ts +8 -0
  23. package/dist/components/select/Select.vue.d.ts +8 -0
  24. package/dist/components/site-form/SiteForm.vue.d.ts +8 -0
  25. package/dist/components/toast/Toast.vue.d.ts +8 -0
  26. package/dist/components/toast/Toaster.vue.d.ts +8 -0
  27. package/dist/components.css +64 -0
  28. package/dist/index.js +3 -2
  29. package/dist/messages/en-US.d.ts +19 -0
  30. package/dist/messages/is-IS.js +9 -1
  31. package/dist/phone/PhoneFlag.vue.d.ts +6 -0
  32. package/dist/phone/PhoneInput.vue.d.ts +220 -0
  33. package/dist/phone/caret.d.ts +14 -0
  34. package/dist/phone/examples.d.ts +2 -0
  35. package/dist/phone/flags.d.ts +8 -0
  36. package/dist/phone/index.d.ts +13 -0
  37. package/dist/phone/phone.d.ts +62 -0
  38. package/dist/phone/phoneFlagData.d.ts +2 -0
  39. package/dist/phone/rule.d.ts +22 -0
  40. package/dist/phone/types.d.ts +63 -0
  41. package/dist/phone/vee-validate/FieldPhoneInput.vue.d.ts +24 -0
  42. package/dist/phone/vee-validate/index.d.ts +3 -0
  43. package/dist/phone/vee-validate/types.d.ts +3 -0
  44. package/dist/phone/vee-validate.js +96 -0
  45. package/dist/phone.js +1 -0
  46. package/dist/phoneFlagData-D9dDT2uC.js +261 -0
  47. package/dist/resolver.d.ts +9 -2
  48. package/dist/resolver.js +15 -4
  49. package/dist/style.css +64 -0
  50. package/dist/useFieldControl-D_b9SC9s.js +273 -0
  51. package/dist/{useMessages-DOHGfip_.js → useMessages-DQQPh1P_.js} +20 -1
  52. package/dist/usePopover-4CQR2hB5.js +2228 -0
  53. package/dist/utilities.css +37 -0
  54. package/dist/vee-validate.js +6 -273
  55. package/dist/vue-i18n.js +4 -1
  56. package/package.json +19 -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 | CSS variables |
177
- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
178
- | `Accordion` | none — the top divider is a stock `border-t`, no per-component variable |
179
- | `AccordionItem` | `--eldra-accordion-title-line` (default `1.4`) — the label's line ratio, no token of its own |
180
- | `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) |
181
- | `AvatarGroup` | none — the overlap and stack order are plain Tailwind, no per-component variable |
182
- | `Badge` | `--eldra-badge-line-height` (default `1`) — the badge text's line ratio, no token of its own |
183
- | `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 |
184
- | `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) |
185
- | `ButtonGroup` | none — reads only the shared tokens from layer 1 |
186
- | `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) |
187
- | `Checkbox` | `--eldra-checkbox-radius` (default `var(--eldra-radius-sm)`), `--eldra-checkbox-border-width` (default `1.5px`), `--eldra-checkbox-border-width-invalid` (default `2px`) |
188
- | `CheckboxGroup` | none — reads only the shared tokens from layer 1 |
189
- | `Chip` | none — the selected/hover fills are `color-mix()` over shared `--eldra-color-*` tokens, no per-component variable |
190
- | `ChipGroup` | none — reads only the shared tokens from layer 1 |
191
- | `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 |
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
- | `CurrencyInput` | `UnitInput`'s exactly (it renders a `UnitInput` with `isCurrency` always on) — see the `UnitInput` row |
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`; `--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
- | `EditorPlaceholder` | `--eldra-editor-placeholder-border-width` (default `1.5px`) — the dashed boundary's width, distinct from `EmptyState`'s own stock `border` (1px) |
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
- | `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 |
199
- | `FieldWrapper` | `--eldra-field-note-line-height` (default `1.45`) — the line the help and error text share |
200
- | `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 |
201
- | `FormLayout` | `--eldra-form-summary-radius` (default `var(--eldra-radius-md)`) — the status summary box's corner radius |
202
- | `Icon` | none — reads only the shared tokens from layer 1 |
203
- | `Image` | `--eldra-image-hatch-gap` (default `0.75rem`) — the live "No image" placeholder's diagonal-line repeat distance |
204
- | `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`) |
205
- | `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` |
206
- | `Link` | `--eldra-link-radius` (default `2px`) — the focus ring's corner radius on every variant |
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
- | `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
- | `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 |
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 |
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 |
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 |
214
- | `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 |
215
- | `ProductCard` | none of its own — it composes `Image`/`Badge`/`StockBadge`/`Price`/`Button`, each restyled through its own row above |
216
- | `QuantityStepper` | `--eldra-stepper-radius` (default `var(--eldra-radius-md)`) |
217
- | `Radio` | the radio circle reads `--eldra-checkbox-border-width`/`-invalid`, shared with `Checkbox` and `RadioGroup` |
218
- | `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` |
219
- | `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 |
220
- | `Rating` | none — the half-star overlay (`eldra-rating-half`) is a fixed `clip-path`, no per-component variable |
221
- | `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 |
222
- | `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`) |
223
- | `Section` | none — the vertical rhythm (`--eldra-section-{sm,md,lg}`) and the gutters it shares with `Container` are shared tokens |
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 |
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)) |
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 |
229
- | `StockBadge` | `--eldra-stock-status-line` (default `1.4`) — the status line text's line ratio, no token of its own |
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) |
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) |
232
- | `TabPanel` | none — reads only the shared tokens from layer 1 |
233
- | `TablerIcon` | none — reads only the shared tokens from layer 1, the same as `Icon` |
234
- | `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 |
235
- | `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`) |
236
- | `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 |
237
- | `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 |
238
- | `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 |
239
- | `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) |
240
- | `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`) |
241
- | `VisuallyHidden` | none — reads only the shared tokens from layer 1 (it renders no visible box at all) |
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,158 @@ 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
+ ## `./phone`
1278
+
1279
+ `@eldrajs/ui/phone` is a phone number field with its country inside it. It is an entry of its own
1280
+ because it is the only part of the package that needs
1281
+ [`libphonenumber-js`](https://gitlab.com/catamphetamine/libphonenumber-js): an app that never
1282
+ imports this entry never installs or bundles it (a test proves it, in the source graph and in
1283
+ `dist/`).
1284
+
1285
+ ```bash
1286
+ pnpm add libphonenumber-js # optional peer, ^1.13
1287
+ ```
1288
+
1289
+ ```vue
1290
+ <script setup lang="ts">
1291
+ import { FieldWrapper } from '@eldrajs/ui';
1292
+ import { PhoneInput } from '@eldrajs/ui/phone';
1293
+ import { ref } from 'vue';
1294
+
1295
+ const phone = ref(''); // '+3545812345'
1296
+ </script>
1297
+
1298
+ <template>
1299
+ <FieldWrapper label="Phone number">
1300
+ <PhoneInput v-model="phone" default-country="IS" :preferred-countries="['IS']" />
1301
+ </FieldWrapper>
1302
+ </template>
1303
+ ```
1304
+
1305
+ **Anatomy.** One field box holding a country button (flag, dialling code, chevron) and the number
1306
+ `<input type="tel">`. The button opens the country list under the whole field, as wide as it: a
1307
+ search field, then the countries, each with its flag, name and dialling code. Parts (`data-part`,
1308
+ each a `classes` key except `root`): `root`, `field`, `countryButton`, `flag`, `callingCode`,
1309
+ `chevron`, `control`, and the list's `panel`, `search`, `listbox`, `group`, `groupLabel`, `option`,
1310
+ `optionLabel`, `optionMeta`, `optionCheck`, `empty`. The list is the panel `Select` opens, built
1311
+ from the same parts, so it is styled by the same variables.
1312
+
1313
+ **Properties**
1314
+
1315
+ | Prop | Type | Default | |
1316
+ | ------------------------------------------ | ---------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1317
+ | `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 |
1318
+ | `country` | `string` | | The chosen country, ISO 3166-1 alpha-2. `v-model:country` follows it |
1319
+ | `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` |
1320
+ | `preferredCountries` | `string[]` | | Listed first, under "Suggested", in this order |
1321
+ | `countries` | `string[]` | every country | The only countries offered, and the only ones a typed `+` may switch to |
1322
+ | `locale` | `string` | `provideEldraUiLocale`'s | The locale countries are named and sorted in |
1323
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | `Input`'s heights |
1324
+ | `name` | `string` | | Posts the E.164 value under this name, through a hidden input |
1325
+ | `placeholder` | `string \| false` | an example number | A number the chosen country could have; `false` for none |
1326
+ | `autocomplete` | `string` | `'tel-national'` | |
1327
+ | `id`, `invalid`, `describedBy`, `required` | | the `FieldWrapper`'s | As on `Input` |
1328
+ | `readonly` | `boolean` | `false` | The number can be read and copied; the list does not open and the chevron is not drawn |
1329
+ | `disabled` | `boolean` | `false` | |
1330
+ | `messages`, `classes` | | | As on every component |
1331
+
1332
+ **Events**: `update:modelValue`, `update:country`, `change` (after every edit and every change of
1333
+ country: `{ e164, country, callingCode, nationalNumber, valid }`), `focus`, `blur`, `open`, `close`.
1334
+ **Slots**: `flag` (`{ country }`), drawn in the button and on every row in place of the built-in
1335
+ artwork. **Exposed**: `control` (the number `<input>`), `focus()`, `country`.
1336
+
1337
+ **Behaviour**
1338
+
1339
+ - The field shows the national number only, spaced the way the chosen country writes it, re-spaced
1340
+ on every keystroke. The caret stays with what was typed: it is put back after the same number of
1341
+ digits, so typing or deleting in the middle of a number does not send it to the end.
1342
+ - Typing or pasting a number that starts with `+` picks the country by itself. As soon as the
1343
+ dialling code is complete, the `+` and the code leave the text and the button shows them.
1344
+ - A dialling code several countries share (`+1` is 25 countries, `+44` four) keeps the current
1345
+ country when it is one of them and otherwise takes the country the code belongs to; once the
1346
+ digits say which country the number is in, the country follows them.
1347
+ - Choosing a country from the list keeps the digits, re-spaces them and moves focus to the number.
1348
+ - The list is `preferredCountries` first, then every other country from A to Z in the locale's own
1349
+ order, each listed once. Search finds a country by name (case and accents ignored), by dialling
1350
+ code with or without the `+`, or by ISO code; with no match it says so in text.
1351
+ - Spacing is the phone library's. Some countries are only spaced when the number is typed with its
1352
+ national prefix: a British `7400123456` stays unspaced, `07400 123456` is spaced. Both are the
1353
+ same E.164 value. A value bound from outside is shown in full national form.
1354
+ - Country names come from `Intl.DisplayNames` through `@eldrajs/sdk/format/display-names`, so
1355
+ Icelandic names are right on runtimes that ship without Icelandic.
1356
+
1357
+ **States**: empty (an example number as placeholder), focused, filled, invalid, read-only,
1358
+ disabled, list open. One focus ring, around the whole box: while the number or the button has
1359
+ keyboard focus, and while the list is open.
1360
+
1361
+ **Keyboard**
1362
+
1363
+ | Key | On | Does |
1364
+ | ---------------------------------------- | ---------------- | ------------------------------------------------------------------------ |
1365
+ | `Tab` | | The country button, then the number |
1366
+ | `Enter`, `Space`, `ArrowDown`, `ArrowUp` | the button | Opens the list; focus moves to its search field |
1367
+ | a letter or digit | the button | Opens the list with that character as the search |
1368
+ | `ArrowDown` / `ArrowUp` | the search field | Moves through the countries (`PageUp`/`PageDown` by ten) |
1369
+ | `Enter` | the search field | Chooses the active country; focus moves to the number |
1370
+ | `Escape` | the search field | Clears the search; pressed again, closes and returns focus to the button |
1371
+ | `Tab` | the search field | Closes the list |
1372
+
1373
+ **Accessibility.** The number is a native `<input type="tel">`, named by the `FieldWrapper`'s
1374
+ `<label for>` (or an `aria-label` of your own). The country button is a `combobox` with
1375
+ `aria-haspopup="listbox"`, named "Country: Iceland, +354" (`phoneCountry`); the list is a `listbox`
1376
+ named "Country" (`phoneCountryList`), its rows `option`s with `aria-selected`, the search field a
1377
+ `combobox` that owns `aria-activedescendant`. Flags are decorative (`aria-hidden`): the name and
1378
+ the code are always in text, so the country is never told by a flag alone.
1379
+
1380
+ **Flags.** The artwork is [country-flag-icons](https://gitlab.com/catamphetamine/country-flag-icons)
1381
+ (MIT; `LICENSE-country-flag-icons` ships in the package), copied into the package by
1382
+ `pnpm --filter @eldrajs/ui build-phone-flags`. It is one lazy chunk (about 46 kB gzipped), fetched
1383
+ 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.
1385
+
1386
+ **Helpers**, from the same entry: `isValidPhone(value, country?)`, `parsePhone(value, country?)`
1387
+ (`{ e164, country, callingCode, nationalNumber, national, valid } | null`), `phoneCountries()`,
1388
+ `phoneCallingCode(country)`, `phoneCountryName(country, locale)`, `phoneExample(country)` and
1389
+ `phoneRule(options)`. Validity is the phone library's `min` metadata: landlines and mobiles both
1390
+ pass, and a number is refused when its length or its prefix is not one the country uses.
1391
+
1392
+ ### With vee-validate
1393
+
1394
+ `@eldrajs/ui/phone/vee-validate` exports `FieldPhoneInput` and `phoneRule`. It is not part of
1395
+ `@eldrajs/ui/vee-validate`, which must load in an app that has not installed `libphonenumber-js`.
1396
+
1397
+ ```vue
1398
+ <Form aria-label="Contact details" @submit="save">
1399
+ <template #default="{ errors }">
1400
+ <FieldWrapper label="Phone number" :error="errors.phone">
1401
+ <FieldPhoneInput name="phone" default-country="IS" />
1402
+ </FieldWrapper>
1403
+ </template>
1404
+ </Form>
1405
+ ```
1406
+
1407
+ `FieldPhoneInput` takes every `PhoneInput` prop and the `Field*` binding props (`name`, `path`,
1408
+ `rules`, `label`, and the three [validation props](#when-a-field-validates) with the typed-control
1409
+ defaults: it validates when the field is left and on submit, not while a number is typed). With no
1410
+ `rules` it checks the number against the country the field is on and shows "Enter a valid phone
1411
+ number for Iceland." (`phoneInvalid`, the country named in the field's locale). An empty field
1412
+ passes; add a required rule where the number is required. `rules` replaces the built-in check, so
1413
+ combine the two yourself:
1414
+
1415
+ ```ts
1416
+ import { phoneRule } from '@eldrajs/ui/phone/vee-validate';
1417
+
1418
+ const valid = phoneRule({ country: () => country.value, locale: 'is-IS', messages: isIS });
1419
+ const rules = (value: unknown) => (value ? valid(value) : 'Enter your phone number.');
1420
+ ```
1421
+
1422
+ `phoneRule` imports nothing from vee-validate: it returns `true` or the message, so it serves a
1423
+ form `validationSchema`, zod's `refine`, or a check of your own. Its messages (`phoneInvalid`,
1424
+ `phoneInvalidNumber`) are part of the message set, so they translate through
1425
+ [`./vue-i18n`](#with-vue-i18n) like every other one.
1426
+
1268
1427
  ## Accessibility and testing
1269
1428
 
1270
1429
  Every component in this package ships, as part of being done, not as an add-on:
@@ -1315,6 +1474,11 @@ during development, outside this repository's own history.
1315
1474
  Things this package ships that design spec 1 does not name at all. Each is listed here so a reader
1316
1475
  comparing the package against the spec can tell an addition from a drift.
1317
1476
 
1477
+ - **`PhoneInput`** (`@eldrajs/ui/phone`, WS-1006): a phone number field with a country picker, as-you-type
1478
+ spacing and per-country validation. The spec has no phone field; its anatomy, properties, states,
1479
+ keyboard and accessibility are written up under [`./phone`](#phone) above. Two utilities came
1480
+ with it: `eldra-focus-has-open` (the focus ring while a popup opened from inside the element is
1481
+ open) and `eldra-phone-flag`.
1318
1482
  - **Wrapper hooks** (operator decision, 2026-11-08): options that let the private component library
1319
1483
  render these components as designed instead of keeping copies of them. Each is opt-in, and output
1320
1484
  is unchanged without it; see the changelog for the details. `Input`/`Textarea`: exposed `control`