@eldrajs/ui 0.3.15 → 0.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +3 -2
- package/dist/{PhoneInput-B5AgJJVE.js → PhoneInput-CHTpjbtS.js} +2 -2
- package/dist/{VariantPicker-Buz_8mHq.js → VariantPicker-Dein0E4i.js} +4200 -4195
- package/dist/componentNames.d.ts +1 -1
- package/dist/components/autocomplete/Autocomplete.vue.d.ts +2 -0
- package/dist/components/chip/Chip.vue.d.ts +2 -0
- package/dist/components/currency-picker/CurrencyPicker.vue.d.ts +17 -0
- package/dist/components/currency-picker/types.d.ts +21 -0
- package/dist/components/dialog/Dialog.vue.d.ts +2 -0
- package/dist/components/drawer/Drawer.vue.d.ts +2 -0
- package/dist/components/filter-panel/FilterGroup.vue.d.ts +2 -0
- package/dist/components/filter-panel/FilterPanel.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +2 -0
- package/dist/components/lightbox/Lightbox.vue.d.ts +2 -0
- package/dist/components/nav-menu/NavMenu.vue.d.ts +2 -0
- package/dist/components/pagination/Pagination.vue.d.ts +2 -0
- package/dist/components/popover/Popover.vue.d.ts +1 -1
- package/dist/components/product-card/types.d.ts +3 -1
- package/dist/components/range-slider/RangeSlider.vue.d.ts +2 -0
- package/dist/components/search-bar/SearchBar.vue.d.ts +2 -0
- package/dist/components/search-modal/SearchModal.vue.d.ts +3 -1
- package/dist/components/section/Section.vue.d.ts +1 -1
- package/dist/components/select/MultiSelect.vue.d.ts +2 -0
- package/dist/components/select/Select.vue.d.ts +2 -0
- package/dist/components/site-form/SiteForm.vue.d.ts +2 -0
- package/dist/components/tabs/Tab.vue.d.ts +2 -0
- package/dist/components/tabs/Tabs.vue.d.ts +2 -0
- package/dist/components/tabs/context.d.ts +3 -1
- package/dist/components/tabs/types.d.ts +8 -0
- package/dist/components/toast/Toast.vue.d.ts +2 -0
- package/dist/components/toast/Toaster.vue.d.ts +2 -0
- package/dist/components.css +40 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1001 -853
- package/dist/messages/en-US.d.ts +4 -0
- package/dist/messages/is-IS.js +2 -0
- package/dist/phone/PhoneInput.vue.d.ts +2 -0
- package/dist/phone/vee-validate.js +4 -4
- package/dist/phone.js +1 -1
- package/dist/resolver.js +1 -0
- package/dist/style.css +40 -0
- package/dist/{useFieldControl-CGH6GEWM.js → useFieldControl-B1JvPEeM.js} +1 -1
- package/dist/{useMessages-CrSnIuLt.js → useMessages-BdN9F1cW.js} +4 -0
- package/dist/{useOptionList-CPHHDvPF.js → useOptionList-UMUMayec.js} +1 -0
- package/dist/utilities.css +9 -0
- package/dist/utils/number-format.d.ts +2 -0
- package/dist/vee-validate.js +3 -3
- package/dist/vue-i18n.js +2 -1
- package/package.json +2 -2
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
|
+
- **`CurrencyPicker`**: the currency a visitor shops in, a `Select` of full names with the code ("Euro (EUR)", in the page's language through `Intl.DisplayNames`) showing the code when closed; nothing with fewer than two currencies; `busy` marks a change on its way while still taking a newer choice. New message `currencyPickerLabel` ("Currency" / "Gjaldmiðill").
|
|
11
|
+
- **`toMinorUnits(amount, currency, locale?)`**: a major-unit amount as the minor units `Price` reads, by the currency's own decimals.
|
|
12
|
+
- **`ProductCard` `product.notSoldIn`** (a currency code): the product has no price in the shopper's currency. The price gives way to a line saying so ("Not available in EUR" / "Ekki til sölu í EUR") the stock line is hidden, and quick add is a disabled button with the same words. New part `notSold`; new message `notSoldInCurrency`, also through `@eldrajs/ui/vue-i18n`.
|
|
13
|
+
- **`Tabs` `size="sm"` and `fill`.** `sm` is a tab bar for a tool panel: 2.25rem tall tabs with 13px text at weight 500 (also when selected, so a label never changes width), a 0.375rem gap between an icon and its label, no gap between tabs and a 2px indicator across the whole tab; the selected text and the indicator are `--eldra-tabs-accent` (default the primary colour), the unselected text `--eldra-tabs-muted` (default `muted`) and the hover background `--eldra-tabs-hover-bg`, set on the `Tabs` to colour one tab bar without re-theming the kit. `fill` makes the tabs share the list's width equally, and a label too long for its share truncates with an ellipsis. On a keyboard-focused `sm` tab the indicator lifts so the focus ring is not covered. The variables apply to the underline variant only; `sm` pills keep the `primary` fill. Both reach every `Tab` through the context, in the `items` and the slots API, and in both variants. `md` and no `fill` render as before. New type `TabsSize`; new utility `text-tab-sm`.
|
|
10
14
|
- **`--eldra-scrollbar-width`** on `<html>` while a `Dialog`, `Drawer`, `Lightbox` or `SearchModal` is open: the width of the scrollbar the scroll lock hid (`0px` when none). A `position: fixed` element that spans the window, such as a fixed site header, pads itself with it (`padding-right: var(--eldra-scrollbar-width, 0px)`) so it does not widen when a modal opens.
|
|
11
15
|
- **`Lightbox` `zoom`** (default `false`) enlarges the current image to its real size: over the image the cursor is a magnifier and a zoom button shows, a click or the button zooms in, the mouse or the arrow keys pan, and a click, the button or `Esc` zooms out. An image under 1.25× its shown size offers no zoom; phones keep pinch-zoom. New part `zoomButton`; new messages `lightboxZoomIn` ("Zoom in" / "Stækka mynd") and `lightboxZoomOut` ("Zoom out" / "Minnka mynd"), also through `@eldrajs/ui/vue-i18n`.
|
|
12
16
|
- **`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.
|
package/README.md
CHANGED
|
@@ -194,6 +194,7 @@ Every component supports all five of these; none hard-codes anything a store mig
|
|
|
194
194
|
| `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 |
|
|
195
195
|
| `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 |
|
|
196
196
|
| `CurrencyInput` | `UnitInput`'s exactly (it renders a `UnitInput` with `isCurrency` always on) — see the `UnitInput` row |
|
|
197
|
+
| `CurrencyPicker` | `Select`'s and `FieldWrapper`'s exactly: it renders a `Select` inside a `FieldWrapper`; `classes` takes `root` plus every `Select` part |
|
|
197
198
|
| `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 |
|
|
198
199
|
| `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)`) |
|
|
199
200
|
| `EditorPlaceholder` | `--eldra-editor-placeholder-border-width` (default `1.5px`) — the dashed boundary's width, distinct from `EmptyState`'s own stock `border` (1px) |
|
|
@@ -232,10 +233,10 @@ Every component supports all five of these; none hard-codes anything a store mig
|
|
|
232
233
|
| `StepIndicator` | none — reads only the shared tokens from layer 1 |
|
|
233
234
|
| `StockBadge` | `--eldra-stock-status-line` (default `1.4`) — the status line text's line ratio, no token of its own |
|
|
234
235
|
| `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) |
|
|
235
|
-
| `Tab` |
|
|
236
|
+
| `Tab` | `--eldra-tabs-accent`, `--eldra-tabs-muted` and `--eldra-tabs-hover-bg` for a `size="sm"` underline tab (see the `Tabs` row, which owns them); otherwise the shared tokens from layer 1, plus `VariantPicker`'s `text-variant-pill` type style (see that component's row) |
|
|
236
237
|
| `TabPanel` | none — reads only the shared tokens from layer 1 |
|
|
237
238
|
| `TablerIcon` | none — reads only the shared tokens from layer 1, the same as `Icon` |
|
|
238
|
-
| `Tabs` |
|
|
239
|
+
| `Tabs` | `--eldra-tabs-accent` (default `var(--eldra-color-primary)`), `--eldra-tabs-muted` (default `var(--eldra-color-muted)`) and `--eldra-tabs-hover-bg` (default the 6% tint of the text colour) — the colours of a `size="sm"` underline tab bar only: selected text and the 2px indicator, unselected text, and the hover background. Set them on the `Tabs` (`class`) to colour a panel's tab bar without re-theming `--eldra-color-*` for every other component; `md` and pills never read them. 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 |
|
|
239
240
|
| `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`) |
|
|
240
241
|
| `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 |
|
|
241
242
|
| `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 |
|
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
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-UMUMayec.js";
|
|
2
2
|
import { r as useEldraScope } from "./useEldraScope-BDbGzt7R.js";
|
|
3
|
-
import { i as enUS, r as useMessages } from "./useMessages-
|
|
3
|
+
import { i as enUS, r as useMessages } from "./useMessages-BdN9F1cW.js";
|
|
4
4
|
import { t as CountryFlag_default } from "./CountryFlag-DOa8lOHp.js";
|
|
5
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";
|
|
6
6
|
import { comparator } from "@eldrajs/sdk/format";
|