@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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UiMessages } from '../../composables/useMessages.js';
|
|
2
2
|
/** Spec "Toast" -> Variants: icon, colour and timing all key off this. */
|
|
3
|
-
|
|
3
|
+
/** `info` is neutral news: the text colour, polite, timed like `success`. */
|
|
4
|
+
export type ToastVariant = 'success' | 'info' | 'warning' | 'danger';
|
|
4
5
|
/**
|
|
5
6
|
* One action a toast offers (spec "Toast" -> Properties, `action` row): "One action: a link
|
|
6
7
|
* ('View cart (3)') or a button ('Try again')." A discriminated union rather than one interface
|
|
@@ -15,10 +16,10 @@ export type ToastAction = {
|
|
|
15
16
|
onActivate: () => void;
|
|
16
17
|
};
|
|
17
18
|
/** The parts a consumer can restyle through `classes` (spec "Toast" -> Anatomy). */
|
|
18
|
-
export type ToastPart = '
|
|
19
|
+
export type ToastPart = 'icon' | 'title' | 'text' | 'action' | 'close';
|
|
19
20
|
export interface ToastProps {
|
|
20
21
|
/** Icon, colour and auto-dismiss timing (see `useToast`'s `DEFAULT_DURATION`). Default
|
|
21
|
-
* `"success"`. */
|
|
22
|
+
* `"success"`. Also on the root as `data-variant`, for a consumer's per-variant selector. */
|
|
22
23
|
variant?: ToastVariant;
|
|
23
24
|
/** The message. The meaning is always in this text — colour and icon are extras (1.4.1). */
|
|
24
25
|
title: string;
|
|
@@ -26,19 +27,65 @@ export interface ToastProps {
|
|
|
26
27
|
text?: string;
|
|
27
28
|
/** One action: a link or a link-style button. */
|
|
28
29
|
action?: ToastAction;
|
|
30
|
+
/**
|
|
31
|
+
* Shows the close button and closes on `Escape`. Default `true`. `false` is for a toast that must
|
|
32
|
+
* stay until its own timer or the app removes it.
|
|
33
|
+
*/
|
|
34
|
+
closable?: boolean;
|
|
29
35
|
/** Message overrides (only `dismissNotification` applies here). See `useMessages`. */
|
|
30
36
|
messages?: Partial<UiMessages>;
|
|
31
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Per-part classes, appended to the part's own (they win by cascade layer). Style the toast
|
|
39
|
+
* itself with `class`.
|
|
40
|
+
*/
|
|
32
41
|
classes?: Partial<Record<ToastPart, string>>;
|
|
33
42
|
}
|
|
34
43
|
/** The parts a consumer can restyle through `classes` (`Toaster`'s own anatomy: the fixed region
|
|
35
44
|
* and the polite status list inside it — see `Toaster.vue`'s own doc comment for why a danger
|
|
36
45
|
* toast is not inside `list`). */
|
|
37
46
|
export type ToasterPart = 'root' | 'list';
|
|
47
|
+
/** Where the stack sits in the viewport. */
|
|
48
|
+
export type ToasterPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
49
|
+
/**
|
|
50
|
+
* One toast in an externally owned list (`Toaster`'s `toasts`). `useToast`'s `ToastItem` is one;
|
|
51
|
+
* `variant` defaults to `"success"`, and with no `duration` (or `0`) the toast keeps no timer of
|
|
52
|
+
* the `Toaster`'s own, so the list's owner decides when it leaves.
|
|
53
|
+
*/
|
|
54
|
+
export interface ToasterToast {
|
|
55
|
+
id: string;
|
|
56
|
+
title: string;
|
|
57
|
+
variant?: ToastVariant;
|
|
58
|
+
text?: string;
|
|
59
|
+
action?: ToastAction;
|
|
60
|
+
closable?: boolean;
|
|
61
|
+
/** Auto-dismiss time in ms, after which `dismiss(id, "timeout")` fires. Ignored for `danger`. */
|
|
62
|
+
duration?: number;
|
|
63
|
+
}
|
|
38
64
|
export interface ToasterProps {
|
|
65
|
+
/**
|
|
66
|
+
* An externally owned queue to render instead of `useToast`'s. Given, the `Toaster` never touches
|
|
67
|
+
* the `useToast` store: closing a toast (or its timer running out) only emits `dismiss`, and the
|
|
68
|
+
* owner removes it from the list. Default: the `useToast` queue.
|
|
69
|
+
*/
|
|
70
|
+
toasts?: ToasterToast[];
|
|
71
|
+
/** Where the stack sits. Default `"bottom-right"`. */
|
|
72
|
+
position?: ToasterPosition;
|
|
73
|
+
/** Renders at most this many toasts, the newest kept. Default: every toast in the queue
|
|
74
|
+
* (`useToast` itself keeps three). */
|
|
75
|
+
maxVisible?: number;
|
|
76
|
+
/** Draws the newest toast first, at the top of the stack. Default `false`: newest at the bottom. */
|
|
77
|
+
newestOnTop?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Where the region is teleported while no modal dialog is open. Default `"body"`. An open
|
|
80
|
+
* `Dialog` still wins, since a toast outside a modal dialog cannot be reached.
|
|
81
|
+
*/
|
|
82
|
+
teleportTo?: string | HTMLElement;
|
|
39
83
|
/** Message overrides, passed through to every `Toast` this renders and to the region's own
|
|
40
84
|
* `aria-label`. See `useMessages`. */
|
|
41
85
|
messages?: Partial<UiMessages>;
|
|
42
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* Per-part classes, appended to the part's own (they win by cascade layer). `root` is a part
|
|
88
|
+
* here: the region is teleported, so a `class` on `Toaster` has no element to land on.
|
|
89
|
+
*/
|
|
43
90
|
classes?: Partial<Record<ToasterPart, string>>;
|
|
44
91
|
}
|
|
@@ -8,8 +8,9 @@ export type TooltipAlign = 'start' | 'center' | 'end';
|
|
|
8
8
|
* has a visible label (`aria-describedby`).
|
|
9
9
|
*/
|
|
10
10
|
export type TooltipRole = 'label' | 'description';
|
|
11
|
-
/** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them.
|
|
12
|
-
|
|
11
|
+
/** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them. The
|
|
12
|
+
* root is styled with `class`. */
|
|
13
|
+
export type TooltipPart = 'bubble' | 'arrow';
|
|
13
14
|
/**
|
|
14
15
|
* The default slot's first element is the trigger `Tooltip` names or describes. **It must be a
|
|
15
16
|
* plain element, or a component whose focusable root receives `$attrs`** — an `aria-labelledby` or
|
|
@@ -41,6 +42,6 @@ export interface TooltipProps {
|
|
|
41
42
|
* `label`.
|
|
42
43
|
*/
|
|
43
44
|
role?: TooltipRole;
|
|
44
|
-
/** Per-part
|
|
45
|
+
/** Per-part classes, appended to the part's own (they win by cascade layer). */
|
|
45
46
|
classes?: Partial<Record<TooltipPart, string>>;
|
|
46
47
|
}
|
|
@@ -11,23 +11,23 @@ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
|
11
11
|
declare const __VLS_base: import('vue').DefineComponent<UnitInputProps, {
|
|
12
12
|
formatValue: typeof formatValue;
|
|
13
13
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
-
blur: (event: FocusEvent) => any;
|
|
15
|
-
clear: () => any;
|
|
16
14
|
"update:modelValue": (value: number | null) => any;
|
|
15
|
+
clear: () => any;
|
|
16
|
+
blur: (event: FocusEvent) => any;
|
|
17
17
|
focus: (event: FocusEvent) => any;
|
|
18
18
|
"update:formattedValue": (value: string) => any;
|
|
19
19
|
}, string, import('vue').PublicProps, Readonly<UnitInputProps> & Readonly<{
|
|
20
|
-
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
21
|
-
onClear?: (() => any) | undefined;
|
|
22
20
|
"onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
|
|
21
|
+
onClear?: (() => any) | undefined;
|
|
22
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
23
23
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
24
24
|
"onUpdate:formattedValue"?: ((value: string) => any) | undefined;
|
|
25
25
|
}>, {
|
|
26
|
-
size: import('../../index.js').InputSize;
|
|
27
|
-
label: string;
|
|
28
26
|
name: string;
|
|
29
|
-
|
|
27
|
+
label: string;
|
|
28
|
+
size: import('../../index.js').InputSize;
|
|
30
29
|
modelValue: string | number | null;
|
|
30
|
+
classes: Partial<Record<import('./types.js').UnitInputPart, string>>;
|
|
31
31
|
required: boolean;
|
|
32
32
|
unit: string;
|
|
33
33
|
max: number;
|
|
@@ -7,7 +7,7 @@ import { InputSize } from '../input/types.js';
|
|
|
7
7
|
* `UnitInputProps.label`), so the field box is one element deeper than `Input`'s — the decorations
|
|
8
8
|
* are positioned against `field`, never against a `root` that may also hold a label.
|
|
9
9
|
*/
|
|
10
|
-
export type UnitInputPart = '
|
|
10
|
+
export type UnitInputPart = 'label' | 'field' | 'leadingIcon' | 'control' | 'suffix' | 'dragHandle' | 'clearButton';
|
|
11
11
|
export interface UnitInputProps {
|
|
12
12
|
/**
|
|
13
13
|
* The value (two-way), as a **number** — never the string in the field. A numeric string is
|
|
@@ -63,6 +63,9 @@ export interface UnitInputProps {
|
|
|
63
63
|
readonly?: boolean;
|
|
64
64
|
/** Native `disabled`. */
|
|
65
65
|
disabled?: boolean;
|
|
66
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Per-part classes, appended to the part's own (they win by cascade layer). Style the root with
|
|
68
|
+
* `class`.
|
|
69
|
+
*/
|
|
67
70
|
classes?: Partial<Record<UnitInputPart, string>>;
|
|
68
71
|
}
|
|
@@ -6,10 +6,10 @@ declare const __VLS_export: import('vue').DefineComponent<VariantPickerProps, {}
|
|
|
6
6
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
7
7
|
onChange?: ((value: string) => any) | undefined;
|
|
8
8
|
}>, {
|
|
9
|
-
classes: Partial<Record<import('./types.js').VariantPickerPart, string>>;
|
|
10
9
|
type: import('./types.js').VariantPickerType;
|
|
11
10
|
legend: string;
|
|
12
11
|
modelValue: string;
|
|
12
|
+
classes: Partial<Record<import('./types.js').VariantPickerPart, string>>;
|
|
13
13
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const _default: typeof __VLS_export;
|
|
15
15
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them. */
|
|
2
|
-
export type VariantPickerPart = '
|
|
2
|
+
export type VariantPickerPart = 'legend' | 'legendValue' | 'options' | 'option' | 'radio' | 'label' | 'swatch' | 'soldOutLine';
|
|
3
3
|
/** Pills for text values (sizes, capacities), swatches for colours and glazes. */
|
|
4
4
|
export type VariantPickerType = 'pills' | 'swatches';
|
|
5
5
|
/**
|
|
@@ -44,6 +44,7 @@ export interface VariantPickerProps {
|
|
|
44
44
|
type?: VariantPickerType;
|
|
45
45
|
/** The options. `swatch` colours are the one allowed per-item colour, set as an inline style. */
|
|
46
46
|
options: VariantPickerOption[];
|
|
47
|
-
/** Per-part
|
|
47
|
+
/** Per-part classes, appended to the kit's own (they win by cascade layer). The root is styled
|
|
48
|
+
* with `class`. */
|
|
48
49
|
classes?: Partial<Record<VariantPickerPart, string>>;
|
|
49
50
|
}
|
|
@@ -6,7 +6,6 @@ declare const __VLS_template: () => {
|
|
|
6
6
|
};
|
|
7
7
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
8
8
|
declare const __VLS_base: import('vue').DefineComponent<VisuallyHiddenProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<VisuallyHiddenProps> & Readonly<{}>, {
|
|
9
|
-
classes: Partial<Record<"root", string>>;
|
|
10
9
|
focusable: boolean;
|
|
11
10
|
as: string;
|
|
12
11
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** The parts a consumer can restyle through `classes`. */
|
|
2
|
-
export type VisuallyHiddenPart = 'root';
|
|
3
1
|
export interface VisuallyHiddenProps {
|
|
4
2
|
/** The element to render. Defaults to `span`. */
|
|
5
3
|
as?: string;
|
|
@@ -9,6 +7,4 @@ export interface VisuallyHiddenProps {
|
|
|
9
7
|
* control's name).
|
|
10
8
|
*/
|
|
11
9
|
focusable?: boolean;
|
|
12
|
-
/** Per-part class overrides, merged with `tailwind-merge`. */
|
|
13
|
-
classes?: Partial<Record<VisuallyHiddenPart, string>>;
|
|
14
10
|
}
|