@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,15 +1,15 @@
|
|
|
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`.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
* (conditionally teleported) `panel
|
|
7
|
-
* `
|
|
8
|
-
* around. `trigger` draws nothing here at all: the trigger is the consumer's own element, rendered
|
|
6
|
+
* The root is a `display: contents` wrapper around the `trigger` slot's own element and the
|
|
7
|
+
* (conditionally teleported) `panel`: it draws no box, so it takes no classes. `class` lands on the
|
|
8
|
+
* panel with the other fallthrough attributes. `trigger` draws nothing here at all: the trigger is the consumer's own element, rendered
|
|
9
9
|
* through the `trigger` slot, and `classes.trigger` reaches it only because the `attrs` slot prop
|
|
10
10
|
* carries a `class` built from it (see `Popover.vue`'s own doc comment) for the consumer to spread.
|
|
11
11
|
*/
|
|
12
|
-
export type PopoverPart = '
|
|
12
|
+
export type PopoverPart = 'trigger' | 'panel';
|
|
13
13
|
export interface PopoverProps {
|
|
14
14
|
/** Whether the panel is open (two-way). Self-managing when not bound, like every stateful
|
|
15
15
|
* component in this package. */
|
|
@@ -17,11 +17,64 @@ export interface PopoverProps {
|
|
|
17
17
|
/**
|
|
18
18
|
* Where the panel opens, in `useFloating`'s own vocabulary: `auto` (default) below, flipping
|
|
19
19
|
* 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
|
-
*
|
|
20
|
+
* for a menu that should hang off a corner (`bottom-end`, for a trigger near the inline-end edge)
|
|
21
|
+
* or open beside its trigger (`right-start`, a submenu). Followed: changing it repositions an open
|
|
22
|
+
* panel.
|
|
23
23
|
*/
|
|
24
24
|
placement?: FloatingPlacement;
|
|
25
|
+
/** The gap between the trigger and the panel, in pixels. Default `4` (0.25rem). */
|
|
26
|
+
offset?: number;
|
|
27
|
+
/** The least room kept between the panel and the viewport edge, in pixels. Default `8`. */
|
|
28
|
+
viewportPadding?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Position the panel against this instead of the trigger: another element, or a Floating UI
|
|
31
|
+
* virtual element (`{ getBoundingClientRect() }`) for a caret or pointer position — call the
|
|
32
|
+
* exposed `update()` after a virtual element moves. With one set, the `trigger` slot is
|
|
33
|
+
* optional: a popover opened only through `v-model` (a slash-command menu at the caret) needs no
|
|
34
|
+
* trigger at all. Unset by default.
|
|
35
|
+
*/
|
|
36
|
+
reference?: ReferenceElement | null;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the trigger may open the panel. `true` adds `disabled` to the trigger slot's `attrs`,
|
|
39
|
+
* ignores every open, and closes an open panel. Default `false`.
|
|
40
|
+
*/
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The trigger's `aria-haspopup`. Default `'true'` (a menu, to assistive technology); set it to
|
|
44
|
+
* the role the panel actually has — `'listbox'`, `'dialog'` — when that is not a menu.
|
|
45
|
+
*/
|
|
46
|
+
haspopup?: 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
47
|
+
/**
|
|
48
|
+
* Name the panel by its trigger (`aria-labelledby` the trigger's id), the menu-button pattern.
|
|
49
|
+
* Ignored when `ariaLabel` is set; an `aria-labelledby` attribute on the component wins over it.
|
|
50
|
+
* Default `false`.
|
|
51
|
+
*/
|
|
52
|
+
labelledByTrigger?: boolean;
|
|
53
|
+
/** `ArrowDown` on the closed trigger opens the panel (the menu-button keyboard pattern). Default
|
|
54
|
+
* `false`. */
|
|
55
|
+
openOnArrowDown?: boolean;
|
|
56
|
+
/** Move focus to the panel's first tab stop on open — or to the panel itself when it has none.
|
|
57
|
+
* Default `false`: see `Popover.vue`'s own doc comment. */
|
|
58
|
+
focusOnOpen?: boolean;
|
|
59
|
+
/** Close on a pointer press outside the popover. Default `true`. */
|
|
60
|
+
closeOnOutsideClick?: boolean;
|
|
61
|
+
/** Close when focus moves outside the popover. Default: whatever `closeOnOutsideClick` is. */
|
|
62
|
+
closeOnFocusOutside?: boolean;
|
|
63
|
+
/** Close on `Esc`. Default `true`. */
|
|
64
|
+
closeOnEscape?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Put focus back on the trigger when the panel is closed by `Esc`, the default slot's `close`,
|
|
67
|
+
* the trigger itself, or focus being lost with the panel. Default `true`.
|
|
68
|
+
*/
|
|
69
|
+
returnFocus?: boolean;
|
|
70
|
+
/** Close, without moving focus, once the trigger scrolls fully out of view. Default `false`. */
|
|
71
|
+
closeWhenTriggerHidden?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Take part in "only one open at a time" with every other popover, `Select`, `MultiSelect` and
|
|
74
|
+
* `SearchBar`. Default `true`. A popover opened from inside another's panel never closes the one
|
|
75
|
+
* it was opened from either way; `false` also lets it stay open beside unrelated ones.
|
|
76
|
+
*/
|
|
77
|
+
exclusive?: boolean;
|
|
25
78
|
/**
|
|
26
79
|
* Tie the panel's width to the trigger's: `true` for a floor (a filter panel that should never
|
|
27
80
|
* be narrower than its control), `'exact'` for a floor *and* a ceiling (a menu that should match
|
|
@@ -48,6 +101,6 @@ export interface PopoverProps {
|
|
|
48
101
|
* consumer that needs it is a one-line, non-breaking widening of this type.
|
|
49
102
|
*/
|
|
50
103
|
teleport?: boolean;
|
|
51
|
-
/** Per-part
|
|
104
|
+
/** Per-part classes, appended to the part's own (they win by cascade layer). */
|
|
52
105
|
classes?: Partial<Record<PopoverPart, string>>;
|
|
53
106
|
}
|
|
@@ -14,7 +14,7 @@ export type PriceSize = 'sm' | 'md' | 'lg';
|
|
|
14
14
|
* `current`/`compareAt`. They exist so the refresh dim (on the part) and the fade a changed amount
|
|
15
15
|
* plays (on the span) are not the same element fighting over `opacity`; they add no box of their
|
|
16
16
|
* own, and a consumer who only wants to restyle the amount's text can reach either one. */
|
|
17
|
-
export type PricePart = '
|
|
17
|
+
export type PricePart = 'current' | 'currentValue' | 'compareAt' | 'compareAtValue' | 'from' | 'unit' | 'srText' | 'skeleton' | 'spinner' | 'srStatus';
|
|
18
18
|
export interface PriceProps {
|
|
19
19
|
/**
|
|
20
20
|
* The current price, in minor units (cents) — for a zero-decimal currency like `ISK`, whole
|
|
@@ -99,6 +99,7 @@ export interface PriceProps {
|
|
|
99
99
|
* are unaffected; only the region goes.
|
|
100
100
|
*/
|
|
101
101
|
announce?: boolean;
|
|
102
|
-
/** Per-part
|
|
102
|
+
/** Per-part classes, appended to the kit's own (they win by cascade layer). The root is styled
|
|
103
|
+
* with `class`. */
|
|
103
104
|
classes?: Partial<Record<PricePart, string>>;
|
|
104
105
|
}
|
|
@@ -4,13 +4,13 @@ declare const __VLS_export: import('vue').DefineComponent<ProductCardProps, {},
|
|
|
4
4
|
}, string, import('vue').PublicProps, Readonly<ProductCardProps> & Readonly<{
|
|
5
5
|
onQuickAdd?: ((product: ProductCardProduct) => any) | undefined;
|
|
6
6
|
}>, {
|
|
7
|
-
classes: Partial<Record<import('./types.js').ProductCardPart, string>>;
|
|
8
7
|
headingLevel: import('../../index.js').HeadingLevel;
|
|
8
|
+
classes: Partial<Record<import('./types.js').ProductCardPart, string>>;
|
|
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;
|
|
@@ -65,7 +65,7 @@ export interface ProductCardProduct {
|
|
|
65
65
|
}
|
|
66
66
|
/** The parts a consumer can restyle through `classes`, named as the spec's anatomy names them,
|
|
67
67
|
* plus `stockLine` for the addition beyond it (see `ProductCardProduct.stock`). */
|
|
68
|
-
export type ProductCardPart = '
|
|
68
|
+
export type ProductCardPart = 'media' | 'badges' | 'body' | 'vendor' | 'title' | 'link' | 'price' | 'rating' | 'stockLine' | 'swatches' | 'swatch' | 'swatchOverflow' | 'quickAdd' | 'skeleton';
|
|
69
69
|
export interface ProductCardProps {
|
|
70
70
|
/** The product. See `ProductCardProduct`. */
|
|
71
71
|
product: ProductCardProduct;
|
|
@@ -118,6 +118,7 @@ export interface ProductCardProps {
|
|
|
118
118
|
* see this package's README "as vs linkAs" note.
|
|
119
119
|
*/
|
|
120
120
|
linkAs?: string | Component;
|
|
121
|
-
/** Per-part
|
|
121
|
+
/** Per-part classes, appended to the kit's own (they win by cascade layer). The root is styled
|
|
122
|
+
* with `class`. */
|
|
122
123
|
classes?: Partial<Record<ProductCardPart, string>>;
|
|
123
124
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { QuantityStepperProps, QuantityStepperSize } from './types.js';
|
|
2
2
|
declare const __VLS_export: import('vue').DefineComponent<QuantityStepperProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
-
blur: (event: FocusEvent) => any;
|
|
4
3
|
"update:modelValue": (value: number) => any;
|
|
4
|
+
blur: (event: FocusEvent) => any;
|
|
5
5
|
focus: (event: FocusEvent) => any;
|
|
6
6
|
change: (value: number) => any;
|
|
7
7
|
}, string, import('vue').PublicProps, Readonly<QuantityStepperProps> & Readonly<{
|
|
8
|
-
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
9
8
|
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
9
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
10
10
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
11
11
|
onChange?: ((value: number) => any) | undefined;
|
|
12
12
|
}>, {
|
|
13
|
-
size: QuantityStepperSize;
|
|
14
13
|
name: string;
|
|
15
|
-
|
|
14
|
+
size: QuantityStepperSize;
|
|
16
15
|
modelValue: number;
|
|
16
|
+
classes: Partial<Record<import('./types.js').QuantityStepperPart, string>>;
|
|
17
17
|
error: string;
|
|
18
18
|
max: number;
|
|
19
19
|
id: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** The parts a consumer can restyle through `classes`, named as this package's own contract names
|
|
2
2
|
* them (spec "Quantity stepper" → Anatomy draws the same four controls plus the error row every
|
|
3
3
|
* other field in this package shows the same way). */
|
|
4
|
-
export type QuantityStepperPart = '
|
|
4
|
+
export type QuantityStepperPart = 'decrease' | 'input' | 'increase' | 'error';
|
|
5
5
|
/** The spec's two sizes (spec "Quantity stepper" → Sizes): the default and the cart-line/filter
|
|
6
6
|
* compact one. */
|
|
7
7
|
export type QuantityStepperSize = 'md' | 'sm';
|
|
@@ -30,6 +30,9 @@ export interface QuantityStepperProps {
|
|
|
30
30
|
* whatever `provideEldraUiLocale` set for the app, and to `"en-US"` with nothing provided.
|
|
31
31
|
*/
|
|
32
32
|
locale?: string;
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Per-part classes, appended to the part's own (they win by cascade layer). Style the root with
|
|
35
|
+
* `class`.
|
|
36
|
+
*/
|
|
34
37
|
classes?: Partial<Record<QuantityStepperPart, string>>;
|
|
35
38
|
}
|
|
@@ -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
|
+
name: string;
|
|
18
|
+
label: string;
|
|
19
|
+
size: import('./types.js').RadioGroupSize;
|
|
20
|
+
modelValue: RadioValue;
|
|
21
|
+
classes: Partial<Record<import('./types.js').RadioPart, string>>;
|
|
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
|
+
};
|
|
@@ -22,12 +22,16 @@ declare const __VLS_base: import('vue').DefineComponent<RadioGroupProps, {}, {},
|
|
|
22
22
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
23
23
|
onChange?: ((value: string) => any) | undefined;
|
|
24
24
|
}>, {
|
|
25
|
-
|
|
25
|
+
help: string;
|
|
26
26
|
name: string;
|
|
27
|
-
|
|
27
|
+
legend: string;
|
|
28
|
+
size: RadioGroupSize;
|
|
28
29
|
modelValue: string;
|
|
30
|
+
classes: Partial<Record<import('./types.js').RadioGroupPart, 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,41 @@
|
|
|
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 = "eldra:group eldra:grid eldra:w-fit eldra:max-w-full eldra:items-start eldra:gap-y-0.5 eldra:target-min";
|
|
13
|
+
/** The radio and its text column. */
|
|
14
|
+
export declare const PLAIN_COLUMNS = "eldra:grid-cols-[auto_1fr] eldra:gap-x-2.5";
|
|
15
|
+
/** A radio with no label and no hint: the circle alone. */
|
|
16
|
+
export declare const PLAIN_BOX_ONLY = "eldra:grid-cols-[auto] eldra:gap-x-0";
|
|
17
|
+
/** The cursor a row (or card) shows: the whole option is the label, so it is the target. */
|
|
18
|
+
export declare function optionCursor(disabled: boolean | undefined): string;
|
|
19
|
+
export interface RadioState {
|
|
20
|
+
selected: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
invalid?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** The drawn circle, before `classes.radio` is appended. */
|
|
25
|
+
export declare function radioRecipe(size: RadioGroupSize, state: RadioState): string[];
|
|
26
|
+
/**
|
|
27
|
+
* The dot (spec "Radio group" → Sizes: "0.5rem dot"). One fixed size regardless of `size`, the
|
|
28
|
+
* same choice `Checkbox` makes for its tick — only the circle around it grows. No `data-part` of
|
|
29
|
+
* its own: the API contract's part list has no entry for it, unlike `Checkbox`'s `check`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function dotRecipe(selected: boolean): string[];
|
|
32
|
+
/** The native radio: invisible but hit-testable, stretched over the drawn circle. */
|
|
33
|
+
export declare const INPUT = "eldra:absolute eldra:inset-0 eldra:m-0 eldra:size-full eldra:cursor-pointer eldra:appearance-none eldra:opacity-0 eldra:disabled:cursor-not-allowed";
|
|
34
|
+
/**
|
|
35
|
+
* Spec "Radio group" → Sizes: "Plain row … 0.9375rem / 1.5rem text" for plain layouts, "Card title
|
|
36
|
+
* … 1rem 600 (line-height 1.4)" for cards — the same two type utilities `Checkbox`'s label and the
|
|
37
|
+
* `text-card-title` utility (see `tailwind.css`) already give those numbers.
|
|
38
|
+
*/
|
|
39
|
+
export declare function labelRecipe(card: boolean, disabled: boolean | undefined): string[];
|
|
40
|
+
/** Spec "Radio group" → Sizes: the hint is `muted` in every layout, under the label's column. */
|
|
41
|
+
export declare const HINT = "eldra:text-body-sm eldra:text-muted eldra:col-start-2 eldra: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 = '
|
|
2
|
+
export type RadioGroupPart = '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,60 @@ 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;
|
|
37
|
-
/**
|
|
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;
|
|
70
|
+
/**
|
|
71
|
+
* Per-part classes, appended to the part's own (a consumer class wins by cascade layer). The
|
|
72
|
+
* root (the `<fieldset>`) is styled with `class`.
|
|
73
|
+
*/
|
|
38
74
|
classes?: Partial<Record<RadioGroupPart, string>>;
|
|
39
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* The parts of a standalone `Radio`: the same names as one `RadioGroup` option's parts. The root
|
|
78
|
+
* `<label>` (the `option` part) is styled with `class`.
|
|
79
|
+
*/
|
|
80
|
+
export type RadioPart = 'radio' | 'input' | 'dot' | 'label' | 'hint';
|
|
81
|
+
/** The values a standalone `Radio` and its group's model hold. */
|
|
82
|
+
export type RadioValue = string | number;
|
|
83
|
+
export interface RadioProps {
|
|
84
|
+
/**
|
|
85
|
+
* The value the radios sharing this `name` currently hold (two-way) — the *group's* value, not
|
|
86
|
+
* this radio's. This radio is checked when it equals `value`. Always bind it: a standalone radio
|
|
87
|
+
* cannot see its siblings, so it keeps no state of its own; `undefined` means nothing is chosen.
|
|
88
|
+
*/
|
|
89
|
+
modelValue?: RadioValue;
|
|
90
|
+
/** This radio's own value: posted when it is checked, and emitted when it is chosen. */
|
|
91
|
+
value: RadioValue;
|
|
92
|
+
/** The native `name` this radio shares with its siblings, wherever they are rendered. */
|
|
93
|
+
name?: string;
|
|
94
|
+
/** The label text. The default slot overrides it. */
|
|
95
|
+
label?: string;
|
|
96
|
+
/** A secondary line under the label. The `hint` slot overrides it. */
|
|
97
|
+
hint?: string;
|
|
98
|
+
/** Radio 1.125rem (`md`, the default) or 1.5rem (`lg`). */
|
|
99
|
+
size?: RadioGroupSize;
|
|
100
|
+
/** Native `disabled`. */
|
|
101
|
+
disabled?: boolean;
|
|
102
|
+
/** Draws the error state and sets `aria-invalid="true"`. */
|
|
103
|
+
invalid?: boolean;
|
|
104
|
+
/** Per-part classes, appended to the part's own (a consumer class wins by cascade layer). */
|
|
105
|
+
classes?: Partial<Record<RadioPart, string>>;
|
|
106
|
+
}
|
|
@@ -23,8 +23,8 @@ declare const __VLS_base: import('vue').DefineComponent<RangeSliderProps, {}, {}
|
|
|
23
23
|
onChange?: ((value: RangeSliderValue) => any) | undefined;
|
|
24
24
|
}>, {
|
|
25
25
|
label: string;
|
|
26
|
-
classes: Partial<Record<import('./types.js').RangeSliderPart, string>>;
|
|
27
26
|
modelValue: RangeSliderValue;
|
|
27
|
+
classes: Partial<Record<import('./types.js').RangeSliderPart, string>>;
|
|
28
28
|
max: number;
|
|
29
29
|
step: number;
|
|
30
30
|
disabled: boolean;
|
|
@@ -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;
|
|
@@ -5,7 +5,7 @@ import { UiMessages } from '../../messages/en-US.js';
|
|
|
5
5
|
* one class string styles the pair, and each element carries a `data-thumb` / `data-input`
|
|
6
6
|
* attribute of `"min"` or `"max"` for the rare rule that has to tell them apart.
|
|
7
7
|
*/
|
|
8
|
-
export type RangeSliderPart = '
|
|
8
|
+
export type RangeSliderPart = 'label' | 'group' | 'rail' | 'track' | 'range' | 'thumb' | 'inputs' | 'input' | 'separator';
|
|
9
9
|
/** Which end of the range a value, a thumb or a field belongs to. */
|
|
10
10
|
export type RangeSliderThumb = 'min' | 'max';
|
|
11
11
|
/**
|
|
@@ -144,7 +144,10 @@ export interface RangeSliderProps {
|
|
|
144
144
|
* nothing left to render at all, which is this prop's business to allow, not to guard against.
|
|
145
145
|
*/
|
|
146
146
|
trackVisible?: boolean;
|
|
147
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* Per-part classes, appended to the part's own (a consumer class wins by cascade layer). The
|
|
149
|
+
* root is styled with `class`.
|
|
150
|
+
*/
|
|
148
151
|
classes?: Partial<Record<RangeSliderPart, string>>;
|
|
149
152
|
/** Overrides for the strings this component renders itself (the thumb names, the word "to"). */
|
|
150
153
|
messages?: Partial<UiMessages>;
|
|
@@ -7,8 +7,8 @@ declare const __VLS_template: () => {
|
|
|
7
7
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
8
8
|
declare const __VLS_base: import('vue').DefineComponent<RatingProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<RatingProps> & Readonly<{}>, {
|
|
9
9
|
size: import('./types.js').RatingSize;
|
|
10
|
-
classes: Partial<Record<import('./types.js').RatingPart, string>>;
|
|
11
10
|
href: string | null;
|
|
11
|
+
classes: Partial<Record<import('./types.js').RatingPart, string>>;
|
|
12
12
|
as: string | import('vue').Component;
|
|
13
13
|
count: number;
|
|
14
14
|
showValue: boolean;
|
|
@@ -8,7 +8,7 @@ export type RatingSize = 'md' | 'lg';
|
|
|
8
8
|
* `link` (the anchor the linked variant wraps its content in — see `Rating.vue`'s own comment on
|
|
9
9
|
* why that is a second element rather than the root itself changing tag).
|
|
10
10
|
*/
|
|
11
|
-
export type RatingPart = '
|
|
11
|
+
export type RatingPart = 'stars' | 'star' | 'value' | 'count' | 'empty' | 'link';
|
|
12
12
|
export interface RatingProps {
|
|
13
13
|
/**
|
|
14
14
|
* Average rating, 0–5. Rounded to the nearest half star for both the stars and the visible
|
|
@@ -40,6 +40,7 @@ export interface RatingProps {
|
|
|
40
40
|
* receives the destination as `to` instead of `href` — the same contract as `Link`'s `as`.
|
|
41
41
|
*/
|
|
42
42
|
as?: string | Component;
|
|
43
|
-
/** Per-part
|
|
43
|
+
/** Per-part classes, appended to the kit's own (they win by cascade layer). The root is styled
|
|
44
|
+
* with `class`. */
|
|
44
45
|
classes?: Partial<Record<RatingPart, string>>;
|
|
45
46
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SearchBarProps, SearchBarSize, SearchResultItem, SearchResultType, SearchSelectType } from './types.js';
|
|
2
2
|
declare const __VLS_template: () => {
|
|
3
3
|
__VLS_Slots: {
|
|
4
4
|
item?: (props: {
|
|
@@ -21,10 +21,10 @@ declare const __VLS_base: import('vue').DefineComponent<SearchBarProps, {}, {},
|
|
|
21
21
|
onClearRecent?: (() => any) | undefined;
|
|
22
22
|
onSubmit?: ((query: string) => any) | undefined;
|
|
23
23
|
}>, {
|
|
24
|
-
size: SearchBarSize;
|
|
25
24
|
label: string;
|
|
26
|
-
|
|
25
|
+
size: SearchBarSize;
|
|
27
26
|
modelValue: string;
|
|
27
|
+
classes: Partial<Record<import('./types.js').SearchBarPart, string>>;
|
|
28
28
|
placeholder: string;
|
|
29
29
|
results: import('./types.js').SearchResults;
|
|
30
30
|
loading: boolean;
|
|
@@ -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;
|
|
@@ -78,8 +78,8 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
|
78
78
|
onSelect?: ((row: SearchRow, event: MouseEvent) => any) | undefined;
|
|
79
79
|
onActivate?: ((value: string) => any) | undefined;
|
|
80
80
|
}>, {
|
|
81
|
-
classes: Partial<Record<SearchBarPart, string>>;
|
|
82
81
|
flat: boolean;
|
|
82
|
+
classes: Partial<Record<SearchBarPart, string>>;
|
|
83
83
|
placement: string;
|
|
84
84
|
activeValue: string;
|
|
85
85
|
panelStyle: Record<string, string>;
|
|
@@ -45,7 +45,7 @@ export type SearchSelectType = SearchResultType | 'viewAll';
|
|
|
45
45
|
* `clearRecent` (the idle view's "Clear recent searches" row) and `liveRegion` (anatomy item 11).
|
|
46
46
|
* `itemArrow` is the Sizes table's "Active arrow".
|
|
47
47
|
*/
|
|
48
|
-
export type SearchBarPart = '
|
|
48
|
+
export type SearchBarPart = 'form' | 'field' | 'leadingIcon' | 'clearButton' | 'busy' | 'shortcutHint' | 'panel' | 'listbox' | 'section' | 'sectionHeading' | 'item' | 'itemImage' | 'itemTitle' | 'itemMeta' | 'itemArrow' | 'recent' | 'clearRecent' | 'popular' | 'chip' | 'viewAll' | 'loading' | 'empty' | 'liveRegion';
|
|
49
49
|
/** The spec's two search-bar sizes: 2.5rem in a header or toolbar, 3rem on the Search page. */
|
|
50
50
|
export type SearchBarSize = 'md' | 'lg';
|
|
51
51
|
export interface SearchBarProps {
|
|
@@ -89,7 +89,10 @@ export interface SearchBarProps {
|
|
|
89
89
|
teleport?: boolean | string;
|
|
90
90
|
/** Message overrides for this control alone. */
|
|
91
91
|
messages?: Partial<UiMessages>;
|
|
92
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* Per-part classes, appended to the part's own (they win by cascade layer). Style the root with
|
|
94
|
+
* `class`.
|
|
95
|
+
*/
|
|
93
96
|
classes?: Partial<Record<SearchBarPart, string>>;
|
|
94
97
|
}
|
|
95
98
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SearchModalProps, SearchResultItem, SearchResultType, SearchSelectType } from './types.js';
|
|
2
2
|
declare const __VLS_template: () => {
|
|
3
3
|
__VLS_Slots: {
|
|
4
4
|
item?: (props: {
|
|
@@ -30,8 +30,8 @@ declare const __VLS_base: import('vue').DefineComponent<SearchModalProps, {
|
|
|
30
30
|
onSubmit?: ((query: string) => any) | undefined;
|
|
31
31
|
"onUpdate:query"?: ((value: string) => any) | undefined;
|
|
32
32
|
}>, {
|
|
33
|
-
classes: Partial<Record<SearchModalPart, string>>;
|
|
34
33
|
modelValue: boolean;
|
|
34
|
+
classes: Partial<Record<import('./types.js').SearchModalPart, string>>;
|
|
35
35
|
placeholder: string;
|
|
36
36
|
results: import('./types.js').SearchResults;
|
|
37
37
|
loading: boolean;
|
|
@@ -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;
|
|
@@ -3,7 +3,8 @@ import { SearchBarPart, SearchResultItem, SearchResultType, SearchResults, Searc
|
|
|
3
3
|
export type { SearchResultItem, SearchResultType, SearchResults, SearchRow, SearchSection, SearchSelectType, };
|
|
4
4
|
/**
|
|
5
5
|
* The parts a consumer can restyle through `classes`. The seven the modal's own frame draws
|
|
6
|
-
* (`
|
|
6
|
+
* (`form`, `field`, `leadingIcon`, `clear`, `close`, `results`, `footer`; the root takes `class`),
|
|
7
|
+
* plus every part
|
|
7
8
|
* of the reused `SearchResultsPanel` (`panel`, `listbox`, `section`, … `liveRegion`) — `classes` is
|
|
8
9
|
* forwarded straight into that child, so a consumer restyles the frame and the rows through one
|
|
9
10
|
* prop, the rows named exactly as `SearchBar`'s own anatomy already names them (controller decision:
|
|
@@ -14,7 +15,7 @@ export type { SearchResultItem, SearchResultType, SearchResults, SearchRow, Sear
|
|
|
14
15
|
* is the exact same element `SearchBar`'s popup uses, just drawn `flat` (see `SearchResultsPanel`'s
|
|
15
16
|
* own `flat` prop).
|
|
16
17
|
*/
|
|
17
|
-
export type SearchModalPart = '
|
|
18
|
+
export type SearchModalPart = 'form' | 'field' | 'leadingIcon' | 'clear' | 'close' | 'results' | 'footer' | SearchBarPart;
|
|
18
19
|
export interface SearchModalProps {
|
|
19
20
|
/** Shows the modal with `showModal()` when `true`, closes it when `false` (two-way). */
|
|
20
21
|
modelValue?: boolean;
|
|
@@ -53,7 +54,9 @@ export interface SearchModalProps {
|
|
|
53
54
|
shortcut?: boolean;
|
|
54
55
|
/** Message overrides for this control alone. */
|
|
55
56
|
messages?: Partial<UiMessages>;
|
|
56
|
-
/**
|
|
57
|
-
*
|
|
57
|
+
/**
|
|
58
|
+
* Per-part classes, appended to the part's own (they win by cascade layer). Style the root with
|
|
59
|
+
* `class`. Forwarded to the reused `SearchResultsPanel` for every part that is its own.
|
|
60
|
+
*/
|
|
58
61
|
classes?: Partial<Record<SearchModalPart, string>>;
|
|
59
62
|
}
|
|
@@ -7,7 +7,6 @@ declare const __VLS_template: () => {
|
|
|
7
7
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
8
8
|
declare const __VLS_base: import('vue').DefineComponent<SectionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SectionProps> & Readonly<{}>, {
|
|
9
9
|
spacing: SectionSpacing;
|
|
10
|
-
classes: Partial<Record<"root", string>>;
|
|
11
10
|
as: string;
|
|
12
11
|
ariaLabel: string | null;
|
|
13
12
|
background: SectionBackground;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
export type SectionBackground = 'none' | 'surface' | 'surface-strong' | 'primary' | 'accent';
|
|
3
3
|
/** Vertical padding steps (spec "Container and section" → Sizes, Section spacing table). */
|
|
4
4
|
export type SectionSpacing = 'none' | 'sm' | 'md' | 'lg';
|
|
5
|
-
/** The parts a consumer can restyle through `classes`. Section has only the one. */
|
|
6
|
-
export type SectionPart = 'root';
|
|
7
5
|
export interface SectionProps {
|
|
8
6
|
/** Section ground. Defaults to `none`. */
|
|
9
7
|
background?: SectionBackground;
|
|
@@ -23,8 +21,6 @@ export interface SectionProps {
|
|
|
23
21
|
* package — see the README's "`ariaLabel` is always an accessible name" rule).
|
|
24
22
|
*/
|
|
25
23
|
ariaLabel?: string | null;
|
|
26
|
-
/** Per-part class overrides, merged with `tailwind-merge`. */
|
|
27
|
-
classes?: Partial<Record<SectionPart, string>>;
|
|
28
24
|
/**
|
|
29
25
|
* Render as a different tag instead of the automatic `<section>`/`<div>` choice — a `<header>` for
|
|
30
26
|
* the site header, a `<footer>` for the site footer, both already unique landmarks that need no
|