@eldrajs/ui 0.2.8 → 0.3.0
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 +52 -0
- package/README.md +324 -161
- package/dist/{VariantPicker-CjWUVhlm.js → VariantPicker-C-9sMXGI.js} +3275 -2040
- package/dist/componentNames.d.ts +1 -1
- package/dist/components/accordion/Accordion.vue.d.ts +1 -2
- package/dist/components/accordion/AccordionItem.vue.d.ts +1 -1
- package/dist/components/accordion/types.d.ts +6 -7
- package/dist/components/avatar/Avatar.vue.d.ts +1 -1
- package/dist/components/avatar/types.d.ts +6 -4
- package/dist/components/badge/types.d.ts +6 -4
- package/dist/components/breadcrumb/types.d.ts +5 -2
- package/dist/components/button/Button.vue.d.ts +6 -3
- package/dist/components/button/ButtonGroup.vue.d.ts +0 -1
- package/dist/components/button/types.d.ts +39 -9
- package/dist/components/card/ContentCard.vue.d.ts +2 -2
- package/dist/components/card/FeatureCard.vue.d.ts +1 -1
- package/dist/components/card/stretchedLink.d.ts +3 -3
- package/dist/components/card/types.d.ts +6 -4
- package/dist/components/carousel/types.d.ts +7 -3
- package/dist/components/checkbox/Checkbox.vue.d.ts +5 -3
- package/dist/components/checkbox/CheckboxGroup.vue.d.ts +1 -1
- package/dist/components/checkbox/types.d.ts +21 -4
- package/dist/components/chip/Chip.vue.d.ts +5 -4
- package/dist/components/chip/ChipGroup.vue.d.ts +0 -1
- package/dist/components/chip/types.d.ts +5 -6
- package/dist/components/container/Container.vue.d.ts +0 -1
- package/dist/components/container/types.d.ts +0 -4
- package/dist/components/dialog/Dialog.vue.d.ts +13 -8
- package/dist/components/dialog/types.d.ts +16 -4
- package/dist/components/drawer/Drawer.vue.d.ts +2 -1
- package/dist/components/drawer/types.d.ts +5 -2
- package/dist/components/empty-state/EmptyState.vue.d.ts +1 -1
- package/dist/components/empty-state/types.d.ts +7 -6
- package/dist/components/field-wrapper/FieldWrapper.vue.d.ts +4 -1
- package/dist/components/field-wrapper/RequiredMark.vue.d.ts +15 -0
- package/dist/components/field-wrapper/context.d.ts +8 -0
- package/dist/components/field-wrapper/types.d.ts +17 -6
- package/dist/components/filter-panel/FilterGroup.vue.d.ts +1 -0
- package/dist/components/filter-panel/FilterPanel.vue.d.ts +7 -6
- package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +1 -0
- package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +1 -0
- package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +2 -1
- package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +1 -0
- package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +1 -0
- package/dist/components/filter-panel/facets/shared.d.ts +4 -4
- package/dist/components/filter-panel/types.d.ts +5 -2
- package/dist/components/form-layout/FormLayout.vue.d.ts +1 -1
- package/dist/components/form-layout/types.d.ts +5 -2
- package/dist/components/icon/Icon.vue.d.ts +1 -2
- package/dist/components/icon/types.d.ts +0 -4
- package/dist/components/image/types.d.ts +3 -2
- package/dist/components/input/Input.vue.d.ts +13 -8
- package/dist/components/input/classes.d.ts +33 -18
- package/dist/components/input/reassertValue.d.ts +13 -0
- package/dist/components/input/types.d.ts +18 -6
- package/dist/components/input/useAdornmentRoom.d.ts +15 -0
- package/dist/components/lightbox/Lightbox.vue.d.ts +2 -1
- package/dist/components/lightbox/types.d.ts +5 -2
- package/dist/components/link/Link.vue.d.ts +1 -1
- package/dist/components/link/types.d.ts +5 -2
- package/dist/components/load-more/types.d.ts +4 -3
- package/dist/components/logo-item/LogoItem.vue.d.ts +1 -1
- package/dist/components/logo-item/types.d.ts +2 -1
- package/dist/components/nav-menu/NavMenu.vue.d.ts +2 -1
- package/dist/components/nav-menu/navLinks.d.ts +1 -1
- package/dist/components/nav-menu/types.d.ts +3 -3
- package/dist/components/pagination/Pagination.vue.d.ts +154 -0
- package/dist/components/pagination/types.d.ts +36 -2
- package/dist/components/popover/Popover.vue.d.ts +29 -2
- package/dist/components/popover/types.d.ts +62 -9
- package/dist/components/price/types.d.ts +3 -2
- package/dist/components/product-card/ProductCard.vue.d.ts +2 -2
- package/dist/components/product-card/types.d.ts +3 -2
- package/dist/components/quantity-stepper/QuantityStepper.vue.d.ts +4 -4
- package/dist/components/quantity-stepper/types.d.ts +5 -2
- package/dist/components/radio/Radio.vue.d.ts +33 -0
- package/dist/components/radio/RadioGroup.vue.d.ts +6 -2
- package/dist/components/radio/recipes.d.ts +41 -0
- package/dist/components/radio/types.d.ts +71 -4
- package/dist/components/range-slider/RangeSlider.vue.d.ts +2 -1
- package/dist/components/range-slider/types.d.ts +5 -2
- package/dist/components/rating/Rating.vue.d.ts +1 -1
- package/dist/components/rating/types.d.ts +3 -2
- package/dist/components/search-bar/SearchBar.vue.d.ts +4 -3
- package/dist/components/search-bar/SearchResultsPanel.vue.d.ts +1 -1
- package/dist/components/search-bar/types.d.ts +5 -2
- package/dist/components/search-modal/SearchModal.vue.d.ts +3 -2
- package/dist/components/search-modal/types.d.ts +7 -4
- package/dist/components/section/Section.vue.d.ts +0 -1
- package/dist/components/section/types.d.ts +0 -4
- package/dist/components/select/MultiSelect.vue.d.ts +53 -6
- package/dist/components/select/Select.vue.d.ts +24 -4
- package/dist/components/select/SelectPanel.vue.d.ts +25 -2
- package/dist/components/select/SelectTags.vue.d.ts +50 -0
- package/dist/components/select/openRegistry.d.ts +14 -4
- package/dist/components/select/panelParts.d.ts +45 -18
- package/dist/components/select/types.d.ts +54 -10
- package/dist/components/select/useOptionList.d.ts +31 -4
- package/dist/components/select/usePopover.d.ts +36 -39
- package/dist/components/select/useSummaryFit.d.ts +21 -0
- package/dist/components/select/useTagRows.d.ts +17 -0
- package/dist/components/site-form/SiteForm.vue.d.ts +3 -2
- package/dist/components/site-form/types.d.ts +6 -2
- package/dist/components/skeleton/Skeleton.vue.d.ts +2 -2
- package/dist/components/skeleton/types.d.ts +4 -4
- package/dist/components/switch/Switch.vue.d.ts +17 -10
- package/dist/components/switch/types.d.ts +29 -2
- package/dist/components/tabler-icon/TablerIcon.vue.d.ts +2 -3
- package/dist/components/tabler-icon/types.d.ts +0 -4
- package/dist/components/tabs/Tab.vue.d.ts +2 -1
- package/dist/components/tabs/TabPanel.vue.d.ts +1 -3
- package/dist/components/tabs/Tabs.vue.d.ts +1 -1
- package/dist/components/tabs/context.d.ts +6 -2
- package/dist/components/tabs/types.d.ts +22 -11
- package/dist/components/textarea/Textarea.vue.d.ts +23 -3
- package/dist/components/textarea/types.d.ts +15 -3
- package/dist/components/toast/Toast.vue.d.ts +2 -0
- package/dist/components/toast/Toaster.vue.d.ts +7 -1
- package/dist/components/toast/types.d.ts +52 -5
- package/dist/components/tooltip/types.d.ts +4 -3
- package/dist/components/unit-input/UnitInput.vue.d.ts +7 -7
- package/dist/components/unit-input/types.d.ts +5 -2
- package/dist/components/variant-picker/VariantPicker.vue.d.ts +1 -1
- package/dist/components/variant-picker/types.d.ts +3 -2
- package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +0 -1
- package/dist/components/visually-hidden/types.d.ts +0 -4
- package/dist/components.css +1556 -2145
- package/dist/composables/useDialog.d.ts +7 -3
- package/dist/composables/useEldraScope.d.ts +24 -0
- package/dist/composables/useFloating.d.ts +21 -8
- package/dist/composables/useOverlay.d.ts +10 -5
- package/dist/composables/useToast.d.ts +3 -0
- package/dist/index.d.ts +12 -10
- package/dist/index.js +2553 -1185
- package/dist/messages/en-US.d.ts +2 -0
- package/dist/messages/is-IS.js +1 -0
- package/dist/resolver.js +1 -0
- package/dist/style.css +1561 -2150
- package/dist/tailwind.css +11 -2203
- package/dist/theme.css +108 -0
- package/dist/tokens.css +1 -0
- package/dist/useMessages-B5nzZghs.js +592 -0
- package/dist/utilities.css +2160 -0
- package/dist/utils/mergeClass.d.ts +3 -0
- package/dist/utils/tagRecipe.d.ts +3 -3
- package/dist/vee-validate.js +42 -6
- package/dist/vue-i18n/index.d.ts +50 -0
- package/dist/vue-i18n/shapes.d.ts +40 -0
- package/dist/vue-i18n.js +289 -0
- package/package.json +17 -3
- package/dist/utils/cx.d.ts +0 -31
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* neither one appears to depend on the other: `MultiSelect` shipped first and `Chip` reuses its
|
|
11
11
|
* visual language, but the recipe itself belongs to neither.
|
|
12
12
|
*/
|
|
13
|
-
export declare const TAG_FILL = "bg-surface-strong text-text";
|
|
13
|
+
export declare const TAG_FILL = "eldra:bg-surface-strong eldra:text-text";
|
|
14
14
|
/** The pill shape and type: rounded-full, min 1.75rem tall, the caption size, `space-1` gap. */
|
|
15
|
-
export declare const TAG_SHAPE = "inline-flex min-h-7 items-center gap-1 rounded-full text-caption";
|
|
15
|
+
export declare const TAG_SHAPE = "eldra:inline-flex eldra:min-h-7 eldra:items-center eldra:gap-1 eldra:rounded-full eldra:text-caption";
|
|
16
16
|
/**
|
|
17
17
|
* Start padding is 0.625rem either way; the end padding is the remove button's own room, so a tag
|
|
18
18
|
* with no remove button is padded evenly instead of ending short.
|
|
@@ -21,4 +21,4 @@ export declare function tagPadding(hasRemoveButton: boolean): string;
|
|
|
21
21
|
/** The remove button: a 1.5rem circle, `muted` at rest, `text` on hover at 11% opacity. */
|
|
22
22
|
export declare const TAG_REMOVE_BUTTON: string;
|
|
23
23
|
/** The remove button's icon: Tabler's `x` at 0.875rem, 1.75 stroke. */
|
|
24
|
-
export declare const TAG_REMOVE_ICON_SIZE = "size-3.5";
|
|
24
|
+
export declare const TAG_REMOVE_ICON_SIZE = "eldra:size-3.5";
|
package/dist/vee-validate.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as focusInvalid, L as CurrencyInput_default, N as Input_default, R as UnitInput_default, _t as FIELD_KEY, b as MultiSelect_default, ft as CheckboxGroup_default, i as SearchBar_default, j as Switch_default, jt as useUiId, k as FormLayout_default, kt as useEldraScope, l as RadioGroup_default, n as Textarea_default, pt as Checkbox_default, r as Select_default, t as VariantPicker_default, y as QuantityStepper_default } from "./VariantPicker-C-9sMXGI.js";
|
|
2
|
+
import { r as useMessages } from "./useMessages-B5nzZghs.js";
|
|
2
3
|
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createSlots, createTextVNode, defineComponent, guardReactiveProps, inject, isRef, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, onScopeDispose, openBlock, provide, ref, renderList, renderSlot, toDisplayString, unref, watch, withCtx } from "vue";
|
|
3
4
|
import { FormContextKey, useField, useForm } from "vee-validate";
|
|
4
5
|
// src/vee-validate/context.ts
|
|
@@ -148,7 +149,9 @@ function useControlProps(props, omit) {
|
|
|
148
149
|
});
|
|
149
150
|
}
|
|
150
151
|
// src/vee-validate/Form.vue?vue&type=script&setup=true&lang.ts
|
|
151
|
-
var _hoisted_1 = ["
|
|
152
|
+
var _hoisted_1 = ["data-eldra-scope"];
|
|
153
|
+
var _hoisted_2 = ["data-eldra-scope"];
|
|
154
|
+
var _hoisted_3 = ["href"];
|
|
152
155
|
var SUMMARY_TITLE = "font-semibold";
|
|
153
156
|
var SUMMARY_LIST = "mt-1 list-disc ps-4";
|
|
154
157
|
var SUMMARY_LINK = "underline";
|
|
@@ -173,6 +176,16 @@ var Form_default = /* @__PURE__ */ defineComponent({
|
|
|
173
176
|
},
|
|
174
177
|
emits: ["submit", "invalid"],
|
|
175
178
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
179
|
+
const eldra = useEldraScope();
|
|
180
|
+
/**
|
|
181
|
+
* `FormLayout` with a vee-validate form behind it.
|
|
182
|
+
*
|
|
183
|
+
* It renders a `FormLayout` and nothing else — every one of its props passes straight through — so
|
|
184
|
+
* the layout, the heading, the actions row, the container-query two-column grid and the polite
|
|
185
|
+
* status region are the same ones the agnostic component ships. What this adds is the form itself:
|
|
186
|
+
* `useForm`, the submit that only reaches the consumer with valid values, the error summary the
|
|
187
|
+
* spec asks a long form for, and the place a server's field errors attach to.
|
|
188
|
+
*/
|
|
176
189
|
const props = __props;
|
|
177
190
|
const emit = __emit;
|
|
178
191
|
const m = useMessages();
|
|
@@ -353,13 +366,19 @@ var Form_default = /* @__PURE__ */ defineComponent({
|
|
|
353
366
|
_: 2
|
|
354
367
|
}, [showSummary.value ? {
|
|
355
368
|
name: "errorSummary",
|
|
356
|
-
fn: withCtx(() => [renderSlot(_ctx.$slots, "errorSummary", normalizeProps(guardReactiveProps(slotProps.value)), () => [createElementVNode("p", {
|
|
369
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "errorSummary", normalizeProps(guardReactiveProps(slotProps.value)), () => [createElementVNode("p", {
|
|
370
|
+
"data-eldra-scope": unref(eldra).scope,
|
|
371
|
+
class: normalizeClass(SUMMARY_TITLE)
|
|
372
|
+
}, toDisplayString(unref(m).formErrors(summary.value.length)), 9, _hoisted_1), createElementVNode("ul", {
|
|
373
|
+
"data-eldra-scope": unref(eldra).scope,
|
|
374
|
+
class: normalizeClass(SUMMARY_LIST)
|
|
375
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(summary.value, (entry) => {
|
|
357
376
|
return openBlock(), createElementBlock("li", { key: entry.name }, [entry.href !== void 0 ? (openBlock(), createElementBlock("a", {
|
|
358
377
|
key: 0,
|
|
359
378
|
href: entry.href,
|
|
360
379
|
class: normalizeClass(SUMMARY_LINK)
|
|
361
|
-
}, toDisplayString(entry.message), 9,
|
|
362
|
-
}), 128))])])]),
|
|
380
|
+
}, toDisplayString(entry.message), 9, _hoisted_3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(entry.message), 1)], 64))]);
|
|
381
|
+
}), 128))], 8, _hoisted_2)])]),
|
|
363
382
|
key: "0"
|
|
364
383
|
} : void 0, _ctx.$slots.actions ? {
|
|
365
384
|
name: "actions",
|
|
@@ -379,6 +398,8 @@ var FieldCheckbox_default = /* @__PURE__ */ defineComponent({
|
|
|
379
398
|
size: {},
|
|
380
399
|
hint: {},
|
|
381
400
|
required: { type: Boolean },
|
|
401
|
+
requiredMark: { type: Boolean },
|
|
402
|
+
error: {},
|
|
382
403
|
disabled: { type: Boolean },
|
|
383
404
|
controls: {},
|
|
384
405
|
id: {},
|
|
@@ -548,7 +569,7 @@ var FieldInput_default = /* @__PURE__ */ defineComponent({
|
|
|
548
569
|
name: {},
|
|
549
570
|
placeholder: {},
|
|
550
571
|
autocomplete: {},
|
|
551
|
-
inputmode: {},
|
|
572
|
+
inputmode: { type: [String, Boolean] },
|
|
552
573
|
min: {},
|
|
553
574
|
max: {},
|
|
554
575
|
step: {},
|
|
@@ -607,6 +628,8 @@ var FieldMultiSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
607
628
|
props: {
|
|
608
629
|
placeholder: {},
|
|
609
630
|
showTags: { type: Boolean },
|
|
631
|
+
tagPlacement: {},
|
|
632
|
+
maxTagRows: {},
|
|
610
633
|
maxSummary: {},
|
|
611
634
|
classes: {},
|
|
612
635
|
options: {},
|
|
@@ -622,6 +645,9 @@ var FieldMultiSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
622
645
|
readonly: { type: Boolean },
|
|
623
646
|
placement: {},
|
|
624
647
|
teleport: { type: [Boolean, String] },
|
|
648
|
+
loading: { type: Boolean },
|
|
649
|
+
creatable: { type: Boolean },
|
|
650
|
+
renderBatch: {},
|
|
625
651
|
messages: {},
|
|
626
652
|
path: {},
|
|
627
653
|
rules: { type: [
|
|
@@ -734,6 +760,9 @@ var FieldRadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
734
760
|
layout: {},
|
|
735
761
|
size: {},
|
|
736
762
|
required: { type: Boolean },
|
|
763
|
+
requiredMark: { type: Boolean },
|
|
764
|
+
help: {},
|
|
765
|
+
invalid: { type: Boolean },
|
|
737
766
|
classes: {},
|
|
738
767
|
path: {},
|
|
739
768
|
rules: { type: [
|
|
@@ -863,6 +892,9 @@ var FieldSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
863
892
|
readonly: { type: Boolean },
|
|
864
893
|
placement: {},
|
|
865
894
|
teleport: { type: [Boolean, String] },
|
|
895
|
+
loading: { type: Boolean },
|
|
896
|
+
creatable: { type: Boolean },
|
|
897
|
+
renderBatch: {},
|
|
866
898
|
messages: {},
|
|
867
899
|
classes: {},
|
|
868
900
|
path: {},
|
|
@@ -910,6 +942,9 @@ var FieldSwitch_default = /* @__PURE__ */ defineComponent({
|
|
|
910
942
|
size: {},
|
|
911
943
|
description: {},
|
|
912
944
|
disabled: { type: Boolean },
|
|
945
|
+
requiredMark: { type: Boolean },
|
|
946
|
+
error: {},
|
|
947
|
+
invalid: { type: Boolean },
|
|
913
948
|
id: {},
|
|
914
949
|
name: {},
|
|
915
950
|
classes: {},
|
|
@@ -959,6 +994,7 @@ var FieldTextarea_default = /* @__PURE__ */ defineComponent({
|
|
|
959
994
|
maxLength: {},
|
|
960
995
|
counter: { type: Boolean },
|
|
961
996
|
hardLimit: { type: Boolean },
|
|
997
|
+
clearable: { type: Boolean },
|
|
962
998
|
minHeight: {},
|
|
963
999
|
required: { type: Boolean },
|
|
964
1000
|
readonly: { type: Boolean },
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { UiMessages } from '../messages/en-US.js';
|
|
2
|
+
export { toVueI18nMessages } from './shapes.js';
|
|
3
|
+
/**
|
|
4
|
+
* The parts of a vue-i18n `Composer` (`useI18n()`, or `i18n.global` with `legacy: false`) this entry
|
|
5
|
+
* reads.
|
|
6
|
+
*/
|
|
7
|
+
export interface EldraUiI18n {
|
|
8
|
+
t(key: string, named: Record<string, unknown>, plural: number): string;
|
|
9
|
+
t(key: string, named?: Record<string, unknown>): string;
|
|
10
|
+
te(key: string, locale?: string): boolean;
|
|
11
|
+
locale: {
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
fallbackLocale?: {
|
|
15
|
+
value: unknown;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface EldraUiI18nOptions {
|
|
19
|
+
/** Where the kit's keys live in your messages. Default `'eldraUi'`: `eldraUi.close`, … */
|
|
20
|
+
prefix?: string;
|
|
21
|
+
/** Text for a key your messages leave out. Default: the English defaults (`enUS`). */
|
|
22
|
+
fallback?: UiMessages;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The kit's messages read through vue-i18n, for `MESSAGES_KEY`. Each key is looked up under
|
|
26
|
+
* `prefix`; one your messages do not have falls back to `fallback`, so a partial translation is
|
|
27
|
+
* fine. Strings are read when a component renders, so switching the locale updates the kit.
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* app.provide(MESSAGES_KEY, eldraUiI18nMessages(i18n.global));
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function eldraUiI18nMessages(i18n: EldraUiI18n, options?: EldraUiI18nOptions): UiMessages;
|
|
34
|
+
/**
|
|
35
|
+
* Reads the kit's messages from the app's vue-i18n for this component and everything below it.
|
|
36
|
+
* Call it during `setup()`, usually in the app root; it uses the global composer unless you pass
|
|
37
|
+
* one (`i18n`).
|
|
38
|
+
*/
|
|
39
|
+
export declare function useEldraUiI18n(options?: EldraUiI18nOptions & {
|
|
40
|
+
i18n?: EldraUiI18n;
|
|
41
|
+
}): void;
|
|
42
|
+
/**
|
|
43
|
+
* Icelandic plural forms for vue-i18n's `pluralRules`: a number ending in 1, except 11, is
|
|
44
|
+
* singular (21 vara, 11 vörur). vue-i18n's default rule treats only 1 as singular.
|
|
45
|
+
*
|
|
46
|
+
* ```ts
|
|
47
|
+
* createI18n({ pluralRules: { 'is-IS': icelandicPluralRule }, … });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function icelandicPluralRule(choice: number, choicesLength: number): number;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { UiMessages } from '../messages/en-US.js';
|
|
2
|
+
type MessageFunction = (...args: never[]) => string;
|
|
3
|
+
/** The messages that take arguments: every one needs a shape below, or this file does not compile. */
|
|
4
|
+
export type FunctionMessageKey = {
|
|
5
|
+
[K in keyof UiMessages]: UiMessages[K] extends MessageFunction ? K : never;
|
|
6
|
+
}[keyof UiMessages];
|
|
7
|
+
/**
|
|
8
|
+
* How a message function maps onto vue-i18n, which has named values and plural forms but no
|
|
9
|
+
* conditions.
|
|
10
|
+
*
|
|
11
|
+
* - `params` names each argument, in order: `createOption(query)` reads `{query}`.
|
|
12
|
+
* - `count` names the argument whose number picks the plural form (`{n} result | {n} results`).
|
|
13
|
+
* - `numbers` names the other numeric arguments (the rest are text).
|
|
14
|
+
* - `variant` picks a key suffix for a branch that is not a count: `pageN(n, true)` reads
|
|
15
|
+
* `pageN_current`, `resultsCount(n, 'shoes')` reads `resultsCount_query`. `variants` gives the
|
|
16
|
+
* arguments that produce each one ('' is the plain key), so a message set can be converted.
|
|
17
|
+
*/
|
|
18
|
+
export interface MessageShape {
|
|
19
|
+
params: readonly string[];
|
|
20
|
+
count?: string;
|
|
21
|
+
numbers?: readonly string[];
|
|
22
|
+
variant?: (...args: unknown[]) => string | undefined;
|
|
23
|
+
variants?: Readonly<Record<string, (sample: unknown[]) => unknown[]>>;
|
|
24
|
+
}
|
|
25
|
+
export declare const SHAPES: {
|
|
26
|
+
readonly [K in FunctionMessageKey]: MessageShape;
|
|
27
|
+
};
|
|
28
|
+
/** The key a call reads: `pageN`, or `pageN_current` for the branch its arguments select. */
|
|
29
|
+
export declare function variantKey(key: FunctionMessageKey, args: unknown[]): string;
|
|
30
|
+
/**
|
|
31
|
+
* A complete message set (`enUS`, `isIS` or your own) as vue-i18n messages: plain strings, named
|
|
32
|
+
* values (`{query}`), plural forms (`{n} result | {n} results`) and a suffixed key per branch
|
|
33
|
+
* (`pageN_current`). Merge it under the prefix `useEldraUiI18n` reads:
|
|
34
|
+
*
|
|
35
|
+
* ```ts
|
|
36
|
+
* i18n.global.mergeLocaleMessage('is-IS', { eldraUi: toVueI18nMessages(isIS) });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function toVueI18nMessages(messages: UiMessages): Record<string, string>;
|
|
40
|
+
export {};
|
package/dist/vue-i18n.js
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { i as enUS, n as provideEldraUiMessages } from "./useMessages-B5nzZghs.js";
|
|
2
|
+
import { t as formatConjunctionList } from "./listFormat-D9ecpDMT.js";
|
|
3
|
+
import { numberFormat } from "@eldrajs/sdk/format";
|
|
4
|
+
import { useI18n } from "vue-i18n";
|
|
5
|
+
// src/vue-i18n/shapes.ts
|
|
6
|
+
var text = (...params) => ({ params });
|
|
7
|
+
var counted = (param = "n") => ({
|
|
8
|
+
params: [param],
|
|
9
|
+
count: param
|
|
10
|
+
});
|
|
11
|
+
var withQuery = {
|
|
12
|
+
params: ["n", "query"],
|
|
13
|
+
count: "n",
|
|
14
|
+
variant: (_n, query) => query === void 0 || query === "" ? void 0 : "query",
|
|
15
|
+
variants: {
|
|
16
|
+
"": ([n]) => [n],
|
|
17
|
+
query: (sample) => sample
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var SHAPES = {
|
|
21
|
+
closeDrawer: text("name"),
|
|
22
|
+
noResultsFor: text("query"),
|
|
23
|
+
noMatchesFor: text("query"),
|
|
24
|
+
createOption: text("query"),
|
|
25
|
+
moreSelected: counted(),
|
|
26
|
+
removeTag: text("label"),
|
|
27
|
+
selectedCount: counted(),
|
|
28
|
+
quantityUpdated: counted(),
|
|
29
|
+
minimumOf: text("name"),
|
|
30
|
+
maximumOf: text("name"),
|
|
31
|
+
counter: {
|
|
32
|
+
params: ["n", "max"],
|
|
33
|
+
numbers: ["n", "max"]
|
|
34
|
+
},
|
|
35
|
+
slideOf: {
|
|
36
|
+
params: ["position", "total"],
|
|
37
|
+
numbers: ["position", "total"]
|
|
38
|
+
},
|
|
39
|
+
goToSlide: {
|
|
40
|
+
params: ["n"],
|
|
41
|
+
numbers: ["n"]
|
|
42
|
+
},
|
|
43
|
+
imageOf: {
|
|
44
|
+
params: ["position", "total"],
|
|
45
|
+
numbers: ["position", "total"]
|
|
46
|
+
},
|
|
47
|
+
goToImage: {
|
|
48
|
+
params: ["n"],
|
|
49
|
+
numbers: ["n"]
|
|
50
|
+
},
|
|
51
|
+
charactersLeft: counted(),
|
|
52
|
+
overLimit: counted(),
|
|
53
|
+
quickAdd: text("title"),
|
|
54
|
+
swatchesAvailable: counted(),
|
|
55
|
+
stockLow: {
|
|
56
|
+
params: ["n"],
|
|
57
|
+
count: "n",
|
|
58
|
+
variant: (n) => n === null ? "unknown" : void 0,
|
|
59
|
+
variants: {
|
|
60
|
+
"": (sample) => sample,
|
|
61
|
+
unknown: () => [null]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
stockPreorder: {
|
|
65
|
+
params: ["date"],
|
|
66
|
+
variant: (date) => date === void 0 || date === "" ? void 0 : "date",
|
|
67
|
+
variants: {
|
|
68
|
+
"": () => [],
|
|
69
|
+
date: (sample) => sample
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
perUnit: text("per"),
|
|
73
|
+
rating: {
|
|
74
|
+
params: ["value", "count"],
|
|
75
|
+
count: "count",
|
|
76
|
+
numbers: ["value"]
|
|
77
|
+
},
|
|
78
|
+
reviewCount: counted(),
|
|
79
|
+
resultsCount: withQuery,
|
|
80
|
+
viewAllResults: withQuery,
|
|
81
|
+
formErrors: counted(),
|
|
82
|
+
avatarGroup: {
|
|
83
|
+
params: [
|
|
84
|
+
"label",
|
|
85
|
+
"names",
|
|
86
|
+
"more"
|
|
87
|
+
],
|
|
88
|
+
numbers: ["more"]
|
|
89
|
+
},
|
|
90
|
+
showMoreLevels: counted(),
|
|
91
|
+
navMenuOverview: text("label"),
|
|
92
|
+
pageN: {
|
|
93
|
+
params: ["n", "current"],
|
|
94
|
+
numbers: ["n"],
|
|
95
|
+
variant: (_n, current) => current ? "current" : void 0,
|
|
96
|
+
variants: {
|
|
97
|
+
"": ([n]) => [n, false],
|
|
98
|
+
current: ([n]) => [n, true]
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
pageOfTotal: {
|
|
102
|
+
params: ["page", "total"],
|
|
103
|
+
numbers: ["page", "total"]
|
|
104
|
+
},
|
|
105
|
+
showingOf: {
|
|
106
|
+
params: [
|
|
107
|
+
"shown",
|
|
108
|
+
"total",
|
|
109
|
+
"noun"
|
|
110
|
+
],
|
|
111
|
+
numbers: ["shown", "total"]
|
|
112
|
+
},
|
|
113
|
+
filterPanelRemoveFilter: text("facet", "value"),
|
|
114
|
+
filterPanelShowAll: counted(),
|
|
115
|
+
filterPanelSearchLabel: text("facet"),
|
|
116
|
+
filterPanelSearchPlaceholder: text("facet"),
|
|
117
|
+
filterPanelValueName: {
|
|
118
|
+
params: ["label", "count"],
|
|
119
|
+
count: "count"
|
|
120
|
+
},
|
|
121
|
+
filterPanelSizeName: {
|
|
122
|
+
params: [
|
|
123
|
+
"system",
|
|
124
|
+
"label",
|
|
125
|
+
"count"
|
|
126
|
+
],
|
|
127
|
+
count: "count"
|
|
128
|
+
},
|
|
129
|
+
filterPanelImpliedBy: text("parent"),
|
|
130
|
+
filterPanelUnder: text("parent"),
|
|
131
|
+
filterPanelShowResults: counted(),
|
|
132
|
+
formTooShort: counted("min"),
|
|
133
|
+
formTooLong: counted("max")
|
|
134
|
+
};
|
|
135
|
+
/** The key a call reads: `pageN`, or `pageN_current` for the branch its arguments select. */
|
|
136
|
+
function variantKey(key, args) {
|
|
137
|
+
const variant = SHAPES[key].variant?.(...args);
|
|
138
|
+
return variant ? `${key}_${variant}` : key;
|
|
139
|
+
}
|
|
140
|
+
var marker = (name) => `\u0001${name}\u0002`;
|
|
141
|
+
var SINGULAR = 1;
|
|
142
|
+
var PLURAL = 7;
|
|
143
|
+
var RATING = 8.3;
|
|
144
|
+
/** vue-i18n's message syntax characters, written as literals. */
|
|
145
|
+
function escape(literal) {
|
|
146
|
+
return literal.replace(/[{}@$|]/g, (char) => `{'${char}'}`);
|
|
147
|
+
}
|
|
148
|
+
function sentinelFor(name, index) {
|
|
149
|
+
return name === "value" ? RATING : 9101 + index * 101;
|
|
150
|
+
}
|
|
151
|
+
function template(fn, args, numbers) {
|
|
152
|
+
let out = fn(...args);
|
|
153
|
+
for (const [name, value] of numbers) {
|
|
154
|
+
const digits = value === RATING ? "8[.,]3" : String(value);
|
|
155
|
+
out = out.replace(new RegExp(`(?<!\\d|\\d[.,])${digits}(?!\\d|[.,]\\d)`, "g"), marker(name));
|
|
156
|
+
}
|
|
157
|
+
return escape(out).replace(/\u0001(\w+)\u0002/g, "{$1}");
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* A complete message set (`enUS`, `isIS` or your own) as vue-i18n messages: plain strings, named
|
|
161
|
+
* values (`{query}`), plural forms (`{n} result | {n} results`) and a suffixed key per branch
|
|
162
|
+
* (`pageN_current`). Merge it under the prefix `useEldraUiI18n` reads:
|
|
163
|
+
*
|
|
164
|
+
* ```ts
|
|
165
|
+
* i18n.global.mergeLocaleMessage('is-IS', { eldraUi: toVueI18nMessages(isIS) });
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
function toVueI18nMessages(messages) {
|
|
169
|
+
const out = {};
|
|
170
|
+
for (const [key, value] of Object.entries(messages)) {
|
|
171
|
+
if (typeof value === "string") {
|
|
172
|
+
out[key] = escape(value);
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
const fn = value;
|
|
176
|
+
const shape = SHAPES[key];
|
|
177
|
+
if (key === "avatarGroup") {
|
|
178
|
+
out.avatarGroup = template(fn, [
|
|
179
|
+
marker("label"),
|
|
180
|
+
[marker("names")],
|
|
181
|
+
0
|
|
182
|
+
], /* @__PURE__ */ new Map());
|
|
183
|
+
const more = 9101;
|
|
184
|
+
const withMore = fn(marker("label"), [], more);
|
|
185
|
+
const item = withMore.slice(withMore.indexOf(String(more)));
|
|
186
|
+
out.avatarGroup_more = template(() => item, [], /* @__PURE__ */ new Map([["n", more]]));
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
const sample = (n) => shape.params.map((name, index) => name === shape.count ? n : shape.numbers?.includes(name) ? sentinelFor(name, index) : marker(name));
|
|
190
|
+
const numbersAt = (n) => new Map(shape.params.flatMap((name, index) => name === shape.count ? [[name, n]] : shape.numbers?.includes(name) ? [[name, sentinelFor(name, index)]] : []));
|
|
191
|
+
for (const [variant, toArgs] of Object.entries(shape.variants ?? { "": (s) => s })) {
|
|
192
|
+
const target = variant ? `${key}_${variant}` : key;
|
|
193
|
+
if (!shape.count) {
|
|
194
|
+
out[target] = template(fn, toArgs(sample(PLURAL)), numbersAt(PLURAL));
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
const forms = [SINGULAR, PLURAL].map((n) => template(fn, toArgs(sample(n)), numbersAt(n)));
|
|
198
|
+
out[target] = forms[0] === forms[1] ? forms[1] : forms.join(" | ");
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return out;
|
|
202
|
+
}
|
|
203
|
+
// src/vue-i18n/index.ts
|
|
204
|
+
/**
|
|
205
|
+
* The kit's messages read through vue-i18n, for `MESSAGES_KEY`. Each key is looked up under
|
|
206
|
+
* `prefix`; one your messages do not have falls back to `fallback`, so a partial translation is
|
|
207
|
+
* fine. Strings are read when a component renders, so switching the locale updates the kit.
|
|
208
|
+
*
|
|
209
|
+
* ```ts
|
|
210
|
+
* app.provide(MESSAGES_KEY, eldraUiI18nMessages(i18n.global));
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
function eldraUiI18nMessages(i18n, options = {}) {
|
|
214
|
+
const prefix = options.prefix ?? "eldraUi";
|
|
215
|
+
const fallback = options.fallback ?? enUS;
|
|
216
|
+
const path = (key) => `${prefix}.${key}`;
|
|
217
|
+
const fallbackLocales = () => {
|
|
218
|
+
const value = i18n.fallbackLocale?.value;
|
|
219
|
+
if (typeof value === "string") return [value];
|
|
220
|
+
return Array.isArray(value) ? value.filter((v) => typeof v === "string") : [];
|
|
221
|
+
};
|
|
222
|
+
const has = (key) => i18n.te(path(key)) || fallbackLocales().some((locale) => i18n.te(path(key), locale));
|
|
223
|
+
const messages = {};
|
|
224
|
+
for (const key of Object.keys(enUS)) {
|
|
225
|
+
if (typeof enUS[key] === "string") {
|
|
226
|
+
Object.defineProperty(messages, key, {
|
|
227
|
+
enumerable: true,
|
|
228
|
+
get: () => has(key) ? i18n.t(path(key)) : fallback[key]
|
|
229
|
+
});
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
const fnKey = key;
|
|
233
|
+
const shape = SHAPES[fnKey];
|
|
234
|
+
const original = fallback[fnKey];
|
|
235
|
+
messages[key] = (...args) => {
|
|
236
|
+
if (fnKey === "avatarGroup") return avatarGroup(args, original);
|
|
237
|
+
const target = variantKey(fnKey, args);
|
|
238
|
+
if (!has(target)) return original(...args);
|
|
239
|
+
const named = {};
|
|
240
|
+
shape.params.forEach((name, index) => {
|
|
241
|
+
named[name] = args[index];
|
|
242
|
+
});
|
|
243
|
+
if (fnKey === "rating") named.value = oneDecimal(args[0]);
|
|
244
|
+
const count = shape.count === void 0 ? void 0 : named[shape.count];
|
|
245
|
+
return typeof count === "number" ? i18n.t(path(target), named, count) : i18n.t(path(target), named);
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function oneDecimal(value) {
|
|
249
|
+
return numberFormat(i18n.locale.value, {
|
|
250
|
+
minimumFractionDigits: 1,
|
|
251
|
+
maximumFractionDigits: 1
|
|
252
|
+
}).format(value);
|
|
253
|
+
}
|
|
254
|
+
function avatarGroup(args, original) {
|
|
255
|
+
const [label, names, more] = args;
|
|
256
|
+
if (!has("avatarGroup") || more > 0 && !has("avatarGroup_more")) return original(...args);
|
|
257
|
+
const items = more > 0 ? [...names, i18n.t(path("avatarGroup_more"), { n: more }, more)] : names;
|
|
258
|
+
return i18n.t(path("avatarGroup"), {
|
|
259
|
+
label,
|
|
260
|
+
names: formatConjunctionList(items, i18n.locale.value)
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
return messages;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Reads the kit's messages from the app's vue-i18n for this component and everything below it.
|
|
267
|
+
* Call it during `setup()`, usually in the app root; it uses the global composer unless you pass
|
|
268
|
+
* one (`i18n`).
|
|
269
|
+
*/
|
|
270
|
+
function useEldraUiI18n(options = {}) {
|
|
271
|
+
const i18n = options.i18n ?? useI18n({ useScope: "global" });
|
|
272
|
+
provideEldraUiMessages(eldraUiI18nMessages(i18n, options));
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Icelandic plural forms for vue-i18n's `pluralRules`: a number ending in 1, except 11, is
|
|
276
|
+
* singular (21 vara, 11 vörur). vue-i18n's default rule treats only 1 as singular.
|
|
277
|
+
*
|
|
278
|
+
* ```ts
|
|
279
|
+
* createI18n({ pluralRules: { 'is-IS': icelandicPluralRule }, … });
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
function icelandicPluralRule(choice, choicesLength) {
|
|
283
|
+
const n = Math.abs(choice);
|
|
284
|
+
const singular = n % 10 === 1 && n % 100 !== 11;
|
|
285
|
+
if (choicesLength === 2) return singular ? 0 : 1;
|
|
286
|
+
if (choicesLength === 3) return n === 0 ? 0 : singular ? 1 : 2;
|
|
287
|
+
return Math.min(n, choicesLength - 1);
|
|
288
|
+
}
|
|
289
|
+
export { eldraUiI18nMessages, icelandicPluralRule, toVueI18nMessages, useEldraUiI18n };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eldrajs/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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",
|
|
@@ -41,12 +41,18 @@
|
|
|
41
41
|
"types": "./dist/vee-validate/index.d.ts",
|
|
42
42
|
"import": "./dist/vee-validate.js"
|
|
43
43
|
},
|
|
44
|
+
"./vue-i18n": {
|
|
45
|
+
"types": "./dist/vue-i18n/index.d.ts",
|
|
46
|
+
"import": "./dist/vue-i18n.js"
|
|
47
|
+
},
|
|
44
48
|
"./messages/is-IS": {
|
|
45
49
|
"types": "./dist/messages/is-IS.d.ts",
|
|
46
50
|
"import": "./dist/messages/is-IS.js"
|
|
47
51
|
},
|
|
48
52
|
"./tokens.css": "./dist/tokens.css",
|
|
49
53
|
"./tailwind.css": "./dist/tailwind.css",
|
|
54
|
+
"./theme.css": "./dist/theme.css",
|
|
55
|
+
"./utilities.css": "./dist/utilities.css",
|
|
50
56
|
"./style.css": "./dist/style.css",
|
|
51
57
|
"./components.css": "./dist/components.css",
|
|
52
58
|
"./package.json": "./package.json"
|
|
@@ -58,7 +64,7 @@
|
|
|
58
64
|
"dependencies": {
|
|
59
65
|
"@floating-ui/vue": "^1.1.5",
|
|
60
66
|
"tailwind-merge": "^3.0.0",
|
|
61
|
-
"@eldrajs/sdk": "^0.4.
|
|
67
|
+
"@eldrajs/sdk": "^0.4.2"
|
|
62
68
|
},
|
|
63
69
|
"devDependencies": {
|
|
64
70
|
"@playwright/test": "1.62.1",
|
|
@@ -74,6 +80,9 @@
|
|
|
74
80
|
"happy-dom": "^21.0.4",
|
|
75
81
|
"pixelmatch": "^7.1.0",
|
|
76
82
|
"pngjs": "^7.0.0",
|
|
83
|
+
"postcss": "^8.5.32",
|
|
84
|
+
"postcss-selector-parser": "^7.1.6",
|
|
85
|
+
"postcss-value-parser": "^4.2.0",
|
|
77
86
|
"storybook": "^10.2.19",
|
|
78
87
|
"tailwindcss": "^4.1.14",
|
|
79
88
|
"vee-validate": "^4.15.0",
|
|
@@ -81,15 +90,20 @@
|
|
|
81
90
|
"vite-plugin-dts": "^5.1.0",
|
|
82
91
|
"vitest-axe": "^0.1.0",
|
|
83
92
|
"vue": "^3.5.30",
|
|
93
|
+
"vue-i18n": "^11.4.16",
|
|
84
94
|
"vue-tsc": "^3.3.11"
|
|
85
95
|
},
|
|
86
96
|
"peerDependencies": {
|
|
87
97
|
"vee-validate": "^4.12.0",
|
|
88
|
-
"vue": "^3.5.0"
|
|
98
|
+
"vue": "^3.5.0",
|
|
99
|
+
"vue-i18n": "^11.0.0"
|
|
89
100
|
},
|
|
90
101
|
"peerDependenciesMeta": {
|
|
91
102
|
"vee-validate": {
|
|
92
103
|
"optional": true
|
|
104
|
+
},
|
|
105
|
+
"vue-i18n": {
|
|
106
|
+
"optional": true
|
|
93
107
|
}
|
|
94
108
|
},
|
|
95
109
|
"engines": {
|
package/dist/utils/cx.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Anything `cx` accepts: a class string, a falsy placeholder for a branch that
|
|
3
|
-
* did not apply, or an object whose truthy keys are class names.
|
|
4
|
-
*
|
|
5
|
-
* An **array is deliberately not in this union**, and neither is it in a
|
|
6
|
-
* `classes` prop's own `Partial<Record<Part, string>>` type: this package's
|
|
7
|
-
* `classes` contract is one string per part, so a TypeScript consumer writing
|
|
8
|
-
* `classes: { root: ['a', 'b'] }` gets a type error where it belongs — at the
|
|
9
|
-
* call. `cx` still *flattens* one at runtime (see `flattenClassValue` below),
|
|
10
|
-
* and `partClass` warns about it in dev, because the type cannot help a
|
|
11
|
-
* JavaScript consumer, a `v-bind` of an untyped object, or a value that arrived
|
|
12
|
-
* from JSON.
|
|
13
|
-
*/
|
|
14
|
-
export type ClassValue = string | false | null | undefined | Record<string, boolean>;
|
|
15
|
-
/**
|
|
16
|
-
* Join class values, then resolve Tailwind conflicts so the last one wins.
|
|
17
|
-
*
|
|
18
|
-
* Every component builds its classes with this, which is what makes the
|
|
19
|
-
* `classes` prop work without `!important`: a consumer's `px-6` replaces the
|
|
20
|
-
* component's `px-4` instead of landing beside it and losing to source order.
|
|
21
|
-
*/
|
|
22
|
-
export declare function cx(...inputs: ClassValue[]): string;
|
|
23
|
-
/**
|
|
24
|
-
* The classes for one named part of a component: the part's own classes with
|
|
25
|
-
* the consumer's override for that part merged over them.
|
|
26
|
-
*
|
|
27
|
-
* `Part` is the union of the part names in the component's spec anatomy, so a
|
|
28
|
-
* typo in a `classes` key is a type error rather than a silently ignored
|
|
29
|
-
* override.
|
|
30
|
-
*/
|
|
31
|
-
export declare function partClass<P extends string>(base: string, classes: Partial<Record<P, string>> | undefined, part: P): string;
|