@eldrajs/ui 0.2.8 → 0.2.9
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 +45 -0
- package/README.md +259 -87
- package/dist/{VariantPicker-CjWUVhlm.js → VariantPicker-Da41_oGA.js} +2244 -1399
- package/dist/componentNames.d.ts +1 -1
- package/dist/components/button/Button.vue.d.ts +3 -0
- package/dist/components/button/types.d.ts +32 -3
- package/dist/components/card/ContentCard.vue.d.ts +1 -1
- package/dist/components/checkbox/Checkbox.vue.d.ts +2 -0
- package/dist/components/checkbox/types.d.ts +12 -1
- package/dist/components/chip/Chip.vue.d.ts +4 -3
- package/dist/components/dialog/Dialog.vue.d.ts +12 -7
- package/dist/components/dialog/types.d.ts +11 -2
- package/dist/components/drawer/Drawer.vue.d.ts +1 -0
- package/dist/components/field-wrapper/FieldWrapper.vue.d.ts +3 -0
- 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 +12 -4
- package/dist/components/filter-panel/FilterGroup.vue.d.ts +1 -0
- package/dist/components/filter-panel/FilterPanel.vue.d.ts +3 -2
- 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/input/Input.vue.d.ts +7 -2
- package/dist/components/input/classes.d.ts +9 -0
- package/dist/components/input/reassertValue.d.ts +13 -0
- package/dist/components/input/types.d.ts +14 -5
- package/dist/components/input/useAdornmentRoom.d.ts +15 -0
- package/dist/components/lightbox/Lightbox.vue.d.ts +1 -0
- package/dist/components/nav-menu/NavMenu.vue.d.ts +1 -0
- package/dist/components/pagination/Pagination.vue.d.ts +154 -0
- package/dist/components/pagination/types.d.ts +31 -0
- package/dist/components/popover/Popover.vue.d.ts +28 -1
- package/dist/components/popover/types.d.ts +57 -3
- package/dist/components/product-card/ProductCard.vue.d.ts +1 -1
- package/dist/components/radio/Radio.vue.d.ts +33 -0
- package/dist/components/radio/RadioGroup.vue.d.ts +4 -0
- package/dist/components/radio/recipes.d.ts +37 -0
- package/dist/components/radio/types.d.ts +64 -3
- package/dist/components/range-slider/RangeSlider.vue.d.ts +1 -0
- package/dist/components/search-bar/SearchBar.vue.d.ts +1 -0
- package/dist/components/search-modal/SearchModal.vue.d.ts +1 -0
- package/dist/components/select/MultiSelect.vue.d.ts +48 -1
- package/dist/components/select/Select.vue.d.ts +20 -0
- package/dist/components/select/SelectPanel.vue.d.ts +23 -0
- 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 +28 -2
- package/dist/components/select/types.d.ts +45 -7
- 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 +2 -1
- package/dist/components/switch/Switch.vue.d.ts +15 -8
- package/dist/components/switch/types.d.ts +25 -1
- package/dist/components/tabs/Tab.vue.d.ts +1 -0
- package/dist/components/tabs/context.d.ts +6 -2
- package/dist/components/tabs/types.d.ts +9 -0
- package/dist/components/textarea/Textarea.vue.d.ts +21 -1
- package/dist/components/textarea/types.d.ts +11 -2
- 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 +43 -2
- package/dist/components.css +312 -13
- package/dist/composables/useDialog.d.ts +7 -3
- package/dist/composables/useEldraScope.d.ts +26 -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 +7 -4
- package/dist/index.js +1296 -405
- 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/scoped.css +4623 -0
- package/dist/style.css +312 -13
- package/dist/tailwind.css +43 -12
- package/dist/useMessages-B5nzZghs.js +592 -0
- 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 +16 -3
|
@@ -6,10 +6,164 @@ declare const __VLS_export: import('vue').DefineComponent<PaginationProps, {}, {
|
|
|
6
6
|
}>, {
|
|
7
7
|
classes: Partial<Record<import('./types.js').PaginationPart, string>>;
|
|
8
8
|
linkAs: string | import('vue').Component;
|
|
9
|
+
disabled: boolean;
|
|
9
10
|
ariaLabel: string;
|
|
11
|
+
messages: Partial<{
|
|
12
|
+
clear: string;
|
|
13
|
+
close: string;
|
|
14
|
+
closeDrawer: (name: string) => string;
|
|
15
|
+
closeSearch: string;
|
|
16
|
+
cancel: string;
|
|
17
|
+
clearSearch: string;
|
|
18
|
+
dismissNotification: string;
|
|
19
|
+
notifications: string;
|
|
20
|
+
loading: string;
|
|
21
|
+
optional: string;
|
|
22
|
+
required: string;
|
|
23
|
+
search: string;
|
|
24
|
+
selectPlaceholder: string;
|
|
25
|
+
multiSelectPlaceholder: string;
|
|
26
|
+
noResults: string;
|
|
27
|
+
noResultsFor: (query: string) => string;
|
|
28
|
+
noMatchesFor: (query: string) => string;
|
|
29
|
+
createOption: (query: string) => string;
|
|
30
|
+
moreSelected: (n: number) => string;
|
|
31
|
+
removeTag: (label: string) => string;
|
|
32
|
+
selected: string;
|
|
33
|
+
selectedCount: (n: number) => string;
|
|
34
|
+
noneSelected: string;
|
|
35
|
+
done: string;
|
|
36
|
+
decrease: string;
|
|
37
|
+
increase: string;
|
|
38
|
+
quantity: string;
|
|
39
|
+
quantityUpdated: (n: number) => string;
|
|
40
|
+
minimum: string;
|
|
41
|
+
maximum: string;
|
|
42
|
+
minimumOf: (name: string) => string;
|
|
43
|
+
maximumOf: (name: string) => string;
|
|
44
|
+
to: string;
|
|
45
|
+
opensInNewTab: string;
|
|
46
|
+
counter: (n: number, max: number) => string;
|
|
47
|
+
previous: string;
|
|
48
|
+
next: string;
|
|
49
|
+
pause: string;
|
|
50
|
+
play: string;
|
|
51
|
+
slideOf: (position: number, total: number) => string;
|
|
52
|
+
goToSlide: (n: number) => string;
|
|
53
|
+
slides: string;
|
|
54
|
+
slideInstructions: string;
|
|
55
|
+
closeLightbox: string;
|
|
56
|
+
previousImage: string;
|
|
57
|
+
nextImage: string;
|
|
58
|
+
imageOf: (position: number, total: number) => string;
|
|
59
|
+
goToImage: (n: number) => string;
|
|
60
|
+
lightboxImages: string;
|
|
61
|
+
charactersLeft: (n: number) => string;
|
|
62
|
+
overLimit: (n: number) => string;
|
|
63
|
+
soldOut: string;
|
|
64
|
+
newBadge: string;
|
|
65
|
+
quickAddLabel: string;
|
|
66
|
+
quickAdd: (title: string) => string;
|
|
67
|
+
loadingProduct: string;
|
|
68
|
+
swatchesAvailable: (n: number) => string;
|
|
69
|
+
noImage: string;
|
|
70
|
+
noImageAvailable: string;
|
|
71
|
+
stockistSite: string;
|
|
72
|
+
stockIn: string;
|
|
73
|
+
stockLow: (n: number | null) => string;
|
|
74
|
+
stockPreorder: (date?: string) => string;
|
|
75
|
+
salePrice: string;
|
|
76
|
+
regularPrice: string;
|
|
77
|
+
from: string;
|
|
78
|
+
perUnit: (per: string) => string;
|
|
79
|
+
updatingPrice: string;
|
|
80
|
+
updatingStock: string;
|
|
81
|
+
rating: (value: number, count: number) => string;
|
|
82
|
+
noReviews: string;
|
|
83
|
+
reviewCount: (n: number) => string;
|
|
84
|
+
searchTheShop: string;
|
|
85
|
+
searchSuggestions: string;
|
|
86
|
+
searchProducts: string;
|
|
87
|
+
searchCollections: string;
|
|
88
|
+
searchJournal: string;
|
|
89
|
+
searchAdvice: string;
|
|
90
|
+
recentSearches: string;
|
|
91
|
+
popularSearches: string;
|
|
92
|
+
clearRecent: string;
|
|
93
|
+
resultsCount: (n: number, query?: string) => string;
|
|
94
|
+
viewAllResults: (n: number, query?: string) => string;
|
|
95
|
+
searchLoading: string;
|
|
96
|
+
shortcutHint: string;
|
|
97
|
+
searchMoveHint: string;
|
|
98
|
+
searchOpenHint: string;
|
|
99
|
+
searchEscHint: string;
|
|
100
|
+
error: string;
|
|
101
|
+
tryAgain: string;
|
|
102
|
+
formErrors: (n: number) => string;
|
|
103
|
+
avatarGroup: (label: string, names: string[], more: number) => string;
|
|
104
|
+
learnMore: string;
|
|
105
|
+
breadcrumbLabel: string;
|
|
106
|
+
showMoreLevels: (n: number) => string;
|
|
107
|
+
navMenuLabel: string;
|
|
108
|
+
navMenuOpen: string;
|
|
109
|
+
navMenuDrawer: string;
|
|
110
|
+
navMenuOverview: (label: string) => string;
|
|
111
|
+
pagination: string;
|
|
112
|
+
previousPage: string;
|
|
113
|
+
nextPage: string;
|
|
114
|
+
pageN: (n: number, current?: boolean) => string;
|
|
115
|
+
pageOfTotal: (page: number, total: number) => string;
|
|
116
|
+
showingOf: (shown: number, total: number, noun: string) => string;
|
|
117
|
+
loadMore: string;
|
|
118
|
+
filterPanelTitle: string;
|
|
119
|
+
filterPanelLabel: string;
|
|
120
|
+
filterPanelClearAll: string;
|
|
121
|
+
filterPanelApplied: string;
|
|
122
|
+
filterPanelRemoveFilter: (facet: string, value: string) => string;
|
|
123
|
+
filterPanelShowAll: (n: number) => string;
|
|
124
|
+
filterPanelShowFewer: string;
|
|
125
|
+
filterPanelSearchLabel: (facet: string) => string;
|
|
126
|
+
filterPanelSearchPlaceholder: (facet: string) => string;
|
|
127
|
+
filterPanelValueName: (label: string, count: number) => string;
|
|
128
|
+
filterPanelSizeName: (system: string, label: string, count: number) => string;
|
|
129
|
+
filterPanelNoneAvailable: string;
|
|
130
|
+
filterPanelImpliedBy: (parent: string) => string;
|
|
131
|
+
filterPanelUnder: (parent: string) => string;
|
|
132
|
+
filterPanelSizeGuide: string;
|
|
133
|
+
filterPanelMin: string;
|
|
134
|
+
filterPanelMax: string;
|
|
135
|
+
filterPanelOrMore: string;
|
|
136
|
+
filterPanelShowResults: (n: number) => string;
|
|
137
|
+
filterPanelShowProducts: string;
|
|
138
|
+
formSubmit: string;
|
|
139
|
+
formSubmitting: string;
|
|
140
|
+
formLoading: string;
|
|
141
|
+
formLoadFailed: string;
|
|
142
|
+
formRequired: string;
|
|
143
|
+
formRequiredCheckbox: string;
|
|
144
|
+
formInvalidEmail: string;
|
|
145
|
+
formInvalidNumber: string;
|
|
146
|
+
formInvalidUrl: string;
|
|
147
|
+
formInvalidOption: string;
|
|
148
|
+
formInvalidFormat: string;
|
|
149
|
+
formTooShort: (min: number) => string;
|
|
150
|
+
formTooLong: (max: number) => string;
|
|
151
|
+
formRefused: string;
|
|
152
|
+
formRateLimited: string;
|
|
153
|
+
formTooLarge: string;
|
|
154
|
+
formUnavailable: string;
|
|
155
|
+
formSpamCheckRequired: string;
|
|
156
|
+
formSpamCheckFailed: string;
|
|
157
|
+
formSuccessTitle: string;
|
|
158
|
+
formPendingTitle: string;
|
|
159
|
+
formPendingMessage: string;
|
|
160
|
+
}>;
|
|
10
161
|
compact: boolean;
|
|
11
162
|
siblings: number;
|
|
12
163
|
hrefForPage: (page: number) => string;
|
|
164
|
+
fixedLength: boolean;
|
|
165
|
+
responsive: boolean;
|
|
166
|
+
showSinglePage: boolean;
|
|
13
167
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
168
|
declare const _default: typeof __VLS_export;
|
|
15
169
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
+
import { UiMessages } from '../../composables/useMessages.js';
|
|
2
3
|
/**
|
|
3
4
|
* The parts a consumer can restyle through `classes`, named as the spec's anatomy names them
|
|
4
5
|
* (spec "Pagination" → Anatomy, numbered 1–4 plus the shared wrapper parts). `item` is the `<li>`
|
|
@@ -46,6 +47,36 @@ export interface PaginationProps {
|
|
|
46
47
|
* Defaults to the `pagination` message ("Pagination").
|
|
47
48
|
*/
|
|
48
49
|
ariaLabel?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Keep the numbered row the same length on every page. The window of `2 × siblings + 1` pages
|
|
52
|
+
* slides against the ends instead of shrinking near them, the slot next to the first and the last
|
|
53
|
+
* page shows that page or "…", and a "…" always stands for two or more pages. So `siblings: 1`
|
|
54
|
+
* always draws seven items once there are more than seven pages (`1 2 3 [4] 5 … 12`,
|
|
55
|
+
* `1 … 5 [6] 7 … 12`), and the controls do not move under the pointer as the page changes.
|
|
56
|
+
* Defaults to `false`: the window is the current page ± `siblings`, plus the first and last.
|
|
57
|
+
*/
|
|
58
|
+
fixedLength?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Renders every control inert: pages and previous/next in the disabled previous/next form (a
|
|
61
|
+
* `<span aria-disabled="true">`, `muted` at 60%, no link, not focusable), the current page still
|
|
62
|
+
* marked with `aria-current="page"`. Nothing emits `update:page`. Defaults to `false`.
|
|
63
|
+
*/
|
|
64
|
+
disabled?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Defaults to `true`: below 48rem of its own width the numbered form gives way to the compact
|
|
67
|
+
* one. `false` keeps the numbered form at every width (it wraps) and never renders the compact
|
|
68
|
+
* row, for a layout where jumping straight to any page matters more than one line. `compact`
|
|
69
|
+
* still wins when set.
|
|
70
|
+
*/
|
|
71
|
+
responsive?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Render with a single page too: previous and next disabled around page 1, so a paged list keeps
|
|
74
|
+
* its footer while it holds one page. Defaults to `false`: nothing renders below two pages.
|
|
75
|
+
*/
|
|
76
|
+
showSinglePage?: boolean;
|
|
77
|
+
/** Message overrides (`pagination`, `previousPage`, `nextPage`, `pageN`, `pageOfTotal`), per
|
|
78
|
+
* instance; a shorter visible "Previous"/"Next" goes here. See `useMessages`. */
|
|
79
|
+
messages?: Partial<UiMessages>;
|
|
49
80
|
/** Per-part class overrides, merged with `tailwind-merge`. */
|
|
50
81
|
classes?: Partial<Record<PaginationPart, string>>;
|
|
51
82
|
}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { PopoverProps } from './types.js';
|
|
2
|
+
/** Close, returning focus to the trigger unless `returnFocus` is off. */
|
|
3
|
+
declare function close(): void;
|
|
4
|
+
declare function toggle(): void;
|
|
2
5
|
declare const __VLS_template: () => {
|
|
3
6
|
__VLS_Slots: {
|
|
4
7
|
default?: (props: {
|
|
5
8
|
close: () => void;
|
|
9
|
+
open: true;
|
|
10
|
+
toggle: typeof toggle;
|
|
6
11
|
}) => any;
|
|
7
12
|
};
|
|
8
13
|
};
|
|
9
14
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
10
|
-
declare const __VLS_base: import('vue').DefineComponent<PopoverProps, {
|
|
15
|
+
declare const __VLS_base: import('vue').DefineComponent<PopoverProps, {
|
|
16
|
+
/** Open the panel, as a trigger click would. */
|
|
17
|
+
open: () => void;
|
|
18
|
+
/** Close the panel, as the default slot's `close` would. */
|
|
19
|
+
close: typeof close;
|
|
20
|
+
toggle: typeof toggle;
|
|
21
|
+
/** Reposition now — after a virtual `reference` has moved. */
|
|
22
|
+
update: () => void;
|
|
23
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
24
|
"update:modelValue": (value: boolean) => any;
|
|
12
25
|
open: () => any;
|
|
13
26
|
close: () => any;
|
|
@@ -18,10 +31,24 @@ declare const __VLS_base: import('vue').DefineComponent<PopoverProps, {}, {}, {}
|
|
|
18
31
|
}>, {
|
|
19
32
|
classes: Partial<Record<import('./types.js').PopoverPart, string>>;
|
|
20
33
|
modelValue: boolean;
|
|
34
|
+
disabled: boolean;
|
|
21
35
|
ariaLabel: string;
|
|
36
|
+
closeOnEscape: boolean;
|
|
22
37
|
placement: import('../../index.js').FloatingPlacement;
|
|
23
38
|
teleport: boolean;
|
|
39
|
+
reference: import('@floating-ui/vue').ReferenceElement | null;
|
|
40
|
+
offset: number;
|
|
24
41
|
matchWidth: boolean | "exact";
|
|
42
|
+
viewportPadding: number;
|
|
43
|
+
haspopup: "dialog" | "menu" | "true" | "grid" | "listbox" | "tree";
|
|
44
|
+
labelledByTrigger: boolean;
|
|
45
|
+
openOnArrowDown: boolean;
|
|
46
|
+
focusOnOpen: boolean;
|
|
47
|
+
closeOnOutsideClick: boolean;
|
|
48
|
+
closeOnFocusOutside: boolean;
|
|
49
|
+
returnFocus: boolean;
|
|
50
|
+
closeWhenTriggerHidden: boolean;
|
|
51
|
+
exclusive: boolean;
|
|
25
52
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
26
53
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
54
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReferenceElement } from '@floating-ui/vue';
|
|
1
2
|
import { FloatingPlacement } from '../../composables/useFloating.js';
|
|
2
3
|
/**
|
|
3
4
|
* The parts a consumer can restyle through `classes`.
|
|
@@ -17,11 +18,64 @@ export interface PopoverProps {
|
|
|
17
18
|
/**
|
|
18
19
|
* Where the panel opens, in `useFloating`'s own vocabulary: `auto` (default) below, flipping
|
|
19
20
|
* above when there is no room; `above` always above; or an explicit `@floating-ui/dom` placement
|
|
20
|
-
* for a menu that should hang off a corner (`bottom-end`, for a trigger near the inline-end edge)
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* for a menu that should hang off a corner (`bottom-end`, for a trigger near the inline-end edge)
|
|
22
|
+
* or open beside its trigger (`right-start`, a submenu). Followed: changing it repositions an open
|
|
23
|
+
* panel.
|
|
23
24
|
*/
|
|
24
25
|
placement?: FloatingPlacement;
|
|
26
|
+
/** The gap between the trigger and the panel, in pixels. Default `4` (0.25rem). */
|
|
27
|
+
offset?: number;
|
|
28
|
+
/** The least room kept between the panel and the viewport edge, in pixels. Default `8`. */
|
|
29
|
+
viewportPadding?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Position the panel against this instead of the trigger: another element, or a Floating UI
|
|
32
|
+
* virtual element (`{ getBoundingClientRect() }`) for a caret or pointer position — call the
|
|
33
|
+
* exposed `update()` after a virtual element moves. With one set, the `trigger` slot is
|
|
34
|
+
* optional: a popover opened only through `v-model` (a slash-command menu at the caret) needs no
|
|
35
|
+
* trigger at all. Unset by default.
|
|
36
|
+
*/
|
|
37
|
+
reference?: ReferenceElement | null;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the trigger may open the panel. `true` adds `disabled` to the trigger slot's `attrs`,
|
|
40
|
+
* ignores every open, and closes an open panel. Default `false`.
|
|
41
|
+
*/
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The trigger's `aria-haspopup`. Default `'true'` (a menu, to assistive technology); set it to
|
|
45
|
+
* the role the panel actually has — `'listbox'`, `'dialog'` — when that is not a menu.
|
|
46
|
+
*/
|
|
47
|
+
haspopup?: 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
48
|
+
/**
|
|
49
|
+
* Name the panel by its trigger (`aria-labelledby` the trigger's id), the menu-button pattern.
|
|
50
|
+
* Ignored when `ariaLabel` is set; an `aria-labelledby` attribute on the component wins over it.
|
|
51
|
+
* Default `false`.
|
|
52
|
+
*/
|
|
53
|
+
labelledByTrigger?: boolean;
|
|
54
|
+
/** `ArrowDown` on the closed trigger opens the panel (the menu-button keyboard pattern). Default
|
|
55
|
+
* `false`. */
|
|
56
|
+
openOnArrowDown?: boolean;
|
|
57
|
+
/** Move focus to the panel's first tab stop on open — or to the panel itself when it has none.
|
|
58
|
+
* Default `false`: see `Popover.vue`'s own doc comment. */
|
|
59
|
+
focusOnOpen?: boolean;
|
|
60
|
+
/** Close on a pointer press outside the popover. Default `true`. */
|
|
61
|
+
closeOnOutsideClick?: boolean;
|
|
62
|
+
/** Close when focus moves outside the popover. Default: whatever `closeOnOutsideClick` is. */
|
|
63
|
+
closeOnFocusOutside?: boolean;
|
|
64
|
+
/** Close on `Esc`. Default `true`. */
|
|
65
|
+
closeOnEscape?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Put focus back on the trigger when the panel is closed by `Esc`, the default slot's `close`,
|
|
68
|
+
* the trigger itself, or focus being lost with the panel. Default `true`.
|
|
69
|
+
*/
|
|
70
|
+
returnFocus?: boolean;
|
|
71
|
+
/** Close, without moving focus, once the trigger scrolls fully out of view. Default `false`. */
|
|
72
|
+
closeWhenTriggerHidden?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Take part in "only one open at a time" with every other popover, `Select`, `MultiSelect` and
|
|
75
|
+
* `SearchBar`. Default `true`. A popover opened from inside another's panel never closes the one
|
|
76
|
+
* it was opened from either way; `false` also lets it stay open beside unrelated ones.
|
|
77
|
+
*/
|
|
78
|
+
exclusive?: boolean;
|
|
25
79
|
/**
|
|
26
80
|
* Tie the panel's width to the trigger's: `true` for a floor (a filter panel that should never
|
|
27
81
|
* be narrower than its control), `'exact'` for a floor *and* a ceiling (a menu that should match
|
|
@@ -9,8 +9,8 @@ declare const __VLS_export: import('vue').DefineComponent<ProductCardProps, {},
|
|
|
9
9
|
loading: boolean;
|
|
10
10
|
quickAdd: boolean;
|
|
11
11
|
linkAs: string | import('vue').Component;
|
|
12
|
-
ratio: import('./types.js').ProductCardRatio;
|
|
13
12
|
locale: string;
|
|
13
|
+
ratio: import('./types.js').ProductCardRatio;
|
|
14
14
|
currency: string;
|
|
15
15
|
revalidating: boolean;
|
|
16
16
|
announce: boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RadioProps, RadioValue } from './types.js';
|
|
2
|
+
declare const __VLS_template: () => {
|
|
3
|
+
__VLS_Slots: {
|
|
4
|
+
default?: (props: {}) => any;
|
|
5
|
+
} & {
|
|
6
|
+
hint?: (props: {}) => any;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
10
|
+
declare const __VLS_base: import('vue').DefineComponent<RadioProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: RadioValue) => any;
|
|
12
|
+
change: (value: RadioValue) => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<RadioProps> & Readonly<{
|
|
14
|
+
"onUpdate:modelValue"?: ((value: RadioValue) => any) | undefined;
|
|
15
|
+
onChange?: ((value: RadioValue) => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
size: import('./types.js').RadioGroupSize;
|
|
18
|
+
label: string;
|
|
19
|
+
name: string;
|
|
20
|
+
classes: Partial<Record<import('./types.js').RadioPart, string>>;
|
|
21
|
+
modelValue: RadioValue;
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
invalid: boolean;
|
|
24
|
+
hint: string;
|
|
25
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -24,10 +24,14 @@ declare const __VLS_base: import('vue').DefineComponent<RadioGroupProps, {}, {},
|
|
|
24
24
|
}>, {
|
|
25
25
|
size: RadioGroupSize;
|
|
26
26
|
name: string;
|
|
27
|
+
help: string;
|
|
27
28
|
classes: Partial<Record<import('./types.js').RadioGroupPart, string>>;
|
|
29
|
+
legend: string;
|
|
28
30
|
modelValue: string;
|
|
29
31
|
required: boolean;
|
|
30
32
|
error: string;
|
|
33
|
+
invalid: boolean;
|
|
34
|
+
requiredMark: boolean;
|
|
31
35
|
layout: import('./types.js').RadioGroupLayout;
|
|
32
36
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
33
37
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { RadioGroupSize } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The plain-row radio's class recipes, shared by `RadioGroup` and the standalone `Radio` so the two
|
|
4
|
+
* cannot drift apart. Each string's spec rationale is written once, here.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The row is a three-column grid — radio, text, meta — so a card's price lines up with its title
|
|
8
|
+
* and the hint sits in column 2 of the next row under it, exactly as the anatomy draws it. A plain
|
|
9
|
+
* row never renders `meta`, so it only ever fills the first two columns; see `Checkbox.vue` for
|
|
10
|
+
* the two-column version this is built from.
|
|
11
|
+
*/
|
|
12
|
+
export declare const PLAIN_OPTION = "group grid w-fit max-w-full grid-cols-[auto_1fr] items-start gap-x-2.5 gap-y-0.5 target-min";
|
|
13
|
+
/** The cursor a row (or card) shows: the whole option is the label, so it is the target. */
|
|
14
|
+
export declare function optionCursor(disabled: boolean | undefined): string;
|
|
15
|
+
export interface RadioState {
|
|
16
|
+
selected: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
invalid?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** The drawn circle, before `classes.radio` is merged in. */
|
|
21
|
+
export declare function radioRecipe(size: RadioGroupSize, state: RadioState): string;
|
|
22
|
+
/**
|
|
23
|
+
* The dot (spec "Radio group" → Sizes: "0.5rem dot"). One fixed size regardless of `size`, the
|
|
24
|
+
* same choice `Checkbox` makes for its tick — only the circle around it grows. No `data-part` of
|
|
25
|
+
* its own: the API contract's part list has no entry for it, unlike `Checkbox`'s `check`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function dotRecipe(selected: boolean): string;
|
|
28
|
+
/** The native radio: invisible but hit-testable, stretched over the drawn circle. */
|
|
29
|
+
export declare const INPUT = "absolute inset-0 m-0 size-full cursor-pointer appearance-none opacity-0 disabled:cursor-not-allowed";
|
|
30
|
+
/**
|
|
31
|
+
* Spec "Radio group" → Sizes: "Plain row … 0.9375rem / 1.5rem text" for plain layouts, "Card title
|
|
32
|
+
* … 1rem 600 (line-height 1.4)" for cards — the same two type utilities `Checkbox`'s label and the
|
|
33
|
+
* `text-card-title` utility (see `tailwind.css`) already give those numbers.
|
|
34
|
+
*/
|
|
35
|
+
export declare function labelRecipe(card: boolean, disabled: boolean | undefined): string;
|
|
36
|
+
/** Spec "Radio group" → Sizes: the hint is `muted` in every layout, under the label's column. */
|
|
37
|
+
export declare const HINT = "text-body-sm text-muted col-start-2 min-w-0";
|
|
@@ -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 RadioGroupPart = 'root' | 'legend' | 'options' | 'option' | 'radio' | 'label' | 'hint' | 'meta' | 'error' | 'errorIcon';
|
|
2
|
+
export type RadioGroupPart = 'root' | 'legend' | 'requiredMark' | 'options' | 'option' | 'radio' | 'input' | 'dot' | 'label' | 'hint' | 'meta' | 'help' | 'error' | 'errorIcon';
|
|
3
3
|
/** The spec's two radio sizes: 1.125rem or 1.5rem. Plain layouts only — a card's radio is fixed. */
|
|
4
4
|
export type RadioGroupSize = 'md' | 'lg';
|
|
5
5
|
/** `vertical` (default), `row` (wraps, for short labels) or `cards` (the whole option is a card). */
|
|
@@ -16,14 +16,29 @@ export interface RadioGroupOption {
|
|
|
16
16
|
meta?: string;
|
|
17
17
|
/** Native `disabled` for this option alone. Say why in `hint`. */
|
|
18
18
|
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Extra attributes for this option's `<label>`: a `class`, a `for`, `data-*` hooks. The group's
|
|
21
|
+
* own `data-part` and classes still apply.
|
|
22
|
+
*/
|
|
23
|
+
optionAttrs?: Record<string, string | undefined>;
|
|
24
|
+
/**
|
|
25
|
+
* Extra attributes for this option's native radio: an `id`, a `class`, `data-*` hooks. The
|
|
26
|
+
* group's own `type`, `name`, `value`, `checked`, `disabled`, `required` and `aria-invalid` win.
|
|
27
|
+
*/
|
|
28
|
+
inputAttrs?: Record<string, string | undefined>;
|
|
19
29
|
}
|
|
20
30
|
export interface RadioGroupProps {
|
|
21
31
|
/** The selected value (two-way). */
|
|
22
32
|
modelValue?: string;
|
|
23
33
|
/** The shared native `name`. Generated when absent, so every option still posts as one field. */
|
|
24
34
|
name?: string;
|
|
25
|
-
/**
|
|
26
|
-
|
|
35
|
+
/**
|
|
36
|
+
* The question, rendered as the fieldset's `<legend>`. Leave it out for a group with no visible
|
|
37
|
+
* question: no `<legend>` renders, so name the group with `aria-label` or `aria-labelledby`
|
|
38
|
+
* (the component's attributes reach the `<fieldset>`). The required mark lives in the legend, so
|
|
39
|
+
* it goes with it. `legend=""` still renders one.
|
|
40
|
+
*/
|
|
41
|
+
legend?: string;
|
|
27
42
|
/** The options. At most about 6 — past that, use `Select`. */
|
|
28
43
|
options: RadioGroupOption[];
|
|
29
44
|
/** `vertical` (default), `row` (wraps) or `cards` (the whole option is a bordered card). */
|
|
@@ -32,8 +47,54 @@ export interface RadioGroupProps {
|
|
|
32
47
|
size?: RadioGroupSize;
|
|
33
48
|
/** Native `required` on every radio. */
|
|
34
49
|
required?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Shows the `*` required mark after the legend, drawn exactly as `FieldWrapper`'s, without
|
|
52
|
+
* setting native `required` — for a caller that validates the group itself and must not have
|
|
53
|
+
* the browser block a submit. The fieldset's name then ends with the "Required" message (visually
|
|
54
|
+
* hidden), since no native `required` announces it. With `required` as well, only the mark is
|
|
55
|
+
* added: the radios already announce it.
|
|
56
|
+
*/
|
|
57
|
+
requiredMark?: boolean;
|
|
35
58
|
/** The group's error message. Sets `aria-invalid="true"` on every radio, linked by id. */
|
|
36
59
|
error?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Help text under the options, in `FieldWrapper`'s help style, linked to the fieldset by
|
|
62
|
+
* `aria-describedby` after the error.
|
|
63
|
+
*/
|
|
64
|
+
help?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Draws the error state and sets `aria-invalid="true"` on every radio without an error row, for
|
|
67
|
+
* a caller that shows its own message. `error` implies it.
|
|
68
|
+
*/
|
|
69
|
+
invalid?: boolean;
|
|
37
70
|
/** Per-part class overrides, merged with `tailwind-merge`. */
|
|
38
71
|
classes?: Partial<Record<RadioGroupPart, string>>;
|
|
39
72
|
}
|
|
73
|
+
/** The parts of a standalone `Radio`: the same names as one `RadioGroup` option's parts. */
|
|
74
|
+
export type RadioPart = 'option' | 'radio' | 'input' | 'dot' | 'label' | 'hint';
|
|
75
|
+
/** The values a standalone `Radio` and its group's model hold. */
|
|
76
|
+
export type RadioValue = string | number;
|
|
77
|
+
export interface RadioProps {
|
|
78
|
+
/**
|
|
79
|
+
* The value the radios sharing this `name` currently hold (two-way) — the *group's* value, not
|
|
80
|
+
* this radio's. This radio is checked when it equals `value`. Always bind it: a standalone radio
|
|
81
|
+
* cannot see its siblings, so it keeps no state of its own; `undefined` means nothing is chosen.
|
|
82
|
+
*/
|
|
83
|
+
modelValue?: RadioValue;
|
|
84
|
+
/** This radio's own value: posted when it is checked, and emitted when it is chosen. */
|
|
85
|
+
value: RadioValue;
|
|
86
|
+
/** The native `name` this radio shares with its siblings, wherever they are rendered. */
|
|
87
|
+
name?: string;
|
|
88
|
+
/** The label text. The default slot overrides it. */
|
|
89
|
+
label?: string;
|
|
90
|
+
/** A secondary line under the label. The `hint` slot overrides it. */
|
|
91
|
+
hint?: string;
|
|
92
|
+
/** Radio 1.125rem (`md`, the default) or 1.5rem (`lg`). */
|
|
93
|
+
size?: RadioGroupSize;
|
|
94
|
+
/** Native `disabled`. */
|
|
95
|
+
disabled?: boolean;
|
|
96
|
+
/** Draws the error state and sets `aria-invalid="true"`. */
|
|
97
|
+
invalid?: boolean;
|
|
98
|
+
/** Per-part class overrides, merged with `tailwind-merge`. */
|
|
99
|
+
classes?: Partial<Record<RadioPart, string>>;
|
|
100
|
+
}
|
|
@@ -46,6 +46,7 @@ declare const __VLS_base: import('vue').DefineComponent<RangeSliderProps, {}, {}
|
|
|
46
46
|
noResults: string;
|
|
47
47
|
noResultsFor: (query: string) => string;
|
|
48
48
|
noMatchesFor: (query: string) => string;
|
|
49
|
+
createOption: (query: string) => string;
|
|
49
50
|
moreSelected: (n: number) => string;
|
|
50
51
|
removeTag: (label: string) => string;
|
|
51
52
|
selected: string;
|
|
@@ -48,6 +48,7 @@ declare const __VLS_base: import('vue').DefineComponent<SearchBarProps, {}, {},
|
|
|
48
48
|
noResults: string;
|
|
49
49
|
noResultsFor: (query: string) => string;
|
|
50
50
|
noMatchesFor: (query: string) => string;
|
|
51
|
+
createOption: (query: string) => string;
|
|
51
52
|
moreSelected: (n: number) => string;
|
|
52
53
|
removeTag: (label: string) => string;
|
|
53
54
|
selected: string;
|
|
@@ -54,6 +54,7 @@ declare const __VLS_base: import('vue').DefineComponent<SearchModalProps, {
|
|
|
54
54
|
noResults: string;
|
|
55
55
|
noResultsFor: (query: string) => string;
|
|
56
56
|
noMatchesFor: (query: string) => string;
|
|
57
|
+
createOption: (query: string) => string;
|
|
57
58
|
moreSelected: (n: number) => string;
|
|
58
59
|
removeTag: (label: string) => string;
|
|
59
60
|
selected: string;
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
import { MultiSelectPart, MultiSelectProps, SelectOption, SelectSize } from './types.js';
|
|
2
2
|
declare const __VLS_template: () => {
|
|
3
3
|
__VLS_Slots: {
|
|
4
|
+
leading?: (props: {
|
|
5
|
+
options: SelectOption[];
|
|
6
|
+
open: boolean;
|
|
7
|
+
}) => any;
|
|
8
|
+
} & {
|
|
9
|
+
tagItem?: (props: {
|
|
10
|
+
option: SelectOption;
|
|
11
|
+
remove: () => void;
|
|
12
|
+
removable: boolean;
|
|
13
|
+
removeLabel: string;
|
|
14
|
+
}) => any;
|
|
15
|
+
} & {
|
|
16
|
+
tag?: (props: {
|
|
17
|
+
option: SelectOption;
|
|
18
|
+
remove: () => void;
|
|
19
|
+
}) => any;
|
|
20
|
+
} & {
|
|
21
|
+
leading?: (props: {
|
|
22
|
+
options: SelectOption[];
|
|
23
|
+
open: boolean;
|
|
24
|
+
}) => any;
|
|
25
|
+
} & {
|
|
4
26
|
value?: (props: {
|
|
5
27
|
options: SelectOption[];
|
|
6
28
|
}) => any;
|
|
@@ -10,11 +32,28 @@ declare const __VLS_template: () => {
|
|
|
10
32
|
selected: boolean;
|
|
11
33
|
active: boolean;
|
|
12
34
|
}) => any;
|
|
35
|
+
} & {
|
|
36
|
+
optionContent?: (props: {
|
|
37
|
+
option: SelectOption;
|
|
38
|
+
selected: boolean;
|
|
39
|
+
active: boolean;
|
|
40
|
+
match: import('./useOptionList.js').MatchParts | null;
|
|
41
|
+
}) => any;
|
|
13
42
|
} & {
|
|
14
43
|
empty?: (props: {}) => any;
|
|
44
|
+
} & {
|
|
45
|
+
loading?: (props: {}) => any;
|
|
46
|
+
} & {
|
|
47
|
+
tagItem?: (props: {
|
|
48
|
+
option: SelectOption;
|
|
49
|
+
remove: () => void;
|
|
50
|
+
removable: boolean;
|
|
51
|
+
removeLabel: string;
|
|
52
|
+
}) => any;
|
|
15
53
|
} & {
|
|
16
54
|
tag?: (props: {
|
|
17
55
|
option: SelectOption;
|
|
56
|
+
remove: () => void;
|
|
18
57
|
}) => any;
|
|
19
58
|
};
|
|
20
59
|
};
|
|
@@ -26,6 +65,7 @@ declare const __VLS_base: import('vue').DefineComponent<MultiSelectProps, {}, {}
|
|
|
26
65
|
open: () => any;
|
|
27
66
|
close: () => any;
|
|
28
67
|
change: (value: string[]) => any;
|
|
68
|
+
create: (query: string) => any;
|
|
29
69
|
}, string, import('vue').PublicProps, Readonly<MultiSelectProps> & Readonly<{
|
|
30
70
|
onClear?: (() => any) | undefined;
|
|
31
71
|
onSearch?: ((query: string) => any) | undefined;
|
|
@@ -33,6 +73,7 @@ declare const __VLS_base: import('vue').DefineComponent<MultiSelectProps, {}, {}
|
|
|
33
73
|
onOpen?: (() => any) | undefined;
|
|
34
74
|
onClose?: (() => any) | undefined;
|
|
35
75
|
onChange?: ((value: string[]) => any) | undefined;
|
|
76
|
+
onCreate?: ((query: string) => any) | undefined;
|
|
36
77
|
}>, {
|
|
37
78
|
size: SelectSize;
|
|
38
79
|
name: string;
|
|
@@ -40,6 +81,7 @@ declare const __VLS_base: import('vue').DefineComponent<MultiSelectProps, {}, {}
|
|
|
40
81
|
modelValue: string[];
|
|
41
82
|
required: boolean;
|
|
42
83
|
placeholder: string;
|
|
84
|
+
loading: boolean;
|
|
43
85
|
id: string;
|
|
44
86
|
leadingIcon: import('../../index.js').IconComponent;
|
|
45
87
|
disabled: boolean;
|
|
@@ -63,6 +105,7 @@ declare const __VLS_base: import('vue').DefineComponent<MultiSelectProps, {}, {}
|
|
|
63
105
|
noResults: string;
|
|
64
106
|
noResultsFor: (query: string) => string;
|
|
65
107
|
noMatchesFor: (query: string) => string;
|
|
108
|
+
createOption: (query: string) => string;
|
|
66
109
|
moreSelected: (n: number) => string;
|
|
67
110
|
removeTag: (label: string) => string;
|
|
68
111
|
selected: string;
|
|
@@ -199,8 +242,12 @@ declare const __VLS_base: import('vue').DefineComponent<MultiSelectProps, {}, {}
|
|
|
199
242
|
searchPlaceholder: string;
|
|
200
243
|
placement: import('./types.js').SelectPlacement;
|
|
201
244
|
teleport: string | boolean;
|
|
245
|
+
creatable: boolean;
|
|
246
|
+
renderBatch: number;
|
|
202
247
|
showTags: boolean;
|
|
203
|
-
|
|
248
|
+
tagPlacement: "below" | "inside";
|
|
249
|
+
maxTagRows: number;
|
|
250
|
+
maxSummary: number | "fit";
|
|
204
251
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
205
252
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
206
253
|
declare const _default: typeof __VLS_export;
|