@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.
- package/CHANGELOG.md +1724 -0
- package/LICENSE +21 -0
- package/README.md +3177 -2
- package/dist/VariantPicker-CKw8hmxt.js +9009 -0
- package/dist/componentNames.d.ts +19 -0
- package/dist/components/accordion/Accordion.vue.d.ts +18 -0
- package/dist/components/accordion/AccordionItem.vue.d.ts +26 -0
- package/dist/components/accordion/context.d.ts +20 -0
- package/dist/components/accordion/detailsExclusivity.d.ts +3 -0
- package/dist/components/accordion/heightTransition.d.ts +59 -0
- package/dist/components/accordion/types.d.ts +40 -0
- package/dist/components/avatar/Avatar.vue.d.ts +10 -0
- package/dist/components/avatar/AvatarGroup.vue.d.ts +7 -0
- package/dist/components/avatar/types.d.ts +61 -0
- package/dist/components/badge/Badge.vue.d.ts +24 -0
- package/dist/components/badge/StockBadge.vue.d.ts +10 -0
- package/dist/components/badge/types.d.ts +79 -0
- package/dist/components/breadcrumb/Breadcrumb.vue.d.ts +10 -0
- package/dist/components/breadcrumb/types.d.ts +53 -0
- package/dist/components/button/Button.vue.d.ts +37 -0
- package/dist/components/button/ButtonGroup.vue.d.ts +17 -0
- package/dist/components/button/types.d.ts +68 -0
- package/dist/components/card/ContentCard.vue.d.ts +36 -0
- package/dist/components/card/FeatureCard.vue.d.ts +27 -0
- package/dist/components/card/cueArrow.d.ts +10 -0
- package/dist/components/card/stretchedLink.d.ts +45 -0
- package/dist/components/card/types.d.ts +92 -0
- package/dist/components/carousel/Carousel.vue.d.ts +39 -0
- package/dist/components/carousel/types.d.ts +75 -0
- package/dist/components/carousel/useCarousel.d.ts +152 -0
- package/dist/components/checkbox/Checkbox.vue.d.ts +36 -0
- package/dist/components/checkbox/CheckboxGroup.vue.d.ts +16 -0
- package/dist/components/checkbox/types.d.ts +78 -0
- package/dist/components/chip/Chip.vue.d.ts +37 -0
- package/dist/components/chip/ChipGroup.vue.d.ts +21 -0
- package/dist/components/chip/context.d.ts +22 -0
- package/dist/components/chip/types.d.ts +84 -0
- package/dist/components/container/Container.vue.d.ts +18 -0
- package/dist/components/container/types.d.ts +17 -0
- package/dist/components/currency-input/CurrencyInput.vue.d.ts +17 -0
- package/dist/components/currency-input/types.d.ts +8 -0
- package/dist/components/dialog/Dialog.vue.d.ts +34 -0
- package/dist/components/dialog/types.d.ts +25 -0
- package/dist/components/drawer/Drawer.vue.d.ts +36 -0
- package/dist/components/drawer/types.d.ts +30 -0
- package/dist/components/empty-state/EditorPlaceholder.vue.d.ts +9 -0
- package/dist/components/empty-state/EmptyState.vue.d.ts +28 -0
- package/dist/components/empty-state/types.d.ts +59 -0
- package/dist/components/field-wrapper/FieldError.vue.d.ts +37 -0
- package/dist/components/field-wrapper/FieldWrapper.vue.d.ts +30 -0
- package/dist/components/field-wrapper/context.d.ts +44 -0
- package/dist/components/field-wrapper/types.d.ts +38 -0
- package/dist/components/filter-panel/FilterGroup.vue.d.ts +48 -0
- package/dist/components/filter-panel/FilterPanel.vue.d.ts +77 -0
- package/dist/components/filter-panel/Histogram.vue.d.ts +15 -0
- package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +12 -0
- package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +12 -0
- package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +20 -0
- package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +12 -0
- package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +12 -0
- package/dist/components/filter-panel/facets/shared.d.ts +39 -0
- package/dist/components/filter-panel/northwind.d.ts +32 -0
- package/dist/components/filter-panel/swatchInk.d.ts +50 -0
- package/dist/components/filter-panel/types.d.ts +183 -0
- package/dist/components/filter-panel/useFilterPanel.d.ts +230 -0
- package/dist/components/form-layout/FormLayout.vue.d.ts +36 -0
- package/dist/components/form-layout/context.d.ts +33 -0
- package/dist/components/form-layout/focusInvalid.d.ts +18 -0
- package/dist/components/form-layout/types.d.ts +52 -0
- package/dist/components/icon/Icon.vue.d.ts +8 -0
- package/dist/components/icon/types.d.ts +29 -0
- package/dist/components/image/Image.vue.d.ts +21 -0
- package/dist/components/image/types.d.ts +81 -0
- package/dist/components/input/Input.vue.d.ts +47 -0
- package/dist/components/input/classes.d.ts +110 -0
- package/dist/components/input/types.d.ts +55 -0
- package/dist/components/internal/ValueText.vue.d.ts +7 -0
- package/dist/components/lightbox/Lightbox.vue.d.ts +19 -0
- package/dist/components/lightbox/types.d.ts +47 -0
- package/dist/components/link/Link.vue.d.ts +23 -0
- package/dist/components/link/types.d.ts +40 -0
- package/dist/components/load-more/LoadMore.vue.d.ts +12 -0
- package/dist/components/load-more/types.d.ts +21 -0
- package/dist/components/logo-item/LogoItem.vue.d.ts +10 -0
- package/dist/components/logo-item/types.d.ts +37 -0
- package/dist/components/pagination/Pagination.vue.d.ts +15 -0
- package/dist/components/pagination/types.d.ts +51 -0
- package/dist/components/popover/Popover.vue.d.ts +31 -0
- package/dist/components/popover/types.d.ts +53 -0
- package/dist/components/price/Price.vue.d.ts +25 -0
- package/dist/components/price/types.d.ts +104 -0
- package/dist/components/product-card/ProductCard.vue.d.ts +22 -0
- package/dist/components/product-card/types.d.ts +123 -0
- package/dist/components/quantity-stepper/QuantityStepper.vue.d.ts +26 -0
- package/dist/components/quantity-stepper/types.d.ts +35 -0
- package/dist/components/radio/RadioGroup.vue.d.ts +38 -0
- package/dist/components/radio/types.d.ts +39 -0
- package/dist/components/range-slider/RangeSlider.vue.d.ts +70 -0
- package/dist/components/range-slider/types.d.ts +151 -0
- package/dist/components/range-slider/useRangeSlider.d.ts +106 -0
- package/dist/components/rating/Rating.vue.d.ts +22 -0
- package/dist/components/rating/RatingStars.vue.d.ts +16 -0
- package/dist/components/rating/types.d.ts +45 -0
- package/dist/components/search-bar/SearchBar.vue.d.ts +47 -0
- package/dist/components/search-bar/SearchResultsPanel.vue.d.ts +93 -0
- package/dist/components/search-bar/shortcutOwner.d.ts +39 -0
- package/dist/components/search-bar/types.d.ts +122 -0
- package/dist/components/search-modal/SearchModal.vue.d.ts +53 -0
- package/dist/components/search-modal/types.d.ts +59 -0
- package/dist/components/section/Section.vue.d.ts +21 -0
- package/dist/components/section/context.d.ts +23 -0
- package/dist/components/section/types.d.ts +34 -0
- package/dist/components/select/MultiSelect.vue.d.ts +62 -0
- package/dist/components/select/Select.vue.d.ts +57 -0
- package/dist/components/select/SelectPanel.vue.d.ts +97 -0
- package/dist/components/select/openRegistry.d.ts +11 -0
- package/dist/components/select/panelParts.d.ts +91 -0
- package/dist/components/select/types.d.ts +129 -0
- package/dist/components/select/useListbox.d.ts +106 -0
- package/dist/components/select/useOptionList.d.ts +61 -0
- package/dist/components/select/usePopover.d.ts +147 -0
- package/dist/components/skeleton/Skeleton.vue.d.ts +12 -0
- package/dist/components/skeleton/types.d.ts +38 -0
- package/dist/components/spinner/Spinner.vue.d.ts +3 -0
- package/dist/components/switch/Switch.vue.d.ts +30 -0
- package/dist/components/switch/types.d.ts +20 -0
- package/dist/components/tabs/Tab.vue.d.ts +17 -0
- package/dist/components/tabs/TabPanel.vue.d.ts +16 -0
- package/dist/components/tabs/Tabs.vue.d.ts +28 -0
- package/dist/components/tabs/context.d.ts +48 -0
- package/dist/components/tabs/types.d.ts +63 -0
- package/dist/components/textarea/Textarea.vue.d.ts +27 -0
- package/dist/components/textarea/supportsFieldSizing.d.ts +10 -0
- package/dist/components/textarea/types.d.ts +32 -0
- package/dist/components/toast/Toast.vue.d.ts +16 -0
- package/dist/components/toast/Toaster.vue.d.ts +13 -0
- package/dist/components/toast/types.d.ts +44 -0
- package/dist/components/tooltip/Tooltip.vue.d.ts +9 -0
- package/dist/components/tooltip/supportsFocusVisible.d.ts +17 -0
- package/dist/components/tooltip/types.d.ts +46 -0
- package/dist/components/unit-input/UnitInput.vue.d.ts +55 -0
- package/dist/components/unit-input/types.d.ts +68 -0
- package/dist/components/unit-input/undo-redo.d.ts +6 -0
- package/dist/components/variant-picker/VariantPicker.vue.d.ts +15 -0
- package/dist/components/variant-picker/types.d.ts +49 -0
- package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +18 -0
- package/dist/components/visually-hidden/types.d.ts +14 -0
- package/dist/composables/dialogStack.d.ts +52 -0
- package/dist/composables/teleportTarget.d.ts +79 -0
- package/dist/composables/useControllableModel.d.ts +16 -0
- package/dist/composables/useDialog.d.ts +84 -0
- package/dist/composables/useFloating.d.ts +82 -0
- package/dist/composables/useHeadingTag.d.ts +24 -0
- package/dist/composables/useLocale.d.ts +81 -0
- package/dist/composables/useMessages.d.ts +30 -0
- package/dist/composables/useOverlay.d.ts +88 -0
- package/dist/composables/useSlotPresence.d.ts +29 -0
- package/dist/composables/useToast.d.ts +53 -0
- package/dist/icons/paths.d.ts +10 -0
- package/dist/index.d.ts +135 -0
- package/dist/index.js +12586 -0
- package/dist/listFormat-1UrH38f2.js +39 -0
- package/dist/messages/en-US.d.ts +485 -0
- package/dist/messages/index.d.ts +2 -0
- package/dist/messages/is-IS.d.ts +16 -0
- package/dist/messages/is-IS.js +169 -0
- package/dist/resolver.d.ts +43 -0
- package/dist/resolver.js +121 -0
- package/dist/style.css +5251 -0
- package/dist/tailwind.css +2057 -0
- package/dist/tokens.css +134 -0
- package/dist/utils/avatar.d.ts +15 -0
- package/dist/utils/color.d.ts +11 -0
- package/dist/utils/cssTiming.d.ts +40 -0
- package/dist/utils/cx.d.ts +31 -0
- package/dist/utils/date.d.ts +45 -0
- package/dist/utils/id.d.ts +36 -0
- package/dist/utils/listFormat.d.ts +22 -0
- package/dist/utils/mask.d.ts +48 -0
- package/dist/utils/number-format.d.ts +250 -0
- package/dist/utils/numeric-input.d.ts +42 -0
- package/dist/utils/rating.d.ts +26 -0
- package/dist/utils/ratio.d.ts +18 -0
- package/dist/utils/tagRecipe.d.ts +24 -0
- package/dist/utils/valueFade.d.ts +42 -0
- package/dist/vee-validate/FieldCheckbox.vue.d.ts +14 -0
- package/dist/vee-validate/FieldCheckboxGroup.vue.d.ts +14 -0
- package/dist/vee-validate/FieldCurrencyInput.vue.d.ts +14 -0
- package/dist/vee-validate/FieldInput.vue.d.ts +14 -0
- package/dist/vee-validate/FieldMultiSelect.vue.d.ts +14 -0
- package/dist/vee-validate/FieldQuantityStepper.vue.d.ts +14 -0
- package/dist/vee-validate/FieldRadioGroup.vue.d.ts +14 -0
- package/dist/vee-validate/FieldSearchBar.vue.d.ts +14 -0
- package/dist/vee-validate/FieldSelect.vue.d.ts +14 -0
- package/dist/vee-validate/FieldSwitch.vue.d.ts +14 -0
- package/dist/vee-validate/FieldTextarea.vue.d.ts +14 -0
- package/dist/vee-validate/FieldUnitInput.vue.d.ts +14 -0
- package/dist/vee-validate/FieldVariantPicker.vue.d.ts +14 -0
- package/dist/vee-validate/Form.vue.d.ts +27 -0
- package/dist/vee-validate/context.d.ts +48 -0
- package/dist/vee-validate/index.d.ts +27 -0
- package/dist/vee-validate/types.d.ts +115 -0
- package/dist/vee-validate/useFieldControl.d.ts +67 -0
- package/dist/vee-validate.js +1154 -0
- package/package.json +105 -3
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { t as formatConjunctionList } from "../listFormat-1UrH38f2.js";
|
|
2
|
+
//#region src/messages/is-IS.ts
|
|
3
|
+
/**
|
|
4
|
+
* Icelandic takes the singular for any count ending in 1 except 11: "1 stafur", "21 stafur", but
|
|
5
|
+
* "11 stafir". English is simpler — only exactly 1 is singular — so the two catalogues do not
|
|
6
|
+
* share this helper.
|
|
7
|
+
*/
|
|
8
|
+
function singular(n) {
|
|
9
|
+
return n % 10 === 1 && n % 100 !== 11;
|
|
10
|
+
}
|
|
11
|
+
/** `en-US.ts`'s `reviewsWord`, shared between `rating` and `reviewCount` for the same reason. */
|
|
12
|
+
function reviewsWord(n) {
|
|
13
|
+
return singular(n) ? "umsögn" : "umsagnir";
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* "vara" / "vörur" — the word the Filter panel's counts are spoken with, shared by the two
|
|
17
|
+
* messages that name a value and the drawer's own apply button, so the three cannot drift onto
|
|
18
|
+
* different declensions of one noun.
|
|
19
|
+
*/
|
|
20
|
+
function productsWord(n) {
|
|
21
|
+
return singular(n) ? "vara" : "vörur";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The Icelandic message set, shipped as its own entry point
|
|
25
|
+
* (`@eldrajs/ui/messages/is-IS`) so an English-only store never bundles it.
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { isIS } from '@eldrajs/ui/messages/is-IS';
|
|
29
|
+
* app.provide(MESSAGES_KEY, isIS);
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* Typed as `UiMessages`, so a key added to `en-US.ts` is a compile error here
|
|
33
|
+
* until it is translated; `parity.spec.ts` also checks arity and that no
|
|
34
|
+
* string is left in English.
|
|
35
|
+
*/
|
|
36
|
+
var isIS = {
|
|
37
|
+
clear: "Hreinsa",
|
|
38
|
+
close: "Loka",
|
|
39
|
+
closeDrawer: (name) => `Loka ${name}`,
|
|
40
|
+
closeSearch: "Loka leit",
|
|
41
|
+
cancel: "Hætta við",
|
|
42
|
+
clearSearch: "Hreinsa leit",
|
|
43
|
+
dismissNotification: "Loka tilkynningu",
|
|
44
|
+
notifications: "Tilkynningar",
|
|
45
|
+
loading: "Hleð",
|
|
46
|
+
optional: "valfrjálst",
|
|
47
|
+
required: "Nauðsynlegt",
|
|
48
|
+
search: "Leita",
|
|
49
|
+
selectPlaceholder: "Velja",
|
|
50
|
+
multiSelectPlaceholder: "Allt",
|
|
51
|
+
noResults: "Engar niðurstöður",
|
|
52
|
+
noMatchesFor: (query) => `Engar niðurstöður fyrir „${query}“`,
|
|
53
|
+
noResultsFor: (query) => `Engar niðurstöður fyrir „${query}“`,
|
|
54
|
+
moreSelected: (n) => `+${n}`,
|
|
55
|
+
removeTag: (label) => `Fjarlægja ${label}`,
|
|
56
|
+
selected: "Valið",
|
|
57
|
+
selectedCount: (n) => `${n} valin`,
|
|
58
|
+
noneSelected: "Ekkert valið",
|
|
59
|
+
done: "Lokið",
|
|
60
|
+
decrease: "Minnka",
|
|
61
|
+
increase: "Auka",
|
|
62
|
+
quantity: "Magn",
|
|
63
|
+
quantityUpdated: (n) => `Magn: ${n}`,
|
|
64
|
+
minimum: "Lágmark",
|
|
65
|
+
maximum: "Hámark",
|
|
66
|
+
minimumOf: (name) => `Lágmark ${name}`,
|
|
67
|
+
maximumOf: (name) => `Hámark ${name}`,
|
|
68
|
+
to: "til",
|
|
69
|
+
opensInNewTab: "(opnast í nýjum flipa)",
|
|
70
|
+
counter: (n, max) => `${n} af ${max}`,
|
|
71
|
+
previous: "Fyrri skyggna",
|
|
72
|
+
next: "Næsta skyggna",
|
|
73
|
+
pause: "Hlé",
|
|
74
|
+
play: "Spila",
|
|
75
|
+
slideOf: (position, total) => `${position} af ${total}`,
|
|
76
|
+
goToSlide: (n) => `Fara á skyggnu ${n}`,
|
|
77
|
+
slides: "Skyggnur",
|
|
78
|
+
slideInstructions: "Notaðu vinstri og hægri örvatakka til að fara á milli skyggna. Ýttu á Tab til að fara innan núverandi skyggnu.",
|
|
79
|
+
closeLightbox: "Loka myndaskoðara",
|
|
80
|
+
previousImage: "Fyrri mynd",
|
|
81
|
+
nextImage: "Næsta mynd",
|
|
82
|
+
imageOf: (position, total) => `${position} af ${total}`,
|
|
83
|
+
goToImage: (n) => `Fara á mynd ${n}`,
|
|
84
|
+
lightboxImages: "Myndir",
|
|
85
|
+
charactersLeft: (n) => `${n} ${singular(n) ? "stafur" : "stafir"} eftir`,
|
|
86
|
+
overLimit: (n) => `Yfir hámarkinu um ${n}`,
|
|
87
|
+
soldOut: "Uppselt",
|
|
88
|
+
newBadge: "Nýtt",
|
|
89
|
+
quickAddLabel: "Setja í körfu",
|
|
90
|
+
quickAdd: (title) => `Setja ${title} í körfu`,
|
|
91
|
+
loadingProduct: "Hleð vöru",
|
|
92
|
+
swatchesAvailable: (n) => `Til í ${n} ${singular(n) ? "lit" : "litum"}`,
|
|
93
|
+
noImage: "Engin mynd",
|
|
94
|
+
noImageAvailable: "Engin mynd í boði",
|
|
95
|
+
stockistSite: " (síða söluaðila)",
|
|
96
|
+
stockIn: "Til á lager, sent út á 1–2 dögum",
|
|
97
|
+
stockLow: (n) => n === null ? "Lítið til" : `Lítið til: aðeins ${n} ${singular(n) ? "eintak" : "eintök"} eftir`,
|
|
98
|
+
stockPreorder: (date) => date === void 0 || date === "" ? "Forpöntun" : `Forpöntun, send út ${date}`,
|
|
99
|
+
salePrice: "Tilboðsverð",
|
|
100
|
+
regularPrice: "Fullt verð",
|
|
101
|
+
from: "Frá",
|
|
102
|
+
perUnit: (per) => `/ ${per}`,
|
|
103
|
+
updatingPrice: "Uppfæri verð",
|
|
104
|
+
updatingStock: "Uppfæri lagerstöðu",
|
|
105
|
+
rating: (value, count) => `Einkunn ${value.toFixed(1).replace(".", ",")} af 5, ${count} ${reviewsWord(count)}`,
|
|
106
|
+
noReviews: "Engar umsagnir enn",
|
|
107
|
+
reviewCount: (n) => `${n} ${reviewsWord(n)}`,
|
|
108
|
+
searchTheShop: "Leitaðu í búðinni",
|
|
109
|
+
searchSuggestions: "Leitartillögur",
|
|
110
|
+
searchProducts: "Vörur",
|
|
111
|
+
searchCollections: "Vöruflokkar",
|
|
112
|
+
searchJournal: "Greinar og hjálp",
|
|
113
|
+
searchAdvice: "Athugaðu stafsetninguna eða prófaðu eitt af þessu.",
|
|
114
|
+
recentSearches: "Nýlegar leitir",
|
|
115
|
+
popularSearches: "Vinsælar leitir",
|
|
116
|
+
clearRecent: "Hreinsa nýlegar leitir",
|
|
117
|
+
resultsCount: (n, query) => {
|
|
118
|
+
const count = `${n} ${singular(n) ? "niðurstaða" : "niðurstöður"}`;
|
|
119
|
+
return query === void 0 || query === "" ? count : `${count} fyrir „${query}“`;
|
|
120
|
+
},
|
|
121
|
+
viewAllResults: (n, query) => {
|
|
122
|
+
const count = singular(n) ? `Sjá ${n} niðurstöðu` : `Sjá allar ${n} niðurstöður`;
|
|
123
|
+
return query === void 0 || query === "" ? count : `${count} fyrir „${query}“`;
|
|
124
|
+
},
|
|
125
|
+
searchLoading: "Leita…",
|
|
126
|
+
shortcutHint: "Ýttu á / til að leita",
|
|
127
|
+
searchMoveHint: "til að fara á milli",
|
|
128
|
+
searchOpenHint: "til að opna",
|
|
129
|
+
searchEscHint: "til að hreinsa eða loka",
|
|
130
|
+
error: "Villa",
|
|
131
|
+
tryAgain: "Reyna aftur",
|
|
132
|
+
formErrors: (n) => singular(n) ? `Það er ${n} villa í þessu eyðublaði` : `Það eru ${n} villur í þessu eyðublaði`,
|
|
133
|
+
avatarGroup: (label, names, more) => {
|
|
134
|
+
const items = more > 0 ? [...names, `${more} til viðbótar`] : names;
|
|
135
|
+
return `${label}: ${formatConjunctionList(items, "is-IS")}`;
|
|
136
|
+
},
|
|
137
|
+
learnMore: "Skoða nánar",
|
|
138
|
+
breadcrumbLabel: "Leiðarslóð",
|
|
139
|
+
showMoreLevels: (n) => `Sýna ${n} þrep í viðbót`,
|
|
140
|
+
pagination: "Síðuskipting",
|
|
141
|
+
previousPage: "Fyrri síða",
|
|
142
|
+
nextPage: "Næsta síða",
|
|
143
|
+
pageN: (n, current = false) => current ? `Síða ${n}, núverandi síða` : `Síða ${n}`,
|
|
144
|
+
pageOfTotal: (page, total) => `Síða ${page} af ${total}`,
|
|
145
|
+
showingOf: (shown, total, noun) => `Sýni ${shown} af ${total} ${noun}`,
|
|
146
|
+
loadMore: "Hlaða meira",
|
|
147
|
+
filterPanelTitle: "Síur",
|
|
148
|
+
filterPanelLabel: "Vörusíur",
|
|
149
|
+
filterPanelClearAll: "Hreinsa allt",
|
|
150
|
+
filterPanelApplied: "Valdar síur",
|
|
151
|
+
filterPanelRemoveFilter: (facet, value) => `Fjarlægja síu ${facet}: ${value}`,
|
|
152
|
+
filterPanelShowAll: (n) => `Sýna öll ${n} gildi`,
|
|
153
|
+
filterPanelShowFewer: "Sýna færri",
|
|
154
|
+
filterPanelSearchLabel: (facet) => `Leita að gildum í ${facet}`,
|
|
155
|
+
filterPanelSearchPlaceholder: (facet) => `Leita í ${facet}`,
|
|
156
|
+
filterPanelValueName: (label, count) => `${label}, ${count} ${productsWord(count)}`,
|
|
157
|
+
filterPanelSizeName: (system, label, count) => `${system} ${label}, ${count} ${productsWord(count)}`,
|
|
158
|
+
filterPanelNoneAvailable: ", ekkert til",
|
|
159
|
+
filterPanelImpliedBy: (parent) => `fylgir ${parent}`,
|
|
160
|
+
filterPanelUnder: (parent) => `Undir ${parent}`,
|
|
161
|
+
filterPanelSizeGuide: "Stærðartafla",
|
|
162
|
+
filterPanelMin: "Lágm.",
|
|
163
|
+
filterPanelMax: "Hám.",
|
|
164
|
+
filterPanelOrMore: " eða meira",
|
|
165
|
+
filterPanelShowResults: (n) => `Sýna ${n} ${productsWord(n)}`,
|
|
166
|
+
filterPanelShowProducts: "Sýna vörur"
|
|
167
|
+
};
|
|
168
|
+
//#endregion
|
|
169
|
+
export { isIS as default, isIS };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface EldraUiResolverOptions {
|
|
2
|
+
/** Prefix every resolved tag name is expected to start with. Default `'Eldra'`. */
|
|
3
|
+
prefix?: string;
|
|
4
|
+
}
|
|
5
|
+
interface ResolvedComponent {
|
|
6
|
+
name: string;
|
|
7
|
+
from: '@eldrajs/ui';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Resolver for [`unplugin-vue-components`](https://github.com/unplugin/unplugin-vue-components):
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import Components from 'unplugin-vue-components/vite';
|
|
14
|
+
* import { EldraUiResolver } from '@eldrajs/ui/resolver';
|
|
15
|
+
*
|
|
16
|
+
* export default defineConfig({
|
|
17
|
+
* plugins: [Components({ resolvers: [EldraUiResolver()] })],
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* A template can then use `<EldraButton>`, `<EldraSelect>`, and so on, with no explicit import —
|
|
22
|
+
* the plugin rewrites the tag into `import { Button } from '@eldrajs/ui'` (auto-imported, not
|
|
23
|
+
* globally registered) the first time it sees it. `EldraUiResolver` resolves against exactly the
|
|
24
|
+
* names in `componentNames` (`src/index.ts`'s component exports — see
|
|
25
|
+
* `src/__tests__/componentNames.spec.ts` for the guard that keeps the two in sync); anything else,
|
|
26
|
+
* including the private library's own `Ui*` names, resolves to `undefined` and is left for another
|
|
27
|
+
* resolver or a real component.
|
|
28
|
+
*
|
|
29
|
+
* The default prefix is `'Eldra'`, never `'Ui'` — that prefix belongs to the private Eldra
|
|
30
|
+
* library's own resolver. Pass `{ prefix: 'Ui' }` yourself if a consumer really wants that name;
|
|
31
|
+
* the package never implies it.
|
|
32
|
+
*/
|
|
33
|
+
export declare function EldraUiResolver(options?: EldraUiResolverOptions): {
|
|
34
|
+
type: 'component';
|
|
35
|
+
resolve: (name: string) => ResolvedComponent | undefined;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The list the resolver resolves against — every component the root entry exports, in one array —
|
|
39
|
+
* and the union of its names. Exported here, beside the resolver, because it is the same question:
|
|
40
|
+
* "which components does this package ship?". A consumer registering all of them globally, or
|
|
41
|
+
* typing their own `Record<ComponentName, …>` wrapper map, needs the list rather than a copy of it.
|
|
42
|
+
*/
|
|
43
|
+
export { componentNames, type ComponentName } from './componentNames.js';
|
package/dist/resolver.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
//#region src/componentNames.ts
|
|
2
|
+
/**
|
|
3
|
+
* The components `src/index.ts` exports from its root entry, unprefixed, exactly as `Object.keys`
|
|
4
|
+
* would read them at runtime. Hand-maintained rather than generated: a generator would need its
|
|
5
|
+
* own build step ahead of `vite build` (see `packages/ui/package.json`'s `build` script) for a
|
|
6
|
+
* list of names that changes at most once per component, ever — `src/__tests__/componentNames.spec.ts`
|
|
7
|
+
* guards this list against drift by importing `src/index.ts` and comparing its component keys
|
|
8
|
+
* against this array, so an added or renamed component fails a test here rather than silently
|
|
9
|
+
* missing the resolver.
|
|
10
|
+
*
|
|
11
|
+
* `src/resolver.ts` is the reader: `EldraUiResolver` resolves `<prefix><Name>` for every name here.
|
|
12
|
+
*
|
|
13
|
+
* The `./vee-validate` entry's `Form` and `Field*` components are deliberately **not** here, and
|
|
14
|
+
* `FieldWrapper` — which is a root-entry layout component, not one of them — is the only name
|
|
15
|
+
* beginning with "Field" that belongs in this list. Resolving `<EldraFieldInput>` would auto-import
|
|
16
|
+
* it from `@eldrajs/ui`, where it does not exist, and would pull an optional peer into a project
|
|
17
|
+
* that never installed it. `src/__tests__/veeValidateIsolation.spec.ts` asserts both halves.
|
|
18
|
+
*/
|
|
19
|
+
var componentNames = [
|
|
20
|
+
"Accordion",
|
|
21
|
+
"AccordionItem",
|
|
22
|
+
"Avatar",
|
|
23
|
+
"AvatarGroup",
|
|
24
|
+
"Badge",
|
|
25
|
+
"Breadcrumb",
|
|
26
|
+
"Button",
|
|
27
|
+
"ButtonGroup",
|
|
28
|
+
"Carousel",
|
|
29
|
+
"Checkbox",
|
|
30
|
+
"CheckboxGroup",
|
|
31
|
+
"Chip",
|
|
32
|
+
"ChipGroup",
|
|
33
|
+
"Container",
|
|
34
|
+
"ContentCard",
|
|
35
|
+
"CurrencyInput",
|
|
36
|
+
"Dialog",
|
|
37
|
+
"Drawer",
|
|
38
|
+
"EditorPlaceholder",
|
|
39
|
+
"EmptyState",
|
|
40
|
+
"FeatureCard",
|
|
41
|
+
"FieldWrapper",
|
|
42
|
+
"FilterPanel",
|
|
43
|
+
"FormLayout",
|
|
44
|
+
"Icon",
|
|
45
|
+
"Image",
|
|
46
|
+
"Input",
|
|
47
|
+
"Lightbox",
|
|
48
|
+
"Link",
|
|
49
|
+
"LoadMore",
|
|
50
|
+
"LogoItem",
|
|
51
|
+
"MultiSelect",
|
|
52
|
+
"Pagination",
|
|
53
|
+
"Popover",
|
|
54
|
+
"Price",
|
|
55
|
+
"ProductCard",
|
|
56
|
+
"QuantityStepper",
|
|
57
|
+
"RadioGroup",
|
|
58
|
+
"RangeSlider",
|
|
59
|
+
"Rating",
|
|
60
|
+
"SearchBar",
|
|
61
|
+
"SearchModal",
|
|
62
|
+
"Section",
|
|
63
|
+
"Select",
|
|
64
|
+
"Skeleton",
|
|
65
|
+
"StockBadge",
|
|
66
|
+
"Switch",
|
|
67
|
+
"Tab",
|
|
68
|
+
"TabPanel",
|
|
69
|
+
"Tabs",
|
|
70
|
+
"Textarea",
|
|
71
|
+
"Toast",
|
|
72
|
+
"Toaster",
|
|
73
|
+
"Tooltip",
|
|
74
|
+
"UnitInput",
|
|
75
|
+
"VariantPicker",
|
|
76
|
+
"VisuallyHidden"
|
|
77
|
+
];
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/resolver.ts
|
|
80
|
+
var componentNameSet = new Set(componentNames);
|
|
81
|
+
/**
|
|
82
|
+
* Resolver for [`unplugin-vue-components`](https://github.com/unplugin/unplugin-vue-components):
|
|
83
|
+
*
|
|
84
|
+
* ```ts
|
|
85
|
+
* import Components from 'unplugin-vue-components/vite';
|
|
86
|
+
* import { EldraUiResolver } from '@eldrajs/ui/resolver';
|
|
87
|
+
*
|
|
88
|
+
* export default defineConfig({
|
|
89
|
+
* plugins: [Components({ resolvers: [EldraUiResolver()] })],
|
|
90
|
+
* });
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* A template can then use `<EldraButton>`, `<EldraSelect>`, and so on, with no explicit import —
|
|
94
|
+
* the plugin rewrites the tag into `import { Button } from '@eldrajs/ui'` (auto-imported, not
|
|
95
|
+
* globally registered) the first time it sees it. `EldraUiResolver` resolves against exactly the
|
|
96
|
+
* names in `componentNames` (`src/index.ts`'s component exports — see
|
|
97
|
+
* `src/__tests__/componentNames.spec.ts` for the guard that keeps the two in sync); anything else,
|
|
98
|
+
* including the private library's own `Ui*` names, resolves to `undefined` and is left for another
|
|
99
|
+
* resolver or a real component.
|
|
100
|
+
*
|
|
101
|
+
* The default prefix is `'Eldra'`, never `'Ui'` — that prefix belongs to the private Eldra
|
|
102
|
+
* library's own resolver. Pass `{ prefix: 'Ui' }` yourself if a consumer really wants that name;
|
|
103
|
+
* the package never implies it.
|
|
104
|
+
*/
|
|
105
|
+
function EldraUiResolver(options = {}) {
|
|
106
|
+
const prefix = options.prefix ?? "Eldra";
|
|
107
|
+
return {
|
|
108
|
+
type: "component",
|
|
109
|
+
resolve(name) {
|
|
110
|
+
if (!name.startsWith(prefix)) return void 0;
|
|
111
|
+
const componentName = name.slice(prefix.length);
|
|
112
|
+
if (!componentNameSet.has(componentName)) return void 0;
|
|
113
|
+
return {
|
|
114
|
+
name: componentName,
|
|
115
|
+
from: "@eldrajs/ui"
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { EldraUiResolver, componentNames };
|