@eldrajs/ui 0.3.20 → 0.3.22

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 (55) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +71 -31
  3. package/dist/{PhoneInput-CHTpjbtS.js → PhoneInput-D_z9MuDw.js} +2 -2
  4. package/dist/{VariantPicker-BLuaCwee.js → VariantPicker-DgDBOM-w.js} +527 -314
  5. package/dist/components/autocomplete/Autocomplete.vue.d.ts +2 -0
  6. package/dist/components/chip/Chip.vue.d.ts +2 -0
  7. package/dist/components/currency-input/CurrencyInput.vue.d.ts +5 -1
  8. package/dist/components/currency-picker/CurrencyPicker.vue.d.ts +27 -1
  9. package/dist/components/currency-picker/types.d.ts +2 -1
  10. package/dist/components/dialog/Dialog.vue.d.ts +2 -0
  11. package/dist/components/drawer/Drawer.vue.d.ts +2 -0
  12. package/dist/components/filter-panel/FilterGroup.vue.d.ts +2 -0
  13. package/dist/components/filter-panel/FilterPanel.vue.d.ts +2 -0
  14. package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +2 -0
  15. package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +2 -0
  16. package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +2 -0
  17. package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +2 -0
  18. package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +2 -0
  19. package/dist/components/lightbox/Lightbox.vue.d.ts +2 -0
  20. package/dist/components/load-more/LoadMore.vue.d.ts +1 -1
  21. package/dist/components/nav-menu/NavMenu.vue.d.ts +5 -2
  22. package/dist/components/nav-menu/NavMenuDrawerList.vue.d.ts +39 -0
  23. package/dist/components/nav-menu/navLinks.d.ts +9 -0
  24. package/dist/components/nav-menu/types.d.ts +22 -2
  25. package/dist/components/pagination/Pagination.vue.d.ts +2 -0
  26. package/dist/components/product-card/ProductCard.vue.d.ts +6 -0
  27. package/dist/components/product-card/types.d.ts +25 -2
  28. package/dist/components/range-slider/RangeSlider.vue.d.ts +2 -0
  29. package/dist/components/search-bar/SearchBar.vue.d.ts +2 -0
  30. package/dist/components/search-modal/SearchModal.vue.d.ts +2 -0
  31. package/dist/components/select/MultiSelect.vue.d.ts +2 -0
  32. package/dist/components/select/Select.vue.d.ts +2 -0
  33. package/dist/components/site-form/SiteForm.vue.d.ts +2 -0
  34. package/dist/components/toast/Toast.vue.d.ts +2 -0
  35. package/dist/components/toast/Toaster.vue.d.ts +2 -0
  36. package/dist/components/unit-input/UnitInput.vue.d.ts +8 -0
  37. package/dist/components/unit-input/types.d.ts +13 -1
  38. package/dist/components.css +45 -0
  39. package/dist/index.d.ts +2 -1
  40. package/dist/index.js +699 -331
  41. package/dist/messages/en-US.d.ts +4 -0
  42. package/dist/messages/is-IS.js +3 -1
  43. package/dist/phone/PhoneInput.vue.d.ts +2 -0
  44. package/dist/phone/vee-validate.js +4 -4
  45. package/dist/phone.js +1 -1
  46. package/dist/style.css +45 -0
  47. package/dist/{useFieldControl-B1JvPEeM.js → useFieldControl-D_h1RWyU.js} +18 -7
  48. package/dist/{useMessages-BdN9F1cW.js → useMessages-D8bTGX7c.js} +5 -1
  49. package/dist/{useOptionList-UMUMayec.js → useOptionList-DuAKag8J.js} +1 -0
  50. package/dist/utilities.css +23 -0
  51. package/dist/utils/amount.d.ts +71 -0
  52. package/dist/vee-validate/useFieldControl.d.ts +6 -0
  53. package/dist/vee-validate.js +35 -5
  54. package/dist/vue-i18n.js +1 -1
  55. package/package.json +2 -2
@@ -207,6 +207,8 @@ declare const __VLS_base: import('vue').DefineComponent<AutocompleteProps, {
207
207
  phoneNoMatch: (query: string) => string;
208
208
  phoneInvalid: (country: string) => string;
209
209
  phoneInvalidNumber: string;
210
+ amountNotANumber: string;
211
+ amountNoDecimals: string;
210
212
  }>;
211
213
  minLength: number;
212
214
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -188,6 +188,8 @@ declare const __VLS_base: import('vue').DefineComponent<ChipProps, {}, {}, {}, {
188
188
  phoneNoMatch: (query: string) => string;
189
189
  phoneInvalid: (country: string) => string;
190
190
  phoneInvalidNumber: string;
191
+ amountNotANumber: string;
192
+ amountNoDecimals: string;
191
193
  }>;
192
194
  icon: import('../../index.js').IconComponent;
193
195
  avatar: string | import('../../index.js').ImageMedia | null;
@@ -5,7 +5,11 @@ declare const __VLS_template: () => {
5
5
  };
6
6
  };
7
7
  type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
8
- declare const __VLS_base: import('vue').DefineComponent<CurrencyInputProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CurrencyInputProps> & Readonly<{}>, {
8
+ declare const __VLS_base: import('vue').DefineComponent<CurrencyInputProps, {
9
+ formatValue: (amount: number) => string;
10
+ isValid: import('vue').ComputedRef<boolean>;
11
+ invalidReason: import('vue').ComputedRef<import('../../index.js').AmountInvalidReason | null>;
12
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CurrencyInputProps> & Readonly<{}>, {
9
13
  currency: string;
10
14
  narrowSymbol: boolean;
11
15
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,5 +1,25 @@
1
1
  import { CurrencyPickerProps } from './types.js';
2
- declare const __VLS_export: import('vue').DefineComponent<CurrencyPickerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
2
+ declare const __VLS_template: () => {
3
+ __VLS_Slots: {
4
+ label?: (props: {}) => any;
5
+ } & {
6
+ leading?: (props: {}) => any;
7
+ } & {
8
+ optionContent?: (props: {
9
+ code: string;
10
+ currencyName: string;
11
+ label: string;
12
+ selected: boolean;
13
+ }) => any;
14
+ } & {
15
+ value?: (props: {
16
+ code: string;
17
+ label: string;
18
+ }) => any;
19
+ };
20
+ };
21
+ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
22
+ declare const __VLS_base: import('vue').DefineComponent<CurrencyPickerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
3
23
  "update:modelValue": (code: string) => any;
4
24
  }, string, import('vue').PublicProps, Readonly<CurrencyPickerProps> & Readonly<{
5
25
  "onUpdate:modelValue"?: ((code: string) => any) | undefined;
@@ -13,5 +33,11 @@ declare const __VLS_export: import('vue').DefineComponent<CurrencyPickerProps, {
13
33
  locale: string;
14
34
  showLabel: boolean;
15
35
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
36
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
37
  declare const _default: typeof __VLS_export;
17
38
  export default _default;
39
+ type __VLS_WithSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -1,5 +1,6 @@
1
1
  import { SelectPart } from '../select/types.js';
2
- export type CurrencyPickerPart = 'root' | SelectPart;
2
+ /** `label` is the visible label's, with `showLabel`. */
3
+ export type CurrencyPickerPart = 'root' | 'label' | SelectPart;
3
4
  export interface CurrencyPickerProps {
4
5
  /** ISO 4217 codes to offer, the store's own first. With fewer than two the picker renders nothing. */
5
6
  currencies: readonly string[];
@@ -189,6 +189,8 @@ declare const __VLS_base: import('vue').DefineComponent<DialogProps, {
189
189
  phoneNoMatch: (query: string) => string;
190
190
  phoneInvalid: (country: string) => string;
191
191
  phoneInvalidNumber: string;
192
+ amountNotANumber: string;
193
+ amountNoDecimals: string;
192
194
  }>;
193
195
  description: string;
194
196
  dismissable: boolean;
@@ -190,6 +190,8 @@ declare const __VLS_base: import('vue').DefineComponent<DrawerProps, {
190
190
  phoneNoMatch: (query: string) => string;
191
191
  phoneInvalid: (country: string) => string;
192
192
  phoneInvalidNumber: string;
193
+ amountNotANumber: string;
194
+ amountNoDecimals: string;
193
195
  }>;
194
196
  ariaLabel: string;
195
197
  count: number;
@@ -201,6 +201,8 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
201
201
  phoneNoMatch: (query: string) => string;
202
202
  phoneInvalid: (country: string) => string;
203
203
  phoneInvalidNumber: string;
204
+ amountNotANumber: string;
205
+ amountNoDecimals: string;
204
206
  }>;
205
207
  topRule: boolean;
206
208
  escCollapses: boolean;
@@ -220,6 +220,8 @@ declare const __VLS_base: import('vue').DefineComponent<FilterPanelProps, {
220
220
  phoneNoMatch: (query: string) => string;
221
221
  phoneInvalid: (country: string) => string;
222
222
  phoneInvalidNumber: string;
223
+ amountNotANumber: string;
224
+ amountNoDecimals: string;
223
225
  }>;
224
226
  mode: import('./types.js').FilterPanelMode;
225
227
  locale: string;
@@ -170,6 +170,8 @@ declare const __VLS_export: import('vue').DefineComponent<FacetProps, {}, {}, {}
170
170
  phoneNoMatch: (query: string) => string;
171
171
  phoneInvalid: (country: string) => string;
172
172
  phoneInvalidNumber: string;
173
+ amountNotANumber: string;
174
+ amountNoDecimals: string;
173
175
  }>;
174
176
  dense: boolean;
175
177
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -170,6 +170,8 @@ declare const __VLS_export: import('vue').DefineComponent<FacetProps, {}, {}, {}
170
170
  phoneNoMatch: (query: string) => string;
171
171
  phoneInvalid: (country: string) => string;
172
172
  phoneInvalidNumber: string;
173
+ amountNotANumber: string;
174
+ amountNoDecimals: string;
173
175
  }>;
174
176
  dense: boolean;
175
177
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -176,6 +176,8 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
176
176
  phoneNoMatch: (query: string) => string;
177
177
  phoneInvalid: (country: string) => string;
178
178
  phoneInvalidNumber: string;
179
+ amountNotANumber: string;
180
+ amountNoDecimals: string;
179
181
  }>;
180
182
  locale: string;
181
183
  currency: string;
@@ -170,6 +170,8 @@ declare const __VLS_export: import('vue').DefineComponent<FacetProps, {}, {}, {}
170
170
  phoneNoMatch: (query: string) => string;
171
171
  phoneInvalid: (country: string) => string;
172
172
  phoneInvalidNumber: string;
173
+ amountNotANumber: string;
174
+ amountNoDecimals: string;
173
175
  }>;
174
176
  dense: boolean;
175
177
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -170,6 +170,8 @@ declare const __VLS_export: import('vue').DefineComponent<FacetProps, {}, {}, {}
170
170
  phoneNoMatch: (query: string) => string;
171
171
  phoneInvalid: (country: string) => string;
172
172
  phoneInvalidNumber: string;
173
+ amountNotANumber: string;
174
+ amountNoDecimals: string;
173
175
  }>;
174
176
  dense: boolean;
175
177
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -177,6 +177,8 @@ declare const __VLS_export: import('vue').DefineComponent<LightboxProps, {
177
177
  phoneNoMatch: (query: string) => string;
178
178
  phoneInvalid: (country: string) => string;
179
179
  phoneInvalidNumber: string;
180
+ amountNotANumber: string;
181
+ amountNoDecimals: string;
180
182
  }>;
181
183
  index: number;
182
184
  thumbnails: boolean;
@@ -5,8 +5,8 @@ declare const __VLS_export: import('vue').DefineComponent<LoadMoreProps, {}, {},
5
5
  onLoad?: (() => any) | undefined;
6
6
  }>, {
7
7
  classes: Partial<Record<import('./types.js').LoadMorePart, string>>;
8
- noun: string;
9
8
  pending: boolean;
9
+ noun: string;
10
10
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
11
  declare const _default: typeof __VLS_export;
12
12
  export default _default;
@@ -19,11 +19,11 @@ type __VLS_Slots = {
19
19
  toggle?: (props: {
20
20
  open: boolean;
21
21
  }) => unknown;
22
- /** The drawer's header row, before its close button: a logo, a call to action. */
22
+ /** The drawer's header row, before its close button: a logo, a call to action. The sheet only. */
23
23
  drawerHeader?: (props: {
24
24
  close: () => void;
25
25
  }) => unknown;
26
- /** The drawer's fixed footer. */
26
+ /** The drawer's footer: fixed in the sheet, after the entries in the inline drawer. */
27
27
  drawerFooter?: (props: {
28
28
  close: () => void;
29
29
  }) => unknown;
@@ -206,6 +206,8 @@ declare const __VLS_base: import('vue').DefineComponent<NavMenuProps, {
206
206
  phoneNoMatch: (query: string) => string;
207
207
  phoneInvalid: (country: string) => string;
208
208
  phoneInvalidNumber: string;
209
+ amountNotANumber: string;
210
+ amountNoDecimals: string;
209
211
  }>;
210
212
  variant: NavMenuVariant;
211
213
  linkAs: string | import('vue').Component;
@@ -215,6 +217,7 @@ declare const __VLS_base: import('vue').DefineComponent<NavMenuProps, {
215
217
  collapseBelow: NavMenuCollapse;
216
218
  drawerSide: import('../../index.js').DrawerSide;
217
219
  drawerLayout: import('./types.js').NavMenuDrawerLayout;
220
+ drawerMode: import('./types.js').NavMenuDrawerMode;
218
221
  drawerItems: readonly NavMenuItem[];
219
222
  openOnHover: boolean;
220
223
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,39 @@
1
+ import { Component } from 'vue';
2
+ import { UiMessages } from '../../composables/useMessages.js';
3
+ import { NavMenuDrawerLayout, NavMenuGroupHeadingSlotProps, NavMenuItem, NavMenuPanelItemSlotProps, NavMenuPart, NavMenuVariant } from './types.js';
4
+ /**
5
+ * The drawer's list of entries, the same in the modal sheet and the inline drawer: a plain link, an
6
+ * accordion row that opens its panel, or (`sections`) a heading row with its panel listed open.
7
+ */
8
+ type __VLS_Props = {
9
+ entries: readonly {
10
+ item: NavMenuItem;
11
+ index: number;
12
+ }[];
13
+ layout: NavMenuDrawerLayout;
14
+ /** The bar's panel id for an entry; the drawer's own ids are derived from it. */
15
+ panelId: (index: number) => string;
16
+ navLabel: string;
17
+ variant: NavMenuVariant;
18
+ messages: UiMessages;
19
+ linkAs?: string | Component;
20
+ cardAspect?: string;
21
+ classes?: Partial<Record<NavMenuPart, string>>;
22
+ };
23
+ type __VLS_Slots = {
24
+ panelItem?: (props: NavMenuPanelItemSlotProps) => unknown;
25
+ groupHeading?: (props: NavMenuGroupHeadingSlotProps) => unknown;
26
+ };
27
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
28
+ follow: () => any;
29
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
30
+ onFollow?: (() => any) | undefined;
31
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
32
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
33
+ declare const _default: typeof __VLS_export;
34
+ export default _default;
35
+ type __VLS_WithSlots<T, S> = T & {
36
+ new (): {
37
+ $slots: S;
38
+ };
39
+ };
@@ -2,6 +2,8 @@ import { Component } from 'vue';
2
2
  import { NavMenuItem, NavMenuLink, NavMenuPanelLayout } from './types.js';
3
3
  /** How the page the visitor is on is marked, on every kind of link the menu draws. */
4
4
  export declare const CURRENT_PAGE = "eldra:aria-[current=page]:underline eldra:aria-[current=page]:decoration-2 eldra:aria-[current=page]:underline-offset-[0.2em]";
5
+ /** The `aria-current` value an entry's `current` stands for, or `undefined` for no mark. */
6
+ export declare function currentMark(current: NavMenuLink['current']): 'page' | 'true' | undefined;
5
7
  /** A run of panel entries under one column heading; `group` is `null` for entries without one. */
6
8
  export interface NavMenuLinkRun {
7
9
  group: string | null;
@@ -29,6 +31,13 @@ export declare function groupLinks(links: readonly NavMenuLink[]): NavMenuLinkRu
29
31
  export declare function panelLayout(item: NavMenuItem): NavMenuPanelLayout;
30
32
  /** Whether the item, or an entry in its panel, is the page the visitor is on. */
31
33
  export declare function containsCurrent(item: NavMenuItem): boolean;
34
+ /**
35
+ * The one top-level entry the bar marks as holding the current page, or `null`. A page can sit in
36
+ * more than one entry — "Ceramics" as its own entry and again inside "Shop" — and marking both
37
+ * reads as two places at once. The entry whose own link is the page wins; failing that, the first
38
+ * entry that holds it in its panel (WS-1277).
39
+ */
40
+ export declare function currentEntry(items: readonly NavMenuItem[]): NavMenuItem | null;
32
41
  /** Whether an entry goes somewhere; one without a destination renders as plain text. */
33
42
  export declare function hasHref(link: NavMenuLink): boolean;
34
43
  /** The element an entry renders as: `linkAs` (or `a`) with a destination, else `span`. */
@@ -23,13 +23,24 @@ export interface NavMenuLink {
23
23
  badge?: string | null;
24
24
  /** The column heading this entry sits under; entries sharing one form a column. */
25
25
  group?: string | null;
26
- /** Marks the page the visitor is on (`aria-current="page"`). */
27
- current?: boolean;
26
+ /**
27
+ * Marks the page the visitor is on: `true` or `'page'` is `aria-current="page"`, `'true'` is
28
+ * `aria-current="true"` for an entry that holds the page without being it (a section's entry on
29
+ * one of its pages), anything else is no mark.
30
+ */
31
+ current?: boolean | 'page' | 'true';
28
32
  /** `card` when the author made the entry a promotional card. With a resolved `card` the panel draws a picture, title and price; without one it is a plain link. */
29
33
  display?: 'card' | 'link';
30
34
  /** Set only on a resolved card; without it the entry is a plain link whatever `display` says. */
31
35
  card?: NavMenuCard;
36
+ /**
37
+ * `accent` draws a top-level entry in the accent colour, in the bar and in the drawer (a "Sale"
38
+ * link). The entry carries it as `data-tone`. Not read on a panel's own entries.
39
+ */
40
+ tone?: NavMenuTone;
32
41
  }
42
+ /** How a top-level entry is coloured: as its siblings (`default`), or in the accent colour. */
43
+ export type NavMenuTone = 'default' | 'accent';
33
44
  /** One column of a panel, as a resolved Studio link's `sections`. */
34
45
  export interface NavMenuSection {
35
46
  /** The column heading. Without one the column's links sit under no heading. */
@@ -76,6 +87,13 @@ export type NavMenuVariant = 'ghost' | 'muted';
76
87
  * open under a heading row (a link when the entry has a page), its links indented beneath.
77
88
  */
78
89
  export type NavMenuDrawerLayout = 'accordion' | 'sections';
90
+ /**
91
+ * `sheet` (default) opens the narrow-screen menu as a modal `Drawer` from the side. `inline` opens it
92
+ * as a disclosure hanging under the menu's positioning box (a whole header, when the root is made
93
+ * `static`), filling the window below and scrolling on its own; its button stays in view and reads
94
+ * as Close while it is open.
95
+ */
96
+ export type NavMenuDrawerMode = 'sheet' | 'inline';
79
97
  /** Where a panel's content is drawn: under the bar, or in the narrow-screen drawer. */
80
98
  export type NavMenuPlacement = 'bar' | 'drawer';
81
99
  /** The parts of a panel's content; in the drawer each one is named with a `drawer` prefix. */
@@ -116,6 +134,8 @@ export interface NavMenuProps {
116
134
  drawerSide?: DrawerSide;
117
135
  /** How the drawer shows a panel: `accordion` (default) rows that open, or `sections` listed open. */
118
136
  drawerLayout?: NavMenuDrawerLayout;
137
+ /** How the drawer opens: `sheet` (default), a modal side sheet, or `inline` under the bar. */
138
+ drawerMode?: NavMenuDrawerMode;
119
139
  /** The drawer's entries when they differ from the bar's. Defaults to `items`. */
120
140
  drawerItems?: readonly NavMenuItem[];
121
141
  /** Also open a panel when a mouse pointer rests 150ms on its trigger; leaving closes it again. */
@@ -171,6 +171,8 @@ declare const __VLS_export: import('vue').DefineComponent<PaginationProps, {}, {
171
171
  phoneNoMatch: (query: string) => string;
172
172
  phoneInvalid: (country: string) => string;
173
173
  phoneInvalidNumber: string;
174
+ amountNotANumber: string;
175
+ amountNoDecimals: string;
174
176
  }>;
175
177
  linkAs: string | import('vue').Component;
176
178
  ariaLabel: string;
@@ -7,6 +7,7 @@ declare const __VLS_export: import('vue').DefineComponent<ProductCardProps, {},
7
7
  headingLevel: import('../../index.js').HeadingLevel;
8
8
  classes: Partial<Record<import('./types.js').ProductCardPart, string>>;
9
9
  loading: boolean;
10
+ quickAddLabel: string;
10
11
  quickAdd: boolean;
11
12
  linkAs: string | import('vue').Component;
12
13
  locale: string;
@@ -15,8 +16,13 @@ declare const __VLS_export: import('vue').DefineComponent<ProductCardProps, {},
15
16
  announce: boolean;
16
17
  revalidating: boolean;
17
18
  showVendor: boolean;
19
+ vendorPlacement: "above" | "below";
18
20
  showRating: boolean;
19
21
  showSwatches: boolean;
22
+ maxSwatches: number;
23
+ saleBadgeLabel: string;
24
+ quickAddName: string;
25
+ quickAddIcon: import('../../index.js').IconComponent;
20
26
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
21
27
  declare const _default: typeof __VLS_export;
22
28
  export default _default;
@@ -2,6 +2,7 @@ import { Component } from 'vue';
2
2
  import { HeadingLevel } from '../../composables/useHeadingTag.js';
3
3
  import { ImageMedia } from '../image/types.js';
4
4
  import { StockLevel } from '../badge/types.js';
5
+ import { IconComponent } from '../icon/types.js';
5
6
  /**
6
7
  * The media ratios `ProductCard` itself offers (spec "Product card" → Properties, `ratio` row):
7
8
  * a subset of `Image`'s own `ImageRatio` — the three the spec names for commerce grids, not
@@ -25,7 +26,8 @@ export interface ProductCardProduct {
25
26
  title: string;
26
27
  /** The product page. Also what `quickAdd` events identify the product by, alongside `title`. */
27
28
  url: string;
28
- /** Shown above the title when `showVendor` is on. */
29
+ /** Shown when `showVendor` is on: above the title, or after the price with
30
+ * `vendorPlacement: 'below'`. */
29
31
  vendor?: string;
30
32
  /** `null`/omitted renders `Image`'s own live "No image" placeholder at the same ratio. */
31
33
  featuredImage?: ImageMedia | null;
@@ -67,17 +69,38 @@ export interface ProductCardProduct {
67
69
  }
68
70
  /** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them,
69
71
  * plus `stockLine` for the addition beyond it (see `ProductCardProduct.stock`). */
70
- export type ProductCardPart = 'media' | 'badges' | 'body' | 'vendor' | 'title' | 'link' | 'price' | 'notSold' | 'rating' | 'stockLine' | 'swatches' | 'swatch' | 'swatchOverflow' | 'quickAdd' | 'skeleton';
72
+ export type ProductCardPart = 'media' | 'badges' | 'saleBadge' | 'newBadge' | 'soldOutBadge' | 'body' | 'vendor' | 'title' | 'link' | 'price' | 'notSold' | 'rating' | 'stockLine' | 'swatches' | 'swatch' | 'swatchOverflow' | 'quickAdd' | 'quickAddLabel' | 'skeleton';
71
73
  export interface ProductCardProps {
72
74
  /** The product. See `ProductCardProduct`. */
73
75
  product: ProductCardProduct;
74
76
  /** Shows the vendor line. Defaults to `false` (spec "Product card" → Properties). */
75
77
  showVendor?: boolean;
78
+ /**
79
+ * Where the vendor line sits: `'above'` the title (the default, the spec's anatomy) or
80
+ * `'below'`, after the price — a maker line under the product name.
81
+ */
82
+ vendorPlacement?: 'above' | 'below';
76
83
  /** Shows `Rating`, when the product has one. Defaults to `true` — turn it off store-wide when
77
84
  * the shop has no reviews at all. */
78
85
  showRating?: boolean;
79
86
  /** Shows the colour dots, when the product has any. Defaults to `true`. */
80
87
  showSwatches?: boolean;
88
+ /** The most colour dots drawn before the rest collapse into "+N". Defaults to `3`. */
89
+ maxSwatches?: number;
90
+ /**
91
+ * The sale badge's text in place of the rounded percentage ("Sale" rather than "−25%"). Unset,
92
+ * the badge reads the percentage with a hidden " off".
93
+ */
94
+ saleBadgeLabel?: string;
95
+ /** The quick-add button's visible text. Defaults to the `quickAddLabel` message ("Quick add"). */
96
+ quickAddLabel?: string;
97
+ /**
98
+ * The quick-add button's full accessible name, product included ("Add Merino crew sweater to
99
+ * cart"). Defaults to the `quickAdd` message for the product's title.
100
+ */
101
+ quickAddName?: string;
102
+ /** A leading icon on the quick-add button (a plus, say). None by default. */
103
+ quickAddIcon?: IconComponent;
81
104
  /** Shows the quick-add control (the live button when available, the disabled "Sold out"
82
105
  * button when not). Defaults to `true`. */
83
106
  quickAdd?: boolean;
@@ -194,6 +194,8 @@ declare const __VLS_base: import('vue').DefineComponent<RangeSliderProps, {}, {}
194
194
  phoneNoMatch: (query: string) => string;
195
195
  phoneInvalid: (country: string) => string;
196
196
  phoneInvalidNumber: string;
197
+ amountNotANumber: string;
198
+ amountNoDecimals: string;
197
199
  }>;
198
200
  formatValue: (value: number, end?: RangeSliderEnd) => string;
199
201
  inputs: boolean;
@@ -195,6 +195,8 @@ declare const __VLS_base: import('vue').DefineComponent<SearchBarProps, {}, {},
195
195
  phoneNoMatch: (query: string) => string;
196
196
  phoneInvalid: (country: string) => string;
197
197
  phoneInvalidNumber: string;
198
+ amountNotANumber: string;
199
+ amountNoDecimals: string;
198
200
  }>;
199
201
  pill: boolean;
200
202
  action: string;
@@ -200,6 +200,8 @@ declare const __VLS_base: import('vue').DefineComponent<SearchModalProps, {
200
200
  phoneNoMatch: (query: string) => string;
201
201
  phoneInvalid: (country: string) => string;
202
202
  phoneInvalidNumber: string;
203
+ amountNotANumber: string;
204
+ amountNoDecimals: string;
203
205
  }>;
204
206
  ariaLabel: string;
205
207
  query: string;
@@ -260,6 +260,8 @@ declare const __VLS_base: import('vue').DefineComponent<MultiSelectProps, {}, {}
260
260
  phoneNoMatch: (query: string) => string;
261
261
  phoneInvalid: (country: string) => string;
262
262
  phoneInvalidNumber: string;
263
+ amountNotANumber: string;
264
+ amountNoDecimals: string;
263
265
  }>;
264
266
  showTags: boolean;
265
267
  tagPlacement: "below" | "inside";
@@ -231,6 +231,8 @@ declare const __VLS_base: import('vue').DefineComponent<SelectProps, {}, {}, {},
231
231
  phoneNoMatch: (query: string) => string;
232
232
  phoneInvalid: (country: string) => string;
233
233
  phoneInvalidNumber: string;
234
+ amountNotANumber: string;
235
+ amountNoDecimals: string;
234
236
  }>;
235
237
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
236
238
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -188,6 +188,8 @@ declare const __VLS_base: import('vue').DefineComponent<SiteFormProps, {}, {}, {
188
188
  phoneNoMatch: (query: string) => string;
189
189
  phoneInvalid: (country: string) => string;
190
190
  phoneInvalidNumber: string;
191
+ amountNotANumber: string;
192
+ amountNoDecimals: string;
191
193
  }>;
192
194
  layout: import('./types.js').SiteFormLayout;
193
195
  heading: string;
@@ -173,6 +173,8 @@ declare const __VLS_export: import('vue').DefineComponent<ToastProps, {}, {}, {}
173
173
  phoneNoMatch: (query: string) => string;
174
174
  phoneInvalid: (country: string) => string;
175
175
  phoneInvalidNumber: string;
176
+ amountNotANumber: string;
177
+ amountNoDecimals: string;
176
178
  }>;
177
179
  variant: ToastVariant;
178
180
  action: import('./types.js').ToastAction;
@@ -173,6 +173,8 @@ declare const __VLS_export: import('vue').DefineComponent<ToasterProps, {}, {},
173
173
  phoneNoMatch: (query: string) => string;
174
174
  phoneInvalid: (country: string) => string;
175
175
  phoneInvalidNumber: string;
176
+ amountNotANumber: string;
177
+ amountNoDecimals: string;
176
178
  }>;
177
179
  teleportTo: string | HTMLElement;
178
180
  toasts: ToasterToast[];
@@ -1,3 +1,4 @@
1
+ import { AmountInvalidReason } from '../../utils/amount.js';
1
2
  import { UnitInputProps } from './types.js';
2
3
  declare function formatValue(value: number): string;
3
4
  declare const __VLS_template: () => {
@@ -10,18 +11,22 @@ declare const __VLS_template: () => {
10
11
  type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
11
12
  declare const __VLS_base: import('vue').DefineComponent<UnitInputProps, {
12
13
  formatValue: typeof formatValue;
14
+ isValid: import('vue').ComputedRef<boolean>;
15
+ invalidReason: import('vue').ComputedRef<AmountInvalidReason | null>;
13
16
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
17
  "update:modelValue": (value: number | null) => any;
15
18
  clear: () => any;
16
19
  blur: (event: FocusEvent) => any;
17
20
  focus: (event: FocusEvent) => any;
18
21
  "update:formattedValue": (value: string) => any;
22
+ "update:valid": (valid: boolean) => any;
19
23
  }, string, import('vue').PublicProps, Readonly<UnitInputProps> & Readonly<{
20
24
  "onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
21
25
  onClear?: (() => any) | undefined;
22
26
  onBlur?: ((event: FocusEvent) => any) | undefined;
23
27
  onFocus?: ((event: FocusEvent) => any) | undefined;
24
28
  "onUpdate:formattedValue"?: ((value: string) => any) | undefined;
29
+ "onUpdate:valid"?: ((valid: boolean) => any) | undefined;
25
30
  }>, {
26
31
  name: string;
27
32
  label: string;
@@ -32,6 +37,7 @@ declare const __VLS_base: import('vue').DefineComponent<UnitInputProps, {
32
37
  unit: string;
33
38
  leadingIcon: import('../../index.js').IconComponent;
34
39
  id: string;
40
+ placeholder: string;
35
41
  min: number;
36
42
  max: number;
37
43
  step: number;
@@ -46,6 +52,8 @@ declare const __VLS_base: import('vue').DefineComponent<UnitInputProps, {
46
52
  maxFraction: number;
47
53
  isCurrency: boolean;
48
54
  enableDragAdjust: boolean;
55
+ fixedFraction: boolean;
56
+ nullable: boolean;
49
57
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
50
58
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
51
59
  declare const _default: typeof __VLS_export;
@@ -24,7 +24,10 @@ export interface UnitInputProps {
24
24
  * `FieldWrapper` the wrapper owns the label, and this is ignored rather than said twice.
25
25
  */
26
26
  label?: string;
27
- /** The most fraction digits the formatted value keeps. Defaults to `2`. */
27
+ /**
28
+ * The most fraction digits the field takes. Defaults to `2`. A currency without decimals (ISK)
29
+ * takes none whatever this says.
30
+ */
28
31
  maxFraction?: number;
29
32
  /** The highest value the field accepts. Typing past it is refused. Defaults to `2 ** 53 - 1`. */
30
33
  max?: number;
@@ -42,6 +45,15 @@ export interface UnitInputProps {
42
45
  currency?: string;
43
46
  /** `$` rather than `US$` where the two differ (`currencyDisplay: 'narrowSymbol'`). Default `false`. */
44
47
  narrowSymbol?: boolean;
48
+ /**
49
+ * Currency only: always the currency's own decimals at rest (`34,90 €`, `4.990 kr.`), and no
50
+ * more while typing. Defaults to `false`.
51
+ */
52
+ fixedFraction?: boolean;
53
+ /** An emptied field stays empty and emits `null`, instead of falling back to `min`. */
54
+ nullable?: boolean;
55
+ /** Shown while empty, in place of the formatted zero. */
56
+ placeholder?: string;
45
57
  /** One of the spec's three field sizes. Defaults to `md`. */
46
58
  size?: InputSize;
47
59
  /** The control's id. Comes from the `FieldWrapper` when there is one; this wins over it. */