@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/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
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
|
|
4
|
-
import { i as enUS, n as provideEldraUiMessages, r as useMessages, t as MESSAGES_KEY } from "./useMessages-
|
|
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";
|
|
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
7
|
// src/components/accordion/context.ts
|
|
@@ -243,7 +243,7 @@ function createPanelHeightAnimator(panel) {
|
|
|
243
243
|
// src/components/accordion/AccordionItem.vue?vue&type=script&setup=true&lang.ts
|
|
244
244
|
var _hoisted_1$52 = ["data-eldra-scope", "href"];
|
|
245
245
|
var _hoisted_2$41 = { class: "eldra:min-w-0 eldra:flex-1" };
|
|
246
|
-
var _hoisted_3$
|
|
246
|
+
var _hoisted_3$31 = [
|
|
247
247
|
"data-eldra-scope",
|
|
248
248
|
"name",
|
|
249
249
|
"open"
|
|
@@ -513,7 +513,7 @@ var AccordionItem_default = /* @__PURE__ */ defineComponent({
|
|
|
513
513
|
"data-eldra-slot": unref(eldra).slotHost("default"),
|
|
514
514
|
"data-part": "panel",
|
|
515
515
|
class: normalizeClass(panelClass.value)
|
|
516
|
-
}, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_5$15)], 42, _hoisted_3$
|
|
516
|
+
}, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_5$15)], 42, _hoisted_3$31));
|
|
517
517
|
};
|
|
518
518
|
}
|
|
519
519
|
});
|
|
@@ -2303,7 +2303,7 @@ var _hoisted_1$46 = [
|
|
|
2303
2303
|
"aria-describedby"
|
|
2304
2304
|
];
|
|
2305
2305
|
var _hoisted_2$37 = ["id"];
|
|
2306
|
-
var _hoisted_3$
|
|
2306
|
+
var _hoisted_3$30 = ["data-eldra-slot"];
|
|
2307
2307
|
var _hoisted_4$21 = ["data-eldra-scope"];
|
|
2308
2308
|
var _hoisted_5$14 = ["disabled", "aria-label"];
|
|
2309
2309
|
var _hoisted_6$10 = ["disabled", "aria-label"];
|
|
@@ -2618,7 +2618,7 @@ var Carousel_default = /* @__PURE__ */ defineComponent({
|
|
|
2618
2618
|
"aria-hidden": "true",
|
|
2619
2619
|
focusable: "false"
|
|
2620
2620
|
}, [createElementVNode("path", { d: "M9 6l6 6l-6 6" })], -1)])], 10, _hoisted_6$10)
|
|
2621
|
-
], 8, _hoisted_4$21)) : createCommentVNode("", true)], 10, _hoisted_3$
|
|
2621
|
+
], 8, _hoisted_4$21)) : createCommentVNode("", true)], 10, _hoisted_3$30)) : createCommentVNode("", true),
|
|
2622
2622
|
createElementVNode("div", {
|
|
2623
2623
|
ref_key: "trackRef",
|
|
2624
2624
|
ref: trackRef,
|
|
@@ -2714,7 +2714,7 @@ var CHIP_GROUP_KEY = Symbol("eldra-ui:chip-group");
|
|
|
2714
2714
|
// src/components/chip/Chip.vue?vue&type=script&setup=true&lang.ts
|
|
2715
2715
|
var _hoisted_1$45 = ["data-eldra-slot"];
|
|
2716
2716
|
var _hoisted_2$36 = ["data-eldra-slot"];
|
|
2717
|
-
var _hoisted_3$
|
|
2717
|
+
var _hoisted_3$29 = ["data-eldra-slot"];
|
|
2718
2718
|
var _hoisted_4$20 = ["aria-label", "disabled"];
|
|
2719
2719
|
var REMOVE_BUTTON = "eldra:inline-flex eldra:shrink-0 eldra:items-center eldra:justify-center eldra:rounded-full eldra:text-muted eldra:hover:text-text eldra:hover:bg-[color-mix(in_oklab,var(--eldra-color-text),transparent_89%)] eldra:eldra-focus";
|
|
2720
2720
|
var FILL_SELECTED = "eldra:bg-primary eldra:text-primary-contrast";
|
|
@@ -3009,7 +3009,7 @@ var Chip_default = /* @__PURE__ */ defineComponent({
|
|
|
3009
3009
|
"data-eldra-slot": unref(eldra).slotHost("default"),
|
|
3010
3010
|
"data-part": "label",
|
|
3011
3011
|
class: normalizeClass(labelClass.value)
|
|
3012
|
-
}, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 10, _hoisted_3$
|
|
3012
|
+
}, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 10, _hoisted_3$29),
|
|
3013
3013
|
__props.removable ? (openBlock(), createElementBlock("button", {
|
|
3014
3014
|
key: 2,
|
|
3015
3015
|
"data-part": "removeButton",
|
|
@@ -3319,7 +3319,7 @@ var _hoisted_2$35 = [
|
|
|
3319
3319
|
"loading",
|
|
3320
3320
|
"fetchpriority"
|
|
3321
3321
|
];
|
|
3322
|
-
var _hoisted_3$
|
|
3322
|
+
var _hoisted_3$28 = [
|
|
3323
3323
|
"role",
|
|
3324
3324
|
"aria-hidden",
|
|
3325
3325
|
"aria-label"
|
|
@@ -3554,7 +3554,7 @@ var Image_default = /* @__PURE__ */ defineComponent({
|
|
|
3554
3554
|
}),
|
|
3555
3555
|
createElementVNode("path", { d: "M3 17l5.5 -5.5c.83 -.83 1.67 -.83 2.5 0l7 7" }),
|
|
3556
3556
|
createElementVNode("path", { d: "M14 15l1.5 -1.5c.83 -.83 1.67 -.83 2.5 0l3 3" })
|
|
3557
|
-
], -1)), createElementVNode("span", _hoisted_4$19, toDisplayString(unref(messages).noImage), 1)], 10, _hoisted_3$
|
|
3557
|
+
], -1)), createElementVNode("span", _hoisted_4$19, toDisplayString(unref(messages).noImage), 1)], 10, _hoisted_3$28))], 6),
|
|
3558
3558
|
hasCaption.value ? (openBlock(), createElementBlock("figcaption", {
|
|
3559
3559
|
key: 1,
|
|
3560
3560
|
"data-part": "caption",
|
|
@@ -3767,7 +3767,7 @@ var CUE_ARROW_PATHS = [
|
|
|
3767
3767
|
// src/components/card/ContentCard.vue?vue&type=script&setup=true&lang.ts
|
|
3768
3768
|
var _hoisted_1$41 = ["data-eldra-scope", "aria-label"];
|
|
3769
3769
|
var _hoisted_2$34 = ["data-eldra-scope"];
|
|
3770
|
-
var _hoisted_3$
|
|
3770
|
+
var _hoisted_3$27 = ["data-eldra-slot"];
|
|
3771
3771
|
var _hoisted_4$18 = ["data-eldra-slot"];
|
|
3772
3772
|
var _hoisted_5$13 = ["data-eldra-slot"];
|
|
3773
3773
|
var _hoisted_6$9 = ["datetime"];
|
|
@@ -3981,7 +3981,7 @@ var ContentCard_default = /* @__PURE__ */ defineComponent({
|
|
|
3981
3981
|
"data-eldra-slot": unref(eldra).slotHost("eyebrow"),
|
|
3982
3982
|
"data-part": "eyebrow",
|
|
3983
3983
|
class: normalizeClass(eyebrowClass.value)
|
|
3984
|
-
}, [renderSlot(_ctx.$slots, "eyebrow", {}, () => [createTextVNode(toDisplayString(__props.eyebrow), 1)])], 10, _hoisted_3$
|
|
3984
|
+
}, [renderSlot(_ctx.$slots, "eyebrow", {}, () => [createTextVNode(toDisplayString(__props.eyebrow), 1)])], 10, _hoisted_3$27)) : createCommentVNode("", true),
|
|
3985
3985
|
(openBlock(), createBlock(resolveDynamicComponent(unref(headingTag)), {
|
|
3986
3986
|
"data-part": "title",
|
|
3987
3987
|
class: normalizeClass(titleClass.value)
|
|
@@ -4042,255 +4042,659 @@ var ContentCard_default = /* @__PURE__ */ defineComponent({
|
|
|
4042
4042
|
};
|
|
4043
4043
|
}
|
|
4044
4044
|
});
|
|
4045
|
-
// src/
|
|
4046
|
-
|
|
4047
|
-
var
|
|
4048
|
-
|
|
4049
|
-
var
|
|
4050
|
-
|
|
4051
|
-
var
|
|
4052
|
-
/** The `<html>` inline `--eldra-scrollbar-width` this module overwrote, restored on release. */
|
|
4053
|
-
var previousScrollbarWidthVar = null;
|
|
4054
|
-
/**
|
|
4055
|
-
* Set on `<html>` while a modal holds the lock: the width of the scrollbar the lock hid (`0px` when
|
|
4056
|
-
* it hid none). Padding `<html>` holds the page's own content still, but a `position: fixed` element
|
|
4057
|
-
* is laid out against the viewport, not `<html>`'s content box, so a full-width fixed header still
|
|
4058
|
-
* widens into the freed strip. Such an element opts in by padding itself with this variable,
|
|
4059
|
-
* `padding-right: var(--eldra-scrollbar-width, 0px)` (`pr-[var(--eldra-scrollbar-width,0px)]`).
|
|
4060
|
-
*/
|
|
4061
|
-
var SCROLLBAR_WIDTH_VAR = "--eldra-scrollbar-width";
|
|
4062
|
-
/**
|
|
4063
|
-
* The width the root's classic scrollbar takes from the viewport, `0` when there is none to take:
|
|
4064
|
-
* a page short enough not to scroll, or a platform drawing overlay scrollbars (macOS's default,
|
|
4065
|
-
* every phone) that never take layout space. A `clientWidth` of `0` means no layout at all (a
|
|
4066
|
-
* DOM-less test environment), not a scrollbar as wide as the window.
|
|
4067
|
-
*/
|
|
4068
|
-
function rootScrollbarWidth(html) {
|
|
4069
|
-
if (html.clientWidth === 0) return 0;
|
|
4070
|
-
return Math.max(0, window.innerWidth - html.clientWidth);
|
|
4071
|
-
}
|
|
4072
|
-
/**
|
|
4073
|
-
* `overflow: hidden` on `<html>` removes a classic scrollbar, and the page's content widens into the
|
|
4074
|
-
* space it leaves — everything centred or right-aligned jumps sideways the moment a modal opens and
|
|
4075
|
-
* back when it closes. The lock pads `<html>` on the right by exactly the scrollbar's width for as
|
|
4076
|
-
* long as it holds, so the content box stays where it was.
|
|
4077
|
-
*
|
|
4078
|
-
* Padding rather than `scrollbar-gutter: stable`: a gutter keeps the strip but leaves it empty, so
|
|
4079
|
-
* the dialog's `::backdrop` stops short of the right edge and a right-hand `Drawer` docks against
|
|
4080
|
-
* the gutter instead of the window's edge, an undimmed bar beside it. Padding sits inside `<html>`'s
|
|
4081
|
-
* box, which the top layer covers whole. The cost is that a `position: fixed` element does not
|
|
4082
|
-
* move with that padding; `SCROLLBAR_WIDTH_VAR` is what lets one follow.
|
|
4083
|
-
*/
|
|
4084
|
-
function lockScroll() {
|
|
4085
|
-
if (typeof document === "undefined") return;
|
|
4086
|
-
const html = document.documentElement;
|
|
4087
|
-
const scrollbarWidth = rootScrollbarWidth(html);
|
|
4088
|
-
previousHtmlOverflow = html.style.overflow;
|
|
4089
|
-
previousHtmlPaddingRight = html.style.paddingRight;
|
|
4090
|
-
previousScrollbarWidthVar = html.style.getPropertyValue(SCROLLBAR_WIDTH_VAR);
|
|
4091
|
-
html.style.setProperty(SCROLLBAR_WIDTH_VAR, `${scrollbarWidth}px`);
|
|
4092
|
-
if (scrollbarWidth > 0) {
|
|
4093
|
-
const padding = Number.parseFloat(getComputedStyle(html).paddingRight) || 0;
|
|
4094
|
-
html.style.paddingRight = `${padding + scrollbarWidth}px`;
|
|
4095
|
-
}
|
|
4096
|
-
html.style.overflow = "hidden";
|
|
4097
|
-
}
|
|
4098
|
-
function unlockScroll() {
|
|
4099
|
-
if (typeof document === "undefined") return;
|
|
4100
|
-
const html = document.documentElement;
|
|
4101
|
-
html.style.overflow = previousHtmlOverflow ?? "";
|
|
4102
|
-
html.style.paddingRight = previousHtmlPaddingRight ?? "";
|
|
4103
|
-
if (previousScrollbarWidthVar) html.style.setProperty(SCROLLBAR_WIDTH_VAR, previousScrollbarWidthVar);
|
|
4104
|
-
else html.style.removeProperty(SCROLLBAR_WIDTH_VAR);
|
|
4105
|
-
previousHtmlOverflow = null;
|
|
4106
|
-
previousHtmlPaddingRight = null;
|
|
4107
|
-
previousScrollbarWidthVar = null;
|
|
4108
|
-
}
|
|
4109
|
-
/**
|
|
4110
|
-
* The DOM element a `Toaster` should render its live region into while a modal dialog is open, or
|
|
4111
|
-
* `null` while none is — **the topmost one** when more than one is open (design spec, shared modal
|
|
4112
|
-
* rules: "a toast raised while a modal is open is rendered inside the open dialog, so it isn't
|
|
4113
|
-
* inert" — with more than one open, the toast has to land in the one that is not itself covered).
|
|
4114
|
-
*
|
|
4115
|
-
* **Not a Vue injection key**, despite the name matching this package's `*_KEY` convention
|
|
4116
|
-
* (`FIELD_KEY`, `MESSAGES_KEY`, …) — those all connect a provider to its own *descendants*, and a
|
|
4117
|
-
* `Toaster` is not one: the design spec's own toast region "lives outside the dialog" (shared modal
|
|
4118
|
-
* rules), which in practice means an app mounts one `<Toaster />` near its root, a sibling of
|
|
4119
|
-
* whatever page content opens a `Dialog` somewhere else in the tree. `provide`/`inject` cannot
|
|
4120
|
-
* connect two siblings, so the hand-off has to be a plain shared reference both sides read and
|
|
4121
|
-
* write independently — exactly what a module-level `Ref` is, and exactly the same reasoning
|
|
4122
|
-
* `usePopover`'s `topLayerDialog()` already leans on to teleport a non-modal panel into a modal
|
|
4123
|
-
* dialog it did not render.
|
|
4124
|
-
*
|
|
4125
|
-
* It holds the open dialog's own root element — the `Dialog` anatomy has no separate "toast host"
|
|
4126
|
-
* part to render (`DialogPart` is `root | panel | header | title | close | description | body |
|
|
4127
|
-
* footer`), so `Toaster` renders its live region as an appended child of this element (a
|
|
4128
|
-
* `<dialog>` accepts ordinary children anywhere in its box) rather than one this package declares
|
|
4129
|
-
* a slot or a `data-part` for.
|
|
4130
|
-
*/
|
|
4131
|
-
var TOAST_HOST_KEY = shallowRef(null);
|
|
4132
|
-
/**
|
|
4133
|
-
* Push `dialog` onto the stack, making it the new top.
|
|
4134
|
-
*
|
|
4135
|
-
* Idempotent for a dialog that is already in the stack (a spurious re-open is a no-op, not a
|
|
4136
|
-
* duplicate entry) — every other dialog is simply pushed on top, no refusal, no warning: nested
|
|
4137
|
-
* modals are allowed.
|
|
4138
|
-
*
|
|
4139
|
-
* The *first* claim (the stack going from empty to non-empty) locks the page's scroll (`<html>`
|
|
4140
|
-
* gets `overflow: hidden`, the shared modal rule: "While any modal surface is open … the root
|
|
4141
|
-
* element does not scroll"), padding `<html>` by the scrollbar's width so nothing shifts — later
|
|
4142
|
-
* pushes leave it locked, already true. `TOAST_HOST_KEY` always
|
|
4143
|
-
* points at the new top.
|
|
4144
|
-
*/
|
|
4145
|
-
function openDialog(dialog) {
|
|
4146
|
-
if (stack.some((entry) => entry.dialog === dialog)) return;
|
|
4147
|
-
if (stack.length === 0) lockScroll();
|
|
4148
|
-
stack.push({ dialog });
|
|
4149
|
-
TOAST_HOST_KEY.value = dialog;
|
|
4150
|
-
}
|
|
4151
|
-
/**
|
|
4152
|
-
* Pop `dialog` off the stack, wherever it sits in it. Safe to call on a dialog that is not in the
|
|
4153
|
-
* stack (already closed, or never opened).
|
|
4154
|
-
*
|
|
4155
|
-
* `TOAST_HOST_KEY` falls back to whatever is now on top (`null` once the stack is empty), and the
|
|
4156
|
-
* scroll lock is released only once the stack actually *is* empty — one modal closing while another
|
|
4157
|
-
* is still open must leave the page exactly as locked as it was.
|
|
4158
|
-
*/
|
|
4159
|
-
function closeDialog(dialog) {
|
|
4160
|
-
const index = stack.findIndex((entry) => entry.dialog === dialog);
|
|
4161
|
-
if (index === -1) return;
|
|
4162
|
-
stack.splice(index, 1);
|
|
4163
|
-
TOAST_HOST_KEY.value = stack.at(-1)?.dialog ?? null;
|
|
4164
|
-
if (stack.length === 0) unlockScroll();
|
|
4165
|
-
}
|
|
4166
|
-
/** Whether `dialog` is the **topmost** entry in the stack — what `Esc` and a backdrop click are
|
|
4167
|
-
* gated on (`useDialog`'s own `isTop`). A dialog lower in the stack answers `false`: it is open,
|
|
4168
|
-
* but not the one those routes may act on. */
|
|
4169
|
-
function isOpenDialog(dialog) {
|
|
4170
|
-
return stack.at(-1)?.dialog === dialog;
|
|
4171
|
-
}
|
|
4172
|
-
/** The topmost dialog's element, or `null` while the stack is empty. Exposed for tests. */
|
|
4173
|
-
function currentDialog() {
|
|
4174
|
-
return stack.at(-1)?.dialog ?? null;
|
|
4175
|
-
}
|
|
4176
|
-
// src/composables/useDialog.ts
|
|
4177
|
-
/**
|
|
4178
|
-
* Every element the platform lets a keyboard user reach, the same list `useOverlay` builds for its
|
|
4179
|
-
* own (non-modal) overlays. Duplicated rather than imported: `useOverlay`'s copy is private to that
|
|
4180
|
-
* module, and the two composables solve unrelated problems (tab *cycling* there, initial focus only
|
|
4181
|
-
* here — a native modal `<dialog>` already contains `Tab` on its own, see this file's own doc
|
|
4182
|
-
* comment below).
|
|
4183
|
-
*/
|
|
4184
|
-
var FOCUSABLE = "a[href], area[href], button, input, select, textarea, details > summary:first-of-type, iframe, audio[controls], video[controls], [contenteditable]:not([contenteditable=\"false\"]), [tabindex]:not([tabindex^=\"-\"])";
|
|
4185
|
-
function isReachable(element) {
|
|
4186
|
-
return element.tabIndex >= 0 && !element.hasAttribute("disabled") && element.getAttribute("aria-hidden") !== "true" && element.closest("[hidden]") === null;
|
|
4187
|
-
}
|
|
4188
|
-
/**
|
|
4189
|
-
* The dialog's first meaningful control (design spec, shared modal rules: "focus moves to the
|
|
4190
|
-
* element marked for initial focus, else the first meaningful control (never the close button when
|
|
4191
|
-
* the dialog has a primary field)") — every reachable focusable inside `root`, **excluding**
|
|
4192
|
-
* whatever carries `data-part="close"`.
|
|
4193
|
-
*
|
|
4194
|
-
* `data-part` is this package's own convention ("`data-part` on every part" — every component's own
|
|
4195
|
-
* anatomy uses it), not a one-off marker invented here: any modal built on this composable
|
|
4196
|
-
* (`Dialog` today; `Drawer`/`Lightbox`/`SearchModal` next) names its own close button the same way,
|
|
4197
|
-
* so this exclusion works for all of them without a second constant to keep in sync.
|
|
4198
|
-
*/
|
|
4199
|
-
var lastInputWasPointer = false;
|
|
4200
|
-
var trackingInput = false;
|
|
4201
|
-
function trackInputModality() {
|
|
4202
|
-
if (trackingInput || typeof document === "undefined") return;
|
|
4203
|
-
trackingInput = true;
|
|
4204
|
-
document.addEventListener("pointerdown", () => lastInputWasPointer = true, true);
|
|
4205
|
-
document.addEventListener("keydown", () => lastInputWasPointer = false, true);
|
|
4206
|
-
}
|
|
4207
|
-
trackInputModality();
|
|
4208
|
-
var TEXT_ENTRY = "input:not([type=\"button\"], [type=\"submit\"], [type=\"reset\"], [type=\"checkbox\"], [type=\"radio\"], [type=\"range\"], [type=\"color\"], [type=\"file\"], [type=\"image\"]), textarea, [contenteditable]:not([contenteditable=\"false\"])";
|
|
4209
|
-
function takesFocusOnTap(element) {
|
|
4210
|
-
return element != null && (element.hasAttribute("autofocus") || element.matches(TEXT_ENTRY));
|
|
4211
|
-
}
|
|
4212
|
-
function focusSurface(dialog) {
|
|
4213
|
-
if (!dialog.hasAttribute("tabindex")) dialog.setAttribute("tabindex", "-1");
|
|
4214
|
-
dialog.focus({ preventScroll: true });
|
|
4215
|
-
}
|
|
4216
|
-
function autofocusControl(root) {
|
|
4217
|
-
return [...root.querySelectorAll("[autofocus]")].find(isReachable);
|
|
4218
|
-
}
|
|
4219
|
-
function firstMeaningfulControl(root) {
|
|
4220
|
-
return [...root.querySelectorAll(FOCUSABLE)].find((element) => isReachable(element) && element.closest("[data-part=\"close\"]") === null);
|
|
4221
|
-
}
|
|
4045
|
+
// src/components/field-wrapper/FieldWrapper.vue?vue&type=script&setup=true&lang.ts
|
|
4046
|
+
var _hoisted_1$40 = ["data-eldra-scope"];
|
|
4047
|
+
var _hoisted_2$33 = ["data-eldra-slot"];
|
|
4048
|
+
var _hoisted_3$26 = ["data-eldra-slot", "id"];
|
|
4049
|
+
var _hoisted_4$17 = ["id"];
|
|
4050
|
+
var GROUP_INLINE = "eldra:grid eldra:min-w-0 eldra:flex-[1_1_14rem] eldra:content-start eldra:gap-1";
|
|
4051
|
+
var INLINE_ROW = "eldra:order-1 eldra:w-full eldra:basis-full";
|
|
4222
4052
|
/**
|
|
4223
|
-
*
|
|
4224
|
-
*
|
|
4225
|
-
* `
|
|
4226
|
-
* it, which is why every rule below lives here instead of in `Dialog.vue`.
|
|
4227
|
-
*
|
|
4228
|
-
* What it owns, entirely through the native element — **no custom focus trap, no `role="dialog"`**
|
|
4229
|
-
* (the design spec's own non-negotiable 2, and this file's whole reason to exist):
|
|
4230
|
-
*
|
|
4231
|
-
* - **Open/close**, synced to `open`: `showModal()` when it becomes `true`, `.close()` when it
|
|
4232
|
-
* becomes `false`. A native modal `<dialog>` already makes the rest of the page `inert` (nothing
|
|
4233
|
-
* outside it is focusable or reachable by a screen reader's virtual cursor) and already contains
|
|
4234
|
-
* `Tab`/`Shift+Tab` to its own controls for free — that is the entire point of using one, so
|
|
4235
|
-
* nothing here re-implements either.
|
|
4236
|
-
* - **Nested modals** (`dialogStack`, operator override, 2026-09-26 — see the README's Deviations
|
|
4237
|
-
* entry): opening a dialog pushes it onto the shared stack; a dialog already open when another
|
|
4238
|
-
* one opens is left open, underneath — no refusal, no warning. `Esc` and a backdrop click,
|
|
4239
|
-
* though, only ever act on the **topmost** dialog (`isTop` below): a lower one ignores both,
|
|
4240
|
-
* even if one somehow reaches its own listeners directly (native top-layer stacking already
|
|
4241
|
-
* routes `Esc` to the top only; this is defence in depth, not the primary mechanism).
|
|
4242
|
-
* - **Scroll lock and the toast host** (`dialogStack`, shared with every future modal built on this
|
|
4243
|
-
* composable): the page behind does not scroll while the stack is non-empty (released only once
|
|
4244
|
-
* every open modal has closed), and `TOAST_HOST_KEY` tracks the **topmost** dialog a `Toaster`
|
|
4245
|
-
* should render into.
|
|
4246
|
-
* - **Initial focus**: `initialFocus`, else a reachable control marked `autofocus`, else (unless
|
|
4247
|
-
* `focusFirstControl: false`, which focuses the dialog itself instead) the first
|
|
4248
|
-
* meaningful control (never the close button — see `firstMeaningfulControl` above), else the close
|
|
4249
|
-
* button itself as a last resort, else whatever the platform already focused. Opened by a tap or
|
|
4250
|
-
* click, the dialog focuses itself instead unless that target is a text field or marked
|
|
4251
|
-
* `autofocus`, because Safari rings a control script focuses after a tap. Applied a tick after `showModal()`, so slot content that
|
|
4252
|
-
* mounts alongside the dialog (a form's first field) already exists in the DOM to focus.
|
|
4253
|
-
* - **Focus return**: whatever had focus immediately before `showModal()` gets it back the moment
|
|
4254
|
-
* the dialog actually closes, by any route — the page's own opener for the bottom of the stack,
|
|
4255
|
-
* or, for a modal opened from inside another one, whichever control still had focus in the modal
|
|
4256
|
-
* underneath (captured the same way, just a tick earlier), so closing the top one lands focus
|
|
4257
|
-
* back in the modal below rather than on the page.
|
|
4258
|
-
* - **`Esc`** (the native `cancel` event): closes the dialog, never `dismissable`-gated (the shared
|
|
4259
|
-
* rule: "`Esc` … always closes it") — but only while this dialog is the top of the stack; a lower
|
|
4260
|
-
* one ignores it outright (`preventDefault()`ed, so even the platform's own default action cannot
|
|
4261
|
-
* close it). `onCancel` is a notification, not a guard — it cannot prevent the close, matching
|
|
4262
|
-
* the interface below (`() => void`, nothing to call `preventDefault()` on). The one opt-out is
|
|
4263
|
-
* `closeOnEscape: false`, which ignores `Esc` the same way (no `onCancel`, no close).
|
|
4264
|
-
* - **Backdrop click**: a `click` whose `target` is the `<dialog>` element itself — not a
|
|
4265
|
-
* descendant, which stops the target at that descendant, and not a press that began inside the
|
|
4266
|
-
* panel and was released on the backdrop — closes it when `dismissable` is `true`
|
|
4267
|
-
* (default) **and** this dialog is the top of the stack; a lower dialog's own backdrop click
|
|
4268
|
-
* (unreachable in a real browser, where the topmost modal's full-viewport surface covers it, but
|
|
4269
|
-
* reachable from a test dispatching the event directly) does nothing. `dismissable` is read on
|
|
4270
|
-
* every click, so a consumer can flip it while the dialog is open (a form that becomes dirty
|
|
4271
|
-
* part-way through).
|
|
4053
|
+
* Spec "Field wrapper" → States: the label is `text` in every state, including error — "Don't turn
|
|
4054
|
+
* the label red on error. The border and message are enough, and red labels read as 'required'."
|
|
4055
|
+
* `w-fit` keeps the click target on the words rather than the whole grid row.
|
|
4272
4056
|
*
|
|
4273
|
-
*
|
|
4274
|
-
*
|
|
4275
|
-
* const dialog = ref<HTMLDialogElement | null>(null);
|
|
4276
|
-
* const { close, isTop } = useDialog({
|
|
4277
|
-
* open,
|
|
4278
|
-
* setOpen: (next) => (open.value = next),
|
|
4279
|
-
* dialog,
|
|
4280
|
-
* dismissable: () => !formIsDirty.value,
|
|
4281
|
-
* onCancel: () => emit('cancel'),
|
|
4282
|
-
* });
|
|
4283
|
-
* ```
|
|
4057
|
+
* The legend is the same type style with the fieldset variant's own 0.5rem bottom margin, and with
|
|
4058
|
+
* the `padding-inline` a `<legend>` carries by default removed.
|
|
4284
4059
|
*/
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4060
|
+
var LABEL_TYPE = "eldra:text-label eldra:text-text eldra:block eldra:w-fit";
|
|
4061
|
+
// src/components/field-wrapper/FieldWrapper.vue
|
|
4062
|
+
var FieldWrapper_default = /* @__PURE__ */ defineComponent({
|
|
4063
|
+
inheritAttrs: false,
|
|
4064
|
+
__name: "FieldWrapper",
|
|
4065
|
+
props: {
|
|
4066
|
+
label: { default: void 0 },
|
|
4067
|
+
id: { default: void 0 },
|
|
4068
|
+
required: {
|
|
4069
|
+
type: Boolean,
|
|
4070
|
+
default: false
|
|
4071
|
+
},
|
|
4072
|
+
optional: {
|
|
4073
|
+
type: Boolean,
|
|
4074
|
+
default: false
|
|
4075
|
+
},
|
|
4076
|
+
help: { default: void 0 },
|
|
4077
|
+
error: { default: void 0 },
|
|
4078
|
+
counter: { default: void 0 },
|
|
4079
|
+
group: {
|
|
4080
|
+
type: Boolean,
|
|
4081
|
+
default: false
|
|
4082
|
+
},
|
|
4083
|
+
full: {
|
|
4084
|
+
type: Boolean,
|
|
4085
|
+
default: false
|
|
4086
|
+
},
|
|
4087
|
+
classes: { default: void 0 }
|
|
4088
|
+
},
|
|
4089
|
+
setup(__props) {
|
|
4090
|
+
const eldra = useEldraScope();
|
|
4091
|
+
const props = __props;
|
|
4092
|
+
const slots = useSlots();
|
|
4093
|
+
const attrs = useAttrs();
|
|
4094
|
+
const forwardedAttrs = computed(() => {
|
|
4095
|
+
const { class: _class, ...rest } = attrs;
|
|
4096
|
+
return rest;
|
|
4097
|
+
});
|
|
4098
|
+
const m = useMessages();
|
|
4099
|
+
/**
|
|
4100
|
+
* The control's id (spec "Field wrapper" → Properties, `id`: "generated"). The wrapper owns it
|
|
4101
|
+
* because the wrapper owns the `<label for>`; a caller that needs a stable id for a
|
|
4102
|
+
* server-rendered form passes one and it is used verbatim.
|
|
4103
|
+
*
|
|
4104
|
+
* The label carries an id of its own too. Native controls are tied by `for`/`id`, but the spec's
|
|
4105
|
+
* Accessibility notes say "The custom select and multi-select triggers use `aria-labelledby`
|
|
4106
|
+
* pointing to the label", and a `<label for>` cannot name a `<button>` trigger — so the id that
|
|
4107
|
+
* makes that possible exists from the start rather than being retrofitted.
|
|
4108
|
+
*/
|
|
4109
|
+
const controlId = useUiId("field", () => props.id);
|
|
4110
|
+
const labelId = computed(() => `${controlId.value}-label`);
|
|
4111
|
+
const helpId = computed(() => `${controlId.value}-help`);
|
|
4112
|
+
const errorId = computed(() => `${controlId.value}-error`);
|
|
4113
|
+
const counterId = computed(() => `${controlId.value}-counter`);
|
|
4114
|
+
/** Slots are not reactive; see `useSlotPresence` for the defect this avoids. */
|
|
4115
|
+
const slotContent = useSlotPresence(slots, [
|
|
4116
|
+
"error",
|
|
4117
|
+
"help",
|
|
4118
|
+
"label"
|
|
4119
|
+
]);
|
|
4120
|
+
/**
|
|
4121
|
+
* A slot counts as content: `<template #error>` is a richer way of writing the `error` prop (a
|
|
4122
|
+
* message with a link in it, say), not a different feature, so it makes the field invalid and
|
|
4123
|
+
* gets linked exactly as the prop does.
|
|
4124
|
+
*/
|
|
4125
|
+
const hasError = computed(() => Boolean(props.error) || slotContent.value.error);
|
|
4126
|
+
const hasHelp = computed(() => Boolean(props.help) || slotContent.value.help);
|
|
4127
|
+
const hasCounter = computed(() => props.counter !== void 0);
|
|
4128
|
+
/**
|
|
4129
|
+
* A field with no visible label is one whose control is named some other way (`aria-label`), so
|
|
4130
|
+
* the wrapper draws no empty `<label>` for it. `label=""` still renders one, as it always has.
|
|
4131
|
+
*/
|
|
4132
|
+
const hasLabel = computed(() => props.label !== void 0 || slotContent.value.label);
|
|
4133
|
+
const hasFoot = computed(() => hasHelp.value || hasCounter.value);
|
|
4134
|
+
/**
|
|
4135
|
+
* Spec "Field wrapper" → Accessibility: `aria-describedby="<error-id> <help-id> <counter-id>"` —
|
|
4136
|
+
* "the error comes first and is announced on focus". Only ids that actually render go in, so a
|
|
4137
|
+
* field with no help never points at an element that is not there.
|
|
4138
|
+
*/
|
|
4139
|
+
const describedBy = computed(() => {
|
|
4140
|
+
const ids = [
|
|
4141
|
+
hasError.value ? errorId.value : void 0,
|
|
4142
|
+
hasHelp.value ? helpId.value : void 0,
|
|
4143
|
+
hasCounter.value ? counterId.value : void 0
|
|
4144
|
+
].filter((id) => id !== void 0);
|
|
4145
|
+
return ids.length > 0 ? ids.join(" ") : void 0;
|
|
4146
|
+
});
|
|
4147
|
+
/**
|
|
4148
|
+
* What the control inside reads (see `context.ts`). A `ComputedRef`, so a control that mounted
|
|
4149
|
+
* while the field was valid still sees `invalid` the moment an error arrives.
|
|
4150
|
+
*
|
|
4151
|
+
* A group provides it too: the `<fieldset>` is described by the same ids, and a future
|
|
4152
|
+
* `CheckboxGroup` or `RadioGroup` reads `id` and `required` from here the way `Input` does.
|
|
4153
|
+
*/
|
|
4154
|
+
const context = computed(() => ({
|
|
4155
|
+
id: controlId.value,
|
|
4156
|
+
labelId: labelId.value,
|
|
4157
|
+
labelled: hasLabel.value,
|
|
4158
|
+
describedBy: describedBy.value,
|
|
4159
|
+
invalid: hasError.value,
|
|
4160
|
+
required: props.required,
|
|
4161
|
+
labelsControl: !props.group
|
|
4162
|
+
}));
|
|
4163
|
+
provide(FIELD_KEY, context);
|
|
4164
|
+
/**
|
|
4165
|
+
* Spec "Field wrapper" → Properties, `full`: "Spans both columns in the two-column form layout."
|
|
4166
|
+
* Only there — in a single-column or inline form, and in a field standing on its own in a
|
|
4167
|
+
* page-builder column, there is no second column to span and the prop does nothing.
|
|
4168
|
+
*/
|
|
4169
|
+
const layout = inject(FORM_LAYOUT_KEY, null);
|
|
4170
|
+
const spansBothColumns = computed(() => props.full && layout?.value === "two");
|
|
4171
|
+
/**
|
|
4172
|
+
* Spec "Form layout" → Anatomy, the inline form: "[ Email address ___ ] [Subscribe]", the field
|
|
4173
|
+
* "grows, shrinks, basis 14rem", the button bottom-aligned to it, and the "error: full-width row
|
|
4174
|
+
* below both when invalid".
|
|
4175
|
+
*
|
|
4176
|
+
* A field is one box, and a box cannot be half a flex row — so in an inline form the wrapper
|
|
4177
|
+
* *becomes* the row rather than sitting in it: the root and the label/control group swap their
|
|
4178
|
+
* `display`, so the label and the control travel together as the growing flex item while the error
|
|
4179
|
+
* and the foot row wrap onto full-width rows of their own, after the button (`order-1`, which
|
|
4180
|
+
* moves nothing in the DOM or the tab order). That is what keeps the button level with the
|
|
4181
|
+
* control instead of dropping to the bottom of the help text.
|
|
4182
|
+
*
|
|
4183
|
+
* Everywhere else the group is `display: contents` and the wrapper is its own grid, exactly as the
|
|
4184
|
+
* Field wrapper section draws it. A `group` fieldset never flattens: it is a set of controls, not
|
|
4185
|
+
* the one field an inline row holds.
|
|
4186
|
+
*/
|
|
4187
|
+
const isInline = computed(() => layout?.value === "inline" && !props.group);
|
|
4188
|
+
/** Spec "Field wrapper" → Properties: a counter with no `value` is an empty field, so "0 / max". */
|
|
4189
|
+
const count = computed(() => props.counter?.value ?? 0);
|
|
4190
|
+
const isOverLimit = computed(() => props.counter?.max !== void 0 && count.value > props.counter.max);
|
|
4191
|
+
/** With no `max` the counter is the length alone: there is no limit to read it against. */
|
|
4192
|
+
const counterText = computed(() => props.counter?.max === void 0 ? String(count.value) : m.value.counter(count.value, props.counter.max));
|
|
4193
|
+
/**
|
|
4194
|
+
* One root, two shapes. A `group` is a `<fieldset>` named by its `<legend>` and described as a
|
|
4195
|
+
* whole: there is no single control for a `<label for>` to point at, so `aria-describedby` and
|
|
4196
|
+
* `aria-invalid` sit on the fieldset itself. Everything inside is identical either way, which is
|
|
4197
|
+
* why the template branches on the tag rather than duplicating itself — and why the root stays a
|
|
4198
|
+
* single node, as `@vue/test-utils` and a consumer's `class` expect.
|
|
4199
|
+
*
|
|
4200
|
+
* The vertical rhythm (spec "Field wrapper" → Sizes, "Vertical rhythm"): "Grid with a 0.25rem gap:
|
|
4201
|
+
* label → control 0.375rem (gap + label margin), control → help/error 0.25rem." So the gap is the
|
|
4202
|
+
* whole rhythm and the label's own 0.125rem bottom margin is what makes its row the wider one.
|
|
4203
|
+
*
|
|
4204
|
+
* `content-start` is what keeps that true inside a form. A grid item stretches to its row, so in a
|
|
4205
|
+
* two-column layout the shorter of a pair used to have its own rows stretched to match the taller
|
|
4206
|
+
* one — the gap grew from 0.375rem to whatever the row needed, and the two controls stopped lining
|
|
4207
|
+
* up. Packing the rows to the start leaves the rhythm fixed and lets the extra height fall below
|
|
4208
|
+
* the field, where it belongs.
|
|
4209
|
+
*
|
|
4210
|
+
* The fieldset variant is the spec's own separate geometry: "no border, padding or min-width, grid
|
|
4211
|
+
* with a 0.75rem (`space-3`) gap, and the legend has a 0.5rem (`space-2`) bottom margin."
|
|
4212
|
+
*
|
|
4213
|
+
* A `group` fieldset also carries `tabindex="-1"`. It is the one part of a field that an error
|
|
4214
|
+
* summary can link to — a group has no single control, so `#<id>` points at the fieldset itself —
|
|
4215
|
+
* and a browser moves focus to a fragment's target only when that target can take focus. `-1`
|
|
4216
|
+
* keeps it out of the tab order while making the link actually land on the question it names.
|
|
4217
|
+
*/
|
|
4218
|
+
const rootClass = computed(() => mergeClass([
|
|
4219
|
+
isInline.value ? "eldra:contents" : "eldra:grid",
|
|
4220
|
+
"eldra:content-start",
|
|
4221
|
+
props.group ? "eldra:min-w-0 eldra:gap-3 eldra:rounded-none eldra:border-0 eldra:p-0" : "eldra:gap-1",
|
|
4222
|
+
spansBothColumns.value && "eldra:@two-col:col-span-2"
|
|
4223
|
+
], attrs.class));
|
|
4224
|
+
/**
|
|
4225
|
+
* The label-and-control group: one box holding the two of them, and **only** where that box has a
|
|
4226
|
+
* job to do.
|
|
4227
|
+
*
|
|
4228
|
+
* In an inline row it is the growing flex item (see `isInline` above). Everywhere else the label
|
|
4229
|
+
* and the control are simply the first two rows of the wrapper's own grid — and in the `group`
|
|
4230
|
+
* fieldset a box around them is not merely redundant but wrong: HTML names a `<fieldset>` by its
|
|
4231
|
+
* first `<legend>` **child**, so a `<div>` in between leaves the fieldset with no accessible name
|
|
4232
|
+
* at all, whatever the CSS says (`display: contents` does not change whose child an element is).
|
|
4233
|
+
* That is a defect no screenshot shows and axe's own descendant lookup hides.
|
|
4234
|
+
*
|
|
4235
|
+
* So the box renders only in an inline row, and the label and the control stay written once — a
|
|
4236
|
+
* duplicated `v-if`/`v-else` pair of the same two elements is exactly the kind of thing that drifts
|
|
4237
|
+
* apart later. It carries no `data-part`, because it is not one of the spec's parts.
|
|
4238
|
+
*/
|
|
4239
|
+
const LabelAndControl = (_props, { slots: own }) => isInline.value ? h("div", { class: GROUP_INLINE }, own.default?.()) : own.default?.() ?? [];
|
|
4240
|
+
/** In an inline row the error and the foot take a full-width row of their own, below the button. */
|
|
4241
|
+
const labelClass = computed(() => mergeClass([LABEL_TYPE, "eldra:mb-0.5"], props.classes?.label));
|
|
4242
|
+
const legendClass = computed(() => [
|
|
4243
|
+
LABEL_TYPE,
|
|
4244
|
+
"eldra:mb-2 eldra:p-0",
|
|
4245
|
+
props.classes?.legend
|
|
4246
|
+
]);
|
|
4247
|
+
/** 0.25rem start margin, `muted`, weight 400 against the label's 600. */
|
|
4248
|
+
const optionalTextClass = computed(() => ["eldra:text-muted eldra:ms-1 eldra:font-normal", props.classes?.optionalText]);
|
|
4249
|
+
/** The control's row. `min-w-0` because a grid item's default `auto` floor would let it overflow. */
|
|
4250
|
+
const controlClass = computed(() => ["eldra:min-w-0", props.classes?.control]);
|
|
4251
|
+
/** Spec "Field wrapper" → Sizes, Foot row: "help and counter on one line, 0.75rem gap". */
|
|
4252
|
+
const footClass = computed(() => [
|
|
4253
|
+
"eldra:flex eldra:flex-wrap eldra:items-baseline eldra:gap-x-3 eldra:gap-y-1",
|
|
4254
|
+
isInline.value && INLINE_ROW,
|
|
4255
|
+
props.classes?.foot
|
|
4256
|
+
]);
|
|
4257
|
+
/** 0.8125rem / 1.45, weight 400, `muted`. */
|
|
4258
|
+
const helpClass = computed(() => ["eldra:text-field-note eldra:text-muted eldra:min-w-0 eldra:font-normal", props.classes?.help]);
|
|
4259
|
+
/**
|
|
4260
|
+
* Spec "Field wrapper" → Sizes, Counter row: "0.8125rem / 1.5, tabular numerals, no wrap … pushed
|
|
4261
|
+
* to the end of the foot row", `muted` weight 400 under the limit and `danger` weight 600 over it.
|
|
4262
|
+
*/
|
|
4263
|
+
const counterClass = computed(() => [
|
|
4264
|
+
"eldra:text-counter eldra:ms-auto eldra:shrink-0 eldra:tabular-nums eldra:whitespace-nowrap",
|
|
4265
|
+
isOverLimit.value ? "eldra:text-danger eldra:font-semibold" : "eldra:text-muted eldra:font-normal",
|
|
4266
|
+
props.classes?.counter
|
|
4267
|
+
]);
|
|
4268
|
+
return (_ctx, _cache) => {
|
|
4269
|
+
return openBlock(), createBlock(resolveDynamicComponent(__props.group ? "fieldset" : "div"), mergeProps({
|
|
4270
|
+
id: __props.group ? unref(controlId) : void 0,
|
|
4271
|
+
"data-eldra-ui": "",
|
|
4272
|
+
"data-eldra-scope": unref(eldra).scope,
|
|
4273
|
+
"data-part": "root",
|
|
4274
|
+
class: rootClass.value,
|
|
4275
|
+
tabindex: __props.group ? -1 : void 0,
|
|
4276
|
+
"aria-describedby": __props.group ? describedBy.value : void 0,
|
|
4277
|
+
"aria-invalid": __props.group && hasError.value ? "true" : void 0
|
|
4278
|
+
}, forwardedAttrs.value), {
|
|
4279
|
+
default: withCtx(() => [
|
|
4280
|
+
createVNode(LabelAndControl, null, {
|
|
4281
|
+
default: withCtx(() => [hasLabel.value ? (openBlock(), createBlock(resolveDynamicComponent(__props.group ? "legend" : "label"), {
|
|
4282
|
+
key: 0,
|
|
4283
|
+
"data-eldra-slot": unref(eldra).slotHost("label", "labelSuffix"),
|
|
4284
|
+
id: labelId.value,
|
|
4285
|
+
for: __props.group ? void 0 : unref(controlId),
|
|
4286
|
+
"data-part": __props.group ? "legend" : "label",
|
|
4287
|
+
class: normalizeClass(__props.group ? legendClass.value : labelClass.value)
|
|
4288
|
+
}, {
|
|
4289
|
+
default: withCtx(() => [
|
|
4290
|
+
renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)]),
|
|
4291
|
+
__props.required ? (openBlock(), createBlock(RequiredMark_default, {
|
|
4292
|
+
key: 0,
|
|
4293
|
+
classes: __props.classes
|
|
4294
|
+
}, null, 8, ["classes"])) : __props.optional ? (openBlock(), createElementBlock("span", {
|
|
4295
|
+
key: 1,
|
|
4296
|
+
"data-eldra-scope": unref(eldra).scope,
|
|
4297
|
+
"data-part": "optionalText",
|
|
4298
|
+
class: normalizeClass(optionalTextClass.value)
|
|
4299
|
+
}, "(" + toDisplayString(unref(m).optional) + ")", 11, _hoisted_1$40)) : createCommentVNode("", true),
|
|
4300
|
+
renderSlot(_ctx.$slots, "labelSuffix")
|
|
4301
|
+
]),
|
|
4302
|
+
_: 3
|
|
4303
|
+
}, 8, [
|
|
4304
|
+
"data-eldra-slot",
|
|
4305
|
+
"id",
|
|
4306
|
+
"for",
|
|
4307
|
+
"data-part",
|
|
4308
|
+
"class"
|
|
4309
|
+
])) : createCommentVNode("", true), createElementVNode("div", {
|
|
4310
|
+
"data-eldra-slot": unref(eldra).slotHost("default"),
|
|
4311
|
+
"data-part": "control",
|
|
4312
|
+
class: normalizeClass(controlClass.value)
|
|
4313
|
+
}, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_2$33)]),
|
|
4314
|
+
_: 3
|
|
4315
|
+
}),
|
|
4316
|
+
hasError.value ? (openBlock(), createBlock(FieldError_default, {
|
|
4317
|
+
key: 0,
|
|
4318
|
+
id: errorId.value,
|
|
4319
|
+
"row-class": isInline.value ? INLINE_ROW : void 0,
|
|
4320
|
+
classes: __props.classes
|
|
4321
|
+
}, {
|
|
4322
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "error", {}, () => [createTextVNode(toDisplayString(__props.error), 1)])]),
|
|
4323
|
+
_: 3
|
|
4324
|
+
}, 8, [
|
|
4325
|
+
"id",
|
|
4326
|
+
"row-class",
|
|
4327
|
+
"classes"
|
|
4328
|
+
])) : createCommentVNode("", true),
|
|
4329
|
+
hasFoot.value ? (openBlock(), createElementBlock("div", {
|
|
4330
|
+
key: 1,
|
|
4331
|
+
"data-part": "foot",
|
|
4332
|
+
class: normalizeClass(footClass.value)
|
|
4333
|
+
}, [hasHelp.value ? (openBlock(), createElementBlock("span", {
|
|
4334
|
+
key: 0,
|
|
4335
|
+
"data-eldra-slot": unref(eldra).slotHost("help"),
|
|
4336
|
+
id: helpId.value,
|
|
4337
|
+
"data-part": "help",
|
|
4338
|
+
class: normalizeClass(helpClass.value)
|
|
4339
|
+
}, [renderSlot(_ctx.$slots, "help", {}, () => [createTextVNode(toDisplayString(__props.help), 1)])], 10, _hoisted_3$26)) : createCommentVNode("", true), __props.counter ? (openBlock(), createElementBlock("span", {
|
|
4340
|
+
key: 1,
|
|
4341
|
+
id: counterId.value,
|
|
4342
|
+
"data-part": "counter",
|
|
4343
|
+
class: normalizeClass(counterClass.value)
|
|
4344
|
+
}, toDisplayString(counterText.value), 11, _hoisted_4$17)) : createCommentVNode("", true)], 2)) : createCommentVNode("", true)
|
|
4345
|
+
]),
|
|
4346
|
+
_: 3
|
|
4347
|
+
}, 16, [
|
|
4348
|
+
"id",
|
|
4349
|
+
"data-eldra-scope",
|
|
4350
|
+
"class",
|
|
4351
|
+
"tabindex",
|
|
4352
|
+
"aria-describedby",
|
|
4353
|
+
"aria-invalid"
|
|
4354
|
+
]);
|
|
4355
|
+
};
|
|
4356
|
+
}
|
|
4357
|
+
});
|
|
4358
|
+
// src/components/currency-picker/CurrencyPicker.vue
|
|
4359
|
+
var CurrencyPicker_default = /* @__PURE__ */ defineComponent({
|
|
4360
|
+
__name: "CurrencyPicker",
|
|
4361
|
+
props: {
|
|
4362
|
+
currencies: {},
|
|
4363
|
+
modelValue: { default: void 0 },
|
|
4364
|
+
label: { default: void 0 },
|
|
4365
|
+
showLabel: {
|
|
4366
|
+
type: Boolean,
|
|
4367
|
+
default: false
|
|
4368
|
+
},
|
|
4369
|
+
size: { default: "sm" },
|
|
4370
|
+
placement: { default: "auto" },
|
|
4371
|
+
busy: {
|
|
4372
|
+
type: Boolean,
|
|
4373
|
+
default: false
|
|
4374
|
+
},
|
|
4375
|
+
locale: { default: void 0 },
|
|
4376
|
+
classes: { default: void 0 }
|
|
4377
|
+
},
|
|
4378
|
+
emits: ["update:modelValue"],
|
|
4379
|
+
setup(__props, { emit: __emit }) {
|
|
4380
|
+
const props = __props;
|
|
4381
|
+
const emit = __emit;
|
|
4382
|
+
const eldra = useEldraScope();
|
|
4383
|
+
const messages = useMessages();
|
|
4384
|
+
const uiLocale = useEldraUiLocale();
|
|
4385
|
+
const locale = computed(() => props.locale ?? uiLocale.value);
|
|
4386
|
+
function currencyName(code) {
|
|
4387
|
+
try {
|
|
4388
|
+
const name = new Intl.DisplayNames(locale.value, { type: "currency" }).of(code) ?? code;
|
|
4389
|
+
return name.charAt(0).toLocaleUpperCase(locale.value) + name.slice(1);
|
|
4390
|
+
} catch {
|
|
4391
|
+
return code;
|
|
4392
|
+
}
|
|
4393
|
+
}
|
|
4394
|
+
const codes = computed(() => props.modelValue && !props.currencies.includes(props.modelValue) ? [...props.currencies, props.modelValue] : props.currencies);
|
|
4395
|
+
const options = computed(() => codes.value.map((code) => ({
|
|
4396
|
+
value: code,
|
|
4397
|
+
label: currencyName(code) === code ? code : `${currencyName(code)} (${code})`
|
|
4398
|
+
})));
|
|
4399
|
+
const selected = computed({
|
|
4400
|
+
get: () => props.modelValue ?? "",
|
|
4401
|
+
set: (code) => emit("update:modelValue", code)
|
|
4402
|
+
});
|
|
4403
|
+
const { root: rootClass, trigger: triggerClass, ...otherClasses } = props.classes ?? {};
|
|
4404
|
+
const selectClasses = computed(() => ({
|
|
4405
|
+
...otherClasses,
|
|
4406
|
+
trigger: [props.busy ? "eldra:opacity-60" : "", triggerClass ?? ""].join(" ").trim() || void 0
|
|
4407
|
+
}));
|
|
4408
|
+
const labelClasses = computed(() => props.showLabel ? void 0 : { label: "eldra:sr-only" });
|
|
4409
|
+
return (_ctx, _cache) => {
|
|
4410
|
+
return props.currencies.length > 1 ? (openBlock(), createBlock(FieldWrapper_default, {
|
|
4411
|
+
key: 0,
|
|
4412
|
+
"data-eldra-ui": "",
|
|
4413
|
+
"data-eldra-scope": unref(eldra).scope,
|
|
4414
|
+
"data-part": "root",
|
|
4415
|
+
label: __props.label ?? unref(messages).currencyPickerLabel,
|
|
4416
|
+
classes: labelClasses.value,
|
|
4417
|
+
class: normalizeClass(unref(rootClass)),
|
|
4418
|
+
"aria-busy": __props.busy ? "true" : void 0
|
|
4419
|
+
}, {
|
|
4420
|
+
default: withCtx(() => [createVNode(Select_default, {
|
|
4421
|
+
modelValue: selected.value,
|
|
4422
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selected.value = $event),
|
|
4423
|
+
options: options.value,
|
|
4424
|
+
placement: __props.placement,
|
|
4425
|
+
searchable: false,
|
|
4426
|
+
size: __props.size,
|
|
4427
|
+
classes: selectClasses.value
|
|
4428
|
+
}, {
|
|
4429
|
+
value: withCtx(({ option }) => [createTextVNode(toDisplayString(option.value), 1)]),
|
|
4430
|
+
_: 1
|
|
4431
|
+
}, 8, [
|
|
4432
|
+
"modelValue",
|
|
4433
|
+
"options",
|
|
4434
|
+
"placement",
|
|
4435
|
+
"size",
|
|
4436
|
+
"classes"
|
|
4437
|
+
])]),
|
|
4438
|
+
_: 1
|
|
4439
|
+
}, 8, [
|
|
4440
|
+
"data-eldra-scope",
|
|
4441
|
+
"label",
|
|
4442
|
+
"classes",
|
|
4443
|
+
"class",
|
|
4444
|
+
"aria-busy"
|
|
4445
|
+
])) : createCommentVNode("", true);
|
|
4446
|
+
};
|
|
4447
|
+
}
|
|
4448
|
+
});
|
|
4449
|
+
// src/composables/dialogStack.ts
|
|
4450
|
+
/** Bottom to top: `stack[0]` opened first, `stack.at(-1)` is the current top. */
|
|
4451
|
+
var stack = [];
|
|
4452
|
+
/** The `<html>` inline `overflow` this module overwrote, restored when the lock is released. */
|
|
4453
|
+
var previousHtmlOverflow = null;
|
|
4454
|
+
/** The `<html>` inline `padding-right` this module overwrote, restored when the lock is released. */
|
|
4455
|
+
var previousHtmlPaddingRight = null;
|
|
4456
|
+
/** The `<html>` inline `--eldra-scrollbar-width` this module overwrote, restored on release. */
|
|
4457
|
+
var previousScrollbarWidthVar = null;
|
|
4458
|
+
/**
|
|
4459
|
+
* Set on `<html>` while a modal holds the lock: the width of the scrollbar the lock hid (`0px` when
|
|
4460
|
+
* it hid none). Padding `<html>` holds the page's own content still, but a `position: fixed` element
|
|
4461
|
+
* is laid out against the viewport, not `<html>`'s content box, so a full-width fixed header still
|
|
4462
|
+
* widens into the freed strip. Such an element opts in by padding itself with this variable,
|
|
4463
|
+
* `padding-right: var(--eldra-scrollbar-width, 0px)` (`pr-[var(--eldra-scrollbar-width,0px)]`).
|
|
4464
|
+
*/
|
|
4465
|
+
var SCROLLBAR_WIDTH_VAR = "--eldra-scrollbar-width";
|
|
4466
|
+
/**
|
|
4467
|
+
* The width the root's classic scrollbar takes from the viewport, `0` when there is none to take:
|
|
4468
|
+
* a page short enough not to scroll, or a platform drawing overlay scrollbars (macOS's default,
|
|
4469
|
+
* every phone) that never take layout space. A `clientWidth` of `0` means no layout at all (a
|
|
4470
|
+
* DOM-less test environment), not a scrollbar as wide as the window.
|
|
4471
|
+
*/
|
|
4472
|
+
function rootScrollbarWidth(html) {
|
|
4473
|
+
if (html.clientWidth === 0) return 0;
|
|
4474
|
+
return Math.max(0, window.innerWidth - html.clientWidth);
|
|
4475
|
+
}
|
|
4476
|
+
/**
|
|
4477
|
+
* `overflow: hidden` on `<html>` removes a classic scrollbar, and the page's content widens into the
|
|
4478
|
+
* space it leaves — everything centred or right-aligned jumps sideways the moment a modal opens and
|
|
4479
|
+
* back when it closes. The lock pads `<html>` on the right by exactly the scrollbar's width for as
|
|
4480
|
+
* long as it holds, so the content box stays where it was.
|
|
4481
|
+
*
|
|
4482
|
+
* Padding rather than `scrollbar-gutter: stable`: a gutter keeps the strip but leaves it empty, so
|
|
4483
|
+
* the dialog's `::backdrop` stops short of the right edge and a right-hand `Drawer` docks against
|
|
4484
|
+
* the gutter instead of the window's edge, an undimmed bar beside it. Padding sits inside `<html>`'s
|
|
4485
|
+
* box, which the top layer covers whole. The cost is that a `position: fixed` element does not
|
|
4486
|
+
* move with that padding; `SCROLLBAR_WIDTH_VAR` is what lets one follow.
|
|
4487
|
+
*/
|
|
4488
|
+
function lockScroll() {
|
|
4489
|
+
if (typeof document === "undefined") return;
|
|
4490
|
+
const html = document.documentElement;
|
|
4491
|
+
const scrollbarWidth = rootScrollbarWidth(html);
|
|
4492
|
+
previousHtmlOverflow = html.style.overflow;
|
|
4493
|
+
previousHtmlPaddingRight = html.style.paddingRight;
|
|
4494
|
+
previousScrollbarWidthVar = html.style.getPropertyValue(SCROLLBAR_WIDTH_VAR);
|
|
4495
|
+
html.style.setProperty(SCROLLBAR_WIDTH_VAR, `${scrollbarWidth}px`);
|
|
4496
|
+
if (scrollbarWidth > 0) {
|
|
4497
|
+
const padding = Number.parseFloat(getComputedStyle(html).paddingRight) || 0;
|
|
4498
|
+
html.style.paddingRight = `${padding + scrollbarWidth}px`;
|
|
4499
|
+
}
|
|
4500
|
+
html.style.overflow = "hidden";
|
|
4501
|
+
}
|
|
4502
|
+
function unlockScroll() {
|
|
4503
|
+
if (typeof document === "undefined") return;
|
|
4504
|
+
const html = document.documentElement;
|
|
4505
|
+
html.style.overflow = previousHtmlOverflow ?? "";
|
|
4506
|
+
html.style.paddingRight = previousHtmlPaddingRight ?? "";
|
|
4507
|
+
if (previousScrollbarWidthVar) html.style.setProperty(SCROLLBAR_WIDTH_VAR, previousScrollbarWidthVar);
|
|
4508
|
+
else html.style.removeProperty(SCROLLBAR_WIDTH_VAR);
|
|
4509
|
+
previousHtmlOverflow = null;
|
|
4510
|
+
previousHtmlPaddingRight = null;
|
|
4511
|
+
previousScrollbarWidthVar = null;
|
|
4512
|
+
}
|
|
4513
|
+
/**
|
|
4514
|
+
* The DOM element a `Toaster` should render its live region into while a modal dialog is open, or
|
|
4515
|
+
* `null` while none is — **the topmost one** when more than one is open (design spec, shared modal
|
|
4516
|
+
* rules: "a toast raised while a modal is open is rendered inside the open dialog, so it isn't
|
|
4517
|
+
* inert" — with more than one open, the toast has to land in the one that is not itself covered).
|
|
4518
|
+
*
|
|
4519
|
+
* **Not a Vue injection key**, despite the name matching this package's `*_KEY` convention
|
|
4520
|
+
* (`FIELD_KEY`, `MESSAGES_KEY`, …) — those all connect a provider to its own *descendants*, and a
|
|
4521
|
+
* `Toaster` is not one: the design spec's own toast region "lives outside the dialog" (shared modal
|
|
4522
|
+
* rules), which in practice means an app mounts one `<Toaster />` near its root, a sibling of
|
|
4523
|
+
* whatever page content opens a `Dialog` somewhere else in the tree. `provide`/`inject` cannot
|
|
4524
|
+
* connect two siblings, so the hand-off has to be a plain shared reference both sides read and
|
|
4525
|
+
* write independently — exactly what a module-level `Ref` is, and exactly the same reasoning
|
|
4526
|
+
* `usePopover`'s `topLayerDialog()` already leans on to teleport a non-modal panel into a modal
|
|
4527
|
+
* dialog it did not render.
|
|
4528
|
+
*
|
|
4529
|
+
* It holds the open dialog's own root element — the `Dialog` anatomy has no separate "toast host"
|
|
4530
|
+
* part to render (`DialogPart` is `root | panel | header | title | close | description | body |
|
|
4531
|
+
* footer`), so `Toaster` renders its live region as an appended child of this element (a
|
|
4532
|
+
* `<dialog>` accepts ordinary children anywhere in its box) rather than one this package declares
|
|
4533
|
+
* a slot or a `data-part` for.
|
|
4534
|
+
*/
|
|
4535
|
+
var TOAST_HOST_KEY = shallowRef(null);
|
|
4536
|
+
/**
|
|
4537
|
+
* Push `dialog` onto the stack, making it the new top.
|
|
4538
|
+
*
|
|
4539
|
+
* Idempotent for a dialog that is already in the stack (a spurious re-open is a no-op, not a
|
|
4540
|
+
* duplicate entry) — every other dialog is simply pushed on top, no refusal, no warning: nested
|
|
4541
|
+
* modals are allowed.
|
|
4542
|
+
*
|
|
4543
|
+
* The *first* claim (the stack going from empty to non-empty) locks the page's scroll (`<html>`
|
|
4544
|
+
* gets `overflow: hidden`, the shared modal rule: "While any modal surface is open … the root
|
|
4545
|
+
* element does not scroll"), padding `<html>` by the scrollbar's width so nothing shifts — later
|
|
4546
|
+
* pushes leave it locked, already true. `TOAST_HOST_KEY` always
|
|
4547
|
+
* points at the new top.
|
|
4548
|
+
*/
|
|
4549
|
+
function openDialog(dialog) {
|
|
4550
|
+
if (stack.some((entry) => entry.dialog === dialog)) return;
|
|
4551
|
+
if (stack.length === 0) lockScroll();
|
|
4552
|
+
stack.push({ dialog });
|
|
4553
|
+
TOAST_HOST_KEY.value = dialog;
|
|
4554
|
+
}
|
|
4555
|
+
/**
|
|
4556
|
+
* Pop `dialog` off the stack, wherever it sits in it. Safe to call on a dialog that is not in the
|
|
4557
|
+
* stack (already closed, or never opened).
|
|
4558
|
+
*
|
|
4559
|
+
* `TOAST_HOST_KEY` falls back to whatever is now on top (`null` once the stack is empty), and the
|
|
4560
|
+
* scroll lock is released only once the stack actually *is* empty — one modal closing while another
|
|
4561
|
+
* is still open must leave the page exactly as locked as it was.
|
|
4562
|
+
*/
|
|
4563
|
+
function closeDialog(dialog) {
|
|
4564
|
+
const index = stack.findIndex((entry) => entry.dialog === dialog);
|
|
4565
|
+
if (index === -1) return;
|
|
4566
|
+
stack.splice(index, 1);
|
|
4567
|
+
TOAST_HOST_KEY.value = stack.at(-1)?.dialog ?? null;
|
|
4568
|
+
if (stack.length === 0) unlockScroll();
|
|
4569
|
+
}
|
|
4570
|
+
/** Whether `dialog` is the **topmost** entry in the stack — what `Esc` and a backdrop click are
|
|
4571
|
+
* gated on (`useDialog`'s own `isTop`). A dialog lower in the stack answers `false`: it is open,
|
|
4572
|
+
* but not the one those routes may act on. */
|
|
4573
|
+
function isOpenDialog(dialog) {
|
|
4574
|
+
return stack.at(-1)?.dialog === dialog;
|
|
4575
|
+
}
|
|
4576
|
+
/** The topmost dialog's element, or `null` while the stack is empty. Exposed for tests. */
|
|
4577
|
+
function currentDialog() {
|
|
4578
|
+
return stack.at(-1)?.dialog ?? null;
|
|
4579
|
+
}
|
|
4580
|
+
// src/composables/useDialog.ts
|
|
4581
|
+
/**
|
|
4582
|
+
* Every element the platform lets a keyboard user reach, the same list `useOverlay` builds for its
|
|
4583
|
+
* own (non-modal) overlays. Duplicated rather than imported: `useOverlay`'s copy is private to that
|
|
4584
|
+
* module, and the two composables solve unrelated problems (tab *cycling* there, initial focus only
|
|
4585
|
+
* here — a native modal `<dialog>` already contains `Tab` on its own, see this file's own doc
|
|
4586
|
+
* comment below).
|
|
4587
|
+
*/
|
|
4588
|
+
var FOCUSABLE = "a[href], area[href], button, input, select, textarea, details > summary:first-of-type, iframe, audio[controls], video[controls], [contenteditable]:not([contenteditable=\"false\"]), [tabindex]:not([tabindex^=\"-\"])";
|
|
4589
|
+
function isReachable(element) {
|
|
4590
|
+
return element.tabIndex >= 0 && !element.hasAttribute("disabled") && element.getAttribute("aria-hidden") !== "true" && element.closest("[hidden]") === null;
|
|
4591
|
+
}
|
|
4592
|
+
/**
|
|
4593
|
+
* The dialog's first meaningful control (design spec, shared modal rules: "focus moves to the
|
|
4594
|
+
* element marked for initial focus, else the first meaningful control (never the close button when
|
|
4595
|
+
* the dialog has a primary field)") — every reachable focusable inside `root`, **excluding**
|
|
4596
|
+
* whatever carries `data-part="close"`.
|
|
4597
|
+
*
|
|
4598
|
+
* `data-part` is this package's own convention ("`data-part` on every part" — every component's own
|
|
4599
|
+
* anatomy uses it), not a one-off marker invented here: any modal built on this composable
|
|
4600
|
+
* (`Dialog` today; `Drawer`/`Lightbox`/`SearchModal` next) names its own close button the same way,
|
|
4601
|
+
* so this exclusion works for all of them without a second constant to keep in sync.
|
|
4602
|
+
*/
|
|
4603
|
+
var lastInputWasPointer = false;
|
|
4604
|
+
var trackingInput = false;
|
|
4605
|
+
function trackInputModality() {
|
|
4606
|
+
if (trackingInput || typeof document === "undefined") return;
|
|
4607
|
+
trackingInput = true;
|
|
4608
|
+
document.addEventListener("pointerdown", () => lastInputWasPointer = true, true);
|
|
4609
|
+
document.addEventListener("keydown", () => lastInputWasPointer = false, true);
|
|
4610
|
+
}
|
|
4611
|
+
trackInputModality();
|
|
4612
|
+
var TEXT_ENTRY = "input:not([type=\"button\"], [type=\"submit\"], [type=\"reset\"], [type=\"checkbox\"], [type=\"radio\"], [type=\"range\"], [type=\"color\"], [type=\"file\"], [type=\"image\"]), textarea, [contenteditable]:not([contenteditable=\"false\"])";
|
|
4613
|
+
function takesFocusOnTap(element) {
|
|
4614
|
+
return element != null && (element.hasAttribute("autofocus") || element.matches(TEXT_ENTRY));
|
|
4615
|
+
}
|
|
4616
|
+
function focusSurface(dialog) {
|
|
4617
|
+
if (!dialog.hasAttribute("tabindex")) dialog.setAttribute("tabindex", "-1");
|
|
4618
|
+
dialog.focus({ preventScroll: true });
|
|
4619
|
+
}
|
|
4620
|
+
function autofocusControl(root) {
|
|
4621
|
+
return [...root.querySelectorAll("[autofocus]")].find(isReachable);
|
|
4622
|
+
}
|
|
4623
|
+
function firstMeaningfulControl(root) {
|
|
4624
|
+
return [...root.querySelectorAll(FOCUSABLE)].find((element) => isReachable(element) && element.closest("[data-part=\"close\"]") === null);
|
|
4625
|
+
}
|
|
4626
|
+
/**
|
|
4627
|
+
* The lifecycle of one **modal surface**: the design spec's shared "Modal dialogs" rules, applied
|
|
4628
|
+
* to whichever native `<dialog>` a component hands this composable. `Dialog` is the first consumer;
|
|
4629
|
+
* `Drawer`, `Lightbox` and `SearchModal` are built on the same contract rather than reimplementing
|
|
4630
|
+
* it, which is why every rule below lives here instead of in `Dialog.vue`.
|
|
4631
|
+
*
|
|
4632
|
+
* What it owns, entirely through the native element — **no custom focus trap, no `role="dialog"`**
|
|
4633
|
+
* (the design spec's own non-negotiable 2, and this file's whole reason to exist):
|
|
4634
|
+
*
|
|
4635
|
+
* - **Open/close**, synced to `open`: `showModal()` when it becomes `true`, `.close()` when it
|
|
4636
|
+
* becomes `false`. A native modal `<dialog>` already makes the rest of the page `inert` (nothing
|
|
4637
|
+
* outside it is focusable or reachable by a screen reader's virtual cursor) and already contains
|
|
4638
|
+
* `Tab`/`Shift+Tab` to its own controls for free — that is the entire point of using one, so
|
|
4639
|
+
* nothing here re-implements either.
|
|
4640
|
+
* - **Nested modals** (`dialogStack`, operator override, 2026-09-26 — see the README's Deviations
|
|
4641
|
+
* entry): opening a dialog pushes it onto the shared stack; a dialog already open when another
|
|
4642
|
+
* one opens is left open, underneath — no refusal, no warning. `Esc` and a backdrop click,
|
|
4643
|
+
* though, only ever act on the **topmost** dialog (`isTop` below): a lower one ignores both,
|
|
4644
|
+
* even if one somehow reaches its own listeners directly (native top-layer stacking already
|
|
4645
|
+
* routes `Esc` to the top only; this is defence in depth, not the primary mechanism).
|
|
4646
|
+
* - **Scroll lock and the toast host** (`dialogStack`, shared with every future modal built on this
|
|
4647
|
+
* composable): the page behind does not scroll while the stack is non-empty (released only once
|
|
4648
|
+
* every open modal has closed), and `TOAST_HOST_KEY` tracks the **topmost** dialog a `Toaster`
|
|
4649
|
+
* should render into.
|
|
4650
|
+
* - **Initial focus**: `initialFocus`, else a reachable control marked `autofocus`, else (unless
|
|
4651
|
+
* `focusFirstControl: false`, which focuses the dialog itself instead) the first
|
|
4652
|
+
* meaningful control (never the close button — see `firstMeaningfulControl` above), else the close
|
|
4653
|
+
* button itself as a last resort, else whatever the platform already focused. Opened by a tap or
|
|
4654
|
+
* click, the dialog focuses itself instead unless that target is a text field or marked
|
|
4655
|
+
* `autofocus`, because Safari rings a control script focuses after a tap. Applied a tick after `showModal()`, so slot content that
|
|
4656
|
+
* mounts alongside the dialog (a form's first field) already exists in the DOM to focus.
|
|
4657
|
+
* - **Focus return**: whatever had focus immediately before `showModal()` gets it back the moment
|
|
4658
|
+
* the dialog actually closes, by any route — the page's own opener for the bottom of the stack,
|
|
4659
|
+
* or, for a modal opened from inside another one, whichever control still had focus in the modal
|
|
4660
|
+
* underneath (captured the same way, just a tick earlier), so closing the top one lands focus
|
|
4661
|
+
* back in the modal below rather than on the page.
|
|
4662
|
+
* - **`Esc`** (the native `cancel` event): closes the dialog, never `dismissable`-gated (the shared
|
|
4663
|
+
* rule: "`Esc` … always closes it") — but only while this dialog is the top of the stack; a lower
|
|
4664
|
+
* one ignores it outright (`preventDefault()`ed, so even the platform's own default action cannot
|
|
4665
|
+
* close it). `onCancel` is a notification, not a guard — it cannot prevent the close, matching
|
|
4666
|
+
* the interface below (`() => void`, nothing to call `preventDefault()` on). The one opt-out is
|
|
4667
|
+
* `closeOnEscape: false`, which ignores `Esc` the same way (no `onCancel`, no close).
|
|
4668
|
+
* - **Backdrop click**: a `click` whose `target` is the `<dialog>` element itself — not a
|
|
4669
|
+
* descendant, which stops the target at that descendant, and not a press that began inside the
|
|
4670
|
+
* panel and was released on the backdrop — closes it when `dismissable` is `true`
|
|
4671
|
+
* (default) **and** this dialog is the top of the stack; a lower dialog's own backdrop click
|
|
4672
|
+
* (unreachable in a real browser, where the topmost modal's full-viewport surface covers it, but
|
|
4673
|
+
* reachable from a test dispatching the event directly) does nothing. `dismissable` is read on
|
|
4674
|
+
* every click, so a consumer can flip it while the dialog is open (a form that becomes dirty
|
|
4675
|
+
* part-way through).
|
|
4676
|
+
*
|
|
4677
|
+
* ```ts
|
|
4678
|
+
* const open = ref(false);
|
|
4679
|
+
* const dialog = ref<HTMLDialogElement | null>(null);
|
|
4680
|
+
* const { close, isTop } = useDialog({
|
|
4681
|
+
* open,
|
|
4682
|
+
* setOpen: (next) => (open.value = next),
|
|
4683
|
+
* dialog,
|
|
4684
|
+
* dismissable: () => !formIsDirty.value,
|
|
4685
|
+
* onCancel: () => emit('cancel'),
|
|
4686
|
+
* });
|
|
4687
|
+
* ```
|
|
4688
|
+
*/
|
|
4689
|
+
function useDialog(options) {
|
|
4690
|
+
const { open, setOpen, dialog } = options;
|
|
4691
|
+
const dismissable = () => toValue(options.dismissable) ?? true;
|
|
4692
|
+
const closeOnEscape = () => toValue(options.closeOnEscape) ?? true;
|
|
4693
|
+
/** Whatever had focus right before this dialog opened. Restored once it actually closes. */
|
|
4694
|
+
let opener = null;
|
|
4695
|
+
function focusInitial() {
|
|
4696
|
+
const el = dialog.value;
|
|
4697
|
+
if (el === null) return;
|
|
4294
4698
|
const named = options.initialFocus?.value ?? autofocusControl(el);
|
|
4295
4699
|
if (named == null && options.focusFirstControl === false) {
|
|
4296
4700
|
focusSurface(el);
|
|
@@ -4400,14 +4804,14 @@ function useDialog(options) {
|
|
|
4400
4804
|
};
|
|
4401
4805
|
}
|
|
4402
4806
|
// src/components/dialog/Dialog.vue?vue&type=script&setup=true&lang.ts
|
|
4403
|
-
var _hoisted_1$
|
|
4807
|
+
var _hoisted_1$39 = [
|
|
4404
4808
|
"data-eldra-scope",
|
|
4405
4809
|
"aria-labelledby",
|
|
4406
4810
|
"aria-describedby"
|
|
4407
4811
|
];
|
|
4408
|
-
var _hoisted_2$
|
|
4812
|
+
var _hoisted_2$32 = ["data-eldra-slot", "id"];
|
|
4409
4813
|
var _hoisted_3$25 = ["id"];
|
|
4410
|
-
var _hoisted_4$
|
|
4814
|
+
var _hoisted_4$16 = ["aria-label"];
|
|
4411
4815
|
var _hoisted_5$12 = ["data-eldra-slot"];
|
|
4412
4816
|
var _hoisted_6$8 = ["data-eldra-scope", "id"];
|
|
4413
4817
|
var _hoisted_7$6 = ["data-eldra-slot"];
|
|
@@ -4591,7 +4995,7 @@ var Dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
4591
4995
|
id: unref(titleId),
|
|
4592
4996
|
"data-part": "title",
|
|
4593
4997
|
class: normalizeClass(titleClass.value)
|
|
4594
|
-
}, [renderSlot(_ctx.$slots, "title")], 10, _hoisted_2$
|
|
4998
|
+
}, [renderSlot(_ctx.$slots, "title")], 10, _hoisted_2$32)) : __props.title !== void 0 ? (openBlock(), createElementBlock("h2", {
|
|
4595
4999
|
key: 1,
|
|
4596
5000
|
id: unref(titleId),
|
|
4597
5001
|
"data-part": "title",
|
|
@@ -4613,7 +5017,7 @@ var Dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
4613
5017
|
"stroke-linejoin": "round",
|
|
4614
5018
|
"aria-hidden": "true",
|
|
4615
5019
|
focusable: "false"
|
|
4616
|
-
}, [createElementVNode("path", { d: "M18 6l-12 12" }), createElementVNode("path", { d: "M6 6l12 12" })], -1)])], 10, _hoisted_4$
|
|
5020
|
+
}, [createElementVNode("path", { d: "M18 6l-12 12" }), createElementVNode("path", { d: "M6 6l12 12" })], -1)])], 10, _hoisted_4$16)) : createCommentVNode("", true)], 2)) : createCommentVNode("", true),
|
|
4617
5021
|
createElementVNode("div", {
|
|
4618
5022
|
"data-eldra-slot": unref(eldra).slotHost("default"),
|
|
4619
5023
|
"data-part": "body",
|
|
@@ -4631,7 +5035,7 @@ var Dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
4631
5035
|
"data-part": "footer",
|
|
4632
5036
|
class: normalizeClass(footerClass.value)
|
|
4633
5037
|
}, [renderSlot(_ctx.$slots, "footer")], 10, _hoisted_7$6)) : createCommentVNode("", true)
|
|
4634
|
-
], 2)], 40, _hoisted_1$
|
|
5038
|
+
], 2)], 40, _hoisted_1$39);
|
|
4635
5039
|
};
|
|
4636
5040
|
}
|
|
4637
5041
|
});
|
|
@@ -4864,15 +5268,15 @@ function useDrawerDrag(options) {
|
|
|
4864
5268
|
};
|
|
4865
5269
|
}
|
|
4866
5270
|
// src/components/drawer/Drawer.vue?vue&type=script&setup=true&lang.ts
|
|
4867
|
-
var _hoisted_1$
|
|
5271
|
+
var _hoisted_1$38 = [
|
|
4868
5272
|
"data-eldra-scope",
|
|
4869
5273
|
"aria-labelledby",
|
|
4870
5274
|
"aria-label",
|
|
4871
5275
|
"data-side"
|
|
4872
5276
|
];
|
|
4873
|
-
var _hoisted_2$
|
|
5277
|
+
var _hoisted_2$31 = ["data-eldra-slot"];
|
|
4874
5278
|
var _hoisted_3$24 = ["data-eldra-scope", "id"];
|
|
4875
|
-
var _hoisted_4$
|
|
5279
|
+
var _hoisted_4$15 = ["aria-label"];
|
|
4876
5280
|
var _hoisted_5$11 = ["data-eldra-slot"];
|
|
4877
5281
|
var _hoisted_6$7 = ["data-eldra-slot"];
|
|
4878
5282
|
var handleBarClass = "eldra:block eldra:h-1 eldra:w-9 eldra:rounded-full eldra:bg-[var(--eldra-drawer-handle-color,var(--eldra-color-border-strong))]";
|
|
@@ -5115,7 +5519,7 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
5115
5519
|
key: 0,
|
|
5116
5520
|
"data-part": "count",
|
|
5117
5521
|
class: normalizeClass(countClass.value)
|
|
5118
|
-
}, "(" + toDisplayString(__props.count) + ")", 3)) : createCommentVNode("", true)], 10, _hoisted_3$24)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "header")], 8, _hoisted_2$
|
|
5522
|
+
}, "(" + toDisplayString(__props.count) + ")", 3)) : createCommentVNode("", true)], 10, _hoisted_3$24)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "header")], 8, _hoisted_2$31), createElementVNode("button", {
|
|
5119
5523
|
ref_key: "closeButtonEl",
|
|
5120
5524
|
ref: closeButtonEl,
|
|
5121
5525
|
type: "button",
|
|
@@ -5133,7 +5537,7 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
5133
5537
|
"stroke-linejoin": "round",
|
|
5134
5538
|
"aria-hidden": "true",
|
|
5135
5539
|
focusable: "false"
|
|
5136
|
-
}, [createElementVNode("path", { d: "M18 6l-12 12" }), createElementVNode("path", { d: "M6 6l12 12" })], -1)])], 10, _hoisted_4$
|
|
5540
|
+
}, [createElementVNode("path", { d: "M18 6l-12 12" }), createElementVNode("path", { d: "M6 6l12 12" })], -1)])], 10, _hoisted_4$15)], 2),
|
|
5137
5541
|
createElementVNode("div", {
|
|
5138
5542
|
ref_key: "bodyEl",
|
|
5139
5543
|
ref: bodyEl,
|
|
@@ -5151,12 +5555,12 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
5151
5555
|
"data-part": "footer",
|
|
5152
5556
|
class: normalizeClass(footerClass.value)
|
|
5153
5557
|
}, [renderSlot(_ctx.$slots, "footer")], 10, _hoisted_6$7)) : createCommentVNode("", true)
|
|
5154
|
-
], 38)], 42, _hoisted_1$
|
|
5558
|
+
], 38)], 42, _hoisted_1$38);
|
|
5155
5559
|
};
|
|
5156
5560
|
}
|
|
5157
5561
|
});
|
|
5158
5562
|
// src/components/empty-state/EditorPlaceholder.vue?vue&type=script&setup=true&lang.ts
|
|
5159
|
-
var _hoisted_1$
|
|
5563
|
+
var _hoisted_1$37 = ["data-eldra-scope"];
|
|
5160
5564
|
// src/components/empty-state/EditorPlaceholder.vue
|
|
5161
5565
|
var EditorPlaceholder_default = /* @__PURE__ */ defineComponent({
|
|
5162
5566
|
__name: "EditorPlaceholder",
|
|
@@ -5212,7 +5616,7 @@ var EditorPlaceholder_default = /* @__PURE__ */ defineComponent({
|
|
|
5212
5616
|
"data-part": "help",
|
|
5213
5617
|
class: normalizeClass(helpClass.value)
|
|
5214
5618
|
}, toDisplayString(__props.help), 3)) : createCommentVNode("", true)
|
|
5215
|
-
], 10, _hoisted_1$
|
|
5619
|
+
], 10, _hoisted_1$37);
|
|
5216
5620
|
};
|
|
5217
5621
|
}
|
|
5218
5622
|
});
|
|
@@ -5248,8 +5652,8 @@ var ALERT_CIRCLE_PATHS = [
|
|
|
5248
5652
|
/** `check`: a completed step's mark in `StepIndicator`. */
|
|
5249
5653
|
var CHECK_PATHS = ["M5 12l5 5l10 -10"];
|
|
5250
5654
|
// src/components/empty-state/EmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
5251
|
-
var _hoisted_1$
|
|
5252
|
-
var _hoisted_2$
|
|
5655
|
+
var _hoisted_1$36 = ["data-eldra-scope", "role"];
|
|
5656
|
+
var _hoisted_2$30 = ["d"];
|
|
5253
5657
|
var _hoisted_3$23 = ["data-eldra-slot"];
|
|
5254
5658
|
var ICON_STROKE_WIDTH$4 = 1.5;
|
|
5255
5659
|
// src/components/empty-state/EmptyState.vue
|
|
@@ -5321,559 +5725,246 @@ var EmptyState_default = /* @__PURE__ */ defineComponent({
|
|
|
5321
5725
|
* `currentColor` from this wrapper (spec → Accessibility, 1.4.1: the shape changes too, not only
|
|
5322
5726
|
* the colour, for a caller using the built-in default).
|
|
5323
5727
|
*/
|
|
5324
|
-
const iconClass = computed(() => [
|
|
5325
|
-
"eldra:flex eldra:size-14 eldra:shrink-0 eldra:items-center eldra:justify-center eldra:rounded-full eldra:bg-surface-strong",
|
|
5326
|
-
props.variant === "error" ? "eldra:text-danger" : "eldra:text-text",
|
|
5327
|
-
props.classes?.icon
|
|
5328
|
-
]);
|
|
5329
|
-
const titleClass = computed(() => ["eldra:text-empty-state-title eldra:text-text", props.classes?.title]);
|
|
5330
|
-
/** 36ch max-width (spec → Sizes, "Text" row) is a content measure, not a design token — the same
|
|
5331
|
-
* literal-arbitrary-value shape `Price.vue`'s `w-[35%]` documents. */
|
|
5332
|
-
const textClass = computed(() => ["eldra:max-w-[36ch] eldra:text-body eldra:text-muted", props.classes?.text]);
|
|
5333
|
-
/** Actions (spec → Sizes): 0.75rem gap between parts, plus an extra 0.5rem above the actions row
|
|
5334
|
-
* specifically — `mt-2` on top of `root`'s own `gap-3`, rather than folded into it. */
|
|
5335
|
-
const actionsClass = computed(() => ["eldra:mt-2 eldra:flex eldra:flex-wrap eldra:items-center eldra:justify-center eldra:gap-3", props.classes?.actions]);
|
|
5336
|
-
return (_ctx, _cache) => {
|
|
5337
|
-
return openBlock(), createElementBlock("div", {
|
|
5338
|
-
"data-eldra-ui": "",
|
|
5339
|
-
"data-eldra-scope": unref(eldra).scope,
|
|
5340
|
-
"data-part": "root",
|
|
5341
|
-
class: normalizeClass(rootClass.value),
|
|
5342
|
-
role: role.value
|
|
5343
|
-
}, [
|
|
5344
|
-
createElementVNode("span", {
|
|
5345
|
-
"data-part": "icon",
|
|
5346
|
-
class: normalizeClass(iconClass.value),
|
|
5347
|
-
"aria-hidden": "true"
|
|
5348
|
-
}, [__props.icon ? (openBlock(), createBlock(resolveDynamicComponent(__props.icon), {
|
|
5349
|
-
key: 0,
|
|
5350
|
-
class: "eldra:size-7",
|
|
5351
|
-
"stroke-width": ICON_STROKE_WIDTH$4,
|
|
5352
|
-
"aria-hidden": "true",
|
|
5353
|
-
focusable: "false"
|
|
5354
|
-
})) : (openBlock(), createElementBlock("svg", {
|
|
5355
|
-
key: 1,
|
|
5356
|
-
class: "eldra:size-7",
|
|
5357
|
-
viewBox: "0 0 24 24",
|
|
5358
|
-
fill: "none",
|
|
5359
|
-
stroke: "currentColor",
|
|
5360
|
-
"stroke-width": ICON_STROKE_WIDTH$4,
|
|
5361
|
-
"stroke-linecap": "round",
|
|
5362
|
-
"stroke-linejoin": "round",
|
|
5363
|
-
"aria-hidden": "true",
|
|
5364
|
-
focusable: "false"
|
|
5365
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(DEFAULT_ICON_PATHS[__props.variant], (d) => {
|
|
5366
|
-
return openBlock(), createElementBlock("path", {
|
|
5367
|
-
key: d,
|
|
5368
|
-
d
|
|
5369
|
-
}, null, 8, _hoisted_2$31);
|
|
5370
|
-
}), 128))]))], 2),
|
|
5371
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(headingTag)), {
|
|
5372
|
-
"data-part": "title",
|
|
5373
|
-
class: normalizeClass(titleClass.value)
|
|
5374
|
-
}, {
|
|
5375
|
-
default: withCtx(() => [createTextVNode(toDisplayString(__props.title), 1)]),
|
|
5376
|
-
_: 1
|
|
5377
|
-
}, 8, ["class"])),
|
|
5378
|
-
hasText.value ? (openBlock(), createElementBlock("p", {
|
|
5379
|
-
key: 0,
|
|
5380
|
-
"data-part": "text",
|
|
5381
|
-
class: normalizeClass(textClass.value)
|
|
5382
|
-
}, toDisplayString(__props.text), 3)) : createCommentVNode("", true),
|
|
5383
|
-
hasActions.value ? (openBlock(), createElementBlock("div", {
|
|
5384
|
-
key: 1,
|
|
5385
|
-
"data-eldra-slot": unref(eldra).slotHost("actions"),
|
|
5386
|
-
"data-part": "actions",
|
|
5387
|
-
class: normalizeClass(actionsClass.value)
|
|
5388
|
-
}, [renderSlot(_ctx.$slots, "actions", { retrying: __props.retrying }, () => [__props.variant === "error" ? (openBlock(), createBlock(Button_default, {
|
|
5389
|
-
key: 0,
|
|
5390
|
-
variant: "primary",
|
|
5391
|
-
loading: __props.retrying,
|
|
5392
|
-
label: unref(messages).tryAgain,
|
|
5393
|
-
onClick: _cache[0] || (_cache[0] = ($event) => emit("retry"))
|
|
5394
|
-
}, null, 8, ["loading", "label"])) : createCommentVNode("", true)])], 10, _hoisted_3$23)) : createCommentVNode("", true)
|
|
5395
|
-
], 10, _hoisted_1$37);
|
|
5396
|
-
};
|
|
5397
|
-
}
|
|
5398
|
-
});
|
|
5399
|
-
// src/components/card/FeatureCard.vue?vue&type=script&setup=true&lang.ts
|
|
5400
|
-
var _hoisted_1$36 = ["data-eldra-scope"];
|
|
5401
|
-
var _hoisted_2$30 = ["data-eldra-slot"];
|
|
5402
|
-
var _hoisted_3$22 = ["data-eldra-slot"];
|
|
5403
|
-
var _hoisted_4$15 = ["data-eldra-scope"];
|
|
5404
|
-
var _hoisted_5$10 = ["d"];
|
|
5405
|
-
// src/components/card/FeatureCard.vue
|
|
5406
|
-
var FeatureCard_default = /* @__PURE__ */ defineComponent({
|
|
5407
|
-
__name: "FeatureCard",
|
|
5408
|
-
props: {
|
|
5409
|
-
icon: {},
|
|
5410
|
-
title: {},
|
|
5411
|
-
body: {},
|
|
5412
|
-
href: { default: null },
|
|
5413
|
-
cue: { default: void 0 },
|
|
5414
|
-
variant: { default: "plain" },
|
|
5415
|
-
headingLevel: { default: 3 },
|
|
5416
|
-
linkAs: { default: void 0 },
|
|
5417
|
-
classes: { default: void 0 }
|
|
5418
|
-
},
|
|
5419
|
-
setup(__props) {
|
|
5420
|
-
const eldra = useEldraScope();
|
|
5421
|
-
const props = __props;
|
|
5422
|
-
const messages = useMessages();
|
|
5423
|
-
/** Spec "Feature card" → Properties, `href` row: "Makes the card linked." Same empty-string
|
|
5424
|
-
* treatment as `LogoItem`'s own `hasHref` — an explicit `''` is "no destination", not a link to
|
|
5425
|
-
* nowhere. */
|
|
5426
|
-
const hasHref = computed(() => props.href !== null && props.href !== void 0 && props.href !== "");
|
|
5427
|
-
/** Spec → Properties, `cue` row: default `"Learn more"`, through the message catalogue rather than
|
|
5428
|
-
* a literal prop default (`useMessages()`'s own `learnMore` key) so an Icelandic store gets the
|
|
5429
|
-
* translation without passing `cue` on every card. */
|
|
5430
|
-
const resolvedCue = computed(() => props.cue ?? messages.value.learnMore);
|
|
5431
|
-
const headingTag = useHeadingTag(() => props.headingLevel);
|
|
5432
|
-
/** `linkAs` follows `Link`/`Button`'s own `as` contract exactly — see `Link.vue`'s comment — but
|
|
5433
|
-
* targets the title's stretched link, not this card's own root (see `card/types.ts`'s comment on
|
|
5434
|
-
* the rename). Linked only: with no `href` there is no tag to choose. */
|
|
5435
|
-
const isComponentAs = computed(() => props.linkAs !== void 0 && typeof props.linkAs !== "string");
|
|
5436
|
-
const titleTag = computed(() => props.linkAs ?? "a");
|
|
5437
|
-
const titleAttrs = computed(() => isComponentAs.value ? { to: props.href } : { href: props.href });
|
|
5438
|
-
/** Spec → Variants: `plain` "No padding, border or visible container"; `surface`/`outlined` both
|
|
5439
|
-
* take the spec's own `space-6` (1.5rem) padding, `outlined` adding the 1px `border` boundary.
|
|
5440
|
-
* Fill: `background` by default (spec → States, Default row), `surface` for that variant. */
|
|
5441
|
-
const VARIANT_CLASS = {
|
|
5442
|
-
plain: "",
|
|
5443
|
-
surface: "eldra:bg-surface eldra:p-6",
|
|
5444
|
-
outlined: "eldra:bg-background eldra:border eldra:border-border eldra:p-6"
|
|
5445
|
-
};
|
|
5446
|
-
/** Spec → States, Default row: "`text` on `surface-strong` tile (surface variant: `background`
|
|
5447
|
-
* tile)" — the icon tile inverts specifically for the `surface` variant, `plain`/`outlined` share
|
|
5448
|
-
* the same `surface-strong` fill. */
|
|
5449
|
-
const ICON_TILE_CLASS = {
|
|
5450
|
-
plain: "eldra:bg-surface-strong eldra:text-text",
|
|
5451
|
-
surface: "eldra:bg-background eldra:text-text",
|
|
5452
|
-
outlined: "eldra:bg-surface-strong eldra:text-text"
|
|
5453
|
-
};
|
|
5454
|
-
/**
|
|
5455
|
-
* The card root (spec → Anatomy). `CARD_FOCUS_PROXY` — `relative`, `rounded-lg`, `group`,
|
|
5456
|
-
* `eldra-focus eldra-focus-proxy`, see `stretchedLink.ts`'s own comment — only while linked: an
|
|
5457
|
-
* unlinked card has no tab stop at all (spec → Keyboard: "Unlinked: none"), so it needs no
|
|
5458
|
-
* positioning context, ring proxy or hover scope.
|
|
5459
|
-
*/
|
|
5460
|
-
const rootClass = computed(() => [
|
|
5461
|
-
"eldra:flex eldra:flex-col eldra:gap-3",
|
|
5462
|
-
hasHref.value ? CARD_FOCUS_PROXY : "eldra:rounded-lg",
|
|
5463
|
-
VARIANT_CLASS[props.variant]
|
|
5464
|
-
]);
|
|
5465
|
-
/** Spec → Sizes: "Icon tile: 2.75rem square, `radius-md`" — `size-11` is 11 × 0.25rem = 2.75rem.
|
|
5466
|
-
* `shrink-0` is the acceptance criterion "The icon tile stays 2.75rem square when the title wraps
|
|
5467
|
-
* to four lines." */
|
|
5468
|
-
const iconTileClass = computed(() => [
|
|
5469
|
-
"eldra:flex eldra:size-11 eldra:shrink-0 eldra:items-center eldra:justify-center eldra:rounded-md",
|
|
5470
|
-
ICON_TILE_CLASS[props.variant],
|
|
5471
|
-
props.classes?.iconTile
|
|
5472
|
-
]);
|
|
5473
|
-
/** Spec → Sizes: "Title: heading family, 1.125rem, line-height 1.35, weight 600" — `text-h4`
|
|
5474
|
-
* already reads exactly this combination (`tailwind.css`'s `--eldra-text-h4-*` tokens), reused
|
|
5475
|
-
* directly rather than a new utility. */
|
|
5476
|
-
const titleClass = computed(() => ["eldra:text-h4 eldra:text-text", props.classes?.title]);
|
|
5477
|
-
/** The stretched link (spec → Anatomy, part 2: "with the stretched link when linked"); underlined
|
|
5478
|
-
* at rest, thickening on hover — see `stretchedLink.ts`'s own comment and `ContentCard.vue`'s
|
|
5479
|
-
* `titleLinkClass` for the full reasoning (operator direction 2026-09-26, README Deviations) and
|
|
5480
|
-
* why `group-hover:decoration-2`/`outline-none` are written this way. */
|
|
5481
|
-
const titleLinkClass = computed(() => [
|
|
5482
|
-
"eldra:underline eldra:decoration-1 eldra:decoration-current/55 eldra:underline-offset-[0.2em]",
|
|
5483
|
-
"eldra:group-hover:decoration-2 eldra:group-hover:decoration-current eldra:eldra-transition-colors",
|
|
5484
|
-
STRETCHED_LINK,
|
|
5485
|
-
STRETCHED_LINK_OUTLINE,
|
|
5486
|
-
props.classes?.titleLink
|
|
5487
|
-
]);
|
|
5488
|
-
/** Spec → Sizes: "Body: 0.9375rem, `muted`" — the same numeric size as `ContentCard`'s own
|
|
5489
|
-
* excerpt, so it reuses `text-content-card-excerpt` rather than a third near-identical utility
|
|
5490
|
-
* (see that utility's own comment in `tailwind.css`). */
|
|
5491
|
-
const bodyClass = computed(() => ["eldra:text-content-card-excerpt eldra:text-muted", props.classes?.body]);
|
|
5492
|
-
/** Spec → Sizes: "Link cue: standalone link style … min-height 1.5rem" — the same shape
|
|
5493
|
-
* `ContentCard`'s own `cueClass` renders, minus the `mt-auto` (a Feature card's cue sits directly
|
|
5494
|
-
* under the body in normal flow, never pinned). */
|
|
5495
|
-
const cueClass = computed(() => ["eldra:inline-flex eldra:items-center eldra:gap-1 eldra:target-min eldra:font-semibold eldra:text-text", props.classes?.cue]);
|
|
5496
|
-
/** The cue's arrow — identical geometry and hover-nudge to `ContentCard.vue`'s own; shared via
|
|
5497
|
-
* `card/cueArrow.ts` rather than redeclared here. */
|
|
5498
|
-
const arrowClass = CUE_ARROW_CLASS;
|
|
5499
|
-
return (_ctx, _cache) => {
|
|
5500
|
-
return openBlock(), createElementBlock("div", {
|
|
5501
|
-
"data-eldra-ui": "",
|
|
5502
|
-
"data-eldra-scope": unref(eldra).scope,
|
|
5503
|
-
"data-part": "root",
|
|
5504
|
-
class: normalizeClass(rootClass.value)
|
|
5505
|
-
}, [
|
|
5506
|
-
createElementVNode("span", {
|
|
5507
|
-
"data-part": "iconTile",
|
|
5508
|
-
class: normalizeClass(iconTileClass.value),
|
|
5509
|
-
"aria-hidden": "true"
|
|
5510
|
-
}, [createVNode(Icon_default, {
|
|
5511
|
-
icon: __props.icon,
|
|
5512
|
-
size: "lg"
|
|
5513
|
-
}, null, 8, ["icon"])], 2),
|
|
5514
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(headingTag)), {
|
|
5515
|
-
"data-eldra-slot": unref(eldra).slotHost("title"),
|
|
5516
|
-
"data-part": "title",
|
|
5517
|
-
class: normalizeClass(titleClass.value)
|
|
5518
|
-
}, {
|
|
5519
|
-
default: withCtx(() => [hasHref.value ? (openBlock(), createBlock(resolveDynamicComponent(titleTag.value), mergeProps({
|
|
5520
|
-
key: 0,
|
|
5521
|
-
"data-eldra-slot": unref(eldra).slotHost("title"),
|
|
5522
|
-
"data-eldra-scope": unref(eldra).scope,
|
|
5523
|
-
"data-part": "titleLink",
|
|
5524
|
-
class: titleLinkClass.value
|
|
5525
|
-
}, titleAttrs.value), {
|
|
5526
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])]),
|
|
5527
|
-
_: 3
|
|
5528
|
-
}, 16, [
|
|
5529
|
-
"data-eldra-slot",
|
|
5530
|
-
"data-eldra-scope",
|
|
5531
|
-
"class"
|
|
5532
|
-
])) : renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)], void 0, 1)]),
|
|
5533
|
-
_: 3
|
|
5534
|
-
}, 8, ["data-eldra-slot", "class"])),
|
|
5535
|
-
createElementVNode("p", {
|
|
5536
|
-
"data-eldra-slot": unref(eldra).slotHost("body"),
|
|
5537
|
-
"data-part": "body",
|
|
5538
|
-
class: normalizeClass(bodyClass.value)
|
|
5539
|
-
}, [renderSlot(_ctx.$slots, "body", {}, () => [createTextVNode(toDisplayString(__props.body), 1)])], 10, _hoisted_2$30),
|
|
5540
|
-
hasHref.value ? (openBlock(), createElementBlock("span", {
|
|
5541
|
-
key: 0,
|
|
5542
|
-
"data-eldra-slot": unref(eldra).slotHost("cue"),
|
|
5543
|
-
"data-part": "cue",
|
|
5544
|
-
class: normalizeClass(cueClass.value),
|
|
5728
|
+
const iconClass = computed(() => [
|
|
5729
|
+
"eldra:flex eldra:size-14 eldra:shrink-0 eldra:items-center eldra:justify-center eldra:rounded-full eldra:bg-surface-strong",
|
|
5730
|
+
props.variant === "error" ? "eldra:text-danger" : "eldra:text-text",
|
|
5731
|
+
props.classes?.icon
|
|
5732
|
+
]);
|
|
5733
|
+
const titleClass = computed(() => ["eldra:text-empty-state-title eldra:text-text", props.classes?.title]);
|
|
5734
|
+
/** 36ch max-width (spec → Sizes, "Text" row) is a content measure, not a design token — the same
|
|
5735
|
+
* literal-arbitrary-value shape `Price.vue`'s `w-[35%]` documents. */
|
|
5736
|
+
const textClass = computed(() => ["eldra:max-w-[36ch] eldra:text-body eldra:text-muted", props.classes?.text]);
|
|
5737
|
+
/** Actions (spec → Sizes): 0.75rem gap between parts, plus an extra 0.5rem above the actions row
|
|
5738
|
+
* specifically — `mt-2` on top of `root`'s own `gap-3`, rather than folded into it. */
|
|
5739
|
+
const actionsClass = computed(() => ["eldra:mt-2 eldra:flex eldra:flex-wrap eldra:items-center eldra:justify-center eldra:gap-3", props.classes?.actions]);
|
|
5740
|
+
return (_ctx, _cache) => {
|
|
5741
|
+
return openBlock(), createElementBlock("div", {
|
|
5742
|
+
"data-eldra-ui": "",
|
|
5743
|
+
"data-eldra-scope": unref(eldra).scope,
|
|
5744
|
+
"data-part": "root",
|
|
5745
|
+
class: normalizeClass(rootClass.value),
|
|
5746
|
+
role: role.value
|
|
5747
|
+
}, [
|
|
5748
|
+
createElementVNode("span", {
|
|
5749
|
+
"data-part": "icon",
|
|
5750
|
+
class: normalizeClass(iconClass.value),
|
|
5545
5751
|
"aria-hidden": "true"
|
|
5546
|
-
}, [
|
|
5547
|
-
|
|
5548
|
-
class:
|
|
5752
|
+
}, [__props.icon ? (openBlock(), createBlock(resolveDynamicComponent(__props.icon), {
|
|
5753
|
+
key: 0,
|
|
5754
|
+
class: "eldra:size-7",
|
|
5755
|
+
"stroke-width": ICON_STROKE_WIDTH$4,
|
|
5756
|
+
"aria-hidden": "true",
|
|
5757
|
+
focusable: "false"
|
|
5758
|
+
})) : (openBlock(), createElementBlock("svg", {
|
|
5759
|
+
key: 1,
|
|
5760
|
+
class: "eldra:size-7",
|
|
5549
5761
|
viewBox: "0 0 24 24",
|
|
5550
5762
|
fill: "none",
|
|
5551
5763
|
stroke: "currentColor",
|
|
5552
|
-
"stroke-width":
|
|
5764
|
+
"stroke-width": ICON_STROKE_WIDTH$4,
|
|
5553
5765
|
"stroke-linecap": "round",
|
|
5554
5766
|
"stroke-linejoin": "round",
|
|
5555
5767
|
"aria-hidden": "true",
|
|
5556
5768
|
focusable: "false"
|
|
5557
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
5769
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(DEFAULT_ICON_PATHS[__props.variant], (d) => {
|
|
5558
5770
|
return openBlock(), createElementBlock("path", {
|
|
5559
5771
|
key: d,
|
|
5560
5772
|
d
|
|
5561
|
-
}, null, 8,
|
|
5562
|
-
}), 128))]
|
|
5773
|
+
}, null, 8, _hoisted_2$30);
|
|
5774
|
+
}), 128))]))], 2),
|
|
5775
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(headingTag)), {
|
|
5776
|
+
"data-part": "title",
|
|
5777
|
+
class: normalizeClass(titleClass.value)
|
|
5778
|
+
}, {
|
|
5779
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.title), 1)]),
|
|
5780
|
+
_: 1
|
|
5781
|
+
}, 8, ["class"])),
|
|
5782
|
+
hasText.value ? (openBlock(), createElementBlock("p", {
|
|
5783
|
+
key: 0,
|
|
5784
|
+
"data-part": "text",
|
|
5785
|
+
class: normalizeClass(textClass.value)
|
|
5786
|
+
}, toDisplayString(__props.text), 3)) : createCommentVNode("", true),
|
|
5787
|
+
hasActions.value ? (openBlock(), createElementBlock("div", {
|
|
5788
|
+
key: 1,
|
|
5789
|
+
"data-eldra-slot": unref(eldra).slotHost("actions"),
|
|
5790
|
+
"data-part": "actions",
|
|
5791
|
+
class: normalizeClass(actionsClass.value)
|
|
5792
|
+
}, [renderSlot(_ctx.$slots, "actions", { retrying: __props.retrying }, () => [__props.variant === "error" ? (openBlock(), createBlock(Button_default, {
|
|
5793
|
+
key: 0,
|
|
5794
|
+
variant: "primary",
|
|
5795
|
+
loading: __props.retrying,
|
|
5796
|
+
label: unref(messages).tryAgain,
|
|
5797
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("retry"))
|
|
5798
|
+
}, null, 8, ["loading", "label"])) : createCommentVNode("", true)])], 10, _hoisted_3$23)) : createCommentVNode("", true)
|
|
5563
5799
|
], 10, _hoisted_1$36);
|
|
5564
5800
|
};
|
|
5565
5801
|
}
|
|
5566
5802
|
});
|
|
5567
|
-
// src/components/
|
|
5803
|
+
// src/components/card/FeatureCard.vue?vue&type=script&setup=true&lang.ts
|
|
5568
5804
|
var _hoisted_1$35 = ["data-eldra-scope"];
|
|
5569
5805
|
var _hoisted_2$29 = ["data-eldra-slot"];
|
|
5570
|
-
var _hoisted_3$
|
|
5571
|
-
var _hoisted_4$14 = ["
|
|
5572
|
-
var
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
* the label red on error. The border and message are enough, and red labels read as 'required'."
|
|
5577
|
-
* `w-fit` keeps the click target on the words rather than the whole grid row.
|
|
5578
|
-
*
|
|
5579
|
-
* The legend is the same type style with the fieldset variant's own 0.5rem bottom margin, and with
|
|
5580
|
-
* the `padding-inline` a `<legend>` carries by default removed.
|
|
5581
|
-
*/
|
|
5582
|
-
var LABEL_TYPE = "eldra:text-label eldra:text-text eldra:block eldra:w-fit";
|
|
5583
|
-
// src/components/field-wrapper/FieldWrapper.vue
|
|
5584
|
-
var FieldWrapper_default = /* @__PURE__ */ defineComponent({
|
|
5585
|
-
inheritAttrs: false,
|
|
5586
|
-
__name: "FieldWrapper",
|
|
5806
|
+
var _hoisted_3$22 = ["data-eldra-slot"];
|
|
5807
|
+
var _hoisted_4$14 = ["data-eldra-scope"];
|
|
5808
|
+
var _hoisted_5$10 = ["d"];
|
|
5809
|
+
// src/components/card/FeatureCard.vue
|
|
5810
|
+
var FeatureCard_default = /* @__PURE__ */ defineComponent({
|
|
5811
|
+
__name: "FeatureCard",
|
|
5587
5812
|
props: {
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
},
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
default: false
|
|
5597
|
-
},
|
|
5598
|
-
help: { default: void 0 },
|
|
5599
|
-
error: { default: void 0 },
|
|
5600
|
-
counter: { default: void 0 },
|
|
5601
|
-
group: {
|
|
5602
|
-
type: Boolean,
|
|
5603
|
-
default: false
|
|
5604
|
-
},
|
|
5605
|
-
full: {
|
|
5606
|
-
type: Boolean,
|
|
5607
|
-
default: false
|
|
5608
|
-
},
|
|
5813
|
+
icon: {},
|
|
5814
|
+
title: {},
|
|
5815
|
+
body: {},
|
|
5816
|
+
href: { default: null },
|
|
5817
|
+
cue: { default: void 0 },
|
|
5818
|
+
variant: { default: "plain" },
|
|
5819
|
+
headingLevel: { default: 3 },
|
|
5820
|
+
linkAs: { default: void 0 },
|
|
5609
5821
|
classes: { default: void 0 }
|
|
5610
5822
|
},
|
|
5611
5823
|
setup(__props) {
|
|
5612
5824
|
const eldra = useEldraScope();
|
|
5613
5825
|
const props = __props;
|
|
5614
|
-
const
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
*
|
|
5626
|
-
*
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
const
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
*/
|
|
5647
|
-
const hasError = computed(() => Boolean(props.error) || slotContent.value.error);
|
|
5648
|
-
const hasHelp = computed(() => Boolean(props.help) || slotContent.value.help);
|
|
5649
|
-
const hasCounter = computed(() => props.counter !== void 0);
|
|
5650
|
-
/**
|
|
5651
|
-
* A field with no visible label is one whose control is named some other way (`aria-label`), so
|
|
5652
|
-
* the wrapper draws no empty `<label>` for it. `label=""` still renders one, as it always has.
|
|
5653
|
-
*/
|
|
5654
|
-
const hasLabel = computed(() => props.label !== void 0 || slotContent.value.label);
|
|
5655
|
-
const hasFoot = computed(() => hasHelp.value || hasCounter.value);
|
|
5656
|
-
/**
|
|
5657
|
-
* Spec "Field wrapper" → Accessibility: `aria-describedby="<error-id> <help-id> <counter-id>"` —
|
|
5658
|
-
* "the error comes first and is announced on focus". Only ids that actually render go in, so a
|
|
5659
|
-
* field with no help never points at an element that is not there.
|
|
5660
|
-
*/
|
|
5661
|
-
const describedBy = computed(() => {
|
|
5662
|
-
const ids = [
|
|
5663
|
-
hasError.value ? errorId.value : void 0,
|
|
5664
|
-
hasHelp.value ? helpId.value : void 0,
|
|
5665
|
-
hasCounter.value ? counterId.value : void 0
|
|
5666
|
-
].filter((id) => id !== void 0);
|
|
5667
|
-
return ids.length > 0 ? ids.join(" ") : void 0;
|
|
5668
|
-
});
|
|
5669
|
-
/**
|
|
5670
|
-
* What the control inside reads (see `context.ts`). A `ComputedRef`, so a control that mounted
|
|
5671
|
-
* while the field was valid still sees `invalid` the moment an error arrives.
|
|
5672
|
-
*
|
|
5673
|
-
* A group provides it too: the `<fieldset>` is described by the same ids, and a future
|
|
5674
|
-
* `CheckboxGroup` or `RadioGroup` reads `id` and `required` from here the way `Input` does.
|
|
5675
|
-
*/
|
|
5676
|
-
const context = computed(() => ({
|
|
5677
|
-
id: controlId.value,
|
|
5678
|
-
labelId: labelId.value,
|
|
5679
|
-
labelled: hasLabel.value,
|
|
5680
|
-
describedBy: describedBy.value,
|
|
5681
|
-
invalid: hasError.value,
|
|
5682
|
-
required: props.required,
|
|
5683
|
-
labelsControl: !props.group
|
|
5684
|
-
}));
|
|
5685
|
-
provide(FIELD_KEY, context);
|
|
5686
|
-
/**
|
|
5687
|
-
* Spec "Field wrapper" → Properties, `full`: "Spans both columns in the two-column form layout."
|
|
5688
|
-
* Only there — in a single-column or inline form, and in a field standing on its own in a
|
|
5689
|
-
* page-builder column, there is no second column to span and the prop does nothing.
|
|
5690
|
-
*/
|
|
5691
|
-
const layout = inject(FORM_LAYOUT_KEY, null);
|
|
5692
|
-
const spansBothColumns = computed(() => props.full && layout?.value === "two");
|
|
5693
|
-
/**
|
|
5694
|
-
* Spec "Form layout" → Anatomy, the inline form: "[ Email address ___ ] [Subscribe]", the field
|
|
5695
|
-
* "grows, shrinks, basis 14rem", the button bottom-aligned to it, and the "error: full-width row
|
|
5696
|
-
* below both when invalid".
|
|
5697
|
-
*
|
|
5698
|
-
* A field is one box, and a box cannot be half a flex row — so in an inline form the wrapper
|
|
5699
|
-
* *becomes* the row rather than sitting in it: the root and the label/control group swap their
|
|
5700
|
-
* `display`, so the label and the control travel together as the growing flex item while the error
|
|
5701
|
-
* and the foot row wrap onto full-width rows of their own, after the button (`order-1`, which
|
|
5702
|
-
* moves nothing in the DOM or the tab order). That is what keeps the button level with the
|
|
5703
|
-
* control instead of dropping to the bottom of the help text.
|
|
5704
|
-
*
|
|
5705
|
-
* Everywhere else the group is `display: contents` and the wrapper is its own grid, exactly as the
|
|
5706
|
-
* Field wrapper section draws it. A `group` fieldset never flattens: it is a set of controls, not
|
|
5707
|
-
* the one field an inline row holds.
|
|
5708
|
-
*/
|
|
5709
|
-
const isInline = computed(() => layout?.value === "inline" && !props.group);
|
|
5710
|
-
/** Spec "Field wrapper" → Properties: a counter with no `value` is an empty field, so "0 / max". */
|
|
5711
|
-
const count = computed(() => props.counter?.value ?? 0);
|
|
5712
|
-
const isOverLimit = computed(() => props.counter?.max !== void 0 && count.value > props.counter.max);
|
|
5713
|
-
/** With no `max` the counter is the length alone: there is no limit to read it against. */
|
|
5714
|
-
const counterText = computed(() => props.counter?.max === void 0 ? String(count.value) : m.value.counter(count.value, props.counter.max));
|
|
5715
|
-
/**
|
|
5716
|
-
* One root, two shapes. A `group` is a `<fieldset>` named by its `<legend>` and described as a
|
|
5717
|
-
* whole: there is no single control for a `<label for>` to point at, so `aria-describedby` and
|
|
5718
|
-
* `aria-invalid` sit on the fieldset itself. Everything inside is identical either way, which is
|
|
5719
|
-
* why the template branches on the tag rather than duplicating itself — and why the root stays a
|
|
5720
|
-
* single node, as `@vue/test-utils` and a consumer's `class` expect.
|
|
5721
|
-
*
|
|
5722
|
-
* The vertical rhythm (spec "Field wrapper" → Sizes, "Vertical rhythm"): "Grid with a 0.25rem gap:
|
|
5723
|
-
* label → control 0.375rem (gap + label margin), control → help/error 0.25rem." So the gap is the
|
|
5724
|
-
* whole rhythm and the label's own 0.125rem bottom margin is what makes its row the wider one.
|
|
5725
|
-
*
|
|
5726
|
-
* `content-start` is what keeps that true inside a form. A grid item stretches to its row, so in a
|
|
5727
|
-
* two-column layout the shorter of a pair used to have its own rows stretched to match the taller
|
|
5728
|
-
* one — the gap grew from 0.375rem to whatever the row needed, and the two controls stopped lining
|
|
5729
|
-
* up. Packing the rows to the start leaves the rhythm fixed and lets the extra height fall below
|
|
5730
|
-
* the field, where it belongs.
|
|
5731
|
-
*
|
|
5732
|
-
* The fieldset variant is the spec's own separate geometry: "no border, padding or min-width, grid
|
|
5733
|
-
* with a 0.75rem (`space-3`) gap, and the legend has a 0.5rem (`space-2`) bottom margin."
|
|
5734
|
-
*
|
|
5735
|
-
* A `group` fieldset also carries `tabindex="-1"`. It is the one part of a field that an error
|
|
5736
|
-
* summary can link to — a group has no single control, so `#<id>` points at the fieldset itself —
|
|
5737
|
-
* and a browser moves focus to a fragment's target only when that target can take focus. `-1`
|
|
5738
|
-
* keeps it out of the tab order while making the link actually land on the question it names.
|
|
5739
|
-
*/
|
|
5740
|
-
const rootClass = computed(() => mergeClass([
|
|
5741
|
-
isInline.value ? "eldra:contents" : "eldra:grid",
|
|
5742
|
-
"eldra:content-start",
|
|
5743
|
-
props.group ? "eldra:min-w-0 eldra:gap-3 eldra:rounded-none eldra:border-0 eldra:p-0" : "eldra:gap-1",
|
|
5744
|
-
spansBothColumns.value && "eldra:@two-col:col-span-2"
|
|
5745
|
-
], attrs.class));
|
|
5826
|
+
const messages = useMessages();
|
|
5827
|
+
/** Spec "Feature card" → Properties, `href` row: "Makes the card linked." Same empty-string
|
|
5828
|
+
* treatment as `LogoItem`'s own `hasHref` — an explicit `''` is "no destination", not a link to
|
|
5829
|
+
* nowhere. */
|
|
5830
|
+
const hasHref = computed(() => props.href !== null && props.href !== void 0 && props.href !== "");
|
|
5831
|
+
/** Spec → Properties, `cue` row: default `"Learn more"`, through the message catalogue rather than
|
|
5832
|
+
* a literal prop default (`useMessages()`'s own `learnMore` key) so an Icelandic store gets the
|
|
5833
|
+
* translation without passing `cue` on every card. */
|
|
5834
|
+
const resolvedCue = computed(() => props.cue ?? messages.value.learnMore);
|
|
5835
|
+
const headingTag = useHeadingTag(() => props.headingLevel);
|
|
5836
|
+
/** `linkAs` follows `Link`/`Button`'s own `as` contract exactly — see `Link.vue`'s comment — but
|
|
5837
|
+
* targets the title's stretched link, not this card's own root (see `card/types.ts`'s comment on
|
|
5838
|
+
* the rename). Linked only: with no `href` there is no tag to choose. */
|
|
5839
|
+
const isComponentAs = computed(() => props.linkAs !== void 0 && typeof props.linkAs !== "string");
|
|
5840
|
+
const titleTag = computed(() => props.linkAs ?? "a");
|
|
5841
|
+
const titleAttrs = computed(() => isComponentAs.value ? { to: props.href } : { href: props.href });
|
|
5842
|
+
/** Spec → Variants: `plain` "No padding, border or visible container"; `surface`/`outlined` both
|
|
5843
|
+
* take the spec's own `space-6` (1.5rem) padding, `outlined` adding the 1px `border` boundary.
|
|
5844
|
+
* Fill: `background` by default (spec → States, Default row), `surface` for that variant. */
|
|
5845
|
+
const VARIANT_CLASS = {
|
|
5846
|
+
plain: "",
|
|
5847
|
+
surface: "eldra:bg-surface eldra:p-6",
|
|
5848
|
+
outlined: "eldra:bg-background eldra:border eldra:border-border eldra:p-6"
|
|
5849
|
+
};
|
|
5850
|
+
/** Spec → States, Default row: "`text` on `surface-strong` tile (surface variant: `background`
|
|
5851
|
+
* tile)" — the icon tile inverts specifically for the `surface` variant, `plain`/`outlined` share
|
|
5852
|
+
* the same `surface-strong` fill. */
|
|
5853
|
+
const ICON_TILE_CLASS = {
|
|
5854
|
+
plain: "eldra:bg-surface-strong eldra:text-text",
|
|
5855
|
+
surface: "eldra:bg-background eldra:text-text",
|
|
5856
|
+
outlined: "eldra:bg-surface-strong eldra:text-text"
|
|
5857
|
+
};
|
|
5746
5858
|
/**
|
|
5747
|
-
* The
|
|
5748
|
-
*
|
|
5749
|
-
*
|
|
5750
|
-
*
|
|
5751
|
-
* and the control are simply the first two rows of the wrapper's own grid — and in the `group`
|
|
5752
|
-
* fieldset a box around them is not merely redundant but wrong: HTML names a `<fieldset>` by its
|
|
5753
|
-
* first `<legend>` **child**, so a `<div>` in between leaves the fieldset with no accessible name
|
|
5754
|
-
* at all, whatever the CSS says (`display: contents` does not change whose child an element is).
|
|
5755
|
-
* That is a defect no screenshot shows and axe's own descendant lookup hides.
|
|
5756
|
-
*
|
|
5757
|
-
* So the box renders only in an inline row, and the label and the control stay written once — a
|
|
5758
|
-
* duplicated `v-if`/`v-else` pair of the same two elements is exactly the kind of thing that drifts
|
|
5759
|
-
* apart later. It carries no `data-part`, because it is not one of the spec's parts.
|
|
5859
|
+
* The card root (spec → Anatomy). `CARD_FOCUS_PROXY` — `relative`, `rounded-lg`, `group`,
|
|
5860
|
+
* `eldra-focus eldra-focus-proxy`, see `stretchedLink.ts`'s own comment — only while linked: an
|
|
5861
|
+
* unlinked card has no tab stop at all (spec → Keyboard: "Unlinked: none"), so it needs no
|
|
5862
|
+
* positioning context, ring proxy or hover scope.
|
|
5760
5863
|
*/
|
|
5761
|
-
const
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
LABEL_TYPE,
|
|
5766
|
-
"eldra:mb-2 eldra:p-0",
|
|
5767
|
-
props.classes?.legend
|
|
5864
|
+
const rootClass = computed(() => [
|
|
5865
|
+
"eldra:flex eldra:flex-col eldra:gap-3",
|
|
5866
|
+
hasHref.value ? CARD_FOCUS_PROXY : "eldra:rounded-lg",
|
|
5867
|
+
VARIANT_CLASS[props.variant]
|
|
5768
5868
|
]);
|
|
5769
|
-
/**
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
const
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
isInline.value && INLINE_ROW,
|
|
5777
|
-
props.classes?.foot
|
|
5869
|
+
/** Spec → Sizes: "Icon tile: 2.75rem square, `radius-md`" — `size-11` is 11 × 0.25rem = 2.75rem.
|
|
5870
|
+
* `shrink-0` is the acceptance criterion "The icon tile stays 2.75rem square when the title wraps
|
|
5871
|
+
* to four lines." */
|
|
5872
|
+
const iconTileClass = computed(() => [
|
|
5873
|
+
"eldra:flex eldra:size-11 eldra:shrink-0 eldra:items-center eldra:justify-center eldra:rounded-md",
|
|
5874
|
+
ICON_TILE_CLASS[props.variant],
|
|
5875
|
+
props.classes?.iconTile
|
|
5778
5876
|
]);
|
|
5779
|
-
/**
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5877
|
+
/** Spec → Sizes: "Title: heading family, 1.125rem, line-height 1.35, weight 600" — `text-h4`
|
|
5878
|
+
* already reads exactly this combination (`tailwind.css`'s `--eldra-text-h4-*` tokens), reused
|
|
5879
|
+
* directly rather than a new utility. */
|
|
5880
|
+
const titleClass = computed(() => ["eldra:text-h4 eldra:text-text", props.classes?.title]);
|
|
5881
|
+
/** The stretched link (spec → Anatomy, part 2: "with the stretched link when linked"); underlined
|
|
5882
|
+
* at rest, thickening on hover — see `stretchedLink.ts`'s own comment and `ContentCard.vue`'s
|
|
5883
|
+
* `titleLinkClass` for the full reasoning (operator direction 2026-09-26, README Deviations) and
|
|
5884
|
+
* why `group-hover:decoration-2`/`outline-none` are written this way. */
|
|
5885
|
+
const titleLinkClass = computed(() => [
|
|
5886
|
+
"eldra:underline eldra:decoration-1 eldra:decoration-current/55 eldra:underline-offset-[0.2em]",
|
|
5887
|
+
"eldra:group-hover:decoration-2 eldra:group-hover:decoration-current eldra:eldra-transition-colors",
|
|
5888
|
+
STRETCHED_LINK,
|
|
5889
|
+
STRETCHED_LINK_OUTLINE,
|
|
5890
|
+
props.classes?.titleLink
|
|
5789
5891
|
]);
|
|
5892
|
+
/** Spec → Sizes: "Body: 0.9375rem, `muted`" — the same numeric size as `ContentCard`'s own
|
|
5893
|
+
* excerpt, so it reuses `text-content-card-excerpt` rather than a third near-identical utility
|
|
5894
|
+
* (see that utility's own comment in `tailwind.css`). */
|
|
5895
|
+
const bodyClass = computed(() => ["eldra:text-content-card-excerpt eldra:text-muted", props.classes?.body]);
|
|
5896
|
+
/** Spec → Sizes: "Link cue: standalone link style … min-height 1.5rem" — the same shape
|
|
5897
|
+
* `ContentCard`'s own `cueClass` renders, minus the `mt-auto` (a Feature card's cue sits directly
|
|
5898
|
+
* under the body in normal flow, never pinned). */
|
|
5899
|
+
const cueClass = computed(() => ["eldra:inline-flex eldra:items-center eldra:gap-1 eldra:target-min eldra:font-semibold eldra:text-text", props.classes?.cue]);
|
|
5900
|
+
/** The cue's arrow — identical geometry and hover-nudge to `ContentCard.vue`'s own; shared via
|
|
5901
|
+
* `card/cueArrow.ts` rather than redeclared here. */
|
|
5902
|
+
const arrowClass = CUE_ARROW_CLASS;
|
|
5790
5903
|
return (_ctx, _cache) => {
|
|
5791
|
-
return openBlock(),
|
|
5792
|
-
id: __props.group ? unref(controlId) : void 0,
|
|
5904
|
+
return openBlock(), createElementBlock("div", {
|
|
5793
5905
|
"data-eldra-ui": "",
|
|
5794
5906
|
"data-eldra-scope": unref(eldra).scope,
|
|
5795
5907
|
"data-part": "root",
|
|
5796
|
-
class: rootClass.value
|
|
5797
|
-
|
|
5798
|
-
"
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)]),
|
|
5813
|
-
__props.required ? (openBlock(), createBlock(RequiredMark_default, {
|
|
5814
|
-
key: 0,
|
|
5815
|
-
classes: __props.classes
|
|
5816
|
-
}, null, 8, ["classes"])) : __props.optional ? (openBlock(), createElementBlock("span", {
|
|
5817
|
-
key: 1,
|
|
5818
|
-
"data-eldra-scope": unref(eldra).scope,
|
|
5819
|
-
"data-part": "optionalText",
|
|
5820
|
-
class: normalizeClass(optionalTextClass.value)
|
|
5821
|
-
}, "(" + toDisplayString(unref(m).optional) + ")", 11, _hoisted_1$35)) : createCommentVNode("", true),
|
|
5822
|
-
renderSlot(_ctx.$slots, "labelSuffix")
|
|
5823
|
-
]),
|
|
5824
|
-
_: 3
|
|
5825
|
-
}, 8, [
|
|
5826
|
-
"data-eldra-slot",
|
|
5827
|
-
"id",
|
|
5828
|
-
"for",
|
|
5829
|
-
"data-part",
|
|
5830
|
-
"class"
|
|
5831
|
-
])) : createCommentVNode("", true), createElementVNode("div", {
|
|
5832
|
-
"data-eldra-slot": unref(eldra).slotHost("default"),
|
|
5833
|
-
"data-part": "control",
|
|
5834
|
-
class: normalizeClass(controlClass.value)
|
|
5835
|
-
}, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_2$29)]),
|
|
5836
|
-
_: 3
|
|
5837
|
-
}),
|
|
5838
|
-
hasError.value ? (openBlock(), createBlock(FieldError_default, {
|
|
5908
|
+
class: normalizeClass(rootClass.value)
|
|
5909
|
+
}, [
|
|
5910
|
+
createElementVNode("span", {
|
|
5911
|
+
"data-part": "iconTile",
|
|
5912
|
+
class: normalizeClass(iconTileClass.value),
|
|
5913
|
+
"aria-hidden": "true"
|
|
5914
|
+
}, [createVNode(Icon_default, {
|
|
5915
|
+
icon: __props.icon,
|
|
5916
|
+
size: "lg"
|
|
5917
|
+
}, null, 8, ["icon"])], 2),
|
|
5918
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(headingTag)), {
|
|
5919
|
+
"data-eldra-slot": unref(eldra).slotHost("title"),
|
|
5920
|
+
"data-part": "title",
|
|
5921
|
+
class: normalizeClass(titleClass.value)
|
|
5922
|
+
}, {
|
|
5923
|
+
default: withCtx(() => [hasHref.value ? (openBlock(), createBlock(resolveDynamicComponent(titleTag.value), mergeProps({
|
|
5839
5924
|
key: 0,
|
|
5840
|
-
|
|
5841
|
-
"
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5925
|
+
"data-eldra-slot": unref(eldra).slotHost("title"),
|
|
5926
|
+
"data-eldra-scope": unref(eldra).scope,
|
|
5927
|
+
"data-part": "titleLink",
|
|
5928
|
+
class: titleLinkClass.value
|
|
5929
|
+
}, titleAttrs.value), {
|
|
5930
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])]),
|
|
5845
5931
|
_: 3
|
|
5846
|
-
},
|
|
5847
|
-
"
|
|
5848
|
-
"
|
|
5849
|
-
"
|
|
5850
|
-
])) :
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5932
|
+
}, 16, [
|
|
5933
|
+
"data-eldra-slot",
|
|
5934
|
+
"data-eldra-scope",
|
|
5935
|
+
"class"
|
|
5936
|
+
])) : renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)], void 0, 1)]),
|
|
5937
|
+
_: 3
|
|
5938
|
+
}, 8, ["data-eldra-slot", "class"])),
|
|
5939
|
+
createElementVNode("p", {
|
|
5940
|
+
"data-eldra-slot": unref(eldra).slotHost("body"),
|
|
5941
|
+
"data-part": "body",
|
|
5942
|
+
class: normalizeClass(bodyClass.value)
|
|
5943
|
+
}, [renderSlot(_ctx.$slots, "body", {}, () => [createTextVNode(toDisplayString(__props.body), 1)])], 10, _hoisted_2$29),
|
|
5944
|
+
hasHref.value ? (openBlock(), createElementBlock("span", {
|
|
5945
|
+
key: 0,
|
|
5946
|
+
"data-eldra-slot": unref(eldra).slotHost("cue"),
|
|
5947
|
+
"data-part": "cue",
|
|
5948
|
+
class: normalizeClass(cueClass.value),
|
|
5949
|
+
"aria-hidden": "true"
|
|
5950
|
+
}, [renderSlot(_ctx.$slots, "cue", {}, () => [createTextVNode(toDisplayString(resolvedCue.value), 1)]), (openBlock(), createElementBlock("svg", {
|
|
5951
|
+
"data-eldra-scope": unref(eldra).scope,
|
|
5952
|
+
class: normalizeClass(unref(arrowClass)),
|
|
5953
|
+
viewBox: "0 0 24 24",
|
|
5954
|
+
fill: "none",
|
|
5955
|
+
stroke: "currentColor",
|
|
5956
|
+
"stroke-width": "1.75",
|
|
5957
|
+
"stroke-linecap": "round",
|
|
5958
|
+
"stroke-linejoin": "round",
|
|
5959
|
+
"aria-hidden": "true",
|
|
5960
|
+
focusable: "false"
|
|
5961
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(CUE_ARROW_PATHS), (d) => {
|
|
5962
|
+
return openBlock(), createElementBlock("path", {
|
|
5963
|
+
key: d,
|
|
5964
|
+
d
|
|
5965
|
+
}, null, 8, _hoisted_5$10);
|
|
5966
|
+
}), 128))], 10, _hoisted_4$14))], 10, _hoisted_3$22)) : createCommentVNode("", true)
|
|
5967
|
+
], 10, _hoisted_1$35);
|
|
5877
5968
|
};
|
|
5878
5969
|
}
|
|
5879
5970
|
});
|
|
@@ -6435,7 +6526,7 @@ var FACET_SWATCH_GUTTER = "eldra:-mx-1.5 eldra:px-1.5";
|
|
|
6435
6526
|
// src/components/filter-panel/facets/ColourFacet.vue?vue&type=script&setup=true&lang.ts
|
|
6436
6527
|
var _hoisted_1$34 = ["data-eldra-scope"];
|
|
6437
6528
|
var _hoisted_2$28 = ["data-part", "data-value"];
|
|
6438
|
-
var _hoisted_3$
|
|
6529
|
+
var _hoisted_3$21 = [
|
|
6439
6530
|
"value",
|
|
6440
6531
|
"checked",
|
|
6441
6532
|
"disabled",
|
|
@@ -6608,7 +6699,7 @@ var ColourFacet_default = /* @__PURE__ */ defineComponent({
|
|
|
6608
6699
|
disabled: disabled(value),
|
|
6609
6700
|
"aria-label": nameOf(value),
|
|
6610
6701
|
onChange: ($event) => emit("toggle", value.value, $event.target.checked)
|
|
6611
|
-
}, null, 40, _hoisted_3$
|
|
6702
|
+
}, null, 40, _hoisted_3$21),
|
|
6612
6703
|
createElementVNode("span", { class: normalizeClass(ringClass(value)) }, [
|
|
6613
6704
|
createElementVNode("span", {
|
|
6614
6705
|
"data-part": "swatch",
|
|
@@ -6663,7 +6754,7 @@ var ColourFacet_default = /* @__PURE__ */ defineComponent({
|
|
|
6663
6754
|
// src/components/filter-panel/facets/ListFacet.vue?vue&type=script&setup=true&lang.ts
|
|
6664
6755
|
var _hoisted_1$33 = ["data-eldra-scope"];
|
|
6665
6756
|
var _hoisted_2$27 = ["data-eldra-scope"];
|
|
6666
|
-
var _hoisted_3$
|
|
6757
|
+
var _hoisted_3$20 = ["id"];
|
|
6667
6758
|
var _hoisted_4$12 = ["data-eldra-scope"];
|
|
6668
6759
|
var _hoisted_5$9 = ["data-eldra-scope"];
|
|
6669
6760
|
var _hoisted_6$6 = ["aria-label"];
|
|
@@ -6895,7 +6986,7 @@ var ListFacet_default = /* @__PURE__ */ defineComponent({
|
|
|
6895
6986
|
"onChange"
|
|
6896
6987
|
]);
|
|
6897
6988
|
}), 128))], 8, _hoisted_6$6)) : createCommentVNode("", true)], 64);
|
|
6898
|
-
}), 128))], 10, _hoisted_3$
|
|
6989
|
+
}), 128))], 10, _hoisted_3$20),
|
|
6899
6990
|
createElementVNode("span", {
|
|
6900
6991
|
"data-part": "noMatches",
|
|
6901
6992
|
role: "status",
|
|
@@ -7092,7 +7183,7 @@ function rangeKeyTransition(key, shiftKey, thumb, value, math) {
|
|
|
7092
7183
|
// src/components/range-slider/RangeSlider.vue?vue&type=script&setup=true&lang.ts
|
|
7093
7184
|
var _hoisted_1$32 = ["data-eldra-scope"];
|
|
7094
7185
|
var _hoisted_2$26 = ["id"];
|
|
7095
|
-
var _hoisted_3$
|
|
7186
|
+
var _hoisted_3$19 = ["data-eldra-slot", "aria-labelledby"];
|
|
7096
7187
|
var _hoisted_4$11 = ["data-eldra-scope"];
|
|
7097
7188
|
var _hoisted_5$8 = [
|
|
7098
7189
|
"data-thumb",
|
|
@@ -7641,7 +7732,7 @@ var RangeSlider_default = /* @__PURE__ */ defineComponent({
|
|
|
7641
7732
|
onKeyup: onThumbKeyup,
|
|
7642
7733
|
onBlur: onThumbBlur
|
|
7643
7734
|
}, null, 46, _hoisted_5$8);
|
|
7644
|
-
}), 128))], 42, _hoisted_4$11)], 64)) : createCommentVNode("", true)], 10, _hoisted_3$
|
|
7735
|
+
}), 128))], 42, _hoisted_4$11)], 64)) : createCommentVNode("", true)], 10, _hoisted_3$19),
|
|
7645
7736
|
__props.inputs ? (openBlock(), createElementBlock("div", {
|
|
7646
7737
|
key: 1,
|
|
7647
7738
|
"data-eldra-slot": unref(eldra).slotHost("inputs"),
|
|
@@ -8255,7 +8346,7 @@ var Link_default = /* @__PURE__ */ defineComponent({
|
|
|
8255
8346
|
// src/components/filter-panel/facets/SizeFacet.vue?vue&type=script&setup=true&lang.ts
|
|
8256
8347
|
var _hoisted_1$28 = ["data-eldra-scope"];
|
|
8257
8348
|
var _hoisted_2$23 = ["data-value"];
|
|
8258
|
-
var _hoisted_3$
|
|
8349
|
+
var _hoisted_3$18 = [
|
|
8259
8350
|
"value",
|
|
8260
8351
|
"checked",
|
|
8261
8352
|
"disabled",
|
|
@@ -8383,7 +8474,7 @@ var SizeFacet_default = /* @__PURE__ */ defineComponent({
|
|
|
8383
8474
|
disabled: disabled(value),
|
|
8384
8475
|
"aria-label": nameOf(value),
|
|
8385
8476
|
onChange: ($event) => emit("toggle", value.value, $event.target.checked)
|
|
8386
|
-
}, null, 40, _hoisted_3$
|
|
8477
|
+
}, null, 40, _hoisted_3$18), createElementVNode("span", {
|
|
8387
8478
|
"data-part": "tileLabel",
|
|
8388
8479
|
class: normalizeClass(tileLabelClass.value),
|
|
8389
8480
|
"aria-hidden": "true"
|
|
@@ -8404,7 +8495,7 @@ var SizeFacet_default = /* @__PURE__ */ defineComponent({
|
|
|
8404
8495
|
// src/components/filter-panel/facets/ToggleFacet.vue?vue&type=script&setup=true&lang.ts
|
|
8405
8496
|
var _hoisted_1$27 = ["data-eldra-scope"];
|
|
8406
8497
|
var _hoisted_2$22 = ["data-value"];
|
|
8407
|
-
var _hoisted_3$
|
|
8498
|
+
var _hoisted_3$17 = ["data-eldra-scope"];
|
|
8408
8499
|
var VALUES_BASE = "eldra:flex eldra:min-w-0 eldra:flex-col eldra:gap-1";
|
|
8409
8500
|
/**
|
|
8410
8501
|
* Spec → Sizes, Switch row: "Min 2.25rem tall, space-between, 0.75rem gap."
|
|
@@ -8481,7 +8572,7 @@ var ToggleFacet_default = /* @__PURE__ */ defineComponent({
|
|
|
8481
8572
|
default: withCtx(() => [createElementVNode("span", {
|
|
8482
8573
|
"data-eldra-scope": unref(eldra).scope,
|
|
8483
8574
|
class: normalizeClass(SWITCH_LABEL)
|
|
8484
|
-
}, toDisplayString(value.label), 9, _hoisted_3$
|
|
8575
|
+
}, toDisplayString(value.label), 9, _hoisted_3$17)]),
|
|
8485
8576
|
_: 2
|
|
8486
8577
|
}, 1032, [
|
|
8487
8578
|
"model-value",
|
|
@@ -8498,7 +8589,7 @@ var ToggleFacet_default = /* @__PURE__ */ defineComponent({
|
|
|
8498
8589
|
// src/components/filter-panel/FilterGroup.vue?vue&type=script&setup=true&lang.ts
|
|
8499
8590
|
var _hoisted_1$26 = ["data-eldra-scope", "data-facet"];
|
|
8500
8591
|
var _hoisted_2$21 = { class: "eldra:m-0" };
|
|
8501
|
-
var _hoisted_3$
|
|
8592
|
+
var _hoisted_3$16 = [
|
|
8502
8593
|
"id",
|
|
8503
8594
|
"aria-expanded",
|
|
8504
8595
|
"aria-controls"
|
|
@@ -8663,7 +8754,7 @@ var FilterGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
8663
8754
|
"aria-hidden": "true",
|
|
8664
8755
|
focusable: "false"
|
|
8665
8756
|
}, [..._cache[1] || (_cache[1] = [createElementVNode("path", { d: "M6 9l6 6l6 -6" }, null, -1)])], 2))
|
|
8666
|
-
], 10, _hoisted_3$
|
|
8757
|
+
], 10, _hoisted_3$16)]), withDirectives(createElementVNode("fieldset", {
|
|
8667
8758
|
"data-eldra-slot": unref(eldra).slotHost("default"),
|
|
8668
8759
|
"data-part": "body",
|
|
8669
8760
|
id: __props.panelId,
|
|
@@ -8682,7 +8773,7 @@ var FilterGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
8682
8773
|
// src/components/filter-panel/FilterPanel.vue?vue&type=script&setup=true&lang.ts
|
|
8683
8774
|
var _hoisted_1$25 = ["data-eldra-scope", "aria-label"];
|
|
8684
8775
|
var _hoisted_2$20 = ["aria-label"];
|
|
8685
|
-
var _hoisted_3$
|
|
8776
|
+
var _hoisted_3$15 = ["data-eldra-slot"];
|
|
8686
8777
|
var ROOT_BASE = "eldra:@container eldra:min-w-0 eldra:text-control eldra:text-text";
|
|
8687
8778
|
/**
|
|
8688
8779
|
* The gutter the rows' own bleed needs, and it is load-bearing. The spec gives every option and
|
|
@@ -9107,7 +9198,7 @@ var FilterPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
9107
9198
|
}, {
|
|
9108
9199
|
default: withCtx(() => [createTextVNode(toDisplayString(__props.resultCount === null ? unref(m).filterPanelShowProducts : unref(m).filterPanelShowResults(__props.resultCount)), 1)]),
|
|
9109
9200
|
_: 1
|
|
9110
|
-
})])], 10, _hoisted_3$
|
|
9201
|
+
})])], 10, _hoisted_3$15)) : createCommentVNode("", true)
|
|
9111
9202
|
], 40, _hoisted_1$25);
|
|
9112
9203
|
};
|
|
9113
9204
|
}
|
|
@@ -9152,7 +9243,7 @@ function zoomTransform(painted, stage, scale, focus) {
|
|
|
9152
9243
|
// src/components/lightbox/Lightbox.vue?vue&type=script&setup=true&lang.ts
|
|
9153
9244
|
var _hoisted_1$24 = ["data-eldra-scope", "aria-label"];
|
|
9154
9245
|
var _hoisted_2$19 = { key: 1 };
|
|
9155
|
-
var _hoisted_3$
|
|
9246
|
+
var _hoisted_3$14 = ["aria-label"];
|
|
9156
9247
|
var _hoisted_4$9 = ["disabled", "aria-label"];
|
|
9157
9248
|
var _hoisted_5$6 = ["aria-label", "data-zoomed"];
|
|
9158
9249
|
var _hoisted_6$4 = ["data-zoomed"];
|
|
@@ -9746,7 +9837,7 @@ var Lightbox_default = /* @__PURE__ */ defineComponent({
|
|
|
9746
9837
|
"stroke-linejoin": "round",
|
|
9747
9838
|
"aria-hidden": "true",
|
|
9748
9839
|
focusable: "false"
|
|
9749
|
-
}, [createElementVNode("path", { d: "M18 6l-12 12" }), createElementVNode("path", { d: "M6 6l12 12" })], -1)])], 10, _hoisted_3$
|
|
9840
|
+
}, [createElementVNode("path", { d: "M18 6l-12 12" }), createElementVNode("path", { d: "M6 6l12 12" })], -1)])], 10, _hoisted_3$14)]),
|
|
9750
9841
|
createElementVNode("div", {
|
|
9751
9842
|
class: normalizeClass(stageClass.value),
|
|
9752
9843
|
onPointerenter: onStagePointerenter,
|
|
@@ -9885,7 +9976,7 @@ var Lightbox_default = /* @__PURE__ */ defineComponent({
|
|
|
9885
9976
|
// src/components/load-more/LoadMore.vue?vue&type=script&setup=true&lang.ts
|
|
9886
9977
|
var _hoisted_1$23 = ["data-eldra-scope"];
|
|
9887
9978
|
var _hoisted_2$18 = ["id"];
|
|
9888
|
-
var _hoisted_3$
|
|
9979
|
+
var _hoisted_3$13 = ["aria-describedby", "aria-busy"];
|
|
9889
9980
|
var rootClass$2 = "eldra:flex eldra:flex-col eldra:items-center eldra:gap-3";
|
|
9890
9981
|
/** Spec → Sizes, "Load-more status": "0.875rem, tabular numbers" — the shared `text-body-sm` type
|
|
9891
9982
|
* style is the same 0.875rem, so this needs no per-component variable of its own. Accessibility:
|
|
@@ -9966,7 +10057,7 @@ var LoadMore_default = /* @__PURE__ */ defineComponent({
|
|
|
9966
10057
|
}, [__props.pending ? (openBlock(), createBlock(Spinner_default, {
|
|
9967
10058
|
key: 0,
|
|
9968
10059
|
class: "eldra:size-4.5"
|
|
9969
|
-
})) : createCommentVNode("", true), createElementVNode("span", null, toDisplayString(unref(m).loadMore), 1)], 10, _hoisted_3$
|
|
10060
|
+
})) : createCommentVNode("", true), createElementVNode("span", null, toDisplayString(unref(m).loadMore), 1)], 10, _hoisted_3$13)) : createCommentVNode("", true)
|
|
9970
10061
|
], 8, _hoisted_1$23);
|
|
9971
10062
|
};
|
|
9972
10063
|
}
|
|
@@ -9981,7 +10072,7 @@ var _hoisted_2$17 = [
|
|
|
9981
10072
|
"height",
|
|
9982
10073
|
"alt"
|
|
9983
10074
|
];
|
|
9984
|
-
var _hoisted_3$
|
|
10075
|
+
var _hoisted_3$12 = [
|
|
9985
10076
|
"src",
|
|
9986
10077
|
"srcset",
|
|
9987
10078
|
"sizes",
|
|
@@ -10146,7 +10237,7 @@ var LogoItem_default = /* @__PURE__ */ defineComponent({
|
|
|
10146
10237
|
alt: __props.name,
|
|
10147
10238
|
loading: "lazy",
|
|
10148
10239
|
decoding: "async"
|
|
10149
|
-
}, null, 10, _hoisted_3$
|
|
10240
|
+
}, null, 10, _hoisted_3$12)) : (openBlock(), createElementBlock("span", {
|
|
10150
10241
|
key: 1,
|
|
10151
10242
|
"data-part": "wordmark",
|
|
10152
10243
|
class: normalizeClass(wordmarkClass.value)
|
|
@@ -10219,7 +10310,7 @@ function navLinkAttrs(link, linkAs) {
|
|
|
10219
10310
|
// src/components/nav-menu/NavMenuPanel.vue?vue&type=script&setup=true&lang.ts
|
|
10220
10311
|
var _hoisted_1$21 = ["data-eldra-scope", "data-part"];
|
|
10221
10312
|
var _hoisted_2$16 = ["data-part"];
|
|
10222
|
-
var _hoisted_3$
|
|
10313
|
+
var _hoisted_3$11 = [
|
|
10223
10314
|
"data-eldra-slot",
|
|
10224
10315
|
"id",
|
|
10225
10316
|
"data-part"
|
|
@@ -10353,7 +10444,7 @@ var NavMenuPanel_default = /* @__PURE__ */ defineComponent({
|
|
|
10353
10444
|
_: 1
|
|
10354
10445
|
})) : createCommentVNode("", true)]),
|
|
10355
10446
|
_: 2
|
|
10356
|
-
}, 1040, ["data-part", "class"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(group.group), 1)], 64))])], 10, _hoisted_3$
|
|
10447
|
+
}, 1040, ["data-part", "class"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(group.group), 1)], 64))])], 10, _hoisted_3$11)) : createCommentVNode("", true), createElementVNode("ul", {
|
|
10357
10448
|
"data-part": part("panelList"),
|
|
10358
10449
|
class: normalizeClass(panelListClass.value),
|
|
10359
10450
|
"aria-labelledby": listLabel(group.group, index)
|
|
@@ -10512,7 +10603,7 @@ function useNavMenuKeys(options) {
|
|
|
10512
10603
|
// src/components/nav-menu/NavMenu.vue?vue&type=script&setup=true&lang.ts
|
|
10513
10604
|
var _hoisted_1$20 = ["data-eldra-scope"];
|
|
10514
10605
|
var _hoisted_2$15 = ["aria-label"];
|
|
10515
|
-
var _hoisted_3$
|
|
10606
|
+
var _hoisted_3$10 = [
|
|
10516
10607
|
"aria-expanded",
|
|
10517
10608
|
"aria-controls",
|
|
10518
10609
|
"data-current",
|
|
@@ -10841,7 +10932,7 @@ var NavMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
10841
10932
|
"stroke-linecap": "round",
|
|
10842
10933
|
"stroke-linejoin": "round",
|
|
10843
10934
|
focusable: "false"
|
|
10844
|
-
}, [createElementVNode("path", { d: "M6 9l6 6l6 -6" })], -1))])], 10, _hoisted_4$7)], 42, _hoisted_3$
|
|
10935
|
+
}, [createElementVNode("path", { d: "M6 9l6 6l6 -6" })], -1))])], 10, _hoisted_4$7)], 42, _hoisted_3$10), createVNode(Transition, mergeProps({ ref_for: true }, PANEL_TRANSITION, { persisted: "" }), {
|
|
10845
10936
|
default: withCtx(() => [withDirectives(createElementVNode("div", {
|
|
10846
10937
|
id: panelId(index),
|
|
10847
10938
|
ref_for: true,
|
|
@@ -11061,7 +11152,7 @@ var _hoisted_1$19 = [
|
|
|
11061
11152
|
"role"
|
|
11062
11153
|
];
|
|
11063
11154
|
var _hoisted_2$14 = ["d"];
|
|
11064
|
-
var _hoisted_3$
|
|
11155
|
+
var _hoisted_3$9 = ["data-eldra-slot"];
|
|
11065
11156
|
var _hoisted_4$6 = ["data-eldra-slot"];
|
|
11066
11157
|
var ICON_STROKE_WIDTH$3 = 1.75;
|
|
11067
11158
|
// src/components/notice/Notice.vue
|
|
@@ -11194,7 +11285,7 @@ var Notice_default = /* @__PURE__ */ defineComponent({
|
|
|
11194
11285
|
"data-eldra-slot": unref(eldra).slotHost("default"),
|
|
11195
11286
|
"data-part": "text",
|
|
11196
11287
|
class: normalizeClass(textClass.value)
|
|
11197
|
-
}, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.text), 1)])], 10, _hoisted_3$
|
|
11288
|
+
}, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.text), 1)])], 10, _hoisted_3$9)) : createCommentVNode("", true),
|
|
11198
11289
|
unref(present).actions ? (openBlock(), createElementBlock("div", {
|
|
11199
11290
|
key: 2,
|
|
11200
11291
|
"data-eldra-slot": unref(eldra).slotHost("actions"),
|
|
@@ -11208,7 +11299,7 @@ var Notice_default = /* @__PURE__ */ defineComponent({
|
|
|
11208
11299
|
// src/components/pagination/Pagination.vue?vue&type=script&setup=true&lang.ts
|
|
11209
11300
|
var _hoisted_1$18 = ["data-eldra-scope", "aria-label"];
|
|
11210
11301
|
var _hoisted_2$13 = ["data-part", "aria-current"];
|
|
11211
|
-
var _hoisted_3$
|
|
11302
|
+
var _hoisted_3$8 = { key: 0 };
|
|
11212
11303
|
/**
|
|
11213
11304
|
* The page window (spec "Pagination" → Properties, `siblings`: "First and last always show; the
|
|
11214
11305
|
* rest collapse to '…'."). Built from the *set* of pages that must show — `1`, `totalPages`, and
|
|
@@ -11559,7 +11650,7 @@ var Pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
11559
11650
|
_: 1
|
|
11560
11651
|
}, 16, ["rel", "aria-label"])),
|
|
11561
11652
|
createElementVNode("span", { class: normalizeClass(compactStatusClass) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(compactStatusParts.value, (part, index) => {
|
|
11562
|
-
return openBlock(), createElementBlock(Fragment, { key: index }, [part.bold ? (openBlock(), createElementBlock("strong", _hoisted_3$
|
|
11653
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [part.bold ? (openBlock(), createElementBlock("strong", _hoisted_3$8, toDisplayString(part.text), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
11563
11654
|
}), 128))]),
|
|
11564
11655
|
nextDisabled.value ? (openBlock(), createElementBlock("span", {
|
|
11565
11656
|
key: 2,
|
|
@@ -12584,7 +12675,7 @@ var RatingStars_default = /* @__PURE__ */ defineComponent({
|
|
|
12584
12675
|
// src/components/rating/Rating.vue?vue&type=script&setup=true&lang.ts
|
|
12585
12676
|
var _hoisted_1$13 = ["data-eldra-slot", "data-eldra-scope"];
|
|
12586
12677
|
var _hoisted_2$11 = ["data-eldra-scope"];
|
|
12587
|
-
var _hoisted_3$
|
|
12678
|
+
var _hoisted_3$7 = ["data-eldra-scope"];
|
|
12588
12679
|
var _hoisted_4$5 = ["data-eldra-scope"];
|
|
12589
12680
|
var SECTION = "eldra:section-primary:text-primary-contrast eldra:section-accent:text-accent-contrast";
|
|
12590
12681
|
// src/components/rating/Rating.vue
|
|
@@ -12736,7 +12827,7 @@ var Rating_default = /* @__PURE__ */ defineComponent({
|
|
|
12736
12827
|
"data-part": "value",
|
|
12737
12828
|
class: normalizeClass(valueClass.value),
|
|
12738
12829
|
"aria-hidden": "true"
|
|
12739
|
-
}, toDisplayString(formattedValue.value), 11, _hoisted_3$
|
|
12830
|
+
}, toDisplayString(formattedValue.value), 11, _hoisted_3$7)) : createCommentVNode("", true), __props.showCount ? (openBlock(), createElementBlock("span", {
|
|
12740
12831
|
key: 1,
|
|
12741
12832
|
"data-eldra-scope": unref(eldra).scope,
|
|
12742
12833
|
"data-part": "count",
|
|
@@ -12903,7 +12994,7 @@ var StockBadge_default = /* @__PURE__ */ defineComponent({
|
|
|
12903
12994
|
// src/components/product-card/ProductCard.vue?vue&type=script&setup=true&lang.ts
|
|
12904
12995
|
var _hoisted_1$11 = ["data-eldra-scope", "aria-label"];
|
|
12905
12996
|
var _hoisted_2$9 = { class: "eldra:mt-3 eldra:flex eldra:flex-1 eldra:flex-col eldra:gap-1" };
|
|
12906
|
-
var _hoisted_3$
|
|
12997
|
+
var _hoisted_3$6 = ["data-eldra-scope"];
|
|
12907
12998
|
// src/components/product-card/ProductCard.vue
|
|
12908
12999
|
var ProductCard_default = /* @__PURE__ */ defineComponent({
|
|
12909
13000
|
__name: "ProductCard",
|
|
@@ -12953,6 +13044,7 @@ var ProductCard_default = /* @__PURE__ */ defineComponent({
|
|
|
12953
13044
|
/** Spec "Product card" → Variants, "Sold out" row. Drives the media opacity, the badge-stack
|
|
12954
13045
|
* outline "Sold out" badge, and the quick-add area's disabled state. */
|
|
12955
13046
|
const isSoldOut = computed(() => props.product.available === false);
|
|
13047
|
+
const notSoldIn = computed(() => props.product.notSoldIn || null);
|
|
12956
13048
|
/**
|
|
12957
13049
|
* The caller's own sale/new decision (spec anatomy part 2), per `ProductCardProduct.badge`'s own
|
|
12958
13050
|
* comment: the spec's "derived automatically ... when tagged `new`" needs a tag vocabulary this
|
|
@@ -12991,7 +13083,7 @@ var ProductCard_default = /* @__PURE__ */ defineComponent({
|
|
|
12991
13083
|
* most storefront cards. Suppressed while sold out, where the disabled quick-add button already
|
|
12992
13084
|
* carries the same "unavailable" meaning and a second line would repeat it.
|
|
12993
13085
|
*/
|
|
12994
|
-
const showStockLine = computed(() => props.product.stock != null && !isSoldOut.value);
|
|
13086
|
+
const showStockLine = computed(() => props.product.stock != null && !isSoldOut.value && notSoldIn.value === null);
|
|
12995
13087
|
const stockLevel = computed(() => props.product.stock ?? "in");
|
|
12996
13088
|
const swatches = computed(() => props.product.colours ?? []);
|
|
12997
13089
|
const showSwatchesResolved = computed(() => props.showSwatches && swatches.value.length > 0);
|
|
@@ -13107,6 +13199,7 @@ var ProductCard_default = /* @__PURE__ */ defineComponent({
|
|
|
13107
13199
|
* the parent's own part name on the wrapper, the child's full part tree intact inside it.
|
|
13108
13200
|
*/
|
|
13109
13201
|
const priceClass = computed(() => props.classes?.price);
|
|
13202
|
+
const notSoldClass = computed(() => ["eldra:text-body-sm eldra:text-muted", props.classes?.notSold]);
|
|
13110
13203
|
const ratingClass = computed(() => props.classes?.rating);
|
|
13111
13204
|
const stockLineClass = computed(() => props.classes?.stockLine);
|
|
13112
13205
|
const swatchesClass = computed(() => ["eldra:flex eldra:items-center eldra:gap-1.5", props.classes?.swatches]);
|
|
@@ -13244,7 +13337,12 @@ var ProductCard_default = /* @__PURE__ */ defineComponent({
|
|
|
13244
13337
|
createElementVNode("div", {
|
|
13245
13338
|
"data-part": "price",
|
|
13246
13339
|
class: normalizeClass(priceClass.value)
|
|
13247
|
-
}, [
|
|
13340
|
+
}, [notSoldIn.value ? (openBlock(), createElementBlock("span", {
|
|
13341
|
+
key: 0,
|
|
13342
|
+
"data-part": "notSold",
|
|
13343
|
+
class: normalizeClass(notSoldClass.value)
|
|
13344
|
+
}, toDisplayString(unref(messages).notSoldInCurrency(notSoldIn.value)), 3)) : (openBlock(), createBlock(Price_default, {
|
|
13345
|
+
key: 1,
|
|
13248
13346
|
amount: __props.product.price.amount,
|
|
13249
13347
|
"compare-at": __props.product.price.compareAt,
|
|
13250
13348
|
from: __props.product.price.from,
|
|
@@ -13261,7 +13359,7 @@ var ProductCard_default = /* @__PURE__ */ defineComponent({
|
|
|
13261
13359
|
"locale",
|
|
13262
13360
|
"revalidating",
|
|
13263
13361
|
"announce"
|
|
13264
|
-
])], 2),
|
|
13362
|
+
]))], 2),
|
|
13265
13363
|
showRatingResolved.value ? (openBlock(), createElementBlock("div", {
|
|
13266
13364
|
key: 1,
|
|
13267
13365
|
"data-part": "rating",
|
|
@@ -13303,7 +13401,7 @@ var ProductCard_default = /* @__PURE__ */ defineComponent({
|
|
|
13303
13401
|
_: 1
|
|
13304
13402
|
})], 64)) : createCommentVNode("", true)
|
|
13305
13403
|
], 2),
|
|
13306
|
-
__props.quickAdd && !isSoldOut.value ? (openBlock(), createBlock(Button_default, {
|
|
13404
|
+
__props.quickAdd && !isSoldOut.value && !notSoldIn.value ? (openBlock(), createBlock(Button_default, {
|
|
13307
13405
|
key: 0,
|
|
13308
13406
|
"data-part": "quickAdd",
|
|
13309
13407
|
variant: "outline",
|
|
@@ -13316,7 +13414,7 @@ var ProductCard_default = /* @__PURE__ */ defineComponent({
|
|
|
13316
13414
|
}, {
|
|
13317
13415
|
default: withCtx(() => [createTextVNode(toDisplayString(unref(messages).quickAddLabel), 1)]),
|
|
13318
13416
|
_: 1
|
|
13319
|
-
}, 8, ["class", "aria-label"])) : __props.quickAdd
|
|
13417
|
+
}, 8, ["class", "aria-label"])) : __props.quickAdd ? (openBlock(), createBlock(Button_default, {
|
|
13320
13418
|
key: 1,
|
|
13321
13419
|
"data-part": "quickAdd",
|
|
13322
13420
|
variant: "outline",
|
|
@@ -13326,10 +13424,10 @@ var ProductCard_default = /* @__PURE__ */ defineComponent({
|
|
|
13326
13424
|
type: "button",
|
|
13327
13425
|
class: normalizeClass(quickAddClass.value)
|
|
13328
13426
|
}, {
|
|
13329
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(messages).soldOut), 1)]),
|
|
13427
|
+
default: withCtx(() => [createTextVNode(toDisplayString(notSoldIn.value ? unref(messages).notSoldInCurrency(notSoldIn.value) : unref(messages).soldOut), 1)]),
|
|
13330
13428
|
_: 1
|
|
13331
13429
|
}, 8, ["class"])) : createCommentVNode("", true)
|
|
13332
|
-
], 8, _hoisted_3$
|
|
13430
|
+
], 8, _hoisted_3$6));
|
|
13333
13431
|
};
|
|
13334
13432
|
}
|
|
13335
13433
|
});
|
|
@@ -13342,7 +13440,7 @@ var _hoisted_2$8 = [
|
|
|
13342
13440
|
"disabled",
|
|
13343
13441
|
"aria-invalid"
|
|
13344
13442
|
];
|
|
13345
|
-
var _hoisted_3$
|
|
13443
|
+
var _hoisted_3$5 = ["data-eldra-slot"];
|
|
13346
13444
|
var _hoisted_4$4 = ["data-eldra-slot"];
|
|
13347
13445
|
// src/components/radio/Radio.vue
|
|
13348
13446
|
var Radio_default = /* @__PURE__ */ defineComponent({
|
|
@@ -13447,7 +13545,7 @@ var Radio_default = /* @__PURE__ */ defineComponent({
|
|
|
13447
13545
|
"data-eldra-slot": unref(eldra).slotHost("default"),
|
|
13448
13546
|
"data-part": "label",
|
|
13449
13547
|
class: normalizeClass(labelClass.value)
|
|
13450
|
-
}, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 10, _hoisted_3$
|
|
13548
|
+
}, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 10, _hoisted_3$5)) : createCommentVNode("", true),
|
|
13451
13549
|
hasHint.value ? (openBlock(), createElementBlock("span", {
|
|
13452
13550
|
key: 1,
|
|
13453
13551
|
"data-eldra-slot": unref(eldra).slotHost("hint"),
|
|
@@ -13461,7 +13559,7 @@ var Radio_default = /* @__PURE__ */ defineComponent({
|
|
|
13461
13559
|
// src/components/search-modal/SearchModal.vue?vue&type=script&setup=true&lang.ts
|
|
13462
13560
|
var _hoisted_1$9 = ["data-eldra-scope", "aria-label"];
|
|
13463
13561
|
var _hoisted_2$7 = ["action"];
|
|
13464
|
-
var _hoisted_3$
|
|
13562
|
+
var _hoisted_3$4 = [
|
|
13465
13563
|
"id",
|
|
13466
13564
|
"value",
|
|
13467
13565
|
"placeholder",
|
|
@@ -14194,7 +14292,7 @@ var SearchModal_default = /* @__PURE__ */ defineComponent({
|
|
|
14194
14292
|
spellcheck: "false",
|
|
14195
14293
|
onInput,
|
|
14196
14294
|
onKeydown
|
|
14197
|
-
}), null, 16, _hoisted_3$
|
|
14295
|
+
}), null, 16, _hoisted_3$4),
|
|
14198
14296
|
loadingShown.value ? (openBlock(), createElementBlock("span", {
|
|
14199
14297
|
key: 0,
|
|
14200
14298
|
"data-part": "busy",
|
|
@@ -14839,7 +14937,7 @@ function useSiteForm(options) {
|
|
|
14839
14937
|
// src/components/site-form/SiteForm.vue?vue&type=script&setup=true&lang.ts
|
|
14840
14938
|
var _hoisted_1$8 = ["data-eldra-slot", "data-eldra-scope"];
|
|
14841
14939
|
var _hoisted_2$6 = ["data-eldra-scope"];
|
|
14842
|
-
var _hoisted_3$
|
|
14940
|
+
var _hoisted_3$3 = ["data-eldra-scope"];
|
|
14843
14941
|
var _hoisted_4$2 = ["data-eldra-slot", "data-eldra-scope"];
|
|
14844
14942
|
var _hoisted_5$2 = ["data-eldra-scope"];
|
|
14845
14943
|
var _hoisted_6$1 = ["data-eldra-scope"];
|
|
@@ -15010,7 +15108,7 @@ var SiteForm_default = /* @__PURE__ */ defineComponent({
|
|
|
15010
15108
|
"data-part": "notice",
|
|
15011
15109
|
role: "alert",
|
|
15012
15110
|
class: normalizeClass(noticeClass.value)
|
|
15013
|
-
}, toDisplayString(unref(m).formLoadFailed), 11, _hoisted_3$
|
|
15111
|
+
}, toDisplayString(unref(m).formLoadFailed), 11, _hoisted_3$3)], void 0, 1) : unref(success) ? (openBlock(), createElementBlock("div", {
|
|
15014
15112
|
key: 2,
|
|
15015
15113
|
ref_key: "successRoot",
|
|
15016
15114
|
ref: successRoot,
|
|
@@ -15250,7 +15348,7 @@ var SiteForm_default = /* @__PURE__ */ defineComponent({
|
|
|
15250
15348
|
// src/components/step-indicator/StepIndicator.vue?vue&type=script&setup=true&lang.ts
|
|
15251
15349
|
var _hoisted_1$7 = ["data-eldra-scope", "data-orientation"];
|
|
15252
15350
|
var _hoisted_2$5 = ["data-state", "aria-current"];
|
|
15253
|
-
var _hoisted_3$
|
|
15351
|
+
var _hoisted_3$2 = ["d"];
|
|
15254
15352
|
var _hoisted_4$1 = {
|
|
15255
15353
|
key: 1,
|
|
15256
15354
|
class: "eldra:bg-primary-contrast eldra:size-2 eldra:rounded-full"
|
|
@@ -15361,7 +15459,7 @@ var StepIndicator_default = /* @__PURE__ */ defineComponent({
|
|
|
15361
15459
|
return openBlock(), createElementBlock("path", {
|
|
15362
15460
|
key: d,
|
|
15363
15461
|
d
|
|
15364
|
-
}, null, 8, _hoisted_3$
|
|
15462
|
+
}, null, 8, _hoisted_3$2);
|
|
15365
15463
|
}), 128))])) : stateOf(index) === "current" ? (openBlock(), createElementBlock("span", _hoisted_4$1)) : createCommentVNode("", true)], 64)) : createCommentVNode("", true)], 2), createElementVNode("span", {
|
|
15366
15464
|
"data-part": "content",
|
|
15367
15465
|
class: normalizeClass(contentClass.value)
|
|
@@ -15411,8 +15509,30 @@ var _hoisted_1$6 = [
|
|
|
15411
15509
|
"aria-disabled",
|
|
15412
15510
|
"tabindex"
|
|
15413
15511
|
];
|
|
15414
|
-
var _hoisted_2$4 = ["data-eldra-scope"];
|
|
15415
|
-
var
|
|
15512
|
+
var _hoisted_2$4 = ["data-eldra-slot", "data-eldra-scope"];
|
|
15513
|
+
var _hoisted_3$1 = ["data-eldra-scope"];
|
|
15514
|
+
var BASE = "eldra:group eldra:relative eldra:inline-flex eldra:items-center eldra:justify-center eldra:whitespace-nowrap";
|
|
15515
|
+
var SIZE_MD = "eldra:target-touch eldra:px-4 eldra:text-variant-pill";
|
|
15516
|
+
/**
|
|
15517
|
+
* `size="sm"`: a tab bar inside a tool panel (the page builder's rail). 2.25rem tall, 13px text
|
|
15518
|
+
* (`text-tab-sm`, the caption token's size), a 0.375rem gap between an icon and its label, and no
|
|
15519
|
+
* weight change on selection — the colour and the indicator carry it, so the label never shifts.
|
|
15520
|
+
* The weight is `font-medium` in every state, see `weightClass`.
|
|
15521
|
+
*/
|
|
15522
|
+
var SIZE_SM = "eldra:h-9 eldra:gap-1.5 eldra:px-3 eldra:text-tab-sm";
|
|
15523
|
+
/**
|
|
15524
|
+
* The `sm` underline tab's own colours, each a per-component variable (the `--eldra-dialog-text`
|
|
15525
|
+
* shape) so a panel can colour its tab bar without re-theming `--eldra-color-*` for every other
|
|
15526
|
+
* component: `--eldra-tabs-accent` (selected text and the indicator; default the primary colour),
|
|
15527
|
+
* `--eldra-tabs-muted` (unselected text; default `muted`) and `--eldra-tabs-hover-bg` (hover
|
|
15528
|
+
* background; default the 6% text tint `md` uses). Written out in full, never interpolated: see
|
|
15529
|
+
* `Tabs.vue`'s `PILLS_RING_RESERVE`.
|
|
15530
|
+
*/
|
|
15531
|
+
var SM_SELECTED_TEXT = "eldra:text-[color:var(--eldra-tabs-accent,var(--eldra-color-primary))]";
|
|
15532
|
+
var SM_REST_TEXT = "eldra:text-[color:var(--eldra-tabs-muted,var(--eldra-color-muted))]";
|
|
15533
|
+
var SM_HOVER = "eldra:hover:text-text eldra:hover:bg-[var(--eldra-tabs-hover-bg,color-mix(in_oklab,var(--eldra-color-text),transparent_94%))]";
|
|
15534
|
+
/** `fill`: every tab takes an equal share of the list. `min-w-0` lets a long label shrink. */
|
|
15535
|
+
var FILL = "eldra:min-w-0 eldra:flex-1";
|
|
15416
15536
|
// src/components/tabs/Tab.vue
|
|
15417
15537
|
var Tab_default = /* @__PURE__ */ defineComponent({
|
|
15418
15538
|
__name: "Tab",
|
|
@@ -15447,6 +15567,7 @@ var Tab_default = /* @__PURE__ */ defineComponent({
|
|
|
15447
15567
|
onBeforeUnmount(() => unregister?.());
|
|
15448
15568
|
const isSelected = computed(() => context.isSelected(props.value));
|
|
15449
15569
|
const isUnderline = computed(() => context.variant.value === "underline");
|
|
15570
|
+
const isSmall = computed(() => context.size.value === "sm");
|
|
15450
15571
|
function select() {
|
|
15451
15572
|
if (props.disabled) return;
|
|
15452
15573
|
context.select(props.value);
|
|
@@ -15487,11 +15608,18 @@ var Tab_default = /* @__PURE__ */ defineComponent({
|
|
|
15487
15608
|
* comment): one size, two weights depending on state, and a `font` shorthand cannot express that,
|
|
15488
15609
|
* so the weight is a separate `font-medium`/`font-semibold` utility paired with it here instead.
|
|
15489
15610
|
*/
|
|
15490
|
-
const
|
|
15611
|
+
const selectedWeight = computed(() => isSmall.value ? "eldra:font-medium" : "eldra:font-semibold");
|
|
15612
|
+
/** States (spec "Tabs" → States, Underline column). Hover text on the tint stays `text`, per the
|
|
15613
|
+
* spec's own contrast row ("hover text on the 6% tint 15.0:1"). */
|
|
15614
|
+
const UNDERLINE = computed(() => ["eldra:rounded-t-sm eldra:eldra-focus-inset eldra:cursor-pointer", isSelected.value ? [selectedWeight.value, isSmall.value ? SM_SELECTED_TEXT : "eldra:text-text"] : isSmall.value ? [
|
|
15615
|
+
"eldra:font-medium",
|
|
15616
|
+
SM_REST_TEXT,
|
|
15617
|
+
SM_HOVER
|
|
15618
|
+
] : ["eldra:font-medium eldra:text-muted eldra:hover:text-text", "eldra:hover:bg-[color-mix(in_oklab,var(--eldra-color-text),transparent_94%)]"]]);
|
|
15491
15619
|
/** States (spec "Tabs" → States, Pills column). The selected fill carries the state on its own —
|
|
15492
15620
|
* the same reading `VariantPicker`'s selected pill gives its own border, see that component's own
|
|
15493
15621
|
* comment — so the border only needs a colour when unselected. */
|
|
15494
|
-
const PILLS = computed(() => ["eldra:rounded-full eldra:border eldra:eldra-focus eldra:cursor-pointer", isSelected.value ? "eldra:border-primary eldra:bg-primary eldra:
|
|
15622
|
+
const PILLS = computed(() => ["eldra:rounded-full eldra:border eldra:eldra-focus eldra:cursor-pointer", isSelected.value ? ["eldra:border-primary eldra:bg-primary eldra:text-primary-contrast", selectedWeight.value] : ["eldra:border-border-strong eldra:font-medium eldra:text-muted eldra:hover:text-text", "eldra:hover:bg-[color-mix(in_oklab,var(--eldra-color-text),transparent_94%)]"]]);
|
|
15495
15623
|
/**
|
|
15496
15624
|
* A disabled tab (not in the spec's States table, which has no disabled row). It borrows the
|
|
15497
15625
|
* package's own disabled readings rather than inventing one: unselected, `Pagination`'s disabled
|
|
@@ -15499,13 +15627,18 @@ var Tab_default = /* @__PURE__ */ defineComponent({
|
|
|
15499
15627
|
* `Checkbox`): the selected weight is kept and the `primary` colour becomes `muted` — a `muted`
|
|
15500
15628
|
* underline bar, or `Button`'s disabled fill (`surface-strong`, `muted` text) for a pill.
|
|
15501
15629
|
*/
|
|
15502
|
-
const UNDERLINE_DISABLED = computed(() => ["eldra:rounded-t-sm eldra:eldra-focus-inset eldra:cursor-not-allowed", isSelected.value ? "eldra:
|
|
15503
|
-
const PILLS_DISABLED = computed(() => ["eldra:rounded-full eldra:border eldra:eldra-focus eldra:cursor-not-allowed", isSelected.value ? "eldra:border-transparent eldra:bg-surface-strong eldra:
|
|
15630
|
+
const UNDERLINE_DISABLED = computed(() => ["eldra:rounded-t-sm eldra:eldra-focus-inset eldra:cursor-not-allowed", isSelected.value ? [selectedWeight.value, "eldra:text-muted"] : "eldra:font-medium eldra:text-muted/60"]);
|
|
15631
|
+
const PILLS_DISABLED = computed(() => ["eldra:rounded-full eldra:border eldra:eldra-focus eldra:cursor-not-allowed", isSelected.value ? ["eldra:border-transparent eldra:bg-surface-strong eldra:text-muted", selectedWeight.value] : "eldra:border-border eldra:font-medium eldra:text-muted/60"]);
|
|
15504
15632
|
const stateClass = computed(() => {
|
|
15505
15633
|
if (props.disabled) return isUnderline.value ? UNDERLINE_DISABLED.value : PILLS_DISABLED.value;
|
|
15506
15634
|
return isUnderline.value ? UNDERLINE.value : PILLS.value;
|
|
15507
15635
|
});
|
|
15508
|
-
const tabClass = computed(() => [
|
|
15636
|
+
const tabClass = computed(() => [
|
|
15637
|
+
BASE,
|
|
15638
|
+
isSmall.value ? SIZE_SM : SIZE_MD,
|
|
15639
|
+
context.fill.value && FILL,
|
|
15640
|
+
stateClass.value
|
|
15641
|
+
]);
|
|
15509
15642
|
/**
|
|
15510
15643
|
* Spec "Tabs" → Anatomy, point 3 and → Sizes: "an underline bar … 0.1875rem tall, inset 0.5rem
|
|
15511
15644
|
* from each side of the tab, sitting on the list's hairline, rounded top" and → Behaviour & motion:
|
|
@@ -15516,9 +15649,10 @@ var Tab_default = /* @__PURE__ */ defineComponent({
|
|
|
15516
15649
|
* anatomy names.
|
|
15517
15650
|
*/
|
|
15518
15651
|
const indicatorClass = computed(() => [
|
|
15519
|
-
"eldra:pointer-events-none eldra:absolute eldra:
|
|
15652
|
+
"eldra:pointer-events-none eldra:absolute eldra:bottom-0",
|
|
15653
|
+
isSmall.value ? "eldra:inset-x-0 eldra:h-0.5 eldra:group-focus-visible:bottom-[calc(var(--eldra-focus-offset)_+_var(--eldra-focus-width))]" : "eldra:inset-x-2 eldra:h-[0.1875rem] eldra:rounded-t-full",
|
|
15520
15654
|
"eldra:eldra-transition-colors",
|
|
15521
|
-
isSelected.value ? props.disabled ? "eldra:bg-muted" : "eldra:bg-primary" : "eldra:bg-transparent",
|
|
15655
|
+
isSelected.value ? props.disabled ? "eldra:bg-muted" : isSmall.value ? "eldra:bg-[var(--eldra-tabs-accent,var(--eldra-color-primary))]" : "eldra:bg-primary" : "eldra:bg-transparent",
|
|
15522
15656
|
props.classes?.indicator
|
|
15523
15657
|
]);
|
|
15524
15658
|
return (_ctx, _cache) => {
|
|
@@ -15539,13 +15673,19 @@ var Tab_default = /* @__PURE__ */ defineComponent({
|
|
|
15539
15673
|
class: normalizeClass(tabClass.value),
|
|
15540
15674
|
onClick: select,
|
|
15541
15675
|
onKeydown
|
|
15542
|
-
}, [
|
|
15676
|
+
}, [unref(context).fill.value ? (openBlock(), createElementBlock("span", {
|
|
15543
15677
|
key: 0,
|
|
15678
|
+
"data-eldra-slot": unref(eldra).slotHost("default"),
|
|
15679
|
+
"data-eldra-scope": unref(eldra).scope,
|
|
15680
|
+
"data-part": "label",
|
|
15681
|
+
class: "eldra:min-w-0 eldra:truncate"
|
|
15682
|
+
}, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])], 8, _hoisted_2$4)) : renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.title), 1)], void 0, 1), isUnderline.value ? (openBlock(), createElementBlock("span", {
|
|
15683
|
+
key: 2,
|
|
15544
15684
|
"data-eldra-scope": unref(eldra).scope,
|
|
15545
15685
|
"aria-hidden": "true",
|
|
15546
15686
|
"data-part": "indicator",
|
|
15547
15687
|
class: normalizeClass(indicatorClass.value)
|
|
15548
|
-
}, null, 10,
|
|
15688
|
+
}, null, 10, _hoisted_3$1)) : createCommentVNode("", true)], 42, _hoisted_1$6);
|
|
15549
15689
|
};
|
|
15550
15690
|
}
|
|
15551
15691
|
});
|
|
@@ -15768,6 +15908,11 @@ var Tabs_default = /* @__PURE__ */ defineComponent({
|
|
|
15768
15908
|
modelValue: { default: void 0 },
|
|
15769
15909
|
variant: { default: "underline" },
|
|
15770
15910
|
ariaLabel: {},
|
|
15911
|
+
size: { default: "md" },
|
|
15912
|
+
fill: {
|
|
15913
|
+
type: Boolean,
|
|
15914
|
+
default: false
|
|
15915
|
+
},
|
|
15771
15916
|
activation: { default: "auto" },
|
|
15772
15917
|
items: { default: void 0 },
|
|
15773
15918
|
classes: { default: void 0 }
|
|
@@ -15833,6 +15978,8 @@ var Tabs_default = /* @__PURE__ */ defineComponent({
|
|
|
15833
15978
|
selectedValue,
|
|
15834
15979
|
activation: computed(() => props.activation),
|
|
15835
15980
|
variant: computed(() => props.variant),
|
|
15981
|
+
size: computed(() => props.size),
|
|
15982
|
+
fill: computed(() => props.fill),
|
|
15836
15983
|
isSelected,
|
|
15837
15984
|
select,
|
|
15838
15985
|
register,
|
|
@@ -15847,7 +15994,8 @@ var Tabs_default = /* @__PURE__ */ defineComponent({
|
|
|
15847
15994
|
* (below) never gets a chance to engage. */
|
|
15848
15995
|
const listClass = computed(() => [
|
|
15849
15996
|
"eldra:flex eldra:items-center eldra:overflow-x-auto eldra:eldra-scrollbar-hide",
|
|
15850
|
-
props.variant === "underline" ? "eldra:gap-1 eldra:border-b eldra:border-border" : ["eldra:gap-2", PILLS_RING_RESERVE],
|
|
15997
|
+
props.variant === "underline" ? [props.size === "sm" ? "eldra:gap-0" : "eldra:gap-1", "eldra:border-b eldra:border-border"] : ["eldra:gap-2", PILLS_RING_RESERVE],
|
|
15998
|
+
props.fill && "eldra:w-full",
|
|
15851
15999
|
props.classes?.list
|
|
15852
16000
|
]);
|
|
15853
16001
|
/** Forwarded onto every internally-rendered `Tab`/`TabPanel` in the `items` API, so a consumer's
|
|
@@ -16779,4 +16927,4 @@ var Tooltip_default = /* @__PURE__ */ defineComponent({
|
|
|
16779
16927
|
function mixToward(color, toward, percent) {
|
|
16780
16928
|
return `color-mix(in oklab, ${color}, ${toward} ${percent}%)`;
|
|
16781
16929
|
}
|
|
16782
|
-
export { ACCORDION_KEY, Accordion_default as Accordion, AccordionItem_default as AccordionItem, Autocomplete_default as Autocomplete, Avatar_default as Avatar, AvatarGroup_default as AvatarGroup, Badge_default as Badge, Breadcrumb_default as Breadcrumb, Button_default as Button, ButtonGroup_default as ButtonGroup, CHIP_GROUP_KEY, CURRENCY_KEY, Carousel_default as Carousel, Checkbox_default as Checkbox, CheckboxGroup_default as CheckboxGroup, Chip_default as Chip, ChipGroup_default as ChipGroup, Container_default as Container, ContentCard_default as ContentCard, CurrencyInput_default as CurrencyInput, DEFAULT_UI_LOCALE, Dialog_default as Dialog, Drawer_default as Drawer, ELDRA_SCOPE_KEY, EditorPlaceholder_default as EditorPlaceholder, EmptyState_default as EmptyState, FIELD_KEY, FILTER_SEARCH_FROM, FILTER_VALUES_SHOWN, FORM_LAYOUT_KEY, FORM_SUBMITTING_KEY, FeatureCard_default as FeatureCard, FieldWrapper_default as FieldWrapper, FilterPanel_default as FilterPanel, FormLayout_default as FormLayout, Icon_default as Icon, Image_default as Image, Input_default as Input, LOCALE_KEY, Lightbox_default as Lightbox, Link_default as Link, LoadMore_default as LoadMore, LogoItem_default as LogoItem, MESSAGES_KEY, MultiSelect_default as MultiSelect, NavMenu_default as NavMenu, Notice_default as Notice, Pagination_default as Pagination, Popover_default as Popover, Price_default as Price, ProductCard_default as ProductCard, QuantityStepper_default as QuantityStepper, Radio_default as Radio, RadioGroup_default as RadioGroup, RangeSlider_default as RangeSlider, Rating_default as Rating, SECTION_KEY, SWATCH_INK_LUMINANCE_THRESHOLD, SearchBar_default as SearchBar, SearchModal_default as SearchModal, Section_default as Section, Select_default as Select, SiteForm_default as SiteForm, Skeleton_default as Skeleton, Spinner_default as Spinner, StepIndicator_default as StepIndicator, StockBadge_default as StockBadge, Switch_default as Switch, TABS_KEY, TOAST_HOST_KEY, Tab_default as Tab, TabPanel_default as TabPanel, TablerIcon_default as TablerIcon, Tabs_default as Tabs, Textarea_default as Textarea, Toast_default as Toast, Toaster_default as Toaster, Tooltip_default as Tooltip, UnitInput_default as UnitInput, VariantPicker_default as VariantPicker, VisuallyHidden_default as VisuallyHidden, appliedFilters, applyMask, carouselPerViewStyle, clampRangeThumb, clearedSelection, closeDialog, createNumberFormat, currencyFractionDigits, currencySymbol, currentDialog, defaultCharacterMeaning, enUS as defaultMessages, enUS, defaultUnitFormat, dropOmittedFacets, facetCanShowAll, facetHasHiddenValues, facetIsRenderable, facetIsSearchable, facetRows, facetSelectedCount, facetStartsOpen, facetSummaryLabels, facetValues, filterNumericBeforeInput, foldForSearch, formatCurrency, formatDate, formatNumber, formatUnit, fractionDigits, frameAspectRatio, hasSelection, histogramBarInRange, initialsFromName, isOpenDialog, isRangeAtLimits, isRangeSelection, isValueDisabled, isValueSelected, joinIds, localeSeparators, matchesSearch, mixToward, nearestRangeThumb, normalizeRangeValue, normalizeText, openDialog, parseLocaleNumber, prefersReducedMotion, preloadTablerIcons, provideEldraScope, provideEldraUiCurrency, provideEldraUiLocale, provideEldraUiMessages, rangeKeyTransition, rangeLimits, rangeOf, rangePositionToValue, rangeStepDigits, rangeThumbLimits, rangeValueToPercent, ratingStarStates, removeValue, renderableFacets, resolveCarouselPerView, roundRatingToHalf, selectedValues, setRange, sizeSystemGroups, snapToRangeStep, stripMask, swatchInk, swatchLuminance, tablerIconName, toggleValue, topLayerDialog, useCarousel, useControllableModel, useDialog, useEldraUiCurrency, useEldraUiLocale, useFloating, useHeadingTag, useListbox, useMessages, useOverlay, usePopover, useSiteForm, useSlotPresence, useToast, useUiId, visibleFacetValues, zoomSizes };
|
|
16930
|
+
export { ACCORDION_KEY, Accordion_default as Accordion, AccordionItem_default as AccordionItem, Autocomplete_default as Autocomplete, Avatar_default as Avatar, AvatarGroup_default as AvatarGroup, Badge_default as Badge, Breadcrumb_default as Breadcrumb, Button_default as Button, ButtonGroup_default as ButtonGroup, CHIP_GROUP_KEY, CURRENCY_KEY, Carousel_default as Carousel, Checkbox_default as Checkbox, CheckboxGroup_default as CheckboxGroup, Chip_default as Chip, ChipGroup_default as ChipGroup, Container_default as Container, ContentCard_default as ContentCard, CurrencyInput_default as CurrencyInput, CurrencyPicker_default as CurrencyPicker, DEFAULT_UI_LOCALE, Dialog_default as Dialog, Drawer_default as Drawer, ELDRA_SCOPE_KEY, EditorPlaceholder_default as EditorPlaceholder, EmptyState_default as EmptyState, FIELD_KEY, FILTER_SEARCH_FROM, FILTER_VALUES_SHOWN, FORM_LAYOUT_KEY, FORM_SUBMITTING_KEY, FeatureCard_default as FeatureCard, FieldWrapper_default as FieldWrapper, FilterPanel_default as FilterPanel, FormLayout_default as FormLayout, Icon_default as Icon, Image_default as Image, Input_default as Input, LOCALE_KEY, Lightbox_default as Lightbox, Link_default as Link, LoadMore_default as LoadMore, LogoItem_default as LogoItem, MESSAGES_KEY, MultiSelect_default as MultiSelect, NavMenu_default as NavMenu, Notice_default as Notice, Pagination_default as Pagination, Popover_default as Popover, Price_default as Price, ProductCard_default as ProductCard, QuantityStepper_default as QuantityStepper, Radio_default as Radio, RadioGroup_default as RadioGroup, RangeSlider_default as RangeSlider, Rating_default as Rating, SECTION_KEY, SWATCH_INK_LUMINANCE_THRESHOLD, SearchBar_default as SearchBar, SearchModal_default as SearchModal, Section_default as Section, Select_default as Select, SiteForm_default as SiteForm, Skeleton_default as Skeleton, Spinner_default as Spinner, StepIndicator_default as StepIndicator, StockBadge_default as StockBadge, Switch_default as Switch, TABS_KEY, TOAST_HOST_KEY, Tab_default as Tab, TabPanel_default as TabPanel, TablerIcon_default as TablerIcon, Tabs_default as Tabs, Textarea_default as Textarea, Toast_default as Toast, Toaster_default as Toaster, Tooltip_default as Tooltip, UnitInput_default as UnitInput, VariantPicker_default as VariantPicker, VisuallyHidden_default as VisuallyHidden, appliedFilters, applyMask, carouselPerViewStyle, clampRangeThumb, clearedSelection, closeDialog, createNumberFormat, currencyFractionDigits, currencySymbol, currentDialog, defaultCharacterMeaning, enUS as defaultMessages, enUS, defaultUnitFormat, dropOmittedFacets, facetCanShowAll, facetHasHiddenValues, facetIsRenderable, facetIsSearchable, facetRows, facetSelectedCount, facetStartsOpen, facetSummaryLabels, facetValues, filterNumericBeforeInput, foldForSearch, formatCurrency, formatDate, formatNumber, formatUnit, fractionDigits, frameAspectRatio, hasSelection, histogramBarInRange, initialsFromName, isOpenDialog, isRangeAtLimits, isRangeSelection, isValueDisabled, isValueSelected, joinIds, localeSeparators, matchesSearch, mixToward, nearestRangeThumb, normalizeRangeValue, normalizeText, openDialog, parseLocaleNumber, prefersReducedMotion, preloadTablerIcons, provideEldraScope, provideEldraUiCurrency, provideEldraUiLocale, provideEldraUiMessages, rangeKeyTransition, rangeLimits, rangeOf, rangePositionToValue, rangeStepDigits, rangeThumbLimits, rangeValueToPercent, ratingStarStates, removeValue, renderableFacets, resolveCarouselPerView, roundRatingToHalf, selectedValues, setRange, sizeSystemGroups, snapToRangeStep, stripMask, swatchInk, swatchLuminance, tablerIconName, toMinorUnits, toggleValue, topLayerDialog, useCarousel, useControllableModel, useDialog, useEldraUiCurrency, useEldraUiLocale, useFloating, useHeadingTag, useListbox, useMessages, useOverlay, usePopover, useSiteForm, useSlotPresence, useToast, useUiId, visibleFacetValues, zoomSizes };
|