@eldrajs/ui 0.3.6 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/LICENSE-country-flag-icons +25 -0
  3. package/README.md +380 -79
  4. package/dist/PhoneInput-CYGpERg4.js +749 -0
  5. package/dist/{VariantPicker-BB-2Cj32.js → VariantPicker-D_Gg80So.js} +163 -2307
  6. package/dist/componentNames.d.ts +1 -1
  7. package/dist/components/badge/StockBadge.vue.d.ts +1 -1
  8. package/dist/components/chip/Chip.vue.d.ts +10 -0
  9. package/dist/components/dialog/Dialog.vue.d.ts +10 -0
  10. package/dist/components/drawer/Drawer.vue.d.ts +10 -0
  11. package/dist/components/filter-panel/FilterGroup.vue.d.ts +10 -0
  12. package/dist/components/filter-panel/FilterPanel.vue.d.ts +10 -0
  13. package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +10 -0
  14. package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +10 -0
  15. package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +10 -0
  16. package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +10 -0
  17. package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +10 -0
  18. package/dist/components/lightbox/Lightbox.vue.d.ts +10 -0
  19. package/dist/components/nav-menu/NavMenu.vue.d.ts +10 -0
  20. package/dist/components/notice/Notice.vue.d.ts +28 -0
  21. package/dist/components/notice/types.d.ts +38 -0
  22. package/dist/components/pagination/Pagination.vue.d.ts +10 -0
  23. package/dist/components/price/Price.vue.d.ts +1 -1
  24. package/dist/components/product-card/ProductCard.vue.d.ts +1 -1
  25. package/dist/components/radio/RadioGroup.vue.d.ts +4 -0
  26. package/dist/components/radio/recipes.d.ts +4 -2
  27. package/dist/components/radio/types.d.ts +8 -1
  28. package/dist/components/range-slider/RangeSlider.vue.d.ts +10 -0
  29. package/dist/components/search-bar/SearchBar.vue.d.ts +10 -0
  30. package/dist/components/search-modal/SearchModal.vue.d.ts +10 -0
  31. package/dist/components/select/MultiSelect.vue.d.ts +10 -0
  32. package/dist/components/select/Select.vue.d.ts +10 -0
  33. package/dist/components/site-form/SiteForm.vue.d.ts +10 -0
  34. package/dist/components/spinner/Spinner.vue.d.ts +4 -1
  35. package/dist/components/spinner/types.d.ts +9 -0
  36. package/dist/components/step-indicator/StepIndicator.vue.d.ts +7 -0
  37. package/dist/components/step-indicator/types.d.ts +30 -0
  38. package/dist/components/toast/Toast.vue.d.ts +10 -0
  39. package/dist/components/toast/Toaster.vue.d.ts +10 -0
  40. package/dist/components.css +153 -0
  41. package/dist/icons/paths.d.ts +8 -0
  42. package/dist/index.d.ts +6 -0
  43. package/dist/index.js +621 -302
  44. package/dist/messages/en-US.d.ts +27 -0
  45. package/dist/messages/is-IS.js +11 -1
  46. package/dist/phone/PhoneFlag.vue.d.ts +6 -0
  47. package/dist/phone/PhoneInput.vue.d.ts +220 -0
  48. package/dist/phone/caret.d.ts +14 -0
  49. package/dist/phone/examples.d.ts +2 -0
  50. package/dist/phone/flags.d.ts +8 -0
  51. package/dist/phone/index.d.ts +13 -0
  52. package/dist/phone/phone.d.ts +62 -0
  53. package/dist/phone/phoneFlagData.d.ts +2 -0
  54. package/dist/phone/rule.d.ts +22 -0
  55. package/dist/phone/types.d.ts +63 -0
  56. package/dist/phone/vee-validate/FieldPhoneInput.vue.d.ts +24 -0
  57. package/dist/phone/vee-validate/index.d.ts +3 -0
  58. package/dist/phone/vee-validate/types.d.ts +3 -0
  59. package/dist/phone/vee-validate.js +96 -0
  60. package/dist/phone.js +1 -0
  61. package/dist/phoneFlagData-D9dDT2uC.js +261 -0
  62. package/dist/resolver.d.ts +9 -2
  63. package/dist/resolver.js +18 -4
  64. package/dist/style.css +153 -0
  65. package/dist/useFieldControl-D_b9SC9s.js +273 -0
  66. package/dist/{useMessages-B5nzZghs.js → useMessages-DQQPh1P_.js} +28 -1
  67. package/dist/usePopover-4CQR2hB5.js +2228 -0
  68. package/dist/utilities.css +37 -0
  69. package/dist/vee-validate/FieldCheckbox.vue.d.ts +5 -1
  70. package/dist/vee-validate/FieldCheckboxGroup.vue.d.ts +5 -1
  71. package/dist/vee-validate/FieldCurrencyInput.vue.d.ts +5 -1
  72. package/dist/vee-validate/FieldInput.vue.d.ts +5 -1
  73. package/dist/vee-validate/FieldMultiSelect.vue.d.ts +5 -1
  74. package/dist/vee-validate/FieldQuantityStepper.vue.d.ts +5 -1
  75. package/dist/vee-validate/FieldRadioGroup.vue.d.ts +5 -1
  76. package/dist/vee-validate/FieldSearchBar.vue.d.ts +5 -1
  77. package/dist/vee-validate/FieldSelect.vue.d.ts +5 -1
  78. package/dist/vee-validate/FieldSwitch.vue.d.ts +5 -1
  79. package/dist/vee-validate/FieldTextarea.vue.d.ts +5 -1
  80. package/dist/vee-validate/FieldUnitInput.vue.d.ts +5 -1
  81. package/dist/vee-validate/FieldVariantPicker.vue.d.ts +5 -1
  82. package/dist/vee-validate/context.d.ts +32 -7
  83. package/dist/vee-validate/index.d.ts +8 -5
  84. package/dist/vee-validate/types.d.ts +26 -0
  85. package/dist/vee-validate/useFieldControl.d.ts +59 -10
  86. package/dist/vee-validate.js +114 -197
  87. package/dist/vue-i18n.js +4 -1
  88. package/package.json +20 -3
@@ -1,317 +1,7 @@
1
- import { r as useMessages } from "./useMessages-B5nzZghs.js";
2
- import { Comment, Fragment, Teleport, Text, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, h, inject, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onBeforeUpdate, onMounted, onScopeDispose, onUpdated, openBlock, provide, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toHandlers, toValue, unref, useAttrs, useId, useSlots, watch, watchPostEffect, withCtx, withModifiers } from "vue";
3
- import { extendTailwindMerge } from "tailwind-merge";
1
+ import { $ as useEldraScope, A as FIELD_SEARCH_APPEARANCE, D as FIELD_PREFIX_PAD, E as FIELD_LIVE, F as FIELD_TRAILING_PAD, G as FIELD_KEY, I as FIELD_TRAILING_PAD_PAIR, J as ICON_STROKE_WIDTH$1, K as Spinner_default, L as fieldState, M as FIELD_SUFFIX_ROW, N as FIELD_SUFFIX_ROW_BASE, O as FIELD_PREFIX_ROW, P as FIELD_TEXT, S as FIELD_CLEAR_SIZE, W as useEldraUiLocale, X as useControllableModel, Y as mergeClass, _ as FIELD_ACTION_ROOM_REM, b as FIELD_CLEAR_BUTTON, c as useOptionList, d as SelectPanel_default, et as joinIds, f as TRIGGER_VALUE_CELL, g as FIELD_ACTION_PAIR_SIZE, h as optionSwatchClass, j as FIELD_SIZE, k as FIELD_RADIUS, m as optionIconClass, p as TRIGGER_VALUE_STACK, q as ICON_SIZE_CLASS, s as matchRange, t as usePopover, tt as useUiId, u as useListbox, v as FIELD_BASE, w as FIELD_LEADING_ICON, x as FIELD_CLEAR_BUTTON_BOX, y as FIELD_BOX } from "./usePopover-4CQR2hB5.js";
2
+ import { r as useMessages } from "./useMessages-DQQPh1P_.js";
3
+ import { Comment, Fragment, Teleport, Text, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, h, inject, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onBeforeUpdate, onMounted, onUpdated, openBlock, provide, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toHandlers, toValue, unref, useAttrs, useSlots, watch, watchPostEffect, withCtx, withModifiers } from "vue";
4
4
  import { numberFormat } from "@eldrajs/sdk/format";
5
- import { autoUpdate, flip, offset, shift, size, useFloating } from "@floating-ui/vue";
6
- // src/utils/id.ts
7
- /**
8
- * A stable, SSR-safe id for a component part, or the caller's own id when it
9
- * gave one.
10
- *
11
- * Built on Vue's `useId()` (Vue 3.5+), so the server and the client produce the
12
- * same value and `aria-describedby`/`for` wiring does not break on hydration.
13
- * Must be called during `setup()`, like every other Vue composable.
14
- */
15
- function useUiId(prefix, explicit) {
16
- const generated = useId();
17
- return computed(() => toValue(explicit) ?? `eldra-${prefix}-${generated}`);
18
- }
19
- /**
20
- * Compose an `aria-describedby` (or `aria-labelledby`) value from ids that may
21
- * be absent.
22
- *
23
- * One rule, everywhere in this package: **a control's own ids come first, then
24
- * whatever the field context adds.** `aria-describedby` is read in document
25
- * order of the listed ids, so the control's own error, counter or description is
26
- * what a screen reader hears first, and the wrapper's help text follows. Nothing
27
- * ever *replaces* the context — a `describedBy` prop adds to it, so
28
- * `<FieldWrapper error="…"><Input described-by="x"/></FieldWrapper>` still
29
- * describes the error.
30
- *
31
- * Duplicates are dropped (the same id listed twice is announced twice), and an
32
- * empty result is `undefined` rather than `""`, so the attribute is omitted
33
- * instead of rendered empty.
34
- *
35
- * **Deduplication is per id, not per argument.** Every argument here is itself an
36
- * `aria-describedby` value, so it may already hold several space-separated ids —
37
- * a `FieldWrapper`'s context contributes its error, help and counter ids as one
38
- * string, and a consumer's `describedBy` prop may do the same. Comparing whole
39
- * arguments would only have caught the case where two of them were byte-identical,
40
- * and `joinIds('a b', 'b c')` would have announced `b` twice. Each argument is
41
- * split on whitespace and the ids are deduplicated individually, first occurrence
42
- * winning, so the order the rule promises is preserved.
43
- */
44
- function joinIds(...ids) {
45
- const seen = /* @__PURE__ */ new Set();
46
- for (const value of ids) {
47
- if (typeof value !== "string") continue;
48
- for (const id of value.split(/\s+/)) if (id.length > 0) seen.add(id);
49
- }
50
- return seen.size > 0 ? [...seen].join(" ") : void 0;
51
- }
52
- // src/composables/useEldraScope.ts
53
- /** The injection key `provideEldraScope` provides under. */
54
- var ELDRA_SCOPE_KEY = Symbol("eldra-scope");
55
- /**
56
- * Names a theming scope for every component of this package rendered below the caller (see the
57
- * README, "Theming a subtree"). Call it in `setup()` of a wrapper or an app root.
58
- *
59
- * Each component then renders `data-eldra-scope="<name>"` on its root and on every part it
60
- * teleports (panels, dialogs, toasts). The name is free; the consumer's own variable overrides
61
- * target it (`[data-eldra-scope='studio'] { --eldra-color-primary: … }`). Without a provider the
62
- * attribute is not rendered, so the output is unchanged.
63
- */
64
- function provideEldraScope(name = "default") {
65
- provide(ELDRA_SCOPE_KEY, name || "default");
66
- }
67
- /**
68
- * Internal: the theming hooks a component of this package binds. `scope` goes on every root,
69
- * teleported root and kit-owned element sitting directly in a slot host, so a scope's variables
70
- * reach it; it is `undefined` without a provider. `slotHost(...names)` is `data-eldra-slot`, on
71
- * the element holding those slots, a hook for consumer CSS. It renders whenever one of the slots
72
- * has content, provider or not, and never for a fallback, which is the kit's own markup.
73
- */
74
- function useEldraScope() {
75
- const scope = inject(ELDRA_SCOPE_KEY, void 0);
76
- const slots = useSlots();
77
- return {
78
- scope,
79
- slotHost: (...names) => names.some((name) => slots[name] !== void 0) ? "" : void 0
80
- };
81
- }
82
- // src/composables/useControllableModel.ts
83
- /**
84
- * A model that works both ways round: controlled when the parent passes
85
- * `modelValue`, self-managing when it does not.
86
- *
87
- * Every stateful component in this package uses it, so a consumer can drop a
88
- * `Select` in with no `v-model` and still get a working control, while a
89
- * consumer that does bind `v-model` stays the single source of truth — writes
90
- * are emitted and never applied locally, so a parent that refuses a value
91
- * actually refuses it.
92
- *
93
- * `fallback` supplies the uncontrolled starting value and is called once.
94
- */
95
- function useControllableModel(props, emit, fallback) {
96
- const internal = ref(props.modelValue === void 0 ? fallback() : props.modelValue);
97
- watch(() => props.modelValue, (value) => {
98
- if (value !== void 0) internal.value = value;
99
- });
100
- return computed({
101
- get: () => props.modelValue === void 0 ? internal.value : props.modelValue,
102
- set: (value) => {
103
- if (props.modelValue === void 0) internal.value = value;
104
- emit("update:modelValue", value);
105
- }
106
- });
107
- }
108
- var kitMerge = extendTailwindMerge({
109
- extend: {
110
- theme: {
111
- shadow: ["float"],
112
- container: [
113
- "narrow",
114
- "content",
115
- "wide",
116
- "tablet",
117
- "two-col"
118
- ]
119
- },
120
- classGroups: {
121
- "font-size": [{ text: [
122
- "display",
123
- "h1",
124
- "h2",
125
- "h3",
126
- "h4",
127
- "body-lg",
128
- "body",
129
- "body-sm",
130
- "caption",
131
- "overline",
132
- "label",
133
- "code",
134
- "button-sm",
135
- "button-md",
136
- "button-lg",
137
- "control-sm",
138
- "control",
139
- "control-lg",
140
- "control-mobile",
141
- "counter",
142
- "field-note",
143
- "card-title",
144
- "switch-label",
145
- "switch-description",
146
- "select-group",
147
- "select-option",
148
- "select-pill",
149
- "stepper-value",
150
- "stepper-value-sm",
151
- "search-meta",
152
- "search-title",
153
- "search-kbd",
154
- "variant-legend",
155
- "variant-pill",
156
- "logo-wordmark",
157
- "badge",
158
- "stock-status",
159
- "price-sm",
160
- "price-lg",
161
- "price-current",
162
- "price-secondary",
163
- "price-unit",
164
- "avatar-initials-sm",
165
- "avatar-initials-md",
166
- "avatar-initials-lg",
167
- "avatar-initials-xl",
168
- "empty-state-title",
169
- "filter-trigger",
170
- "filter-subheading",
171
- "filter-tile-count",
172
- "content-card-title",
173
- "content-card-excerpt",
174
- "dialog-title",
175
- "accordion-title",
176
- "drawer-title",
177
- "tooltip",
178
- "toast-title",
179
- "search-modal-field",
180
- "search-modal-foot",
181
- "search-modal-kbd"
182
- ] }],
183
- h: [
184
- "control-h",
185
- "control-h-sm",
186
- "control-h-lg",
187
- "eldra-range-track",
188
- "eldra-skeleton-title",
189
- "eldra-skeleton-box"
190
- ],
191
- "min-h": [
192
- "eldra-range-rail",
193
- "eldra-drawer-header-height",
194
- "eldra-nav-menu-drawer-row"
195
- ],
196
- px: [
197
- "eldra-range-gutter",
198
- "eldra-range-gutter-thumb",
199
- "eldra-drawer-gutter"
200
- ],
201
- w: [
202
- "eldra-dialog-width",
203
- "eldra-dialog-width-sm",
204
- "eldra-drawer-width",
205
- "eldra-toast-width",
206
- "eldra-search-modal-width"
207
- ],
208
- size: [
209
- "eldra-avatar-icon-sm",
210
- "eldra-avatar-icon-md",
211
- "eldra-avatar-icon-lg",
212
- "eldra-avatar-icon-xl"
213
- ],
214
- "target-min": ["target-min"],
215
- "target-touch": ["target-touch"],
216
- "eldra-scrollbar-hide": ["eldra-scrollbar-hide"],
217
- transition: ["eldra-transition-colors"],
218
- "border-w": [
219
- "eldra-field-border",
220
- "eldra-button-border",
221
- "eldra-checkbox-border",
222
- "eldra-checkbox-border-invalid",
223
- "eldra-radio-card-border",
224
- "eldra-switch-track-border",
225
- "eldra-variant-pill-border",
226
- "eldra-variant-swatch-ring",
227
- "eldra-variant-swatch-edge",
228
- "eldra-filter-swatch-ring",
229
- "eldra-editor-placeholder-border"
230
- ],
231
- "eldra-field-invalid": ["eldra-field-invalid"],
232
- "eldra-radio-card-selected": ["eldra-radio-card-selected"],
233
- "eldra-switch-thumb-offset": ["eldra-switch-thumb-offset"],
234
- "eldra-dialog-fullscreen": ["eldra-dialog-fullscreen"],
235
- "eldra-drawer-motion": ["eldra-drawer-motion"],
236
- "eldra-drawer-sheet": ["eldra-drawer-sheet"],
237
- "max-h": [
238
- "eldra-select-panel-height",
239
- "eldra-search-panel-height",
240
- "eldra-dialog-max-height",
241
- "eldra-search-modal-max-height",
242
- "eldra-drawer-sheet-height"
243
- ],
244
- m: ["eldra-search-modal-position"],
245
- "max-w": [
246
- "eldra-select-panel-width",
247
- "eldra-container-narrow",
248
- "eldra-container-content",
249
- "eldra-container-wide"
250
- ],
251
- "eldra-select-match": ["eldra-select-match"],
252
- "eldra-select-swatch": ["eldra-select-swatch"],
253
- "eldra-select-option-active": ["eldra-select-option-active"],
254
- "eldra-select-option-selected": ["eldra-select-option-selected"],
255
- "eldra-variant-pill-selected-line": ["eldra-variant-pill-selected-line"],
256
- "eldra-focus": ["eldra-focus", "eldra-focus-inset"],
257
- "eldra-focus-always": ["eldra-focus-always", "eldra-focus-inset-always"],
258
- "eldra-focus-proxy": ["eldra-focus-proxy"],
259
- "eldra-focus-open": ["eldra-focus-open"],
260
- rounded: ["eldra-link-radius", "eldra-select-check-radius"],
261
- duration: [
262
- "duration-fast",
263
- "duration-base",
264
- "duration-slow"
265
- ],
266
- opacity: ["eldra-revalidating"],
267
- "eldra-skeleton": ["eldra-skeleton"],
268
- "eldra-skeleton-text": ["eldra-skeleton-text"],
269
- "eldra-rating-half": ["eldra-rating-half"],
270
- "eldra-image-placeholder-hatch": ["eldra-image-placeholder-hatch"],
271
- "eldra-tooltip-arrow": ["eldra-tooltip-arrow"],
272
- z: [
273
- "z-sticky",
274
- "z-popover",
275
- "z-drawer",
276
- "z-dialog",
277
- "z-toast"
278
- ],
279
- "eldra-accordion-chevron": ["eldra-accordion-chevron"],
280
- "eldra-accordion-panel": ["eldra-accordion-panel"],
281
- "eldra-carousel-slide": ["eldra-carousel-slide"],
282
- "eldra-carousel-track": ["eldra-carousel-track"],
283
- "eldra-carousel-dot": ["eldra-carousel-dot"],
284
- "eldra-range-thumb": ["eldra-range-thumb"],
285
- "eldra-filter-swatch-edge": ["eldra-filter-swatch-edge"],
286
- "eldra-filter-histogram-bar": ["eldra-filter-histogram-bar"],
287
- pt: ["eldra-nav-menu-panel", "eldra-drawer-header-top"],
288
- "grid-cols": ["eldra-nav-menu-columns"],
289
- "eldra-nav-menu-dropdown": ["eldra-nav-menu-dropdown"],
290
- ps: ["eldra-nav-menu-drawer-nest"],
291
- pb: [
292
- "eldra-drawer-header-bottom",
293
- "eldra-drawer-body-bottom",
294
- "eldra-drawer-footer-bottom"
295
- ],
296
- animate: [
297
- "animate-eldra-spin",
298
- "animate-eldra-pulse",
299
- "animate-eldra-popover-in",
300
- "animate-eldra-dialog-in",
301
- "animate-eldra-dialog-in-reduced",
302
- "animate-eldra-drawer-in-right",
303
- "animate-eldra-drawer-in-left",
304
- "animate-eldra-toast-in",
305
- "animate-eldra-lightbox-in"
306
- ]
307
- }
308
- },
309
- prefix: "eldra"
310
- });
311
- /** The component's own classes with `incoming` (a parent component's) merged over them. */
312
- function mergeClass(own, incoming) {
313
- return kitMerge(normalizeClass([own, incoming]));
314
- }
315
5
  // src/components/form-layout/context.ts
316
6
  /**
317
7
  * Whether the form this subtree belongs to is currently submitting.
@@ -345,20 +35,6 @@ var FORM_SUBMITTING_KEY = Symbol("eldra-form-submitting");
345
35
  * ```
346
36
  */
347
37
  var FORM_LAYOUT_KEY = Symbol("eldra-form-layout");
348
- // src/components/icon/sizes.ts
349
- /**
350
- * The spec's sizes as Tailwind utilities. The theme's `--spacing` is 0.25rem,
351
- * so `size-4`/`size-5`/`size-6`/`size-8` are exactly 1/1.25/1.5/2rem — no
352
- * literal length appears here or in the built CSS.
353
- */
354
- var ICON_SIZE_CLASS = {
355
- sm: "eldra:size-4",
356
- md: "eldra:size-5",
357
- lg: "eldra:size-6",
358
- xl: "eldra:size-8"
359
- };
360
- /** The spec's outline stroke weight. */
361
- var ICON_STROKE_WIDTH = 1.75;
362
38
  // src/components/icon/Icon.vue
363
39
  var Icon_default = /* @__PURE__ */ defineComponent({
364
40
  __name: "Icon",
@@ -377,7 +53,7 @@ var Icon_default = /* @__PURE__ */ defineComponent({
377
53
  "data-eldra-scope": unref(eldra).scope,
378
54
  "data-part": "root",
379
55
  class: normalizeClass(rootClass.value),
380
- "stroke-width": unref(ICON_STROKE_WIDTH),
56
+ "stroke-width": unref(ICON_STROKE_WIDTH$1),
381
57
  "aria-hidden": __props.label === void 0 ? "true" : void 0,
382
58
  role: __props.label === void 0 ? void 0 : "img",
383
59
  "aria-label": __props.label,
@@ -393,42 +69,10 @@ var Icon_default = /* @__PURE__ */ defineComponent({
393
69
  };
394
70
  }
395
71
  });
396
- // src/components/spinner/Spinner.vue?vue&type=script&setup=true&lang.ts
397
- var _hoisted_1$19 = ["data-eldra-scope"];
398
- // src/components/spinner/Spinner.vue
399
- var Spinner_default = /* @__PURE__ */ defineComponent({
400
- __name: "Spinner",
401
- setup(__props) {
402
- const eldra = useEldraScope();
403
- return (_ctx, _cache) => {
404
- return openBlock(), createElementBlock("svg", {
405
- "data-eldra-ui": "",
406
- "data-eldra-scope": unref(eldra).scope,
407
- class: "eldra:animate-eldra-spin eldra:motion-reduce:animate-eldra-pulse",
408
- viewBox: "0 0 18 18",
409
- fill: "none",
410
- "aria-hidden": "true",
411
- focusable: "false"
412
- }, [..._cache[0] || (_cache[0] = [createElementVNode("circle", {
413
- cx: "9",
414
- cy: "9",
415
- r: "8",
416
- stroke: "currentColor",
417
- "stroke-width": "2",
418
- "stroke-opacity": "0.3"
419
- }, null, -1), createElementVNode("path", {
420
- d: "M17 9a8 8 0 0 0-8-8",
421
- stroke: "currentColor",
422
- "stroke-width": "2",
423
- "stroke-linecap": "round"
424
- }, null, -1)])], 8, _hoisted_1$19);
425
- };
426
- }
427
- });
428
72
  // src/components/button/Button.vue?vue&type=script&setup=true&lang.ts
429
- var _hoisted_1$18 = ["data-eldra-slot"];
430
- var _hoisted_2$16 = ["data-eldra-slot"];
431
- var _hoisted_3$15 = ["data-eldra-slot"];
73
+ var _hoisted_1$17 = ["data-eldra-slot"];
74
+ var _hoisted_2$15 = ["data-eldra-slot"];
75
+ var _hoisted_3$14 = ["data-eldra-slot"];
432
76
  var BASE$1 = "eldra:relative eldra:inline-flex eldra:items-center eldra:justify-center eldra:rounded-[var(--eldra-button-radius,var(--eldra-radius-md))] eldra:eldra-focus";
433
77
  /** The border (`--eldra-button-border-width`, default 1px, see `eldra-button-border`) and no
434
78
  * underline, except `link`, which is a borderless underlined line box. */
@@ -752,9 +396,10 @@ var Button_default = /* @__PURE__ */ defineComponent({
752
396
  * the container's own `gap`, so the icon sits exactly as `iconLeft` would.
753
397
  */
754
398
  function labelClass() {
399
+ const rich = slots.default !== void 0 && hasElements(slots.default());
755
400
  return mergeClass([
756
401
  "eldra:whitespace-nowrap",
757
- slots.default !== void 0 && hasElements(slots.default()) && "eldra:inline-flex eldra:items-center eldra:gap-[inherit]",
402
+ rich && "eldra:inline-flex eldra:items-center eldra:gap-[inherit]",
758
403
  labelHiddenWhileLoading.value
759
404
  ], props.classes?.label);
760
405
  }
@@ -842,13 +487,13 @@ var Button_default = /* @__PURE__ */ defineComponent({
842
487
  }, [renderSlot(_ctx.$slots, "leadingIcon", {}, () => [leadingIcon.value ? (openBlock(), createBlock(Icon_default, {
843
488
  key: 0,
844
489
  icon: leadingIcon.value
845
- }, null, 8, ["icon"])) : createCommentVNode("", true)])], 10, _hoisted_1$18)) : createCommentVNode("", true),
490
+ }, null, 8, ["icon"])) : createCommentVNode("", true)])], 10, _hoisted_1$17)) : createCommentVNode("", true),
846
491
  !__props.iconOnly ? (openBlock(), createElementBlock("span", {
847
492
  key: 2,
848
493
  "data-eldra-slot": unref(eldra).slotHost("default"),
849
494
  "data-part": "label",
850
495
  class: normalizeClass(labelClass())
851
- }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 10, _hoisted_2$16)) : createCommentVNode("", true),
496
+ }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 10, _hoisted_2$15)) : createCommentVNode("", true),
852
497
  hasTrailing.value ? (openBlock(), createElementBlock("span", {
853
498
  key: 3,
854
499
  "data-eldra-slot": unref(eldra).slotHost("trailingIcon"),
@@ -857,7 +502,7 @@ var Button_default = /* @__PURE__ */ defineComponent({
857
502
  }, [renderSlot(_ctx.$slots, "trailingIcon", {}, () => [__props.iconRight ? (openBlock(), createBlock(Icon_default, {
858
503
  key: 0,
859
504
  icon: __props.iconRight
860
- }, null, 8, ["icon"])) : createCommentVNode("", true)])], 10, _hoisted_3$15)) : createCommentVNode("", true),
505
+ }, null, 8, ["icon"])) : createCommentVNode("", true)])], 10, _hoisted_3$14)) : createCommentVNode("", true),
861
506
  isLoading.value && isOverlaySpinner.value ? (openBlock(), createElementBlock("span", {
862
507
  key: 4,
863
508
  "data-part": "spinner",
@@ -879,12 +524,9 @@ var Button_default = /* @__PURE__ */ defineComponent({
879
524
  };
880
525
  }
881
526
  });
882
- // src/components/field-wrapper/context.ts
883
- /** The key a `FieldWrapper` provides its `FieldContext` on. */
884
- var FIELD_KEY = Symbol("eldra-ui:field");
885
527
  // src/components/field-wrapper/FieldError.vue?vue&type=script&setup=true&lang.ts
886
- var _hoisted_1$17 = ["id", "data-eldra-scope"];
887
- var _hoisted_2$15 = ["data-eldra-slot"];
528
+ var _hoisted_1$16 = ["id", "data-eldra-scope"];
529
+ var _hoisted_2$14 = ["data-eldra-slot"];
888
530
  // src/components/field-wrapper/FieldError.vue
889
531
  var FieldError_default = /* @__PURE__ */ defineComponent({
890
532
  __name: "FieldError",
@@ -941,12 +583,12 @@ var FieldError_default = /* @__PURE__ */ defineComponent({
941
583
  createElementVNode("path", { d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" }, null, -1),
942
584
  createElementVNode("path", { d: "M12 8v4" }, null, -1),
943
585
  createElementVNode("path", { d: "M12 16h.01" }, null, -1)
944
- ])], 2)), createElementVNode("span", { "data-eldra-slot": unref(eldra).slotHost("default") }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_2$15)], 10, _hoisted_1$17);
586
+ ])], 2)), createElementVNode("span", { "data-eldra-slot": unref(eldra).slotHost("default") }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_2$14)], 10, _hoisted_1$16);
945
587
  };
946
588
  }
947
589
  });
948
590
  // src/components/field-wrapper/RequiredMark.vue?vue&type=script&setup=true&lang.ts
949
- var _hoisted_1$16 = ["data-eldra-scope"];
591
+ var _hoisted_1$15 = ["data-eldra-scope"];
950
592
  // src/components/field-wrapper/RequiredMark.vue
951
593
  var RequiredMark_default = /* @__PURE__ */ defineComponent({
952
594
  __name: "RequiredMark",
@@ -970,7 +612,7 @@ var RequiredMark_default = /* @__PURE__ */ defineComponent({
970
612
  "data-part": "requiredMark",
971
613
  class: normalizeClass(markClass.value),
972
614
  "aria-hidden": "true"
973
- }, "*", 10, _hoisted_1$16);
615
+ }, "*", 10, _hoisted_1$15);
974
616
  };
975
617
  }
976
618
  });
@@ -1013,7 +655,7 @@ var VisuallyHidden_default = /* @__PURE__ */ defineComponent({
1013
655
  }
1014
656
  });
1015
657
  // src/components/checkbox/Checkbox.vue?vue&type=script&setup=true&lang.ts
1016
- var _hoisted_1$15 = [
658
+ var _hoisted_1$14 = [
1017
659
  "id",
1018
660
  "name",
1019
661
  "value",
@@ -1025,18 +667,18 @@ var _hoisted_1$15 = [
1025
667
  "aria-controls",
1026
668
  "aria-checked"
1027
669
  ];
1028
- var _hoisted_2$14 = {
670
+ var _hoisted_2$13 = {
1029
671
  key: 0,
1030
672
  "data-mark": "dash",
1031
673
  d: "M1 5h8"
1032
674
  };
1033
- var _hoisted_3$14 = {
675
+ var _hoisted_3$13 = {
1034
676
  key: 1,
1035
677
  "data-mark": "tick",
1036
678
  d: "M1.25 5l2.5 2.5l5 -5"
1037
679
  };
1038
- var _hoisted_4$13 = ["data-eldra-slot"];
1039
- var _hoisted_5$11 = ["data-eldra-slot"];
680
+ var _hoisted_4$12 = ["data-eldra-slot"];
681
+ var _hoisted_5$10 = ["data-eldra-slot"];
1040
682
  var ROOT$3 = "eldra:group eldra:grid eldra:max-w-full eldra:gap-y-0.5 eldra:target-min";
1041
683
  var ROOT_COLUMNS = "eldra:grid-cols-[auto_1fr] eldra:gap-x-2.5";
1042
684
  var ROOT_INLINE = "eldra:w-fit eldra:items-start";
@@ -1337,7 +979,7 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
1337
979
  "aria-controls": __props.controls,
1338
980
  "aria-checked": __props.indeterminate ? "mixed" : void 0,
1339
981
  onChange
1340
- }), null, 16, _hoisted_1$15), (openBlock(), createElementBlock("svg", {
982
+ }), null, 16, _hoisted_1$14), (openBlock(), createElementBlock("svg", {
1341
983
  "data-part": "check",
1342
984
  class: normalizeClass(checkClass.value),
1343
985
  viewBox: "0 0 10 10",
@@ -1348,7 +990,7 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
1348
990
  "stroke-linejoin": "round",
1349
991
  "aria-hidden": "true",
1350
992
  focusable: "false"
1351
- }, [__props.indeterminate ? (openBlock(), createElementBlock("path", _hoisted_2$14)) : (openBlock(), createElementBlock("path", _hoisted_3$14))], 2))], 2),
993
+ }, [__props.indeterminate ? (openBlock(), createElementBlock("path", _hoisted_2$13)) : (openBlock(), createElementBlock("path", _hoisted_3$13))], 2))], 2),
1352
994
  isLabelled() ? (openBlock(), createElementBlock("span", {
1353
995
  key: 0,
1354
996
  "data-eldra-slot": unref(eldra).slotHost("default"),
@@ -1364,13 +1006,13 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
1364
1006
  default: withCtx(() => [createTextVNode(toDisplayString(unref(m).required), 1)]),
1365
1007
  _: 1
1366
1008
  })) : createCommentVNode("", true)
1367
- ], 10, _hoisted_4$13)) : createCommentVNode("", true),
1009
+ ], 10, _hoisted_4$12)) : createCommentVNode("", true),
1368
1010
  hasHint.value ? (openBlock(), createElementBlock("span", {
1369
1011
  key: 1,
1370
1012
  "data-eldra-slot": unref(eldra).slotHost("hint"),
1371
1013
  "data-part": "hint",
1372
1014
  class: normalizeClass(hintClass.value)
1373
- }, [renderSlot(_ctx.$slots, "hint", {}, () => [createTextVNode(toDisplayString(__props.hint), 1)])], 10, _hoisted_5$11)) : createCommentVNode("", true)
1015
+ }, [renderSlot(_ctx.$slots, "hint", {}, () => [createTextVNode(toDisplayString(__props.hint), 1)])], 10, _hoisted_5$10)) : createCommentVNode("", true)
1374
1016
  ]),
1375
1017
  _: 3
1376
1018
  }, 8, ["data-eldra-scope", "class"]))]),
@@ -1380,7 +1022,7 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
1380
1022
  }
1381
1023
  });
1382
1024
  // src/components/checkbox/CheckboxGroup.vue?vue&type=script&setup=true&lang.ts
1383
- var _hoisted_1$14 = [
1025
+ var _hoisted_1$13 = [
1384
1026
  "data-eldra-scope",
1385
1027
  "aria-describedby",
1386
1028
  "aria-invalid"
@@ -1484,7 +1126,7 @@ var CheckboxGroup_default = /* @__PURE__ */ defineComponent({
1484
1126
  default: withCtx(() => [createTextVNode(toDisplayString(__props.error), 1)]),
1485
1127
  _: 1
1486
1128
  }, 8, ["id", "classes"])) : createCommentVNode("", true)
1487
- ], 8, _hoisted_1$14);
1129
+ ], 8, _hoisted_1$13);
1488
1130
  };
1489
1131
  }
1490
1132
  });
@@ -1511,107 +1153,6 @@ var TAG_SHAPE = "eldra:inline-flex eldra:min-h-7 eldra:items-center eldra:gap-1
1511
1153
  function tagPadding(hasRemoveButton) {
1512
1154
  return hasRemoveButton ? "eldra:ps-2.5 eldra:pe-0.5" : "eldra:px-2.5";
1513
1155
  }
1514
- // src/composables/useLocale.ts
1515
- /**
1516
- * The number locale the components format with, as a provide/inject pair — the same shape as
1517
- * `useMessages`, and deliberately separate from it: the *strings* a component renders and the
1518
- * *locale its numbers are formatted in* are two different decisions, and a store that accepts the
1519
- * English defaults may still be an Icelandic shop.
1520
- *
1521
- * It is an ambient default, never an answer: every component that reads it also takes a `locale`
1522
- * prop, and the prop wins. With nothing provided the components format in `en-US`.
1523
- */
1524
- var DEFAULT_UI_LOCALE = "en-US";
1525
- /**
1526
- * The injection key the locale provider writes to. Exported so an app can set the locale from
1527
- * outside a `setup()` scope — and so it can provide a **getter**, which is what makes a locale
1528
- * switch reactive without an effect that outlives a server request:
1529
- *
1530
- * ```ts
1531
- * import { LOCALE_KEY } from '@eldrajs/ui';
1532
- * app.provide(LOCALE_KEY, () => store.locale);
1533
- * ```
1534
- */
1535
- var LOCALE_KEY = Symbol("eldra-ui-locale");
1536
- /**
1537
- * Set the number locale for this component and everything below it.
1538
- *
1539
- * Wraps Vue's `provide`, so it must be called during `setup()`. Use
1540
- * `app.provide(LOCALE_KEY, locale)` for the app-wide case.
1541
- */
1542
- function provideEldraUiLocale(locale) {
1543
- provide(LOCALE_KEY, locale);
1544
- }
1545
- /**
1546
- * The locale a component should format numbers in: whatever an ancestor provided, else `en-US`.
1547
- * A ref or a getter is unwrapped on every read, so the value follows a locale switch.
1548
- */
1549
- function useEldraUiLocale() {
1550
- const provided = inject(LOCALE_KEY, void 0);
1551
- return computed(() => toValue(provided) ?? "en-US");
1552
- }
1553
- /**
1554
- * The injection key the store currency is provided under (spec "Price" → Properties, `currency`
1555
- * row: "store currency") — the same provide/inject shape as `LOCALE_KEY` and deliberately separate
1556
- * from it: a store's number locale and its currency are two different decisions (an
1557
- * `en-US`-formatted store may still sell in `ISK`). It is an ambient default, never an answer:
1558
- * every component that reads it also takes a `currency` prop, and the prop wins. **With nothing
1559
- * provided there is no currency at all** — see `useEldraUiCurrency` for what the components then
1560
- * render, and why this pair has no default code.
1561
- *
1562
- * Exported so an app can set the currency from
1563
- * outside a `setup()` scope — and so it can provide a **getter**, which is what makes a currency
1564
- * switch reactive without an effect that outlives a server request:
1565
- *
1566
- * ```ts
1567
- * import { CURRENCY_KEY } from '@eldrajs/ui';
1568
- * app.provide(CURRENCY_KEY, () => store.currency);
1569
- * ```
1570
- *
1571
- * Providing `undefined` is meaningful and different from not providing at all: it says the store
1572
- * has **no** currency, which is the answer a platform that has not been told one must be able to
1573
- * give. Vue's `inject` consults `key in provides`, so the two cases stay distinguishable (see
1574
- * `useEldraUiCurrency`).
1575
- */
1576
- var CURRENCY_KEY = Symbol("eldra-ui-currency");
1577
- /**
1578
- * Set the store currency for this component and everything below it.
1579
- *
1580
- * Wraps Vue's `provide`, so it must be called during `setup()`. Use
1581
- * `app.provide(CURRENCY_KEY, currency)` for the app-wide case.
1582
- */
1583
- function provideEldraUiCurrency(currency) {
1584
- provide(CURRENCY_KEY, currency);
1585
- }
1586
- /**
1587
- * A value no provider can supply, so `inject`'s default tells "nobody provided a currency" apart
1588
- * from "a provider answered: this store has none". Vue's `inject` returns a provided `undefined`
1589
- * rather than the default (it tests `key in provides`), which is what makes the distinction real.
1590
- */
1591
- var NO_CURRENCY_PROVIDER = Symbol("eldra-ui-currency-absent");
1592
- /**
1593
- * The currency a component should format money in: whatever an ancestor provided, else **nothing**.
1594
- * A ref or a getter is unwrapped on every read, so the value follows a currency switch.
1595
- *
1596
- * **There is no default code.** A component library installed by a shop of any kind cannot guess
1597
- * one: a `USD` fallback puts a dollar sign in front of krónur, and a wrong price is worse than an
1598
- * incomplete one. So `undefined` comes back whenever there is no currency to name, and a component
1599
- * reading it formats the amount as a plain number through the same `Intl` path, with no symbol and
1600
- * no code (`Price` does exactly that). The empty string is read as "no currency" too: it is not a
1601
- * code `Intl` accepts, and it was the only way to decline one while this composable still defaulted.
1602
- *
1603
- * Two ways to arrive at `undefined`, and only one of them is a mistake. A provider that supplies
1604
- * `undefined` (or `''`) has *answered* — this store has no currency — and nothing is logged. Having
1605
- * no provider at all is unwired, and warns once per session in dev.
1606
- */
1607
- function useEldraUiCurrency() {
1608
- const provided = inject(CURRENCY_KEY, NO_CURRENCY_PROVIDER);
1609
- return computed(() => {
1610
- if (provided === NO_CURRENCY_PROVIDER) return;
1611
- const currency = toValue(provided);
1612
- return currency === void 0 || currency === "" ? void 0 : currency;
1613
- });
1614
- }
1615
1156
  // src/composables/useHeadingTag.ts
1616
1157
  /**
1617
1158
  * Turns a `headingLevel` prop into the tag name `<component :is>` renders — pulled out of the five
@@ -1969,165 +1510,6 @@ function currencySymbol(currency, locale = "en-US", narrow = true) {
1969
1510
  return currency;
1970
1511
  }
1971
1512
  }
1972
- // src/components/input/classes.ts
1973
- /**
1974
- * The field recipes of the design spec's **Input**, in one place.
1975
- *
1976
- * `Input` is the spec's field box, and two other controls draw the same box: `SearchBar`'s search
1977
- * field ("Search bar" → Sizes says it *is* an input) and `UnitInput` (so `CurrencyInput` too).
1978
- * `SearchBar` used to carry a
1979
- * hand-copied duplicate of these strings, and the copy drifted — the operator's report was that
1980
- * the search field "does not behave like the regular input fields", which was exactly that: the
1981
- * copy had lost the radius variable and the mobile type-size rule, so the field rounded and
1982
- * resized differently from every `Input` beside it.
1983
- *
1984
- * So the recipes live here and the three components import them. What a component may add is its
1985
- * own **delta** — a pill radius, a different padding for an icon it draws itself — never a second
1986
- * copy of the box.
1987
- *
1988
- * Nothing here is exported from the package: a consumer restyles through `class`, `classes`, tokens and
1989
- * the per-component CSS variables (see the README's Customisation section), not by importing our
1990
- * class strings, which are not a stable API.
1991
- */
1992
- /**
1993
- * The shared box (spec "Input" → Anatomy, Sizes, States). The `<input>` *is* the field box — the
1994
- * anatomy calls it "the native `<input>`, full width" — so the border, the radius and the one
1995
- * focus ring all live on it, and any leading or trailing decoration is absolutely positioned over
1996
- * the padding the sizes reserve for it.
1997
- *
1998
- * `eldra-focus-always` is the text-field rule from the focus-ring foundation: the ring shows on
1999
- * *any* focus, pointer included, "because a caret alone is easy to miss". There is deliberately no
2000
- * `transition-*`/`duration-*` utility beside it — `eldra-focus` owns this element's transition
2001
- * list, including the `duration-fast` border-colour change the spec's Behaviour section asks for.
2002
- * See `src/styles/tailwind.css` and `src/__tests__/focus-transition.spec.ts`.
2003
- */
2004
- var FIELD_BOX = "eldra:block eldra:w-full eldra:min-w-0 eldra:eldra-field-border eldra:placeholder:text-muted eldra:eldra-focus eldra:eldra-focus-always";
2005
- /** The box's radius, apart so a field with a radius of its own (`SearchBar`'s pill) takes one. */
2006
- var FIELD_RADIUS = "eldra:rounded-[var(--eldra-input-radius,var(--eldra-radius-md))]";
2007
- var FIELD_BASE = `${FIELD_BOX} ${FIELD_RADIUS}`;
2008
- /**
2009
- * The type style per size (spec "Input" → Sizes). Its own constant because `SearchBar`'s two sizes
2010
- * take exactly these rules while its paddings are its own — the `max-md:text-control-mobile`
2011
- * override in particular, which is a *viewport* rule (so iOS never zooms into a focused field) and
2012
- * is the half that had gone missing from the copy.
2013
- */
2014
- var FIELD_TEXT = {
2015
- sm: "eldra:text-control-sm",
2016
- md: "eldra:text-control eldra:max-md:text-control-mobile",
2017
- lg: "eldra:text-control-lg"
2018
- };
2019
- /**
2020
- * Sizes (spec "Input" → Sizes). `--spacing` is 0.25rem, so `py-0.75`/`px-2.25` are the spec's
2021
- * 0.1875/0.5625rem, `py-1.75`/`px-2.75` its 0.4375/0.6875rem and `py-2.75` its 0.6875rem.
2022
- * The 1.5rem line comes from the `text-control*` utilities, so the value sits on the spec's line
2023
- * inside the spec's box at every size.
2024
- */
2025
- var FIELD_SIZE = {
2026
- sm: `eldra:control-h-sm eldra:py-0.75 eldra:px-2.25 ${FIELD_TEXT.sm}`,
2027
- md: `eldra:control-h eldra:py-1.75 eldra:px-2.75 ${FIELD_TEXT.md}`,
2028
- lg: `eldra:control-h-lg eldra:py-2.75 eldra:px-2.75 ${FIELD_TEXT.lg}`
2029
- };
2030
- var FIELD_TRAILING_PAD = {
2031
- sm: "eldra:pe-8",
2032
- md: "eldra:pe-10",
2033
- lg: "eldra:pe-10"
2034
- };
2035
- var FIELD_CLEAR_SIZE = {
2036
- sm: "eldra:size-6",
2037
- md: "eldra:size-8",
2038
- lg: "eldra:size-8"
2039
- };
2040
- /**
2041
- * Two trailing actions (operator report, 2026-09-25; recorded under Deviations in the README): a
2042
- * `UnitInput`/`CurrencyInput` with `clearable` and a drag handle both on showed `$1,234,567.89 ×
2043
- * ↕` — each action a full 2rem square around a 1.125rem icon, `gap-1` between them, so the two
2044
- * icons ended up roughly 1.1rem apart, far wider than any other icon pair in the library (the
2045
- * private library's own handle sits `px-0` beside the clear button, no gap at all).
2046
- *
2047
- * A single action keeps `FIELD_TRAILING_PAD`/`FIELD_CLEAR_SIZE` unchanged (`Input`'s and
2048
- * `SearchBar`'s only ever have one, and their rendered classes must not change). With two, the row
2049
- * itself carries no gap (`FIELD_SUFFIX_ROW` below), each action shrinks to `w-6` (1.5rem — still
2050
- * the WCAG 2.5.8 24px minimum) at the row's own height, and the control's end padding grows to fit
2051
- * both of them plus the row's own 0.25rem inset from the edge.
2052
- */
2053
- var FIELD_TRAILING_PAD_PAIR = {
2054
- sm: "eldra:pe-14",
2055
- md: "eldra:pe-14",
2056
- lg: "eldra:pe-14"
2057
- };
2058
- var FIELD_ACTION_PAIR_SIZE = {
2059
- sm: "eldra:w-6 eldra:h-6",
2060
- md: "eldra:w-6 eldra:h-8",
2061
- lg: "eldra:w-6 eldra:h-8"
2062
- };
2063
- /**
2064
- * States (spec "Input" → States). Disabled and read-only replace the live colours outright rather
2065
- * than layering over them, so a `:hover` rule can never win back a live boundary on a dead field.
2066
- * The error row's second 1px line is the ring's own outline at rest (`eldra-field-invalid`, on the
2067
- * control beside this recipe). Each recipe carries the
2068
- * fill, the text colour and the boundary, so a field renders exactly one of each: `fieldState`
2069
- * picks the one recipe a field is in.
2070
- */
2071
- var FIELD_LIVE_FILL = "eldra:bg-background eldra:text-text";
2072
- var FIELD_READONLY_FILL = "eldra:bg-surface eldra:text-text";
2073
- var FIELD_LIVE = `${FIELD_LIVE_FILL} eldra:border-border-strong eldra:hover:border-text eldra:focus:border-text`;
2074
- /** The error boundary alone; `fieldState` pairs it with the live or the read-only fill. */
2075
- var FIELD_INVALID = "eldra:border-danger eldra:hover:border-danger eldra:focus:border-danger";
2076
- var FIELD_DISABLED = "eldra:bg-surface-strong eldra:border-border eldra:border-dashed eldra:text-muted eldra:cursor-not-allowed";
2077
- var FIELD_READONLY = `${FIELD_READONLY_FILL} eldra:border-border`;
2078
- /** The one state recipe a field box is in. `invalid` is the shown error, never set while disabled. */
2079
- function fieldState(state) {
2080
- if (state.disabled) return FIELD_DISABLED;
2081
- if (state.readonly) return state.invalid ? `${FIELD_READONLY_FILL} ${FIELD_INVALID}` : FIELD_READONLY;
2082
- return state.invalid ? `${FIELD_LIVE_FILL} ${FIELD_INVALID}` : FIELD_LIVE;
2083
- }
2084
- /** Spec "Input" → Variants, `search`: "The browser's own clear button is hidden." */
2085
- var FIELD_SEARCH_APPEARANCE = "eldra:[&::-webkit-search-cancel-button]:appearance-none eldra:[&::-webkit-search-decoration]:appearance-none";
2086
- /**
2087
- * A ghost icon button at the field's end edge (spec "Input" → Anatomy): square, `muted`, the ring.
2088
- * `cursor-pointer` (operator report, 2026-09-25; recorded under Deviations in the README): Tailwind
2089
- * v4's preflight sets `button { cursor: default }`, so without it every clear button in the
2090
- * package — `Input`'s, `SearchBar`'s and `UnitInput`'s (`CurrencyInput` wraps the last) — showed
2091
- * the default arrow rather than a pointer.
2092
- */
2093
- var FIELD_CLEAR_BUTTON_BOX = "eldra:shrink-0 eldra:items-center eldra:justify-center eldra:text-muted eldra:hover:text-text eldra:cursor-pointer eldra:hover:bg-[color-mix(in_oklab,var(--eldra-color-text),transparent_94%)] eldra:eldra-focus";
2094
- /** The whole button. A field that shows or rounds it its own way takes `FIELD_CLEAR_BUTTON_BOX`. */
2095
- var FIELD_CLEAR_BUTTON = `eldra:inline-flex ${FIELD_CLEAR_BUTTON_BOX} eldra:rounded-[var(--eldra-radius-sm)]`;
2096
- /** 1.125rem, `muted`, 0.6875rem from the start edge, and out of the pointer's way. */
2097
- var FIELD_LEADING_ICON = "eldra:absolute eldra:start-2.75 eldra:inset-y-0 eldra:my-auto eldra:flex eldra:h-4.5 eldra:w-4.5 eldra:items-center eldra:justify-center eldra:text-muted eldra:pointer-events-none";
2098
- /**
2099
- * The end-edge area, 0.25rem from the edge (spec "Input" → Anatomy, "Trailing action"). The clear
2100
- * button and the `suffix` slot share it, so a field that has both keeps them on one row in reading
2101
- * order — which is also the tab order the Keyboard table asks for: the input first, the clear
2102
- * button next.
2103
- *
2104
- * `gap-1` is the shared default: `Input`'s own doc comment documents `clearable`/`type="search"`
2105
- * plus a populated `suffix` slot as first-class ("the clear button and the `suffix` slot share it,
2106
- * so a field with both keeps them on one row"), and this constant is `Input`'s and `SearchBar`'s
2107
- * row too — dropping the gap here would silently change `Input`'s rendered output for that
2108
- * combination, which an early review caught. Only `UnitInput`'s two-action pair (see
2109
- * `FIELD_TRAILING_PAD_PAIR` above) wants flush icons, and it builds its row from
2110
- * `FIELD_SUFFIX_ROW_BASE` with `gap-0` rather than changing the shared default.
2111
- */
2112
- var FIELD_SUFFIX_ROW_BASE = "eldra:absolute eldra:end-1 eldra:inset-y-0 eldra:my-auto eldra:flex eldra:items-center";
2113
- var FIELD_SUFFIX_ROW = `${FIELD_SUFFIX_ROW_BASE} eldra:gap-1`;
2114
- /**
2115
- * The start-edge mirror of `FIELD_SUFFIX_ROW`, for the `prefix` slot: interactive content (a
2116
- * calendar button) 0.25rem from the start edge, so unlike `FIELD_LEADING_ICON` it keeps the pointer.
2117
- */
2118
- var FIELD_PREFIX_ROW = "eldra:absolute eldra:start-1 eldra:inset-y-0 eldra:my-auto eldra:flex eldra:items-center eldra:gap-1";
2119
- /** The start padding a `prefix` row reserves: the trailing action's room, mirrored. */
2120
- var FIELD_PREFIX_PAD = {
2121
- sm: "eldra:ps-8",
2122
- md: "eldra:ps-10",
2123
- lg: "eldra:ps-10"
2124
- };
2125
- /** `FIELD_TRAILING_PAD`/`FIELD_PREFIX_PAD` in rem, for `useAdornmentRoom`'s comparison. */
2126
- var FIELD_ACTION_ROOM_REM = {
2127
- sm: 2,
2128
- md: 2.5,
2129
- lg: 2.5
2130
- };
2131
1513
  // src/components/unit-input/undo-redo.ts
2132
1514
  function useUndoRedo(value) {
2133
1515
  const undo = ref([]);
@@ -2185,10 +1567,10 @@ function useUndoRedo(value) {
2185
1567
  return { onKeydown };
2186
1568
  }
2187
1569
  // src/components/unit-input/UnitInput.vue?vue&type=script&setup=true&lang.ts
2188
- var _hoisted_1$13 = ["data-eldra-scope"];
2189
- var _hoisted_2$13 = ["for"];
2190
- var _hoisted_3$13 = ["data-eldra-slot"];
2191
- var _hoisted_4$12 = [
1570
+ var _hoisted_1$12 = ["data-eldra-scope"];
1571
+ var _hoisted_2$12 = ["for"];
1572
+ var _hoisted_3$12 = ["data-eldra-slot"];
1573
+ var _hoisted_4$11 = [
2192
1574
  "id",
2193
1575
  "value",
2194
1576
  "placeholder",
@@ -2198,10 +1580,10 @@ var _hoisted_4$12 = [
2198
1580
  "aria-invalid",
2199
1581
  "aria-describedby"
2200
1582
  ];
2201
- var _hoisted_5$10 = ["name", "value"];
2202
- var _hoisted_6$8 = ["data-eldra-slot"];
1583
+ var _hoisted_5$9 = ["name", "value"];
1584
+ var _hoisted_6$7 = ["data-eldra-slot"];
2203
1585
  var _hoisted_7$5 = ["data-eldra-scope", "aria-label"];
2204
- var _hoisted_8$4 = ["data-eldra-scope"];
1586
+ var _hoisted_8$3 = ["data-eldra-scope"];
2205
1587
  var VALUE_DRAG_PIXELS_PER_STEP = 8;
2206
1588
  /**
2207
1589
  * `Number.MAX_SAFE_INTEGER`, written out. A property access in a prop default is a member
@@ -2793,7 +2175,7 @@ var UnitInput_default = /* @__PURE__ */ defineComponent({
2793
2175
  "data-part": "label",
2794
2176
  for: unref(controlId),
2795
2177
  class: normalizeClass(labelClass.value)
2796
- }, toDisplayString(__props.label), 11, _hoisted_2$13)) : createCommentVNode("", true), createElementVNode("span", {
2178
+ }, toDisplayString(__props.label), 11, _hoisted_2$12)) : createCommentVNode("", true), createElementVNode("span", {
2797
2179
  "data-part": "field",
2798
2180
  class: normalizeClass(fieldClass.value)
2799
2181
  }, [
@@ -2805,10 +2187,10 @@ var UnitInput_default = /* @__PURE__ */ defineComponent({
2805
2187
  }, [renderSlot(_ctx.$slots, "leadingIcon", {}, () => [__props.leadingIcon ? (openBlock(), createBlock(resolveDynamicComponent(__props.leadingIcon), {
2806
2188
  key: 0,
2807
2189
  class: "eldra:size-4.5 eldra:shrink-0",
2808
- "stroke-width": unref(ICON_STROKE_WIDTH),
2190
+ "stroke-width": unref(ICON_STROKE_WIDTH$1),
2809
2191
  "aria-hidden": "true",
2810
2192
  focusable: "false"
2811
- }, null, 8, ["stroke-width"])) : createCommentVNode("", true)])], 10, _hoisted_3$13)) : createCommentVNode("", true),
2193
+ }, null, 8, ["stroke-width"])) : createCommentVNode("", true)])], 10, _hoisted_3$12)) : createCommentVNode("", true),
2812
2194
  createElementVNode("input", mergeProps({
2813
2195
  ref_key: "controlRef",
2814
2196
  ref: controlRef
@@ -2836,13 +2218,13 @@ var UnitInput_default = /* @__PURE__ */ defineComponent({
2836
2218
  onDblclick: onDoubleClick,
2837
2219
  onFocus,
2838
2220
  onBlur
2839
- }), null, 16, _hoisted_4$12),
2221
+ }), null, 16, _hoisted_4$11),
2840
2222
  __props.name ? (openBlock(), createElementBlock("input", {
2841
2223
  key: 1,
2842
2224
  type: "hidden",
2843
2225
  name: __props.name,
2844
2226
  value: numericModel.value ?? ""
2845
- }, null, 8, _hoisted_5$10)) : createCommentVNode("", true),
2227
+ }, null, 8, _hoisted_5$9)) : createCommentVNode("", true),
2846
2228
  hasTrailing.value ? (openBlock(), createElementBlock("span", {
2847
2229
  key: 2,
2848
2230
  "data-eldra-slot": unref(eldra).slotHost("suffix"),
@@ -2896,10 +2278,10 @@ var UnitInput_default = /* @__PURE__ */ defineComponent({
2896
2278
  createElementVNode("path", { d: "M12 3l0 18" }),
2897
2279
  createElementVNode("path", { d: "M15 6l-3 -3l-3 3" }),
2898
2280
  createElementVNode("path", { d: "M15 18l-3 3l-3 -3" })
2899
- ], -1)])], 42, _hoisted_8$4)) : createCommentVNode("", true),
2281
+ ], -1)])], 42, _hoisted_8$3)) : createCommentVNode("", true),
2900
2282
  renderSlot(_ctx.$slots, "suffix")
2901
- ], 10, _hoisted_6$8)) : createCommentVNode("", true)
2902
- ], 2)], 10, _hoisted_1$13);
2283
+ ], 10, _hoisted_6$7)) : createCommentVNode("", true)
2284
+ ], 2)], 10, _hoisted_1$12);
2903
2285
  };
2904
2286
  }
2905
2287
  });
@@ -3157,10 +2539,10 @@ function useAdornmentRoom(row, reservedRem) {
3157
2539
  });
3158
2540
  }
3159
2541
  // src/components/input/Input.vue?vue&type=script&setup=true&lang.ts
3160
- var _hoisted_1$12 = ["data-eldra-scope"];
3161
- var _hoisted_2$12 = ["data-eldra-slot"];
3162
- var _hoisted_3$12 = ["data-eldra-slot"];
3163
- var _hoisted_4$11 = [
2542
+ var _hoisted_1$11 = ["data-eldra-scope"];
2543
+ var _hoisted_2$11 = ["data-eldra-slot"];
2544
+ var _hoisted_3$11 = ["data-eldra-slot"];
2545
+ var _hoisted_4$10 = [
3164
2546
  "id",
3165
2547
  "name",
3166
2548
  "type",
@@ -3177,8 +2559,8 @@ var _hoisted_4$11 = [
3177
2559
  "aria-invalid",
3178
2560
  "aria-describedby"
3179
2561
  ];
3180
- var _hoisted_5$9 = ["data-eldra-slot"];
3181
- var _hoisted_6$7 = ["data-eldra-scope", "aria-label"];
2562
+ var _hoisted_5$8 = ["data-eldra-slot"];
2563
+ var _hoisted_6$6 = ["data-eldra-scope", "aria-label"];
3182
2564
  var rootClass$5 = "eldra:relative eldra:block eldra:w-full";
3183
2565
  // src/components/input/Input.vue
3184
2566
  var Input_default = /* @__PURE__ */ defineComponent({
@@ -3391,7 +2773,7 @@ var Input_default = /* @__PURE__ */ defineComponent({
3391
2773
  "data-eldra-slot": unref(eldra).slotHost("prefix"),
3392
2774
  "data-part": "prefix",
3393
2775
  class: normalizeClass(prefixClass.value)
3394
- }, [renderSlot(_ctx.$slots, "prefix")], 10, _hoisted_2$12)) : hasLeading.value ? (openBlock(), createElementBlock("span", {
2776
+ }, [renderSlot(_ctx.$slots, "prefix")], 10, _hoisted_2$11)) : hasLeading.value ? (openBlock(), createElementBlock("span", {
3395
2777
  key: 1,
3396
2778
  "data-eldra-slot": unref(eldra).slotHost("leadingIcon"),
3397
2779
  "data-part": "leadingIcon",
@@ -3399,10 +2781,10 @@ var Input_default = /* @__PURE__ */ defineComponent({
3399
2781
  }, [renderSlot(_ctx.$slots, "leadingIcon", {}, () => [__props.leadingIcon ? (openBlock(), createBlock(resolveDynamicComponent(__props.leadingIcon), {
3400
2782
  key: 0,
3401
2783
  class: "eldra:size-4.5 eldra:shrink-0",
3402
- "stroke-width": unref(ICON_STROKE_WIDTH),
2784
+ "stroke-width": unref(ICON_STROKE_WIDTH$1),
3403
2785
  "aria-hidden": "true",
3404
2786
  focusable: "false"
3405
- }, null, 8, ["stroke-width"])) : createCommentVNode("", true)])], 10, _hoisted_3$12)) : createCommentVNode("", true),
2787
+ }, null, 8, ["stroke-width"])) : createCommentVNode("", true)])], 10, _hoisted_3$11)) : createCommentVNode("", true),
3406
2788
  createElementVNode("input", mergeProps({
3407
2789
  ref_key: "controlRef",
3408
2790
  ref: controlRef
@@ -3431,7 +2813,7 @@ var Input_default = /* @__PURE__ */ defineComponent({
3431
2813
  onInput,
3432
2814
  onFocus: _cache[0] || (_cache[0] = ($event) => emit("focus", $event)),
3433
2815
  onBlur: _cache[1] || (_cache[1] = ($event) => emit("blur", $event))
3434
- }), null, 16, _hoisted_4$11),
2816
+ }), null, 16, _hoisted_4$10),
3435
2817
  hasTrailing.value ? (openBlock(), createElementBlock("span", {
3436
2818
  key: 2,
3437
2819
  ref_key: "suffixRef",
@@ -3457,8 +2839,8 @@ var Input_default = /* @__PURE__ */ defineComponent({
3457
2839
  "stroke-linejoin": "round",
3458
2840
  "aria-hidden": "true",
3459
2841
  focusable: "false"
3460
- }, [createElementVNode("path", { d: "M18 6l-12 12" }), createElementVNode("path", { d: "M6 6l12 12" })], -1)])], 10, _hoisted_6$7)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "suffix")], 10, _hoisted_5$9)) : createCommentVNode("", true)
3461
- ], 10, _hoisted_1$12);
2842
+ }, [createElementVNode("path", { d: "M18 6l-12 12" }), createElementVNode("path", { d: "M6 6l12 12" })], -1)])], 10, _hoisted_6$6)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "suffix")], 10, _hoisted_5$8)) : createCommentVNode("", true)
2843
+ ], 10, _hoisted_1$11);
3462
2844
  };
3463
2845
  }
3464
2846
  });
@@ -3548,7 +2930,7 @@ function filterNumericBeforeInput(event, options = {}) {
3548
2930
  return true;
3549
2931
  }
3550
2932
  // src/components/switch/Switch.vue?vue&type=script&setup=true&lang.ts
3551
- var _hoisted_1$11 = [
2933
+ var _hoisted_1$10 = [
3552
2934
  "data-eldra-scope",
3553
2935
  "id",
3554
2936
  "aria-checked",
@@ -3556,11 +2938,11 @@ var _hoisted_1$11 = [
3556
2938
  "aria-invalid",
3557
2939
  "disabled"
3558
2940
  ];
3559
- var _hoisted_2$11 = ["data-eldra-slot"];
3560
- var _hoisted_3$11 = ["data-eldra-slot"];
3561
- var _hoisted_4$10 = ["data-eldra-slot"];
3562
- var _hoisted_5$8 = ["data-eldra-slot"];
3563
- var _hoisted_6$6 = ["data-eldra-slot", "id"];
2941
+ var _hoisted_2$10 = ["data-eldra-slot"];
2942
+ var _hoisted_3$10 = ["data-eldra-slot"];
2943
+ var _hoisted_4$9 = ["data-eldra-slot"];
2944
+ var _hoisted_5$7 = ["data-eldra-slot"];
2945
+ var _hoisted_6$5 = ["data-eldra-slot", "id"];
3564
2946
  var _hoisted_7$4 = [
3565
2947
  "data-eldra-scope",
3566
2948
  "name",
@@ -3808,14 +3190,14 @@ var Switch_default = /* @__PURE__ */ defineComponent({
3808
3190
  "data-part": "trackStart",
3809
3191
  "aria-hidden": "true",
3810
3192
  class: normalizeClass(trackStartClass.value)
3811
- }, [renderSlot(_ctx.$slots, "trackStart", normalizeProps(guardReactiveProps(slotProps.value)))], 10, _hoisted_2$11)) : createCommentVNode("", true),
3193
+ }, [renderSlot(_ctx.$slots, "trackStart", normalizeProps(guardReactiveProps(slotProps.value)))], 10, _hoisted_2$10)) : createCommentVNode("", true),
3812
3194
  _ctx.$slots.trackEnd ? (openBlock(), createElementBlock("span", {
3813
3195
  key: 1,
3814
3196
  "data-eldra-slot": unref(eldra).slotHost("trackEnd"),
3815
3197
  "data-part": "trackEnd",
3816
3198
  "aria-hidden": "true",
3817
3199
  class: normalizeClass(trackEndClass.value)
3818
- }, [renderSlot(_ctx.$slots, "trackEnd", normalizeProps(guardReactiveProps(slotProps.value)))], 10, _hoisted_3$11)) : createCommentVNode("", true),
3200
+ }, [renderSlot(_ctx.$slots, "trackEnd", normalizeProps(guardReactiveProps(slotProps.value)))], 10, _hoisted_3$10)) : createCommentVNode("", true),
3819
3201
  createElementVNode("span", {
3820
3202
  "data-part": "thumb",
3821
3203
  class: normalizeClass(thumbClass.value)
@@ -3824,7 +3206,7 @@ var Switch_default = /* @__PURE__ */ defineComponent({
3824
3206
  "data-eldra-slot": unref(eldra).slotHost("thumb"),
3825
3207
  "aria-hidden": "true",
3826
3208
  class: "eldra:pointer-events-none eldra:inline-flex"
3827
- }, [renderSlot(_ctx.$slots, "thumb", normalizeProps(guardReactiveProps(slotProps.value)))], 8, _hoisted_4$10)) : unref(model) ? (openBlock(), createElementBlock("svg", {
3209
+ }, [renderSlot(_ctx.$slots, "thumb", normalizeProps(guardReactiveProps(slotProps.value)))], 8, _hoisted_4$9)) : unref(model) ? (openBlock(), createElementBlock("svg", {
3828
3210
  key: 1,
3829
3211
  class: normalizeClass(checkClass.value),
3830
3212
  viewBox: "0 0 12 12",
@@ -3852,7 +3234,7 @@ var Switch_default = /* @__PURE__ */ defineComponent({
3852
3234
  default: withCtx(() => [createTextVNode(toDisplayString(unref(m).required), 1)]),
3853
3235
  _: 1
3854
3236
  })) : createCommentVNode("", true)
3855
- ], 10, _hoisted_5$8)) : createCommentVNode("", true),
3237
+ ], 10, _hoisted_5$7)) : createCommentVNode("", true),
3856
3238
  hasDescription.value ? (openBlock(), createElementBlock("span", {
3857
3239
  key: 1,
3858
3240
  "data-eldra-slot": unref(eldra).slotHost("description"),
@@ -3860,8 +3242,8 @@ var Switch_default = /* @__PURE__ */ defineComponent({
3860
3242
  "data-part": "description",
3861
3243
  "aria-hidden": "true",
3862
3244
  class: normalizeClass(descriptionClass.value)
3863
- }, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])], 10, _hoisted_6$6)) : createCommentVNode("", true)
3864
- ], 16, _hoisted_1$11), createElementVNode("input", {
3245
+ }, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])], 10, _hoisted_6$5)) : createCommentVNode("", true)
3246
+ ], 16, _hoisted_1$10), createElementVNode("input", {
3865
3247
  "data-eldra-ui": "",
3866
3248
  "data-eldra-scope": unref(eldra).scope,
3867
3249
  type: "checkbox",
@@ -3891,7 +3273,7 @@ function focusInvalid(element) {
3891
3273
  (element.matches("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [href], [tabindex]:not([tabindex=\"-1\"])") ? element : element.querySelector("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [href], [tabindex]:not([tabindex=\"-1\"])") ?? element).focus();
3892
3274
  }
3893
3275
  // src/components/form-layout/FormLayout.vue?vue&type=script&setup=true&lang.ts
3894
- var _hoisted_1$10 = [
3276
+ var _hoisted_1$9 = [
3895
3277
  "data-eldra-scope",
3896
3278
  "action",
3897
3279
  "method",
@@ -3899,9 +3281,9 @@ var _hoisted_1$10 = [
3899
3281
  "aria-labelledby",
3900
3282
  "aria-label"
3901
3283
  ];
3902
- var _hoisted_2$10 = ["data-eldra-slot"];
3903
- var _hoisted_3$10 = ["data-eldra-slot"];
3904
- var _hoisted_4$9 = ["data-eldra-slot"];
3284
+ var _hoisted_2$9 = ["data-eldra-slot"];
3285
+ var _hoisted_3$9 = ["data-eldra-slot"];
3286
+ var _hoisted_4$8 = ["data-eldra-slot"];
3905
3287
  var ROOT_BASE$1 = "eldra:@container eldra:w-full";
3906
3288
  /**
3907
3289
  * Spec "Form layout" → Anatomy: "form (grid, 1rem row gap)". The inline form is the one exception:
@@ -4107,18 +3489,18 @@ var FormLayout_default = /* @__PURE__ */ defineComponent({
4107
3489
  ], -1)), createElementVNode("div", {
4108
3490
  "data-eldra-slot": unref(eldra).slotHost("errorSummary"),
4109
3491
  class: "eldra:min-w-0"
4110
- }, [renderSlot(_ctx.$slots, "errorSummary")], 8, _hoisted_2$10)], 2)) : createCommentVNode("", true),
3492
+ }, [renderSlot(_ctx.$slots, "errorSummary")], 8, _hoisted_2$9)], 2)) : createCommentVNode("", true),
4111
3493
  createElementVNode("div", {
4112
3494
  "data-eldra-slot": unref(eldra).slotHost("default"),
4113
3495
  "data-part": "fields",
4114
3496
  class: normalizeClass(fieldsClass.value)
4115
- }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_3$10),
3497
+ }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_3$9),
4116
3498
  hasActions.value ? (openBlock(), createElementBlock("div", {
4117
3499
  key: 2,
4118
3500
  "data-eldra-slot": unref(eldra).slotHost("actions"),
4119
3501
  "data-part": "actions",
4120
3502
  class: normalizeClass(actionsClass.value)
4121
- }, [renderSlot(_ctx.$slots, "actions")], 10, _hoisted_4$9)) : createCommentVNode("", true),
3503
+ }, [renderSlot(_ctx.$slots, "actions")], 10, _hoisted_4$8)) : createCommentVNode("", true),
4122
3504
  createVNode(VisuallyHidden_default, {
4123
3505
  as: "p",
4124
3506
  "data-part": "status",
@@ -4129,587 +3511,28 @@ var FormLayout_default = /* @__PURE__ */ defineComponent({
4129
3511
  default: withCtx(() => [createTextVNode(toDisplayString(__props.statusMessage), 1)]),
4130
3512
  _: 1
4131
3513
  }, 8, ["class"])
4132
- ], 42, _hoisted_1$10);
3514
+ ], 42, _hoisted_1$9);
4133
3515
  };
4134
3516
  }
4135
3517
  });
4136
- // src/components/select/panelParts.ts
4137
- /**
4138
- * Every class the **panel** of a select draws, in one place, because `Select` and `MultiSelect`
4139
- * draw the same panel. They are plain functions rather than computeds so that both `SelectPanel`
4140
- * (which renders the panel) and a trigger (which reuses an option's swatch and icon for the chosen
4141
- * option's mark) can call them.
4142
- *
4143
- * Each returns a Vue class value with the consumer's per-part classes appended last.
4144
- */
4145
- /**
4146
- * The popover (spec "Select" → Sizes, Popover row). Not a dialog: it is a non-modal popup
4147
- * (non-negotiable 2), positioned by `useFloating` against the trigger.
4148
- *
4149
- * It is **teleported** — to `body`, or to the open `<dialog>` the control sits in — so that no
4150
- * ancestor's `overflow: hidden` clips it and no later stacking context paints over it. `absolute`
4151
- * stays in the class list because it is what a `teleport: false` panel needs; the inline
4152
- * `position` `useFloating` writes (`fixed` once teleported) is on the element itself and wins
4153
- * over it either way. `z-popover` puts it over the sticky header, `overflow-hidden` keeps the
4154
- * search field's top corners on the popover's radius, and the list — not the panel — is what
4155
- * scrolls.
4156
- *
4157
- * Because the panel leaves the control's subtree, a consumer's `classes`/`data-part` styling still
4158
- * reaches it (both are on the element), but a **descendant selector rooted above the control does
4159
- * not**, and neither do custom properties set on a wrapper: set `--eldra-*` overrides on `:root`
4160
- * (or on the teleport target), which is what the README's Customisation section already asks for.
4161
- */
4162
- function panelClass(classes) {
4163
- return [
4164
- "eldra:absolute eldra:z-popover eldra:flex eldra:flex-col eldra:overflow-hidden",
4165
- "eldra:eldra-select-panel-height eldra:eldra-select-panel-width",
4166
- "eldra:rounded-md eldra:border eldra:shadow-md",
4167
- "eldra:border-[color:var(--eldra-select-panel-border,var(--eldra-color-border))]",
4168
- "eldra:bg-[color:var(--eldra-select-panel-background,var(--eldra-color-background))]",
4169
- "eldra:text-[color:var(--eldra-select-panel-text)]",
4170
- "eldra:animate-eldra-popover-in",
4171
- classes?.panel
4172
- ];
4173
- }
4174
- /**
4175
- * Spec "Select" → Sizes, Search field: 2.5rem tall, text from 2.125rem. No focus ring (a README
4176
- * Deviation): focus sits here whenever the panel is open, so the caret and the active row show it.
4177
- */
4178
- function searchClass(classes) {
4179
- return [
4180
- "eldra:control-h eldra:w-full eldra:min-w-0 eldra:rounded-t-md eldra:bg-transparent eldra:ps-8.5 eldra:pe-3",
4181
- "eldra:text-control-sm eldra:max-md:text-control-mobile",
4182
- "eldra:text-[color:var(--eldra-select-panel-text,var(--eldra-color-text))]",
4183
- "eldra:placeholder:text-[color:var(--eldra-select-panel-muted,var(--eldra-color-muted))]",
4184
- "eldra:outline-none",
4185
- classes?.search
4186
- ];
4187
- }
4188
- function listboxClass(classes, hasOptions) {
4189
- return [
4190
- "eldra:overflow-y-auto eldra:overscroll-contain",
4191
- hasOptions ? "eldra:min-h-0 eldra:flex-1 eldra:p-1" : "eldra:h-0",
4192
- classes?.listbox
4193
- ];
4194
- }
4195
- /** Spec: "Every group after the first gets a 1px `border` hairline and 0.25rem gap above it." */
4196
- function groupClass(classes, index) {
4197
- return [index > 0 && "eldra:mt-1 eldra:border-t eldra:border-[color:var(--eldra-select-panel-border,var(--eldra-color-border))]", classes?.group];
4198
- }
4199
- function groupLabelClass(classes, index) {
4200
- return [
4201
- "eldra:text-select-group eldra:px-2 eldra:pb-1",
4202
- "eldra:text-[color:var(--eldra-select-panel-muted,var(--eldra-color-muted))]",
4203
- index > 0 ? "eldra:pt-2.5" : "eldra:pt-2",
4204
- classes?.groupLabel
4205
- ];
4206
- }
4207
- /**
4208
- * Spec "Select" → Sizes, Option row, and → States for active / selected / disabled.
4209
- *
4210
- * `multiple` is the one difference the spec draws between the two controls' rows: a multi-select's
4211
- * selection is carried by the filled box, so its label is "weight 500 (not 600)" (spec
4212
- * "Multi-select" → States, Option selected).
4213
- */
4214
- function optionClass(classes, option, state) {
4215
- return [
4216
- "eldra:flex eldra:min-h-9 eldra:scroll-my-1 eldra:items-center eldra:gap-2 eldra:rounded-sm eldra:px-2 eldra:py-1.5 eldra:text-select-option",
4217
- state.active && "eldra:bg-[color:var(--eldra-select-panel-active,var(--eldra-color-surface-strong))] eldra:eldra-select-option-active",
4218
- state.selected && (state.multiple ? "eldra:font-medium" : "eldra:font-semibold"),
4219
- state.selected && "eldra:eldra-select-option-selected",
4220
- option.disabled === true ? "eldra:text-[color:var(--eldra-select-panel-muted,var(--eldra-color-muted))] eldra:cursor-not-allowed" : "eldra:text-[color:var(--eldra-select-panel-text,var(--eldra-color-text))] eldra:cursor-pointer",
4221
- classes?.option
4222
- ];
4223
- }
4224
- /** A disabled row reads as disabled through the row's `muted` text and cursor, like `Checkbox`. */
4225
- function optionLabelClass(classes) {
4226
- return ["eldra:block", classes?.optionLabel];
4227
- }
4228
- function optionHintClass(classes) {
4229
- return ["eldra:text-caption eldra:block eldra:text-[color:var(--eldra-select-panel-muted,var(--eldra-color-muted))]", classes?.optionHint];
4230
- }
4231
- var META_TONE = {
4232
- warning: "eldra:text-warning eldra:font-semibold",
4233
- danger: "eldra:text-danger eldra:font-semibold"
4234
- };
4235
- function optionMetaClass(classes, option) {
4236
- return [
4237
- "eldra:ms-3 eldra:shrink-0 eldra:text-caption eldra:tabular-nums",
4238
- option.metaTone === void 0 ? "eldra:text-[color:var(--eldra-select-panel-muted,var(--eldra-color-muted))]" : META_TONE[option.metaTone],
4239
- classes?.optionMeta
4240
- ];
4241
- }
4242
- function optionSwatchClass(classes) {
4243
- return ["eldra:size-4 eldra:shrink-0 eldra:rounded-full eldra:eldra-select-swatch", classes?.optionSwatch];
4244
- }
4245
- function optionIconClass(classes) {
4246
- return ["eldra:size-4.5 eldra:shrink-0", classes?.optionIcon];
4247
- }
4248
- /** Spec "Select" → States, Option selected: "check mark in `text` (never colour alone)". */
4249
- function optionCheckClass(classes) {
4250
- return ["eldra:size-4.5 eldra:shrink-0 eldra:text-[color:var(--eldra-select-panel-check,var(--eldra-color-text))]", classes?.optionCheck];
4251
- }
4252
- /**
4253
- * A multi-select option's checkbox (spec "Multi-select" → Sizes, "Checkbox in option"): "1rem
4254
- * square, 1.5px `border-strong`, 0.25rem radius, `background` fill. Checked: `primary` fill and
4255
- * border with a `primary-contrast` tick."
4256
- *
4257
- * It is the `optionCheck` part — the same part a single select's check mark is — so "the mark that
4258
- * says this row is chosen" is one styling hook in both controls. The border width is `Checkbox`'s
4259
- * own `eldra-checkbox-border`, so a consumer that has restyled their checkboxes' boundary has
4260
- * restyled these; the radius is the spec's smaller 0.25rem, on its own variable.
4261
- */
4262
- function optionBoxClass(classes, state) {
4263
- return [
4264
- "eldra:relative eldra:inline-flex eldra:size-4 eldra:shrink-0 eldra:items-center eldra:justify-center",
4265
- "eldra:eldra-checkbox-border eldra:eldra-select-check-radius",
4266
- "eldra:transition-colors eldra:duration-fast eldra:ease-out",
4267
- state.selected && state.disabled ? "eldra:bg-muted eldra:border-muted" : state.selected ? "eldra:bg-[color:var(--eldra-select-panel-check,var(--eldra-color-primary))] eldra:border-[color:var(--eldra-select-panel-check,var(--eldra-color-primary))]" : state.disabled ? "eldra:bg-surface-strong eldra:border-border eldra:border-dashed" : "eldra:bg-[color:var(--eldra-select-panel-background,var(--eldra-color-background))] eldra:border-[color:var(--eldra-select-panel-check-border,var(--eldra-color-border-strong))]",
4268
- classes?.optionCheck
4269
- ];
4270
- }
4271
- /** Spec "Select" → Sizes, Empty state: "0.875rem, `muted`, centred, padding 1rem 0.75rem". */
4272
- function emptyClass(classes) {
4273
- return ["eldra:px-3 eldra:py-4 eldra:text-center eldra:text-body-sm eldra:text-[color:var(--eldra-select-panel-muted,var(--eldra-color-muted))]", classes?.empty];
4274
- }
4275
- /**
4276
- * The loading row: the empty state's box, with the shared spinner before its text. It stands in
4277
- * for the list and the empty state while a `loading` control's options are being fetched.
4278
- */
4279
- function loadingClass(classes) {
4280
- return ["eldra:flex eldra:items-center eldra:justify-center eldra:gap-2 eldra:px-3 eldra:py-4 eldra:text-body-sm eldra:text-[color:var(--eldra-select-panel-muted,var(--eldra-color-muted))]", classes?.loading];
4281
- }
4282
- /**
4283
- * The "Create “query”" row of a `creatable` control: an option row's own box and active fill, with
4284
- * a `plus` where a row draws its mark. After other rows it sits under a group's hairline (drawn
4285
- * by `SelectPanel`), so it reads as an action rather than one more match.
4286
- */
4287
- function createOptionClass(classes, state) {
4288
- return [
4289
- "eldra:flex eldra:min-h-9 eldra:scroll-my-1 eldra:items-center eldra:gap-2 eldra:rounded-sm eldra:px-2 eldra:py-1.5 eldra:text-select-option",
4290
- "eldra:text-[color:var(--eldra-select-panel-text,var(--eldra-color-text))] eldra:cursor-pointer",
4291
- state.active && "eldra:bg-[color:var(--eldra-select-panel-active,var(--eldra-color-surface-strong))] eldra:eldra-select-option-active",
4292
- classes?.createOption
4293
- ];
4294
- }
4295
- /**
4296
- * The tick inside that box (spec "Multi-select" → Sizes: "a `primary-contrast` tick (0.25 × 0.5rem,
4297
- * 2px stroke)").
4298
- *
4299
- * The svg is drawn 0.5rem square — `size-2` on the 0.25rem spacing step — over an 8 × 8 viewBox,
4300
- * so one viewBox unit is one pixel of the drawn mark and `stroke-width="2"` is the spec's 2px.
4301
- * (The same relationship `Checkbox` has at its own larger size; a 10-unit viewBox squeezed into
4302
- * 0.5rem would render that same `2` as 1.6px.) The mark is Tabler's check at 3 : 2 — 0.5 × 0.375rem
4303
- * of ink rather than the spec's literal 0.5 × 0.25rem, which read flat (see `Checkbox.vue`).
4304
- *
4305
- * It is always rendered and scaled from 0, rather than added and removed, so it can grow in over
4306
- * `duration-fast` the way `Checkbox`'s does.
4307
- */
4308
- function optionTickClass(selected) {
4309
- return [
4310
- "eldra:text-[color:var(--eldra-select-panel-check-contrast,var(--eldra-color-primary-contrast))]",
4311
- "eldra:pointer-events-none eldra:size-2 eldra:transition-transform eldra:duration-fast eldra:ease-out",
4312
- selected ? "eldra:scale-100" : "eldra:scale-0"
4313
- ];
4314
- }
4315
- /**
4316
- * The cell a trigger stacks its chosen value in, with an invisible copy of the placeholder
4317
- * (`data-placeholder`, drawn by `::after`) in the same grid cell: a content-sized trigger keeps at
4318
- * least its placeholder's width once a value is chosen, as a native input keeps its width. The copy
4319
- * is generated content under `visibility: hidden`, so it adds no text and no accessible name.
4320
- */
4321
- var TRIGGER_VALUE_STACK = "eldra:relative eldra:grid eldra:min-w-0 eldra:flex-1 eldra:grid-cols-[minmax(0,1fr)] eldra:items-center eldra:after:invisible eldra:after:col-start-1 eldra:after:row-start-1 eldra:after:truncate eldra:after:content-[attr(data-placeholder)]";
4322
- /** The chosen value inside `TRIGGER_VALUE_STACK`, in the cell the placeholder copy shares. */
4323
- var TRIGGER_VALUE_CELL = "eldra:col-start-1 eldra:row-start-1";
4324
- // src/components/select/SelectPanel.vue?vue&type=script&setup=true&lang.ts
4325
- var _hoisted_1$9 = [
4326
- "data-eldra-slot",
3518
+ // src/components/select/SelectTags.vue?vue&type=script&setup=true&lang.ts
3519
+ var _hoisted_1$8 = [
4327
3520
  "id",
4328
3521
  "data-eldra-scope",
4329
- "data-eldra-overlay-owner",
4330
- "data-placement"
4331
- ];
4332
- var _hoisted_2$9 = ["data-eldra-scope"];
4333
- var _hoisted_3$9 = [
4334
- "value",
4335
- "placeholder",
4336
3522
  "aria-label",
4337
- "aria-controls",
4338
- "aria-activedescendant"
3523
+ "aria-labelledby"
4339
3524
  ];
4340
- var _hoisted_4$8 = [
3525
+ var _hoisted_2$8 = ["data-eldra-slot"];
3526
+ var _hoisted_3$8 = ["data-eldra-slot"];
3527
+ var _hoisted_4$7 = { class: "eldra:min-w-0 eldra:truncate" };
3528
+ var _hoisted_5$6 = [
4341
3529
  "data-eldra-scope",
4342
- "id",
4343
- "aria-multiselectable",
4344
- "aria-labelledby",
4345
3530
  "aria-label",
4346
- "aria-busy"
4347
- ];
4348
- var _hoisted_5$7 = [
4349
- "data-part",
4350
- "role",
4351
- "aria-labelledby"
4352
- ];
4353
- var _hoisted_6$5 = ["id"];
4354
- var _hoisted_7$3 = [
4355
- "data-eldra-slot",
4356
- "id",
4357
- "aria-selected",
4358
- "aria-disabled",
4359
- "onClick",
4360
- "onMouseenter"
3531
+ "onClick"
4361
3532
  ];
4362
- var _hoisted_8$3 = ["data-eldra-scope"];
4363
- var _hoisted_9$3 = { class: "eldra:min-w-0 eldra:flex-1" };
4364
- var _hoisted_10$3 = { class: "eldra:eldra-select-match" };
4365
- var _hoisted_11$3 = ["data-eldra-scope"];
4366
- var _hoisted_12$3 = ["id"];
4367
- var _hoisted_13$2 = { class: "eldra:min-w-0 eldra:flex-1 eldra:truncate" };
4368
- var _hoisted_14$2 = ["data-eldra-slot", "data-eldra-scope"];
4369
- var _hoisted_15$1 = ["data-eldra-slot", "data-eldra-scope"];
4370
- var SCROLL_END_SLACK = 80;
4371
- var FOCUSABLE$1 = "input, button, a[href], textarea, select, [tabindex]:not([tabindex^=\"-\"])";
4372
- // src/components/select/SelectPanel.vue
4373
- var SelectPanel_default = /* @__PURE__ */ defineComponent({
4374
- __name: "SelectPanel",
4375
- props: {
4376
- panelId: {},
4377
- listboxId: {},
4378
- sections: {},
4379
- hasOptions: { type: Boolean },
4380
- highlights: {},
4381
- optionId: {},
4382
- activeValue: { default: void 0 },
4383
- selectedValues: {},
4384
- searchable: { type: Boolean },
4385
- query: {},
4386
- searchPlaceholder: {},
4387
- emptyText: {},
4388
- labelledBy: { default: void 0 },
4389
- fallbackLabel: { default: void 0 },
4390
- multiple: {
4391
- type: Boolean,
4392
- default: false
4393
- },
4394
- loading: {
4395
- type: Boolean,
4396
- default: false
4397
- },
4398
- loadingText: { default: void 0 },
4399
- createOption: { default: void 0 },
4400
- createText: { default: void 0 },
4401
- panelStyle: { default: void 0 },
4402
- placement: { default: void 0 },
4403
- classes: { default: void 0 }
4404
- },
4405
- emits: [
4406
- "search",
4407
- "select",
4408
- "activate",
4409
- "keydown",
4410
- "scrollEnd"
4411
- ],
4412
- setup(__props, { expose: __expose, emit: __emit }) {
4413
- const eldra = useEldraScope();
4414
- /**
4415
- * The popover a `Select` and a `MultiSelect` both open: the search field, the listbox with its
4416
- * groups and option rows, and the empty state — plus a `footer` slot, which only a multi-select
4417
- * fills.
4418
- *
4419
- * It exists so that the two controls share one panel rather than two copies of the same markup.
4420
- * Everything it knows is a prop: it owns no open/closed state, no query, no value, and no keyboard
4421
- * (that is `useListbox`). What it does own is the DOM the parents cannot: the panel element and
4422
- * the search input, both exposed so the parent can position the one and focus the other, and the
4423
- * pointer-press guard that keeps a press inside the panel from blurring the focused element.
4424
- *
4425
- * `multiple` is the one behavioural switch, and it is the spec's own: a multi-select's rows carry a
4426
- * checkbox instead of a trailing check mark, and its listbox is `aria-multiselectable="true"`.
4427
- */
4428
- const props = __props;
4429
- const emit = __emit;
4430
- const root = ref(null);
4431
- const searchInput = ref(null);
4432
- __expose({
4433
- root,
4434
- searchInput
4435
- });
4436
- const isActive = (option) => props.activeValue === option.value;
4437
- const isSelected = (option) => props.selectedValues.includes(option.value);
4438
- const panelClasses = computed(() => panelClass(props.classes));
4439
- const searchClasses = computed(() => searchClass(props.classes));
4440
- const listboxClasses = computed(() => listboxClass(props.classes, props.hasOptions));
4441
- const optionHintClasses = computed(() => optionHintClass(props.classes));
4442
- const optionSwatchClasses = computed(() => optionSwatchClass(props.classes));
4443
- const optionIconClasses = computed(() => optionIconClass(props.classes));
4444
- const optionCheckClasses = computed(() => optionCheckClass(props.classes));
4445
- const emptyClasses = computed(() => emptyClass(props.classes));
4446
- const loadingClasses = computed(() => loadingClass(props.classes));
4447
- const createClasses = computed(() => props.createOption === void 0 ? "" : createOptionClass(props.classes, { active: isActive(props.createOption) }));
4448
- /** Within this many pixels of the end — two rows — the next render batch is asked for. */
4449
- function onListScroll(event) {
4450
- const list = event.currentTarget;
4451
- if (list.scrollHeight - list.scrollTop - list.clientHeight <= SCROLL_END_SLACK) emit("scrollEnd");
4452
- }
4453
- const rowClass = (option) => optionClass(props.classes, option, {
4454
- active: isActive(option),
4455
- selected: isSelected(option),
4456
- multiple: props.multiple
4457
- });
4458
- const boxClass = (option) => optionBoxClass(props.classes, {
4459
- selected: isSelected(option),
4460
- disabled: option.disabled === true
4461
- });
4462
- /**
4463
- * Spec "Select" → Behaviour: "The active option is scrolled into view with a 0.25rem margin
4464
- * whenever it changes" — the margin is the row's own `scroll-my-1`.
4465
- *
4466
- * It lives here rather than in either parent because it is the one part of "the active row" that
4467
- * needs an element, and the panel is what has the elements. Both controls get it from one copy.
4468
- */
4469
- function scrollActiveIntoView() {
4470
- const value = props.activeValue;
4471
- if (value === void 0 || typeof document === "undefined") return;
4472
- document.getElementById(props.optionId(value))?.scrollIntoView?.({ block: "nearest" });
4473
- }
4474
- onMounted(scrollActiveIntoView);
4475
- watch(() => props.activeValue, () => void nextTick(scrollActiveIntoView));
4476
- function onSearchInput(event) {
4477
- emit("search", event.target.value);
4478
- }
4479
- /**
4480
- * Anything inside the panel that wants the pointer's default action: it takes focus, or places a
4481
- * caret. The search field and — in a multi-select — the footer's Clear and Done buttons.
4482
- */
4483
- function onPanelMouseDown(event) {
4484
- const target = event.target;
4485
- if (target instanceof Element && target.closest(FOCUSABLE$1) !== null) return;
4486
- event.preventDefault();
4487
- }
4488
- return (_ctx, _cache) => {
4489
- return openBlock(), createElementBlock("div", {
4490
- ref_key: "root",
4491
- ref: root,
4492
- "data-eldra-slot": unref(eldra).slotHost("footer"),
4493
- id: __props.panelId,
4494
- "data-eldra-ui": "",
4495
- "data-eldra-scope": unref(eldra).scope,
4496
- "data-part": "panel",
4497
- "data-eldra-overlay-owner": __props.panelId,
4498
- class: normalizeClass(panelClasses.value),
4499
- style: normalizeStyle(__props.panelStyle),
4500
- "data-placement": __props.placement,
4501
- onMousedown: onPanelMouseDown
4502
- }, [
4503
- __props.searchable ? (openBlock(), createElementBlock("div", {
4504
- key: 0,
4505
- "data-eldra-scope": unref(eldra).scope,
4506
- class: "eldra:relative eldra:shrink-0 eldra:border-b eldra:border-[color:var(--eldra-select-panel-border,var(--eldra-color-border))]"
4507
- }, [_cache[3] || (_cache[3] = createElementVNode("svg", {
4508
- class: "eldra:pointer-events-none eldra:absolute eldra:inset-y-0 eldra:start-2.5 eldra:my-auto eldra:size-4 eldra:text-[color:var(--eldra-select-panel-muted,var(--eldra-color-muted))]",
4509
- viewBox: "0 0 24 24",
4510
- fill: "none",
4511
- stroke: "currentColor",
4512
- "stroke-width": "1.75",
4513
- "stroke-linecap": "round",
4514
- "stroke-linejoin": "round",
4515
- "aria-hidden": "true",
4516
- focusable: "false"
4517
- }, [createElementVNode("path", { d: "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" }), createElementVNode("path", { d: "M21 21l-6 -6" })], -1)), createElementVNode("input", {
4518
- ref_key: "searchInput",
4519
- ref: searchInput,
4520
- "data-part": "search",
4521
- type: "text",
4522
- role: "combobox",
4523
- class: normalizeClass(searchClasses.value),
4524
- value: __props.query,
4525
- placeholder: __props.searchPlaceholder,
4526
- "aria-label": __props.searchPlaceholder,
4527
- "aria-autocomplete": "list",
4528
- "aria-expanded": "true",
4529
- "aria-controls": __props.listboxId,
4530
- "aria-activedescendant": __props.activeValue === void 0 ? void 0 : __props.optionId(__props.activeValue),
4531
- autocomplete: "off",
4532
- spellcheck: "false",
4533
- onInput: onSearchInput,
4534
- onKeydown: _cache[0] || (_cache[0] = ($event) => emit("keydown", $event))
4535
- }, null, 42, _hoisted_3$9)], 8, _hoisted_2$9)) : createCommentVNode("", true),
4536
- createElementVNode("div", {
4537
- "data-eldra-scope": unref(eldra).scope,
4538
- id: __props.listboxId,
4539
- "data-part": "listbox",
4540
- role: "listbox",
4541
- class: normalizeClass(listboxClasses.value),
4542
- "aria-multiselectable": __props.multiple ? "true" : void 0,
4543
- "aria-labelledby": __props.labelledBy,
4544
- "aria-label": __props.fallbackLabel,
4545
- "aria-busy": __props.loading ? "true" : void 0,
4546
- onScrollPassive: onListScroll
4547
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.sections, (section, sectionIndex) => {
4548
- return openBlock(), createElementBlock("div", {
4549
- key: section.key,
4550
- "data-part": section.label ? "group" : void 0,
4551
- role: section.label ? "group" : "presentation",
4552
- class: normalizeClass(section.label ? unref(groupClass)(__props.classes, sectionIndex) : void 0),
4553
- "aria-labelledby": section.labelId
4554
- }, [section.label ? (openBlock(), createElementBlock("div", {
4555
- key: 0,
4556
- id: section.labelId,
4557
- "data-part": "groupLabel",
4558
- role: "presentation",
4559
- class: normalizeClass(unref(groupLabelClass)(__props.classes, sectionIndex))
4560
- }, toDisplayString(section.label), 11, _hoisted_6$5)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(section.options, (option) => {
4561
- return openBlock(), createElementBlock("div", {
4562
- key: option.value,
4563
- "data-eldra-slot": unref(eldra).slotHost("option", "optionContent"),
4564
- id: __props.optionId(option.value),
4565
- "data-part": "option",
4566
- role: "option",
4567
- class: normalizeClass(rowClass(option)),
4568
- "aria-selected": isSelected(option) ? "true" : "false",
4569
- "aria-disabled": option.disabled ? "true" : void 0,
4570
- onClick: ($event) => emit("select", option),
4571
- onMouseenter: ($event) => option.disabled ? void 0 : emit("activate", option.value)
4572
- }, [renderSlot(_ctx.$slots, "option", {
4573
- option,
4574
- selected: isSelected(option),
4575
- active: isActive(option)
4576
- }, () => [
4577
- __props.multiple ? (openBlock(), createElementBlock("span", {
4578
- key: 0,
4579
- "data-eldra-scope": unref(eldra).scope,
4580
- "data-part": "optionCheck",
4581
- class: normalizeClass(boxClass(option)),
4582
- "aria-hidden": "true"
4583
- }, [(openBlock(), createElementBlock("svg", {
4584
- class: normalizeClass(unref(optionTickClass)(isSelected(option))),
4585
- viewBox: "0 0 8 8",
4586
- fill: "none",
4587
- stroke: "currentColor",
4588
- "stroke-width": "2",
4589
- "stroke-linecap": "round",
4590
- "stroke-linejoin": "round",
4591
- "aria-hidden": "true",
4592
- focusable: "false"
4593
- }, [..._cache[4] || (_cache[4] = [createElementVNode("path", { d: "M1 4l2 2l4 -4" }, null, -1)])], 2))], 10, _hoisted_8$3)) : createCommentVNode("", true),
4594
- renderSlot(_ctx.$slots, "optionContent", {
4595
- option,
4596
- selected: isSelected(option),
4597
- active: isActive(option),
4598
- match: __props.highlights.get(option.value) ?? null
4599
- }, () => [
4600
- option.swatch ? (openBlock(), createElementBlock("span", {
4601
- key: 0,
4602
- "data-part": "optionSwatch",
4603
- class: normalizeClass(optionSwatchClasses.value),
4604
- style: normalizeStyle({ backgroundColor: option.swatch }),
4605
- "aria-hidden": "true"
4606
- }, null, 6)) : option.icon ? (openBlock(), createBlock(resolveDynamicComponent(option.icon), {
4607
- key: 1,
4608
- "data-eldra-scope": unref(eldra).scope,
4609
- "data-part": "optionIcon",
4610
- class: normalizeClass(optionIconClasses.value),
4611
- "stroke-width": unref(ICON_STROKE_WIDTH),
4612
- "aria-hidden": "true",
4613
- focusable: "false"
4614
- }, null, 8, [
4615
- "data-eldra-scope",
4616
- "class",
4617
- "stroke-width"
4618
- ])) : createCommentVNode("", true),
4619
- createElementVNode("span", _hoisted_9$3, [createElementVNode("span", {
4620
- "data-part": "optionLabel",
4621
- class: normalizeClass(unref(optionLabelClass)(__props.classes))
4622
- }, [__props.highlights.get(option.value) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
4623
- createTextVNode(toDisplayString(__props.highlights.get(option.value)?.before), 1),
4624
- createElementVNode("span", _hoisted_10$3, toDisplayString(__props.highlights.get(option.value)?.match), 1),
4625
- createTextVNode(toDisplayString(__props.highlights.get(option.value)?.after), 1)
4626
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(option.label), 1)], 64))], 2), option.hint ? (openBlock(), createElementBlock("span", {
4627
- key: 0,
4628
- "data-part": "optionHint",
4629
- class: normalizeClass(optionHintClasses.value)
4630
- }, toDisplayString(option.hint), 3)) : createCommentVNode("", true)]),
4631
- option.meta ? (openBlock(), createElementBlock("span", {
4632
- key: 2,
4633
- "data-part": "optionMeta",
4634
- class: normalizeClass(unref(optionMetaClass)(__props.classes, option))
4635
- }, toDisplayString(option.meta), 3)) : createCommentVNode("", true)
4636
- ]),
4637
- !__props.multiple && isSelected(option) ? (openBlock(), createElementBlock("svg", {
4638
- key: 1,
4639
- "data-eldra-scope": unref(eldra).scope,
4640
- "data-part": "optionCheck",
4641
- class: normalizeClass(optionCheckClasses.value),
4642
- viewBox: "0 0 24 24",
4643
- fill: "none",
4644
- stroke: "currentColor",
4645
- "stroke-width": "1.75",
4646
- "stroke-linecap": "round",
4647
- "stroke-linejoin": "round",
4648
- "aria-hidden": "true",
4649
- focusable: "false"
4650
- }, [..._cache[5] || (_cache[5] = [createElementVNode("path", { d: "M5 12l5 5l10 -10" }, null, -1)])], 10, _hoisted_11$3)) : createCommentVNode("", true)
4651
- ])], 42, _hoisted_7$3);
4652
- }), 128))], 10, _hoisted_5$7);
4653
- }), 128)), __props.createOption ? (openBlock(), createElementBlock("div", {
4654
- key: 0,
4655
- role: "presentation",
4656
- class: normalizeClass(__props.sections.length > 0 ? "eldra:mt-1 eldra:border-t eldra:border-[color:var(--eldra-select-panel-border,var(--eldra-color-border))] eldra:pt-1" : void 0)
4657
- }, [createElementVNode("div", {
4658
- id: __props.optionId(__props.createOption.value),
4659
- "data-part": "createOption",
4660
- role: "option",
4661
- "aria-selected": "false",
4662
- class: normalizeClass(createClasses.value),
4663
- onClick: _cache[1] || (_cache[1] = ($event) => emit("select", __props.createOption)),
4664
- onMouseenter: _cache[2] || (_cache[2] = ($event) => emit("activate", __props.createOption.value))
4665
- }, [(openBlock(), createElementBlock("svg", {
4666
- class: normalizeClass(optionIconClasses.value),
4667
- viewBox: "0 0 24 24",
4668
- fill: "none",
4669
- stroke: "currentColor",
4670
- "stroke-width": "1.75",
4671
- "stroke-linecap": "round",
4672
- "stroke-linejoin": "round",
4673
- "aria-hidden": "true",
4674
- focusable: "false"
4675
- }, [..._cache[6] || (_cache[6] = [createElementVNode("path", { d: "M12 5l0 14" }, null, -1), createElementVNode("path", { d: "M5 12l14 0" }, null, -1)])], 2)), createElementVNode("span", _hoisted_13$2, toDisplayString(__props.createText), 1)], 42, _hoisted_12$3)], 2)) : createCommentVNode("", true)], 42, _hoisted_4$8),
4676
- __props.loading ? (openBlock(), createElementBlock("div", {
4677
- key: 1,
4678
- "data-eldra-slot": unref(eldra).slotHost("loading"),
4679
- "data-eldra-scope": unref(eldra).scope,
4680
- "data-part": "loading",
4681
- role: "status",
4682
- class: normalizeClass(loadingClasses.value)
4683
- }, [createVNode(Spinner_default, { class: "eldra:size-4" }), renderSlot(_ctx.$slots, "loading", {}, () => [createTextVNode(toDisplayString(__props.loadingText), 1)])], 10, _hoisted_14$2)) : !__props.hasOptions ? (openBlock(), createElementBlock("div", {
4684
- key: 2,
4685
- "data-eldra-slot": unref(eldra).slotHost("empty"),
4686
- "data-eldra-scope": unref(eldra).scope,
4687
- "data-part": "empty",
4688
- class: normalizeClass(emptyClasses.value)
4689
- }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(__props.emptyText), 1)])], 10, _hoisted_15$1)) : createCommentVNode("", true),
4690
- renderSlot(_ctx.$slots, "footer")
4691
- ], 46, _hoisted_1$9);
4692
- };
4693
- }
4694
- });
4695
- // src/components/select/SelectTags.vue?vue&type=script&setup=true&lang.ts
4696
- var _hoisted_1$8 = [
4697
- "id",
4698
- "data-eldra-scope",
4699
- "aria-label",
4700
- "aria-labelledby"
4701
- ];
4702
- var _hoisted_2$8 = ["data-eldra-slot"];
4703
- var _hoisted_3$8 = ["data-eldra-slot"];
4704
- var _hoisted_4$7 = { class: "eldra:min-w-0 eldra:truncate" };
4705
- var _hoisted_5$6 = [
4706
- "data-eldra-scope",
4707
- "aria-label",
4708
- "onClick"
4709
- ];
4710
- // src/components/select/SelectTags.vue
4711
- var SelectTags_default = /* @__PURE__ */ defineComponent({
4712
- __name: "SelectTags",
3533
+ // src/components/select/SelectTags.vue
3534
+ var SelectTags_default = /* @__PURE__ */ defineComponent({
3535
+ __name: "SelectTags",
4713
3536
  props: {
4714
3537
  options: {},
4715
3538
  id: {},
@@ -4959,1025 +3782,6 @@ function useTagRows(field, maxRows, enabled, watched) {
4959
3782
  measure
4960
3783
  };
4961
3784
  }
4962
- // src/components/select/useListbox.ts
4963
- /** Spec Select → Keyboard, open: "`PageDown` / `PageUp` | Move by 10." */
4964
- var PAGE = 10;
4965
- /** Spec Select → Keyboard, closed: "the buffer resets after 0.6s". */
4966
- var TYPEAHEAD_RESET_MS = 600;
4967
- /**
4968
- * Case- and diacritic-insensitive, so the spec's "'island' finds 'Ísland'" holds for type-ahead
4969
- * and for the search field alike. `NFD` splits a letter from its accent and the range drops the
4970
- * combining marks that are left.
4971
- */
4972
- function normalizeText(text) {
4973
- return text.normalize("NFD").replaceAll(/[̀-ͯ]/g, "").toLowerCase();
4974
- }
4975
- /** A key that types a character, rather than a chord or a named key. */
4976
- function isPrintable(event) {
4977
- return event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;
4978
- }
4979
- function clamp(value, min, max) {
4980
- return value < min ? min : value > max ? max : value;
4981
- }
4982
- /**
4983
- * The keyboard and the active row of a listbox popup — everything in the design spec's Select →
4984
- * Keyboard tables that is not about *what* choosing a row does.
4985
- *
4986
- * It is separate from `Select.vue` on purpose. `MultiSelect` (the next component) has the same two
4987
- * keyboard tables with three differences — `Enter` toggles instead of choosing-and-closing,
4988
- * `Space` toggles, and the popup stays open — all of which are the caller's `select` callback and
4989
- * the caller's decision about closing. Everything else (arrow movement that skips disabled and
4990
- * filtered-out rows and stops at the ends, `PageUp`/`PageDown` by ten, `Home`/`End` unless a
4991
- * search field owns them, `Alt+ArrowUp`, `Escape` clearing a query before it closes, `Tab`
4992
- * closing without a choice, and type-ahead with a 0.6s buffer) is identical, and identical code
4993
- * that is written twice stops being identical.
4994
- *
4995
- * The composable owns no DOM. `aria-activedescendant` is `activeId`, which the caller binds to
4996
- * whichever element is focused — the trigger when there is no search field, the search field when
4997
- * there is — and scrolling the active row into view is the caller's, because only the caller knows
4998
- * which element a value maps to.
4999
- *
5000
- * ```ts
5001
- * const listbox = useListbox({
5002
- * options: () => visibleOptions.value,
5003
- * isOpen: () => open.value,
5004
- * searchable: () => searchable.value,
5005
- * optionId: (value) => `${id.value}-option-${value}`,
5006
- * open: (edge) => openPanel(edge),
5007
- * close: () => closePanel(),
5008
- * select: (option) => choose(option.value),
5009
- * });
5010
- * ```
5011
- */
5012
- function useListbox(options) {
5013
- const activeValue = ref(void 0);
5014
- const activeId = computed(() => activeValue.value === void 0 ? void 0 : options.optionId(activeValue.value));
5015
- /** Only enabled rows are reachable: "Arrow keys skip it" (Select → Variants, Disabled option). */
5016
- const enabled = () => options.options().filter((option) => !option.disabled);
5017
- const setActive = (value) => {
5018
- activeValue.value = value;
5019
- };
5020
- const first = () => setActive(enabled()[0]?.value);
5021
- const last = () => setActive(enabled().at(-1)?.value);
5022
- const activateFrom = (value) => {
5023
- const rows = enabled();
5024
- const match = rows.find((option) => option.value === value);
5025
- setActive((match ?? rows[0])?.value);
5026
- };
5027
- const move = (step) => {
5028
- const rows = enabled();
5029
- if (rows.length === 0) {
5030
- setActive(void 0);
5031
- return;
5032
- }
5033
- const index = rows.findIndex((option) => option.value === activeValue.value);
5034
- if (index === -1) {
5035
- setActive((step > 0 ? rows[0] : rows.at(-1))?.value);
5036
- return;
5037
- }
5038
- setActive(rows[clamp(index + step, 0, rows.length - 1)]?.value);
5039
- };
5040
- const selectActive = () => {
5041
- const option = options.options().find((row) => row.value === activeValue.value);
5042
- if (option === void 0 || option.disabled === true) return;
5043
- options.select(option);
5044
- };
5045
- let buffer = "";
5046
- let timer;
5047
- const resetTypeahead = () => {
5048
- buffer = "";
5049
- if (timer !== void 0) clearTimeout(timer);
5050
- timer = void 0;
5051
- };
5052
- onScopeDispose(resetTypeahead);
5053
- function typeahead(character, inclusive = false) {
5054
- buffer += character;
5055
- if (timer !== void 0) clearTimeout(timer);
5056
- timer = setTimeout(resetTypeahead, TYPEAHEAD_RESET_MS);
5057
- const rows = enabled();
5058
- if (rows.length === 0) return;
5059
- const prefix = normalizeText(buffer);
5060
- const current = rows.findIndex((option) => option.value === activeValue.value);
5061
- const from = buffer.length === 1 && !inclusive ? current + 1 : Math.max(current, 0);
5062
- for (let step = 0; step < rows.length; step += 1) {
5063
- const option = rows[(from + step + rows.length) % rows.length];
5064
- if (option !== void 0 && normalizeText(option.label).startsWith(prefix)) {
5065
- setActive(option.value);
5066
- return;
5067
- }
5068
- }
5069
- }
5070
- function onClosedKeydown(event) {
5071
- switch (event.key) {
5072
- case "ArrowDown":
5073
- case "Enter":
5074
- case " ":
5075
- event.preventDefault();
5076
- options.open("start");
5077
- return;
5078
- case "ArrowUp":
5079
- event.preventDefault();
5080
- options.open(options.searchable() ? "start" : "end");
5081
- return;
5082
- case "Backspace":
5083
- case "Delete":
5084
- if (options.clear?.() === true) event.preventDefault();
5085
- return;
5086
- default:
5087
- if (!isPrintable(event)) return;
5088
- event.preventDefault();
5089
- options.open("start");
5090
- if (options.searchable()) options.startQuery?.(event.key);
5091
- else typeahead(event.key, true);
5092
- }
5093
- }
5094
- function onOpenKeydown(event) {
5095
- switch (event.key) {
5096
- case "ArrowDown":
5097
- event.preventDefault();
5098
- move(1);
5099
- return;
5100
- case "ArrowUp":
5101
- event.preventDefault();
5102
- if (event.altKey) selectActive();
5103
- else move(-1);
5104
- return;
5105
- case "PageDown":
5106
- event.preventDefault();
5107
- move(PAGE);
5108
- return;
5109
- case "PageUp":
5110
- event.preventDefault();
5111
- move(-10);
5112
- return;
5113
- case "Home":
5114
- if (options.searchable()) return;
5115
- event.preventDefault();
5116
- first();
5117
- return;
5118
- case "End":
5119
- if (options.searchable()) return;
5120
- event.preventDefault();
5121
- last();
5122
- return;
5123
- case "Enter":
5124
- event.preventDefault();
5125
- selectActive();
5126
- return;
5127
- case " ":
5128
- if (options.searchable()) return;
5129
- event.preventDefault();
5130
- selectActive();
5131
- return;
5132
- case "Escape":
5133
- if (options.escape?.() !== true) return;
5134
- event.preventDefault();
5135
- event.stopPropagation();
5136
- return;
5137
- case "Tab":
5138
- options.close();
5139
- return;
5140
- default:
5141
- if (options.searchable() || !isPrintable(event)) return;
5142
- event.preventDefault();
5143
- typeahead(event.key);
5144
- }
5145
- }
5146
- function onKeydown(event) {
5147
- if (event.defaultPrevented) return;
5148
- if (options.isOpen()) {
5149
- onOpenKeydown(event);
5150
- return;
5151
- }
5152
- if (options.canOpen?.() === false) return;
5153
- onClosedKeydown(event);
5154
- }
5155
- return {
5156
- activeValue,
5157
- activeId,
5158
- setActive,
5159
- activateFrom,
5160
- first,
5161
- last,
5162
- move,
5163
- selectActive,
5164
- onKeydown,
5165
- resetTypeahead
5166
- };
5167
- }
5168
- // src/components/select/useOptionList.ts
5169
- /**
5170
- * Where a query matches inside a label, in **code points of the original string**.
5171
- *
5172
- * Matching is case- and diacritic-insensitive (the spec's "'island' finds 'Ísland'"), so the
5173
- * comparison happens on a normalised copy — and the match has to be reported back in the original
5174
- * string's own offsets, or the bold-and-underlined run would land on the wrong characters for any
5175
- * label holding an accent. Hence the per-character walk: each original code point contributes zero
5176
- * (a combining mark) or more normalised characters, and `positions` maps back.
5177
- */
5178
- function matchRange(label, rawQuery) {
5179
- const needle = normalizeText(rawQuery);
5180
- if (needle === "") return null;
5181
- const characters = [...label];
5182
- const positions = [];
5183
- let normalized = "";
5184
- for (const [index, character] of characters.entries()) {
5185
- const piece = normalizeText(character);
5186
- for (let step = 0; step < piece.length; step += 1) positions.push(index);
5187
- normalized += piece;
5188
- }
5189
- const at = normalized.indexOf(needle);
5190
- if (at === -1) return null;
5191
- return {
5192
- start: positions[at] ?? 0,
5193
- end: (positions[at + needle.length - 1] ?? characters.length - 1) + 1
5194
- };
5195
- }
5196
- /**
5197
- * Options bucketed by `group`, in the order each group first appears — so a "Most used" group
5198
- * written first stays first, which is exactly the spec's advice ("Put the 3 to 5 most likely
5199
- * answers first"). Options with no `group` form an unlabelled section of their own.
5200
- */
5201
- function groupOptions(list, idPrefix, controlId) {
5202
- const order = [];
5203
- const buckets = /* @__PURE__ */ new Map();
5204
- for (const option of list) {
5205
- const key = option.group ?? "";
5206
- let bucket = buckets.get(key);
5207
- if (bucket === void 0) {
5208
- bucket = [];
5209
- buckets.set(key, bucket);
5210
- order.push(key);
5211
- }
5212
- bucket.push(option);
5213
- }
5214
- return order.map((key, index) => ({
5215
- key: key === "" ? `${idPrefix}-plain-${index}` : `${idPrefix}-group-${key}`,
5216
- label: key === "" ? void 0 : key,
5217
- labelId: key === "" ? void 0 : `${controlId}-g${index}`,
5218
- options: buckets.get(key) ?? []
5219
- }));
5220
- }
5221
- /**
5222
- * The value of the "Create “query”" row a `creatable` control appends. A control character no
5223
- * merchant value holds, so it never collides with an option's own value.
5224
- */
5225
- var CREATE_VALUE = "\0eldra-create";
5226
- /**
5227
- * The list a select panel shows: filtering, grouping, match highlighting, the create row and the
5228
- * render batch.
5229
- *
5230
- * Shared by `Select` and `MultiSelect`, which differ in what choosing a row *does* and in nothing
5231
- * about which rows there are. No DOM; its one piece of state is how many rows are rendered.
5232
- */
5233
- function useOptionList(options) {
5234
- const trimmedQuery = computed(() => options.searchable() ? options.query().trim() : "");
5235
- const loading = computed(() => options.loading?.() === true);
5236
- /**
5237
- * The options a query leaves, in the consumer's order. Not returned: every caller wants them
5238
- * bucketed (`sections`) or in DOM order (`listOptions`), and a third view of the same list would
5239
- * only be a way to disagree with those two.
5240
- */
5241
- const visibleOptions = computed(() => {
5242
- if (loading.value) return [];
5243
- const trimmed = trimmedQuery.value;
5244
- if (trimmed === "") return options.options();
5245
- const needle = normalizeText(trimmed);
5246
- return options.options().filter((option) => matchRange(option.label, trimmed) !== null || option.keywords?.some((keyword) => normalizeText(keyword).includes(needle)) === true);
5247
- });
5248
- /** Every visible option in DOM order, before the render batch cuts it. */
5249
- const orderedOptions = computed(() => groupOptions(visibleOptions.value, "panel", options.controlId()).flatMap((section) => section.options));
5250
- const batchSize = () => {
5251
- const size = options.renderBatch?.();
5252
- return size === void 0 || !(size >= 1) ? Number.POSITIVE_INFINITY : Math.floor(size);
5253
- };
5254
- const rendered = ref(batchSize());
5255
- const resetBatch = () => {
5256
- rendered.value = batchSize();
5257
- };
5258
- const renderMore = () => {
5259
- if (rendered.value < orderedOptions.value.length) rendered.value += batchSize();
5260
- };
5261
- const reveal = (value) => {
5262
- if (value === void 0 || !Number.isFinite(rendered.value)) return;
5263
- const index = orderedOptions.value.findIndex((option) => option.value === value);
5264
- if (index < rendered.value) return;
5265
- const size = batchSize();
5266
- rendered.value = Math.ceil((index + 1) / size) * size;
5267
- };
5268
- watch(trimmedQuery, resetBatch);
5269
- watch(() => options.renderBatch?.(), resetBatch);
5270
- const renderedOptions = computed(() => Number.isFinite(rendered.value) ? orderedOptions.value.slice(0, rendered.value) : orderedOptions.value);
5271
- const sections = computed(() => groupOptions(renderedOptions.value, "panel", options.controlId()));
5272
- const nativeSections = computed(() => groupOptions(options.options(), "native", options.controlId()));
5273
- /**
5274
- * Spec-free addition: a query no option's label already equals can be offered as a new option.
5275
- * Equal ignoring case and accents, the same comparison the search itself makes, so "Shirt" is
5276
- * not offered beside an existing "shirt".
5277
- */
5278
- const createOption = computed(() => {
5279
- const trimmed = trimmedQuery.value;
5280
- if (options.creatable?.() !== true || loading.value || trimmed === "") return void 0;
5281
- const needle = normalizeText(trimmed);
5282
- if (options.options().some((option) => normalizeText(option.label) === needle)) return;
5283
- return {
5284
- value: CREATE_VALUE,
5285
- label: trimmed
5286
- };
5287
- });
5288
- const listOptions = computed(() => createOption.value === void 0 ? orderedOptions.value : [...orderedOptions.value, createOption.value]);
5289
- return {
5290
- sections,
5291
- nativeSections,
5292
- listOptions,
5293
- hasOptions: computed(() => listOptions.value.length > 0),
5294
- highlights: computed(() => {
5295
- const trimmed = trimmedQuery.value;
5296
- return new Map(renderedOptions.value.map((option) => {
5297
- const range = trimmed === "" ? null : matchRange(option.label, trimmed);
5298
- if (range === null) return [option.value, null];
5299
- const characters = [...option.label];
5300
- return [option.value, {
5301
- before: characters.slice(0, range.start).join(""),
5302
- match: characters.slice(range.start, range.end).join(""),
5303
- after: characters.slice(range.end).join("")
5304
- }];
5305
- }));
5306
- }),
5307
- createOption,
5308
- renderMore,
5309
- reveal,
5310
- resetBatch
5311
- };
5312
- }
5313
- // src/composables/useFloating.ts
5314
- /** What each of the spec's two named placements means to `@floating-ui/dom`. */
5315
- var RESOLVED = {
5316
- auto: {
5317
- placement: "bottom-start",
5318
- flip: true
5319
- },
5320
- above: {
5321
- placement: "top-start",
5322
- flip: false
5323
- },
5324
- bottom: {
5325
- placement: "bottom",
5326
- flip: true
5327
- },
5328
- "bottom-start": {
5329
- placement: "bottom-start",
5330
- flip: true
5331
- },
5332
- "bottom-end": {
5333
- placement: "bottom-end",
5334
- flip: true
5335
- },
5336
- top: {
5337
- placement: "top",
5338
- flip: true
5339
- },
5340
- "top-start": {
5341
- placement: "top-start",
5342
- flip: true
5343
- },
5344
- "top-end": {
5345
- placement: "top-end",
5346
- flip: true
5347
- },
5348
- left: {
5349
- placement: "left",
5350
- flip: true
5351
- },
5352
- "left-start": {
5353
- placement: "left-start",
5354
- flip: true
5355
- },
5356
- "left-end": {
5357
- placement: "left-end",
5358
- flip: true
5359
- },
5360
- right: {
5361
- placement: "right",
5362
- flip: true
5363
- },
5364
- "right-start": {
5365
- placement: "right-start",
5366
- flip: true
5367
- },
5368
- "right-end": {
5369
- placement: "right-end",
5370
- flip: true
5371
- }
5372
- };
5373
- /**
5374
- * Positions a floating panel against the element that opened it — the one piece of every popup in
5375
- * this package that has to measure the page.
5376
- *
5377
- * It is a thin wrap of `@floating-ui/vue`: `autoUpdate` keeps the position current while both
5378
- * elements are mounted (scrolling, resizing, an ancestor moving), `offset` sets the gap, `flip`
5379
- * turns the panel above the trigger when there is no room below, `shift` keeps it inside the
5380
- * viewport, and `size` measures the trigger for `matchWidth` (a floor on the panel's width — the
5381
- * spec lets a select's panel grow past its trigger up to its own `max-width` — or a floor and a
5382
- * ceiling under `'exact'`). What the wrap adds is the design spec's vocabulary (`auto` / `above`)
5383
- * and a plain style object rather than a transform, so a consumer writes `<div :style="styles">`
5384
- * and nothing else.
5385
- *
5386
- * `top` and `left` are used instead of the default `transform`, because a panel positioned by
5387
- * transform is blurry on fractional pixels and, more to the point, cannot then use `transform` for
5388
- * the spec's own open animation (fade + 0.25rem slide + a vertical scale from the top edge).
5389
- *
5390
- * ```ts
5391
- * const trigger = ref<HTMLElement | null>(null);
5392
- * const panel = ref<HTMLElement | null>(null);
5393
- * const { styles, placement } = useFloating(trigger, panel, { matchWidth: true });
5394
- * ```
5395
- *
5396
- * The reference may be a Floating UI **virtual element** (`{ getBoundingClientRect() }`), for a
5397
- * panel anchored to a caret or a pointer position rather than to a node; call `update()` after it
5398
- * moves, since nothing observes a virtual element's geometry.
5399
- */
5400
- function useFloating$1(reference, floating, options = {}) {
5401
- const resolved = computed(() => RESOLVED[toValue(options.placement) ?? "auto"]);
5402
- const exactWidth = options.matchWidth === "exact";
5403
- const matchWidth = options.matchWidth === true || exactWidth;
5404
- const referenceWidth = ref(0);
5405
- const middleware = computed(() => {
5406
- const list = [offset(toValue(options.offset) ?? 4)];
5407
- if (options.flip ?? resolved.value.flip) list.push(flip());
5408
- list.push(shift({ padding: toValue(options.padding) ?? 8 }));
5409
- if (matchWidth) list.push(size({ apply({ rects }) {
5410
- referenceWidth.value = rects.reference.width;
5411
- } }));
5412
- return list;
5413
- });
5414
- const position = useFloating(reference, floating, {
5415
- placement: computed(() => resolved.value.placement),
5416
- strategy: options.strategy ?? "absolute",
5417
- transform: false,
5418
- middleware,
5419
- whileElementsMounted: autoUpdate
5420
- });
5421
- return {
5422
- styles: computed(() => {
5423
- const base = {
5424
- position: position.strategy.value,
5425
- left: `${position.x.value}px`,
5426
- top: `${position.y.value}px`
5427
- };
5428
- if (matchWidth) base.minWidth = `${referenceWidth.value}px`;
5429
- if (exactWidth) base.maxWidth = `${referenceWidth.value}px`;
5430
- return base;
5431
- }),
5432
- placement: computed(() => position.placement.value),
5433
- update: position.update
5434
- };
5435
- }
5436
- // src/composables/teleportTarget.ts
5437
- /**
5438
- * Whether an element is a dialog the browser has put in its **top layer**.
5439
- *
5440
- * `:modal` is the only way to ask: a `<dialog>` has the `open` attribute whether it was shown with
5441
- * `show()` (an ordinary in-flow element, which clips and stacks like any other) or with
5442
- * `showModal()` (top layer, above every z-index, with a backdrop), and nothing else in the DOM
5443
- * tells the two apart. Engines that do not implement `:modal` answer `false` here — happy-dom
5444
- * parses the selector and never matches it, jsdom does not implement `<dialog>` modality at all —
5445
- * which is what the caller's fallback is for.
5446
- *
5447
- * Wrapped in a `try`: a selector an engine cannot parse is a `SyntaxError`, not a `false`.
5448
- */
5449
- function isTopLayer(element) {
5450
- try {
5451
- return element.matches(":modal");
5452
- } catch {
5453
- return false;
5454
- }
5455
- }
5456
- /**
5457
- * The `<dialog>` a popup anchored to `anchor` has to be teleported *into* rather than escape, or
5458
- * `null` when there is none.
5459
- *
5460
- * A **modal** dialog is the one place `document.body` is the wrong target: the dialog is in the top
5461
- * layer, so a popup on the body would be painted behind it and no `z-index` could raise it. So the
5462
- * nearest open ancestor dialog that is actually in the top layer wins — which is not always the
5463
- * nearest one, since a non-modal `<dialog open>` may sit inside a modal one.
5464
- *
5465
- * When **no** ancestor dialog claims the top layer, the nearest open one is still the answer. That
5466
- * case is ambiguous — either they really are all non-modal, or the engine does not implement
5467
- * `:modal` and cannot say — and the two mistakes are not equally bad. Teleporting into a dialog
5468
- * that did not need it still escapes everything between the control and that dialog, and the
5469
- * dialog is a box the popup had no business overflowing anyway; teleporting to `body` out of a
5470
- * dialog that *was* modal puts the popup behind it, invisibly, which is the very bug this whole
5471
- * mechanism exists to fix. There is no engine-independent probe to break the tie —
5472
- * `CSS.supports('selector(:modal)')` answers `true` for nonsense in happy-dom — so the safe
5473
- * mistake is the one taken. A non-modal `<dialog open>` is in any case close to hypothetical here:
5474
- * the design spec's non-negotiable 2 opens every modal surface with `showModal()`, and says the
5475
- * non-modal popups are not dialogs at all.
5476
- */
5477
- function topLayerDialog(anchor) {
5478
- const nearest = anchor.closest("dialog[open]");
5479
- if (nearest === null) return null;
5480
- for (let dialog = nearest; dialog !== null; dialog = dialog.parentElement?.closest("dialog[open]") ?? null) if (isTopLayer(dialog)) return dialog;
5481
- return nearest;
5482
- }
5483
- /**
5484
- * Where a teleported popup is rendered: `usePopover`'s and `Tooltip`'s shared answer to "escape
5485
- * clipping and stacking, but not the browser's own top layer."
5486
- *
5487
- * A panel (or bubble) rendered inside its own control is at the mercy of everything above it: an
5488
- * ancestor with `overflow: hidden` (a card, a table cell, a carousel track) clips it, and any later
5489
- * sibling that starts a stacking context (a sticky header with a `z-index`, a section with
5490
- * `isolate`) paints over it however high its own `z-index` is. On `body` neither can happen — except
5491
- * for a native `<dialog>` opened with `showModal()`, which renders in the top layer above every
5492
- * `z-index` on the page, so a popup teleported to `body` out from under one would be invisible
5493
- * behind it. `topLayerDialog` is the one exception that rule needs.
5494
- *
5495
- * ```ts
5496
- * const isOpen = ref(false);
5497
- * const trigger = ref<HTMLElement | null>(null);
5498
- * const { teleportTo, teleportDisabled } = useTeleportTarget({ trigger, teleport: true, isOpen });
5499
- * ```
5500
- */
5501
- function useTeleportTarget(options) {
5502
- const { trigger, teleport, isOpen } = options;
5503
- /**
5504
- * Only `true` after `onMounted`, which never runs on the server. Everything that reads the
5505
- * document below is behind it.
5506
- */
5507
- const isMounted = ref(false);
5508
- onMounted(() => {
5509
- isMounted.value = true;
5510
- });
5511
- const teleportDisabled = computed(() => teleport === false || !isMounted.value);
5512
- return {
5513
- teleportTo: computed(() => {
5514
- if (!isMounted.value) return "body";
5515
- if (typeof teleport === "string") return teleport;
5516
- isOpen.value;
5517
- const anchor = trigger.value;
5518
- return (anchor === null ? null : topLayerDialog(anchor)) ?? document.body;
5519
- }),
5520
- teleportDisabled
5521
- };
5522
- }
5523
- // src/composables/useOverlay.ts
5524
- /**
5525
- * Anything the platform lets a user reach with `Tab`, plus the elements a component has opted in
5526
- * with a `tabindex`. `tabindex="-1"` is deliberately excluded: it is programmatically focusable,
5527
- * not part of the sequence a keyboard user walks, and `focusFirst()` exists to put focus where a
5528
- * user would have put it themselves.
5529
- */
5530
- var FOCUSABLE = "a[href], area[href], button, input, select, textarea, details > summary:first-of-type, iframe, audio[controls], video[controls], [contenteditable]:not([contenteditable=\"false\"]), [tabindex]:not([tabindex^=\"-\"])";
5531
- /**
5532
- * Marks an element that belongs to an overlay whose content element has this `id`.
5533
- *
5534
- * Exported for `usePopover`, which has to find those elements rather than only recognise one it is
5535
- * handed: a teleported panel's `Tab` walk runs through them (see its `tabRedirect` option).
5536
- */
5537
- var OVERLAY_OWNER_ATTRIBUTE = "data-eldra-overlay-owner";
5538
- var read = (setting, fallback) => setting === void 0 ? fallback : typeof setting === "function" ? setting() : setting;
5539
- /**
5540
- * The closing and focus rules shared by every **non-modal** popup in this package — the Select and
5541
- * Multi-select panels, the Search bar's results panel, menus.
5542
- *
5543
- * Non-modal is the whole point. The design spec's non-negotiables put every *modal* surface in a
5544
- * native `<dialog>` opened with `showModal()`, and say in the same breath that these popups are not
5545
- * dialogs: "Non-modal popups (select panels, search results panel, mega-menus, tooltips) are **not**
5546
- * dialogs." So there is no focus trap here and no `Tab` cycling — `Tab` simply moves on, and focus
5547
- * landing outside is what closes the popup (WCAG 2.1.2: no keyboard trap). Everything this
5548
- * composable does is close at the right moment and leave focus somewhere sensible.
5549
- *
5550
- * What it listens for, and only while `open` is `true`:
5551
- *
5552
- * - **A pointer press outside** (`pointerdown`, captured, so a handler inside the page that stops
5553
- * propagation cannot hide the press from us). Inside is the trigger, the content, and anything
5554
- * under an element carrying `data-eldra-overlay-owner="<the content's id>"` — which is how a
5555
- * panel rendered through a `<Teleport>` still counts as part of the overlay. Closing this way
5556
- * never moves focus: the user is pressing something else, and pulling focus back to the trigger
5557
- * would take it off whatever they just pressed.
5558
- * - **Focus leaving** (`focusout`). If the new focus owner is outside the overlay, the popup
5559
- * closes and focus stays where the user sent it. If focus went *nowhere* (`relatedTarget` is
5560
- * `null` — the content is about to be removed from under it), `returnFocus` puts it back on the
5561
- * trigger rather than letting it fall to `<body>`.
5562
- * - **`Escape`** (`keydown`, bubbling, so a component that wants the first go at `Escape` — the
5563
- * Select clears its search query before it closes — can handle it and stop propagation). It
5564
- * closes, returns focus to the trigger, and both `preventDefault()`s and stops propagation: a
5565
- * popup inside a native `<dialog>` must consume the key, or the dialog closes behind it.
5566
- *
5567
- * Listeners go on `document` when the overlay opens and come off when it closes or the scope is
5568
- * disposed, so a closed overlay costs nothing and an unmounted one leaves nothing behind. Nothing
5569
- * touches the DOM during SSR.
5570
- *
5571
- * ```ts
5572
- * const open = ref(false);
5573
- * const trigger = ref<HTMLElement | null>(null);
5574
- * const content = ref<HTMLElement | null>(null);
5575
- * const overlay = useOverlay({ open, trigger, content, setOpen: (next) => (open.value = next) });
5576
- * ```
5577
- */
5578
- function useOverlay(options) {
5579
- const { open, trigger, content, setOpen } = options;
5580
- const closeOnOutsideClick = () => read(options.closeOnOutsideClick, true);
5581
- const closeOnFocusOutside = () => read(options.closeOnFocusOutside, closeOnOutsideClick());
5582
- const closeOnEscape = () => read(options.closeOnEscape, true);
5583
- const returnFocus = () => read(options.returnFocus, true);
5584
- const focusables = (from) => {
5585
- const root = from === void 0 ? content.value : from;
5586
- if (!root) return [];
5587
- return [root, ...root.querySelectorAll(FOCUSABLE)].filter((element) => element.matches(FOCUSABLE) && element.tabIndex >= 0 && !element.hasAttribute("disabled") && element.getAttribute("aria-hidden") !== "true" && element.closest("[hidden]") === null);
5588
- };
5589
- const focusFirst = () => {
5590
- focusables()[0]?.focus();
5591
- };
5592
- const close = () => setOpen(false);
5593
- /**
5594
- * A teleported part of the overlay is in the DOM somewhere else entirely, so containment says
5595
- * nothing about it. It is claimed one of two ways, both followed transitively:
5596
- *
5597
- * - **An owner marker**: an ancestor carrying `data-eldra-overlay-owner` names the content's id —
5598
- * or the id of any element that is itself inside this overlay, so a picker teleported out of a
5599
- * panel can point at the field inside the panel it belongs to.
5600
- * - **An open control inside the overlay**: an element with `aria-expanded="true"` inside this
5601
- * overlay names, in `aria-controls`, an element in the node's popup — the owner-marked panel
5602
- * that element sits in, or the element itself. That is a nested popup (a `Select` or another
5603
- * `Popover` opened from this panel) whose own panel is teleported too.
5604
- *
5605
- * Walked by hand rather than through selectors so an id with a character CSS would have to
5606
- * escape cannot break the check.
5607
- */
5608
- const isInside = (node, visited = /* @__PURE__ */ new Set()) => {
5609
- if (!(node instanceof Node) || visited.has(node)) return false;
5610
- visited.add(node);
5611
- if (trigger.value?.contains(node) === true) return true;
5612
- if (content.value?.contains(node) === true) return true;
5613
- const id = content.value?.id;
5614
- if (id === void 0 || id === "" || typeof document === "undefined") return false;
5615
- for (let element = node instanceof Element ? node : node.parentElement; element !== null; element = element.parentElement) {
5616
- const owner = element.getAttribute(OVERLAY_OWNER_ATTRIBUTE);
5617
- if (owner === id) return true;
5618
- if (owner === null || owner === "") continue;
5619
- const named = document.getElementById(owner);
5620
- if (named !== null && !named.contains(element) && isInside(named, visited)) return true;
5621
- }
5622
- for (const control of document.querySelectorAll("[aria-controls]")) {
5623
- if (control.getAttribute("aria-expanded") !== "true" || control.contains(node)) continue;
5624
- for (const controlled of (control.getAttribute("aria-controls") ?? "").split(/\s+/)) {
5625
- const target = controlled === "" ? null : document.getElementById(controlled);
5626
- if (target === null) continue;
5627
- const popup = target.closest(`[data-eldra-overlay-owner]`) ?? target;
5628
- if (!popup.contains(node) || popup.contains(control)) continue;
5629
- if (isInside(control, visited)) return true;
5630
- }
5631
- }
5632
- return false;
5633
- };
5634
- const onPointerDown = (event) => {
5635
- if (!open.value || !closeOnOutsideClick() || isInside(event.target)) return;
5636
- close();
5637
- };
5638
- const onFocusOut = (event) => {
5639
- if (!open.value || !closeOnFocusOutside()) return;
5640
- if (!isInside(event.target)) return;
5641
- const next = event.relatedTarget;
5642
- if (isInside(next)) return;
5643
- close();
5644
- if (returnFocus() && next === null) trigger.value?.focus();
5645
- };
5646
- const onKeyDown = (event) => {
5647
- if (!open.value || event.key !== "Escape" || !closeOnEscape()) return;
5648
- event.preventDefault();
5649
- event.stopPropagation();
5650
- close();
5651
- if (returnFocus()) trigger.value?.focus();
5652
- };
5653
- let listening = false;
5654
- const attach = () => {
5655
- if (listening || typeof document === "undefined") return;
5656
- listening = true;
5657
- document.addEventListener("pointerdown", onPointerDown, true);
5658
- document.addEventListener("focusout", onFocusOut);
5659
- document.addEventListener("keydown", onKeyDown);
5660
- };
5661
- const detach = () => {
5662
- if (!listening) return;
5663
- listening = false;
5664
- document.removeEventListener("pointerdown", onPointerDown, true);
5665
- document.removeEventListener("focusout", onFocusOut);
5666
- document.removeEventListener("keydown", onKeyDown);
5667
- };
5668
- watch(open, (isOpen) => isOpen ? attach() : detach(), { immediate: true });
5669
- onScopeDispose(detach);
5670
- return {
5671
- close,
5672
- focusFirst,
5673
- focusables,
5674
- isInside: (node) => isInside(node)
5675
- };
5676
- }
5677
- // src/components/select/openRegistry.ts
5678
- /**
5679
- * The open popups, outermost first. Without nesting it never holds more than one entry; a popup
5680
- * opened from inside another's panel is stacked on it instead of closing it.
5681
- */
5682
- var stack = [];
5683
- /**
5684
- * Claim the slot and close whatever held it — except the popups the new one is nested in.
5685
- *
5686
- * The slot is reassigned *before* the previous popups are closed, so the `unregisterOpen` that
5687
- * closing triggers sees a slot that is no longer its own and leaves the new owner alone.
5688
- */
5689
- function registerOpen(close, options = {}) {
5690
- if (stack.at(-1)?.close === close) return;
5691
- const { anchor } = options;
5692
- const kept = [];
5693
- const closed = [];
5694
- for (const entry of stack) {
5695
- if (entry.close === close) continue;
5696
- (anchor !== void 0 && anchor !== null && entry.contains?.(anchor) === true ? kept : closed).push(entry);
5697
- }
5698
- stack = [...kept, {
5699
- close,
5700
- contains: options.contains
5701
- }];
5702
- for (const entry of closed) entry.close();
5703
- }
5704
- /** Release the slot, if it is still this popup's. */
5705
- function unregisterOpen(close) {
5706
- stack = stack.filter((entry) => entry.close !== close);
5707
- }
5708
- // src/components/select/usePopover.ts
5709
- /**
5710
- * The open/closed life of a **non-modal popup** anchored to a control: `Select`'s panel,
5711
- * `MultiSelect`'s, and the `SearchBar`'s results panel.
5712
- *
5713
- * Every one of them needs the same six things, and before this composable the first two controls
5714
- * held a line-identical copy of all of them:
5715
- *
5716
- * - **"Only one open at a time"** (`openRegistry`): opening claims a module-level slot and closes
5717
- * whatever held it. The handle is stable per instance, so a late close cannot blank out the
5718
- * popup that took its place.
5719
- * - **Closing** (`useOverlay`): an outside pointer press, focus leaving, `Escape`. Non-modal, so
5720
- * nothing is trapped and `Tab` always moves on.
5721
- * - **Getting out of the way of the page** (`teleport`): the panel is rendered through a
5722
- * `<Teleport>` to `body` — or to the modal `<dialog>` the trigger is in, which is the one place
5723
- * `body` would be *behind* — and positioned with floating-ui's `fixed` strategy, so no ancestor's
5724
- * `overflow: hidden` clips it and no later stacking context paints over it. `tabRedirect` puts a
5725
- * panel that has real tab stops back into the `Tab` walk it left with its place in the DOM.
5726
- * - **Positioning** (`useFloating`), plus the `--eldra-popover-origin` the entrance keyframes read,
5727
- * so a panel that flips after floating-ui measures changes a custom property rather than its
5728
- * `animation-name` (which would replay the entrance).
5729
- * - **The open sequence**: open, make a row active, and — only when the call actually changed the
5730
- * state — run `afterOpen` a tick later, which is where focus moves into the panel.
5731
- * - **The label-forwarded-click latch**: a `<label for>` naming the trigger forwards its click to
5732
- * it, and the spec is explicit that clicking a field's label focuses the control **without**
5733
- * opening it. A forwarded click differs from a real one in that no pointer was pressed on the
5734
- * trigger and its `detail` is 0. The latch is armed on `pointerdown` and released on the
5735
- * `pointerup` or `pointercancel` that follows, wherever it lands: a press that ends off the
5736
- * trigger (a drag, a cancelled touch) would otherwise leave the latch standing and arm the
5737
- * *next* click. A programmatic `element.click()` has the same shape, so it is told apart by what
5738
- * it is not (see `isProgrammaticClick`): not forwarded from a label clicked in the same task,
5739
- * not trusted, and a `PointerEvent`, which is what `click()` dispatches.
5740
- *
5741
- * What stays with each control is what actually differs: which rows there are, what choosing one
5742
- * does, and which element the popup is anchored to.
5743
- */
5744
- /**
5745
- * The control a `<label>` click is about to forward to, until the task that clicked it ends. A
5746
- * label's activation behaviour fires its forwarded click synchronously after its own click's
5747
- * dispatch, so a capture listener on `document` sees the label's click first. One listener for the
5748
- * whole page, attached on first use in a browser.
5749
- */
5750
- var forwardingTo = null;
5751
- var labelWatcherAttached = false;
5752
- function watchLabelClicks() {
5753
- if (labelWatcherAttached || typeof document === "undefined") return;
5754
- labelWatcherAttached = true;
5755
- document.addEventListener("click", (event) => {
5756
- const target = event.target;
5757
- if (!(target instanceof Element)) return;
5758
- const control = target.closest("label")?.control ?? null;
5759
- if (!(control instanceof HTMLElement) || control.contains(target)) return;
5760
- forwardingTo = control;
5761
- setTimeout(() => {
5762
- if (forwardingTo === control) forwardingTo = null;
5763
- }, 0);
5764
- }, true);
5765
- }
5766
- /**
5767
- * Whether a click with no pointer press behind it came from code (`trigger.click()`) rather than a
5768
- * `<label>` forwarding its own: not forwarded from a label clicked in this task, untrusted (a
5769
- * user's label click forwards a trusted one), and a `PointerEvent`, which is what `click()`
5770
- * dispatches. A bare `dispatchEvent(new MouseEvent('click'))` keeps counting as forwarded, as it
5771
- * always has; so does every click in an engine whose `click()` still sends a `MouseEvent`.
5772
- */
5773
- function isProgrammaticClick(event, trigger) {
5774
- if (trigger !== null && forwardingTo !== null && trigger.contains(forwardingTo)) return false;
5775
- return !event.isTrusted && typeof PointerEvent !== "undefined" && event instanceof PointerEvent;
5776
- }
5777
- function usePopover(options) {
5778
- const { trigger, content } = options;
5779
- watchLabelClicks();
5780
- const canOpen = () => options.canOpen?.() !== false;
5781
- const isOpen = ref(false);
5782
- const isExclusive = () => {
5783
- const setting = options.exclusive ?? true;
5784
- return typeof setting === "function" ? setting() : setting;
5785
- };
5786
- /** The `anchor`, when it is a real element rather than a virtual one. */
5787
- const anchorElement = () => {
5788
- const anchor = options.anchor?.value ?? null;
5789
- return typeof HTMLElement !== "undefined" && anchor instanceof HTMLElement ? anchor : null;
5790
- };
5791
- /** The registry's handle on this popup. Stable, so the registry can tell ours from another's. */
5792
- const closeFromRegistry = () => setOpen(false);
5793
- function setOpen(next) {
5794
- if (next === isOpen.value) return;
5795
- if (next) {
5796
- if (!canOpen()) return;
5797
- isOpen.value = true;
5798
- if (isExclusive()) registerOpen(closeFromRegistry, {
5799
- anchor: trigger.value ?? anchorElement(),
5800
- contains: (node) => overlay.isInside(node)
5801
- });
5802
- options.onOpen?.();
5803
- return;
5804
- }
5805
- isOpen.value = false;
5806
- unregisterOpen(closeFromRegistry);
5807
- options.onClose?.();
5808
- }
5809
- const overlay = useOverlay({
5810
- open: isOpen,
5811
- trigger,
5812
- content,
5813
- setOpen: (next) => setOpen(next),
5814
- closeOnOutsideClick: options.closeOnOutsideClick,
5815
- closeOnFocusOutside: options.closeOnFocusOutside,
5816
- closeOnEscape: options.closeOnEscape,
5817
- returnFocus: options.returnFocus
5818
- });
5819
- const teleport = options.teleport ?? true;
5820
- const { teleportTo, teleportDisabled } = useTeleportTarget({
5821
- trigger: computed(() => trigger.value ?? anchorElement()),
5822
- teleport,
5823
- isOpen
5824
- });
5825
- const { styles: floatingStyles, placement, update } = useFloating$1(computed(() => options.anchor?.value ?? trigger.value), content, {
5826
- placement: options.placement ?? "auto",
5827
- offset: options.offset,
5828
- padding: options.padding,
5829
- matchWidth: options.matchWidth,
5830
- strategy: teleport === false ? "absolute" : "fixed"
5831
- });
5832
- const wantsTabRedirect = () => {
5833
- const setting = options.tabRedirect ?? false;
5834
- return typeof setting === "function" ? setting() : setting;
5835
- };
5836
- /**
5837
- * Every tab stop of this overlay that is **not** in the panel, in document order — the trigger,
5838
- * plus anything claiming the panel's id with `data-eldra-overlay-owner` (a multi-select's clear
5839
- * button). These keep their natural place in the walk: the redirect happens at the **last** of
5840
- * them, so `Tab` still passes each one on the way to the panel.
5841
- *
5842
- * The owner elements are found with a plain attribute-presence selector and filtered by value in
5843
- * JavaScript, for the reason `useOverlay` walks the attribute by hand: an id is merchant-settable
5844
- * through the `id` prop, and one holding a character CSS would need escaped must not break this.
5845
- */
5846
- function stopsBeforePanel(panel) {
5847
- const roots = [];
5848
- if (trigger.value !== null) roots.push(trigger.value);
5849
- const id = panel.id;
5850
- if (id !== "") for (const owner of document.querySelectorAll(`[${OVERLAY_OWNER_ATTRIBUTE}]`)) {
5851
- if (owner.getAttribute("data-eldra-overlay-owner") !== id) continue;
5852
- if (panel.contains(owner) || roots.includes(owner)) continue;
5853
- roots.push(owner);
5854
- }
5855
- return roots.flatMap((root) => overlay.focusables(root)).sort((a, b) => (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) === 0 ? 1 : -1);
5856
- }
5857
- /**
5858
- * The two boundary keystrokes of the walk described on the `tabRedirect` option: into the panel
5859
- * from the last tab stop the control still holds, and back out of the panel's first row to that
5860
- * same stop. Everything else about `Tab` is left to the browser, which is what keeps this a
5861
- * redirect rather than a trap — including the steps *within* the control, so a multi-select's
5862
- * clear button is passed on the way in and returned to on the way back.
5863
- *
5864
- * It listens in the **capture** phase, before the control's own `keydown` reaches its handler:
5865
- * `useListbox`'s `Tab` case asks the caller to close (the `SearchBar` does), and a popup that has
5866
- * already closed has nothing left to walk into. Propagation is stopped only on the two keystrokes
5867
- * actually redirected, so every other `Tab` arrives at the control untouched.
5868
- */
5869
- function onTabKeyDown(event) {
5870
- if (event.key !== "Tab" || event.altKey || event.ctrlKey || event.metaKey) return;
5871
- if (!isOpen.value || teleportDisabled.value || !wantsTabRedirect()) return;
5872
- const panel = content.value;
5873
- const active = document.activeElement;
5874
- if (panel === null || active === null) return;
5875
- const first = overlay.focusables()[0];
5876
- if (first === void 0) return;
5877
- const last = stopsBeforePanel(panel).at(-1);
5878
- if (event.shiftKey) {
5879
- if (active !== first) return;
5880
- event.preventDefault();
5881
- event.stopPropagation();
5882
- (last ?? trigger.value)?.focus();
5883
- return;
5884
- }
5885
- if (panel.contains(active) || !overlay.isInside(active)) return;
5886
- if (last !== void 0 && active !== last) return;
5887
- event.preventDefault();
5888
- event.stopPropagation();
5889
- first.focus();
5890
- }
5891
- const attachTabRedirect = () => {
5892
- if (typeof document === "undefined") return;
5893
- document.addEventListener("keydown", onTabKeyDown, true);
5894
- };
5895
- const detachTabRedirect = () => {
5896
- if (typeof document === "undefined") return;
5897
- document.removeEventListener("keydown", onTabKeyDown, true);
5898
- };
5899
- watch(isOpen, (open) => open ? attachTabRedirect() : detachTabRedirect(), { immediate: true });
5900
- function open(activate) {
5901
- if (!canOpen()) return;
5902
- const wasOpen = isOpen.value;
5903
- setOpen(true);
5904
- if (!isOpen.value) return;
5905
- activate?.(wasOpen);
5906
- if (!wasOpen) options.afterOpen?.();
5907
- }
5908
- function close(returnFocus = true) {
5909
- if (!isOpen.value) return;
5910
- setOpen(false);
5911
- if (returnFocus) trigger.value?.focus();
5912
- }
5913
- let pressedTrigger = false;
5914
- function releaseTrigger(event) {
5915
- detachTriggerRelease();
5916
- const target = event.target;
5917
- if (target instanceof Node && trigger.value?.contains(target) === true) return;
5918
- pressedTrigger = false;
5919
- }
5920
- function detachTriggerRelease() {
5921
- if (typeof document === "undefined") return;
5922
- document.removeEventListener("pointerup", releaseTrigger, true);
5923
- document.removeEventListener("pointercancel", releaseTrigger, true);
5924
- }
5925
- function onTriggerPointerDown() {
5926
- pressedTrigger = true;
5927
- if (typeof document === "undefined") return;
5928
- document.addEventListener("pointerup", releaseTrigger, true);
5929
- document.addEventListener("pointercancel", releaseTrigger, true);
5930
- }
5931
- function onTriggerClick(event) {
5932
- const fromPointer = pressedTrigger || event.detail > 0 || isProgrammaticClick(event, trigger.value);
5933
- pressedTrigger = false;
5934
- if (!canOpen()) return;
5935
- if (!fromPointer) {
5936
- trigger.value?.focus();
5937
- return;
5938
- }
5939
- if (isOpen.value) close();
5940
- else options.openFromPointer?.();
5941
- }
5942
- onBeforeUnmount(() => {
5943
- unregisterOpen(closeFromRegistry);
5944
- detachTriggerRelease();
5945
- detachTabRedirect();
5946
- });
5947
- /**
5948
- * Which corner the panel grows from: the one it is anchored by, so the entrance reads as the
5949
- * control opening out rather than as a box arriving from somewhere. A panel below the control
5950
- * grows from `top left`, a flipped one from `bottom left`. A custom property rather than a second
5951
- * animation class: see the composable's own comment above, and the keyframes in `tailwind.css`.
5952
- *
5953
- * Logical directions are deliberately not used. `transform-origin` takes physical keywords only
5954
- * (`left`/`right`, never `inline-start`), and every panel in this package is `start`-aligned and
5955
- * at least as wide as its control, so the horizontal half barely moves the result either way.
5956
- */
5957
- const origin = computed(() => {
5958
- if (placement.value.startsWith("top")) return "bottom left";
5959
- if (placement.value.startsWith("left")) return "top right";
5960
- return "top left";
5961
- });
5962
- return {
5963
- isOpen,
5964
- setOpen,
5965
- open,
5966
- close,
5967
- panelStyle: computed(() => ({
5968
- ...floatingStyles.value,
5969
- "--eldra-popover-origin": origin.value
5970
- })),
5971
- placement,
5972
- teleportTo,
5973
- teleportDisabled,
5974
- onTriggerPointerDown,
5975
- onTriggerClick,
5976
- focusFirst: overlay.focusFirst,
5977
- isInside: overlay.isInside,
5978
- update
5979
- };
5980
- }
5981
3785
  // src/components/select/MultiSelect.vue?vue&type=script&setup=true&lang.ts
5982
3786
  var _hoisted_1$7 = ["data-eldra-scope"];
5983
3787
  var _hoisted_2$7 = ["data-part", "data-eldra-overlay-owner"];
@@ -5997,7 +3801,7 @@ var _hoisted_4$6 = [
5997
3801
  ];
5998
3802
  var _hoisted_5$5 = ["data-eldra-slot"];
5999
3803
  var _hoisted_6$4 = ["data-placeholder"];
6000
- var _hoisted_7$2 = ["data-eldra-slot"];
3804
+ var _hoisted_7$3 = ["data-eldra-slot"];
6001
3805
  var _hoisted_8$2 = {
6002
3806
  key: 0,
6003
3807
  class: "eldra:min-w-0 eldra:truncate"
@@ -6540,7 +4344,7 @@ var MultiSelect_default = /* @__PURE__ */ defineComponent({
6540
4344
  }, () => [__props.leadingIcon ? (openBlock(), createBlock(resolveDynamicComponent(__props.leadingIcon), {
6541
4345
  key: 0,
6542
4346
  class: "eldra:size-4.5 eldra:shrink-0",
6543
- "stroke-width": unref(ICON_STROKE_WIDTH),
4347
+ "stroke-width": unref(ICON_STROKE_WIDTH$1),
6544
4348
  "aria-hidden": "true",
6545
4349
  focusable: "false"
6546
4350
  }, null, 8, ["stroke-width"])) : createCommentVNode("", true)])], 10, _hoisted_3$7)) : createCommentVNode("", true),
@@ -6616,7 +4420,7 @@ var MultiSelect_default = /* @__PURE__ */ defineComponent({
6616
4420
  }, () => [__props.leadingIcon ? (openBlock(), createBlock(resolveDynamicComponent(__props.leadingIcon), {
6617
4421
  key: 0,
6618
4422
  class: "eldra:size-4.5 eldra:shrink-0",
6619
- "stroke-width": unref(ICON_STROKE_WIDTH),
4423
+ "stroke-width": unref(ICON_STROKE_WIDTH$1),
6620
4424
  "aria-hidden": "true",
6621
4425
  focusable: "false"
6622
4426
  }, null, 8, ["stroke-width"])) : createCommentVNode("", true)])], 10, _hoisted_5$5)) : createCommentVNode("", true),
@@ -6638,7 +4442,7 @@ var MultiSelect_default = /* @__PURE__ */ defineComponent({
6638
4442
  key: 1,
6639
4443
  "data-part": "summaryMore",
6640
4444
  class: normalizeClass(summaryMoreClass.value)
6641
- }, toDisplayString(unref(m).moreSelected(moreCount.value)), 3)) : createCommentVNode("", true)])], 10, _hoisted_7$2), fitsSummary.value && unref(summaryFit).mounted.value ? (openBlock(), createElementBlock("span", {
4445
+ }, toDisplayString(unref(m).moreSelected(moreCount.value)), 3)) : createCommentVNode("", true)])], 10, _hoisted_7$3), fitsSummary.value && unref(summaryFit).mounted.value ? (openBlock(), createElementBlock("span", {
6642
4446
  key: 0,
6643
4447
  "aria-hidden": "true",
6644
4448
  inert: "",
@@ -7413,8 +5217,10 @@ function labelRecipe(card, disabled) {
7413
5217
  disabled ? "eldra:text-muted" : "eldra:text-text"
7414
5218
  ];
7415
5219
  }
7416
- /** Spec "Radio group" → Sizes: the hint is `muted` in every layout, under the label's column. */
7417
- var HINT = "eldra:text-body-sm eldra:text-muted eldra:col-start-2 eldra:min-w-0";
5220
+ /** Spec "Radio group" → Sizes: the hint is `muted` in every layout. */
5221
+ var HINT_TEXT = "eldra:text-body-sm eldra:text-muted eldra:min-w-0";
5222
+ /** The hint under the label's column: column 2, after the radio. */
5223
+ var HINT = `${HINT_TEXT} eldra:col-start-2`;
7418
5224
  // src/components/radio/RadioGroup.vue?vue&type=script&setup=true&lang.ts
7419
5225
  var _hoisted_1$5 = [
7420
5226
  "data-eldra-scope",
@@ -7433,10 +5239,11 @@ var _hoisted_2$5 = [
7433
5239
  var _hoisted_3$5 = ["data-eldra-slot"];
7434
5240
  var _hoisted_4$4 = ["data-eldra-slot"];
7435
5241
  var _hoisted_5$4 = ["data-eldra-slot"];
7436
- var _hoisted_6$3 = ["id"];
5242
+ var _hoisted_6$3 = ["data-eldra-slot"];
5243
+ var _hoisted_7$2 = ["id"];
7437
5244
  var ROOT = "eldra:grid eldra:min-w-0 eldra:content-start eldra:gap-3 eldra:rounded-none eldra:border-0 eldra:p-0";
7438
5245
  /** `FieldWrapper`'s help type: 0.8125rem / 1.45, weight 400, `muted`. */
7439
- var CARD_OPTION = "eldra:group eldra:relative eldra:grid eldra:w-full eldra:grid-cols-[auto_1fr_auto] eldra:items-start eldra:gap-x-2.5 eldra:gap-y-0.5 eldra:min-h-14 eldra:rounded-md eldra:px-4 eldra:py-3 eldra:eldra-radio-card-border eldra:eldra-transition-colors";
5246
+ var CARD_OPTION = "eldra:group eldra:relative eldra:grid eldra:w-full eldra:items-start eldra:gap-x-2.5 eldra:gap-y-0.5 eldra:min-h-14 eldra:rounded-md eldra:px-4 eldra:py-3 eldra:eldra-radio-card-border eldra:eldra-transition-colors";
7440
5247
  var CARD_UNSELECTED = "eldra:bg-background eldra:border-border-strong eldra:hover:border-text";
7441
5248
  var CARD_SELECTED = "eldra:bg-surface eldra:border-primary eldra:eldra-radio-card-selected";
7442
5249
  var CARD_INVALID = "eldra:bg-background eldra:border-danger eldra:hover:border-danger";
@@ -7450,6 +5257,15 @@ var CARD_INVALID_SELECTED = "eldra:bg-surface eldra:border-danger eldra:eldra-ra
7450
5257
  /** Spec "Radio group" → States, Disabled selected row: "as disabled" — the card draws no special
7451
5258
  * selected look once it is also disabled; only the radio inside it keeps a distinct look. */
7452
5259
  var CARD_DISABLED = "eldra:bg-background eldra:border-border eldra:border-dashed";
5260
+ var CARD_COLUMNS = "eldra:grid-cols-[auto_1fr_auto]";
5261
+ /** With a leading icon or logo: radio, leading, text, meta. */
5262
+ var CARD_COLUMNS_LEADING = "eldra:grid-cols-[auto_auto_1fr_auto]";
5263
+ /**
5264
+ * Cards only: whether this option draws the `leading` part — its own `icon`, or the group's
5265
+ * `leading` slot. A card without one keeps the three columns it always had, so a group that never
5266
+ * uses either renders exactly as before.
5267
+ */
5268
+ var ICON_STROKE_WIDTH = 1.75;
7453
5269
  // src/components/radio/RadioGroup.vue
7454
5270
  var RadioGroup_default = /* @__PURE__ */ defineComponent({
7455
5271
  __name: "RadioGroup",
@@ -7489,6 +5305,8 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
7489
5305
  */
7490
5306
  const field = inject(FIELD_KEY, null);
7491
5307
  const m = useMessages();
5308
+ const slots = useSlots();
5309
+ const present = useSlotPresence(slots, ["leading"]);
7492
5310
  const errorId = useUiId("radio-group-error");
7493
5311
  const helpId = useUiId("radio-group-help");
7494
5312
  /** The shared native `name` every radio posts under. Generated when the caller gives none. */
@@ -7570,9 +5388,21 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
7570
5388
  if (isSelected(option.value)) return inError.value ? CARD_INVALID_SELECTED : CARD_SELECTED;
7571
5389
  return inError.value ? CARD_INVALID : CARD_UNSELECTED;
7572
5390
  }
5391
+ /** The card's columns: radio, text, meta. */
5392
+ function hasLeading(option) {
5393
+ return props.layout === "cards" && (present.value.leading || option.icon !== void 0);
5394
+ }
5395
+ /** Whether a hint row sits under the title, for the leading part to span. */
5396
+ function hasHint(option) {
5397
+ return !!option.hint || slots.hint !== void 0;
5398
+ }
7573
5399
  function optionClass(option) {
7574
5400
  return [
7575
- props.layout === "cards" ? [CARD_OPTION, cardState(option)] : [PLAIN_OPTION, PLAIN_COLUMNS],
5401
+ props.layout === "cards" ? [
5402
+ CARD_OPTION,
5403
+ hasLeading(option) ? CARD_COLUMNS_LEADING : CARD_COLUMNS,
5404
+ cardState(option)
5405
+ ] : [PLAIN_OPTION, PLAIN_COLUMNS],
7576
5406
  optionCursor(option.disabled),
7577
5407
  props.classes?.option
7578
5408
  ];
@@ -7591,15 +5421,30 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
7591
5421
  function labelClass(option) {
7592
5422
  return [labelRecipe(props.layout === "cards", option.disabled), props.classes?.label];
7593
5423
  }
7594
- const hintClass = computed(() => [HINT, props.classes?.hint]);
5424
+ /** Under the title: column 2, or column 3 when a leading part takes the second. */
5425
+ function hintClass(option) {
5426
+ return [hasLeading(option) ? `${HINT_TEXT} eldra:col-start-3` : HINT, props.classes?.hint];
5427
+ }
7595
5428
  /**
7596
- * Spec "Radio group" → Sizes, Card title / hint / meta row: "1rem 600 tabular, no wrap, pushed to
7597
- * the end" — `tabular-nums` and `whitespace-nowrap` are stock Tailwind utilities, so meta reuses
7598
- * `text-card-title` rather than a near-identical utility of its own, and `justify-self-end` in the
7599
- * grid's third column is what pushes it to the end.
5429
+ * The leading part: an icon or a logo between the radio and the text, centred against the title
5430
+ * and the hint together (it spans both rows when there is a hint). `text` so an icon follows the
5431
+ * title's colour, `muted` when the option is disabled.
7600
5432
  */
5433
+ function leadingClass(option) {
5434
+ return [
5435
+ "eldra:col-start-2 eldra:flex eldra:shrink-0 eldra:items-center eldra:justify-center eldra:self-center",
5436
+ hasHint(option) ? "eldra:row-span-2" : "eldra:row-span-1",
5437
+ option.disabled ? "eldra:text-muted" : "eldra:text-text",
5438
+ props.classes?.leading
5439
+ ];
5440
+ }
5441
+ /** The stroke `Icon` draws with. */
7601
5442
  function metaClass(option) {
7602
- return [["eldra:text-card-title eldra:col-start-3 eldra:min-w-0 eldra:justify-self-end eldra:tabular-nums eldra:whitespace-nowrap", option.disabled ? "eldra:text-muted" : "eldra:text-text"], props.classes?.meta];
5443
+ return [[
5444
+ "eldra:text-card-title eldra:min-w-0 eldra:justify-self-end eldra:tabular-nums eldra:whitespace-nowrap",
5445
+ hasLeading(option) ? "eldra:col-start-4" : "eldra:col-start-3",
5446
+ option.disabled ? "eldra:text-muted" : "eldra:text-text"
5447
+ ], props.classes?.meta];
7603
5448
  }
7604
5449
  return (_ctx, _cache) => {
7605
5450
  return openBlock(), createElementBlock("fieldset", {
@@ -7639,23 +5484,34 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
7639
5484
  "aria-hidden": "true",
7640
5485
  class: normalizeClass(dotClass(option))
7641
5486
  }, null, 2)], 2),
5487
+ hasLeading(option) ? (openBlock(), createElementBlock("span", {
5488
+ key: 0,
5489
+ "data-eldra-slot": unref(eldra).slotHost("leading"),
5490
+ "data-part": "leading",
5491
+ class: normalizeClass(leadingClass(option))
5492
+ }, [renderSlot(_ctx.$slots, "leading", { option }, () => [(openBlock(), createBlock(resolveDynamicComponent(option.icon), {
5493
+ class: "eldra:size-5",
5494
+ "stroke-width": ICON_STROKE_WIDTH,
5495
+ "aria-hidden": "true",
5496
+ focusable: "false"
5497
+ }))])], 10, _hoisted_3$5)) : createCommentVNode("", true),
7642
5498
  createElementVNode("span", {
7643
5499
  "data-eldra-slot": unref(eldra).slotHost("label"),
7644
5500
  "data-part": "label",
7645
5501
  class: normalizeClass(labelClass(option))
7646
- }, [renderSlot(_ctx.$slots, "label", { option }, () => [createTextVNode(toDisplayString(option.label), 1)])], 10, _hoisted_3$5),
5502
+ }, [renderSlot(_ctx.$slots, "label", { option }, () => [createTextVNode(toDisplayString(option.label), 1)])], 10, _hoisted_4$4),
7647
5503
  option.hint || _ctx.$slots.hint ? (openBlock(), createElementBlock("span", {
7648
- key: 0,
5504
+ key: 1,
7649
5505
  "data-eldra-slot": unref(eldra).slotHost("hint"),
7650
5506
  "data-part": "hint",
7651
- class: normalizeClass(hintClass.value)
7652
- }, [renderSlot(_ctx.$slots, "hint", { option }, () => [createTextVNode(toDisplayString(option.hint), 1)])], 10, _hoisted_4$4)) : createCommentVNode("", true),
5507
+ class: normalizeClass(hintClass(option))
5508
+ }, [renderSlot(_ctx.$slots, "hint", { option }, () => [createTextVNode(toDisplayString(option.hint), 1)])], 10, _hoisted_5$4)) : createCommentVNode("", true),
7653
5509
  __props.layout === "cards" && (option.meta || _ctx.$slots.meta) ? (openBlock(), createElementBlock("span", {
7654
- key: 1,
5510
+ key: 2,
7655
5511
  "data-eldra-slot": unref(eldra).slotHost("meta"),
7656
5512
  "data-part": "meta",
7657
5513
  class: normalizeClass(metaClass(option))
7658
- }, [renderSlot(_ctx.$slots, "meta", { option }, () => [createTextVNode(toDisplayString(option.meta), 1)])], 10, _hoisted_5$4)) : createCommentVNode("", true)
5514
+ }, [renderSlot(_ctx.$slots, "meta", { option }, () => [createTextVNode(toDisplayString(option.meta), 1)])], 10, _hoisted_6$3)) : createCommentVNode("", true)
7659
5515
  ], 16);
7660
5516
  }), 128))], 2),
7661
5517
  __props.error ? (openBlock(), createBlock(FieldError_default, {
@@ -7671,7 +5527,7 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
7671
5527
  id: unref(helpId),
7672
5528
  "data-part": "help",
7673
5529
  class: normalizeClass(helpClass.value)
7674
- }, toDisplayString(__props.help), 11, _hoisted_6$3)) : createCommentVNode("", true)
5530
+ }, toDisplayString(__props.help), 11, _hoisted_7$2)) : createCommentVNode("", true)
7675
5531
  ], 8, _hoisted_1$5);
7676
5532
  };
7677
5533
  }
@@ -9393,7 +7249,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
9393
7249
  }, () => [__props.leadingIcon ? (openBlock(), createBlock(resolveDynamicComponent(__props.leadingIcon), {
9394
7250
  key: 0,
9395
7251
  class: "eldra:size-4.5 eldra:shrink-0",
9396
- "stroke-width": unref(ICON_STROKE_WIDTH),
7252
+ "stroke-width": unref(ICON_STROKE_WIDTH$1),
9397
7253
  "aria-hidden": "true",
9398
7254
  focusable: "false"
9399
7255
  }, null, 8, ["stroke-width"])) : createCommentVNode("", true)])], 10, _hoisted_3$2)) : createCommentVNode("", true),
@@ -9416,7 +7272,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
9416
7272
  "data-eldra-scope": unref(eldra).scope,
9417
7273
  "data-part": "optionIcon",
9418
7274
  class: normalizeClass(triggerIconClass.value),
9419
- "stroke-width": unref(ICON_STROKE_WIDTH),
7275
+ "stroke-width": unref(ICON_STROKE_WIDTH$1),
9420
7276
  "aria-hidden": "true",
9421
7277
  focusable: "false"
9422
7278
  }, null, 8, [
@@ -10262,4 +8118,4 @@ var VariantPicker_default = /* @__PURE__ */ defineComponent({
10262
8118
  };
10263
8119
  }
10264
8120
  });
10265
- export { parseLocaleNumber as $, focusInvalid as A, joinIds as At, FIELD_CLEAR_BUTTON_BOX as B, topLayerDialog as C, FORM_LAYOUT_KEY as Ct, normalizeText as D, ELDRA_SCOPE_KEY as Dt, matchRange as E, useControllableModel as Et, defaultCharacterMeaning as F, createNumberFormat as G, FIELD_LIVE as H, stripMask as I, defaultUnitFormat as J, currencyFractionDigits as K, CurrencyInput_default as L, filterNumericBeforeInput as M, Input_default as N, useListbox as O, provideEldraScope as Ot, applyMask as P, localeSeparators as Q, UnitInput_default as R, useOverlay as S, ICON_STROKE_WIDTH as St, useFloating$1 as T, mergeClass as Tt, FIELD_SEARCH_APPEARANCE as U, FIELD_DISABLED as V, FIELD_SIZE as W, formatNumber as X, formatCurrency as Y, formatUnit as Z, optionCursor as _, FIELD_KEY as _t, claimShortcut as a, provideEldraUiCurrency as at, MultiSelect_default as b, Icon_default as bt, SearchResultsPanel_default as c, useEldraUiLocale as ct, INPUT as d, tagPadding as dt, useSlotPresence as et, PLAIN_BOX_ONLY as f, CheckboxGroup_default as ft, labelRecipe as g, FieldError_default as gt, dotRecipe as h, RequiredMark_default as ht, SearchBar_default as i, LOCALE_KEY as it, Switch_default as j, useUiId as jt, FormLayout_default as k, useEldraScope as kt, RadioGroup_default as l, TAG_FILL as lt, PLAIN_OPTION as m, VisuallyHidden_default as mt, Textarea_default as n, CURRENCY_KEY as nt, ownsShortcut as o, provideEldraUiLocale as ot, PLAIN_COLUMNS as p, Checkbox_default as pt, currencySymbol as q, Select_default as r, DEFAULT_UI_LOCALE as rt, releaseShortcut as s, useEldraUiCurrency as st, VariantPicker_default as t, useHeadingTag as tt, HINT as u, TAG_SHAPE as ut, radioRecipe as v, Button_default as vt, useTeleportTarget as w, FORM_SUBMITTING_KEY as wt, usePopover as x, ICON_SIZE_CLASS as xt, QuantityStepper_default as y, Spinner_default as yt, FIELD_BASE as z };
8121
+ export { FORM_SUBMITTING_KEY as $, UnitInput_default as A, useSlotPresence as B, Switch_default as C, defaultCharacterMeaning as D, applyMask as E, formatCurrency as F, CheckboxGroup_default as G, TAG_FILL as H, formatNumber as I, RequiredMark_default as J, Checkbox_default as K, formatUnit as L, currencyFractionDigits as M, currencySymbol as N, stripMask as O, defaultUnitFormat as P, FORM_LAYOUT_KEY as Q, localeSeparators as R, focusInvalid as S, Input_default as T, TAG_SHAPE as U, useHeadingTag as V, tagPadding as W, Button_default as X, FieldError_default as Y, Icon_default as Z, optionCursor as _, claimShortcut as a, MultiSelect_default as b, SearchResultsPanel_default as c, INPUT as d, PLAIN_BOX_ONLY as f, labelRecipe as g, dotRecipe as h, SearchBar_default as i, createNumberFormat as j, CurrencyInput_default as k, RadioGroup_default as l, PLAIN_OPTION as m, Textarea_default as n, ownsShortcut as o, PLAIN_COLUMNS as p, VisuallyHidden_default as q, Select_default as r, releaseShortcut as s, VariantPicker_default as t, HINT as u, radioRecipe as v, filterNumericBeforeInput as w, FormLayout_default as x, QuantityStepper_default as y, parseLocaleNumber as z };