@eldrajs/ui 0.0.0-stage → 0.1.1

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 (205) hide show
  1. package/CHANGELOG.md +1724 -0
  2. package/LICENSE +21 -0
  3. package/README.md +3177 -2
  4. package/dist/VariantPicker-CKw8hmxt.js +9009 -0
  5. package/dist/componentNames.d.ts +19 -0
  6. package/dist/components/accordion/Accordion.vue.d.ts +18 -0
  7. package/dist/components/accordion/AccordionItem.vue.d.ts +26 -0
  8. package/dist/components/accordion/context.d.ts +20 -0
  9. package/dist/components/accordion/detailsExclusivity.d.ts +3 -0
  10. package/dist/components/accordion/heightTransition.d.ts +59 -0
  11. package/dist/components/accordion/types.d.ts +40 -0
  12. package/dist/components/avatar/Avatar.vue.d.ts +10 -0
  13. package/dist/components/avatar/AvatarGroup.vue.d.ts +7 -0
  14. package/dist/components/avatar/types.d.ts +61 -0
  15. package/dist/components/badge/Badge.vue.d.ts +24 -0
  16. package/dist/components/badge/StockBadge.vue.d.ts +10 -0
  17. package/dist/components/badge/types.d.ts +79 -0
  18. package/dist/components/breadcrumb/Breadcrumb.vue.d.ts +10 -0
  19. package/dist/components/breadcrumb/types.d.ts +53 -0
  20. package/dist/components/button/Button.vue.d.ts +37 -0
  21. package/dist/components/button/ButtonGroup.vue.d.ts +17 -0
  22. package/dist/components/button/types.d.ts +68 -0
  23. package/dist/components/card/ContentCard.vue.d.ts +36 -0
  24. package/dist/components/card/FeatureCard.vue.d.ts +27 -0
  25. package/dist/components/card/cueArrow.d.ts +10 -0
  26. package/dist/components/card/stretchedLink.d.ts +45 -0
  27. package/dist/components/card/types.d.ts +92 -0
  28. package/dist/components/carousel/Carousel.vue.d.ts +39 -0
  29. package/dist/components/carousel/types.d.ts +75 -0
  30. package/dist/components/carousel/useCarousel.d.ts +152 -0
  31. package/dist/components/checkbox/Checkbox.vue.d.ts +36 -0
  32. package/dist/components/checkbox/CheckboxGroup.vue.d.ts +16 -0
  33. package/dist/components/checkbox/types.d.ts +78 -0
  34. package/dist/components/chip/Chip.vue.d.ts +37 -0
  35. package/dist/components/chip/ChipGroup.vue.d.ts +21 -0
  36. package/dist/components/chip/context.d.ts +22 -0
  37. package/dist/components/chip/types.d.ts +84 -0
  38. package/dist/components/container/Container.vue.d.ts +18 -0
  39. package/dist/components/container/types.d.ts +17 -0
  40. package/dist/components/currency-input/CurrencyInput.vue.d.ts +17 -0
  41. package/dist/components/currency-input/types.d.ts +8 -0
  42. package/dist/components/dialog/Dialog.vue.d.ts +34 -0
  43. package/dist/components/dialog/types.d.ts +25 -0
  44. package/dist/components/drawer/Drawer.vue.d.ts +36 -0
  45. package/dist/components/drawer/types.d.ts +30 -0
  46. package/dist/components/empty-state/EditorPlaceholder.vue.d.ts +9 -0
  47. package/dist/components/empty-state/EmptyState.vue.d.ts +28 -0
  48. package/dist/components/empty-state/types.d.ts +59 -0
  49. package/dist/components/field-wrapper/FieldError.vue.d.ts +37 -0
  50. package/dist/components/field-wrapper/FieldWrapper.vue.d.ts +30 -0
  51. package/dist/components/field-wrapper/context.d.ts +44 -0
  52. package/dist/components/field-wrapper/types.d.ts +38 -0
  53. package/dist/components/filter-panel/FilterGroup.vue.d.ts +48 -0
  54. package/dist/components/filter-panel/FilterPanel.vue.d.ts +77 -0
  55. package/dist/components/filter-panel/Histogram.vue.d.ts +15 -0
  56. package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +12 -0
  57. package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +12 -0
  58. package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +20 -0
  59. package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +12 -0
  60. package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +12 -0
  61. package/dist/components/filter-panel/facets/shared.d.ts +39 -0
  62. package/dist/components/filter-panel/northwind.d.ts +32 -0
  63. package/dist/components/filter-panel/swatchInk.d.ts +50 -0
  64. package/dist/components/filter-panel/types.d.ts +183 -0
  65. package/dist/components/filter-panel/useFilterPanel.d.ts +230 -0
  66. package/dist/components/form-layout/FormLayout.vue.d.ts +36 -0
  67. package/dist/components/form-layout/context.d.ts +33 -0
  68. package/dist/components/form-layout/focusInvalid.d.ts +18 -0
  69. package/dist/components/form-layout/types.d.ts +52 -0
  70. package/dist/components/icon/Icon.vue.d.ts +8 -0
  71. package/dist/components/icon/types.d.ts +29 -0
  72. package/dist/components/image/Image.vue.d.ts +21 -0
  73. package/dist/components/image/types.d.ts +81 -0
  74. package/dist/components/input/Input.vue.d.ts +47 -0
  75. package/dist/components/input/classes.d.ts +110 -0
  76. package/dist/components/input/types.d.ts +55 -0
  77. package/dist/components/internal/ValueText.vue.d.ts +7 -0
  78. package/dist/components/lightbox/Lightbox.vue.d.ts +19 -0
  79. package/dist/components/lightbox/types.d.ts +47 -0
  80. package/dist/components/link/Link.vue.d.ts +23 -0
  81. package/dist/components/link/types.d.ts +40 -0
  82. package/dist/components/load-more/LoadMore.vue.d.ts +12 -0
  83. package/dist/components/load-more/types.d.ts +21 -0
  84. package/dist/components/logo-item/LogoItem.vue.d.ts +10 -0
  85. package/dist/components/logo-item/types.d.ts +37 -0
  86. package/dist/components/pagination/Pagination.vue.d.ts +15 -0
  87. package/dist/components/pagination/types.d.ts +51 -0
  88. package/dist/components/popover/Popover.vue.d.ts +31 -0
  89. package/dist/components/popover/types.d.ts +53 -0
  90. package/dist/components/price/Price.vue.d.ts +25 -0
  91. package/dist/components/price/types.d.ts +104 -0
  92. package/dist/components/product-card/ProductCard.vue.d.ts +22 -0
  93. package/dist/components/product-card/types.d.ts +123 -0
  94. package/dist/components/quantity-stepper/QuantityStepper.vue.d.ts +26 -0
  95. package/dist/components/quantity-stepper/types.d.ts +35 -0
  96. package/dist/components/radio/RadioGroup.vue.d.ts +38 -0
  97. package/dist/components/radio/types.d.ts +39 -0
  98. package/dist/components/range-slider/RangeSlider.vue.d.ts +70 -0
  99. package/dist/components/range-slider/types.d.ts +151 -0
  100. package/dist/components/range-slider/useRangeSlider.d.ts +106 -0
  101. package/dist/components/rating/Rating.vue.d.ts +22 -0
  102. package/dist/components/rating/RatingStars.vue.d.ts +16 -0
  103. package/dist/components/rating/types.d.ts +45 -0
  104. package/dist/components/search-bar/SearchBar.vue.d.ts +47 -0
  105. package/dist/components/search-bar/SearchResultsPanel.vue.d.ts +93 -0
  106. package/dist/components/search-bar/shortcutOwner.d.ts +39 -0
  107. package/dist/components/search-bar/types.d.ts +122 -0
  108. package/dist/components/search-modal/SearchModal.vue.d.ts +53 -0
  109. package/dist/components/search-modal/types.d.ts +59 -0
  110. package/dist/components/section/Section.vue.d.ts +21 -0
  111. package/dist/components/section/context.d.ts +23 -0
  112. package/dist/components/section/types.d.ts +34 -0
  113. package/dist/components/select/MultiSelect.vue.d.ts +62 -0
  114. package/dist/components/select/Select.vue.d.ts +57 -0
  115. package/dist/components/select/SelectPanel.vue.d.ts +97 -0
  116. package/dist/components/select/openRegistry.d.ts +11 -0
  117. package/dist/components/select/panelParts.d.ts +91 -0
  118. package/dist/components/select/types.d.ts +129 -0
  119. package/dist/components/select/useListbox.d.ts +106 -0
  120. package/dist/components/select/useOptionList.d.ts +61 -0
  121. package/dist/components/select/usePopover.d.ts +147 -0
  122. package/dist/components/skeleton/Skeleton.vue.d.ts +12 -0
  123. package/dist/components/skeleton/types.d.ts +38 -0
  124. package/dist/components/spinner/Spinner.vue.d.ts +3 -0
  125. package/dist/components/switch/Switch.vue.d.ts +30 -0
  126. package/dist/components/switch/types.d.ts +20 -0
  127. package/dist/components/tabs/Tab.vue.d.ts +17 -0
  128. package/dist/components/tabs/TabPanel.vue.d.ts +16 -0
  129. package/dist/components/tabs/Tabs.vue.d.ts +28 -0
  130. package/dist/components/tabs/context.d.ts +48 -0
  131. package/dist/components/tabs/types.d.ts +63 -0
  132. package/dist/components/textarea/Textarea.vue.d.ts +27 -0
  133. package/dist/components/textarea/supportsFieldSizing.d.ts +10 -0
  134. package/dist/components/textarea/types.d.ts +32 -0
  135. package/dist/components/toast/Toast.vue.d.ts +16 -0
  136. package/dist/components/toast/Toaster.vue.d.ts +13 -0
  137. package/dist/components/toast/types.d.ts +44 -0
  138. package/dist/components/tooltip/Tooltip.vue.d.ts +9 -0
  139. package/dist/components/tooltip/supportsFocusVisible.d.ts +17 -0
  140. package/dist/components/tooltip/types.d.ts +46 -0
  141. package/dist/components/unit-input/UnitInput.vue.d.ts +55 -0
  142. package/dist/components/unit-input/types.d.ts +68 -0
  143. package/dist/components/unit-input/undo-redo.d.ts +6 -0
  144. package/dist/components/variant-picker/VariantPicker.vue.d.ts +15 -0
  145. package/dist/components/variant-picker/types.d.ts +49 -0
  146. package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +18 -0
  147. package/dist/components/visually-hidden/types.d.ts +14 -0
  148. package/dist/composables/dialogStack.d.ts +52 -0
  149. package/dist/composables/teleportTarget.d.ts +79 -0
  150. package/dist/composables/useControllableModel.d.ts +16 -0
  151. package/dist/composables/useDialog.d.ts +84 -0
  152. package/dist/composables/useFloating.d.ts +82 -0
  153. package/dist/composables/useHeadingTag.d.ts +24 -0
  154. package/dist/composables/useLocale.d.ts +81 -0
  155. package/dist/composables/useMessages.d.ts +30 -0
  156. package/dist/composables/useOverlay.d.ts +88 -0
  157. package/dist/composables/useSlotPresence.d.ts +29 -0
  158. package/dist/composables/useToast.d.ts +53 -0
  159. package/dist/icons/paths.d.ts +10 -0
  160. package/dist/index.d.ts +135 -0
  161. package/dist/index.js +12586 -0
  162. package/dist/listFormat-1UrH38f2.js +39 -0
  163. package/dist/messages/en-US.d.ts +485 -0
  164. package/dist/messages/index.d.ts +2 -0
  165. package/dist/messages/is-IS.d.ts +16 -0
  166. package/dist/messages/is-IS.js +169 -0
  167. package/dist/resolver.d.ts +43 -0
  168. package/dist/resolver.js +121 -0
  169. package/dist/style.css +5251 -0
  170. package/dist/tailwind.css +2057 -0
  171. package/dist/tokens.css +134 -0
  172. package/dist/utils/avatar.d.ts +15 -0
  173. package/dist/utils/color.d.ts +11 -0
  174. package/dist/utils/cssTiming.d.ts +40 -0
  175. package/dist/utils/cx.d.ts +31 -0
  176. package/dist/utils/date.d.ts +45 -0
  177. package/dist/utils/id.d.ts +36 -0
  178. package/dist/utils/listFormat.d.ts +22 -0
  179. package/dist/utils/mask.d.ts +48 -0
  180. package/dist/utils/number-format.d.ts +250 -0
  181. package/dist/utils/numeric-input.d.ts +42 -0
  182. package/dist/utils/rating.d.ts +26 -0
  183. package/dist/utils/ratio.d.ts +18 -0
  184. package/dist/utils/tagRecipe.d.ts +24 -0
  185. package/dist/utils/valueFade.d.ts +42 -0
  186. package/dist/vee-validate/FieldCheckbox.vue.d.ts +14 -0
  187. package/dist/vee-validate/FieldCheckboxGroup.vue.d.ts +14 -0
  188. package/dist/vee-validate/FieldCurrencyInput.vue.d.ts +14 -0
  189. package/dist/vee-validate/FieldInput.vue.d.ts +14 -0
  190. package/dist/vee-validate/FieldMultiSelect.vue.d.ts +14 -0
  191. package/dist/vee-validate/FieldQuantityStepper.vue.d.ts +14 -0
  192. package/dist/vee-validate/FieldRadioGroup.vue.d.ts +14 -0
  193. package/dist/vee-validate/FieldSearchBar.vue.d.ts +14 -0
  194. package/dist/vee-validate/FieldSelect.vue.d.ts +14 -0
  195. package/dist/vee-validate/FieldSwitch.vue.d.ts +14 -0
  196. package/dist/vee-validate/FieldTextarea.vue.d.ts +14 -0
  197. package/dist/vee-validate/FieldUnitInput.vue.d.ts +14 -0
  198. package/dist/vee-validate/FieldVariantPicker.vue.d.ts +14 -0
  199. package/dist/vee-validate/Form.vue.d.ts +27 -0
  200. package/dist/vee-validate/context.d.ts +48 -0
  201. package/dist/vee-validate/index.d.ts +27 -0
  202. package/dist/vee-validate/types.d.ts +115 -0
  203. package/dist/vee-validate/useFieldControl.d.ts +67 -0
  204. package/dist/vee-validate.js +1154 -0
  205. package/package.json +105 -3
@@ -0,0 +1,230 @@
1
+ import { AppliedFilter, FilterFacet, FilterFacetSelection, FilterFacetValue, FilterSelection } from './types.js';
2
+ /**
3
+ * How many values a `list` facet shows before **Show all N** (spec → Variants, `list` facet row:
4
+ * "More than 6 values: the first 6, then **Show all N**").
5
+ */
6
+ export declare const FILTER_VALUES_SHOWN = 6;
7
+ /**
8
+ * How many values a `list` facet has to exceed before it also gets a search field (spec → the same
9
+ * row: "More than 12: a search field above the list as well").
10
+ *
11
+ * Strictly more than, both of them: a facet with exactly 6 values shows all six and no button, and
12
+ * one with exactly 12 gets no search field. The two thresholds are the whole reason these are
13
+ * constants rather than literals in a template — a test can assert the boundary on either side of
14
+ * each, which is what makes the off-by-one un-shippable.
15
+ */
16
+ export declare const FILTER_SEARCH_FROM = 12;
17
+ /** A facet's values, or an empty list for a facet that has none (every `range` facet). */
18
+ export declare function facetValues(facet: FilterFacet): FilterFacetValue[];
19
+ /** Whether one facet's selection is a range's span rather than a list of chosen values. */
20
+ export declare function isRangeSelection(selection: FilterFacetSelection | undefined): selection is [number, number];
21
+ /**
22
+ * The values selected in one facet. Empty for a facet nothing is selected in, and empty for a
23
+ * range — a span is not a set of values, and every caller here that means "the chosen values"
24
+ * means the set.
25
+ */
26
+ export declare function selectedValues(selection: FilterSelection, facetId: string): readonly string[];
27
+ export declare function isValueSelected(selection: FilterSelection, facetId: string, value: string): boolean;
28
+ /**
29
+ * The selection with one value checked or unchecked.
30
+ *
31
+ * A new object every time, never a mutation: the panel is controlled, so what it emits has to be a
32
+ * value the parent can tell apart from the one it passed in. The facet's key is **removed** rather
33
+ * than left as an empty array when the last value goes, so "nothing selected here" has one
34
+ * representation — which is what lets `hasSelection` and the URL grammar agree, and what makes a
35
+ * round trip through a query string idempotent.
36
+ */
37
+ export declare function toggleValue(selection: FilterSelection, facetId: string, value: string, checked: boolean): FilterSelection;
38
+ /** The selection with one value removed, whether it was there or not (a chip's own gesture). */
39
+ export declare function removeValue(selection: FilterSelection, facetId: string, value: string): FilterSelection;
40
+ /**
41
+ * The selection with one range's span written, or **removed** when the span is the facet's own
42
+ * limits.
43
+ *
44
+ * A range at its limits excludes nothing, so storing it would make "no price filter" and "the
45
+ * whole price range" two different selections that mean the same thing — and the second one would
46
+ * keep **Clear all** on screen with nothing to clear, and put a `?price=0-240` in the URL that
47
+ * says nothing. Dropping it is also what makes a cleared range read back as `[min, max]` through
48
+ * `rangeOf` below.
49
+ */
50
+ export declare function setRange(selection: FilterSelection, facet: FilterFacet, range: [number, number]): FilterSelection;
51
+ /** A range facet's own bounds, with the spec's `[0, 100]` fallback for a facet that gives none. */
52
+ export declare function rangeLimits(facet: FilterFacet): [number, number];
53
+ /**
54
+ * A range facet's current span: what the selection holds, or its own limits with nothing held.
55
+ *
56
+ * The limits are the answer rather than a thrown error for an absent key because absent *is* the
57
+ * resting state (see `setRange`), and they clamp whatever is held, so a span left over from before
58
+ * the bounds moved still reads as a span inside them.
59
+ */
60
+ export declare function rangeOf(selection: FilterSelection, facet: FilterFacet): [number, number];
61
+ /** Whether a range facet is untouched — both ends at its own limits. */
62
+ export declare function isRangeAtLimits(selection: FilterSelection, facet: FilterFacet): boolean;
63
+ /**
64
+ * Whether a facet can be drawn at all.
65
+ *
66
+ * A **range with fewer than two distinct values** cannot: a catalogue whose cheapest and dearest
67
+ * product are the same price has no span to narrow, and drawing one anyway gives the shopper a
68
+ * single thumb that cannot move and a pair of fields reading "3,500" to "3,500" — a control that
69
+ * looks operable, answers every gesture with nothing, and excludes nothing however it is set. The
70
+ * honest rendering of "there is nothing to filter here" is no group at all.
71
+ *
72
+ * Every other facet type is drawn whatever it holds: an empty `list` is a group that says, truly,
73
+ * that the catalogue offers no values for it, and that is information a shopper can act on (it is
74
+ * also what a facet looks like for one tick while its counts are refreshing).
75
+ */
76
+ export declare function facetIsRenderable(facet: FilterFacet): boolean;
77
+ /** The facets a panel draws — and the only ones its selection should go on mentioning. */
78
+ export declare function renderableFacets(facets: FilterFacet[]): FilterFacet[];
79
+ /**
80
+ * The selection with any key belonging to a facet the panel is **not** drawing taken out.
81
+ *
82
+ * It is deliberately narrow: only a facet that was supplied and then omitted loses its key. A key
83
+ * for a facet the panel was never given is left alone, because a page may well keep a filter of
84
+ * its own in the same object that this panel has no business clearing.
85
+ *
86
+ * This is what "cleared on the next change" means for a collapsed range: a span inherited from a
87
+ * URL, or from a catalogue whose price span has since collapsed, would otherwise keep narrowing
88
+ * the results with no control on screen that could widen them again.
89
+ */
90
+ export declare function dropOmittedFacets(selection: FilterSelection, facets: FilterFacet[]): FilterSelection;
91
+ /**
92
+ * The facet's selected-count badge (spec → Behaviour: "the number of checked values and
93
+ * switched-on switches in the group ... a moved range does not count").
94
+ *
95
+ * A range answers `0` deliberately: its badge would say "1" for a span the shopper can see on the
96
+ * track, which is a count of nothing. The head's **Clear all** still knows about it (see
97
+ * `hasSelection`).
98
+ */
99
+ export declare function facetSelectedCount(facet: FilterFacet, selection: FilterSelection): number;
100
+ /**
101
+ * The selected labels of one facet, in the facet's **own** value order rather than the order they
102
+ * were checked in — this is the collapsed summary ("Brown, Natural"), and a summary that reordered
103
+ * itself as the shopper ticked would read as a different group each time.
104
+ *
105
+ * Empty for a range, which has no labels to list.
106
+ */
107
+ export declare function facetSummaryLabels(facet: FilterFacet, selection: FilterSelection): string[];
108
+ /**
109
+ * Whether a facet is open before the shopper has touched its trigger (spec → Facet shape,
110
+ * `collapsed`: "A group with a selected value always starts open").
111
+ *
112
+ * A range counts as selected here even though its badge does not: a facet whose track has been
113
+ * moved is a facet the shopper is using, and opening it is the only way they can see what it says.
114
+ */
115
+ export declare function facetStartsOpen(facet: FilterFacet, selection: FilterSelection): boolean;
116
+ /**
117
+ * Whether anything is selected at all, across every facet — which is what decides whether the
118
+ * head's **Clear all** is on screen (spec → States: "hidden while nothing is selected and every
119
+ * range is at its limits").
120
+ *
121
+ * It needs the facets, not just the selection, because "at its limits" is a question only a
122
+ * facet's own `min`/`max` can answer. Keys for facets that are no longer there are ignored, so a
123
+ * stale key in a restored URL cannot keep the button on screen with nothing it could clear.
124
+ */
125
+ export declare function hasSelection(facets: FilterFacet[], selection: FilterSelection): boolean;
126
+ /**
127
+ * The applied-filter chips, facet by facet and in each facet's own value order (spec → Anatomy
128
+ * item 2: "one per selected value").
129
+ *
130
+ * Range facets contribute none: a span has no one value a chip could take off, and removing "the
131
+ * price" is **Clear all**'s job or the track's own. A selected value the facet no longer offers
132
+ * contributes none either — a chip the panel cannot name is a chip nobody can act on.
133
+ */
134
+ export declare function appliedFilters(facets: FilterFacet[], selection: FilterSelection): AppliedFilter[];
135
+ /**
136
+ * Text folded for searching: lower case with every accent taken off, so "créme" matches "creme"
137
+ * and "Ósk" matches "osk" (spec → Behaviour: "ignoring case and accents").
138
+ *
139
+ * `NFD` splits a letter into its base and its combining marks and the range strips the marks,
140
+ * which is the one decomposition that works for every script rather than a table of the
141
+ * substitutions one language needs.
142
+ */
143
+ export declare function foldForSearch(text: string): string;
144
+ /** Whether one value's label answers a search query, accents and case ignored. */
145
+ export declare function matchesSearch(value: FilterFacetValue, query: string): boolean;
146
+ /**
147
+ * Whether a facet gets a search field: a `list` facet with **more than** `FILTER_SEARCH_FROM`
148
+ * values.
149
+ *
150
+ * Only `list`. The spec gives the search field and **Show all N** to that row of the Variants
151
+ * table alone; a colour facet's swatches and a size facet's tiles are compact enough to read at a
152
+ * glance, and a store with two hundred colours is a catalogue problem, not a panel one.
153
+ */
154
+ export declare function facetIsSearchable(facet: FilterFacet): boolean;
155
+ /** Whether a facet can show **Show all N**: a `list` facet with more than `FILTER_VALUES_SHOWN`. */
156
+ export declare function facetCanShowAll(facet: FilterFacet): boolean;
157
+ /** The state of one facet's list: whether the shopper pressed **Show all N**, and what they typed. */
158
+ export interface FacetListState {
159
+ expanded?: boolean;
160
+ query?: string;
161
+ }
162
+ /**
163
+ * The values a facet draws.
164
+ *
165
+ * Three rules in one place, because they interact: a query shows **every** matching value and not
166
+ * only the first six (spec → States, "Searching a long list": "the list shows all its values (not
167
+ * just 6) while a query is active" — a truncated search result is a search that lies); with no
168
+ * query, an expanded facet shows everything and a collapsed one the first six; and a facet that
169
+ * never earned a **Show all N** shows everything regardless of what `expanded` says.
170
+ */
171
+ export declare function visibleFacetValues(facet: FilterFacet, state?: FacetListState): FilterFacetValue[];
172
+ /** Whether **Show all N** has anything left to reveal (never while a query is filtering). */
173
+ export declare function facetHasHiddenValues(facet: FilterFacet, state?: FacetListState): boolean;
174
+ /** One top row of a facet's list, with the rows that sit under it (empty in a flat facet). */
175
+ export interface FacetRow {
176
+ value: FilterFacetValue;
177
+ children: FilterFacetValue[];
178
+ }
179
+ /**
180
+ * The visible values re-read as parent rows and their children — the one place a flat value list
181
+ * becomes nesting, so everything else (the badge, the 6-value truncation, the search, the chips)
182
+ * keeps working on the flat list it always did.
183
+ *
184
+ * A child whose parent is **not** among the visible values becomes a top row of its own rather
185
+ * than disappearing: the truncation cuts the list at six, and a row the shopper can see has to be
186
+ * a row they can tick.
187
+ */
188
+ export declare function facetRows(values: FilterFacetValue[]): FacetRow[];
189
+ /** One size system's sub-heading and its tiles. `key` is `undefined` for values with no system. */
190
+ export interface SizeSystemGroup {
191
+ key: string | undefined;
192
+ values: FilterFacetValue[];
193
+ }
194
+ /**
195
+ * A size facet's values grouped by size system, in the order the systems **first appear** in the
196
+ * values rather than alphabetically (spec → Do / Don't: "Do group sizes by system; don't mix 'M'
197
+ * and '42' in one grid").
198
+ *
199
+ * First appearance, because the order is the store's: a catalogue that lists Knitwear before Shoes
200
+ * means it, and sorting the headings would reorder the grid under the merchant without being
201
+ * asked. Values with no `group` collapse into one unlabelled group, which is what a store that has
202
+ * not told us its size systems yet gets — one grid, no sub-headings, nothing invented.
203
+ */
204
+ export declare function sizeSystemGroups(values: FilterFacetValue[]): SizeSystemGroup[];
205
+ /**
206
+ * Whether one histogram bar sits inside the selected span (spec → Behaviour: "a bar is 'in' when
207
+ * its bucket centre lies between the thumbs").
208
+ *
209
+ * The **centre**, not either edge: a bucket is a width of the range, and judging it by its left
210
+ * edge lights the bar the minimum thumb is standing in the middle of while leaving the one it has
211
+ * just left dark. `bars` is however many the facet supplied (the spec's own distribution is 24),
212
+ * so a store that answers a different resolution still gets a correct picture.
213
+ */
214
+ export declare function histogramBarInRange(index: number, bars: number, range: [number, number], limits: [number, number]): boolean;
215
+ /**
216
+ * A value is disabled when it has nothing left **and** the shopper has not selected it (spec →
217
+ * States: "A selected value is never disabled").
218
+ *
219
+ * The exception is not cosmetic: a selected value with a count of 0 is the one a shopper has to be
220
+ * able to un-tick to get their results back, and disabling it would trap them.
221
+ */
222
+ export declare function isValueDisabled(value: FilterFacetValue, selection: FilterSelection, facetId: string): boolean;
223
+ /**
224
+ * The selection a **Clear all** leaves behind: nothing at all.
225
+ *
226
+ * Every range goes back to its limits by the same token, because a range at its limits is an
227
+ * absent key (see `setRange`). Keys for facets the panel is not showing go too — Clear all says
228
+ * "clear the filters", and a key nothing on screen can reach is still a filter on the results.
229
+ */
230
+ export declare function clearedSelection(): FilterSelection;
@@ -0,0 +1,36 @@
1
+ import { FormLayoutProps, FormLayoutSubmitPayload, FormLayoutVariant } from './types.js';
2
+ declare var __VLS_7: {}, __VLS_9: {}, __VLS_11: {};
3
+ type __VLS_Slots = {} & {
4
+ errorSummary?: (props: typeof __VLS_7) => any;
5
+ } & {
6
+ default?: (props: typeof __VLS_9) => any;
7
+ } & {
8
+ actions?: (props: typeof __VLS_11) => any;
9
+ };
10
+ declare const __VLS_base: import('vue').DefineComponent<FormLayoutProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ submit: (payload: FormLayoutSubmitPayload) => any;
12
+ invalid: (ids: string[]) => any;
13
+ }, string, import('vue').PublicProps, Readonly<FormLayoutProps> & Readonly<{
14
+ onSubmit?: ((payload: FormLayoutSubmitPayload) => any) | undefined;
15
+ onInvalid?: ((ids: string[]) => any) | undefined;
16
+ }>, {
17
+ classes: Partial<Record<import('./types.js').FormLayoutPart, string>>;
18
+ headingLevel: import('./types.js').FormLayoutHeadingLevel;
19
+ ariaLabel: string;
20
+ layout: FormLayoutVariant;
21
+ novalidate: boolean;
22
+ heading: string;
23
+ action: string;
24
+ method: string;
25
+ focusOnInvalid: boolean;
26
+ submitting: boolean;
27
+ statusMessage: string;
28
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
29
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
30
+ declare const _default: typeof __VLS_export;
31
+ export default _default;
32
+ type __VLS_WithSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,33 @@
1
+ import { ComputedRef, InjectionKey, Ref } from 'vue';
2
+ /**
3
+ * Whether the form this subtree belongs to is currently submitting.
4
+ *
5
+ * `FormLayout` provides it; every `Button` below injects it. The design spec's Form layout section
6
+ * says what a submitting form looks like — "primary button loading, other actions disabled" — and
7
+ * this key is how the buttons learn it without the form reaching into them:
8
+ *
9
+ * - a `type="submit"` button becomes `loading` (spinner, `aria-busy`, focus and width kept);
10
+ * - every other button becomes `disabled`, so a second action cannot start mid-submit.
11
+ *
12
+ * Optional everywhere: a Button outside a form injects nothing and behaves exactly as its props
13
+ * say.
14
+ *
15
+ * ```ts
16
+ * import { FORM_SUBMITTING_KEY } from '@eldrajs/ui';
17
+ * provide(FORM_SUBMITTING_KEY, submitting); // Ref<boolean>
18
+ * ```
19
+ */
20
+ export declare const FORM_SUBMITTING_KEY: InjectionKey<Ref<boolean>>;
21
+ /**
22
+ * Which of the three arrangements the form around this subtree is using.
23
+ *
24
+ * `FormLayout` provides it; a `FieldWrapper` below injects it so its `full` prop can span both
25
+ * columns — and only in the layout where there *are* two columns. A `FieldWrapper` outside a form
26
+ * injects nothing and `full` does nothing, which is what a field in a page-builder column wants.
27
+ *
28
+ * ```ts
29
+ * import { FORM_LAYOUT_KEY } from '@eldrajs/ui';
30
+ * provide(FORM_LAYOUT_KEY, computed(() => 'two')); // ComputedRef<'single' | 'two' | 'inline'>
31
+ * ```
32
+ */
33
+ export declare const FORM_LAYOUT_KEY: InjectionKey<ComputedRef<'single' | 'two' | 'inline'>>;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * What can actually take focus. Used to decide *what* to focus rather than to ask whether a
3
+ * `focus()` call landed: the answer to that is not the same in every runtime (happy-dom will
4
+ * happily make a `<fieldset>` the active element, a browser will not), and a focus move on a
5
+ * failed submit is not something to leave to a runtime's opinion.
6
+ */
7
+ export declare const FOCUSABLE: string;
8
+ /**
9
+ * Focus the first invalid field (spec "Field wrapper" → Behaviour: "On submit, focus moves to the
10
+ * first invalid field"). A `FieldWrapper` group marks its `<fieldset>` invalid as well as the
11
+ * controls inside it, and a fieldset cannot take focus — so an invalid element that is not itself
12
+ * focusable hands focus to the first focusable thing inside it.
13
+ *
14
+ * Shared by `FormLayout`, which does this on a native submit it refuses, and by the `./vee-validate`
15
+ * entry's `Form`, which does it after vee-validate has rejected one asynchronously — the two must
16
+ * agree on where focus lands, so they run the same function rather than two copies of it.
17
+ */
18
+ export declare function focusInvalid(element: HTMLElement): void;
@@ -0,0 +1,52 @@
1
+ import { HeadingLevel } from '../../composables/useHeadingTag.js';
2
+ /** The three arrangements the design spec's Form layout section gives. */
3
+ export type FormLayoutVariant = 'single' | 'two' | 'inline';
4
+ /** The heading levels the form's own title can take under a page's `<h1>` — narrower than the
5
+ * shared `HeadingLevel` (`2 | 3 | 4 | 5 | 6`) every other component's `headingLevel` prop uses,
6
+ * because a form's own title realistically never sits six levels deep. Declared as an explicit
7
+ * subtype of `HeadingLevel` (`Extract`, not a separately re-typed union) so the two stay in sync
8
+ * if the shared type ever changes. */
9
+ export type FormLayoutHeadingLevel = Extract<HeadingLevel, 2 | 3 | 4>;
10
+ /** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them. */
11
+ export type FormLayoutPart = 'root' | 'heading' | 'errorSummary' | 'fields' | 'actions' | 'status';
12
+ /** What the `submit` event carries once every field in the form is valid. */
13
+ export interface FormLayoutSubmitPayload {
14
+ /** The native event, so a scripted form can `preventDefault()` it itself. */
15
+ event: SubmitEvent;
16
+ /** The form's values, read from the native form — no bookkeeping of its own. */
17
+ data: FormData;
18
+ }
19
+ export interface FormLayoutProps {
20
+ /** `single` (default), `two` (a responsive two-column grid) or `inline` (one field, one button). */
21
+ layout?: FormLayoutVariant;
22
+ /** A visible heading that names the form. The form is `aria-labelledby` it. */
23
+ heading?: string;
24
+ /** The heading's element, for a form nested under a page's own headings. Defaults to `2`. */
25
+ headingLevel?: FormLayoutHeadingLevel;
26
+ /** The form's name when there is no visible heading ("Newsletter sign-up"). */
27
+ ariaLabel?: string;
28
+ /** Native `action`, so the form posts without scripting. */
29
+ action?: string;
30
+ /** Native `method`. */
31
+ method?: string;
32
+ /** Native `novalidate`. Defaults to `true`: the components' own messages, not browser bubbles. */
33
+ novalidate?: boolean;
34
+ /**
35
+ * Whether a refused submit moves focus to the first invalid field. Defaults to `true`.
36
+ *
37
+ * Set it to `false` only when something above the form does the focus move itself, and would
38
+ * otherwise do it twice — which is exactly what `@eldrajs/ui/vee-validate`'s `Form` does: its own
39
+ * validation finishes asynchronously, after this one, so it has to own where focus lands. The
40
+ * `invalid` event still fires either way.
41
+ */
42
+ focusOnInvalid?: boolean;
43
+ /** While true the submit button is loading and every other action in the form is disabled. */
44
+ submitting?: boolean;
45
+ /**
46
+ * A short sentence announced in the form's polite live region ("Thanks, you're subscribed"). It
47
+ * is never visible: the visible confirmation is the page's, this is what a screen reader hears.
48
+ */
49
+ statusMessage?: string;
50
+ /** Per-part class overrides, merged with `tailwind-merge`. */
51
+ classes?: Partial<Record<FormLayoutPart, string>>;
52
+ }
@@ -0,0 +1,8 @@
1
+ import { IconProps, IconSize } from './types.js';
2
+ declare const __VLS_export: import('vue').DefineComponent<IconProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<IconProps> & Readonly<{}>, {
3
+ size: IconSize;
4
+ label: string;
5
+ classes: Partial<Record<import('./types.js').IconPart, string>>;
6
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -0,0 +1,29 @@
1
+ import { Component } from 'vue';
2
+ /**
3
+ * An icon component. In practice a Tabler outline icon
4
+ * (`import { IconSearch } from '@tabler/icons-vue'`), but any component that
5
+ * renders an `<svg>` and accepts class and ARIA attributes works — the package
6
+ * does not depend on `@tabler/icons-vue`, the consumer passes the component.
7
+ */
8
+ export type IconComponent = Component;
9
+ /**
10
+ * The design spec's four icon sizes: 1rem (small), 1.25rem (default),
11
+ * 1.5rem (feature tiles) and 2rem (empty states).
12
+ */
13
+ export type IconSize = 'sm' | 'md' | 'lg' | 'xl';
14
+ /** The parts a consumer can restyle through `classes`. */
15
+ export type IconPart = 'root';
16
+ export interface IconProps {
17
+ /** The icon component to render. */
18
+ icon: IconComponent;
19
+ /** One of the spec's four sizes. Defaults to `md` (1.25rem). */
20
+ size?: IconSize;
21
+ /**
22
+ * An accessible name. Give it only when the icon carries meaning nothing
23
+ * else on screen carries; without it the icon is decorative and hidden from
24
+ * assistive technology.
25
+ */
26
+ label?: string;
27
+ /** Per-part class overrides, merged with `tailwind-merge`. */
28
+ classes?: Partial<Record<IconPart, string>>;
29
+ }
@@ -0,0 +1,21 @@
1
+ import { ImageProps } from './types.js';
2
+ declare const __VLS_export: import('vue').DefineComponent<ImageProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ImageProps> & Readonly<{}>, {
3
+ caption: string | null;
4
+ rounded: "none" | "lg" | "xl";
5
+ zoom: number;
6
+ classes: Partial<Record<import('./types.js').ImagePart, string>>;
7
+ media: import('./types.js').ImageMedia | null;
8
+ decorative: boolean;
9
+ alt: string;
10
+ loading: boolean;
11
+ sizes: string;
12
+ ratio: import('./types.js').ImageRatio;
13
+ fit: "cover" | "contain";
14
+ focal: {
15
+ x: number;
16
+ y: number;
17
+ };
18
+ priority: boolean;
19
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
@@ -0,0 +1,81 @@
1
+ /**
2
+ * The frame's fixed aspect presets (spec "Image" → Properties, `ratio` row; → Sizes). `auto` uses
3
+ * the media's own intrinsic ratio when it has one, or 4:3 when there is no media at all — see
4
+ * `src/utils/ratio.ts#frameAspectRatio`.
5
+ */
6
+ export type ImageRatio = 'auto' | '1x1' | '4x3' | '3x2' | '16x9' | '3x4' | '4x5';
7
+ /**
8
+ * The image or video the frame renders (spec "Image" → Anatomy, part 3). `alt`/`width`/`height`
9
+ * here are metadata a CMS field carries alongside the asset; the component's own `alt` prop is
10
+ * what actually renders on the `<img>`/`<video>` (falling back to `media.alt` when the prop is not
11
+ * given), so a consumer can override the stored description per instance without editing the
12
+ * asset.
13
+ */
14
+ export interface ImageMedia {
15
+ /** The asset URL. */
16
+ src: string;
17
+ /** A responsive `srcset`, e.g. `"a.jpg 480w, b.jpg 960w"`. */
18
+ srcset?: string;
19
+ /** Per-media `sizes`; `ImageProps.sizes` overrides this when both are given. */
20
+ sizes?: string;
21
+ /** The asset's own stored description, used when `ImageProps.alt` is not given. */
22
+ alt?: string;
23
+ /** Intrinsic width in pixels. With `height`, reserves the frame's space under `ratio="auto"`. */
24
+ width?: number;
25
+ /** Intrinsic height in pixels. See `width`. */
26
+ height?: number;
27
+ /** Renders a `<video>` instead of an `<img>`. Defaults to `'image'`. */
28
+ type?: 'image' | 'video';
29
+ }
30
+ /** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them. */
31
+ export type ImagePart = 'root' | 'frame' | 'media' | 'placeholder' | 'caption' | 'skeleton';
32
+ export interface ImageProps {
33
+ /** The image or video. `null`/omitted renders the live "No image" placeholder. */
34
+ media?: ImageMedia | null;
35
+ /**
36
+ * Required whenever `media` is set, unless `decorative` is on: a dev warning fires otherwise
37
+ * (spec "Image" → Accessibility, 1.1.1). Falls back to `media.alt`, then to `""`.
38
+ */
39
+ alt?: string;
40
+ /** Renders `alt=""` (and hides the live placeholder from assistive technology) regardless of
41
+ * `alt`/`media.alt`. */
42
+ decorative?: boolean;
43
+ /** The frame's aspect preset. See `ImageRatio`. Defaults to `'4x3'` — a product-card caller
44
+ * passes `'4x5'` itself, per the spec's own per-context default. */
45
+ ratio?: ImageRatio;
46
+ /**
47
+ * How the media fills its frame: `'cover'` (default) crops to fill, matching the spec's own
48
+ * "the frame always crops; it never stretches" rule for every card/grid context this component
49
+ * originally shipped for. `'contain'` letterboxes instead — added for `Lightbox`, whose own spec
50
+ * explicitly wants the opposite ("Image: fits the stage height and width, keeps its aspect ratio
51
+ * (contain)"): a full-resolution photo in a viewer must never be cropped.
52
+ * `focal`/`zoom` still apply to `cover`; they have no effect under `contain` (there is nothing to
53
+ * pan or scale once the whole image is always visible).
54
+ */
55
+ fit?: 'cover' | 'contain';
56
+ /**
57
+ * Crop anchor, in percent (0–100 on each axis): sets the media's `object-position` and, when
58
+ * `zoom` is above 1, the scale's `transform-origin`. Defaults to centred (`{ x: 50, y: 50 }`).
59
+ */
60
+ focal?: {
61
+ x: number;
62
+ y: number;
63
+ };
64
+ /** Static crop scale (1–2) around `focal`, applied as `transform: scale(zoom)`. Never animated —
65
+ * a static crop, not a hover effect (spec "Image" → Behaviour & motion). Defaults to `1`. */
66
+ zoom?: number;
67
+ /** Frame corner radius: `none` (default), `lg` (`radius-lg`) or `xl` (`radius-xl`). */
68
+ rounded?: 'none' | 'lg' | 'xl';
69
+ /** Renders a `<figcaption>` under the frame and makes the root a `<figure>`. `null`/omitted
70
+ * renders neither. */
71
+ caption?: string | null;
72
+ /** Responsive `sizes` for the `srcset`. Overrides `media.sizes` when both are given. */
73
+ sizes?: string;
74
+ /** The first hero image: `loading="eager"` + `fetchpriority="high"`. Every other image is
75
+ * `loading="lazy"` (the default). */
76
+ priority?: boolean;
77
+ /** Renders a skeleton at the frame's own ratio instead of `media`/the placeholder. */
78
+ loading?: boolean;
79
+ /** Per-part class overrides, merged with `tailwind-merge`. */
80
+ classes?: Partial<Record<ImagePart, string>>;
81
+ }
@@ -0,0 +1,47 @@
1
+ import { InputProps } from './types.js';
2
+ declare var __VLS_1: {}, __VLS_8: {};
3
+ type __VLS_Slots = {} & {
4
+ leadingIcon?: (props: typeof __VLS_1) => any;
5
+ } & {
6
+ suffix?: (props: typeof __VLS_8) => any;
7
+ };
8
+ declare const __VLS_base: import('vue').DefineComponent<InputProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
+ blur: (event: FocusEvent) => any;
10
+ clear: () => any;
11
+ "update:modelValue": (value: string) => any;
12
+ focus: (event: FocusEvent) => any;
13
+ }, string, import('vue').PublicProps, Readonly<InputProps> & Readonly<{
14
+ onBlur?: ((event: FocusEvent) => any) | undefined;
15
+ onClear?: (() => any) | undefined;
16
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
17
+ onFocus?: ((event: FocusEvent) => any) | undefined;
18
+ }>, {
19
+ size: import('./types.js').InputSize;
20
+ name: string;
21
+ classes: Partial<Record<import('./types.js').InputPart, string>>;
22
+ mask: string;
23
+ type: import('./types.js').InputType;
24
+ modelValue: string;
25
+ required: boolean;
26
+ placeholder: string;
27
+ max: number;
28
+ id: string;
29
+ step: number;
30
+ leadingIcon: import('../../index.js').IconComponent;
31
+ disabled: boolean;
32
+ invalid: boolean;
33
+ describedBy: string;
34
+ min: number;
35
+ clearable: boolean;
36
+ readonly: boolean;
37
+ inputmode: string;
38
+ autocomplete: string;
39
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
40
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
41
+ declare const _default: typeof __VLS_export;
42
+ export default _default;
43
+ type __VLS_WithSlots<T, S> = T & {
44
+ new (): {
45
+ $slots: S;
46
+ };
47
+ };