@eldrajs/ui 0.3.16 → 0.3.18
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 +3 -0
- package/README.md +1 -0
- package/dist/{PhoneInput-CB9p1skb.js → PhoneInput-CHTpjbtS.js} +1 -1
- package/dist/{VariantPicker-CCBZXtMa.js → VariantPicker-Dein0E4i.js} +4199 -4194
- 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/toast/Toast.vue.d.ts +2 -0
- package/dist/components/toast/Toaster.vue.d.ts +2 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +798 -700
- 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 +2 -2
- package/dist/phone.js +1 -1
- package/dist/resolver.js +1 -0
- package/dist/{useMessages-CrSnIuLt.js → useMessages-BdN9F1cW.js} +4 -0
- package/dist/utils/number-format.d.ts +2 -0
- package/dist/vee-validate.js +2 -2
- package/dist/vue-i18n.js +2 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $ as FIELD_KEY, A as ICON_STROKE_WIDTH$6, G as FIELD_SEARCH_APPEARANCE, I as FIELD_CLEAR_BUTTON_BOX, K as FIELD_SIZE, N as FIELD_BASE, R as FIELD_DISABLED, V as FIELD_LIVE, _ as useFloating, a as CURRENCY_KEY, c as provideEldraUiCurrency, d as useEldraUiLocale, et as mergeClass, f as Spinner_default, g as useTeleportTarget, h as topLayerDialog, k as ICON_SIZE_CLASS, l as provideEldraUiLocale, m as useOverlay, n as matchRange, nt as joinIds, o as DEFAULT_UI_LOCALE, p as usePopover, rt as useUiId, s as LOCALE_KEY, tt as useControllableModel, u as useEldraUiCurrency, v as normalizeText, y as useListbox } from "./useOptionList-UMUMayec.js";
|
|
2
2
|
import { n as provideEldraScope, r as useEldraScope, t as ELDRA_SCOPE_KEY } from "./useEldraScope-BDbGzt7R.js";
|
|
3
|
-
import { $ as
|
|
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
|
|
@@ -4042,6 +4042,410 @@ var ContentCard_default = /* @__PURE__ */ defineComponent({
|
|
|
4042
4042
|
};
|
|
4043
4043
|
}
|
|
4044
4044
|
});
|
|
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";
|
|
4052
|
+
/**
|
|
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.
|
|
4056
|
+
*
|
|
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.
|
|
4059
|
+
*/
|
|
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
|
+
});
|
|
4045
4449
|
// src/composables/dialogStack.ts
|
|
4046
4450
|
/** Bottom to top: `stack[0]` opened first, `stack.at(-1)` is the current top. */
|
|
4047
4451
|
var stack = [];
|
|
@@ -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$
|
|
4409
|
-
var _hoisted_3$
|
|
4410
|
-
var _hoisted_4$
|
|
4812
|
+
var _hoisted_2$32 = ["data-eldra-slot", "id"];
|
|
4813
|
+
var _hoisted_3$25 = ["id"];
|
|
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,12 +4995,12 @@ 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",
|
|
4598
5002
|
class: normalizeClass(titleClass.value)
|
|
4599
|
-
}, toDisplayString(__props.title), 11, _hoisted_3$
|
|
5003
|
+
}, toDisplayString(__props.title), 11, _hoisted_3$25)) : createCommentVNode("", true), __props.closeButton ? (openBlock(), createElementBlock("button", {
|
|
4600
5004
|
key: 2,
|
|
4601
5005
|
type: "button",
|
|
4602
5006
|
"data-part": "close",
|
|
@@ -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$
|
|
4874
|
-
var _hoisted_3$
|
|
4875
|
-
var _hoisted_4$
|
|
5277
|
+
var _hoisted_2$31 = ["data-eldra-slot"];
|
|
5278
|
+
var _hoisted_3$24 = ["data-eldra-scope", "id"];
|
|
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$
|
|
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,369 +5537,61 @@ 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,
|
|
5140
5544
|
"data-eldra-slot": unref(eldra).slotHost("default"),
|
|
5141
5545
|
"data-part": "body",
|
|
5142
5546
|
class: normalizeClass(bodyClass.value),
|
|
5143
|
-
onTouchstart: _cache[0] || (_cache[0] = (...args) => unref(drag).onTouchStart && unref(drag).onTouchStart(...args)),
|
|
5144
|
-
onTouchmove: _cache[1] || (_cache[1] = (...args) => unref(drag).onTouchMove && unref(drag).onTouchMove(...args)),
|
|
5145
|
-
onTouchend: _cache[2] || (_cache[2] = (...args) => unref(drag).onTouchEnd && unref(drag).onTouchEnd(...args)),
|
|
5146
|
-
onTouchcancel: _cache[3] || (_cache[3] = (...args) => unref(drag).onTouchEnd && unref(drag).onTouchEnd(...args))
|
|
5147
|
-
}, [renderSlot(_ctx.$slots, "default")], 42, _hoisted_5$11),
|
|
5148
|
-
unref(slots).footer ? (openBlock(), createElementBlock("div", {
|
|
5149
|
-
key: 1,
|
|
5150
|
-
"data-eldra-slot": unref(eldra).slotHost("footer"),
|
|
5151
|
-
"data-part": "footer",
|
|
5152
|
-
class: normalizeClass(footerClass.value)
|
|
5153
|
-
}, [renderSlot(_ctx.$slots, "footer")], 10, _hoisted_6$7)) : createCommentVNode("", true)
|
|
5154
|
-
], 38)], 42, _hoisted_1$
|
|
5155
|
-
};
|
|
5156
|
-
}
|
|
5157
|
-
});
|
|
5158
|
-
// src/components/empty-state/EditorPlaceholder.vue?vue&type=script&setup=true&lang.ts
|
|
5159
|
-
var _hoisted_1$38 = ["data-eldra-scope"];
|
|
5160
|
-
// src/components/empty-state/EditorPlaceholder.vue
|
|
5161
|
-
var EditorPlaceholder_default = /* @__PURE__ */ defineComponent({
|
|
5162
|
-
__name: "EditorPlaceholder",
|
|
5163
|
-
props: {
|
|
5164
|
-
icon: { default: null },
|
|
5165
|
-
label: {},
|
|
5166
|
-
help: { default: null },
|
|
5167
|
-
inline: {
|
|
5168
|
-
type: Boolean,
|
|
5169
|
-
default: false
|
|
5170
|
-
},
|
|
5171
|
-
classes: { default: void 0 }
|
|
5172
|
-
},
|
|
5173
|
-
setup(__props) {
|
|
5174
|
-
const eldra = useEldraScope();
|
|
5175
|
-
const props = __props;
|
|
5176
|
-
/**
|
|
5177
|
-
* The Studio page-builder's own hint for an unfilled block field (spec "Empty and error states" →
|
|
5178
|
-
* Variants, "Editor hint" row: "never rendered on the live site; there, an empty optional part
|
|
5179
|
-
* simply does not render"). It carries no ARIA role — spec → Accessibility: "Editor hints are not
|
|
5180
|
-
* part of the live page, so they need no roles" — because it exists only inside the editor's own
|
|
5181
|
-
* chrome, never in what a screen reader on the storefront ever reaches.
|
|
5182
|
-
*/
|
|
5183
|
-
const rootClass = computed(() => ["eldra:flex eldra:flex-col eldra:items-center eldra:justify-center eldra:gap-2 eldra:rounded-lg eldra:border eldra:border-dashed eldra:border-border-strong eldra:bg-surface eldra:text-center", props.inline ? "eldra:p-4" : "eldra:p-8"]);
|
|
5184
|
-
/** 1.5rem (spec → Sizes, "Editor hint" row) is exactly `Icon.vue`'s own `lg` size, unlike
|
|
5185
|
-
* `EmptyState`'s 1.75rem icon — so, unlike that component, this one draws it through the shared
|
|
5186
|
-
* `Icon` component instead of a hand-rolled `<svg>`. Colour (spec → States, "Editor hint" row):
|
|
5187
|
-
* `muted`, same as the help text. */
|
|
5188
|
-
const iconClass = computed(() => ["eldra:text-muted", props.classes?.icon]);
|
|
5189
|
-
const labelClass = computed(() => ["eldra:text-body-sm eldra:font-semibold eldra:text-text", props.classes?.label]);
|
|
5190
|
-
const helpClass = computed(() => ["eldra:text-body-sm eldra:text-muted", props.classes?.help]);
|
|
5191
|
-
return (_ctx, _cache) => {
|
|
5192
|
-
return openBlock(), createElementBlock("div", {
|
|
5193
|
-
"data-eldra-ui": "",
|
|
5194
|
-
"data-eldra-scope": unref(eldra).scope,
|
|
5195
|
-
"data-part": "root",
|
|
5196
|
-
class: normalizeClass(rootClass.value)
|
|
5197
|
-
}, [
|
|
5198
|
-
__props.icon ? (openBlock(), createElementBlock("span", {
|
|
5199
|
-
key: 0,
|
|
5200
|
-
"data-part": "icon",
|
|
5201
|
-
class: normalizeClass(iconClass.value)
|
|
5202
|
-
}, [createVNode(Icon_default, {
|
|
5203
|
-
icon: __props.icon,
|
|
5204
|
-
size: "lg"
|
|
5205
|
-
}, null, 8, ["icon"])], 2)) : createCommentVNode("", true),
|
|
5206
|
-
createElementVNode("p", {
|
|
5207
|
-
"data-part": "label",
|
|
5208
|
-
class: normalizeClass(labelClass.value)
|
|
5209
|
-
}, toDisplayString(__props.label), 3),
|
|
5210
|
-
__props.help ? (openBlock(), createElementBlock("p", {
|
|
5211
|
-
key: 1,
|
|
5212
|
-
"data-part": "help",
|
|
5213
|
-
class: normalizeClass(helpClass.value)
|
|
5214
|
-
}, toDisplayString(__props.help), 3)) : createCommentVNode("", true)
|
|
5215
|
-
], 10, _hoisted_1$38);
|
|
5216
|
-
};
|
|
5217
|
-
}
|
|
5218
|
-
});
|
|
5219
|
-
// src/icons/paths.ts
|
|
5220
|
-
/**
|
|
5221
|
-
* Inline SVG path data for a handful of Tabler icons this package draws directly rather than
|
|
5222
|
-
* depending on `@tabler/icons-vue` at runtime (the same decision `StockBadge.vue`'s own comment
|
|
5223
|
-
* records for `Button`'s spinner) — copied verbatim from `@tabler/icons-vue`'s "outline" 24x24
|
|
5224
|
-
* viewBox icons, MIT licensed. Each consumer keeps its own stroke width; only the path data (the
|
|
5225
|
-
* one thing that must stay byte-identical to read as the same icon) lives here, shared rather than
|
|
5226
|
-
* duplicated — `StockBadge`'s `low`/`error` icon and `EmptyState`'s own `error` default icon are
|
|
5227
|
-
* the same `alert-triangle` glyph.
|
|
5228
|
-
*/
|
|
5229
|
-
var ALERT_TRIANGLE_PATHS = [
|
|
5230
|
-
"M12 9v4",
|
|
5231
|
-
"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0",
|
|
5232
|
-
"M12 16h.01"
|
|
5233
|
-
];
|
|
5234
|
-
/** `circle-check`: `Notice`'s `success` default (the same glyph `Toast` and `StockBadge` draw). */
|
|
5235
|
-
var CIRCLE_CHECK_PATHS = ["M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "M9 12l2 2l4 -4"];
|
|
5236
|
-
/** `info-circle`: `Notice`'s `info` default (the same glyph `Toast`'s `info` draws). */
|
|
5237
|
-
var INFO_CIRCLE_PATHS = [
|
|
5238
|
-
"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",
|
|
5239
|
-
"M12 9h.01",
|
|
5240
|
-
"M11 12h1v4h1"
|
|
5241
|
-
];
|
|
5242
|
-
/** `alert-circle`: `Notice`'s `danger` default (the same glyph `Toast`'s `danger` draws). */
|
|
5243
|
-
var ALERT_CIRCLE_PATHS = [
|
|
5244
|
-
"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",
|
|
5245
|
-
"M12 8v4",
|
|
5246
|
-
"M12 16h.01"
|
|
5247
|
-
];
|
|
5248
|
-
/** `check`: a completed step's mark in `StepIndicator`. */
|
|
5249
|
-
var CHECK_PATHS = ["M5 12l5 5l10 -10"];
|
|
5250
|
-
// src/components/empty-state/EmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
5251
|
-
var _hoisted_1$37 = ["data-eldra-scope", "role"];
|
|
5252
|
-
var _hoisted_2$31 = ["d"];
|
|
5253
|
-
var _hoisted_3$24 = ["data-eldra-slot"];
|
|
5254
|
-
var ICON_STROKE_WIDTH$4 = 1.5;
|
|
5255
|
-
// src/components/empty-state/EmptyState.vue
|
|
5256
|
-
var EmptyState_default = /* @__PURE__ */ defineComponent({
|
|
5257
|
-
__name: "EmptyState",
|
|
5258
|
-
props: {
|
|
5259
|
-
variant: { default: "empty" },
|
|
5260
|
-
icon: { default: void 0 },
|
|
5261
|
-
title: {},
|
|
5262
|
-
text: { default: null },
|
|
5263
|
-
plain: {
|
|
5264
|
-
type: Boolean,
|
|
5265
|
-
default: false
|
|
5266
|
-
},
|
|
5267
|
-
headingLevel: { default: 3 },
|
|
5268
|
-
retrying: {
|
|
5269
|
-
type: Boolean,
|
|
5270
|
-
default: false
|
|
5271
|
-
},
|
|
5272
|
-
classes: { default: void 0 }
|
|
5273
|
-
},
|
|
5274
|
-
emits: ["retry"],
|
|
5275
|
-
setup(__props, { emit: __emit }) {
|
|
5276
|
-
const eldra = useEldraScope();
|
|
5277
|
-
const props = __props;
|
|
5278
|
-
const emit = __emit;
|
|
5279
|
-
const messages = useMessages();
|
|
5280
|
-
const slots = useSlots();
|
|
5281
|
-
/**
|
|
5282
|
-
* `icon` per variant when none is given (spec "Empty and error states" → Properties, `icon` row:
|
|
5283
|
-
* "per use", e.g. `shopping-bag`, `search`, `alert-triangle`, `heart"). These three are the
|
|
5284
|
-
* variant-neutral fallback — `search` for "nothing matched", `alert-triangle` for "something
|
|
5285
|
-
* failed" — Tabler outline path data (`IconInbox`/`IconSearch`/`IconAlertTriangle`, MIT licensed),
|
|
5286
|
-
* the same "copy the path data rather than depend on `@tabler/icons-vue` at runtime" decision
|
|
5287
|
-
* `StockBadge.vue` already documents. `error`'s `alert-triangle` path data is `src/icons/paths.ts`'s
|
|
5288
|
-
* `ALERT_TRIANGLE_PATHS`, shared with `StockBadge`'s own `low` icon rather than duplicated (M19).
|
|
5289
|
-
*/
|
|
5290
|
-
const DEFAULT_ICON_PATHS = {
|
|
5291
|
-
empty: ["M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12", "M4 13h3l3 3h4l3 -3h3"],
|
|
5292
|
-
noResults: ["M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0", "M21 21l-6 -6"],
|
|
5293
|
-
error: ALERT_TRIANGLE_PATHS
|
|
5294
|
-
};
|
|
5295
|
-
/** Icon circle (spec → Sizes): 1.75rem icon, stroke 1.5 — not one of `Icon.vue`'s four sizes
|
|
5296
|
-
* (`sm`/`md`/`lg`/`xl` are 1/1.25/1.5/2rem) or its fixed 1.75 stroke, so, like `Badge`'s own
|
|
5297
|
-
* leading icon, it is drawn directly rather than through that shared component. */
|
|
5298
|
-
const present = useSlotPresence(slots, ["actions"]);
|
|
5299
|
-
/**
|
|
5300
|
-
* Roles (spec → Accessibility): `noResults` and `empty` are `role="status"` (announced politely);
|
|
5301
|
-
* `error` is `role="alert"` (announced assertively). `plain` does not change this — it only drops
|
|
5302
|
-
* the boundary, not the semantics.
|
|
5303
|
-
*/
|
|
5304
|
-
const role = computed(() => props.variant === "error" ? "alert" : "status");
|
|
5305
|
-
const hasText = computed(() => Boolean(props.text));
|
|
5306
|
-
/**
|
|
5307
|
-
* The actions row shows whenever a caller supplies the `actions` slot, or — with none — whenever
|
|
5308
|
-
* `variant` is `error`: the built-in "Try again" button is the one case this component has a
|
|
5309
|
-
* generic next step of its own to offer (spec → Variants, "Error" row: "'Try again' button").
|
|
5310
|
-
* `empty`/`noResults` have no generic action to fall back to (the spec's own examples — "Shop
|
|
5311
|
-
* bestsellers", "Clear filters" — are all store-specific), so those variants render nothing here
|
|
5312
|
-
* until a caller supplies one.
|
|
5313
|
-
*/
|
|
5314
|
-
const hasActions = computed(() => present.value.actions || props.variant === "error");
|
|
5315
|
-
const headingTag = useHeadingTag(() => props.headingLevel);
|
|
5316
|
-
const rootClass = computed(() => ["eldra:flex eldra:flex-col eldra:items-center eldra:justify-center eldra:gap-3 eldra:px-6 eldra:py-12 eldra:text-center", !props.plain && "eldra:rounded-lg eldra:border eldra:border-dashed eldra:border-border-strong eldra:bg-background"]);
|
|
5317
|
-
/**
|
|
5318
|
-
* The icon circle (spec → Sizes): 3.5rem, `surface-strong` fill. Colour (spec → States): `text`
|
|
5319
|
-
* for `empty`/`noResults`, `danger` for `error` — "the icon turns `danger`" happens whichever icon
|
|
5320
|
-
* is showing, the built-in default or a caller's own `icon` prop, because both inherit
|
|
5321
|
-
* `currentColor` from this wrapper (spec → Accessibility, 1.4.1: the shape changes too, not only
|
|
5322
|
-
* the colour, for a caller using the built-in default).
|
|
5323
|
-
*/
|
|
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$24)) : createCommentVNode("", true)
|
|
5395
|
-
], 10, _hoisted_1$37);
|
|
5547
|
+
onTouchstart: _cache[0] || (_cache[0] = (...args) => unref(drag).onTouchStart && unref(drag).onTouchStart(...args)),
|
|
5548
|
+
onTouchmove: _cache[1] || (_cache[1] = (...args) => unref(drag).onTouchMove && unref(drag).onTouchMove(...args)),
|
|
5549
|
+
onTouchend: _cache[2] || (_cache[2] = (...args) => unref(drag).onTouchEnd && unref(drag).onTouchEnd(...args)),
|
|
5550
|
+
onTouchcancel: _cache[3] || (_cache[3] = (...args) => unref(drag).onTouchEnd && unref(drag).onTouchEnd(...args))
|
|
5551
|
+
}, [renderSlot(_ctx.$slots, "default")], 42, _hoisted_5$11),
|
|
5552
|
+
unref(slots).footer ? (openBlock(), createElementBlock("div", {
|
|
5553
|
+
key: 1,
|
|
5554
|
+
"data-eldra-slot": unref(eldra).slotHost("footer"),
|
|
5555
|
+
"data-part": "footer",
|
|
5556
|
+
class: normalizeClass(footerClass.value)
|
|
5557
|
+
}, [renderSlot(_ctx.$slots, "footer")], 10, _hoisted_6$7)) : createCommentVNode("", true)
|
|
5558
|
+
], 38)], 42, _hoisted_1$38);
|
|
5396
5559
|
};
|
|
5397
5560
|
}
|
|
5398
5561
|
});
|
|
5399
|
-
// src/components/
|
|
5400
|
-
var _hoisted_1$
|
|
5401
|
-
|
|
5402
|
-
var
|
|
5403
|
-
|
|
5404
|
-
var _hoisted_5$10 = ["d"];
|
|
5405
|
-
// src/components/card/FeatureCard.vue
|
|
5406
|
-
var FeatureCard_default = /* @__PURE__ */ defineComponent({
|
|
5407
|
-
__name: "FeatureCard",
|
|
5562
|
+
// src/components/empty-state/EditorPlaceholder.vue?vue&type=script&setup=true&lang.ts
|
|
5563
|
+
var _hoisted_1$37 = ["data-eldra-scope"];
|
|
5564
|
+
// src/components/empty-state/EditorPlaceholder.vue
|
|
5565
|
+
var EditorPlaceholder_default = /* @__PURE__ */ defineComponent({
|
|
5566
|
+
__name: "EditorPlaceholder",
|
|
5408
5567
|
props: {
|
|
5409
|
-
icon: {},
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
linkAs: { default: void 0 },
|
|
5568
|
+
icon: { default: null },
|
|
5569
|
+
label: {},
|
|
5570
|
+
help: { default: null },
|
|
5571
|
+
inline: {
|
|
5572
|
+
type: Boolean,
|
|
5573
|
+
default: false
|
|
5574
|
+
},
|
|
5417
5575
|
classes: { default: void 0 }
|
|
5418
5576
|
},
|
|
5419
5577
|
setup(__props) {
|
|
5420
5578
|
const eldra = useEldraScope();
|
|
5421
5579
|
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
5580
|
/**
|
|
5455
|
-
* The
|
|
5456
|
-
*
|
|
5457
|
-
*
|
|
5458
|
-
*
|
|
5581
|
+
* The Studio page-builder's own hint for an unfilled block field (spec "Empty and error states" →
|
|
5582
|
+
* Variants, "Editor hint" row: "never rendered on the live site; there, an empty optional part
|
|
5583
|
+
* simply does not render"). It carries no ARIA role — spec → Accessibility: "Editor hints are not
|
|
5584
|
+
* part of the live page, so they need no roles" — because it exists only inside the editor's own
|
|
5585
|
+
* chrome, never in what a screen reader on the storefront ever reaches.
|
|
5459
5586
|
*/
|
|
5460
|
-
const rootClass = computed(() => [
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
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;
|
|
5587
|
+
const rootClass = computed(() => ["eldra:flex eldra:flex-col eldra:items-center eldra:justify-center eldra:gap-2 eldra:rounded-lg eldra:border eldra:border-dashed eldra:border-border-strong eldra:bg-surface eldra:text-center", props.inline ? "eldra:p-4" : "eldra:p-8"]);
|
|
5588
|
+
/** 1.5rem (spec → Sizes, "Editor hint" row) is exactly `Icon.vue`'s own `lg` size, unlike
|
|
5589
|
+
* `EmptyState`'s 1.75rem icon — so, unlike that component, this one draws it through the shared
|
|
5590
|
+
* `Icon` component instead of a hand-rolled `<svg>`. Colour (spec → States, "Editor hint" row):
|
|
5591
|
+
* `muted`, same as the help text. */
|
|
5592
|
+
const iconClass = computed(() => ["eldra:text-muted", props.classes?.icon]);
|
|
5593
|
+
const labelClass = computed(() => ["eldra:text-body-sm eldra:font-semibold eldra:text-text", props.classes?.label]);
|
|
5594
|
+
const helpClass = computed(() => ["eldra:text-body-sm eldra:text-muted", props.classes?.help]);
|
|
5499
5595
|
return (_ctx, _cache) => {
|
|
5500
5596
|
return openBlock(), createElementBlock("div", {
|
|
5501
5597
|
"data-eldra-ui": "",
|
|
@@ -5503,377 +5599,372 @@ var FeatureCard_default = /* @__PURE__ */ defineComponent({
|
|
|
5503
5599
|
"data-part": "root",
|
|
5504
5600
|
class: normalizeClass(rootClass.value)
|
|
5505
5601
|
}, [
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5602
|
+
__props.icon ? (openBlock(), createElementBlock("span", {
|
|
5603
|
+
key: 0,
|
|
5604
|
+
"data-part": "icon",
|
|
5605
|
+
class: normalizeClass(iconClass.value)
|
|
5510
5606
|
}, [createVNode(Icon_default, {
|
|
5511
5607
|
icon: __props.icon,
|
|
5512
5608
|
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"])),
|
|
5609
|
+
}, null, 8, ["icon"])], 2)) : createCommentVNode("", true),
|
|
5535
5610
|
createElementVNode("p", {
|
|
5536
|
-
"data-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
"aria-hidden": "true"
|
|
5546
|
-
}, [renderSlot(_ctx.$slots, "cue", {}, () => [createTextVNode(toDisplayString(resolvedCue.value), 1)]), (openBlock(), createElementBlock("svg", {
|
|
5547
|
-
"data-eldra-scope": unref(eldra).scope,
|
|
5548
|
-
class: normalizeClass(unref(arrowClass)),
|
|
5549
|
-
viewBox: "0 0 24 24",
|
|
5550
|
-
fill: "none",
|
|
5551
|
-
stroke: "currentColor",
|
|
5552
|
-
"stroke-width": "1.75",
|
|
5553
|
-
"stroke-linecap": "round",
|
|
5554
|
-
"stroke-linejoin": "round",
|
|
5555
|
-
"aria-hidden": "true",
|
|
5556
|
-
focusable: "false"
|
|
5557
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(CUE_ARROW_PATHS), (d) => {
|
|
5558
|
-
return openBlock(), createElementBlock("path", {
|
|
5559
|
-
key: d,
|
|
5560
|
-
d
|
|
5561
|
-
}, null, 8, _hoisted_5$10);
|
|
5562
|
-
}), 128))], 10, _hoisted_4$15))], 10, _hoisted_3$23)) : createCommentVNode("", true)
|
|
5563
|
-
], 10, _hoisted_1$36);
|
|
5611
|
+
"data-part": "label",
|
|
5612
|
+
class: normalizeClass(labelClass.value)
|
|
5613
|
+
}, toDisplayString(__props.label), 3),
|
|
5614
|
+
__props.help ? (openBlock(), createElementBlock("p", {
|
|
5615
|
+
key: 1,
|
|
5616
|
+
"data-part": "help",
|
|
5617
|
+
class: normalizeClass(helpClass.value)
|
|
5618
|
+
}, toDisplayString(__props.help), 3)) : createCommentVNode("", true)
|
|
5619
|
+
], 10, _hoisted_1$37);
|
|
5564
5620
|
};
|
|
5565
5621
|
}
|
|
5566
5622
|
});
|
|
5567
|
-
// src/
|
|
5568
|
-
var _hoisted_1$35 = ["data-eldra-scope"];
|
|
5569
|
-
var _hoisted_2$29 = ["data-eldra-slot"];
|
|
5570
|
-
var _hoisted_3$22 = ["data-eldra-slot", "id"];
|
|
5571
|
-
var _hoisted_4$14 = ["id"];
|
|
5572
|
-
var GROUP_INLINE = "eldra:grid eldra:min-w-0 eldra:flex-[1_1_14rem] eldra:content-start eldra:gap-1";
|
|
5573
|
-
var INLINE_ROW = "eldra:order-1 eldra:w-full eldra:basis-full";
|
|
5623
|
+
// src/icons/paths.ts
|
|
5574
5624
|
/**
|
|
5575
|
-
*
|
|
5576
|
-
*
|
|
5577
|
-
* `
|
|
5578
|
-
*
|
|
5579
|
-
*
|
|
5580
|
-
*
|
|
5625
|
+
* Inline SVG path data for a handful of Tabler icons this package draws directly rather than
|
|
5626
|
+
* depending on `@tabler/icons-vue` at runtime (the same decision `StockBadge.vue`'s own comment
|
|
5627
|
+
* records for `Button`'s spinner) — copied verbatim from `@tabler/icons-vue`'s "outline" 24x24
|
|
5628
|
+
* viewBox icons, MIT licensed. Each consumer keeps its own stroke width; only the path data (the
|
|
5629
|
+
* one thing that must stay byte-identical to read as the same icon) lives here, shared rather than
|
|
5630
|
+
* duplicated — `StockBadge`'s `low`/`error` icon and `EmptyState`'s own `error` default icon are
|
|
5631
|
+
* the same `alert-triangle` glyph.
|
|
5581
5632
|
*/
|
|
5582
|
-
var
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5633
|
+
var ALERT_TRIANGLE_PATHS = [
|
|
5634
|
+
"M12 9v4",
|
|
5635
|
+
"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0",
|
|
5636
|
+
"M12 16h.01"
|
|
5637
|
+
];
|
|
5638
|
+
/** `circle-check`: `Notice`'s `success` default (the same glyph `Toast` and `StockBadge` draw). */
|
|
5639
|
+
var CIRCLE_CHECK_PATHS = ["M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "M9 12l2 2l4 -4"];
|
|
5640
|
+
/** `info-circle`: `Notice`'s `info` default (the same glyph `Toast`'s `info` draws). */
|
|
5641
|
+
var INFO_CIRCLE_PATHS = [
|
|
5642
|
+
"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",
|
|
5643
|
+
"M12 9h.01",
|
|
5644
|
+
"M11 12h1v4h1"
|
|
5645
|
+
];
|
|
5646
|
+
/** `alert-circle`: `Notice`'s `danger` default (the same glyph `Toast`'s `danger` draws). */
|
|
5647
|
+
var ALERT_CIRCLE_PATHS = [
|
|
5648
|
+
"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",
|
|
5649
|
+
"M12 8v4",
|
|
5650
|
+
"M12 16h.01"
|
|
5651
|
+
];
|
|
5652
|
+
/** `check`: a completed step's mark in `StepIndicator`. */
|
|
5653
|
+
var CHECK_PATHS = ["M5 12l5 5l10 -10"];
|
|
5654
|
+
// src/components/empty-state/EmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
5655
|
+
var _hoisted_1$36 = ["data-eldra-scope", "role"];
|
|
5656
|
+
var _hoisted_2$30 = ["d"];
|
|
5657
|
+
var _hoisted_3$23 = ["data-eldra-slot"];
|
|
5658
|
+
var ICON_STROKE_WIDTH$4 = 1.5;
|
|
5659
|
+
// src/components/empty-state/EmptyState.vue
|
|
5660
|
+
var EmptyState_default = /* @__PURE__ */ defineComponent({
|
|
5661
|
+
__name: "EmptyState",
|
|
5662
|
+
props: {
|
|
5663
|
+
variant: { default: "empty" },
|
|
5664
|
+
icon: { default: void 0 },
|
|
5665
|
+
title: {},
|
|
5666
|
+
text: { default: null },
|
|
5667
|
+
plain: {
|
|
5602
5668
|
type: Boolean,
|
|
5603
5669
|
default: false
|
|
5604
5670
|
},
|
|
5605
|
-
|
|
5671
|
+
headingLevel: { default: 3 },
|
|
5672
|
+
retrying: {
|
|
5606
5673
|
type: Boolean,
|
|
5607
5674
|
default: false
|
|
5608
5675
|
},
|
|
5609
5676
|
classes: { default: void 0 }
|
|
5610
5677
|
},
|
|
5611
|
-
|
|
5678
|
+
emits: ["retry"],
|
|
5679
|
+
setup(__props, { emit: __emit }) {
|
|
5612
5680
|
const eldra = useEldraScope();
|
|
5613
5681
|
const props = __props;
|
|
5682
|
+
const emit = __emit;
|
|
5683
|
+
const messages = useMessages();
|
|
5614
5684
|
const slots = useSlots();
|
|
5615
|
-
const attrs = useAttrs();
|
|
5616
|
-
const forwardedAttrs = computed(() => {
|
|
5617
|
-
const { class: _class, ...rest } = attrs;
|
|
5618
|
-
return rest;
|
|
5619
|
-
});
|
|
5620
|
-
const m = useMessages();
|
|
5621
|
-
/**
|
|
5622
|
-
* The control's id (spec "Field wrapper" → Properties, `id`: "generated"). The wrapper owns it
|
|
5623
|
-
* because the wrapper owns the `<label for>`; a caller that needs a stable id for a
|
|
5624
|
-
* server-rendered form passes one and it is used verbatim.
|
|
5625
|
-
*
|
|
5626
|
-
* The label carries an id of its own too. Native controls are tied by `for`/`id`, but the spec's
|
|
5627
|
-
* Accessibility notes say "The custom select and multi-select triggers use `aria-labelledby`
|
|
5628
|
-
* pointing to the label", and a `<label for>` cannot name a `<button>` trigger — so the id that
|
|
5629
|
-
* makes that possible exists from the start rather than being retrofitted.
|
|
5630
|
-
*/
|
|
5631
|
-
const controlId = useUiId("field", () => props.id);
|
|
5632
|
-
const labelId = computed(() => `${controlId.value}-label`);
|
|
5633
|
-
const helpId = computed(() => `${controlId.value}-help`);
|
|
5634
|
-
const errorId = computed(() => `${controlId.value}-error`);
|
|
5635
|
-
const counterId = computed(() => `${controlId.value}-counter`);
|
|
5636
|
-
/** Slots are not reactive; see `useSlotPresence` for the defect this avoids. */
|
|
5637
|
-
const slotContent = useSlotPresence(slots, [
|
|
5638
|
-
"error",
|
|
5639
|
-
"help",
|
|
5640
|
-
"label"
|
|
5641
|
-
]);
|
|
5642
|
-
/**
|
|
5643
|
-
* A slot counts as content: `<template #error>` is a richer way of writing the `error` prop (a
|
|
5644
|
-
* message with a link in it, say), not a different feature, so it makes the field invalid and
|
|
5645
|
-
* gets linked exactly as the prop does.
|
|
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
5685
|
/**
|
|
5670
|
-
*
|
|
5671
|
-
*
|
|
5672
|
-
*
|
|
5673
|
-
*
|
|
5674
|
-
*
|
|
5686
|
+
* `icon` per variant when none is given (spec "Empty and error states" → Properties, `icon` row:
|
|
5687
|
+
* "per use", e.g. `shopping-bag`, `search`, `alert-triangle`, `heart"). These three are the
|
|
5688
|
+
* variant-neutral fallback — `search` for "nothing matched", `alert-triangle` for "something
|
|
5689
|
+
* failed" — Tabler outline path data (`IconInbox`/`IconSearch`/`IconAlertTriangle`, MIT licensed),
|
|
5690
|
+
* the same "copy the path data rather than depend on `@tabler/icons-vue` at runtime" decision
|
|
5691
|
+
* `StockBadge.vue` already documents. `error`'s `alert-triangle` path data is `src/icons/paths.ts`'s
|
|
5692
|
+
* `ALERT_TRIANGLE_PATHS`, shared with `StockBadge`'s own `low` icon rather than duplicated (M19).
|
|
5675
5693
|
*/
|
|
5676
|
-
const
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
provide(FIELD_KEY, context);
|
|
5694
|
+
const DEFAULT_ICON_PATHS = {
|
|
5695
|
+
empty: ["M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12", "M4 13h3l3 3h4l3 -3h3"],
|
|
5696
|
+
noResults: ["M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0", "M21 21l-6 -6"],
|
|
5697
|
+
error: ALERT_TRIANGLE_PATHS
|
|
5698
|
+
};
|
|
5699
|
+
/** Icon circle (spec → Sizes): 1.75rem icon, stroke 1.5 — not one of `Icon.vue`'s four sizes
|
|
5700
|
+
* (`sm`/`md`/`lg`/`xl` are 1/1.25/1.5/2rem) or its fixed 1.75 stroke, so, like `Badge`'s own
|
|
5701
|
+
* leading icon, it is drawn directly rather than through that shared component. */
|
|
5702
|
+
const present = useSlotPresence(slots, ["actions"]);
|
|
5686
5703
|
/**
|
|
5687
|
-
*
|
|
5688
|
-
*
|
|
5689
|
-
*
|
|
5704
|
+
* Roles (spec → Accessibility): `noResults` and `empty` are `role="status"` (announced politely);
|
|
5705
|
+
* `error` is `role="alert"` (announced assertively). `plain` does not change this — it only drops
|
|
5706
|
+
* the boundary, not the semantics.
|
|
5690
5707
|
*/
|
|
5691
|
-
const
|
|
5692
|
-
const
|
|
5708
|
+
const role = computed(() => props.variant === "error" ? "alert" : "status");
|
|
5709
|
+
const hasText = computed(() => Boolean(props.text));
|
|
5693
5710
|
/**
|
|
5694
|
-
*
|
|
5695
|
-
*
|
|
5696
|
-
*
|
|
5697
|
-
*
|
|
5698
|
-
*
|
|
5699
|
-
*
|
|
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.
|
|
5711
|
+
* The actions row shows whenever a caller supplies the `actions` slot, or — with none — whenever
|
|
5712
|
+
* `variant` is `error`: the built-in "Try again" button is the one case this component has a
|
|
5713
|
+
* generic next step of its own to offer (spec → Variants, "Error" row: "'Try again' button").
|
|
5714
|
+
* `empty`/`noResults` have no generic action to fall back to (the spec's own examples — "Shop
|
|
5715
|
+
* bestsellers", "Clear filters" — are all store-specific), so those variants render nothing here
|
|
5716
|
+
* until a caller supplies one.
|
|
5708
5717
|
*/
|
|
5709
|
-
const
|
|
5710
|
-
|
|
5711
|
-
const
|
|
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));
|
|
5718
|
+
const hasActions = computed(() => present.value.actions || props.variant === "error");
|
|
5719
|
+
const headingTag = useHeadingTag(() => props.headingLevel);
|
|
5720
|
+
const rootClass = computed(() => ["eldra:flex eldra:flex-col eldra:items-center eldra:justify-center eldra:gap-3 eldra:px-6 eldra:py-12 eldra:text-center", !props.plain && "eldra:rounded-lg eldra:border eldra:border-dashed eldra:border-border-strong eldra:bg-background"]);
|
|
5715
5721
|
/**
|
|
5716
|
-
*
|
|
5717
|
-
*
|
|
5718
|
-
*
|
|
5719
|
-
*
|
|
5720
|
-
*
|
|
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.
|
|
5722
|
+
* The icon circle (spec → Sizes): 3.5rem, `surface-strong` fill. Colour (spec → States): `text`
|
|
5723
|
+
* for `empty`/`noResults`, `danger` for `error` — "the icon turns `danger`" happens whichever icon
|
|
5724
|
+
* is showing, the built-in default or a caller's own `icon` prop, because both inherit
|
|
5725
|
+
* `currentColor` from this wrapper (spec → Accessibility, 1.4.1: the shape changes too, not only
|
|
5726
|
+
* the colour, for a caller using the built-in default).
|
|
5739
5727
|
*/
|
|
5740
|
-
const
|
|
5741
|
-
|
|
5742
|
-
"eldra:
|
|
5743
|
-
props.
|
|
5744
|
-
|
|
5745
|
-
|
|
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),
|
|
5751
|
+
"aria-hidden": "true"
|
|
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",
|
|
5761
|
+
viewBox: "0 0 24 24",
|
|
5762
|
+
fill: "none",
|
|
5763
|
+
stroke: "currentColor",
|
|
5764
|
+
"stroke-width": ICON_STROKE_WIDTH$4,
|
|
5765
|
+
"stroke-linecap": "round",
|
|
5766
|
+
"stroke-linejoin": "round",
|
|
5767
|
+
"aria-hidden": "true",
|
|
5768
|
+
focusable: "false"
|
|
5769
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(DEFAULT_ICON_PATHS[__props.variant], (d) => {
|
|
5770
|
+
return openBlock(), createElementBlock("path", {
|
|
5771
|
+
key: d,
|
|
5772
|
+
d
|
|
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)
|
|
5799
|
+
], 10, _hoisted_1$36);
|
|
5800
|
+
};
|
|
5801
|
+
}
|
|
5802
|
+
});
|
|
5803
|
+
// src/components/card/FeatureCard.vue?vue&type=script&setup=true&lang.ts
|
|
5804
|
+
var _hoisted_1$35 = ["data-eldra-scope"];
|
|
5805
|
+
var _hoisted_2$29 = ["data-eldra-slot"];
|
|
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",
|
|
5812
|
+
props: {
|
|
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 },
|
|
5821
|
+
classes: { default: void 0 }
|
|
5822
|
+
},
|
|
5823
|
+
setup(__props) {
|
|
5824
|
+
const eldra = useEldraScope();
|
|
5825
|
+
const props = __props;
|
|
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
|
});
|
|
@@ -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,7 +13424,7 @@ 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
13430
|
], 8, _hoisted_3$6));
|
|
@@ -16829,4 +16927,4 @@ var Tooltip_default = /* @__PURE__ */ defineComponent({
|
|
|
16829
16927
|
function mixToward(color, toward, percent) {
|
|
16830
16928
|
return `color-mix(in oklab, ${color}, ${toward} ${percent}%)`;
|
|
16831
16929
|
}
|
|
16832
|
-
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 };
|