@eldrajs/ui 0.3.18 → 0.3.19

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 CHANGED
@@ -7,6 +7,9 @@ Release-please writes the generated notes from commit messages and does not repl
7
7
 
8
8
  ### Added
9
9
 
10
+ - **`NavMenu` draws cards (WS-1362).** An entry with `display: 'card'` and a resolved `card` is drawn as a card: its picture cropped to the new `cardAspect` prop (`width:height`, default `4:3`), the title, and `card.price` written with `formatPrice` in the ambient `CURRENCY_KEY` and `LOCALE_KEY` (a plain number without a currency). A column holding cards lays them two to a row in the bar and in the drawer; a plain entry beside them takes a whole row, and the heading, cards and plain entries of that column start at one edge. The column and the columns row carry `data-cards` for a theme to size it. The picture has an empty `alt` since the title beside it names the link. New parts `card`, `cardImage`, `cardTitle`, `cardPrice` (and `drawer…`), new helpers `isCard` and `cardAspectRatio` in `navLinks`. The `panelItem` slot still replaces the card; an entry without a resolved `card` stays a link.
11
+ - **`NavMenuLink.card` and `display` (WS-1326).** A resolved card (`{ image, title, price? }`) rides on the entry and reaches the `panelItem` slot as `link.card`. New type `NavMenuCard`.
12
+ - **`NavMenu` sections (WS-1321).** `NavMenuItem.sections` (new type `NavMenuSection`: `heading`, `headingLink`, `links`, `seeAll`, `display`), which a resolved Studio link carries for a theme that declares `tree.sections`, draws one column per section in a `mega` panel: a heading that links when it has a page, the "see all" entry last (`data-see-all`, and `isSeeAll` in the `panelItem` slot props), a section with only a heading link headed by that link's label, a section with nothing to show left out. `children` and `groups` keep working for a link without sections. New helper `panelRuns` in `navLinks`.
10
13
  - **`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
14
  - **`toMinorUnits(amount, currency, locale?)`**: a major-unit amount as the minor units `Price` reads, by the currency's own decimals.
12
15
  - **`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`.
@@ -258,7 +258,10 @@ var Input_default = /* @__PURE__ */ defineComponent({
258
258
  min: { default: void 0 },
259
259
  max: { default: void 0 },
260
260
  step: { default: void 0 },
261
- leadingIcon: { default: void 0 },
261
+ leadingIcon: {
262
+ type: [Object, Function],
263
+ default: void 0
264
+ },
262
265
  clearable: {
263
266
  type: Boolean,
264
267
  default: void 0
@@ -582,7 +585,10 @@ var Autocomplete_default = /* @__PURE__ */ defineComponent({
582
585
  type: [String, Boolean],
583
586
  default: void 0
584
587
  },
585
- leadingIcon: { default: void 0 },
588
+ leadingIcon: {
589
+ type: [Object, Function],
590
+ default: void 0
591
+ },
586
592
  clearable: {
587
593
  type: Boolean,
588
594
  default: void 0
@@ -1017,15 +1023,31 @@ var Button_default = /* @__PURE__ */ defineComponent({
1017
1023
  size: { default: "md" },
1018
1024
  type: { default: "button" },
1019
1025
  href: { default: void 0 },
1020
- as: { default: void 0 },
1026
+ as: {
1027
+ type: [
1028
+ String,
1029
+ Object,
1030
+ Function
1031
+ ],
1032
+ default: void 0
1033
+ },
1021
1034
  to: { default: void 0 },
1022
- iconLeft: { default: void 0 },
1023
- iconRight: { default: void 0 },
1035
+ iconLeft: {
1036
+ type: [Object, Function],
1037
+ default: void 0
1038
+ },
1039
+ iconRight: {
1040
+ type: [Object, Function],
1041
+ default: void 0
1042
+ },
1024
1043
  iconOnly: {
1025
1044
  type: Boolean,
1026
1045
  default: false
1027
1046
  },
1028
- icon: { default: void 0 },
1047
+ icon: {
1048
+ type: [Object, Function],
1049
+ default: void 0
1050
+ },
1029
1051
  label: { default: void 0 },
1030
1052
  loading: {
1031
1053
  type: Boolean,
@@ -2503,7 +2525,10 @@ var UnitInput_default = /* @__PURE__ */ defineComponent({
2503
2525
  size: { default: "md" },
2504
2526
  id: { default: void 0 },
2505
2527
  name: { default: void 0 },
2506
- leadingIcon: { default: void 0 },
2528
+ leadingIcon: {
2529
+ type: [Object, Function],
2530
+ default: void 0
2531
+ },
2507
2532
  invalid: {
2508
2533
  type: Boolean,
2509
2534
  default: void 0
@@ -3319,7 +3344,10 @@ var Select_default = /* @__PURE__ */ defineComponent({
3319
3344
  default: false
3320
3345
  },
3321
3346
  placeholder: { default: void 0 },
3322
- leadingIcon: { default: void 0 },
3347
+ leadingIcon: {
3348
+ type: [Object, Function],
3349
+ default: void 0
3350
+ },
3323
3351
  invalid: {
3324
3352
  type: Boolean,
3325
3353
  default: void 0
@@ -4910,7 +4938,10 @@ var MultiSelect_default = /* @__PURE__ */ defineComponent({
4910
4938
  default: void 0
4911
4939
  },
4912
4940
  searchPlaceholder: { default: void 0 },
4913
- leadingIcon: { default: void 0 },
4941
+ leadingIcon: {
4942
+ type: [Object, Function],
4943
+ default: void 0
4944
+ },
4914
4945
  invalid: {
4915
4946
  type: Boolean,
4916
4947
  default: void 0
@@ -210,6 +210,7 @@ declare const __VLS_base: import('vue').DefineComponent<NavMenuProps, {
210
210
  variant: NavMenuVariant;
211
211
  linkAs: string | import('vue').Component;
212
212
  ariaLabel: string;
213
+ cardAspect: string;
213
214
  drawerOpen: boolean;
214
215
  collapseBelow: NavMenuCollapse;
215
216
  drawerSide: import('../../index.js').DrawerSide;
@@ -8,6 +8,8 @@ type __VLS_Props = {
8
8
  variant: NavMenuVariant;
9
9
  messages: UiMessages;
10
10
  linkAs?: string | Component;
11
+ /** The cards' picture crop as `width:height`. */
12
+ cardAspect?: string;
11
13
  classes?: Partial<Record<NavMenuPart, string>>;
12
14
  /** Names a list that has no group heading of its own, such as a drawer section's. */
13
15
  labelledBy?: string;
@@ -6,6 +6,10 @@ export declare const CURRENT_PAGE = "eldra:aria-[current=page]:underline eldra:a
6
6
  export interface NavMenuLinkRun {
7
7
  group: string | null;
8
8
  links: NavMenuLink[];
9
+ /** A section's own heading page; unset for a run built from `group`s. */
10
+ headingLink?: NavMenuLink | null;
11
+ /** A section's trailing "see all" entry. */
12
+ seeAll?: NavMenuLink | null;
9
13
  }
10
14
  /** Whether an entry has visible text to render. */
11
15
  export declare function isRenderableLink(link: NavMenuLink): boolean;
@@ -13,6 +17,12 @@ export declare function isRenderableLink(link: NavMenuLink): boolean;
13
17
  export declare function panelLinks(item: NavMenuItem): NavMenuLink[];
14
18
  /** Whether a top-level entry opens a panel rather than being a plain link. */
15
19
  export declare function hasPanel(item: NavMenuItem): boolean;
20
+ /**
21
+ * What a panel draws, column by column: one run per section, in order (two sections with the same
22
+ * heading stay two), or, for an item without sections, its children grouped by `group`. A section
23
+ * with nothing to show, no entries and no "see all", is left out.
24
+ */
25
+ export declare function panelRuns(item: NavMenuItem): NavMenuLinkRun[];
16
26
  /** Groups entries by their `group`, keeping the order each group first appears in. */
17
27
  export declare function groupLinks(links: readonly NavMenuLink[]): NavMenuLinkRun[];
18
28
  /** The panel's layout: the item's own, else `mega` when its entries are grouped into columns. */
@@ -25,3 +35,9 @@ export declare function hasHref(link: NavMenuLink): boolean;
25
35
  export declare function navLinkTag(link: NavMenuLink, linkAs?: string | Component): string | Component;
26
36
  /** An entry's link attributes; a component `linkAs` takes the destination as `to`. */
27
37
  export declare function navLinkAttrs(link: NavMenuLink, linkAs?: string | Component): Record<string, unknown>;
38
+ /** The card aspect used when a theme gives none, or one that is not `width:height`. */
39
+ export declare const DEFAULT_CARD_ASPECT = "4:3";
40
+ /** Whether an entry is drawn as a card: it asks for one and its picture and title resolved. */
41
+ export declare function isCard(link: NavMenuLink): boolean;
42
+ /** A `width:height` aspect as a CSS `aspect-ratio`; anything else is the default. */
43
+ export declare function cardAspectRatio(aspect?: string): string;
@@ -1,6 +1,14 @@
1
1
  import { Component } from 'vue';
2
2
  import { UiMessages } from '../../composables/useMessages.js';
3
3
  import { DrawerSide } from '../drawer/types.js';
4
+ /** A promotional card's content, resolved by `@eldrajs/theme-core`: the picture, the title and, for a product, its price. */
5
+ export interface NavMenuCard {
6
+ /** The picture's URL: the card's own image, else its target's. The panel's card draws it with an empty `alt` beside the printed `title`; a custom card names it with `title`. */
7
+ image: string;
8
+ title: string;
9
+ /** A product's lowest price in the store's major units; format it with the store's currency. */
10
+ price?: number;
11
+ }
4
12
  /** One entry; `@eldrajs/theme-core`'s `ResolvedLink` (a resolved Studio link tree) fits it as is. */
5
13
  export interface NavMenuLink {
6
14
  /** The visible text. An entry with no label (`null` or empty) is not rendered. */
@@ -17,6 +25,23 @@ export interface NavMenuLink {
17
25
  group?: string | null;
18
26
  /** Marks the page the visitor is on (`aria-current="page"`). */
19
27
  current?: boolean;
28
+ /** `card` when the author made the entry a promotional card. With a resolved `card` the panel draws a picture, title and price; without one it is a plain link. */
29
+ display?: 'card' | 'link';
30
+ /** Set only on a resolved card; without it the entry is a plain link whatever `display` says. */
31
+ card?: NavMenuCard;
32
+ }
33
+ /** One column of a panel, as a resolved Studio link's `sections`. */
34
+ export interface NavMenuSection {
35
+ /** The column heading. Without one the column's links sit under no heading. */
36
+ heading?: string | null;
37
+ /** The heading's own page. Without one (or without a destination) the heading is plain text. */
38
+ headingLink?: NavMenuLink | null;
39
+ /** `card` when the author made the column cards; each entry decides by its own resolved `card`. */
40
+ display?: 'card' | 'link';
41
+ /** The column's entries. */
42
+ links: readonly NavMenuLink[];
43
+ /** The trailing "see all" entry under the column's links. */
44
+ seeAll?: NavMenuLink | null;
20
45
  }
21
46
  /** `dropdown` hangs a compact panel under its trigger; `mega` spans the menu's positioning box. */
22
47
  export type NavMenuPanelLayout = 'dropdown' | 'mega';
@@ -35,6 +60,8 @@ export interface NavMenuGroup {
35
60
  export interface NavMenuItem extends NavMenuLink {
36
61
  /** The panel's entries, one level deep. */
37
62
  children?: readonly NavMenuLink[];
63
+ /** The panel's columns, each with its own heading. When present they are the panel and `children` is not read. */
64
+ sections?: readonly NavMenuSection[];
38
65
  /** The panel's column headings, for those that link to a page of their own. */
39
66
  groups?: readonly NavMenuGroup[];
40
67
  /** Default `mega` when any child has a `group`, else `dropdown`. */
@@ -52,7 +79,7 @@ export type NavMenuDrawerLayout = 'accordion' | 'sections';
52
79
  /** Where a panel's content is drawn: under the bar, or in the narrow-screen drawer. */
53
80
  export type NavMenuPlacement = 'bar' | 'drawer';
54
81
  /** The parts of a panel's content; in the drawer each one is named with a `drawer` prefix. */
55
- export type NavMenuPanelPart = 'overview' | 'columns' | 'group' | 'groupHeading' | 'panelList' | 'panelItem' | 'groupLink' | 'panelLink' | 'panelLabel' | 'description' | 'badge';
82
+ export type NavMenuPanelPart = 'overview' | 'columns' | 'group' | 'groupHeading' | 'panelList' | 'panelItem' | 'groupLink' | 'panelLink' | 'panelLabel' | 'description' | 'badge' | 'card' | 'cardImage' | 'cardTitle' | 'cardPrice';
56
83
  /** A panel part as the drawer names it: `panelLink` is `drawerPanelLink`. */
57
84
  export type NavMenuDrawerPanelPart = `drawer${Capitalize<NavMenuPanelPart>}`;
58
85
  /** What the `panelItem` slot is handed: the entry, the item whose panel holds it, and where it is drawn. */
@@ -60,6 +87,8 @@ export interface NavMenuPanelItemSlotProps {
60
87
  link: NavMenuLink;
61
88
  item: NavMenuItem;
62
89
  placement: NavMenuPlacement;
90
+ /** True for a section's trailing "see all" entry. */
91
+ isSeeAll?: boolean;
63
92
  }
64
93
  /** What the `groupHeading` slot is handed: the heading, its entries, their item, and where it is drawn. */
65
94
  export interface NavMenuGroupHeadingSlotProps {
@@ -96,6 +125,12 @@ export interface NavMenuProps {
96
125
  * the tag and keeps `href`; a component receives the destination as `to`.
97
126
  */
98
127
  linkAs?: string | Component;
128
+ /**
129
+ * The crop of every card's picture, as `width:height` (`4:3`, `16:9`): the aspect the theme's block
130
+ * declares in `cards.aspect`. Default `4:3`; a value that is not two positive numbers is `4:3`.
131
+ * A card's price is written in the ambient store currency and locale, as `Price` is.
132
+ */
133
+ cardAspect?: string;
99
134
  /** Message overrides. See `useMessages`. */
100
135
  messages?: Partial<UiMessages>;
101
136
  /** Per-part classes, appended to the part's own (a consumer class wins by cascade layer). */
@@ -535,6 +535,10 @@
535
535
  order: 3;
536
536
  }
537
537
 
538
+ .eldra\:col-span-2 {
539
+ grid-column: span 2 / span 2;
540
+ }
541
+
538
542
  .eldra\:col-span-full {
539
543
  grid-column: 1 / -1;
540
544
  }
package/dist/index.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { $ as FIELD_KEY, A as ICON_STROKE_WIDTH$6, G as FIELD_SEARCH_APPEARANCE, I as FIELD_CLEAR_BUTTON_BOX, K as FIELD_SIZE, N as FIELD_BASE, R as FIELD_DISABLED, V as FIELD_LIVE, _ as useFloating, a as CURRENCY_KEY, c as provideEldraUiCurrency, d as useEldraUiLocale, et as mergeClass, f as Spinner_default, g as useTeleportTarget, h as topLayerDialog, k as ICON_SIZE_CLASS, l as provideEldraUiLocale, m as useOverlay, n as matchRange, nt as joinIds, o as DEFAULT_UI_LOCALE, p as usePopover, rt as useUiId, s as LOCALE_KEY, tt as useControllableModel, u as useEldraUiCurrency, v as normalizeText, y as useListbox } from "./useOptionList-UMUMayec.js";
2
2
  import { n as provideEldraScope, r as useEldraScope, t as ELDRA_SCOPE_KEY } from "./useEldraScope-BDbGzt7R.js";
3
- import { $ as applyMask, A as defaultUnitFormat, B as tagPadding, C as filterNumericBeforeInput, D as createNumberFormat, E as UnitInput_default, F as parseLocaleNumber, G as FieldError_default, H as Checkbox_default, I as toMinorUnits, J as FORM_LAYOUT_KEY, K as Button_default, L as useHeadingTag, M as formatNumber, N as formatUnit, O as currencyFractionDigits, P as localeSeparators, Q as useSlotPresence, R as TAG_FILL, S as Switch_default, T as CurrencyInput_default, U as VisuallyHidden_default, V as CheckboxGroup_default, W as RequiredMark_default, X as Autocomplete_default, Y as FORM_SUBMITTING_KEY, Z as Input_default, _ as radioRecipe, a as ownsShortcut, b as FormLayout_default, c as RadioGroup_default, d as PLAIN_BOX_ONLY, et as defaultCharacterMeaning, f as PLAIN_COLUMNS, g as optionCursor, h as labelRecipe, i as claimShortcut, j as formatCurrency, k as currencySymbol, l as HINT, m as dotRecipe, n as Textarea_default, o as releaseShortcut, p as PLAIN_OPTION, q as Icon_default, r as SearchBar_default, s as SearchResultsPanel_default, t as VariantPicker_default, tt as stripMask, u as INPUT, v as QuantityStepper_default, w as Select_default, x as focusInvalid, y as MultiSelect_default, z as TAG_SHAPE } from "./VariantPicker-Dein0E4i.js";
3
+ import { $ as applyMask, A as defaultUnitFormat, B as tagPadding, C as filterNumericBeforeInput, D as createNumberFormat, E as UnitInput_default, F as parseLocaleNumber, G as FieldError_default, H as Checkbox_default, I as toMinorUnits, J as FORM_LAYOUT_KEY, K as Button_default, L as useHeadingTag, M as formatNumber, N as formatUnit, O as currencyFractionDigits, P as localeSeparators, Q as useSlotPresence, R as TAG_FILL, S as Switch_default, T as CurrencyInput_default, U as VisuallyHidden_default, V as CheckboxGroup_default, W as RequiredMark_default, X as Autocomplete_default, Y as FORM_SUBMITTING_KEY, Z as Input_default, _ as radioRecipe, a as ownsShortcut, b as FormLayout_default, c as RadioGroup_default, d as PLAIN_BOX_ONLY, et as defaultCharacterMeaning, f as PLAIN_COLUMNS, g as optionCursor, h as labelRecipe, i as claimShortcut, j as formatCurrency, k as currencySymbol, l as HINT, m as dotRecipe, n as Textarea_default, o as releaseShortcut, p as PLAIN_OPTION, q as Icon_default, r as SearchBar_default, s as SearchResultsPanel_default, t as VariantPicker_default, tt as stripMask, u as INPUT, v as QuantityStepper_default, w as Select_default, x as focusInvalid, y as MultiSelect_default, z as TAG_SHAPE } from "./VariantPicker-CrKQ7jpB.js";
4
4
  import { i as enUS, n as provideEldraUiMessages, r as useMessages, t as MESSAGES_KEY } from "./useMessages-BdN9F1cW.js";
5
5
  import { Comment, Fragment, Teleport, Text, Transition, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, isRef, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, onServerPrefetch, onUnmounted, onUpdated, openBlock, provide, reactive, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRef, toValue, unref, useAttrs, useId, useSlots, useTemplateRef, vModelText, vShow, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
6
6
  import { dateTimeFormat } from "@eldrajs/sdk/format/date";
7
+ import { formatPrice, numberFormat } from "@eldrajs/sdk/format";
7
8
  // src/components/accordion/context.ts
8
9
  /** The key an `Accordion` provides its `AccordionContext` on. */
9
10
  var ACCORDION_KEY = Symbol("eldra-ui:accordion");
@@ -800,7 +801,14 @@ var Badge_default = /* @__PURE__ */ defineComponent({
800
801
  type: Boolean,
801
802
  default: false
802
803
  },
803
- icon: { default: void 0 },
804
+ icon: {
805
+ type: [
806
+ Object,
807
+ Function,
808
+ null
809
+ ],
810
+ default: void 0
811
+ },
804
812
  hiddenSuffix: { default: void 0 },
805
813
  as: { default: void 0 },
806
814
  classes: { default: void 0 }
@@ -894,7 +902,14 @@ var Breadcrumb_default = /* @__PURE__ */ defineComponent({
894
902
  items: {},
895
903
  collapseAfter: { default: 1 },
896
904
  keepLast: { default: 2 },
897
- linkAs: { default: void 0 },
905
+ linkAs: {
906
+ type: [
907
+ String,
908
+ Object,
909
+ Function
910
+ ],
911
+ default: void 0
912
+ },
898
913
  structuredData: {
899
914
  type: Boolean,
900
915
  default: true
@@ -2312,18 +2327,18 @@ var _hoisted_7$8 = [
2312
2327
  "tabindex",
2313
2328
  "aria-label"
2314
2329
  ];
2315
- var _hoisted_8$5 = {
2330
+ var _hoisted_8$6 = {
2316
2331
  key: 2,
2317
2332
  class: "eldra:flex eldra:items-center eldra:justify-between eldra:gap-4"
2318
2333
  };
2319
- var _hoisted_9$5 = ["aria-label"];
2320
- var _hoisted_10$2 = { key: 1 };
2321
- var _hoisted_11$2 = [
2334
+ var _hoisted_9$6 = ["aria-label"];
2335
+ var _hoisted_10$3 = { key: 1 };
2336
+ var _hoisted_11$3 = [
2322
2337
  "aria-current",
2323
2338
  "aria-label",
2324
2339
  "onClick"
2325
2340
  ];
2326
- var _hoisted_12$1 = { key: 3 };
2341
+ var _hoisted_12$2 = { key: 3 };
2327
2342
  var _hoisted_13 = {
2328
2343
  key: 4,
2329
2344
  class: "eldra:flex eldra:shrink-0 eldra:items-center eldra:gap-2"
@@ -2631,7 +2646,7 @@ var Carousel_default = /* @__PURE__ */ defineComponent({
2631
2646
  style: normalizeStyle(trackStyle.value),
2632
2647
  onKeydown: _cache[2] || (_cache[2] = (...args) => unref(onTrackKeydown) && unref(onTrackKeydown)(...args))
2633
2648
  }, [renderSlot(_ctx.$slots, "default")], 46, _hoisted_7$8),
2634
- showBelowRow.value ? (openBlock(), createElementBlock("div", _hoisted_8$5, [
2649
+ showBelowRow.value ? (openBlock(), createElementBlock("div", _hoisted_8$6, [
2635
2650
  showPause.value ? (openBlock(), createElementBlock("button", {
2636
2651
  key: 0,
2637
2652
  type: "button",
@@ -2639,7 +2654,7 @@ var Carousel_default = /* @__PURE__ */ defineComponent({
2639
2654
  class: normalizeClass(pauseClass.value),
2640
2655
  "aria-label": unref(playing) ? unref(messages).pause : unref(messages).play,
2641
2656
  onClick: _cache[3] || (_cache[3] = (...args) => unref(toggle) && unref(toggle)(...args))
2642
- }, toDisplayString(unref(playing) ? unref(messages).pause : unref(messages).play), 11, _hoisted_9$5)) : (openBlock(), createElementBlock("span", _hoisted_10$2)),
2657
+ }, toDisplayString(unref(playing) ? unref(messages).pause : unref(messages).play), 11, _hoisted_9$6)) : (openBlock(), createElementBlock("span", _hoisted_10$3)),
2643
2658
  __props.dots ? (openBlock(), createElementBlock("div", {
2644
2659
  key: 2,
2645
2660
  "data-part": "dots",
@@ -2653,8 +2668,8 @@ var Carousel_default = /* @__PURE__ */ defineComponent({
2653
2668
  "aria-current": dotNumber - 1 === unref(index) ? "true" : void 0,
2654
2669
  "aria-label": unref(messages).goToSlide(dotNumber),
2655
2670
  onClick: ($event) => unref(goTo)(dotNumber - 1)
2656
- }, [..._cache[8] || (_cache[8] = [createElementVNode("span", { class: "eldra:eldra-carousel-dot" }, null, -1)])], 10, _hoisted_11$2);
2657
- }), 128))], 2)) : (openBlock(), createElementBlock("span", _hoisted_12$1)),
2671
+ }, [..._cache[8] || (_cache[8] = [createElementVNode("span", { class: "eldra:eldra-carousel-dot" }, null, -1)])], 10, _hoisted_11$3);
2672
+ }), 128))], 2)) : (openBlock(), createElementBlock("span", _hoisted_12$2)),
2658
2673
  __props.controls === "below" ? (openBlock(), createElementBlock("div", _hoisted_13, [
2659
2674
  createElementVNode("button", {
2660
2675
  ref_key: "prevButtonRef",
@@ -2747,7 +2762,10 @@ var Chip_default = /* @__PURE__ */ defineComponent({
2747
2762
  type: Boolean,
2748
2763
  default: false
2749
2764
  },
2750
- icon: { default: void 0 },
2765
+ icon: {
2766
+ type: [Object, Function],
2767
+ default: void 0
2768
+ },
2751
2769
  avatar: { default: void 0 },
2752
2770
  value: { default: void 0 },
2753
2771
  classes: { default: void 0 },
@@ -3772,8 +3790,8 @@ var _hoisted_4$18 = ["data-eldra-slot"];
3772
3790
  var _hoisted_5$13 = ["data-eldra-slot"];
3773
3791
  var _hoisted_6$9 = ["datetime"];
3774
3792
  var _hoisted_7$7 = ["data-eldra-slot"];
3775
- var _hoisted_8$4 = ["data-eldra-scope"];
3776
- var _hoisted_9$4 = ["d"];
3793
+ var _hoisted_8$5 = ["data-eldra-scope"];
3794
+ var _hoisted_9$5 = ["d"];
3777
3795
  // src/components/card/ContentCard.vue
3778
3796
  var ContentCard_default = /* @__PURE__ */ defineComponent({
3779
3797
  __name: "ContentCard",
@@ -3794,7 +3812,14 @@ var ContentCard_default = /* @__PURE__ */ defineComponent({
3794
3812
  default: false
3795
3813
  },
3796
3814
  locale: { default: void 0 },
3797
- linkAs: { default: void 0 },
3815
+ linkAs: {
3816
+ type: [
3817
+ String,
3818
+ Object,
3819
+ Function
3820
+ ],
3821
+ default: void 0
3822
+ },
3798
3823
  classes: { default: void 0 }
3799
3824
  },
3800
3825
  setup(__props) {
@@ -4036,8 +4061,8 @@ var ContentCard_default = /* @__PURE__ */ defineComponent({
4036
4061
  return openBlock(), createElementBlock("path", {
4037
4062
  key: d,
4038
4063
  d
4039
- }, null, 8, _hoisted_9$4);
4040
- }), 128))], 10, _hoisted_8$4))], 10, _hoisted_7$7)) : createCommentVNode("", true)
4064
+ }, null, 8, _hoisted_9$5);
4065
+ }), 128))], 10, _hoisted_8$5))], 10, _hoisted_7$7)) : createCommentVNode("", true)
4041
4066
  ], 2)], 10, _hoisted_2$34));
4042
4067
  };
4043
4068
  }
@@ -5565,7 +5590,14 @@ var _hoisted_1$37 = ["data-eldra-scope"];
5565
5590
  var EditorPlaceholder_default = /* @__PURE__ */ defineComponent({
5566
5591
  __name: "EditorPlaceholder",
5567
5592
  props: {
5568
- icon: { default: null },
5593
+ icon: {
5594
+ type: [
5595
+ Object,
5596
+ Function,
5597
+ null
5598
+ ],
5599
+ default: null
5600
+ },
5569
5601
  label: {},
5570
5602
  help: { default: null },
5571
5603
  inline: {
@@ -5661,7 +5693,10 @@ var EmptyState_default = /* @__PURE__ */ defineComponent({
5661
5693
  __name: "EmptyState",
5662
5694
  props: {
5663
5695
  variant: { default: "empty" },
5664
- icon: { default: void 0 },
5696
+ icon: {
5697
+ type: [Object, Function],
5698
+ default: void 0
5699
+ },
5665
5700
  title: {},
5666
5701
  text: { default: null },
5667
5702
  plain: {
@@ -5817,7 +5852,14 @@ var FeatureCard_default = /* @__PURE__ */ defineComponent({
5817
5852
  cue: { default: void 0 },
5818
5853
  variant: { default: "plain" },
5819
5854
  headingLevel: { default: 3 },
5820
- linkAs: { default: void 0 },
5855
+ linkAs: {
5856
+ type: [
5857
+ String,
5858
+ Object,
5859
+ Function
5860
+ ],
5861
+ default: void 0
5862
+ },
5821
5863
  classes: { default: void 0 }
5822
5864
  },
5823
5865
  setup(__props) {
@@ -6759,8 +6801,8 @@ var _hoisted_4$12 = ["data-eldra-scope"];
6759
6801
  var _hoisted_5$9 = ["data-eldra-scope"];
6760
6802
  var _hoisted_6$6 = ["aria-label"];
6761
6803
  var _hoisted_7$5 = ["data-eldra-scope"];
6762
- var _hoisted_8$3 = ["data-eldra-scope"];
6763
- var _hoisted_9$3 = ["data-eldra-scope"];
6804
+ var _hoisted_8$4 = ["data-eldra-scope"];
6805
+ var _hoisted_9$4 = ["data-eldra-scope"];
6764
6806
  var SEARCH_BASE = "eldra:mb-2 eldra:w-full";
6765
6807
  /** Spec → Sizes, Facet search: '"No matches" line: 0.875rem `muted`, 0.5rem vertical padding.' */
6766
6808
  var NO_MATCHES_BASE = "eldra:text-body-sm eldra:text-muted";
@@ -6974,7 +7016,7 @@ var ListFacet_default = /* @__PURE__ */ defineComponent({
6974
7016
  "data-eldra-scope": unref(eldra).scope,
6975
7017
  "data-part": "count",
6976
7018
  class: normalizeClass(countClass.value)
6977
- }, toDisplayString(child.count), 11, _hoisted_8$3)]),
7019
+ }, toDisplayString(child.count), 11, _hoisted_8$4)]),
6978
7020
  _: 2
6979
7021
  }, 1032, [
6980
7022
  "model-value",
@@ -7014,7 +7056,7 @@ var ListFacet_default = /* @__PURE__ */ defineComponent({
7014
7056
  "stroke-linejoin": "round",
7015
7057
  "aria-hidden": "true",
7016
7058
  focusable: "false"
7017
- }, [..._cache[3] || (_cache[3] = [createElementVNode("path", { d: "M6 9l6 6l6 -6" }, null, -1)])], 10, _hoisted_9$3))]),
7059
+ }, [..._cache[3] || (_cache[3] = [createElementVNode("path", { d: "M6 9l6 6l6 -6" }, null, -1)])], 10, _hoisted_9$4))]),
7018
7060
  default: withCtx(() => [createTextVNode(toDisplayString(expanded.value ? unref(m).filterPanelShowFewer : unref(m).filterPanelShowAll(total.value)) + " ", 1)]),
7019
7061
  _: 1
7020
7062
  }, 8, [
@@ -8216,7 +8258,14 @@ var Link_default = /* @__PURE__ */ defineComponent({
8216
8258
  default: true
8217
8259
  },
8218
8260
  classes: { default: void 0 },
8219
- as: { default: void 0 }
8261
+ as: {
8262
+ type: [
8263
+ String,
8264
+ Object,
8265
+ Function
8266
+ ],
8267
+ default: void 0
8268
+ }
8220
8269
  },
8221
8270
  setup(__props) {
8222
8271
  const eldra = useEldraScope();
@@ -9248,8 +9297,8 @@ var _hoisted_4$9 = ["disabled", "aria-label"];
9248
9297
  var _hoisted_5$6 = ["aria-label", "data-zoomed"];
9249
9298
  var _hoisted_6$4 = ["data-zoomed"];
9250
9299
  var _hoisted_7$3 = ["disabled", "aria-label"];
9251
- var _hoisted_8$2 = ["aria-label"];
9252
- var _hoisted_9$2 = {
9300
+ var _hoisted_8$3 = ["aria-label"];
9301
+ var _hoisted_9$3 = {
9253
9302
  class: "eldra:size-5",
9254
9303
  viewBox: "0 0 24 24",
9255
9304
  fill: "none",
@@ -9260,11 +9309,11 @@ var _hoisted_9$2 = {
9260
9309
  "aria-hidden": "true",
9261
9310
  focusable: "false"
9262
9311
  };
9263
- var _hoisted_10$1 = {
9312
+ var _hoisted_10$2 = {
9264
9313
  key: 0,
9265
9314
  d: "M10 7l0 6"
9266
9315
  };
9267
- var _hoisted_11$1 = [
9316
+ var _hoisted_11$2 = [
9268
9317
  "aria-current",
9269
9318
  "aria-label",
9270
9319
  "onClick"
@@ -9939,12 +9988,12 @@ var Lightbox_default = /* @__PURE__ */ defineComponent({
9939
9988
  class: normalizeClass(zoomButtonClass.value),
9940
9989
  "aria-label": zoomed.value ? unref(m).lightboxZoomOut : unref(m).lightboxZoomIn,
9941
9990
  onClick: onZoomButtonClick
9942
- }, [(openBlock(), createElementBlock("svg", _hoisted_9$2, [
9991
+ }, [(openBlock(), createElementBlock("svg", _hoisted_9$3, [
9943
9992
  _cache[5] || (_cache[5] = createElementVNode("path", { d: "M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" }, null, -1)),
9944
9993
  _cache[6] || (_cache[6] = createElementVNode("path", { d: "M7 10l6 0" }, null, -1)),
9945
- !zoomed.value ? (openBlock(), createElementBlock("path", _hoisted_10$1)) : createCommentVNode("", true),
9994
+ !zoomed.value ? (openBlock(), createElementBlock("path", _hoisted_10$2)) : createCommentVNode("", true),
9946
9995
  _cache[7] || (_cache[7] = createElementVNode("path", { d: "M21 21l-6 -6" }, null, -1))
9947
- ]))], 10, _hoisted_8$2)) : createCommentVNode("", true)
9996
+ ]))], 10, _hoisted_8$3)) : createCommentVNode("", true)
9948
9997
  ], 34),
9949
9998
  showThumbnails.value && unref(model) ? (openBlock(), createElementBlock("div", {
9950
9999
  key: 0,
@@ -9967,7 +10016,7 @@ var Lightbox_default = /* @__PURE__ */ defineComponent({
9967
10016
  decorative: "",
9968
10017
  ratio: "1x1",
9969
10018
  fit: "cover"
9970
- }, null, 8, ["media"])], 10, _hoisted_11$1);
10019
+ }, null, 8, ["media"])], 10, _hoisted_11$2);
9971
10020
  }), 128))], 2)) : createCommentVNode("", true)
9972
10021
  ], 2)], 40, _hoisted_1$24);
9973
10022
  };
@@ -10088,7 +10137,14 @@ var LogoItem_default = /* @__PURE__ */ defineComponent({
10088
10137
  logo: { default: null },
10089
10138
  href: { default: null },
10090
10139
  linkContext: { default: null },
10091
- as: { default: void 0 },
10140
+ as: {
10141
+ type: [
10142
+ String,
10143
+ Object,
10144
+ Function
10145
+ ],
10146
+ default: void 0
10147
+ },
10092
10148
  classes: { default: void 0 }
10093
10149
  },
10094
10150
  setup(__props) {
@@ -10252,13 +10308,45 @@ var CURRENT_PAGE = "eldra:aria-[current=page]:underline eldra:aria-[current=page
10252
10308
  function isRenderableLink(link) {
10253
10309
  return typeof link.label === "string" && link.label.trim() !== "";
10254
10310
  }
10311
+ /** The item's sections when it has any; they are the panel, and `children` is then not read. */
10312
+ function itemSections(item) {
10313
+ return item.sections !== void 0 && item.sections.length > 0 ? item.sections : [];
10314
+ }
10255
10315
  /** The entries a panel draws, without the ones that have nothing to show. */
10256
10316
  function panelLinks(item) {
10317
+ const sections = itemSections(item);
10318
+ if (sections.length > 0) return sections.flatMap((section) => section.links.filter(isRenderableLink));
10257
10319
  return (item.children ?? []).filter(isRenderableLink);
10258
10320
  }
10259
10321
  /** Whether a top-level entry opens a panel rather than being a plain link. */
10260
10322
  function hasPanel(item) {
10261
- return panelLinks(item).length > 0;
10323
+ return panelRuns(item).length > 0;
10324
+ }
10325
+ /**
10326
+ * What a panel draws, column by column: one run per section, in order (two sections with the same
10327
+ * heading stay two), or, for an item without sections, its children grouped by `group`. A section
10328
+ * with nothing to show, no entries and no "see all", is left out.
10329
+ */
10330
+ function panelRuns(item) {
10331
+ const sections = itemSections(item);
10332
+ if (sections.length === 0) return groupLinks(panelLinks(item));
10333
+ const runs = [];
10334
+ for (const section of sections) {
10335
+ const links = section.links.filter(isRenderableLink);
10336
+ const seeAll = section.seeAll != null && isRenderableLink(section.seeAll) ? section.seeAll : null;
10337
+ if (links.length === 0 && seeAll === null) continue;
10338
+ const own = typeof section.heading === "string" && section.heading.trim() !== "";
10339
+ const headingLink = section.headingLink != null && hasHref(section.headingLink) ? section.headingLink : null;
10340
+ const named = section.headingLink != null && isRenderableLink(section.headingLink);
10341
+ const heading = own ? section.heading : named ? section.headingLink.label : null;
10342
+ runs.push({
10343
+ group: heading,
10344
+ links,
10345
+ headingLink,
10346
+ seeAll
10347
+ });
10348
+ }
10349
+ return runs;
10262
10350
  }
10263
10351
  /** Groups entries by their `group`, keeping the order each group first appears in. */
10264
10352
  function groupLinks(links) {
@@ -10282,11 +10370,12 @@ function groupLinks(links) {
10282
10370
  /** The panel's layout: the item's own, else `mega` when its entries are grouped into columns. */
10283
10371
  function panelLayout(item) {
10284
10372
  if (item.layout !== void 0) return item.layout;
10373
+ if (itemSections(item).length > 0) return "mega";
10285
10374
  return panelLinks(item).some((link) => typeof link.group === "string" && link.group.trim() !== "") ? "mega" : "dropdown";
10286
10375
  }
10287
10376
  /** Whether the item, or an entry in its panel, is the page the visitor is on. */
10288
10377
  function containsCurrent(item) {
10289
- return item.current === true || panelLinks(item).some((link) => link.current === true) || (item.groups ?? []).some((group) => group.current === true);
10378
+ return item.current === true || panelLinks(item).some((link) => link.current === true) || itemSections(item).some((section) => section.headingLink?.current === true || section.seeAll?.current === true) || (item.groups ?? []).some((group) => group.current === true);
10290
10379
  }
10291
10380
  /** Whether an entry goes somewhere; one without a destination renders as plain text. */
10292
10381
  function hasHref(link) {
@@ -10307,9 +10396,24 @@ function navLinkAttrs(link, linkAs) {
10307
10396
  if (link.current === true) attrs["aria-current"] = "page";
10308
10397
  return attrs;
10309
10398
  }
10399
+ /** Whether an entry is drawn as a card: it asks for one and its picture and title resolved. */
10400
+ function isCard(link) {
10401
+ return link.display === "card" && link.card !== void 0;
10402
+ }
10403
+ /** A `width:height` aspect as a CSS `aspect-ratio`; anything else is the default. */
10404
+ function cardAspectRatio(aspect) {
10405
+ const match = /^\s*(\d+(?:\.\d+)?)\s*:\s*(\d+(?:\.\d+)?)\s*$/.exec(aspect ?? "");
10406
+ const ratio = match !== null && Number(match[1]) > 0 && Number(match[2]) > 0 ? match : null;
10407
+ const [width, height] = ratio !== null ? [ratio[1], ratio[2]] : "4:3".split(":");
10408
+ return `${width} / ${height}`;
10409
+ }
10310
10410
  // src/components/nav-menu/NavMenuPanel.vue?vue&type=script&setup=true&lang.ts
10311
- var _hoisted_1$21 = ["data-eldra-scope", "data-part"];
10312
- var _hoisted_2$16 = ["data-part"];
10411
+ var _hoisted_1$21 = [
10412
+ "data-eldra-scope",
10413
+ "data-part",
10414
+ "data-cards"
10415
+ ];
10416
+ var _hoisted_2$16 = ["data-part", "data-cards"];
10313
10417
  var _hoisted_3$11 = [
10314
10418
  "data-eldra-slot",
10315
10419
  "id",
@@ -10318,7 +10422,12 @@ var _hoisted_3$11 = [
10318
10422
  var _hoisted_4$8 = ["data-part", "aria-labelledby"];
10319
10423
  var _hoisted_5$5 = ["data-part"];
10320
10424
  var _hoisted_6$3 = ["data-part"];
10321
- var _hoisted_7$2 = ["data-part"];
10425
+ var _hoisted_7$2 = ["src", "data-part"];
10426
+ var _hoisted_8$2 = { class: "eldra:flex eldra:flex-col eldra:gap-0.5" };
10427
+ var _hoisted_9$2 = ["data-part"];
10428
+ var _hoisted_10$1 = ["data-part"];
10429
+ var _hoisted_11$1 = ["data-part"];
10430
+ var _hoisted_12$1 = ["data-part"];
10322
10431
  // src/components/nav-menu/NavMenuPanel.vue
10323
10432
  var NavMenuPanel_default = /* @__PURE__ */ defineComponent({
10324
10433
  __name: "NavMenuPanel",
@@ -10328,7 +10437,12 @@ var NavMenuPanel_default = /* @__PURE__ */ defineComponent({
10328
10437
  placement: {},
10329
10438
  variant: {},
10330
10439
  messages: {},
10331
- linkAs: {},
10440
+ linkAs: { type: [
10441
+ String,
10442
+ Object,
10443
+ Function
10444
+ ] },
10445
+ cardAspect: {},
10332
10446
  classes: {},
10333
10447
  labelledBy: {},
10334
10448
  omitOverview: { type: Boolean }
@@ -10336,8 +10450,20 @@ var NavMenuPanel_default = /* @__PURE__ */ defineComponent({
10336
10450
  setup(__props) {
10337
10451
  const eldra = useEldraScope();
10338
10452
  const props = __props;
10339
- const links = computed(() => panelLinks(props.item));
10340
- const groups = computed(() => groupLinks(links.value));
10453
+ const locale = useEldraUiLocale();
10454
+ const currency = useEldraUiCurrency();
10455
+ const aspectStyle = computed(() => ({ aspectRatio: cardAspectRatio(props.cardAspect) }));
10456
+ /** A card's price in the store currency, or a plain number when the store has none the runtime knows. */
10457
+ function priceText(amount) {
10458
+ const code = currency.value;
10459
+ if (code !== void 0 && code !== "") try {
10460
+ return formatPrice(amount, code, locale.value);
10461
+ } catch {
10462
+ return `${numberFormat(locale.value, { style: "decimal" }).format(amount)} ${code}`;
10463
+ }
10464
+ return numberFormat(locale.value, { style: "decimal" }).format(amount);
10465
+ }
10466
+ const groups = computed(() => panelRuns(props.item));
10341
10467
  const grouped = computed(() => groups.value.some((group) => group.group !== null));
10342
10468
  const mega = computed(() => props.placement === "bar" && panelLayout(props.item) === "mega");
10343
10469
  const bar = computed(() => props.placement === "bar");
@@ -10373,23 +10499,45 @@ var NavMenuPanel_default = /* @__PURE__ */ defineComponent({
10373
10499
  if (!grouped.value) return panelPartClass("", "columns");
10374
10500
  return panelPartClass(bar.value ? "eldra:grid eldra:eldra-nav-menu-columns eldra:gap-6" : "eldra:flex eldra:flex-col eldra:gap-4", "columns");
10375
10501
  });
10376
- function groupMeta(name) {
10377
- return name === null ? void 0 : props.item.groups?.find((group) => group.label === name);
10502
+ /** A column heading's own page: a section's `headingLink`, else the item's `groups` entry of that name. */
10503
+ function groupMeta(run) {
10504
+ if (run.group === null) return void 0;
10505
+ return run.headingLink ?? props.item.groups?.find((group) => group.label === run.group);
10506
+ }
10507
+ /** A column's entries, its "see all" entry last. */
10508
+ function runEntries(run) {
10509
+ return run.seeAll != null ? [...run.links, run.seeAll] : run.links;
10378
10510
  }
10379
10511
  const groupLinkClass = computed(() => panelPartClass(["eldra:rounded-sm eldra:eldra-focus eldra:hover:text-text", CURRENT_PAGE], "groupLink"));
10380
10512
  const groupClass = computed(() => panelPartClass("eldra:flex eldra:min-w-0 eldra:flex-col", "group"));
10381
- const groupHeadingClass = computed(() => panelPartClass(["eldra:pb-1 eldra:text-overline eldra:text-muted", bar.value && "eldra:px-3"], "groupHeading"));
10382
- const panelListClass = computed(() => panelPartClass(mega.value && !grouped.value ? "eldra:grid eldra:eldra-nav-menu-columns eldra:gap-x-6 eldra:gap-y-0.5" : "eldra:flex eldra:flex-col eldra:gap-0.5", "panelList"));
10383
- const panelItemClass = computed(() => panelPartClass("", "panelItem"));
10384
- function panelLinkClass(link) {
10513
+ /** A heading is indented as the links under it are; a column of cards has no indent to match. */
10514
+ function groupHeadingClass(run) {
10515
+ return panelPartClass(["eldra:pb-1 eldra:text-overline eldra:text-muted", bar.value && !hasCards(run) && "eldra:px-3"], "groupHeading");
10516
+ }
10517
+ /** A column with a card in it lays its entries in two columns, cards beside each other. */
10518
+ function hasCards(run) {
10519
+ return run.links.some(isCard);
10520
+ }
10521
+ function panelListClass(run) {
10522
+ return panelPartClass(hasCards(run) ? "eldra:grid eldra:grid-cols-2 eldra:gap-3" : mega.value && !grouped.value ? "eldra:grid eldra:eldra-nav-menu-columns eldra:gap-x-6 eldra:gap-y-0.5" : "eldra:flex eldra:flex-col eldra:gap-0.5", "panelList");
10523
+ }
10524
+ function panelItemClass(run, link) {
10525
+ return panelPartClass(hasCards(run) && !isCard(link) ? "eldra:col-span-2" : "", "panelItem");
10526
+ }
10527
+ function panelLinkClass(link, run) {
10528
+ if (isCard(link)) return panelPartClass(["eldra:flex eldra:min-w-0 eldra:flex-col eldra:gap-2 eldra:rounded-md eldra:text-text eldra:eldra-focus", CURRENT_PAGE], "panelLink");
10385
10529
  return panelPartClass([
10386
10530
  "eldra:flex eldra:flex-col eldra:gap-0.5 eldra:rounded-md",
10387
- bar.value ? ["eldra:px-3 eldra:py-2", BAR_ENTRY[props.variant]] : "eldra:py-2.5 eldra:text-text",
10531
+ bar.value ? [hasCards(run) ? "eldra:py-2" : "eldra:px-3 eldra:py-2", BAR_ENTRY[props.variant]] : "eldra:py-2.5 eldra:text-text",
10388
10532
  hasHref(link) && "eldra:eldra-focus",
10389
10533
  hasHref(link) && bar.value && BAR_LINK[props.variant],
10390
10534
  CURRENT_PAGE
10391
10535
  ], "panelLink");
10392
10536
  }
10537
+ const cardClass = computed(() => panelPartClass("eldra:flex eldra:min-w-0 eldra:flex-col eldra:gap-2", "card"));
10538
+ const cardImageClass = computed(() => panelPartClass("eldra:block eldra:w-full eldra:rounded-md eldra:bg-surface eldra:object-cover", "cardImage"));
10539
+ const cardTitleClass = computed(() => panelPartClass("eldra:text-body-sm eldra:font-medium eldra:text-text", "cardTitle"));
10540
+ const cardPriceClass = computed(() => panelPartClass("eldra:text-body-sm eldra:text-muted", "cardPrice"));
10393
10541
  const panelLabelClass = computed(() => panelPartClass("eldra:flex eldra:flex-wrap eldra:items-center eldra:gap-x-2 eldra:gap-y-1 eldra:text-body eldra:font-medium", "panelLabel"));
10394
10542
  const descriptionClass = computed(() => panelPartClass("eldra:text-body-sm eldra:text-muted", "description"));
10395
10543
  const badgeClass = computed(() => props.classes?.[part("badge")]);
@@ -10417,63 +10565,87 @@ var NavMenuPanel_default = /* @__PURE__ */ defineComponent({
10417
10565
  "data-eldra-ui": "",
10418
10566
  "data-eldra-scope": unref(eldra).scope,
10419
10567
  "data-part": part("columns"),
10420
- class: normalizeClass(columnsClass.value)
10568
+ class: normalizeClass(columnsClass.value),
10569
+ "data-cards": groups.value.some(hasCards) ? "" : void 0
10421
10570
  }, [(openBlock(true), createElementBlock(Fragment, null, renderList(groups.value, (group, index) => {
10422
10571
  return openBlock(), createElementBlock("div", {
10423
10572
  key: index,
10424
10573
  "data-part": part("group"),
10425
- class: normalizeClass(groupClass.value)
10574
+ class: normalizeClass(groupClass.value),
10575
+ "data-cards": hasCards(group) ? "" : void 0
10426
10576
  }, [group.group !== null ? (openBlock(), createElementBlock("span", {
10427
10577
  key: 0,
10428
10578
  "data-eldra-slot": unref(eldra).slotHost("groupHeading"),
10429
10579
  id: headingId(index),
10430
10580
  "data-part": part("groupHeading"),
10431
- class: normalizeClass(groupHeadingClass.value)
10581
+ class: normalizeClass(groupHeadingClass(group))
10432
10582
  }, [renderSlot(_ctx.$slots, "groupHeading", {
10433
10583
  group: group.group,
10434
10584
  links: group.links,
10435
10585
  item: __props.item,
10436
10586
  placement: __props.placement
10437
- }, () => [groupMeta(group.group) && unref(hasHref)(groupMeta(group.group)) ? (openBlock(), createBlock(resolveDynamicComponent(unref(navLinkTag)(groupMeta(group.group), __props.linkAs)), mergeProps({
10587
+ }, () => [groupMeta(group) && unref(hasHref)(groupMeta(group)) ? (openBlock(), createBlock(resolveDynamicComponent(unref(navLinkTag)(groupMeta(group), __props.linkAs)), mergeProps({
10438
10588
  key: 0,
10439
10589
  "data-part": part("groupLink"),
10440
10590
  class: groupLinkClass.value
10441
- }, { ref_for: true }, unref(navLinkAttrs)(groupMeta(group.group), __props.linkAs)), {
10442
- default: withCtx(() => [createTextVNode(toDisplayString(group.group) + " ", 1), groupMeta(group.group).newTab ? (openBlock(), createBlock(VisuallyHidden_default, { key: 0 }, {
10591
+ }, { ref_for: true }, unref(navLinkAttrs)(groupMeta(group), __props.linkAs)), {
10592
+ default: withCtx(() => [createTextVNode(toDisplayString(group.group) + " ", 1), groupMeta(group).newTab ? (openBlock(), createBlock(VisuallyHidden_default, { key: 0 }, {
10443
10593
  default: withCtx(() => [createTextVNode(toDisplayString(__props.messages.opensInNewTab), 1)]),
10444
10594
  _: 1
10445
10595
  })) : createCommentVNode("", true)]),
10446
10596
  _: 2
10447
10597
  }, 1040, ["data-part", "class"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(group.group), 1)], 64))])], 10, _hoisted_3$11)) : createCommentVNode("", true), createElementVNode("ul", {
10448
10598
  "data-part": part("panelList"),
10449
- class: normalizeClass(panelListClass.value),
10599
+ class: normalizeClass(panelListClass(group)),
10450
10600
  "aria-labelledby": listLabel(group.group, index)
10451
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(group.links, (link, at) => {
10601
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(runEntries(group), (link, at) => {
10452
10602
  return openBlock(), createElementBlock("li", {
10453
10603
  key: at,
10454
10604
  "data-part": part("panelItem"),
10455
- class: normalizeClass(panelItemClass.value)
10605
+ class: normalizeClass(panelItemClass(group, link))
10456
10606
  }, [(openBlock(), createBlock(resolveDynamicComponent(unref(navLinkTag)(link, __props.linkAs)), mergeProps({
10457
10607
  "data-eldra-slot": unref(eldra).slotHost("panelItem"),
10458
10608
  "data-part": part("panelLink"),
10459
- class: panelLinkClass(link)
10609
+ "data-see-all": link === group.seeAll ? "" : void 0,
10610
+ class: panelLinkClass(link, group)
10460
10611
  }, { ref_for: true }, unref(navLinkAttrs)(link, __props.linkAs)), {
10461
10612
  default: withCtx(() => [renderSlot(_ctx.$slots, "panelItem", {
10462
10613
  link,
10463
10614
  item: __props.item,
10464
- placement: __props.placement
10465
- }, () => [createElementVNode("span", {
10615
+ placement: __props.placement,
10616
+ isSeeAll: link === group.seeAll
10617
+ }, () => [unref(isCard)(link) ? (openBlock(), createElementBlock("span", {
10618
+ key: 0,
10619
+ "data-part": part("card"),
10620
+ class: normalizeClass(cardClass.value)
10621
+ }, [createElementVNode("img", {
10622
+ src: link.card.image,
10623
+ alt: "",
10624
+ "data-part": part("cardImage"),
10625
+ class: normalizeClass(cardImageClass.value),
10626
+ style: normalizeStyle(aspectStyle.value),
10627
+ loading: "lazy",
10628
+ decoding: "async"
10629
+ }, null, 14, _hoisted_7$2), createElementVNode("span", _hoisted_8$2, [createElementVNode("span", {
10630
+ "data-part": part("cardTitle"),
10631
+ class: normalizeClass(cardTitleClass.value)
10632
+ }, toDisplayString(link.card.title), 11, _hoisted_9$2), link.card.price !== void 0 ? (openBlock(), createElementBlock("span", {
10633
+ key: 0,
10634
+ "data-part": part("cardPrice"),
10635
+ class: normalizeClass(cardPriceClass.value)
10636
+ }, toDisplayString(priceText(link.card.price)), 11, _hoisted_10$1)) : createCommentVNode("", true)])], 10, _hoisted_6$3)) : (openBlock(), createElementBlock("span", {
10637
+ key: 1,
10466
10638
  "data-part": part("panelLabel"),
10467
10639
  class: normalizeClass(panelLabelClass.value)
10468
10640
  }, [createTextVNode(toDisplayString(link.label) + " ", 1), link.badge ? (openBlock(), createBlock(Badge_default, {
10469
10641
  key: 0,
10470
10642
  label: link.badge,
10471
10643
  class: normalizeClass(badgeClass.value)
10472
- }, null, 8, ["label", "class"])) : createCommentVNode("", true)], 10, _hoisted_6$3), link.description ? (openBlock(), createElementBlock("span", {
10473
- key: 0,
10644
+ }, null, 8, ["label", "class"])) : createCommentVNode("", true)], 10, _hoisted_11$1)), link.description && !unref(isCard)(link) ? (openBlock(), createElementBlock("span", {
10645
+ key: 2,
10474
10646
  "data-part": part("description"),
10475
10647
  class: normalizeClass(descriptionClass.value)
10476
- }, toDisplayString(link.description), 11, _hoisted_7$2)) : createCommentVNode("", true)]), link.newTab && unref(hasHref)(link) ? (openBlock(), createBlock(VisuallyHidden_default, { key: 0 }, {
10648
+ }, toDisplayString(link.description), 11, _hoisted_12$1)) : createCommentVNode("", true)]), link.newTab && unref(hasHref)(link) ? (openBlock(), createBlock(VisuallyHidden_default, { key: 0 }, {
10477
10649
  default: withCtx(() => [createTextVNode(toDisplayString(__props.messages.opensInNewTab), 1)]),
10478
10650
  _: 1
10479
10651
  })) : createCommentVNode("", true)]),
@@ -10481,6 +10653,7 @@ var NavMenuPanel_default = /* @__PURE__ */ defineComponent({
10481
10653
  }, 1040, [
10482
10654
  "data-eldra-slot",
10483
10655
  "data-part",
10656
+ "data-see-all",
10484
10657
  "class"
10485
10658
  ]))], 10, _hoisted_5$5);
10486
10659
  }), 128))], 10, _hoisted_4$8)], 10, _hoisted_2$16);
@@ -10647,7 +10820,15 @@ var NavMenu_default = /* @__PURE__ */ defineComponent({
10647
10820
  type: Boolean,
10648
10821
  default: false
10649
10822
  },
10650
- linkAs: { default: void 0 },
10823
+ linkAs: {
10824
+ type: [
10825
+ String,
10826
+ Object,
10827
+ Function
10828
+ ],
10829
+ default: void 0
10830
+ },
10831
+ cardAspect: { default: void 0 },
10651
10832
  messages: { default: void 0 },
10652
10833
  classes: { default: void 0 }
10653
10834
  },
@@ -10950,6 +11131,7 @@ var NavMenu_default = /* @__PURE__ */ defineComponent({
10950
11131
  variant: __props.variant,
10951
11132
  messages: unref(m),
10952
11133
  "link-as": __props.linkAs,
11134
+ "card-aspect": __props.cardAspect,
10953
11135
  classes: __props.classes
10954
11136
  }, createSlots({ _: 2 }, [unref(slots).panelItem ? {
10955
11137
  name: "panelItem",
@@ -10965,6 +11147,7 @@ var NavMenu_default = /* @__PURE__ */ defineComponent({
10965
11147
  "variant",
10966
11148
  "messages",
10967
11149
  "link-as",
11150
+ "card-aspect",
10968
11151
  "classes"
10969
11152
  ]), unref(slots).panelFooter ? (openBlock(), createElementBlock("div", {
10970
11153
  key: 0,
@@ -11058,6 +11241,7 @@ var NavMenu_default = /* @__PURE__ */ defineComponent({
11058
11241
  variant: __props.variant,
11059
11242
  messages: unref(m),
11060
11243
  "link-as": __props.linkAs,
11244
+ "card-aspect": __props.cardAspect,
11061
11245
  classes: __props.classes,
11062
11246
  "labelled-by": `${panelId(index)}-drawer-heading`,
11063
11247
  "omit-overview": unref(hasHref)(item)
@@ -11075,6 +11259,7 @@ var NavMenu_default = /* @__PURE__ */ defineComponent({
11075
11259
  "variant",
11076
11260
  "messages",
11077
11261
  "link-as",
11262
+ "card-aspect",
11078
11263
  "classes",
11079
11264
  "labelled-by",
11080
11265
  "omit-overview"
@@ -11094,6 +11279,7 @@ var NavMenu_default = /* @__PURE__ */ defineComponent({
11094
11279
  variant: __props.variant,
11095
11280
  messages: unref(m),
11096
11281
  "link-as": __props.linkAs,
11282
+ "card-aspect": __props.cardAspect,
11097
11283
  classes: __props.classes
11098
11284
  }, createSlots({ _: 2 }, [unref(slots).panelItem ? {
11099
11285
  name: "panelItem",
@@ -11109,6 +11295,7 @@ var NavMenu_default = /* @__PURE__ */ defineComponent({
11109
11295
  "variant",
11110
11296
  "messages",
11111
11297
  "link-as",
11298
+ "card-aspect",
11112
11299
  "classes"
11113
11300
  ])], 10, _hoisted_9$1)]),
11114
11301
  _: 2
@@ -11162,7 +11349,14 @@ var Notice_default = /* @__PURE__ */ defineComponent({
11162
11349
  tone: { default: "info" },
11163
11350
  title: { default: void 0 },
11164
11351
  text: { default: void 0 },
11165
- icon: { default: void 0 },
11352
+ icon: {
11353
+ type: [
11354
+ Object,
11355
+ Function,
11356
+ null
11357
+ ],
11358
+ default: void 0
11359
+ },
11166
11360
  headingLevel: { default: void 0 },
11167
11361
  announce: {
11168
11362
  type: Boolean,
@@ -11333,7 +11527,14 @@ var Pagination_default = /* @__PURE__ */ defineComponent({
11333
11527
  type: Boolean,
11334
11528
  default: false
11335
11529
  },
11336
- linkAs: { default: void 0 },
11530
+ linkAs: {
11531
+ type: [
11532
+ String,
11533
+ Object,
11534
+ Function
11535
+ ],
11536
+ default: void 0
11537
+ },
11337
11538
  ariaLabel: { default: void 0 },
11338
11539
  fixedLength: {
11339
11540
  type: Boolean,
@@ -12694,7 +12895,14 @@ var Rating_default = /* @__PURE__ */ defineComponent({
12694
12895
  },
12695
12896
  size: { default: "md" },
12696
12897
  href: { default: void 0 },
12697
- as: { default: void 0 },
12898
+ as: {
12899
+ type: [
12900
+ String,
12901
+ Object,
12902
+ Function
12903
+ ],
12904
+ default: void 0
12905
+ },
12698
12906
  classes: { default: void 0 }
12699
12907
  },
12700
12908
  setup(__props) {
@@ -13032,7 +13240,14 @@ var ProductCard_default = /* @__PURE__ */ defineComponent({
13032
13240
  },
13033
13241
  currency: { default: void 0 },
13034
13242
  locale: { default: void 0 },
13035
- linkAs: { default: void 0 },
13243
+ linkAs: {
13244
+ type: [
13245
+ String,
13246
+ Object,
13247
+ Function
13248
+ ],
13249
+ default: void 0
13250
+ },
13036
13251
  classes: { default: void 0 }
13037
13252
  },
13038
13253
  emits: ["quickAdd"],
package/dist/style.css CHANGED
@@ -673,6 +673,10 @@
673
673
  order: 3;
674
674
  }
675
675
 
676
+ .eldra\:col-span-2 {
677
+ grid-column: span 2 / span 2;
678
+ }
679
+
676
680
  .eldra\:col-span-full {
677
681
  grid-column: 1 / -1;
678
682
  }
@@ -1,4 +1,4 @@
1
- import { E as UnitInput_default, H as Checkbox_default, S as Switch_default, T as CurrencyInput_default, V as CheckboxGroup_default, X as Autocomplete_default, Z as Input_default, b as FormLayout_default, c as RadioGroup_default, n as Textarea_default, r as SearchBar_default, t as VariantPicker_default, v as QuantityStepper_default, w as Select_default, x as focusInvalid, y as MultiSelect_default } from "./VariantPicker-Dein0E4i.js";
1
+ import { E as UnitInput_default, H as Checkbox_default, S as Switch_default, T as CurrencyInput_default, V as CheckboxGroup_default, X as Autocomplete_default, Z as Input_default, b as FormLayout_default, c as RadioGroup_default, n as Textarea_default, r as SearchBar_default, t as VariantPicker_default, v as QuantityStepper_default, w as Select_default, x as focusInvalid, y as MultiSelect_default } from "./VariantPicker-CrKQ7jpB.js";
2
2
  import { r as useMessages } from "./useMessages-BdN9F1cW.js";
3
3
  import { a as useControlProps, c as FIELD_ANCHORS_KEY, i as FIELD_VALIDATION_PROPS, l as FIELD_MESSAGES_KEY, n as FIELD_ONLY, o as useFieldControl, r as FIELD_VALIDATION_DEFAULTS, s as API_ERRORS_KEY, t as FIELD_CHOICE_VALIDATION_DEFAULTS } from "./useFieldControl-B1JvPEeM.js";
4
4
  import { r as useEldraScope } from "./useEldraScope-BDbGzt7R.js";
@@ -280,7 +280,7 @@ var FieldAutocomplete_default = /* @__PURE__ */ defineComponent({
280
280
  placeholder: {},
281
281
  autocomplete: {},
282
282
  inputmode: { type: [String, Boolean] },
283
- leadingIcon: {},
283
+ leadingIcon: { type: [Object, Function] },
284
284
  clearable: { type: Boolean },
285
285
  describedBy: {},
286
286
  required: { type: Boolean },
@@ -466,7 +466,7 @@ var FieldCurrencyInput_default = /* @__PURE__ */ defineComponent({
466
466
  size: {},
467
467
  id: {},
468
468
  name: {},
469
- leadingIcon: {},
469
+ leadingIcon: { type: [Object, Function] },
470
470
  describedBy: {},
471
471
  required: { type: Boolean },
472
472
  readonly: { type: Boolean },
@@ -526,7 +526,7 @@ var FieldInput_default = /* @__PURE__ */ defineComponent({
526
526
  min: {},
527
527
  max: {},
528
528
  step: {},
529
- leadingIcon: {},
529
+ leadingIcon: { type: [Object, Function] },
530
530
  clearable: { type: Boolean },
531
531
  describedBy: {},
532
532
  required: { type: Boolean },
@@ -595,7 +595,7 @@ var FieldMultiSelect_default = /* @__PURE__ */ defineComponent({
595
595
  size: {},
596
596
  searchable: { type: Boolean },
597
597
  searchPlaceholder: {},
598
- leadingIcon: {},
598
+ leadingIcon: { type: [Object, Function] },
599
599
  describedBy: {},
600
600
  required: { type: Boolean },
601
601
  disabled: { type: Boolean },
@@ -855,7 +855,7 @@ var FieldSelect_default = /* @__PURE__ */ defineComponent({
855
855
  searchPlaceholder: {},
856
856
  clearable: { type: Boolean },
857
857
  placeholder: {},
858
- leadingIcon: {},
858
+ leadingIcon: { type: [Object, Function] },
859
859
  describedBy: {},
860
860
  required: { type: Boolean },
861
861
  disabled: { type: Boolean },
@@ -1039,7 +1039,7 @@ var FieldUnitInput_default = /* @__PURE__ */ defineComponent({
1039
1039
  size: {},
1040
1040
  id: {},
1041
1041
  name: {},
1042
- leadingIcon: {},
1042
+ leadingIcon: { type: [Object, Function] },
1043
1043
  describedBy: {},
1044
1044
  required: { type: Boolean },
1045
1045
  readonly: { type: Boolean },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eldrajs/ui",
3
- "version": "0.3.18",
3
+ "version": "0.3.19",
4
4
  "description": "Accessible Vue 3 core components for Eldra storefronts: buttons, forms, selects, cards, overlays and navigation, themed through CSS design tokens.",
5
5
  "keywords": [
6
6
  "accessible",