@eldrajs/ui 0.3.15 → 0.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +3 -2
  3. package/dist/{PhoneInput-B5AgJJVE.js → PhoneInput-CHTpjbtS.js} +2 -2
  4. package/dist/{VariantPicker-Buz_8mHq.js → VariantPicker-Dein0E4i.js} +4200 -4195
  5. package/dist/componentNames.d.ts +1 -1
  6. package/dist/components/autocomplete/Autocomplete.vue.d.ts +2 -0
  7. package/dist/components/chip/Chip.vue.d.ts +2 -0
  8. package/dist/components/currency-picker/CurrencyPicker.vue.d.ts +17 -0
  9. package/dist/components/currency-picker/types.d.ts +21 -0
  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/nav-menu/NavMenu.vue.d.ts +2 -0
  21. package/dist/components/pagination/Pagination.vue.d.ts +2 -0
  22. package/dist/components/popover/Popover.vue.d.ts +1 -1
  23. package/dist/components/product-card/types.d.ts +3 -1
  24. package/dist/components/range-slider/RangeSlider.vue.d.ts +2 -0
  25. package/dist/components/search-bar/SearchBar.vue.d.ts +2 -0
  26. package/dist/components/search-modal/SearchModal.vue.d.ts +3 -1
  27. package/dist/components/section/Section.vue.d.ts +1 -1
  28. package/dist/components/select/MultiSelect.vue.d.ts +2 -0
  29. package/dist/components/select/Select.vue.d.ts +2 -0
  30. package/dist/components/site-form/SiteForm.vue.d.ts +2 -0
  31. package/dist/components/tabs/Tab.vue.d.ts +2 -0
  32. package/dist/components/tabs/Tabs.vue.d.ts +2 -0
  33. package/dist/components/tabs/context.d.ts +3 -1
  34. package/dist/components/tabs/types.d.ts +8 -0
  35. package/dist/components/toast/Toast.vue.d.ts +2 -0
  36. package/dist/components/toast/Toaster.vue.d.ts +2 -0
  37. package/dist/components.css +40 -0
  38. package/dist/index.d.ts +4 -2
  39. package/dist/index.js +1001 -853
  40. package/dist/messages/en-US.d.ts +4 -0
  41. package/dist/messages/is-IS.js +2 -0
  42. package/dist/phone/PhoneInput.vue.d.ts +2 -0
  43. package/dist/phone/vee-validate.js +4 -4
  44. package/dist/phone.js +1 -1
  45. package/dist/resolver.js +1 -0
  46. package/dist/style.css +40 -0
  47. package/dist/{useFieldControl-CGH6GEWM.js → useFieldControl-B1JvPEeM.js} +1 -1
  48. package/dist/{useMessages-CrSnIuLt.js → useMessages-BdN9F1cW.js} +4 -0
  49. package/dist/{useOptionList-CPHHDvPF.js → useOptionList-UMUMayec.js} +1 -0
  50. package/dist/utilities.css +9 -0
  51. package/dist/utils/number-format.d.ts +2 -0
  52. package/dist/vee-validate.js +3 -3
  53. package/dist/vue-i18n.js +2 -1
  54. package/package.json +2 -2
@@ -204,6 +204,8 @@ export declare const enUS: {
204
204
  * draws for English is honoured without constraining every locale to the same shape.
205
205
  */
206
206
  quickAdd: (title: string) => string;
207
+ /** `ProductCard`'s line in place of the price for a product with no price in the chosen currency. */
208
+ notSoldInCurrency: (currency: string) => string;
207
209
  /**
208
210
  * `ProductCard`'s loading skeleton's accessible name (spec "Product card" → Variants, Loading
209
211
  * row: `aria-label="Loading product"`).
@@ -218,6 +220,8 @@ export declare const enUS: {
218
220
  /** `Image`'s live placeholder text, shown next to the photo icon when there is no `media` (spec
219
221
  * "Image" → Variants, "Placeholder (live)" row). */
220
222
  noImage: string;
223
+ /** `CurrencyPicker`'s label: visually hidden in a header, shown in a menu. */
224
+ currencyPickerLabel: string;
221
225
  /** `Image`'s live placeholder's accessible name (spec "Image" → Accessibility: 'otherwise it
222
226
  * gets `role="img"` and `aria-label="No image available"`'), omitted when `decorative` is on. */
223
227
  noImageAvailable: string;
@@ -92,9 +92,11 @@ var isIS = {
92
92
  newBadge: "Nýtt",
93
93
  quickAddLabel: "Setja í körfu",
94
94
  quickAdd: (title) => `Setja ${title} í körfu`,
95
+ notSoldInCurrency: (currency) => `Ekki til sölu í ${currency}`,
95
96
  loadingProduct: "Hleður…",
96
97
  swatchesAvailable: (n) => `Til í ${n} ${singular(n) ? "lit" : "litum"}`,
97
98
  noImage: "Engin mynd",
99
+ currencyPickerLabel: "Gjaldmiðill",
98
100
  noImageAvailable: "Engin mynd í boði",
99
101
  stockistSite: " (síða söluaðila)",
100
102
  stockIn: "Til á lager, sent út á 1–2 dögum",
@@ -104,9 +104,11 @@ declare const __VLS_base: import('vue').DefineComponent<PhoneInputProps, {
104
104
  newBadge: string;
105
105
  quickAddLabel: string;
106
106
  quickAdd: (title: string) => string;
107
+ notSoldInCurrency: (currency: string) => string;
107
108
  loadingProduct: string;
108
109
  swatchesAvailable: (n: number) => string;
109
110
  noImage: string;
111
+ currencyPickerLabel: string;
110
112
  noImageAvailable: string;
111
113
  stockistSite: string;
112
114
  stockIn: string;
@@ -1,7 +1,7 @@
1
- import { d as useEldraUiLocale } from "../useOptionList-CPHHDvPF.js";
2
- import { r as useMessages } from "../useMessages-CrSnIuLt.js";
3
- import { a as useControlProps, n as FIELD_ONLY, o as useFieldControl, r as FIELD_VALIDATION_DEFAULTS } from "../useFieldControl-CGH6GEWM.js";
4
- import { r as phoneRule, t as PhoneInput_default } from "../PhoneInput-B5AgJJVE.js";
1
+ import { d as useEldraUiLocale } from "../useOptionList-UMUMayec.js";
2
+ import { r as useMessages } from "../useMessages-BdN9F1cW.js";
3
+ import { a as useControlProps, n as FIELD_ONLY, o as useFieldControl, r as FIELD_VALIDATION_DEFAULTS } from "../useFieldControl-B1JvPEeM.js";
4
+ import { r as phoneRule, t as PhoneInput_default } from "../PhoneInput-CHTpjbtS.js";
5
5
  import { computed, createBlock, createSlots, defineComponent, guardReactiveProps, isRef, mergeDefaults, mergeProps, normalizeProps, openBlock, reactive, ref, renderList, renderSlot, toRefs, unref, withCtx } from "vue";
6
6
  // src/phone/vee-validate/FieldPhoneInput.vue
7
7
  var FieldPhoneInput_default = /* @__PURE__ */ defineComponent({
package/dist/phone.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as parsePhone, c as phoneExample, i as isValidPhone, n as phoneCountryName, o as phoneCallingCode, r as phoneRule, s as phoneCountries, t as PhoneInput_default } from "./PhoneInput-B5AgJJVE.js";
1
+ import { a as parsePhone, c as phoneExample, i as isValidPhone, n as phoneCountryName, o as phoneCallingCode, r as phoneRule, s as phoneCountries, t as PhoneInput_default } from "./PhoneInput-CHTpjbtS.js";
2
2
  import { n as preloadCountryFlags } from "./CountryFlag-DOa8lOHp.js";
3
3
  export { PhoneInput_default as PhoneInput, isValidPhone, parsePhone, phoneCallingCode, phoneCountries, phoneCountryName, phoneExample, phoneRule, preloadCountryFlags as preloadPhoneFlags };
package/dist/resolver.js CHANGED
@@ -34,6 +34,7 @@ var componentNames = [
34
34
  "Container",
35
35
  "ContentCard",
36
36
  "CurrencyInput",
37
+ "CurrencyPicker",
37
38
  "Dialog",
38
39
  "Drawer",
39
40
  "EditorPlaceholder",
package/dist/style.css CHANGED
@@ -1115,6 +1115,10 @@
1115
1115
  height: 0;
1116
1116
  }
1117
1117
 
1118
+ .eldra\:h-0\.5 {
1119
+ height: .125rem;
1120
+ }
1121
+
1118
1122
  .eldra\:h-1 {
1119
1123
  height: var(--eldra-space-1);
1120
1124
  }
@@ -1143,6 +1147,10 @@
1143
1147
  height: var(--eldra-space-8);
1144
1148
  }
1145
1149
 
1150
+ .eldra\:h-9 {
1151
+ height: 2.25rem;
1152
+ }
1153
+
1146
1154
  .eldra\:h-10 {
1147
1155
  height: 2.5rem;
1148
1156
  }
@@ -2411,6 +2419,10 @@
2411
2419
  background-color: var(--eldra-drawer-handle-color, var(--eldra-color-border-strong));
2412
2420
  }
2413
2421
 
2422
+ .eldra\:bg-\[var\(--eldra-tabs-accent\,var\(--eldra-color-primary\)\)\] {
2423
+ background-color: var(--eldra-tabs-accent, var(--eldra-color-primary));
2424
+ }
2425
+
2414
2426
  .eldra\:bg-accent {
2415
2427
  background-color: var(--eldra-color-accent);
2416
2428
  }
@@ -3240,6 +3252,12 @@
3240
3252
  line-height: var(--eldra-field-note-line-height, 1.45);
3241
3253
  }
3242
3254
 
3255
+ .eldra\:text-tab-sm {
3256
+ font-family: var(--eldra-font-body);
3257
+ font-size: var(--eldra-text-caption-size);
3258
+ line-height: var(--eldra-control-line-height, 1.5rem);
3259
+ }
3260
+
3243
3261
  .eldra\:text-tooltip {
3244
3262
  font-family: var(--eldra-font-body);
3245
3263
  font-size: var(--eldra-text-caption-size);
@@ -3369,6 +3387,14 @@
3369
3387
  color: var(--eldra-select-tag-text, var(--eldra-color-text));
3370
3388
  }
3371
3389
 
3390
+ .eldra\:text-\[color\:var\(--eldra-tabs-accent\,var\(--eldra-color-primary\)\)\] {
3391
+ color: var(--eldra-tabs-accent, var(--eldra-color-primary));
3392
+ }
3393
+
3394
+ .eldra\:text-\[color\:var\(--eldra-tabs-muted\,var\(--eldra-color-muted\)\)\] {
3395
+ color: var(--eldra-tabs-muted, var(--eldra-color-muted));
3396
+ }
3397
+
3372
3398
  .eldra\:text-accent {
3373
3399
  color: var(--eldra-color-accent);
3374
3400
  }
@@ -4036,6 +4062,10 @@
4036
4062
  }
4037
4063
  }
4038
4064
 
4065
+ .eldra\:group-focus-visible\:bottom-\[calc\(var\(--eldra-focus-offset\)_\+_var\(--eldra-focus-width\)\)\]:is(:where(.eldra\:group):focus-visible *) {
4066
+ bottom: calc(var(--eldra-focus-offset) + var(--eldra-focus-width));
4067
+ }
4068
+
4039
4069
  .eldra\:placeholder\:text-\[color\:var\(--eldra-select-panel-muted\,var\(--eldra-color-muted\)\)\]::placeholder {
4040
4070
  color: var(--eldra-select-panel-muted, var(--eldra-color-muted));
4041
4071
  }
@@ -4244,6 +4274,16 @@
4244
4274
  }
4245
4275
  }
4246
4276
 
4277
+ .eldra\:hover\:bg-\[var\(--eldra-tabs-hover-bg\,color-mix\(in_oklab\,var\(--eldra-color-text\)\,transparent_94\%\)\)\]:hover {
4278
+ background-color: var(--eldra-tabs-hover-bg, var(--eldra-color-text));
4279
+ }
4280
+
4281
+ @supports (color: color-mix(in lab, red, red)) {
4282
+ .eldra\:hover\:bg-\[var\(--eldra-tabs-hover-bg\,color-mix\(in_oklab\,var\(--eldra-color-text\)\,transparent_94\%\)\)\]:hover {
4283
+ background-color: var(--eldra-tabs-hover-bg, color-mix(in oklab,var(--eldra-color-text),transparent 94%));
4284
+ }
4285
+ }
4286
+
4247
4287
  .eldra\:hover\:bg-primary:hover {
4248
4288
  background-color: var(--eldra-color-primary);
4249
4289
  }
@@ -1,4 +1,4 @@
1
- import { $ as FIELD_KEY, rt as useUiId } from "./useOptionList-CPHHDvPF.js";
1
+ import { $ as FIELD_KEY, rt as useUiId } from "./useOptionList-UMUMayec.js";
2
2
  import { computed, inject, onMounted, onScopeDispose, shallowRef, watch } from "vue";
3
3
  import { FormContextKey, useField } from "vee-validate";
4
4
  // src/vee-validate/context.ts
@@ -227,6 +227,8 @@ var enUS = {
227
227
  * draws for English is honoured without constraining every locale to the same shape.
228
228
  */
229
229
  quickAdd: (title) => `Quick add ${title}`,
230
+ /** `ProductCard`'s line in place of the price for a product with no price in the chosen currency. */
231
+ notSoldInCurrency: (currency) => `Not available in ${currency}`,
230
232
  /**
231
233
  * `ProductCard`'s loading skeleton's accessible name (spec "Product card" → Variants, Loading
232
234
  * row: `aria-label="Loading product"`).
@@ -241,6 +243,8 @@ var enUS = {
241
243
  /** `Image`'s live placeholder text, shown next to the photo icon when there is no `media` (spec
242
244
  * "Image" → Variants, "Placeholder (live)" row). */
243
245
  noImage: "No image",
246
+ /** `CurrencyPicker`'s label: visually hidden in a header, shown in a menu. */
247
+ currencyPickerLabel: "Currency",
244
248
  /** `Image`'s live placeholder's accessible name (spec "Image" → Accessibility: 'otherwise it
245
249
  * gets `role="img"` and `aria-label="No image available"`'), omitted when `decorative` is on. */
246
250
  noImageAvailable: "No image available",
@@ -122,6 +122,7 @@ var kitMerge = extendTailwindMerge({
122
122
  "search-kbd",
123
123
  "variant-legend",
124
124
  "variant-pill",
125
+ "tab-sm",
125
126
  "logo-wordmark",
126
127
  "badge",
127
128
  "stock-status",
@@ -1394,6 +1394,15 @@
1394
1394
  line-height: var(--eldra-control-line-height, 1.5rem);
1395
1395
  }
1396
1396
 
1397
+ /* The text of a `size="sm"` tab (`Tabs`): a panel tab bar's 13px label. The size is the caption
1398
+ token's, the same reuse `text-price-unit` makes; the line is the control line so the 2.25rem tab
1399
+ centres it. No weight in the shorthand: the component pairs it with `font-medium`. */
1400
+ @utility text-tab-sm {
1401
+ font-family: var(--eldra-font-body);
1402
+ font-size: var(--eldra-text-caption-size);
1403
+ line-height: var(--eldra-control-line-height, 1.5rem);
1404
+ }
1405
+
1397
1406
  /* A pill's own boundary (spec "Variant picker" → States): "1px" in every row but one. The width is
1398
1407
  a variable rather than Tailwind's `border`, the same shape as `eldra-field-border` and
1399
1408
  `eldra-checkbox-border` above: the "sold out + selected" row's own 2px line (below) is inset by
@@ -95,6 +95,8 @@ export declare function parseLocaleNumber(text: string, locale: string): number
95
95
  * `ISK` is 0 under `en-US` too.
96
96
  */
97
97
  export declare function currencyFractionDigits(currency: string, locale?: string): number;
98
+ /** A major-unit amount (`28.5`) as the minor units `Price` reads, by the currency's own decimals; no currency counts two. */
99
+ export declare function toMinorUnits(amount: number, currency: string | undefined, locale?: string): number;
98
100
  /**
99
101
  * The options the private library's `formatUnit` takes, mirrored name for name (its own
100
102
  * `UnitFormatProps`) so that library can alias this module's function in place of its copy.
@@ -1,6 +1,6 @@
1
- import { B as CheckboxGroup_default, C as Switch_default, E as UnitInput_default, S as focusInvalid, T as CurrencyInput_default, V as Checkbox_default, X as Input_default, Y as Autocomplete_default, b as MultiSelect_default, i as SearchBar_default, l as RadioGroup_default, n as Textarea_default, r as Select_default, t as VariantPicker_default, x as FormLayout_default, y as QuantityStepper_default } from "./VariantPicker-Buz_8mHq.js";
2
- import { r as useMessages } from "./useMessages-CrSnIuLt.js";
3
- import { a as useControlProps, c as FIELD_ANCHORS_KEY, i as FIELD_VALIDATION_PROPS, l as FIELD_MESSAGES_KEY, n as FIELD_ONLY, o as useFieldControl, r as FIELD_VALIDATION_DEFAULTS, s as API_ERRORS_KEY, t as FIELD_CHOICE_VALIDATION_DEFAULTS } from "./useFieldControl-CGH6GEWM.js";
1
+ import { E as UnitInput_default, H as Checkbox_default, S as Switch_default, T as CurrencyInput_default, V as CheckboxGroup_default, X as Autocomplete_default, Z as Input_default, b as FormLayout_default, c as RadioGroup_default, n as Textarea_default, r as SearchBar_default, t as VariantPicker_default, v as QuantityStepper_default, w as Select_default, x as focusInvalid, y as MultiSelect_default } from "./VariantPicker-Dein0E4i.js";
2
+ import { r as useMessages } from "./useMessages-BdN9F1cW.js";
3
+ import { a as useControlProps, c as FIELD_ANCHORS_KEY, i as FIELD_VALIDATION_PROPS, l as FIELD_MESSAGES_KEY, n as FIELD_ONLY, o as useFieldControl, r as FIELD_VALIDATION_DEFAULTS, s as API_ERRORS_KEY, t as FIELD_CHOICE_VALIDATION_DEFAULTS } from "./useFieldControl-B1JvPEeM.js";
4
4
  import { r as useEldraScope } from "./useEldraScope-BDbGzt7R.js";
5
5
  import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createSlots, createTextVNode, defineComponent, guardReactiveProps, isRef, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, openBlock, provide, ref, renderList, renderSlot, toDisplayString, unref, watch, withCtx } from "vue";
6
6
  import { useForm } from "vee-validate";
package/dist/vue-i18n.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as enUS, n as provideEldraUiMessages } from "./useMessages-CrSnIuLt.js";
1
+ import { i as enUS, n as provideEldraUiMessages } from "./useMessages-BdN9F1cW.js";
2
2
  import { t as formatConjunctionList } from "./listFormat-D9ecpDMT.js";
3
3
  import { numberFormat } from "@eldrajs/sdk/format";
4
4
  import { useI18n } from "vue-i18n";
@@ -54,6 +54,7 @@ var SHAPES = {
54
54
  charactersLeft: counted(),
55
55
  overLimit: counted(),
56
56
  quickAdd: text("title"),
57
+ notSoldInCurrency: text("currency"),
57
58
  swatchesAvailable: counted(),
58
59
  stockLow: {
59
60
  params: ["n"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eldrajs/ui",
3
- "version": "0.3.15",
3
+ "version": "0.3.17",
4
4
  "description": "Accessible Vue 3 core components for Eldra storefronts: buttons, forms, selects, cards, overlays and navigation, themed through CSS design tokens.",
5
5
  "keywords": [
6
6
  "accessible",
@@ -77,7 +77,7 @@
77
77
  "dependencies": {
78
78
  "@floating-ui/vue": "^1.1.5",
79
79
  "tailwind-merge": "^3.0.0",
80
- "@eldrajs/sdk": "^0.5.2"
80
+ "@eldrajs/sdk": "^0.5.3"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@playwright/test": "1.62.1",